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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    color: #333;
}

/* Login Page */
.login-page {
    width: 100%;
    height: 100%;
    background: #252e3a;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.login-logo {
    text-align: center;
    margin-bottom: -20px; /* Sobreposição negativa para puxar a logo para cima */
    position: relative;
    z-index: 2; /* Garante que a logo fique acima do box */
}

.login-logo img {
    max-width: 180px; /* Um pouco menor para não ficar muito grande */
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3)); /* Sombra para destacar do fundo */
    background: transparent;
}

.login-box {
    background: white;
    padding: 50px 40px 40px 40px; /* Aumentei o padding-top para compensar a logo sobreposta */
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #252e3a;
    font-size: 22px;
    font-weight: 500;
}

.login-info {
    margin-top: 20px;
    padding: 15px;
    background: #f0f0f0;
    border-radius: 5px;
    font-size: 12px;
}

.login-info p {
    margin: 5px 0;
}

/* Container */
.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: #2c3e50;
    color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.logo h2 {
    font-size: 18px;
    font-weight: 600;
}

.user-info {
    background: #34495e;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.user-info p {
    margin: 5px 0;
    font-size: 14px;
}

.nav-menu {
    list-style: none;
    flex: 1;
}

.nav-menu li {
    margin-bottom: 10px;
}

.nav-menu a {
    display: block;
    padding: 12px 15px;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: #34495e;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

h1 {
    margin-bottom: 30px;
    color: #2c3e50;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    border-color: #ff9800;
    outline: none;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

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

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-danger {
    background: #e74c3c;
    color: white;
    padding: 5px 10px;
    font-size: 12px;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-edit {
    background: #3498db;
    color: white;
    padding: 5px 10px;
    font-size: 12px;
    margin-right: 5px;
}

.btn-edit:hover {
    background: #2980b9;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.stat-card.alert {
    background: #fee;
    border-left: 4px solid #e74c3c;
}

.stat-card h3 {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
    color: #2c3e50;
}

/* Charts */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chart-container h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.chart-container {
    height: 475px !important;
    position: relative; /* necessário para o Chart.js ocupar todo o container */
}

.chart-container canvas {
    height: 90% !important;
    width: 100% !important;
}

/* Overdue Section */
.overdue-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.overdue-section h3 {
    margin-bottom: 15px;
    color: #e74c3c;
}

.overdue-task {
    padding: 15px;
    background: #fee;
    border-left: 4px solid #e74c3c;
    margin-bottom: 10px;
    border-radius: 5px;
}

.overdue-task h4 {
    margin-bottom: 5px;
}

.overdue-task p {
    font-size: 14px;
    color: #666;
}

/* Kanban Board */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.kanban-column {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.kanban-column h3 {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.kanban-tasks {
    min-height: 100%;
}

.kanban-task {
    background: #f8f9fa;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 5px;
    border-left: 4px solid #667eea;
    cursor: move;
    transition: all 0.3s;
}

.kanban-task:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.kanban-task.priority-high {
    border-left-color: #e74c3c;
}

.kanban-task.priority-medium {
    border-left-color: #f39c12;
}

.kanban-task.priority-low {
    border-left-color: #3498db;
}

.kanban-task h4 {
    margin-bottom: 8px;
    color: #2c3e50;
}

.kanban-task p {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
}

.kanban-task .task-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 12px;
    color: #999;
}

/* Table */
.table-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #f8f9fa;
}

th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #dee2e6;
}

td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
}

tr:hover {
    background: #f8f9fa;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-todo {
    background: #e3f2fd;
    color: #1976d2;
}

.status-in_progress {
    background: #fff3e0;
    color: #f57c00;
}

.status-done {
    background: #e8f5e9;
    color: #388e3c;
}

.priority-high {
    color: #e74c3c;
    font-weight: bold;
}

.priority-medium {
    color: #f39c12;
    font-weight: bold;
}

.priority-low {
    color: #3498db;
}

/* Chat */
.chat-main-container {
    display: flex;
    height: calc(100vh - 150px); /* Ajuste a altura conforme necessário */
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chat-sidebar {
    width: 250px;
    border-right: 1px solid #eee;
    padding: 15px;
    overflow-y: auto;
}

.chat-sidebar h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.contact-list {
    list-style: none;
    padding: 0;
}

.contact-list li {
    padding: 10px;
    cursor: pointer;
    border-radius: 5px;
    margin-bottom: 5px;
    transition: background 0.3s;
}

.contact-list li:hover {
    background: #f0f0f0;
}

.contact-list li.active {
    background: #667eea;
    color: white;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.chat-header h3 {
    margin: 0;
    color: #2c3e50;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.chat-message {
    margin-bottom: 15px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    max-width: 70%;
}

.chat-message.own {
    background: #667eea;
    color: white;
    margin-left: auto;
}

.chat-message .message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 12px;
}

.chat-message .message-user {
    font-weight: bold;
}

.chat-message .message-time {
    color: #999;
}

.chat-message.own .message-time {
    color: rgba(255, 255, 255, 0.8);
}

.chat-message .message-text {
    font-size: 14px;
}

.chat-input-area {
    display: flex;
    padding: 15px;
    border-top: 1px solid #dee2e6;
}

.chat-input-area input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-right: 10px;
}

/* Badge de Alerta */
.badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
    line-height: 1;
    color: white;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    border-radius: 10px;
    background-color: #e74c3c; /* Vermelho para alerta */
    margin-left: 5px;
}

/* Responsive */
@media (max-width: 768px) {
    .chat-main-container {
        flex-direction: column;
    }

    .chat-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #eee;
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    
    /* Centralização */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Error Message */
.error-message {
    color: #e74c3c;
    margin-top: 15px;
    font-size: 14px;
    text-align: center;
}

/* Reports */
.reports-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.reports-section h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.report-item {
    padding: 15px;
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    margin-bottom: 10px;
    border-radius: 5px;
}

.report-item h4 {
    margin-bottom: 8px;
    color: #2c3e50;
}

.report-item p {
    font-size: 14px;
    color: #666;
    margin: 5px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .kanban-board {
        grid-template-columns: 1fr;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

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

/* Mensagens não lidas */
.unread-message {
    background-color: #fff3cd !important;
    border-left: 4px solid #ff6b6b !important;
}

.unread-badge {
    background-color: red;
    color: white;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    float: right;
    margin-left: 8px;
}

.unread-banner {
    background: #ff6b6b;
    color: white;
    padding: 8px;
    text-align: center;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 10;
    border-radius: 5px;
    margin-bottom: 10px;
}

.contact-unread {
    background: red;
    color: white;
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 12px;
}

/* ===== ESTILOS DO WHATSAPP ===== */
.whatsapp-main-container {
    display: flex;
    gap: 20px;
    height: calc(100vh - 200px);
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.whatsapp-sidebar {
    width: 350px;
    border-right: 1px solid #e0e0e0;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
}

.whatsapp-sidebar h3 {
    margin-bottom: 15px;
    color: #333;
}

.ticket-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ticket-list li {
    padding: 15px;
    margin-bottom: 10px;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid #ccc;
}

.ticket-list li:hover {
    background: #f0f0f0;
    transform: translateX(5px);
}

.ticket-list li.active {
    background: #e3f2fd;
    border-left-color: #2196F3;
}

.ticket-list li.waiting {
    border-left-color: #ff9800;
}

.ticket-list li.in_progress {
    border-left-color: #4caf50;
}

.ticket-list li.closed {
    border-left-color: #9e9e9e;
}

.ticket-contact-name {
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.ticket-contact-number {
    font-size: 0.9em;
    color: #666;
}

.ticket-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    margin-top: 5px;
    font-weight: 500;
}

.ticket-status.waiting {
    background: #fff3e0;
    color: #ff9800;
}

.ticket-status.in_progress {
    background: #e8f5e9;
    color: #4caf50;
}

.ticket-status.closed {
    background: #f5f5f5;
    color: #9e9e9e;
}

.ticket-assigned {
    font-size: 0.85em;
    color: #666;
    margin-top: 5px;
}

.whatsapp-chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #e5ddd5;
}

.whatsapp-chat-header {
    padding: 15px 20px;
    background: #075e54;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.whatsapp-chat-header h3 {
    margin: 0;
    font-size: 1.1em;
}

#ticketActions button {
    margin-left: 10px;
}

.whatsapp-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MTA0MUI2M0E5QzA4MTFFNDhEQzFBOENDOEVBMjBCQkMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MTA0MUI2M0I5QzA4MTFFNDhEQzFBOENDOEVBMjBCQkMiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDoxMDQxQjYzODlDMDgxMUU0OERDMUE4Q0M4RUEyMEJCQyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDoxMDQxQjYzOTlDMDgxMUU0OERDMUE4Q0M4RUEyMEJCQyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PlBhPWsAAAAbSURBVHjaYvz//z8DKYAJRhHqAAAA//8DAC8pAgcdEPEFAAAAAElFTkSuQmCC');
    background-repeat: repeat;
}

.whatsapp-message {
    margin-bottom: 12px;
    display: flex;
    align-items: flex-end;
}

.whatsapp-message.from-me {
    justify-content: flex-end;
}

.whatsapp-message.from-them {
    justify-content: flex-start;
}

.whatsapp-message-bubble {
    max-width: 60%;
    padding: 8px 12px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

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

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

.whatsapp-message.internal .whatsapp-message-bubble {
    background: #fff3cd;
    border-left: 3px solid #ff9800;
}

.whatsapp-message-text {
    white-space: pre-line;
    word-break: break-word;
    color: #333;
    font-size: 0.95em;
}

.whatsapp-message-time {
    font-size: 0.75em;
    color: #999;
    margin-top: 4px;
    text-align: right;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.whatsapp-internal-badge {
    display: inline-block;
    font-size: 0.7em;
    font-weight: bold;
    color: #ff9800;
    background: rgba(255, 152, 0, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.whatsapp-input-area {
    padding: 15px 20px;
    background: #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.whatsapp-input-area textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 12px;
    font-size: 0.95em;
    outline: none;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    max-height: 150px;
}

.whatsapp-input-area textarea:focus {
    border-color: #075e54;
}

.whatsapp-input-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.internal-message-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 0.9em;
    color: #555;
}

.internal-message-checkbox input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.internal-message-checkbox:hover {
    color: #333;
}

.whatsapp-input-area button {
    padding: 12px 25px;
    border-radius: 25px;
    white-space: nowrap;
}

#qrCodeImage img {
    max-width: 300px;
    height: auto;
}

.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: bold;
}

.badge.connected {
    background: #4caf50;
    color: white;
}

.badge.disconnected {
    background: #f44336;
    color: white;
}

.badge.loading {
    background: #ff9800;
    color: white;
}

/* Botões de filtro de status */
.whatsapp-sidebar button[data-status] {
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.3s ease;
}

.whatsapp-sidebar button[data-status]:hover {
    background: #f0f0f0;
}

.whatsapp-sidebar button[data-status].active {
    background: #2196F3;
    color: white;
    border-color: #2196F3;
}

/* Limite de tamanho para imagens */
.whatsapp-media-img {
  max-width: 380px;     /* limite horizontal */
  max-height: 280px;    /* limite vertical */
  border-radius: 8px;
  object-fit: cover;    /* mantém proporção cortando excesso */
}

/* Limite de tamanho para vídeos */
.whatsapp-media-video {
  max-width: 380px;     /* limite horizontal */
  max-height: 280px;    /* limite vertical */
  border-radius: 8px;
  object-fit: contain;  /* mantém proporção, sem distorcer */
}

/* Player de áudio */
.whatsapp-media-audio {
  width: 220px;
  max-width: 100%;
  margin-top: 5px;
}


/* Link para documentos */
.whatsapp-media-file {
  color: #0d6efd;
  text-decoration: underline;
  font-size: 14px;
}

/* Legenda */
.whatsapp-media-caption {
  margin-top: 5px;
  font-size: 14px;
}

.whatsapp-internal-sender {
  font-weight: bold;
  font-size: 12px;
  margin-bottom: 4px;
  color: #ff9800;
}

.whatsapp-internal-label {
  display: inline-block;
  font-size: 0.7em;
  font-weight: bold;
  color: #ff9800;
  background: rgba(255, 152, 0, 0.15);
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* 🔥 ESTILOS PARA STICKERS WEBP */
.whatsapp-sticker-bubble {
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.whatsapp-sticker-img {
  width: 150px;
  height: 150px;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
}

/* ===== ESTILOS DE STATUS DE MENSAGEM (CHECKMARKS WHATSAPP) ===== */
.whatsapp-message-status {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  position: relative;
}

/* Checkmark único (enviado) */
.whatsapp-checkmark {
  display: inline-block;
  width: 16px;
  height: 16px;
  position: relative;
}

/* Checkmark simples - mensagem enviada */
.whatsapp-checkmark.sent::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 3px;
  width: 6px;
  height: 10px;
  border: solid #999;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Checkmarks duplos - mensagem entregue */
.whatsapp-checkmark.delivered::before,
.whatsapp-checkmark.delivered::after {
  content: '';
  position: absolute;
  top: 3px;
  width: 6px;
  height: 10px;
  border: solid #999;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.whatsapp-checkmark.delivered::before {
  left: 2px;
}

.whatsapp-checkmark.delivered::after {
  left: 6px;
}

/* Checkmarks duplos azuis - mensagem lida */
.whatsapp-checkmark.read::before,
.whatsapp-checkmark.read::after {
  content: '';
  position: absolute;
  top: 3px;
  width: 6px;
  height: 10px;
  border: solid #4FC3F7;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.whatsapp-checkmark.read::before {
  left: 2px;
}

.whatsapp-checkmark.read::after {
  left: 6px;
}

/* Ícone de relógio - mensagem sendo enviada */
.whatsapp-checkmark.sending::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 10px;
  height: 10px;
  border: 2px solid #999;
  border-radius: 50%;
}

.whatsapp-checkmark.sending::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 5px;
  width: 4px;
  height: 4px;
  border-right: 2px solid #999;
  border-bottom: 2px solid #999;
  transform-origin: center;
}

/* Container do tempo com status */
.whatsapp-message-time {
  font-size: 0.75em;
  color: #999;
  margin-top: 4px;
  text-align: right;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
}

/* Ajuste para mensagens próprias */
.whatsapp-message.from-me .whatsapp-message-time {
  justify-content: flex-end;
}

/* ===== MELHORIAS PARA O MENU LATERAL ===== */

/* Ajustes para os ícones no menu */
.nav-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: #b0b7c3;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
}

.nav-menu a i {
    width: 20px;
    text-align: center;
    font-size: 16px;
    transition: transform 0.3s ease;
}

.nav-menu a span {
    flex: 1;
}

.nav-menu a:hover {
    background: rgb(234 176 102 / 10%);
    color: #ffffff;
    transform: translateX(5px);
}

.nav-menu a:hover i {
    transform: scale(1.1);
    color: #ff9800;
}

.nav-menu a.active {
    background: linear-gradient(135deg, rgb(246, 113, 23) 0%, #ff980066 100%);
    color: white;
    box-shadow: 0 4px 15px rgb(234 172 102 / 30%);
}

.nav-menu a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: white;
    border-radius: 0 4px 4px 0;
}

.nav-menu a.active i {
    color: white;
    transform: scale(1.1);
}

/* Badge aprimorado */
.nav-menu .badge {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff4757 100%);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
    animation: pulse 2s infinite;
    box-shadow: 0 2px 5px rgba(255, 107, 107, 0.3);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.4);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(255, 107, 107, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0);
    }
}

/* Logo aprimorada */
.logo {
    padding: 20px 0;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

/* User info aprimorado */
.user-info {
    background: linear-gradient(135deg, rgb(234 183 102 / 20%) 0%, #ffb86b 100%);
    padding: 18px;
    border-radius: 10px;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.user-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #eaad66, #a27e4b);
}

.user-info p {
    margin: 6px 0;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-info p:first-child {
    font-weight: 600;
    color: white;
    font-size: 15px;
}

.user-info p:last-child {
    color: #b0b7c3;
    font-size: 13px;
}

.user-info p i {
    width: 16px;
    color: #667eea;
}

/* Botão de sair aprimorado */
#logoutBtn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    margin-top: auto;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: #ff6b6b;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
}

#logoutBtn:hover {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff4757 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

#logoutBtn i {
    font-size: 14px;
}

/* Sidebar com gradiente suave */
.sidebar {
    background: linear-gradient(180deg, #494949e0 0%, #494949 100%);
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 100;
}

.sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.1), transparent);
}

/* Animações suaves */
.nav-menu li {
    animation: slideIn 0.5s ease forwards;
    opacity: 0;
    transform: translateX(-10px);
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Delay para cada item do menu */
.nav-menu li:nth-child(1) { animation-delay: 0.1s; }
.nav-menu li:nth-child(2) { animation-delay: 0.2s; }
.nav-menu li:nth-child(3) { animation-delay: 0.3s; }
.nav-menu li:nth-child(4) { animation-delay: 0.4s; }
.nav-menu li:nth-child(5) { animation-delay: 0.5s; }
.nav-menu li:nth-child(6) { animation-delay: 0.6s; }
.nav-menu li:nth-child(7) { animation-delay: 0.7s; }

/* Responsividade */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
        padding: 15px 10px;
    }
    
    .logo h2 {
        font-size: 18px;
    }
    
    .logo h2 span {
        display: none;
    }
    
    .nav-menu a span {
        display: none;
    }
    
    .nav-menu a {
        justify-content: center;
        padding: 12px;
    }
    
    .nav-menu a i {
        font-size: 18px;
        margin: 0;
    }
    
    .user-info p span {
        display: none;
    }
    
    .nav-menu .badge {
        position: absolute;
        top: 5px;
        right: 5px;
        font-size: 9px;
        padding: 2px 5px;
    }
    
    #logoutBtn span {
        display: none;
    }
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

  .whatsapp-reply-container {
    background: rgba(0, 0, 0, 0.05);
    border-left: 4px solid #25d366;
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
  }

  .from-me .whatsapp-reply-container {
    background: rgba(0, 0, 0, 0.05);
    border-left: 4px solid brown;
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
  }

  .whatsapp-reply-preview {
    background: #f0f0f0;
    border-left: 4px solid #25d366;
    padding: 12px 16px;
    margin: 12px 16px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
  }

/* Estilos para os filtros */
.filter-container {
    margin: 20px 0;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filter-container h3 {
    margin-bottom: 10px;
    color: #333;
    font-size: 16px;
}

.filter-inputs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.filter-group input,
.filter-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Contadores do Kanban */
.kanban-count {
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 5px;
}
/* ===== DASHBOARD EXECUTIVO ===== */
.dashboard-shell {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.dashboard-hero {
    background: linear-gradient(120deg, #111827 0%, #1f2937 45%, #0f172a 100%);
    color: #f9fafb;
    border-radius: 22px;
    padding: 28px 32px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.25);
}

.dashboard-hero h1 {
    color: #f9fafb;
    margin-bottom: 8px;
}

.dashboard-eyebrow {
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 12px;
    opacity: 0.7;
    margin-bottom: 12px;
}

.dashboard-subtitle {
    font-size: 15px;
    opacity: 0.8;
    margin-bottom: 20px;
}

.dashboard-total {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dashboard-total-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: rgba(248, 250, 252, 0.6);
}

.dashboard-total-value {
    font-size: 36px;
    font-weight: 700;
}

.dashboard-hero-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: flex-end;
}

.live-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.12);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 12px;
    letter-spacing: 0.4px;
}

.live-pill .pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
    animation: livePulse 2s infinite;
}

@keyframes livePulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
    70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 12px;
    width: 100%;
}

.hero-metric-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.6);
}

.hero-metric-value {
    display: block;
    font-size: 20px;
    font-weight: 600;
}

.dashboard-filters {
    background: white;
    border-radius: 18px;
    padding: 18px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    align-items: end;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.dashboard-filters .filter-group label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #6b7280;
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(260px, 1fr);
    gap: 24px;
}

.dashboard-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.dashboard-card {
    background: white;
    border: none;
    border-radius: 16px;
    padding: 18px 20px;
    text-align: left;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 12px 25px rgba(15, 23, 42, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-card .card-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6b7280;
}

.dashboard-card .card-value {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
}

.dashboard-card .card-meta {
    font-size: 12px;
    color: #9ca3af;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.15);
}

.dashboard-card.highlight {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(236, 253, 245, 0.9));
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.dashboard-card.warning {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 247, 237, 0.9));
    border: 1px solid rgba(249, 115, 22, 0.25);
}

.dashboard-card.dark {
    background: linear-gradient(135deg, #111827, #1f2937);
}

.dashboard-card.dark .card-label,
.dashboard-card.dark .card-meta {
    color: rgba(255, 255, 255, 0.7);
}

.dashboard-card.dark .card-value {
    color: #f9fafb;
}

.dashboard-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.dashboard-panel {
    background: white;
    border-radius: 18px;
    padding: 20px 22px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

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

.panel-header h3 {
    margin-bottom: 4px;
    color: #111827;
}

.panel-header p {
    color: #6b7280;
    font-size: 13px;
}

.panel-badge {
    background: rgba(79, 70, 229, 0.1);
    color: #4f46e5;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.panel-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pipeline-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.pipeline-metrics span {
    display: block;
    font-size: 12px;
    color: #6b7280;
}

.pipeline-metrics strong {
    font-size: 18px;
    color: #111827;
}

.time-insights {
    font-size: 13px;
    color: #6b7280;
}

.table-wrap {
    overflow-x: auto;
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.dashboard-table th,
.dashboard-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.dashboard-table th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #6b7280;
}

.dashboard-table tr:hover {
    background: #f9fafb;
}

.metric-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.metric-pill.good { background: #ecfdf5; color: #047857; }
.metric-pill.warn { background: #fffbeb; color: #b45309; }
.metric-pill.bad { background: #fef2f2; color: #b91c1c; }

.intelligence-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.metrics-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.metrics-list li {
    padding: 10px 12px;
    border-radius: 12px;
    background: #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #1f2937;
}

.dashboard-aside {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.alerts-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alerts-list li {
    padding: 12px 14px;
    border-radius: 14px;
    background: #fef2f2;
    color: #7f1d1d;
    font-size: 13px;
    line-height: 1.4;
}

.alerts-list li.warning {
    background: #fffbeb;
    color: #92400e;
}

.alerts-list li.info {
    background: #eff6ff;
    color: #1d4ed8;
}

.prediction-card {
    padding: 16px 18px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.92), rgba(30, 41, 59, 0.92));
    color: #f9fafb;
    font-size: 14px;
    line-height: 1.6;
}

@media (max-width: 1100px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-hero-actions {
        align-items: flex-start;
        width: 100%;
    }
}

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

    .dashboard-cards {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
}

.dashboard-panel canvas {
    width: 100% !important;
    height: 220px !important;
}

.intelligence-grid canvas {
    width: 100% !important;
    height: 200px !important;
}

.dashboard-tech-row {
    cursor: pointer;
}
.dashboard-card {
    appearance: none;
    font-family: inherit;
}
