/* Estilos para o painel admin */
.admin-stats {
    margin-bottom: 30px;
}

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

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    border-left: 4px solid #6a11cb;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.stat-info {
    flex: 1;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #666;
}

.dashboard-content {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-top: 20px;
}

.dashboard-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #6a11cb;
}

.dashboard-card h3 {
    margin-bottom: 15px;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

/* Tabelas administrativas */
.admin-table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.admin-table-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: between;
    align-items: center;
}

.admin-table-header h2 {
    margin: 0;
    color: #333;
}

.search-box {
    display: flex;
    gap: 10px;
}

.search-box input {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    width: 300px;
}

.search-box button {
    background: #6a11cb;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
}

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

.admin-table th,
.admin-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.admin-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

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

/* Botões de ação */
.btn {
    padding: 8px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #6a11cb;
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* 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: 0;
    border-radius: 12px;
    width: 80%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #333;
}

#modal-body {
    padding: 30px;
}

/* Layout de usuários */
.users-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.user-column {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.user-column-header {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    padding: 15px 20px;
    font-weight: 600;
}

.user-list {
    max-height: 500px;
    overflow-y: auto;
}

.user-item {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-item:last-child {
    border-bottom: none;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    color: #333;
}

.user-phone {
    font-size: 12px;
    color: #666;
}

.user-actions {
    display: flex;
    gap: 5px;
}

/* Status badges */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

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

/* Responsividade */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    .users-grid {
        grid-template-columns: 1fr;
    }
    
    .search-box input {
        width: 200px;
    }
    
    .admin-table {
        font-size: 14px;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 10px 5px;
    }
}

.error-message {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.error-message h3 {
    color: #dc3545;
    margin-bottom: 15px;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #6a11cb;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 2s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Estilos para a seção de logs */
.full-width {
    grid-column: 1 / -1;
}

.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.logs-header h3 {
    margin: 0;
    color: #333;
}

.logs-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.logs-controls select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

.logs-container {
    background: #1e1e1e;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #333;
}

.logs-content {
    height: 400px;
    overflow-y: auto;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    color: #d4d4d4;
    background: #1e1e1e;
}

.log-line {
    margin-bottom: 2px;
    padding: 2px 0;
    border-bottom: 1px solid #2d2d2d;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.log-info {
    color: #d4d4d4;
}

.log-error {
    color: #f48771;
    background: rgba(244, 135, 113, 0.1);
    padding: 2px 5px;
    border-radius: 3px;
}

.log-warning {
    color: #ffcc02;
    background: rgba(255, 204, 2, 0.1);
    padding: 2px 5px;
    border-radius: 3px;
}

.log-debug {
    color: #569cd6;
    background: rgba(86, 156, 214, 0.1);
    padding: 2px 5px;
    border-radius: 3px;
}

.no-logs {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 20px;
}

/* Scrollbar personalizada para logs */
.logs-content::-webkit-scrollbar {
    width: 8px;
}

.logs-content::-webkit-scrollbar-track {
    background: #2d2d2d;
}

.logs-content::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.logs-content::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* Responsividade */
@media (max-width: 768px) {
    .logs-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .logs-controls {
        width: 100%;
        justify-content: flex-start;
    }
    
    .logs-content {
        height: 300px;
        font-size: 11px;
    }
}

/* Estilos para o status do WhatsApp */
.whatsapp-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.whatsapp-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.whatsapp-status {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.whatsapp-status.connected {
    background: #d4edda;
    border: 1px solid #c3e6cb;
}

.whatsapp-status.waiting {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
}

.whatsapp-status.disconnected {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.status-indicator.online {
    background: #28a745;
    animation: pulse 2s infinite;
}

.status-indicator.waiting {
    background: #ffc107;
    animation: pulse 1.5s infinite;
}

.status-indicator.offline {
    background: #dc3545;
}

.status-info h4 {
    margin: 0 0 5px 0;
    color: #155724;
}

.whatsapp-status.waiting .status-info h4 {
    color: #856404;
}

.whatsapp-status.disconnected .status-info h4 {
    color: #721c24;
}

.status-info p {
    margin: 0;
    color: #666;
}

.status-info small {
    color: #888;
}

.whatsapp-details {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.whatsapp-details h5 {
    margin: 0 0 10px 0;
    color: #333;
}

.whatsapp-details ul {
    margin: 0;
    padding-left: 20px;
}

.whatsapp-details li {
    margin-bottom: 5px;
    color: #555;
}

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

/* Responsividade */
@media (max-width: 768px) {
    .whatsapp-status-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .whatsapp-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Estilos para ações do WhatsApp */
.whatsapp-actions-info {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #6a11cb;
}

.whatsapp-actions-info h6 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 14px;
}

.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-xs {
    padding: 4px 8px;
    font-size: 11px;
}

.btn-dark {
    background: #343a40;
    border-color: #343a40;
    color: white;
}

.btn-dark:hover {
    background: #23272b;
    border-color: #1d2124;
    color: white;
}

/* Melhorar visualização dos status */
.whatsapp-details ul {
    margin: 0;
    padding-left: 20px;
    font-size: 13px;
}

.whatsapp-details li {
    margin-bottom: 3px;
    color: #555;
    display: flex;
    justify-content: space-between;
}

.whatsapp-details li strong {
    color: #333;
}

/* Tooltip para botões */
button[title] {
    position: relative;
}

button[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
}

/* Responsividade */
@media (max-width: 768px) {
    .action-buttons {
        justify-content: center;
    }
    
    .whatsapp-actions {
        width: 100%;
        justify-content: center;
    }
}

/* Estilos para QR Code automático */
.qrcode-container-auto {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px dashed #6a11cb;
    text-align: center;
}

.qrcode-container-auto h5 {
    margin: 0 0 15px 0;
    color: #6a11cb;
    font-size: 16px;
}

.qrcode-instructions {
    text-align: left;
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #28a745;
}

.qrcode-instructions ol {
    margin: 0;
    padding-left: 20px;
}

.qrcode-instructions li {
    margin-bottom: 8px;
    color: #333;
}

.qrcode-instructions li:last-child {
    margin-bottom: 0;
}

.qrcode-instructions strong {
    color: #6a11cb;
}

.auto-qrcode-display {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 250px;
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin: 15px 0;
    border: 1px solid #ddd;
}

.auto-qrcode-display canvas {
    max-width: 100%;
    height: auto;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 10px;
    background: white;
}

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

.qrcode-text {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    max-height: 200px;
    overflow-y: auto;
}

.qrcode-text pre {
    margin: 0;
    font-size: 8px;
    line-height: 1;
    color: #333;
}

.qrcode-notes {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.qrcode-notes p {
    margin: 5px 0;
    color: #666;
}

.text-muted {
    color: #6c757d !important;
}

/* Animações para o QR Code */
@keyframes pulse-qrcode {
    0% { box-shadow: 0 0 0 0 rgba(106, 17, 203, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(106, 17, 203, 0); }
    100% { box-shadow: 0 0 0 0 rgba(106, 17, 203, 0); }
}

.qrcode-container-auto {
    animation: pulse-qrcode 2s infinite;
}

/* Responsividade */
@media (max-width: 768px) {
    .qrcode-container-auto {
        padding: 15px;
        margin: 15px 0;
    }
    
    .auto-qrcode-display {
        min-height: 200px;
        padding: 15px;
    }
    
    .qrcode-text pre {
        font-size: 6px;
    }
    
    .qrcode-instructions {
        padding: 10px;
    }
}

/* Estilos para QR Code melhorado */
.enhanced-text-qrcode {
    text-align: left;
}

.qr-info {
    background: #e9ecef;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
}

.qr-info p {
    margin: 5px 0;
    font-family: 'Courier New', monospace;
}

.terminal-instruction {
    background: #fff3cd;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    border-left: 4px solid #ffc107;
}

.terminal-instruction h6 {
    color: #856404;
    margin: 0 0 10px 0;
}

.terminal-instruction ol {
    margin: 0;
    padding-left: 20px;
}

.terminal-instruction li {
    margin-bottom: 5px;
    color: #856404;
}

.alternative-solutions {
    text-align: center;
    padding: 15px;
    background: #d1ecf1;
    border-radius: 8px;
    margin: 10px 0;
    border-left: 4px solid #17a2b8;
}

.alternative-solutions h6 {
    color: #0c5460;
    margin: 0 0 10px 0;
}

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

.api-qrcode img {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Melhorar a exibição de texto do QR Code */
.qrcode-text pre {
    font-size: 6px;
    line-height: 1;
    word-wrap: break-word;
    white-space: pre-wrap;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    max-height: 150px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
}

/* Loading states */
.loading {
    text-align: center;
    padding: 20px;
    color: #6c757d;
}

.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #6a11cb;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ESTILOS SIMPLES E FUNCIONAIS PARA QR CODE */
.simple-qrcode {
    text-align: left;
}

.qr-data {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    border: 1px solid #e9ecef;
}

.qr-textarea {
    width: 100%;
    height: 60px;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
    resize: vertical;
    margin: 8px 0;
}

.qr-info {
    text-align: right;
    margin: 5px 0 0 0;
    color: #6c757d;
    font-size: 12px;
}

.qr-instructions {
    background: #e7f3ff;
    padding: 20px;
    border-radius: 8px;
    margin: 15px 0;
    border-left: 4px solid #007bff;
}

.qr-instructions ol {
    margin: 15px 0 0 0;
    padding-left: 20px;
}

.qr-instructions li {
    margin-bottom: 12px;
    color: #004085;
    font-weight: 500;
}

.terminal-note {
    background: #fff3cd;
    padding: 15px;
    border-radius: 6px;
    margin-top: 15px;
    border-left: 4px solid #ffc107;
}

.terminal-note p {
    margin: 8px 0;
    color: #856404;
}

.terminal-note strong {
    color: #723b07;
}

.qr-actions {
    text-align: center;
    padding: 15px;
    background: #d4edda;
    border-radius: 8px;
    margin: 15px 0;
    border-left: 4px solid #28a745;
}

.qr-actions .btn {
    margin: 0 5px;
}

/* Responsividade */
@media (max-width: 768px) {
    .qr-textarea {
        height: 80px;
        font-size: 9px;
    }
    
    .qr-instructions {
        padding: 15px;
    }
    
    .qr-instructions li {
        font-size: 14px;
    }
}

/* ESTILOS PARA QR CODE VISUAL */
.visual-qrcode {
    text-align: center;
    padding: 20px;
}

.qrcode-image {
    margin: 20px 0;
    padding: 20px;
    background: white;
    border-radius: 12px;
    border: 2px solid #6a11cb;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.qrcode-image img {
    display: block;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.scan-instructions {
    background: #e7f3ff;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border-left: 4px solid #007bff;
    text-align: left;
}

.scan-instructions ol {
    margin: 15px 0 0 0;
    padding-left: 20px;
}

.scan-instructions li {
    margin-bottom: 10px;
    color: #004085;
    font-weight: 500;
}

.qrcode-actions {
    margin-top: 20px;
}

.qrcode-actions .btn {
    margin: 0 8px;
}

/* Estilos para o modal de dados */
.qr-textarea-modal {
    width: 100%;
    height: 100px;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f8f9fa;
    resize: none;
    margin: 10px 0;
}

/* Animações */
@keyframes pulse-qr {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.qrcode-image {
    animation: pulse-qr 2s ease-in-out infinite;
}

/* Responsividade */
@media (max-width: 768px) {
    .visual-qrcode {
        padding: 15px;
    }
    
    .qrcode-image {
        padding: 15px;
        margin: 15px 0;
    }
    
    .scan-instructions {
        padding: 15px;
    }
    
    .scan-instructions li {
        font-size: 14px;
    }
}

/* Estilos para o novo sistema de logs */
.log-stats {
    background: #e9ecef;
    padding: 8px 15px;
    border-bottom: 1px solid #dee2e6;
    font-size: 12px;
    color: #6c757d;
}

.live-control {
    display: flex;
    align-items: center;
    margin-left: 10px;
}

/* Switch toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #28a745;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* Novos tipos de log */
.log-system {
    color: #6f42c1;
    background: rgba(111, 66, 193, 0.1);
}

.temp-message {
    animation: fadeInOut 2s ease-in-out;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(-10px); }
    20% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-10px); }
}

/* Melhorar scroll */
.logs-content {
    scroll-behavior: smooth;
}

/* Loading states */
.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

/* Loading states */
.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

/* Estilos para Gerenciamento de Banners */
.banner-management {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.banner-management h2 {
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #6a11cb;
    padding-bottom: 10px;
}

.banner-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.banner-section {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    background: #f8f9fa;
}

.banner-section h3 {
    margin: 0 0 15px 0;
    color: #6a11cb;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.banner-info {
    background: #e7f3ff;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    border-left: 4px solid #007bff;
}

.banner-info p {
    margin: 5px 0;
    font-size: 13px;
    color: #004085;
}

.banner-info strong {
    color: #002752;
}

.banner-upload-area {
    border: 2px dashed #6a11cb;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    background: white;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.banner-upload-area:hover {
    border-color: #2575fc;
    background: #f0f4ff;
}

.banner-upload-area.dragging {
    border-color: #28a745;
    background: #d4edda;
}

.banner-upload-area input[type="file"] {
    display: none;
}

.upload-icon {
    font-size: 48px;
    color: #6a11cb;
    margin-bottom: 10px;
}

.upload-text {
    color: #666;
    margin: 10px 0;
}

.upload-text strong {
    color: #333;
    display: block;
    margin-top: 5px;
}

.banner-preview-area {
    margin-top: 20px;
}

.banner-preview-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 14px;
}

.banner-preview-grid {
    display: grid;
    gap: 15px;
}

.banner-item {
    position: relative;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    transition: all 0.3s ease;
}

.banner-item:hover {
    border-color: #6a11cb;
    box-shadow: 0 4px 12px rgba(106, 17, 203, 0.2);
}

.banner-item img,
.banner-item video {
    width: 100%;
    height: auto;
    display: block;
}

.banner-item-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
}

.banner-item-info {
    padding: 10px;
    background: rgba(255, 255, 255, 0.95);
    font-size: 12px;
    color: #666;
}

.banner-item-info strong {
    color: #333;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
}

.banner-empty {
    text-align: center;
    padding: 40px;
    color: #999;
    font-style: italic;
}

.banner-empty i {
    font-size: 48px;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* Modal de confirmação */
.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.modal-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
    color: #856404;
}

.modal-warning i {
    margin-right: 10px;
}

/* Upload Progress */
.upload-progress {
    margin-top: 15px;
    display: none;
}

.upload-progress.active {
    display: block;
}

.progress-bar-container {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
}

.progress-text {
    text-align: center;
    font-size: 13px;
    color: #666;
}

/* Responsividade */
@media (max-width: 768px) {
    .banner-sections {
        grid-template-columns: 1fr;
    }
    
    .banner-item-actions {
        opacity: 1;
    }
    
    .upload-icon {
        font-size: 36px;
    }
}

/* MODIFICAÇÃO: Estilo para a pré-visualização de banners no painel de admin */
.banner-preview {
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #f0f0f0;
}

/* Banner desktop - retangular */
.banner-preview.desktop {
  width: 250px;
  height: 80px;
}

/* Banner mobile - quadrado */
.banner-preview.mobile {
  width: 120px;
  height: 120px;
}

.banner-preview img,
.banner-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Garante que a imagem cubra a área sem distorcer */
  display: block;
}

/* MODIFICAÇÃO: Aumenta o tamanho do modal para visualização de banners */
.modal-content:has(.banner-preview-modal) {
    max-width: 90vw;
    width: auto;
}

.banner-preview-modal {
    text-align: center; /* Centraliza a imagem/vídeo dentro do corpo do modal */
}

/* Identificação visual dos tipos de banner */
.banner-item.desktop-banner::before {
  content: "🖥️ Desktop";
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(106, 17, 203, 0.9);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  z-index: 2;
}

.banner-item.mobile-banner::before {
  content: "📱 Mobile";
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(37, 117, 252, 0.9);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  z-index: 2;
}

/* Estilos para Drag and Drop de Banners */
.banner-item {
    cursor: grab; /* Indica que o item é arrastável */
}

.banner-item:active {
    cursor: grabbing;
}

/* Estilo para o item "fantasma" que aparece enquanto arrasta */
.sortable-ghost {
    opacity: 0.4;
    background: #c8ebfb;
    border: 2px dashed #6a11cb;
}

/* ============================================= */
/* ESTILOS PARA LINK DE BANNER (NOVO)              */
/* ============================================= */

.banner-item {
    /* Ajustar o layout para incluir o novo controle */
    display: flex;
    flex-wrap: wrap; /* Permite que os itens quebrem a linha */
    align-items: center;
    gap: 10px;
    padding: 10px;
}

.banner-preview {
    flex-shrink: 0; /* Não encolher a preview */
    width: 120px; /* Tamanho fixo para a preview */
    height: 70px;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 4px;
}

.banner-preview img,
.banner-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-item-info {
    flex-grow: 1; /* Ocupa o espaço disponível */
    flex-basis: 150px; /* Tamanho base */
    padding: 0;
}

.banner-item-info strong {
    font-size: 13px;
    word-break: break-all;
}

.banner-link-control {
    flex-grow: 2; /* Ocupa mais espaço */
    flex-basis: 250px; /* Tamanho base maior */
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 5px;
    background: #f0f0f0;
    border-radius: 4px;
}

.banner-link-control label {
    font-size: 11px;
    font-weight: 600;
    color: #555;
}

.banner-link-control select {
    width: 100%;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 12px;
    background: white;
}

.banner-link-control small {
    font-size: 11px;
    color: #333;
    word-break: break-all;
}

.banner-link-control small span {
    font-weight: 600;
    color: #0056b3;
}

.banner-item-actions {
    flex-shrink: 0; /* Não encolher */
    padding: 0;
    margin-left: auto; /* Alinha à direita */
}

/* ============================================= */
/* ESTILOS PARA CONTROLE DE ORDEM (NOVO)         */
/* ============================================= */

.order-control {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #f8f9fa;
    padding: 5px 8px;
    border-radius: 6px;
    border: 1px solid #ddd;
    margin-top: 5px; /* Adiciona espaço se quebrar a linha */
    
    /* Faz ocupar a linha inteira se quebrar */
    flex-basis: 100%; 
    max-width: fit-content;
}

.order-control label {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin: 0;
    white-space: nowrap;
}

.order-control select {
    padding: 2px 5px; /* Ajusta o padding para se alinhar com btn-sm */
    border: 1px solid #ccc;
    border-radius: 4px;
    background: white;
    font-size: 12px;
    font-weight: 600;
}

/* ============================================= */
/* ESTILOS MELHORADOS PARA ANALYTICS */
/* ============================================= */

.analytics-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 25px;
    margin-bottom: 30px;
}

.analytics-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.analytics-header h2 {
    color: #333;
    margin-bottom: 10px;
    font-size: 28px;
    font-weight: 700;
}

.analytics-header p {
    color: #666;
    font-size: 16px;
    margin: 0;
}

/* Controles de Filtro */
.analytics-controls {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.period-selector {
    display: flex;
    gap: 10px;
    align-items: center;
}

.period-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.period-btn.active {
    background: #6a11cb;
    color: white;
    border-color: #6a11cb;
}

.period-btn:hover:not(.active) {
    background: #f0f0f0;
}

.date-range {
    display: flex;
    gap: 10px;
    align-items: center;
}

.date-range input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
}

.export-actions {
    display: flex;
    gap: 10px;
}

/* Grid de Gráficos Melhorado */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
}

.analytics-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #f0f0f0;
}

.analytics-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.analytics-card.full-width {
    grid-column: 1 / -1;
}

.analytics-card h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.analytics-card h3 i {
    color: #6a11cb;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Estilos específicos para diferentes tipos de gráficos */
.chart-legend {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* Cards de Comparação */
.comparison-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.comparison-card {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid #6a11cb;
}

.comparison-card .comparison-value {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.comparison-card .comparison-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.comparison-card.positive .comparison-value {
    color: #28a745;
}

.comparison-card.negative .comparison-value {
    color: #dc3545;
}

/* Tooltips personalizados para gráficos */
.chart-tooltip {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    pointer-events: none;
}

/* Animações de carregamento melhoradas */
.analytics-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #666;
}

.analytics-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #6a11cb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

/* Estados vazios */
.analytics-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.analytics-empty i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Responsividade Melhorada */
@media (max-width: 1200px) {
    .analytics-grid {
        grid-template-columns: 1fr;
    }
    
    .analytics-card.full-width {
        grid-column: 1;
    }
}

@media (max-width: 768px) {
    .analytics-content {
        padding: 15px;
    }
    
    .analytics-metrics {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .analytics-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .period-selector {
        justify-content: center;
    }
    
    .date-range {
        flex-direction: column;
    }
    
    .export-actions {
        justify-content: center;
    }
    
    .chart-container {
        height: 250px;
    }
    
    .comparison-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .analytics-metrics {
        grid-template-columns: 1fr;
    }
    
    .period-selector {
        flex-wrap: wrap;
    }
    
    .analytics-card {
        padding: 15px;
    }
    
    .chart-container {
        height: 200px;
    }
}

/* Animações de entrada */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.analytics-card {
    animation: fadeInUp 0.5s ease-out;
}

.analytics-card:nth-child(1) { animation-delay: 0.1s; }
.analytics-card:nth-child(2) { animation-delay: 0.2s; }
.analytics-card:nth-child(3) { animation-delay: 0.3s; }
.analytics-card:nth-child(4) { animation-delay: 0.4s; }
.analytics-card:nth-child(5) { animation-delay: 0.5s; }

/* ============================================= */
/* ESTILOS PARA OS FILTROS DE ANALYTICS (NOVOS)  */
/* ============================================= */

.analytics-controls {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Permite quebrar a linha em telas menores */
    gap: 20px;
    border: 1px solid #eee;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px; /* Espaço entre os itens do grupo */
    flex-wrap: wrap;
}

.filter-group label {
    font-weight: 600;
    color: #555;
    font-size: 14px;
    margin: 0;
}

/* Estilo para os botões de período (7, 30, 90 dias) */
.filter-btn {
    border: 1px solid #ddd !important; /* !important para sobrepor .btn */
    background: white !important;
    color: #333 !important;
    font-weight: 500;
}

/* Reutiliza a cor primária para o botão ativo */
.filter-btn.active {
    background: #6a11cb !important;
    color: white !important;
    border-color: #6a11cb !important;
}

.filter-btn:hover:not(.active) {
    background: #f0f0f0 !important;
}

/* Estilo para os inputs de data (reutilizando estilo do .search-box input) */
.filter-group input[type="date"] {
    padding: 8px 12px; /* Um pouco menor para se alinhar com btn-sm */
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #333;
    line-height: 1.5; /* Garante altura consistente */
}

/* Estilo para o "até" entre as datas */
.filter-group span {
    font-size: 14px;
    color: #666;
    margin: 0 5px;
}

/* Responsividade para os filtros */
@media (max-width: 992px) {
    .analytics-controls {
        flex-direction: column; /* Empilha os grupos de filtro */
        align-items: stretch; /* Faz os grupos ocuparem 100% da largura */
    }

    .filter-group {
        justify-content: center; /* Centraliza os itens */
    }
}

@media (max-width: 480px) {
    .filter-group {
        flex-direction: column; /* Empilha os itens dentro do grupo */
        align-items: stretch;
    }

    .filter-group input[type="date"] {
        width: 100%;
        box-sizing: border-box; /* Garante que o padding não quebre o layout */
        text-align: center;
    }

    .filter-group span {
        margin: 5px 0;
    }
}

/* Estilos para a Edição de Mensagens do WhatsApp */
.whatsapp-msg-editor {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.whatsapp-msg-editor h4 {
    color: #007bff; /* Cor azul primária */
    font-size: 18px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.msg-editor-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Estilo para a textarea no modal de edição */
.msg-edit-textarea {
    width: 100%;
    min-height: 300px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    box-sizing: border-box;
}

.modal-content:has(.msg-edit-textarea) {
    max-width: 800px;
}

.modal-actions-save {
    text-align: right;
    margin-top: 20px;
}

/* Estilos para a Edição de Mensagens do WhatsApp */
.whatsapp-msg-editor {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.whatsapp-msg-editor h4 {
    color: #007bff; /* Cor azul primária */
    font-size: 18px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.msg-editor-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Estilo para a textarea no modal de edição */
.msg-edit-textarea {
    width: 100%;
    min-height: 300px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    box-sizing: border-box;
}

.modal-content:has(.msg-edit-textarea) {
    max-width: 800px;
}

.modal-actions-save {
    text-align: right;
    margin-top: 20px;
}

/* ============================================= */
/* ESTILOS CORRETOS PARA MENU MOBILE */
/* ============================================= */

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: #333;
    cursor: pointer;
    padding: 10px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
    background: #f0f0f0;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    .nav-buttons {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        flex-direction: column;
        padding: 20px;
        z-index: 1000;
        gap: 10px;
    }
    
    .nav-buttons.active {
        display: flex;
    }
    
    /* REUTILIZANDO OS ESTILOS EXISTENTES DOS BOTÕES */
    .nav-buttons .nav-btn {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 15px 20px;
        background: #f8f9fa;
        border: 1px solid #e9ecef;
        border-radius: 8px;
        text-decoration: none;
        color: #333;
        font-size: 14px;
        font-weight: 500;
        transition: all 0.3s ease;
        width: 100%;
        justify-content: flex-start;
    }
    
    .nav-buttons .nav-btn:hover {
        background: #e9ecef;
        transform: translateX(5px);
    }
    
    .nav-buttons .nav-btn.active {
        background: #6a11cb;
        color: white;
        border-color: #6a11cb;
    }
    
    .nav-buttons .nav-btn.active:hover {
        background: #5a0db9;
    }
    
    .header-left {
        position: relative;
    }
    
    /* Ajuste para o layout do header */
    .header-right .user-info {
        display: none;
    }
}