/* Importa a fonte Poppins do Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --sidebar-bg: #111827;
    --sidebar-text: #d1d5db;
    --sidebar-text-hover: #ffffff;
    --page-bg: #f9fafb;
    --box-bg: #ffffff;
    --border-color: #e5e7eb;
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    background-color: var(--page-bg);
    color: #333;
}

/* --- Layout Principal do Painel --- */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
}

.sidebar-header {
    padding: 0 20px 20px 20px;
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    border-bottom: 1px solid #374151;
}

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

.sidebar nav {
    flex-grow: 1;
    margin-top: 20px;
}

.sidebar nav a {
    display: block;
    color: var(--sidebar-text);
    text-decoration: none;
    padding: 15px 20px;
    transition: background-color 0.2s, color 0.2s;
}

.sidebar nav a:hover, .sidebar nav a.active {
    background-color: #374151;
    color: var(--sidebar-text-hover);
}

.sidebar-footer {
    padding: 20px;
    font-size: 0.8rem;
    text-align: center;
}

.main-content {
    flex-grow: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
}

.content-box {
    background-color: var(--box-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    flex-grow: 1;
}

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

footer {
    text-align: center;
    margin-top: 40px;
    color: #6c757d;
    font-size: 0.9rem;
}


/* --- Tela de Login --- */
.login-body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-container {
    background-color: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-container h1 {
    margin-bottom: 30px;
}

/* --- Elementos Gerais --- */
table { width: 100%; border-collapse: collapse; margin-top: 20px; }
th, td { padding: 12px 15px; border: 1px solid var(--border-color); text-align: left; vertical-align: middle; }
th { background-color: #f9fafb; font-weight: 600; }
.status-dot { height: 12px; width: 12px; border-radius: 50%; display: inline-block; margin-right: 8px; }
.connected { background-color: #28a745; }
.disconnected { background-color: #dc3545; }
.no-instance { background-color: #ffc107; }
button { background: var(--primary-color); color: white; padding: 12px 20px; border: none; border-radius: 6px; cursor: pointer; font-size: 15px; font-weight: 500; font-family: 'Poppins', sans-serif; transition: background-color 0.2s; }
button:hover { background: var(--primary-hover); }
.action-button { background: #6c757d; }
.action-button:hover { background: #5a6268; }
a { color: var(--primary-color); text-decoration: none; }
input { width: 100%; padding: 12px; margin: 10px 0 20px 0; border-radius: 6px; border: 1px solid #ccc; box-sizing: border-box; font-family: 'Poppins', sans-serif; }
label { display: block; text-align: left; margin-top: 1rem; font-weight: 500; }
.error, .success { padding: 1rem; border-radius: 5px; margin: 1rem 0; }
.error { color: #721c24; background-color: #f8d7da; border: 1px solid #f5c6cb; }
.success { color: #155724; background-color: #d4edda; border: 1px solid #c3e6cb; }

/* --- Novos Estilos para Botões e Status --- */

/* Estilo base para todos os botões de ação na tabela */
.btn {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}
.btn:hover {
    opacity: 0.85;
}
.btn i {
    margin-right: 5px; /* Espaço entre o ícone e o texto */
}

/* Cores específicas para cada ação */
.btn-primary { background-color: #007bff; }
.btn-secondary { background-color: #6c757d; }
.btn-danger { background-color: #dc3545; }

/* Estilo para os botões de Status */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px; /* Deixa bem arredondado */
    font-weight: 600;
    font-size: 0.85rem;
    color: #fff;
}
.status-badge i {
    margin-right: 8px;
}

.status-connected {
    background-color: #28a745;
}
.status-disconnected {
    background-color: #dc3545;
}
.status-no-instance {
    background-color: #ffc107;
    color: #212529;
}

/* Ajustes na célula de ações da tabela */
.actions-cell {
    display: flex;
    gap: 8px;
    align-items: center;
}
.actions-cell form {
    margin: 0;
}
/* Adicione este código ao final do seu arquivo CSS */

.login-container .login-logo {
    font-size: 42px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
}

.login-container h2 {
    color: #6c757d;
    font-size: 16px;
    margin-top: 0;
    margin-bottom: 30px;
    font-weight: normal;
}

/* Adicione este código ao final do seu arquivo */

.login-container .subtitle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px; /* Espaço entre o ícone e o texto */
    margin-bottom: 30px;
}

.login-container .subtitle-container h2 {
    color: #6c757d;
    font-size: 16px;
    margin: 0;
    font-weight: normal;
    text-align: center;
}

.login-container .fa-whatsapp {
    font-size: 30px;
    /* Efeito de degradê para o ícone */
    background: linear-gradient(45deg, #25D366, #128C7E);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

/* Adicione este código ao final do seu arquivo */

/* Torna o container a referência para o posicionamento do ícone */
.login-container {
    position: relative;
    padding-top: 50px; /* Aumenta o espaço no topo para o ícone não sobrepor o texto */
}

/* Estiliza o círculo que envolve o ícone */
.login-card-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(45deg, #25D366, #128C7E);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -40px; /* Metade da altura para ficar no meio da borda */
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    border: 3px solid #fff;
}

/* Estiliza o ícone do WhatsApp em si (VERSÃO CORRIGIDA) */
.login-card-icon .fa-whatsapp {
    font-size: 45px;
    color: #fff !important; /* Força a cor branca */

    /* Reseta os estilos de degradê que estavam sendo herdados */
    background: none;
    -webkit-background-clip: initial;
    -webkit-text-fill-color: initial;
    background-clip: initial;
}
/* Remove o ícone e o texto que ficavam ao lado do título */
.login-container .subtitle-container .fa-whatsapp {
    display: none;
}
.login-container .subtitle-container {
    gap: 0;
}

/* Adicione este código ao final do seu arquivo */

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid #374151;
    text-align: center;
}

.sidebar-footer .user-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #fff;
    font-weight: 500;
    margin-bottom: 15px;
}

.sidebar-footer .user-info i {
    font-size: 20px;
}

.sidebar-footer .logout-link {
    color: #d1d5db;
    text-decoration: none;
    font-size: 0.9rem;
}

.sidebar-footer .logout-link:hover {
    color: #fff;
}