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

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

/* Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #25D366, #128C7E);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    color: #128C7E;
    margin-bottom: 20px;
    text-align: center;
}

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

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

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

.btn-primary {
    background: #25D366;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #128C7E;
}

.alert {
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}

.alert.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

/* Dashboard */
.dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: #128C7E;
    color: white;
    padding: 20px 0;
}

.user-info {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.user-info h3 {
    margin-bottom: 5px;
}

.user-info p {
    opacity: 0.8;
    font-size: 14px;
}

.menu {
    list-style: none;
    padding: 20px 0;
}

.menu li {
    padding: 0;
}

.menu a {
    display: block;
    padding: 12px 20px;
    color: white;
    text-decoration: none;
    transition: background 0.3s;
    border-left: 4px solid transparent;
}

.menu a:hover {
    background: rgba(255,255,255,0.1);
    border-left-color: #25D366;
}

.menu li.active a {
    background: rgba(255,255,255,0.15);
    border-left-color: #25D366;
}

.badge {
    background: #25D366;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    margin-left: 5px;
}

.content {
    flex: 1;
    padding: 20px;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.status-whatsapp {
    font-size: 14px;
}

.status {
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: bold;
}

.status.conectado {
    background: #d4edda;
    color: #155724;
}

.status.aguardando_qrcode {
    background: #fff3cd;
    color: #856404;
}

.status.desconectado {
    background: #f8d7da;
    color: #721c24;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

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

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

.card .number {
    font-size: 32px;
    font-weight: bold;
    color: #128C7E;
}

.actions {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

/* QR Code Page */
.qrcode-container {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.instructions {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 5px;
}

.instructions ol {
    margin-left: 20px;
    margin-top: 10px;
}

.qrcode-display {
    text-align: center;
    margin: 30px 0;
}

.qrcode-display img {
    max-width: 300px;
    border: 1px solid #ddd;
    padding: 10px;
    background: white;
}

.session-id {
    margin-top: 10px;
    font-family: monospace;
    color: #666;
    font-size: 14px;
}

.qrcode-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.connected-message {
    text-align: center;
    padding: 40px 20px;
}

.connected-message h3 {
    color: #25D366;
    margin-bottom: 20px;
}

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

.messages-list {
    max-height: 600px;
    overflow-y: auto;
}

.message-card {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 15px;
}

.message-card.enviada {
    border-left: 4px solid #25D366;
    background: #f8fff8;
}
/* Tabelas */
.table-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    overflow-x: auto;
}

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

.data-table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

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

.data-table tr:hover {
    background: #f8f9fa;
}

/* Badges de nível */
.badge.nivel-admin {
    background: #dc3545;
    color: white;
}

.badge.nivel-supervisor {
    background: #ffc107;
    color: #212529;
}

.badge.nivel-atendente {
    background: #28a745;
    color: white;
}

/* Status */
.status.ativo {
    background: #d4edda;
    color: #155724;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
}

.status.inativo {
    background: #f8d7da;
    color: #721c24;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
}

/* Botões pequenos */
.btn-small {
    padding: 5px 10px;
    font-size: 12px;
    margin: 2px;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

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

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

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #666;
}

.close-modal:hover {
    color: #000;
}

/* Checkbox */
.checkbox {
    display: flex;
    align-items: center;
}

.checkbox input {
    margin-right: 10px;
}

/* Alertas */
.alert.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
}

/* Notificações */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    color: white;
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: #28a745;
}

.notification.error {
    background: #dc3545;
}

.notification.warning {
    background: #ffc107;
    color: #212529;
}

/* Ações da tabela */
.actions {
    display: flex;
    gap: 5px;
}

/* Responsividade */
@media (max-width: 768px) {
    .dashboard {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        padding: 10px 0;
    }
    
    .menu {
        display: flex;
        overflow-x: auto;
        padding: 10px;
    }
    
    .menu li {
        flex-shrink: 0;
    }
    
    .menu a {
        padding: 10px 15px;
        border-left: none;
        border-bottom: 3px solid transparent;
    }
    
    .menu li.active a {
        border-left: none;
        border-bottom-color: #25D366;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .content-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}
.message-card