/* CRM Recebíveis - Estilos Principais */

/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    line-height: 1.6;
    color: #333;
}

/* =============================================================================
   BACKGROUND E LAYOUT EXECUTIVO
   ============================================================================= */

/* Background executivo para o corpo da aplicação */
body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 25% 25%, rgba(102, 126, 234, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(118, 75, 162, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Main content com backdrop executivo */
.main-content {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(20px);
    border-radius: 0;
    min-height: calc(100vh - 80px);
    position: relative;
}

/* Container principal */
.container {
    background: transparent;
}

/* Section styling executivo */
.section {
    margin: 5px;
    background: transparent;
    position: relative;
}

.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 15px;
    right: 15px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.2), transparent);
}

/* Header melhorado */
.header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 50%, #2c3e50 100%);
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.2);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Scrollbar customizada executiva */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 50%, #2c3e50 100%);
    border-radius: 4px;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 50%, #2c3e50 100%);
}

/* Animações suaves globais */
* {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, 
                box-shadow 0.3s ease, transform 0.3s ease;
}

/* Selection styling executivo */
::selection {
    background: rgba(102, 126, 234, 0.2);
    color: #2c3e50;
}

::-moz-selection {
    background: rgba(102, 126, 234, 0.2);
    color: #2c3e50;
}

/* =============================================================================
   DRAG AND DROP - ESTILOS MELHORADOS
   ============================================================================= */

/* Lead card durante drag */
.lead-card.dragging {
    opacity: 0.7;
    transform: rotate(3deg) scale(0.98);
    border: 2px dashed #007bff;
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
    background: linear-gradient(135deg, #f8f9ff 0%, #e3f2fd 100%);
    cursor: grabbing;
    z-index: 1000;
    position: relative;
}

/* Área de drop ativa */
.funil-vendas-content.drag-over {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.05) 0%, rgba(0, 123, 255, 0.1) 100%);
    border: 2px dashed #007bff;
    border-radius: 12px;
    transform: scale(1.02);
    box-shadow: inset 0 0 20px rgba(0, 123, 255, 0.1);
    position: relative;
}

/* Feedback visual adicional */
.funil-vendas-content.drag-over::before {
    content: '📋 Solte o lead aqui';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 123, 255, 0.9);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    z-index: 10;
    animation: pulseDropZone 1s ease-in-out infinite;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

@keyframes pulseDropZone {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1); 
        opacity: 0.9;
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.05); 
        opacity: 1;
    }
}

/* Cursor durante drag */
.lead-card[draggable="true"] {
    cursor: grab;
}

.lead-card[draggable="true"]:active {
    cursor: grabbing;
}

/* Estado vazio melhorado */
.stage-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-style: italic;
    position: relative;
}

.stage-empty::before {
    content: '📋';
    font-size: 2rem;
    display: block;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* Animação suave para lead cards */
.lead-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lead-card:hover:not(.dragging) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Splash Screen de Autenticação */
.auth-splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 50%, #2c3e50 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.5s ease-in;
}

.auth-card {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    text-align: center;
    min-width: 400px;
    max-width: 500px;
    animation: slideUp 0.5s ease-out;
}

.auth-logo {
    margin-bottom: 20px;
}

.auth-logo i {
    font-size: 48px;
    color: linear-gradient(135deg, #2c3e50 0%, #34495e 50%, #2c3e50 100%);
}

.auth-title {
    font-size: 28px;
    color: #333;
    margin-bottom: 8px;
    font-weight: 600;
}

.auth-subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 16px;
}

.auth-input-group {
    position: relative;
    margin-bottom: 20px;
}

.auth-input {
    width: 100%;
    padding: 15px 50px 15px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.auth-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.2);
}

.auth-input-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 18px;
}

.auth-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 50%, #2c3e50 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.auth-loading {
    display: none;
    margin-top: 20px;
    color: #666;
}

.auth-error {
    margin-top: 15px;
    color: #dc3545;
    background: #f8d7da;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
    display: none;
}

/* Container Principal */
.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: none;
}

/* Header */
.header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 50%, #2c3e50 100%);
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1000;
    overflow: visible;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo i {
    font-size: 28px;
}

.logo h1 {
    font-size: 24px;
    font-weight: 600;
}

.nav {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255,255,255,0.15);
    color: white;
    transform: translateY(-1px);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    position: static;
    z-index: auto;
}

.user-info i {
    font-size: 24px;
}

/* Header Actions */
.header-actions {
    position: relative;
    z-index: 9999;
    overflow: visible;
}

.btn-header-action {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 10000;
}

.btn-header-action:hover {
    background: rgba(255,255,255,0.25);
}

.config-dropdown {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 2147483647; /* Máximo z-index possível */
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    min-width: 200px;
    display: none;
    overflow: visible;
    transform: translateY(-10px);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    clip: unset;
    max-height: none;
    contain: none;
}

.config-dropdown.show {
    display: block;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    visibility: visible;
}

.config-dropdown-content {
    position: relative;
    z-index: auto;
    overflow: visible;
    contain: none;
    padding: 8px 0;
}

/* Main Content */
.main-content {
    padding: 30px;
    background: #f8f9fa;
    min-height: calc(100vh - 80px);
}

.section {
    display: none;
}

.section.active {
    display: block;
}

/* Cards */
.card {
    background: white;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.card h3 {
    font-size: 22px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.card h3::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
 
    margin-bottom: 2rem;
    border-radius: 12px;
    
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 28px 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.stat-card:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 8px 32px rgba(240, 147, 251, 0.3);
}

.stat-card:nth-child(2):hover {
    box-shadow: 0 12px 40px rgba(240, 147, 251, 0.4);
}

.stat-card:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 8px 32px rgba(79, 172, 254, 0.3);
}

.stat-card:nth-child(3):hover {
    box-shadow: 0 12px 40px rgba(79, 172, 254, 0.4);
}

.stat-card:nth-child(4) {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    box-shadow: 0 8px 32px rgba(67, 233, 123, 0.3);
}

.stat-card:nth-child(4):hover {
    box-shadow: 0 12px 40px rgba(67, 233, 123, 0.4);
}

.stat-icon {
    font-size: 48px;
    margin-right: 20px;
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.2);
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.stat-info h3 {
    font-size: 36px;
    font-weight: 700;
    margin: 0 0 8px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.stat-info p {
    font-size: 16px;
    margin: 0;
    opacity: 0.9;
    font-weight: 500;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 32px;
    margin-bottom: 32px;
}

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* Dashboard Grid - Layout Definitivo */
.dashboard-grid {
    display: flex;
    flex-direction: row;
    gap: 20px;
    margin-bottom: 24px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    align-items: start;
}

/* Forçar flexbox em todos os contextos */
#dashboard .dashboard-grid,
.section .dashboard-grid,
.main-content .dashboard-grid {
    display: flex;
    flex-direction: row;
}

/* Card de Ações Rápidas com largura fixa */
.dashboard-grid .card:nth-child(2) {
    width: 280px;
    max-width: 280px;
    min-width: 280px;
    flex-shrink: 0;
}

/* Card de Tarefas com largura flexível */
.dashboard-grid .card:nth-child(1) {
    flex: 1;
    width: auto;
    min-width: 0;
}

/* Resetar qualquer grid que possa interferir */
.dashboard-grid * {
    grid-column: unset;
    grid-row: unset;
}

/* Responsividade para o dashboard grid */
@media (max-width: 768px) {
    .section h2 {
        font-size: 22px;
        margin-bottom: 20px;
    }
    
    .section h2::after {
        width: 40px;
        height: 2px;
    }
    
    .dashboard-grid {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 15px;
        justify-content: center;
    }
    
    .dashboard-grid .card:nth-child(2) {
        flex: 1 1 300px !important;
        width: auto !important;
        min-width: 300px !important;
        max-width: none !important;
        flex-shrink: 1 !important;
    }
    
    .dashboard-grid .card:nth-child(1) {
        flex: 1 1 300px !important;
        width: auto !important;
        min-width: 300px !important;
        flex-shrink: 1 !important;
    }
}

/* Telas muito pequenas - forçar coluna */
@media (max-width: 640px) {
    .dashboard-grid {
        flex-direction: column !important;
        flex-wrap: nowrap !important;
    }
    
    .dashboard-grid .card:nth-child(1),
    .dashboard-grid .card:nth-child(2) {
        flex: 1 1 auto !important;
        width: 100% !important;
        min-width: auto !important;
        max-width: none !important;
    }
}

/* Botões */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

/* Formulários */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.2);
}

/* Modais */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: white;
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    animation: slideUp 0.3s ease-out;
}

#perfilForm{
    padding: 15px;

}

.modal-content.large {
    max-width: 1000px;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-weight: 600;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #000;
}

.modal-body {
    padding: 24px;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling no iOS */
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

/* Tabelas */
.table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #f8f9fa;
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e9ecef;
}

td {
    padding: 16px;
    border-bottom: 1px solid #e9ecef;
}

tr:hover {
    background: #f8f9fa;
}

/* Badges de Status */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-lead-captado { background: #e3f2fd; color: #1976d2; }
.status-primeiro-contato { background: #f3e5f5; color: #7b1fa2; }
.status-recontato-pendente { background: #fff3e0; color: #f57c00; }
.status-agendamento-feito { background: #e8f5e8; color: #388e3c; }
.status-aguardando-documentos { background: #fff8e1; color: #f9a825; }
.status-em-negociacao { background: #e1f5fe; color: #0277bd; }
.status-aprovado { background: #e8f5e8; color: #2e7d32; }
.status-reprovado { background: #ffebee; color: #c62828; }
.status-contrato-assinado { background: #e8f5e8; color: #1b5e20; }

/* Badges de Potencial */
.potencial-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.potencial-alto { background: #e8f5e8; color: #2e7d32; }
.potencial-medio { background: #fff8e1; color: #f9a825; }
.potencial-baixo { background: #ffebee; color: #c62828; }

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* =============================================================================
   MENU HAMBÚRGUER PARA MOBILE
   ============================================================================= */

/* Botão hambúrguer - apenas para smartphones e tablets */
.mobile-menu-toggle {
    display: none; /* Escondido por padrão em todas as resoluções */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    position: relative;
    border-radius: 10px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.mobile-menu-toggle:focus {
    outline: none;
}



/* Hambúrguer simples */
.mobile-menu-toggle span {
    display: block;
    height: 2px;
    width: 20px;
    background: white;
    margin: 3px 0;
    border-radius: 1px;
    transition: all 0.3s ease;
}

/* Animação X quando ativo */
.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Responsividade */
@media (max-width: 768px) {
    .header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0;
        position: relative;
    }
    
    /* Mostrar botão hambúrguer no mobile */
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Esconder navegação normal no mobile */
    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 8px 32px rgba(0,0,0,0.3);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 1000;
        opacity: 0;
        transform: translateY(-20px);
        transition: all 0.3s ease;
    }
    
    /* Mostrar navegação quando menu está aberto */
    .nav.mobile-open {
        display: flex;
        opacity: 1;
        transform: translateY(0);
    }
    
    /* Links de navegação mobile */
    .nav-link {
        padding: 15px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        text-align: left;
        width: 100%;
        transition: all 0.3s ease;
        background: rgba(255, 255, 255, 0.05);
        color: rgba(255, 255, 255, 0.9);
        border-radius: 8px;
        margin-bottom: 5px;
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .nav-link:hover {
        background: rgba(255, 255, 255, 0.15);
        transform: translateX(5px);
        color: #ffffff;
    }
    
    .nav-link:last-child {
        border-bottom: none;
        margin-bottom: 0;
    }
    
    .nav-link.active {
        background: rgba(102, 126, 234, 0.2);
        border-left: 3px solid #667eea;
        color: #ffffff;
    }
    
    /* User info no mobile - esconder por padrão */
    .user-info {
        display: none;
    }
    
    /* Quando o menu mobile está aberto, mostrar user-info dentro do nav */
    .nav.mobile-open .mobile-user-info {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 20px 0;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        margin-top: 10px;
        gap: 15px;
    }
    
    .nav.mobile-open .mobile-user-info .user-welcome {
        color: white;
        font-size: 14px;
        text-align: center;
    }
    
    .nav.mobile-open .mobile-user-info .user-icon {
        color: white;
        font-size: 2em;
    }
    
    .nav.mobile-open .mobile-user-info .mobile-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .nav.mobile-open .mobile-user-info .mobile-config-item {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 16px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        color: white;
        text-decoration: none;
        transition: all 0.3s ease;
        width: 100%;
        box-sizing: border-box;
    }
    
    .nav.mobile-open .mobile-user-info .mobile-config-item:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: translateX(5px);
    }
    
    .nav.mobile-open .mobile-user-info .mobile-config-item.logout {
        background: rgba(220, 53, 69, 0.2);
        border: 1px solid rgba(220, 53, 69, 0.3);
    }
    
    .nav.mobile-open .mobile-user-info .mobile-config-item.logout:hover {
        background: rgba(220, 53, 69, 0.3);
    }
    
    .main-content {
        padding: 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
    }
}

/* Responsividade adicional para mobile */
@media (max-width: 768px) {
    /* Stats cards em grid mobile-friendly */
    .stats-grid-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-card h3 {
        font-size: 1.5em;
    }
    
    .stat-card p {
        font-size: 0.85em;
    }
    
    /* Quick actions responsivo */
    .quick-actions {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .quick-actions .btn {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
        font-size: 14px;
    }
    
    /* Headers executivos responsivos */
    .funil-executive-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .funil-header-content {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .funil-action-button {
        width: 100%;
    }
    
    .funil-action-button .btn {
        width: 100%;
    }
    
    /* Ajustes de tipografia mobile */
    .funil-title-group h2 {
        font-size: 1.5em;
    }
    
    .funil-description {
        font-size: 0.9em;
    }
    
    /* Filtros responsivos */
    .filters {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-group input,
    .filter-group select {
        width: 100%;
        padding: 10px;
    }
    
    /* Cards responsivos */
    .card {
        padding: 16px;
        margin-bottom: 16px;
    }
    
    .card h3 {
        font-size: 1.2em;
        margin-bottom: 12px;
    }
    
    /* Tabela responsiva */
    .table-container {
        overflow-x: auto;
    }
    
    .table-header-info {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    #leads-table {
        min-width: 600px;
    }
    
    /* Paginação responsiva */
    .pagination-container {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    
    .pagination-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* Pipeline/Funil responsivo */
    .pipeline-stages {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .pipeline-stage {
        min-height: auto;
    }
    
    /* Agenda responsiva */
    .agenda-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .calendar-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .calendar-header h3 {
        order: 1;
        margin: 0;
    }
    
    .calendar-header button {
        width: 100%;
        max-width: 200px;
    }
    
    /* Modal responsivo aprimorado */
    .modal-content {
        width: 95%;
        max-width: 500px;
        margin: 10px auto;
        max-height: 92vh;
        overflow-y: auto;
    }
    
    .modal-content.large {
        max-width: 95%;
        margin: 10px auto;
    }
    
    .modal-header {
        padding: 12px 16px;
        position: sticky;
        top: 0;
        background: #f8f9fa;
        z-index: 10;
    }
    
    .modal-header h3 {
        font-size: 18px;
    }
    
    .modal-body {
        padding: 12px;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100%;
        padding: 12px;
        font-size: 16px; /* Evita zoom no iOS */
    }
    
    .form-actions {
        flex-direction: column-reverse;
        gap: 10px;
    }
    
    .form-actions .btn {
        width: 100%;
        margin: 0;
    }
}

/* Responsividade para smartphones pequenos */
@media (max-width: 480px) {
    /* Header ainda mais compacto */
    .header {
        padding: 10px 15px;
    }
    
    .logo h1 {
        font-size: 1.2em;
    }
    
    .logo i {
        font-size: 1.5em;
    }
    
    /* Cabeçalhos de seção alinhados para telas pequenas */
    .funil-executive-header,
    .section .funil-executive-header,
    .leads-section .funil-executive-header,
    .agenda-section .funil-executive-header,
    .relatorios-section .funil-executive-header,
    .funil-section .funil-executive-header {
        margin-left: -15px !important;
        margin-right: -15px !important;
        margin-top: -15px !important;
    }
    
    /* Stats em coluna única */
    .stats-grid-content {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .stat-card {
        padding: 12px;
        text-align: center;
    }
    
    /* Main content com menos padding */
    .main-content {
        padding: 15px;
    }
    
    /* Cabeçalhos de seção alinhados */
    .funil-executive-header {
        margin-left: -15px !important;
        margin-right: -15px !important;
        margin-top: -15px !important;
        margin-bottom: 2rem !important;
        min-width: 300px;
        max-width: 100vw;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    /* Garantir alinhamento para todos os cabeçalhos de seção */
    .section .funil-executive-header,
    .leads-section .funil-executive-header,
    .agenda-section .funil-executive-header,
    .relatorios-section .funil-executive-header,
    .funil-section .funil-executive-header {
        margin-left: -15px !important;
        margin-right: -15px !important;
        margin-top: -15px !important;
        min-width: 300px;
        max-width: 100vw;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    /* Cards mais compactos */
    .card {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    /* Botões menores */
    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    /* Modal ainda mais responsivo */
    .modal-content {
        width: 98%;
        margin: 5px auto;
        max-height: 94vh;
    }
    
    .modal-content.large {
        width: 98%;
    }
    
    .modal-header {
        padding: 10px 12px;
    }
    
    .modal-header h3 {
        font-size: 16px;
    }
    
    .close {
        font-size: 24px;
    }
    
    .modal-body {
        padding: 10px;
    }
    
    /* Inputs com tamanho mínimo para touch */
    .form-group input,
    .form-group select,
    .form-group textarea,
    .btn {
        min-height: 44px; /* Padrão Apple para touch targets */
    }
    
    /* Menu mobile mais espaçado para touch */
    .nav-link {
        padding: 18px 0;
        font-size: 16px;
    }
    
    /* User info mais compacto */
    .user-info {
        gap: 8px;
    }
    
    .user-info i {
        font-size: 1.2em;
    }
    
    /* Config dropdown mais acessível */
    .config-dropdown {
        right: 0;
        min-width: 180px;
    }
    
    .config-item {
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* Fix para orientação landscape em mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .modal-content {
        max-height: 85vh;
        margin: 5px auto;
    }
    
    .modal-body {
        max-height: 65vh;
    }
    
    .stats-grid-content {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Notificações */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.notification.success { background: #28a745; }
.notification.error { background: #dc3545; }
.notification.warning { background: #ffc107; color: #212529; }
.notification.info { background: #17a2b8; }

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading Indicator */
.loading-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #666;
    font-size: 14px;
    margin-top: 10px;
}

.loading-indicator i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Modal de Perfil - Alinhado com Cards */
#perfilModal .modal-content {
    background: white;
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

#perfilModal .modal-content:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

#perfilModal .modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-radius: 16px 16px 0 0;
}

#perfilModal .modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

#perfilModal .modal-header h3::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

#perfilModal .modal-body {
    padding: 28px;
}

/* =============================================================================
   DASHBOARD EXECUTIVO - ESTILOS PREMIUM
   ============================================================================= */

/* Dashboard Section - Estilo Executivo */
.section h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 30px;
    color: #ffffff;
    background: white;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.section h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

/* Dashboard Executive Header - Padrão Consistente */
.stats-grid {
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.stats-grid::before {
    content: '';
    position: absolute;
    background: 
        linear-gradient(135deg, #2c3e50 0%, #34495e 50%, #2c3e50 100%)
        linear-gradient(135deg, #2c3e50 0%, #34495e 50%, #2c3e50 100%);
    pointer-events: none;
}

.stats-grid-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    position: relative;
    z-index: 1;
    padding: 15px 0px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.stat-card:hover:before {
    opacity: 0.08;
    transform: scale(1.05);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.stat-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.15),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.stat-card:hover .stat-icon {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 12px 32px rgba(0, 0, 0, 0.2),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.stat-info {
    flex: 1;
}

.stat-info h3 {
    margin: 0;
    font-size: 32px;
    font-weight: 800;
    color: white;
    letter-spacing: -0.5px;
    line-height: 1;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-info p {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    opacity: 0.9;
}

/* Dashboard Grid - Executivo - REMOVIDO para evitar conflito */
/* Regras agora estão unificadas acima */

.dashboard-grid .card {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 
        0 10px 40px rgba(0,0,0,0.08),
        0 4px 16px rgba(0,0,0,0.04);
    border: 1px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.dashboard-grid .card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.dashboard-grid .card:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 20px 60px rgba(0,0,0,0.12),
        0 8px 32px rgba(0,0,0,0.06);
}

.dashboard-grid .card h3 {
    margin: 0 0 25px 0;
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dashboard-grid .card h3::before {
    content: '';
    width: 6px;
    height: 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

/* Quick Actions - Executivo */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.quick-actions .btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px 24px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.quick-actions .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.quick-actions .btn:hover::before {
    left: 100%;
}

.quick-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.quick-actions .btn.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.3);
}

.quick-actions .btn.btn-secondary:hover {
    box-shadow: 0 10px 30px rgba(108, 117, 125, 0.4);
}

.quick-actions .btn.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
}

.quick-actions .btn.btn-success:hover {
    box-shadow: 0 10px 30px rgba(40, 167, 69, 0.4);
}

.quick-actions .btn.btn-warning {
    background: linear-gradient(135deg, #ff9500 0%, #ff6b35 100%);
    box-shadow: 0 6px 20px rgba(255, 149, 0, 0.3);
    color: white;
}

.quick-actions .btn.btn-warning:hover {
    box-shadow: 0 10px 30px rgba(255, 149, 0, 0.4);
}

/* Task List - Executivo */
.task-list {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.task-list::-webkit-scrollbar {
    width: 6px;
}

.task-list::-webkit-scrollbar-track {
    background: #f1f3f4;
    border-radius: 3px;
}

.task-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
}

.task-item {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.task-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.task-item.urgent::before {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
}

.task-item.completed {
    opacity: 0.7;
    background: #f8f9fa;
}

.task-item.completed::before {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.task-item:hover {
    transform: translateX(5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.no-tasks, .no-agenda {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-size: 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    border: 2px dashed #dee2e6;
}

.no-tasks i, .no-agenda i {
    font-size: 48px;
    margin-bottom: 16px;
    color: #adb5bd;
}

/* Activity List - Executivo */
.activity-list {
    padding: 20px 0;
}

.no-activity {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-size: 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    border: 2px dashed #dee2e6;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.activity-item:hover {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-color: #d1d5db;
    transform: translateX(4px);
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.875rem;
    line-height: 1.4;
    margin-bottom: 0.25rem;
}

.activity-description {
    color: #6b7280;
    font-size: 0.75rem;
    line-height: 1.3;
    margin-bottom: 0.25rem;
}

.activity-time {
    color: #9ca3af;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Loading States */
.loading-tasks {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =============================================================================
   FILTROS E PAGINAÇÃO - LAYOUT ROW FORÇADO
   ============================================================================= */

/* Filtros com design moderno e profissional */
.filters {
    display: flex;
    flex-direction: row;
    gap: 24px;
    margin-bottom: 32px;
    padding: 28px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid rgba(255,255,255,0.8);
    align-items: flex-end;
    flex-wrap: wrap;
    position: relative;
    backdrop-filter: blur(10px);
}

.filters::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb, #f5576c);
    border-radius: 16px 16px 0 0;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 180px;
    flex: 1;
}

.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.filter-group input,
.filter-group select {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    background: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    color: #2d3748;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.filter-group input:focus,
.filter-group select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1), 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.filter-group input:hover,
.filter-group select:hover {
    border-color: #cbd5e0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.04);
}

.filter-group input::placeholder {
    color: #a0aec0;
    font-style: italic;
}

.filter-group select {
    cursor: pointer;
}

.filter-group select:hover {
    background: #f7fafc;
}

/* Responsivo melhorado */
@media (max-width: 1024px) {
    .filters {
        gap: 20px;
        padding: 24px;
    }
    
    .filter-group {
        min-width: 160px;
    }
}

@media (max-width: 768px) {
    .filters {
        gap: 16px;
        padding: 20px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        min-width: 100%;
        flex: none;
    }
}

@media (max-width: 480px) {
    .filters {
        padding: 16px;
        margin-bottom: 24px;
    }
    
    .filter-group input,
    .filter-group select {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* Micro-interações e estados especiais para filtros */
.filter-group input:focus,
.filter-group select:focus {
    animation: focusPulse 0.3s ease-out;
}

@keyframes focusPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

/* Estados de carregamento e disabled */
.filter-group input:disabled,
.filter-group select:disabled {
    background: #f7fafc;
    color: #a0aec0;
    cursor: not-allowed;
    border-color: #e2e8f0;
}

/* Indicador visual de filtros ativos */
.filter-group.active::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #667eea;
    border-radius: 50%;
    border: 2px solid white;
}

.filter-group {
    position: relative;
}

/* Tooltip para filtros */
.filter-group[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(45, 55, 72, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
}

.filter-group:hover[data-tooltip]::before {
    opacity: 1;
}



/* Controles de paginação sempre em linha (row) */
.pagination-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination-container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: white;
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 12px 12px;
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    font-size: 14px;
}

.pagination-numbers {
    display: flex;
    flex-direction: row;
    gap: 4px;
    align-items: center;
}

.pagination-number {
    min-width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}

.pagination-ellipsis {
    padding: 0 8px;
    color: #6c757d;
    font-weight: 500;
}

/* Botões de paginação */
.pagination-controls .btn {
    min-width: 35px;
    height: 35px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 12px;
}

.pagination-controls .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsividade para filtros e paginação */
@media (max-width: 768px) {
    .filters {
        flex-direction: column;
        gap: 15px;
    }
    
    .pagination-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .pagination-controls {
        order: 2;
    }
    
    .pagination-info {
        order: 1;
    }
}

/* =============================================================================
   EXECUTIVE HEADER - PADRÃO UNIFICADO
   ============================================================================= */

.executive-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 50%, #2c3e50 100%);
    margin: -30px -30px 3rem -30px;
    padding: 3rem 2rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.executive-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse" viewBox="0 0 10 10"><rect width="10" height="10" fill="none"/><path d="M10 0L0 10M0 0L10 10" stroke="rgba(255,255,255,0.1)" stroke-width="2"/></pattern></defs><rect width="100" height="100" fill="url(#grid)"/></svg>');
    pointer-events: none;
    z-index: 1;
}

.executive-header h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 10px;
    position: relative;
    z-index: 2;
}

.executive-header h1::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 4px;
    bottom: -2px;
    left: 0;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
    z-index: 2;
}

.executive-header p {
    font-size: 18px;
    margin-bottom: 0;
    position: relative;
    z-index: 2;
}

/* Garantir que nenhum container pai tenha overflow: hidden */
.header,
.user-info,
.header-actions,
.nav,
.container {
    overflow: visible;
    clip: unset;
    max-height: none;
}

/* Forçar visibilidade do dropdown */
.config-dropdown-content {
    position: relative;
    z-index: 999999;
    overflow: visible;
    clip: unset;
    max-height: none;
}

/* =============================================================================
   DROPDOWN CONFIGURATION FIX - CORREÇÃO DE Z-INDEX E STACKING CONTEXT
   ============================================================================= */

/* Garantir que o container principal não crie stacking context */
.container {
    position: relative;
    z-index: auto;
    overflow: visible;
}

/* Header com z-index controlado */
.header {
    position: relative;
    z-index: 1000;
    overflow: visible;
    contain: none;
}

/* User info sem criar novo stacking context */
.user-info {
    position: static;
    z-index: auto;
    overflow: visible;
    contain: none;
}

/* Header actions com z-index alto mas controlado */
.header-actions {
    position: static;
    z-index: auto;
    overflow: visible;
    contain: none;
}

/* Config dropdown com posicionamento absoluto ao body */
.config-dropdown {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 2147483647; /* Máximo z-index possível */
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    min-width: 200px;
    display: none;
    overflow: visible;
    transform: translateY(-10px);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    clip: unset;
    max-height: none;
    contain: none;
}

.config-dropdown.show {
    display: block;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    visibility: visible;
}

/* Config dropdown content sem criar novo contexto */
.config-dropdown-content {
    position: relative;
    z-index: auto;
    overflow: visible;
    contain: none;
    padding: 8px 0;
}

/* Remover qualquer transform que possa criar stacking context */
.main-content,
.section,
.nav,
.logo {
    transform: none;
    will-change: auto;
    contain: none;
    overflow: visible;
}

/* Forçar dropdown acima de todos os elementos */
.config-dropdown {
    isolation: isolate;
}

/* Correção adicional para alinhamento do card de Atividade Recente no Dashboard */
#dashboard .card:last-child {
    grid-column: 1 / -1; /* Ocupa toda a largura do grid */
    margin: 0;
    padding: 25px;
    box-sizing: border-box;
}

/* Garantir que todos os cards do dashboard tenham alinhamento consistente */
#dashboard .stats-grid,
#dashboard .dashboard-grid,
#dashboard .card:last-child {
    margin-left: 0;
    margin-right: 0;
}

/* ========================================
   DASHBOARD GRID - OVERRIDE FINAL
   Forçar flexbox em todos os contextos
   ======================================== */

/* Forçar flexbox em todos os dashboard-grid */
.dashboard-grid,
#dashboard .dashboard-grid,
.section .dashboard-grid,
.main-content .dashboard-grid,
body .dashboard-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
    align-items: stretch;
    justify-content: flex-start;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Desktop - sem wrap */
@media (min-width: 769px) {
    .dashboard-grid,
    #dashboard .dashboard-grid,
    .section .dashboard-grid,
    .main-content .dashboard-grid,
    body .dashboard-grid {
        flex-wrap: nowrap;
    }
}

/* Card de Tarefas - Flexível */
.dashboard-grid .card:nth-child(1),
.dashboard-grid .card:first-child {
    flex: 1;
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: auto;
    width: auto;
    min-width: 0;
    max-width: none;
}

/* Card de Ações Rápidas - Largura Fixa - APENAS DESKTOP */
@media (min-width: 769px) {
    .dashboard-grid .card:nth-child(2),
    .dashboard-grid .card:last-child {
        flex: 0 0 280px;
        width: 280px;
        min-width: 280px;
        max-width: 280px;
        flex-shrink: 0;
    }
}

/* Remover qualquer propriedade grid que possa interferir */
.dashboard-grid,
.dashboard-grid * {
    grid-template-columns: unset;
    grid-template-rows: unset;
    grid-area: unset;
    grid-column: unset;
    grid-row: unset;
}

/* Override específico para cards */
.dashboard-grid .card {
    margin: 0;
    box-sizing: border-box;
    display: block;
}

/* Responsividade para flexbox */
@media (max-width: 768px) {
    .dashboard-grid {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 15px;
        justify-content: center;
    }
    
    .dashboard-grid .card:nth-child(1),
    .dashboard-grid .card:nth-child(2) {
        flex: 1 1 300px !important;
        width: auto !important;
        min-width: 300px !important;
        max-width: none !important;
        flex-shrink: 1 !important;
    }
}

/* Telas muito pequenas - força quebra de linha */
@media (max-width: 640px) {
    .dashboard-grid {
        flex-direction: column !important;
        flex-wrap: nowrap !important;
    }
    
    .dashboard-grid .card:nth-child(1),
    .dashboard-grid .card:nth-child(2) {
        flex: 1 1 auto !important;
        width: 100% !important;
        min-width: auto !important;
        max-width: none !important;
    }
}

/* =============== DRAG AND DROP STYLES =============== */

/* Elementos sendo arrastados */
.dragging {
    opacity: 0.6;
    cursor: grabbing !important;
    transform: scale(1.05);
    z-index: 1000;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

/* Elementos que podem ser arrastados */
.calendar-event[draggable="true"],
.lead-card[draggable="true"] {
    cursor: grab;
    transition: all 0.3s ease;
}

.calendar-event[draggable="true"]:hover,
.lead-card[draggable="true"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/*  reas de drop destacadas */
.calendar-day.drag-over,
.funil-vendas-content.drag-over {
    background-color: rgba(102, 126, 234, 0.1) !important;
    border: 2px dashed #667eea !important;
    transform: scale(1.02);
    transition: all 0.3s ease;
}

/* Anima  o especial para dias do calend rio */
.calendar-day.drag-over::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(102, 126, 234, 0.05), transparent);
    animation: dragOverPulse 1.5s infinite;
    border-radius: inherit;
}

@keyframes dragOverPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* Estilo para stages do funil durante drag */
.funil-vendas-stage {
    position: relative;
    transition: all 0.3s ease;
}

.funil-vendas-content.drag-over::before {
    content: 'Solte aqui para mover o lead';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(102, 126, 234, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    z-index: 10;
}

/* Notifica  es para feedback */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateX(350px);
    animation: slideIn 0.3s ease forwards;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.notification-success {
    background: linear-gradient(45deg, #28a745, #20c997);
}

.notification-error {
    background: linear-gradient(45deg, #dc3545, #fd7e14);
}

.notification-info {
    background: linear-gradient(45deg, #17a2b8, #6f42c1);
}

.notification button {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    margin: 0;
    line-height: 1;
}

@keyframes slideIn {
    to { transform: translateX(0); }
}

/* Estilo especial para eventos urgentes sendo arrastados */
.calendar-event.urgent.dragging {
    border-color: #dc3545;
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.4);
}

/* Estilo especial para cards de lead sendo arrastados */
.lead-card.dragging {
    border: 2px solid #667eea;
    background: rgba(102, 126, 234, 0.05);
}

/* Melhorias na experi ncia de drag para mobile */
@media (max-width: 768px) {
    .dragging {
        transform: scale(1.1);
    }
    
    .drag-over {
        transform: scale(1.05);
    }
    
    .notification {
        right: 10px;
        left: 10px;
        width: auto;
    }
}

/* =============================================================================
   MODAL DE IMPORTAÇÃO EXCEL/CSV
   ============================================================================= */

/* Área de upload de arquivo */
.file-upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
    margin-bottom: 20px;
}

.file-upload-area:hover {
    border-color: #28a745;
    background: #f8fff9;
}

.file-upload-area.drag-over {
    border-color: #28a745;
    background: #f8fff9;
    transform: scale(1.02);
}

.file-upload-area i {
    font-size: 48px;
    color: #6c757d;
    margin-bottom: 10px;
    display: block;
}

.file-upload-area p {
    font-size: 16px;
    color: #495057;
    margin-bottom: 5px;
}

.file-upload-area small {
    color: #6c757d;
    font-size: 12px;
}

/* Informações do arquivo */
.file-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.file-info h4 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
}

.file-details {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.file-detail {
    display: flex;
    align-items: center;
    gap: 5px;
}

.file-detail strong {
    color: #495057;
    font-size: 12px;
}

.file-detail span {
    color: #6c757d;
    font-size: 12px;
}

/* Progresso da importação */
.import-progress {
    margin-bottom: 20px;
}

.import-progress h4 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 16px;
}

.progress-bar {
    position: relative;
    background: #e9ecef;
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    background: linear-gradient(90deg, #28a745, #20c997);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #495057;
    font-weight: 600;
    font-size: 12px;
}

.progress-details {
    color: #6c757d;
    font-size: 12px;
    text-align: center;
}

/* Resultados da importação */
.import-results {
    margin-bottom: 20px;
}

.import-results h4 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 16px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.result-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    border: 1px solid #e9ecef;
}

.result-item.success {
    background: #d4edda;
    border-color: #c3e6cb;
}

.result-item.skipped {
    background: #fff3cd;
    border-color: #ffeaa7;
}

.result-item.error {
    background: #f8d7da;
    border-color: #f5c6cb;
}

.result-item i {
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
}

.result-item.success i {
    color: #28a745;
}

.result-item.skipped i {
    color: #ffc107;
}

.result-item.error i {
    color: #dc3545;
}

.result-label {
    display: block;
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 5px;
}

.result-value {
    font-size: 24px;
    font-weight: 700;
    color: #495057;
}

/* Detalhes de erros */
.error-details {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid #dc3545;
}

.error-details h5 {
    color: #dc3545;
    margin-bottom: 10px;
    font-size: 14px;
}

.error-list {
    max-height: 200px;
    overflow-y: auto;
}

.error-item {
    color: #721c24;
    font-size: 12px;
    margin-bottom: 5px;
    padding: 5px;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 4px;
}

/* Detalhes de leads ignorados */
.skipped-details {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid #17a2b8;
    margin-top: 15px;
}

.skipped-details h5 {
    color: #17a2b8;
    margin-bottom: 10px;
    font-size: 14px;
}

.skipped-list {
    max-height: 200px;
    overflow-y: auto;
}

.skipped-item {
    color: #0c5460;
    font-size: 12px;
    margin-bottom: 5px;
    padding: 5px;
    background: rgba(23, 162, 184, 0.1);
    border-radius: 4px;
}

/* Seções de importação */
.import-section {
    margin-bottom: 25px;
}

.import-section h4 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
}

/* Modal grande para importação */
.large-modal {
    max-width: 900px;
    width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

/* Footer do modal de importação */
.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    align-items: center;
    padding: 20px 24px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

.modal-footer .btn {
    min-width: 120px;
    padding: 10px 20px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.modal-footer .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Seção de Mapeamento de Colunas */
.column-mapping-section {
    margin-top: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.column-mapping-section h4 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
}

.mapping-description {
    margin-bottom: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 6px;
    border-left: 4px solid #007bff;
}

.mapping-description p {
    margin: 8px 0;
    font-size: 14px;
    color: #495057;
}

.mapping-description strong {
    color: #212529;
}

.required-indicator {
    color: #dc3545;
    font-weight: bold;
    margin-left: 3px;
}

/* Preview dos dados */
.data-preview {
    margin: 20px 0;
    overflow-x: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 13px;
}

.preview-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.preview-table th {
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    border-right: 1px solid rgba(255,255,255,0.2);
}

.preview-table th:last-child {
    border-right: none;
}

.preview-table th small {
    display: block;
    font-size: 11px;
    font-weight: 400;
    margin-top: 3px;
    opacity: 0.9;
}

.preview-table tbody tr {
    border-bottom: 1px solid #dee2e6;
}

.preview-table tbody tr:last-child {
    border-bottom: none;
}

.preview-table tbody tr:hover {
    background-color: #f8f9fa;
}

.preview-table td {
    padding: 10px;
    color: #495057;
    white-space: nowrap;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Grid de mapeamento */
.mapping-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.mapping-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mapping-label {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
}

.mapping-select {
    padding: 10px 12px;
    border: 2px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    color: #495057;
    background-color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.mapping-select:hover {
    border-color: #80bdff;
}

.mapping-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.mapping-select.error {
    border-color: #dc3545;
    animation: shake 0.3s ease;
}

.mapping-select.error:focus {
    box-shadow: 0 0 0 3px rgba(220,53,69,0.1);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Responsividade para modal de importação */
@media (max-width: 768px) {
    .large-modal {
        max-width: 95vw;
        margin: 10px;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .file-details {
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-footer {
        flex-direction: column-reverse;
        gap: 8px;
    }
    
    .modal-footer .btn {
        width: 100%;
        min-width: unset;
    }
    
    .mapping-grid {
        grid-template-columns: 1fr;
    }
    
    .data-preview {
        font-size: 11px;
    }
    
    .preview-table td,
    .preview-table th {
        padding: 8px 6px;
        max-width: 100px;
    }
}

/* =============================================================================
   PWA ESPECÍFICO
   ============================================================================= */

/* Estilos PWA removidos - usar apenas estilos do navegador */

/* Botão de instalação PWA */
.pwa-install-btn {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    z-index: 9999 !important;
    border-radius: 50px !important;
    padding: 12px 20px !important;
    box-shadow: 0 4px 20px rgba(0,123,255,0.3) !important;
    background: linear-gradient(45deg, #007bff, #0056b3) !important;
    border: none !important;
    color: white !important;
    font-weight: bold !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    animation: pwa-pulse 2s infinite !important;
}

.pwa-install-btn:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 6px 25px rgba(0,123,255,0.4) !important;
}

.pwa-install-btn i {
    margin-right: 8px;
}

@keyframes pwa-pulse {
    0% { 
        transform: scale(1);
        box-shadow: 0 4px 20px rgba(0,123,255,0.3);
    }
    50% { 
        transform: scale(1.02);
        box-shadow: 0 6px 25px rgba(0,123,255,0.4);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 4px 20px rgba(0,123,255,0.3);
    }
}

/* Ocultar botão de instalação em mobile quando já instalado */
@media (display-mode: standalone) {
    .pwa-install-btn {
        display: none !important;
    }
}

/* Indicador de status offline */
.offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #dc3545;
    color: white;
    text-align: center;
    padding: 8px;
    z-index: 10000;
    font-size: 14px;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.offline-indicator.show {
    transform: translateY(0);
}

.offline-indicator i {
    margin-right: 8px;
}

/* Estilos PWA removidos - usar apenas estilos do navegador */

/* Splash screen personalizado para PWA */
.pwa-splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    color: white;
}

.pwa-splash-logo {
    font-size: 80px;
    margin-bottom: 20px;
    animation: pwa-logo-pulse 1.5s ease-in-out infinite;
}

.pwa-splash-title {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 10px;
}

.pwa-splash-subtitle {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 40px;
}

.pwa-splash-loader {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes pwa-logo-pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* Notificações PWA personalizadas */
.pwa-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    border-left: 4px solid #007bff;
    z-index: 9998;
    max-width: 350px;
    animation: pwa-slide-in 0.3s ease-out;
}

.pwa-notification.success {
    border-left-color: #28a745;
}

.pwa-notification.warning {
    border-left-color: #ffc107;
}

.pwa-notification.error {
    border-left-color: #dc3545;
}

@keyframes pwa-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsividade específica para mobile - sem estilos PWA */
@media screen and (max-width: 768px) {
    .pwa-install-btn {
        bottom: 20px !important;
        right: 20px !important;
    }
    
    .pwa-notification {
        top: 20px;
        right: 20px;
        left: 20px;
        max-width: none;
    }
}

/* Previne zoom em inputs (iOS Safari) */
@media screen and (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    input[type="url"],
    input[type="search"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* =============================================================================
   PWA SPECIFIC STYLES
   ============================================================================= */

/* PWA Install Button */
.btn-header-action {
    position: relative;
}

#installPWAButton {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: none; /* Escondido por padrão no desktop */
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

/* Mostrar apenas no mobile */
@media (max-width: 768px) {
    #installPWAButton {
        display: flex;
    }
}

#installPWAButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

#installPWAButton i {
    font-size: 16px;
}

/* PWA Mode Adjustments - REMOVIDO para usar estilo do navegador */

/* Estilos PWA removidos - usar apenas estilos do navegador */

/* Estilos PWA iOS removidos */

/* Estilos PWA Android removidos */

/* Splash Screen for PWA */
.pwa-splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.pwa-splash.show {
    opacity: 1;
    visibility: visible;
}

.pwa-splash .logo {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.pwa-splash .title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.pwa-splash .subtitle {
    font-size: 1.2rem;
    opacity: 0.8;
}

/* PWA Update Available Notification */
.pwa-update-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #28a745;
    color: white;
    padding: 15px 25px;
    border-radius: 25px;
    box-shadow: 0 4px 20px rgba(40, 167, 69, 0.3);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.pwa-update-notification.show {
    opacity: 1;
    visibility: visible;
}

.pwa-update-notification button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 15px;
    border-radius: 15px;
    margin-left: 10px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.pwa-update-notification button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* =============================================================================
   INLINE EDITING STYLES FOR LEAD DETAILS
   ============================================================================= */

/* Campos editáveis nos detalhes do lead */
.editable-field {
    position: relative;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer !important;
    min-height: 20px;
    display: inline-block;
    min-width: 50px;
    border: 1px solid transparent;
}

.editable-field:hover {
    background-color: rgba(0, 123, 255, 0.05);
    border-color: rgba(0, 123, 255, 0.2);
    transform: translateY(-1px);
}

.editable-field:hover::after {
    content: "✏️ Clique para editar";
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    animation: fadeInTooltip 0.3s ease forwards;
}

@keyframes fadeInTooltip {
    to {
        opacity: 1;
    }
}

/* Estilo do input durante edição */
.editable-input {
    font-family: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    color: inherit !important;
    border: 2px solid #007bff !important;
    border-radius: 4px !important;
    padding: 6px 10px !important;
    background: white !important;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1) !important;
    outline: none !important;
    transition: all 0.3s ease !important;
    resize: vertical !important;
    min-height: 20px !important;
}

.editable-input:focus {
    border-color: #0056b3 !important;
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.2) !important;
}

/* Indicador visual para campos editáveis */
.editable-field::before {
    content: "";
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.editable-field:hover::before {
    opacity: 0.7;
}

/* Campos em observações (textarea) */
.observations-content .editable-field {
    display: block;
    width: 100%;
    min-height: 60px;
    padding: 12px;
    background: #f8f9fa;
    border: 1px dashed #dee2e6;
    border-radius: 6px;
    font-style: italic;
    color: #6c757d;
}

.observations-content .editable-field:hover {
    background: #e9ecef;
    border-color: #007bff;
    color: #495057;
    font-style: normal;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .editable-field:hover::after {
        font-size: 10px;
        padding: 3px 6px;
    }
    
    .editable-input {
        font-size: 16px !important; /* Evita zoom no mobile */
    }
}
