:root {
    --primary: #f5c400;
    --primary-hover: #ffd633;
    --secondary: #8a8f98;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f5c400;

    --bg-dark: #050505;
    --bg-light: #0b0b0b;
    --bg-card: #141414;
    --bg-card-hover: #1c1c1c;

    --border: #2a2a2a;

    --text-primary: #f5f5f5;
    --text-secondary: #a7a7a7;

    --yellow-soft: rgba(245, 196, 0, 0.12);
    --yellow-border: rgba(245, 196, 0, 0.35);

    --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.6;
}

/* =============================================================================
   PÁGINA DE LOGIN
   ============================================================================= */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 32px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-secondary);
}

.form-group input {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: var(--border);
    cursor: not-allowed;
    transform: none;
}

.erro-mensagem {
    background: #fef0ee;
    color: var(--danger);
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    border-left: 3px solid var(--danger);
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.login-footer p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* =============================================================================
   DASHBOARD
   ============================================================================= */
.dashboard-container {
    display: grid;
    grid-template-columns: 280px 380px 1fr;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    font-size: 20px;
    margin-bottom: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
    padding: 8px;
    background: var(--bg-light);
    border-radius: 6px;
}

.user-info span {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.btn-secondary-small {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary-small:hover {
    background: var(--bg-light);
    border-color: var(--secondary);
    color: var(--text-primary);
}

.sidebar-stats {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-card {
    background: var(--bg-light);
    padding: 16px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.sidebar-filters {
    padding: 0 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-btn {
    background: transparent;
    border: none;
    padding: 10px 12px;
    text-align: left;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.filter-btn:hover {
    background: var(--bg-light);
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    font-weight: 500;
}

/* Lista de Conversas */
.conversas-list {
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.conversas-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.conversas-header h3 {
    font-size: 18px;
    margin-bottom: 12px;
}

.search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
}

.conversas-items {
    flex: 1;
    overflow-y: auto;
}

.conversa-item {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
}

.conversa-item:hover {
    background: var(--bg-light);
}

.conversa-item.active {
    background: #e8f0fe;
    border-left: 3px solid var(--primary);
}

.conversa-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
}

.conversa-info {
    min-width: 0;
}

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

.conversa-nome {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversa-hora {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.conversa-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.conversa-ultima-msg {
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.conversa-badge {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.conversa-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 4px;
}

.conversa-status.aguardando {
    background: var(--warning);
}

.conversa-status.em_atendimento {
    background: var(--success);
}

.conversa-status.finalizada {
    background: var(--secondary);
}

/* Chat */
.chat-container {
    background: var(--bg-light);
    display: flex;
    flex-direction: column;
    position: relative;
}

.chat-vazio {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.chat-vazio-content {
    text-align: center;
    color: var(--text-secondary);
}

.chat-vazio-content svg {
    opacity: 0.3;
    margin-bottom: 20px;
}

.chat-vazio-content h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.chat-ativo {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.chat-header-text h3 {
    font-size: 16px;
    margin-bottom: 2px;
}

.chat-telefone {
    font-size: 13px;
    color: var(--text-secondary);
}

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

.status-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}

.chat-mensagens {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mensagem {
    display: flex;
    max-width: 70%;
}

.mensagem.cliente {
    align-self: flex-start;
}

.mensagem.atendente {
    align-self: flex-end;
}

.mensagem-conteudo {
    background: var(--bg-card);
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.mensagem.atendente .mensagem-conteudo {
    background: var(--primary);
    color: white;
}

.mensagem-texto {
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.mensagem-hora {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
    display: block;
}

.chat-input-container {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 16px 24px;
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

#chatInput {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 12px 16px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    overflow-y: auto;
}

#chatInput:focus {
    outline: none;
    border-color: var(--primary);
}

.btn-enviar {
    background: var(--primary);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-enviar:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.btn-enviar:active {
    transform: scale(0.95);
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

/* Responsivo */
@media (max-width: 1200px) {
    .dashboard-container {
        grid-template-columns: 80px 320px 1fr;
    }
    
    .sidebar-header h2,
    .sidebar-stats,
    .sidebar-filters {
        display: none;
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        grid-template-columns: 1fr;
    }
    
    .sidebar,
    .conversas-list {
        display: none;
    }
}
/* =============================================================================
   TEMA AVSEG - PRETO E AMARELO
   Colar no FINAL do style.css
   ============================================================================= */

body {
    background: var(--bg-light);
    color: var(--text-primary);
}

/* Login */
.login-page {
    background:
        radial-gradient(circle at top left, rgba(245, 196, 0, 0.18), transparent 30%),
        radial-gradient(circle at bottom right, rgba(245, 196, 0, 0.10), transparent 28%),
        linear-gradient(135deg, #030303 0%, #0b0b0b 55%, #1a1600 100%);
}

.login-card {
    background: rgba(20, 20, 20, 0.96);
    border: 1px solid var(--yellow-border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65);
}

.login-header h1 {
    color: var(--primary);
}

.login-header p,
.login-footer p {
    color: var(--text-secondary);
}

.login-footer {
    border-top-color: var(--border);
}

/* Inputs */
.form-group input,
.search-input,
.status-select,
#chatInput {
    background: #0f0f0f;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.form-group input::placeholder,
.search-input::placeholder,
#chatInput::placeholder {
    color: #777;
}

.form-group input:focus,
.search-input:focus,
.status-select:focus,
#chatInput:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(245, 196, 0, 0.12);
}

/* Botões */
.btn-primary,
.btn-enviar {
    background: var(--primary);
    color: #050505;
}

.btn-primary:hover,
.btn-enviar:hover {
    background: var(--primary-hover);
}

.btn-primary:disabled {
    background: #3a3a3a;
    color: #888;
}

.btn-secondary-small {
    background: #0f0f0f;
    color: var(--text-secondary);
    border-color: var(--border);
}

.btn-secondary-small:hover {
    background: var(--yellow-soft);
    color: var(--primary);
    border-color: var(--yellow-border);
}

/* Erro */
.erro-mensagem {
    background: rgba(239, 68, 68, 0.12);
    color: #ff8a8a;
    border-left-color: var(--danger);
}

/* Estrutura principal */
.dashboard-container {
    background: var(--bg-light);
}

.sidebar,
.conversas-list,
.chat-header,
.chat-input-container {
    background: var(--bg-card);
    border-color: var(--border);
}

.sidebar-header,
.conversas-header {
    border-bottom-color: var(--border);
}

.sidebar-header h2 {
    color: var(--primary);
}

.user-info,
.stat-card {
    background: #0f0f0f;
    border: 1px solid var(--border);
}

.stat-number {
    color: var(--primary);
}

/* Filtros */
.filter-btn {
    color: var(--text-secondary);
}

.filter-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--primary);
    color: #050505;
    font-weight: 700;
}

/* Lista de conversas */
.conversa-item {
    border-bottom-color: var(--border);
}

.conversa-item:hover {
    background: var(--bg-card-hover);
}

.conversa-item.active {
    background: var(--yellow-soft);
    border-left: 3px solid var(--primary);
}

.conversa-avatar,
.avatar {
    background: var(--primary);
    color: #050505;
}

.conversa-nome,
.chat-header-text h3,
.chat-vazio-content h3 {
    color: var(--text-primary);
}

.conversa-ultima-msg,
.conversa-hora,
.chat-telefone,
.loading,
.chat-vazio-content {
    color: var(--text-secondary);
}

.conversa-badge {
    background: var(--primary);
    color: #050505;
}

/* Chat */
.chat-container {
    background:
        radial-gradient(circle at top right, rgba(245, 196, 0, 0.08), transparent 28%),
        #090909;
}

.chat-vazio-content svg {
    color: var(--primary);
    opacity: 0.35;
}

.chat-mensagens {
    background:
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 28px 28px;
}

.mensagem-conteudo {
    background: #1a1a1a;
    color: var(--text-primary);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.mensagem.atendente .mensagem-conteudo {
    background: var(--primary);
    color: #050505;
    border-color: var(--primary);
}

.mensagem-hora {
    opacity: 0.65;
}

.status-select {
    background: #0f0f0f;
    color: var(--text-primary);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0b0b0b;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}
/* =============================================================================
   MÍDIAS NAS MENSAGENS
   ============================================================================= */

.mensagem-midia {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mensagem-imagem {
    max-width: 280px;
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: 14px;
    display: block;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: transform 0.2s, opacity 0.2s;
}

.mensagem-imagem:hover {
    transform: scale(1.02);
    opacity: 0.95;
}

.mensagem-audio {
    width: 280px;
    max-width: 100%;
    display: block;
    filter: invert(1);
}

.mensagem-arquivo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: inherit;
    text-decoration: none;
    font-weight: 600;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.mensagem-arquivo:hover {
    border-color: var(--primary);
}

.legenda-midia {
    margin-top: 8px;
}

/* Ajuste para bolha com imagem */
.mensagem:has(.mensagem-imagem) .mensagem-conteudo,
.mensagem:has(.mensagem-audio) .mensagem-conteudo {
    padding: 10px;
}

/* Áudio enviado pelo atendente */
.mensagem.atendente .mensagem-audio {
    filter: none;
}

/* Responsivo para imagem/áudio */
@media (max-width: 768px) {
    .mensagem-imagem,
    .mensagem-audio {
        max-width: 220px;
        width: 220px;
    }
}
/* Corrige rolagem da área de mensagens */
.chat-container,
.chat-ativo {
    min-height: 0;
    overflow: hidden;
}

.chat-mensagens {
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 32px;
    scroll-behavior: smooth;
}

.chat-input-container {
    flex-shrink: 0;
}
/* =============================================================================
   MODAL DE IMAGEM AMPLIADA
   ============================================================================= */

.modal-imagem-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-imagem-card {
    position: relative;
    width: min(980px, 96vw);
    max-height: 92vh;
    background: #0f0f0f;
    border: 1px solid var(--yellow-border);
    border-radius: 18px;
    box-shadow: 0 24px 90px rgba(0, 0, 0, 0.8);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

#imagemAmpliada {
    max-width: 100%;
    max-height: 76vh;
    object-fit: contain;
    border-radius: 14px;
    background: #050505;
}

.modal-imagem-fechar {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--yellow-border);
    background: var(--primary);
    color: #050505;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    font-weight: 700;
    box-shadow: var(--shadow);
}

.modal-imagem-fechar:hover {
    background: var(--primary-hover);
    transform: scale(1.04);
}

.modal-imagem-actions {
    display: flex;
    justify-content: flex-end;
}

.btn-download-imagem {
    background: var(--primary);
    color: #050505;
    border: none;
    border-radius: 10px;
    padding: 11px 16px;
    font-weight: 700;
    cursor: pointer;
}

.btn-download-imagem:hover {
    background: var(--primary-hover);
}

body.modal-aberto {
    overflow: hidden;
}

.mensagem-imagem {
    cursor: zoom-in;
}
/* =============================================================================
   ARQUIVOS, VÍDEOS E DOCUMENTOS NAS MENSAGENS
   ============================================================================= */

.mensagem-video {
    width: 320px;
    max-width: 100%;
    max-height: 300px;
    border-radius: 14px;
    background: #050505;
    border: 1px solid var(--border);
    display: block;
}

.mensagem-arquivo-card {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 12px;
    min-width: 260px;
    max-width: 360px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.arquivo-icone {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--yellow-soft);
    border: 1px solid var(--yellow-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.arquivo-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.arquivo-info strong {
    color: var(--text-primary);
    font-size: 14px;
    word-break: break-word;
}

.arquivo-info span {
    color: var(--text-secondary);
    font-size: 12px;
    word-break: break-word;
}

.arquivo-acoes {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.arquivo-btn {
    flex: 1;
    text-align: center;
    text-decoration: none;
    background: #0f0f0f;
    color: var(--primary);
    border: 1px solid var(--yellow-border);
    padding: 8px 10px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
}

.arquivo-btn:hover {
    background: var(--primary);
    color: #050505;
}

.mensagem.atendente .mensagem-arquivo-card {
    background: rgba(0, 0, 0, 0.12);
    border-color: rgba(0, 0, 0, 0.18);
}

.mensagem.atendente .arquivo-info strong,
.mensagem.atendente .arquivo-info span {
    color: #050505;
}

.mensagem.atendente .arquivo-btn {
    background: rgba(0, 0, 0, 0.16);
    color: #050505;
    border-color: rgba(0, 0, 0, 0.18);
}

@media (max-width: 768px) {
    .mensagem-video,
    .mensagem-arquivo-card {
        width: 230px;
        max-width: 230px;
    }
}
/* =============================================================================
   MODAL DE ATENDENTES
   ============================================================================= */

.sidebar-admin {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.btn-admin {
    width: 100%;
    background: var(--yellow-soft);
    color: var(--primary);
    border: 1px solid var(--yellow-border);
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    text-align: left;
    transition: all 0.2s;
}

.btn-admin:hover {
    background: var(--primary);
    color: #050505;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-card {
    width: 100%;
    max-width: 760px;
    max-height: 88vh;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--yellow-border);
    border-radius: 18px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.75);
    padding: 24px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
}

.modal-header h3 {
    color: var(--primary);
    font-size: 22px;
}

.modal-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.btn-icon {
    background: #0f0f0f;
    color: var(--text-primary);
    border: 1px solid var(--border);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.btn-icon:hover {
    color: var(--primary);
    border-color: var(--yellow-border);
}

.form-atendente {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-atendente input,
.form-atendente select {
    background: #0f0f0f;
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
}

.form-atendente input:focus,
.form-atendente select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(245, 196, 0, 0.12);
}

.lista-atendentes-header {
    border-top: 1px solid var(--border);
    padding-top: 18px;
    margin-bottom: 12px;
}

.atendente-item {
    display: grid;
    grid-template-columns: 42px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    background: #0f0f0f;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 10px;
}

.atendente-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary);
    color: #050505;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.atendente-info h5 {
    font-size: 15px;
    color: var(--text-primary);
}

.atendente-info p {
    font-size: 13px;
    color: var(--text-secondary);
}

.atendente-role {
    font-size: 12px;
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--yellow-soft);
    color: var(--primary);
    border: 1px solid var(--yellow-border);
    text-transform: capitalize;
}

.atendente-role.admin {
    background: rgba(245, 196, 0, 0.18);
    color: var(--primary);
}

.atendente-role.atendente {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.35);
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-card {
        padding: 18px;
    }
}
/* =============================================================================
   EXCLUSÃO DE ATENDENTES
   ============================================================================= */

.atendente-acoes {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-excluir-atendente {
    background: rgba(239, 68, 68, 0.12);
    color: #ff8a8a;
    border: 1px solid rgba(239, 68, 68, 0.35);
    padding: 6px 9px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-excluir-atendente:hover {
    background: #ef4444;
    color: white;
}

@media (max-width: 768px) {
    .atendente-item {
        grid-template-columns: 42px 1fr;
    }

    .atendente-acoes {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}
/* =============================================================================
   CONTROLE DE CONVERSA / ATENDENTE RESPONSÁVEL
   ============================================================================= */

.chat-atendente-info {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 3px;
}

.chat-atendente-info.com-atendente {
    color: var(--primary);
    font-weight: 600;
}

.conversa-atendente {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-chat-action {
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-finalizar {
    background: rgba(239, 68, 68, 0.12);
    color: #ff8a8a;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.btn-finalizar:hover {
    background: #ef4444;
    color: white;
}

.btn-reabrir {
    background: var(--yellow-soft);
    color: var(--primary);
    border: 1px solid var(--yellow-border);
}

.btn-reabrir:hover {
    background: var(--primary);
    color: #050505;
}

#chatInput:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#btnEnviar:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 768px) {
    .chat-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .chat-header-actions {
        width: 100%;
    }

    .chat-header-actions button,
    .chat-header-actions select {
        flex: 1;
    }
}


/* =============================================================================
   ENVIO DE ARQUIVOS PELO ATENDENTE
   ============================================================================= */

.btn-input-action {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: #0f0f0f;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    transition: all 0.2s;
}

.btn-input-action:hover {
    background: var(--yellow-soft);
    border-color: var(--yellow-border);
    transform: translateY(-1px);
}

.btn-input-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.anexo-preview {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 12px 24px 0;
}

.anexo-preview-card {
    max-width: 520px;
    display: grid;
    grid-template-columns: 54px 1fr 34px;
    align-items: center;
    gap: 12px;
    background: #0f0f0f;
    border: 1px solid var(--yellow-border);
    border-radius: 14px;
    padding: 10px;
}

.anexo-preview-img {
    width: 54px;
    height: 54px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.anexo-preview-icone {
    width: 54px;
    height: 54px;
    border-radius: 10px;
    background: var(--yellow-soft);
    border: 1px solid var(--yellow-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}

.anexo-preview-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.anexo-preview-info strong {
    color: var(--text-primary);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.anexo-preview-info span {
    color: var(--text-secondary);
    font-size: 12px;
}

.anexo-preview-remover {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.12);
    color: #ff8a8a;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.anexo-preview-remover:hover {
    background: #ef4444;
    color: white;
}

/* =============================================================================
   RESPOSTAS RÁPIDAS / TEMPLATES
   ============================================================================= */

.templates-rapidos {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 86px;
    max-height: 320px;
    overflow-y: auto;
    z-index: 80;
    background: #0f0f0f;
    border: 1px solid var(--yellow-border);
    border-radius: 16px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.65);
    padding: 10px;
}

.template-item {
    width: 100%;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 12px;
    transition: all 0.2s;
    display: block;
}

.template-item:hover {
    background: var(--yellow-soft);
    border-color: var(--yellow-border);
}

.template-topo {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 4px;
}

.template-topo strong {
    font-size: 13px;
    color: var(--primary);
}

.template-topo span {
    font-size: 12px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    padding: 2px 7px;
    border-radius: 999px;
}

.template-item p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.35;
}

.template-vazio {
    color: var(--text-secondary);
    padding: 16px;
    text-align: center;
}

@media (max-width: 768px) {
    .templates-rapidos {
        left: 12px;
        right: 12px;
        bottom: 80px;
    }

    .chat-input-container {
        gap: 8px;
        padding: 12px;
    }

    .btn-input-action {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
}


/* =============================================================================
   TRANSFERÊNCIA DE CONVERSA
   ============================================================================= */

.btn-transferir {
    background: rgba(59, 130, 246, 0.12);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.35);
}

.btn-transferir:hover {
    background: #3b82f6;
    color: white;
}

.modal-transferir-card {
    max-width: 640px;
}

.lista-transferir-atendentes {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.transferir-atendente-item {
    width: 100%;
    display: grid;
    grid-template-columns: 42px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    background: #0f0f0f;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.transferir-atendente-item:hover {
    border-color: var(--yellow-border);
    background: var(--yellow-soft);
    transform: translateY(-1px);
}

.transferir-atendente-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.transferir-atendente-info strong {
    font-size: 14px;
    color: var(--text-primary);
}

.transferir-atendente-info span {
    font-size: 12px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transferir-atendente-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
}

.transferir-atendente-meta small {
    color: var(--primary);
    font-size: 11px;
}

.mensagem.sistema {
    align-self: center;
    max-width: 90%;
}

.mensagem.sistema .mensagem-conteudo {
    background: rgba(245, 196, 0, 0.10);
    color: var(--primary);
    border: 1px dashed var(--yellow-border);
    box-shadow: none;
    text-align: center;
    padding: 8px 12px;
}

.mensagem-sistema-texto {
    font-size: 12px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .transferir-atendente-item {
        grid-template-columns: 42px 1fr;
    }

    .transferir-atendente-meta {
        grid-column: 1 / -1;
        align-items: flex-start;
        flex-direction: row;
    }
}
/* Logo da marca */
.brand-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: var(--primary);
}

.brand-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.login-brand {
    justify-content: center;
    font-size: 34px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 20px;
}

.login-brand .brand-logo {
    width: 72px;
    height: 72px;
}

.sidebar-header .brand-logo {
    width: 56px;
    height: 56px;
}
.login-header h1 {
    font-size: 34px;
    letter-spacing: -0.5px;
}
.login-brand-vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--primary);
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 20px;
}

.login-logo-grande {
    width: 96px;
    height: 96px;
    object-fit: contain;
}
.sidebar-header {
    padding: 22px 24px;
}

.sidebar-header .brand-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header .brand-logo {
    width: 46px;
    height: 46px;
    object-fit: contain;
}

.sidebar-header .brand-title span {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.sidebar {
    background: linear-gradient(180deg, #101010 0%, #0b0b0b 100%);
    border-right: 1px solid rgba(245, 196, 0, 0.16);
}

.user-info {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(245, 196, 0, 0.14);
    border-radius: 14px;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-logout:hover {
    border-color: var(--yellow-border);
    color: var(--primary);
}
.stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 20px 24px;
}

.stat-card {
    min-height: auto;
    padding: 18px 20px;
    border-radius: 16px;
    background: linear-gradient(145deg, #111111, #0c0c0c);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-number {
    font-size: 34px;
    line-height: 1;
}

.stat-label {
    margin-top: 8px;
    font-size: 14px;
}
.filter-btn {
    border-radius: 12px;
    margin-bottom: 6px;
    padding: 13px 16px;
    font-weight: 600;
    transition: 0.2s ease;
}

.filter-btn:hover {
    background: rgba(245, 196, 0, 0.08);
    color: var(--primary);
}

.filter-btn.active {
    background: linear-gradient(135deg, #f5c400, #ffd84a);
    color: #050505;
    box-shadow: 0 8px 20px rgba(245, 196, 0, 0.18);
}
.conversas-list {
    background: #121212;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.conversas-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.conversas-header h2 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.search-input {
    height: 48px;
    border-radius: 12px;
    background: #0c0c0c;
}

.conversa-item {
    padding: 18px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: 0.2s ease;
}

.conversa-item:hover {
    background: rgba(245, 196, 0, 0.055);
}

.conversa-item.active {
    background: linear-gradient(90deg, rgba(245, 196, 0, 0.16), rgba(245, 196, 0, 0.04));
    border-left: 4px solid var(--primary);
}

.conversa-avatar {
    width: 54px;
    height: 54px;
    font-size: 22px;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(245, 196, 0, 0.18);
}.chat-vazio-content {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(245, 196, 0, 0.12);
    border-radius: 24px;
    padding: 46px 56px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

.chat-vazio-content svg {
    width: 96px;
    height: 96px;
    color: var(--primary);
    opacity: 0.32;
    margin-bottom: 24px;
}

.chat-vazio-content h3 {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 10px;
}

.chat-vazio-content p {
    font-size: 16px;
    color: var(--text-secondary);
}.sidebar {
    overflow-y: auto;
    scrollbar-width: thin;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(245, 196, 0, 0.24);
    border-radius: 999px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.dashboard-container {
    grid-template-columns: 320px 480px 1fr;
}
/* =============================================================================
   RESPONSIVO MOBILE - ATENDENTES NO CELULAR
   ============================================================================= */

@media (max-width: 900px) {
    body {
        overflow: hidden;
    }

    .dashboard-container {
        display: flex;
        width: 100vw;
        height: 100vh;
        overflow: hidden;
    }

    .sidebar {
        display: none;
    }

    .conversas-list {
        width: 100vw;
        min-width: 100vw;
        height: 100vh;
        border-right: none;
    }

    .chat-container {
        position: fixed;
        inset: 0;
        width: 100vw;
        height: 100vh;
        z-index: 50;
        background: var(--bg-light);
        transform: translateX(100%);
        transition: transform 0.25s ease;
    }

    body.chat-mobile-aberto .chat-container {
        transform: translateX(0);
    }

    .chat-header {
        min-height: 72px;
        padding: 12px 14px;
        gap: 10px;
    }

    .chat-header-info {
        min-width: 0;
        flex: 1;
    }

    .chat-header-text h3 {
        font-size: 17px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .chat-telefone,
    .chat-atendente-info {
        font-size: 12px;
    }

    .chat-actions {
        gap: 6px;
        justify-content: flex-end;
    }

    .chat-actions select,
    .chat-actions button {
        font-size: 12px;
        padding: 8px 9px;
        height: 38px;
    }

    .chat-mensagens {
        padding: 14px;
        padding-bottom: 20px;
    }

    .mensagem-conteudo {
        max-width: 86vw;
    }

    .mensagem-imagem {
        max-width: 78vw;
        max-height: 260px;
    }

    .mensagem-audio {
        width: 78vw;
    }

    .mensagem-video,
    .mensagem-arquivo-card {
        width: 78vw;
        max-width: 78vw;
    }

    .chat-input-container {
        padding: 10px;
        gap: 8px;
        border-top: 1px solid var(--border);
    }

    .chat-input-wrapper {
        min-height: 48px;
        border-radius: 14px;
    }

    #chatInput {
        font-size: 16px;
        min-height: 44px;
    }

    .btn-enviar,
    .btn-anexo,
    .btn-template {
        width: 44px;
        height: 44px;
        min-width: 44px;
        border-radius: 50%;
    }

    .templates-panel {
        left: 10px;
        right: 10px;
        bottom: 72px;
        width: auto;
        max-height: 280px;
    }

    .modal-card {
        width: 94vw;
        max-height: 88vh;
        padding: 18px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}
.btn-voltar-mobile {
    display: none;
}

@media (max-width: 900px) {
    .btn-voltar-mobile {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        border: 1px solid var(--border);
        background: #0f0f0f;
        color: var(--primary);
        font-size: 22px;
        font-weight: 800;
        cursor: pointer;
        flex-shrink: 0;
    }
}
.mobile-filters {
    display: none;
}

@media (max-width: 900px) {
    .mobile-filters {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-top: 12px;
        scrollbar-width: none;
    }

    .mobile-filters::-webkit-scrollbar {
        display: none;
    }

    .filter-btn-mobile {
        white-space: nowrap;
        border: 1px solid var(--border);
        background: #0f0f0f;
        color: var(--text-secondary);
        padding: 9px 12px;
        border-radius: 999px;
        font-size: 13px;
        cursor: pointer;
    }

    .filter-btn-mobile.active {
        background: var(--primary);
        color: #050505;
        border-color: var(--primary);
        font-weight: 800;
    }
}
/* =============================================================================
   CORREÇÕES FINAIS MOBILE - AVSEG CHAT
   Colocado no final para sobrescrever regras antigas conflitantes.
   ============================================================================= */

@media (max-width: 900px) {
    body {
        overflow: hidden;
    }

    .dashboard-container {
        display: flex !important;
        width: 100vw;
        height: 100vh;
        overflow: hidden;
    }

    .sidebar {
        display: none !important;
    }

    .conversas-list {
        display: flex !important;
        flex-direction: column;
        width: 100vw;
        min-width: 100vw;
        height: 100vh;
        border-right: none;
    }

    .chat-container {
        position: fixed;
        inset: 0;
        width: 100vw;
        height: 100vh;
        z-index: 50;
        background: var(--bg-light);
        transform: translateX(100%);
        transition: transform 0.25s ease;
    }

    body.chat-mobile-aberto .chat-container {
        transform: translateX(0);
    }

    .chat-header {
        min-height: 72px;
        padding: 12px 14px;
        gap: 10px;
    }

    .chat-header-info {
        min-width: 0;
        flex: 1;
    }

    .chat-header-text h3 {
        font-size: 17px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .chat-telefone,
    .chat-atendente-info {
        font-size: 12px;
    }

    .chat-header-actions {
        gap: 6px;
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    .chat-header-actions select,
    .chat-header-actions button {
        font-size: 12px;
        padding: 8px 9px;
        height: 38px;
    }

    .chat-mensagens {
        padding: 14px;
        padding-bottom: 20px;
    }

    .mensagem-conteudo {
        max-width: 86vw;
    }

    .mensagem-imagem {
        max-width: 78vw;
        max-height: 260px;
    }

    .mensagem-audio {
        width: 78vw;
    }

    .mensagem-video,
    .mensagem-arquivo-card {
        width: 78vw;
        max-width: 78vw;
    }

    .chat-input-container {
        padding: 10px;
        gap: 8px;
        border-top: 1px solid var(--border);
    }

    .chat-input-wrapper {
        min-height: 48px;
        border-radius: 14px;
    }

    #chatInput {
        font-size: 16px;
        min-height: 44px;
    }

    .btn-enviar,
    .btn-input-action {
        width: 44px;
        height: 44px;
        min-width: 44px;
        border-radius: 50%;
    }

    .templates-rapidos {
        left: 10px;
        right: 10px;
        bottom: 72px;
        width: auto;
        max-height: 280px;
    }

    .modal-card {
        width: 94vw;
        max-height: 88vh;
        padding: 18px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .mobile-filters {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding: 12px 14px 0;
        scrollbar-width: none;
    }

    .mobile-filters::-webkit-scrollbar {
        display: none;
    }

    .filter-btn-mobile {
        white-space: nowrap;
        border: 1px solid var(--border);
        background: #0f0f0f;
        color: var(--text-secondary);
        padding: 9px 12px;
        border-radius: 999px;
        font-size: 13px;
        cursor: pointer;
    }

    .filter-btn-mobile.active {
        background: var(--primary);
        color: #050505;
        border-color: var(--primary);
        font-weight: 800;
    }

    .btn-voltar-mobile {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        border: 1px solid var(--border);
        background: #0f0f0f;
        color: var(--primary);
        font-size: 22px;
        font-weight: 800;
        cursor: pointer;
        flex-shrink: 0;
    }
}

@media (min-width: 901px) {
    .btn-voltar-mobile,
    .mobile-filters {
        display: none !important;
    }
}
/* =============================================================================
   AJUSTE FINO MOBILE - CHAT AVSEG
   ============================================================================= */

@media (max-width: 900px) {
    .chat-container {
        height: 100dvh;
        max-height: 100dvh;
    }

    .chat-ativo {
        height: 100dvh;
        max-height: 100dvh;
        display: flex;
        flex-direction: column;
    }

    .chat-header {
        padding: 14px 16px 12px;
        min-height: auto;
        display: grid;
        grid-template-columns: 44px 1fr;
        gap: 10px 12px;
        align-items: start;
    }

    .btn-voltar-mobile {
        grid-row: 1 / 3;
        width: 44px;
        height: 44px;
        margin-top: 2px;
    }

    .chat-header-info {
        min-width: 0;
    }

    .chat-header-text h3 {
        font-size: 24px;
        line-height: 1.15;
        margin-bottom: 6px;
    }

    .chat-telefone {
        font-size: 15px;
        margin-bottom: 4px;
    }

    .chat-atendente-info {
        font-size: 15px;
        font-weight: 700;
    }

    .chat-header-actions {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 8px;
        width: 100%;
        margin-top: 8px;
    }

    .chat-header-actions select,
    .chat-header-actions button {
        width: 100%;
        height: 42px;
        min-height: 42px;
        padding: 0 8px;
        font-size: 14px;
        border-radius: 10px;
        line-height: 1.1;
    }

    #btnTransferirConversa {
        grid-column: 1 / -1;
    }

    .chat-mensagens {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        padding: 14px;
        padding-bottom: 18px;
    }

    .mensagem {
        margin-bottom: 10px;
    }

    .mensagem-conteudo {
        max-width: 82vw;
        font-size: 15px;
        border-radius: 18px;
    }

    .mensagem.atendente .mensagem-conteudo {
        max-width: 78vw;
    }

    .mensagem-imagem {
        max-width: 70vw;
        max-height: 280px;
        object-fit: contain;
    }

    .mensagem-audio {
        width: 70vw;
    }

    .chat-input-container {
        flex-shrink: 0;
        padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
        background: rgba(16, 16, 16, 0.98);
        position: sticky;
        bottom: 0;
        z-index: 60;
    }

    .chat-input-wrapper {
        min-height: 46px;
        border-radius: 999px;
    }

    #chatInput {
        font-size: 16px;
        min-height: 44px;
        padding: 10px 12px;
    }

    .btn-enviar,
    .btn-input-action {
        width: 42px;
        height: 42px;
        min-width: 42px;
    }
}
@media (max-width: 900px) {
    .conversas-header {
        padding: 28px 22px 16px;
    }

    .conversas-header h2 {
        font-size: 30px;
        margin-bottom: 18px;
    }

    .search-input {
        height: 54px;
        font-size: 16px;
        border-radius: 18px;
    }

    .mobile-filters {
        padding: 14px 10px 0;
        gap: 8px;
    }

    .filter-btn-mobile {
        font-size: 15px;
        padding: 10px 16px;
    }

    .conversa-item {
        padding: 18px 24px;
    }

    .conversa-avatar {
        width: 66px;
        height: 66px;
        font-size: 28px;
    }

    .conversa-nome {
        font-size: 22px;
    }

    .conversa-ultima-msg {
        font-size: 18px;
    }

    .conversa-atendente {
        font-size: 14px;
    }
}
/* =============================================================================
   AJUSTE FINAL MOBILE LIMPO - AVSEG CHAT
   ============================================================================= */

@media (max-width: 900px) {
    html,
    body {
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    .dashboard-container {
        display: flex !important;
        width: 100vw;
        height: 100dvh;
        overflow: hidden;
    }

    .sidebar {
        display: none !important;
    }

    .conversas-list {
        display: flex !important;
        flex-direction: column;
        width: 100vw;
        min-width: 100vw;
        height: 100dvh;
        border-right: none;
        background: #111;
    }

    .conversas-header {
        padding: 26px 22px 14px;
    }

    .conversas-header h2,
    .conversas-header h3 {
        font-size: 30px;
        margin-bottom: 18px;
    }

    .search-input {
        height: 54px;
        font-size: 16px;
        border-radius: 18px;
    }

    .mobile-filters {
        display: flex !important;
        gap: 8px;
        overflow-x: auto;
        padding: 14px 10px 0;
        scrollbar-width: none;
    }

    .mobile-filters::-webkit-scrollbar {
        display: none;
    }

    .filter-btn-mobile {
        white-space: nowrap;
        border: 1px solid var(--border);
        background: #0f0f0f;
        color: var(--text-secondary);
        padding: 10px 16px;
        border-radius: 999px;
        font-size: 15px;
        cursor: pointer;
    }

    .filter-btn-mobile.active {
        background: var(--primary);
        color: #050505;
        border-color: var(--primary);
        font-weight: 800;
    }

    .conversa-item {
        padding: 18px 22px;
        grid-template-columns: 66px 1fr auto;
        gap: 14px;
    }

    .conversa-avatar {
        width: 66px;
        height: 66px;
        font-size: 28px;
    }

    .conversa-nome {
        font-size: 22px;
    }

    .conversa-ultima-msg {
        font-size: 18px;
    }

    .conversa-atendente {
        font-size: 14px;
    }

    .chat-container {
        position: fixed;
        inset: 0;
        width: 100vw;
        height: 100dvh;
        z-index: 50;
        background: var(--bg-light);
        transform: translateX(100%);
        transition: transform 0.25s ease;
    }

    body.chat-mobile-aberto .chat-container {
        transform: translateX(0);
    }

    .chat-ativo {
        height: 100dvh;
        max-height: 100dvh;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .chat-header {
        flex-shrink: 0;
        padding: 14px 16px 12px;
        min-height: auto;
        display: grid;
        grid-template-columns: 46px 1fr;
        gap: 10px 12px;
        align-items: start;
    }

    .btn-voltar-mobile {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        grid-row: 1 / 3;
        width: 44px;
        height: 44px;
        margin-top: 2px;
        border-radius: 50%;
        border: 1px solid var(--border);
        background: #0f0f0f;
        color: var(--primary);
        font-size: 22px;
        font-weight: 800;
        cursor: pointer;
        flex-shrink: 0;
    }

    .chat-header-info {
        min-width: 0;
        display: block;
    }

    .chat-header-info .avatar,
    .chat-header-info .conversa-avatar {
        display: none;
    }

    .chat-header-text h3 {
        font-size: 24px;
        line-height: 1.15;
        margin-bottom: 6px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .chat-telefone {
        font-size: 15px;
        margin-bottom: 4px;
    }

    .chat-atendente-info {
        font-size: 15px;
        font-weight: 700;
    }

    .chat-header-actions {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 8px;
        width: 100%;
        margin-top: 8px;
    }

    .chat-header-actions select,
    .chat-header-actions button {
        width: 100%;
        height: 42px;
        min-height: 42px;
        padding: 0 8px;
        font-size: 14px;
        border-radius: 10px;
        line-height: 1.1;
    }

    #btnTransferirConversa {
        grid-column: 1 / -1;
    }

    .chat-mensagens {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        padding: 14px;
        padding-bottom: 18px;
    }

    .mensagem {
        max-width: 100%;
        margin-bottom: 10px;
    }

    .mensagem-conteudo {
        max-width: 82vw;
        font-size: 15px;
        border-radius: 18px;
    }

    .mensagem.atendente .mensagem-conteudo {
        max-width: 78vw;
    }

    .mensagem-imagem {
        max-width: 70vw;
        max-height: 280px;
        object-fit: contain;
    }

    .mensagem-audio {
        width: 70vw;
    }

    .mensagem-video,
    .mensagem-arquivo-card {
        width: 70vw;
        max-width: 70vw;
    }

    .chat-input-container {
        flex-shrink: 0;
        padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
        background: rgba(16, 16, 16, 0.98);
        position: sticky;
        bottom: 0;
        z-index: 60;
    }

    .chat-input-wrapper {
        min-height: 46px;
        border-radius: 999px;
    }

    #chatInput {
        font-size: 16px;
        min-height: 44px;
        padding: 10px 12px;
    }

    .btn-enviar,
    .btn-input-action {
        width: 42px;
        height: 42px;
        min-width: 42px;
    }

    .templates-rapidos {
        left: 10px;
        right: 10px;
        bottom: 72px;
        width: auto;
        max-height: 280px;
    }
}

@media (min-width: 901px) {
    .btn-voltar-mobile,
    .mobile-filters {
        display: none !important;
    }
}
/* =============================================================================
   REFINO FINAL MOBILE COMPACTO - AVSEG CHAT
   ============================================================================= */

@media (max-width: 900px) {
    /* Lista de conversas mais compacta */
    .conversas-header {
        padding: 22px 18px 12px;
    }

    .conversas-header h2,
    .conversas-header h3 {
        font-size: 32px;
        margin-bottom: 16px;
    }

    .search-input {
        height: 50px;
        font-size: 15px;
        border-radius: 16px;
    }

    .mobile-filters {
        padding: 12px 10px 0;
        gap: 8px;
    }

    .filter-btn-mobile {
        font-size: 14px;
        padding: 9px 14px;
    }

    .conversa-item {
        padding: 16px 18px;
        grid-template-columns: 58px 1fr auto;
        gap: 13px;
    }

    .conversa-avatar {
        width: 58px;
        height: 58px;
        font-size: 24px;
    }

    .conversa-nome {
        font-size: 20px;
    }

    .conversa-ultima-msg {
        font-size: 16px;
    }

    .conversa-atendente {
        font-size: 13px;
    }

    .conversa-hora {
        font-size: 14px;
    }

    /* Cabeçalho do chat mais profissional */
    .chat-header {
        padding: 12px 14px 10px;
        display: grid;
        grid-template-columns: 42px 1fr;
        gap: 8px 12px;
        align-items: center;
        min-height: auto;
    }

    .btn-voltar-mobile {
        width: 40px;
        height: 40px;
        font-size: 22px;
        grid-row: 1 / 3;
        margin-top: 0;
    }

    .chat-header-text h3 {
        font-size: 25px;
        line-height: 1.1;
        margin-bottom: 4px;
    }

    .chat-telefone {
        font-size: 15px;
        margin-bottom: 2px;
    }

    .chat-atendente-info {
        font-size: 15px;
        line-height: 1.2;
    }

    /* Botões do chat mais compactos */
    .chat-header-actions {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 7px;
        margin-top: 8px;
    }

    .chat-header-actions select,
    .chat-header-actions button {
        height: 38px;
        min-height: 38px;
        font-size: 13px;
        padding: 0 7px;
        border-radius: 10px;
    }

    #btnTransferirConversa {
        grid-column: 1 / -1;
        height: 40px;
    }

    /* Mensagens */
    .chat-mensagens {
        padding: 12px;
        padding-bottom: 14px;
    }

    .mensagem-conteudo {
        max-width: 80vw;
        font-size: 15px;
        border-radius: 16px;
        padding: 12px 14px;
    }

    .mensagem.atendente .mensagem-conteudo {
        max-width: 78vw;
    }

    .mensagem-imagem {
        max-width: 68vw;
        max-height: 250px;
    }

    .mensagem-audio {
        width: 68vw;
    }

    .mensagem-video,
    .mensagem-arquivo-card {
        width: 68vw;
        max-width: 68vw;
    }

    /* Input inferior */
    .chat-input-container {
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
        gap: 8px;
    }

    .chat-input-wrapper {
        min-height: 44px;
        border-radius: 999px;
    }

    #chatInput {
        min-height: 42px;
        font-size: 16px;
        padding: 9px 10px;
    }

    .btn-enviar,
    .btn-input-action {
        width: 42px;
        height: 42px;
        min-width: 42px;
    }
}
/* =============================================================================
   BOTÃO SAIR MOBILE
   ============================================================================= */

.conversas-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.btn-logout-mobile {
    display: none;
}

@media (max-width: 900px) {
    .btn-logout-mobile {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        border: 1px solid var(--border);
        background: #0f0f0f;
        color: var(--primary);
        cursor: pointer;
        flex-shrink: 0;
    }

    .btn-logout-mobile:hover {
        background: var(--primary);
        color: #050505;
    }
}
.conversa-ultima-msg {
    display: flex;
    align-items: center;
    gap: 7px;
}

.conversa-ultima-msg svg {
    color: var(--primary);
    flex-shrink: 0;
}

.conversa-atendente {
    display: flex;
    align-items: center;
    gap: 6px;
}
/* =============================================================================
   AVSEG CHAT — melhorias-ui.css
   Adicione no final do seu style.css existente, OU importe separado no HTML.
   Contém: bolhas refinadas, animações de entrada, indicador digitando,
           toast, badge, e polimentos gerais de UI.
   ============================================================================= */

/* -----------------------------------------------------------------------------
   ANIMAÇÕES DE ENTRADA DAS MENSAGENS
   ----------------------------------------------------------------------------- */
@keyframes msgEntradaCliente {
  from {
    opacity: 0;
    transform: translateX(-14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes msgEntradaAtendente {
  from {
    opacity: 0;
    transform: translateX(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes msgEntradaSistema {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mensagem.cliente {
  animation: msgEntradaCliente 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.mensagem.atendente {
  animation: msgEntradaAtendente 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.mensagem.sistema {
  animation: msgEntradaSistema 0.2s ease both;
}

/* -----------------------------------------------------------------------------
   BOLHAS DE MENSAGEM — refinamento
   ----------------------------------------------------------------------------- */

/* Cauda nas bolhas */
.mensagem {
  position: relative;
}

.mensagem.cliente .mensagem-conteudo {
  border-radius: 4px 18px 18px 18px;
  background: #1e1e1e;
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.mensagem.atendente .mensagem-conteudo {
  border-radius: 18px 4px 18px 18px;
  background: linear-gradient(135deg, #f5c400, #ffd84a);
  color: #050505;
  border: none;
  box-shadow: 0 2px 14px rgba(245, 196, 0, 0.25);
}

/* Hora inline — estilo WhatsApp */
.mensagem-conteudo {
  padding: 10px 14px 8px;
  position: relative;
}

.mensagem-texto {
  font-size: 14.5px;
  line-height: 1.55;
  word-break: break-word;
  white-space: pre-wrap;
}

/* Hora fica no canto inferior direito */
.mensagem-hora {
  display: block;
  font-size: 11px;
  margin-top: 4px;
  text-align: right;
  opacity: 0.6;
  user-select: none;
  letter-spacing: 0.02em;
}

.mensagem.atendente .mensagem-hora {
  color: rgba(5, 5, 5, 0.7);
}

.mensagem.cliente .mensagem-hora {
  color: var(--text-secondary);
}

/* Avatar sutil na bolha do cliente */
.mensagem.cliente::before {
  content: attr(data-inicial);
  position: absolute;
  left: -32px;
  bottom: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: #050505;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

/* Agrupamento — remove borda do topo quando mensagens consecutivas */
.mensagem + .mensagem.cliente .mensagem-conteudo,
.mensagem + .mensagem.atendente .mensagem-conteudo {
  margin-top: -2px;
}

/* Espaçamento entre grupos de origem diferente */
.mensagem.cliente + .mensagem.atendente,
.mensagem.atendente + .mensagem.cliente {
  margin-top: 12px;
}

/* Hover leve na bolha */
.mensagem-conteudo {
  transition: box-shadow 0.15s ease;
}

.mensagem.cliente .mensagem-conteudo:hover {
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

.mensagem.atendente .mensagem-conteudo:hover {
  box-shadow: 0 4px 18px rgba(245, 196, 0, 0.35);
}

/* Max-width um pouco maior */
.mensagem {
  max-width: 72%;
}

/* -----------------------------------------------------------------------------
   INDICADOR "DIGITANDO..."
   ----------------------------------------------------------------------------- */
@keyframes digitandoPonto {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

.mensagem-digitando {
  animation: msgEntradaCliente 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: opacity 0.2s, transform 0.2s;
}

.digitando-bolha {
  padding: 12px 16px !important;
  min-width: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.digitando-pontos {
  display: flex;
  align-items: center;
  gap: 5px;
}

.digitando-pontos span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-secondary);
  display: block;
  animation: digitandoPonto 1.2s ease infinite;
}

.digitando-pontos span:nth-child(1) { animation-delay: 0s; }
.digitando-pontos span:nth-child(2) { animation-delay: 0.18s; }
.digitando-pontos span:nth-child(3) { animation-delay: 0.36s; }

/* -----------------------------------------------------------------------------
   TOAST — feedback visual rápido
   ----------------------------------------------------------------------------- */
#avseg-toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.avseg-toast {
  background: #1e1e1e;
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(12px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  white-space: nowrap;
  pointer-events: none;
}

.avseg-toast--visivel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.avseg-toast--sucesso {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
}

.avseg-toast--erro {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.12);
  color: #ff8a8a;
}

.avseg-toast--aviso {
  border-color: var(--yellow-border);
  background: var(--yellow-soft);
  color: var(--primary);
}

/* -----------------------------------------------------------------------------
   NOTIFICAÇÃO VISUAL NA LISTA — pulso no badge
   ----------------------------------------------------------------------------- */
@keyframes badgePulse {
  0% { box-shadow: 0 0 0 0 rgba(245, 196, 0, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(245, 196, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 196, 0, 0); }
}

.conversa-badge {
  animation: badgePulse 2s ease infinite;
}

/* Status dot animado para "aguardando" */
@keyframes statusPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.8); }
}

.conversa-status.aguardando {
  animation: statusPulse 2s ease infinite;
}

/* -----------------------------------------------------------------------------
   POLIMENTOS GERAIS
   ----------------------------------------------------------------------------- */

/* Linha de data separadora entre mensagens de dias diferentes */
.mensagem-data-separador {
  align-self: center;
  font-size: 12px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 4px 14px;
  border-radius: 999px;
  margin: 8px 0;
  user-select: none;
  letter-spacing: 0.04em;
}

/* Input focado — brilho mais suave */
#chatInput:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(245, 196, 0, 0.1);
  background: #111;
}

/* Botão enviar — micro-interação */
.btn-enviar {
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn-enviar:not(:disabled):hover {
  transform: scale(1.08) rotate(6deg);
  box-shadow: 0 4px 18px rgba(245, 196, 0, 0.35);
}

.btn-enviar:not(:disabled):active {
  transform: scale(0.94);
}

/* Conversa item — entrada suave ao carregar */
@keyframes conversaEntrada {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

.conversa-item {
  animation: conversaEntrada 0.18s ease both;
}

/* Scrolbar suave na área de mensagens */
.chat-mensagens {
  scroll-behavior: smooth;
}

/* Fundo das mensagens — padrão de pontilhado sutil */
.chat-mensagens {
  background-image:
    radial-gradient(circle, rgba(245, 196, 0, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  background-color: #090909;
}

/* Tooltip de hora ao passar o mouse (opcional via title) */
.mensagem-conteudo:hover .mensagem-hora {
  opacity: 1;
}

/* Status select — estilo mais limpo */
.status-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23f5c400' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

/* Linha de boas-vindas no chat vazio */
.chat-vazio-content p {
  max-width: 260px;
  margin: 0 auto;
  line-height: 1.6;
}

/* -----------------------------------------------------------------------------
   RESPONSIVO
   ----------------------------------------------------------------------------- */
@media (max-width: 900px) {
  #avseg-toast-container {
    bottom: 80px;
    width: 90vw;
    left: 5vw;
    transform: none;
  }

  .avseg-toast {
    width: 100%;
    white-space: normal;
    text-align: center;
  }

  .mensagem {
    max-width: 85%;
  }
}
/* =============================================================================
   TEMA CLARO
   ============================================================================= */
[data-theme="light"] {
  --primary: #d4a900;
  --primary-hover: #f5c400;
  --bg-dark: #f0f0f0;
  --bg-light: #f8f8f8;
  --bg-card: #ffffff;
  --bg-card-hover: #f2f2f2;
  --border: #e0e0e0;
  --text-primary: #111111;
  --text-secondary: #555555;
  --yellow-soft: rgba(212, 169, 0, 0.10);
  --yellow-border: rgba(212, 169, 0, 0.35);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .sidebar {
  background: #ffffff;
  border-right-color: #e5e5e5;
}

[data-theme="light"] .conversas-list {
  background: #f8f8f8;
}

[data-theme="light"] .chat-container,
[data-theme="light"] .chat-mensagens {
  background: #f8f8f8 !important;
  background-image: none !important;
}

[data-theme="light"] .chat-vazio-content svg {
  color: #999;
}

/* Sobrepõe cores fixas do redesign.css (feito para o tema escuro) */
[data-theme="light"] .conversas-header,
[data-theme="light"] .conversas-secao-titulo,
[data-theme="light"] .chat-header,
[data-theme="light"] .chat-input-container,
[data-theme="light"] .templates-rapidos,
[data-theme="light"] .anexo-preview {
  background: #ffffff !important;
  border-color: #e5e5e5 !important;
}

[data-theme="light"] .search-input,
[data-theme="light"] .status-select,
[data-theme="light"] .btn-secondary-small {
  background: #f0f0f0 !important;
  border-color: #ddd !important;
  color: #333 !important;
}

[data-theme="light"] .search-input::placeholder {
  color: #888 !important;
}

[data-theme="light"] .conversa-item:hover {
  background: #f0f0f0 !important;
}

[data-theme="light"] .conversa-item.active {
  background: rgba(212, 169, 0, 0.08) !important;
}

[data-theme="light"] .mensagem.cliente .mensagem-conteudo {
  background: #eeeeee;
  color: #111111;
}

[data-theme="light"] #chatInput {
  background: #f0f0f0;
  border-color: #ddd;
}

[data-theme="light"] .modal-card,
[data-theme="light"] .modal-imagem-card {
  background: #ffffff;
}

[data-theme="light"] ::-webkit-scrollbar-track {
  background: #f0f0f0;
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: #cccccc;
}

/* Transição suave ao alternar entre tema claro e escuro */
*, *::before, *::after {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* -----------------------------------------------------------------------------
   BOTÃO DE ALTERNAR TEMA (sidebar)
   ----------------------------------------------------------------------------- */
.btn-tema-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  margin-top: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
}

.btn-tema-toggle:hover {
  border-color: var(--yellow-border);
  color: var(--primary);
  background: var(--yellow-soft);
}

/* =============================================================================
   NOTAS INTERNAS
   ============================================================================= */
#btnNotaInterna.ativo {
  background: var(--primary);
  color: #050505;
  border-color: var(--primary);
}

.chat-input-container.modo-nota {
  background: rgba(245, 196, 0, 0.06);
}

.chat-input-container.modo-nota #chatInput {
  background: rgba(245, 196, 0, 0.12);
  border-color: var(--yellow-border);
}

.mensagem.nota-interna {
  align-self: center;
  max-width: 80%;
}

.mensagem.nota-interna .mensagem-conteudo {
  background: rgba(245, 196, 0, 0.12);
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  color: var(--text-primary);
}

.nota-interna-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

/* =============================================================================
   CONTADOR DE CARACTERES
   ============================================================================= */
.contador-caracteres {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: right;
  padding: 0 24px 6px;
}

.contador-caracteres.limite-alto {
  color: #ef4444;
  font-weight: 700;
}

/* =============================================================================
   CARREGAR MENSAGENS ANTERIORES
   ============================================================================= */
.btn-carregar-anteriores {
  display: block;
  margin: 0 auto 12px;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
}

.btn-carregar-anteriores:hover {
  border-color: var(--yellow-border);
  color: var(--primary);
  background: var(--yellow-soft);
}

/* =============================================================================
   INDICADOR DE HORÁRIO DE ATENDIMENTO
   ============================================================================= */
.indicador-horario {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  margin: 0 20px 10px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* =============================================================================
   PAINEL LATERAL — INFORMAÇÕES DO ASSOCIADO
   ============================================================================= */
.painel-cliente-info {
  position: absolute;
  top: 0;
  right: 0;
  width: min(300px, 90vw);
  height: 100%;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.25);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  z-index: 25;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.painel-cliente-info.aberto {
  transform: translateX(0);
}

.painel-cliente-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.painel-cliente-header h4 {
  font-size: 14px;
  color: var(--text-primary);
}

.painel-cliente-conteudo {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.painel-cliente-secao-titulo {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.painel-cliente-conversa-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-light);
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
  margin-bottom: 8px;
  transition: all 0.18s;
}

.painel-cliente-conversa-item:hover {
  border-color: var(--yellow-border);
  background: var(--yellow-soft);
}

.painel-cliente-conversa-item .conversa-item-data {
  color: var(--text-secondary);
  font-size: 11px;
  margin-top: 2px;
}

@media (max-width: 900px) {
  .painel-cliente-info { width: 100%; }
}
