/* ==========================================================================
   MARKETING BAG - ESTILOS PRINCIPAIS (V1.0 - MVP GOLD)
   ========================================================================== */

:root {
    --primary: #8B0000; /* Vermelho Escuro da Marca */
    --primary-hover: #a50000;
    --bg-light: #f4f7f6;
}

body {
    background-color: var(--bg-light);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ==========================================
   BARRA LATERAL (SIDEBAR)
   ========================================== */
.bg-dark-red {
    background-color: var(--primary) !important;
}

.sidebar {
    width: 260px;
    min-width: 260px;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 1050;
}

.sidebar .nav-link {
    border-radius: 8px;
    margin-bottom: 5px;
    font-weight: 500;
    opacity: 0.85;
    transition: all 0.2s ease;
}

.sidebar .nav-link:hover, .sidebar .nav-link.active {
    background-color: rgba(255,255,255,0.1);
    opacity: 1;
}

/* ==========================================
   KANBAN (FUNIL DE VENDAS)
   ========================================== */
.kanban-column {
    background-color: #e9ecef;
    min-width: 280px;
    max-width: 280px;
    border-top: 4px solid var(--primary);
    display: flex;
    flex-direction: column;
    max-height: 70vh;
}

.kanban-column.border-success-top {
    border-top: 4px solid #198754;
}

.kanban-header {
    padding: 12px;
    font-weight: bold;
    text-align: center;
    border-bottom: 1px solid #ddd;
    background: #fff;
    border-radius: 4px 4px 0 0;
}

.kanban-cards {
    flex-grow: 1;
    overflow-y: auto;
    min-height: 150px;
}

.kanban-card {
    background: #fff;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    cursor: grab;
    position: relative;
    border: 1px solid #eee;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.kanban-card:active {
    cursor: grabbing;
}

.btn-update-lead {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #aaa;
    cursor: pointer;
}

.btn-update-lead:hover {
    color: var(--primary);
}

.dot {
    height: 10px;
    width: 10px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}
.dot-prazo { background-color: #0d6efd; }
.dot-atrasado { background-color: #dc3545; }

/* ==========================================
   TIMELINE (ATIVIDADES E HISTÓRICO DE ARTE)
   ========================================== */
.timeline {
    list-style: none;
    padding: 0;
    position: relative;
}

.timeline:before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 20px;
    width: 2px;
    background: #dee2e6;
}

.timeline li {
    position: relative;
    padding-left: 45px;
    margin-bottom: 20px;
    background: #fff;
    padding-right: 15px;
    padding-top: 15px;
    padding-bottom: 15px;
    border-radius: 8px;
    border: 1px solid #eee;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.timeline li:before {
    content: '';
    position: absolute;
    top: 20px;
    left: 14px;
    width: 14px;
    height: 14px;
    background: #fff;
    border: 3px solid var(--primary);
    border-radius: 50%;
}

.atv-concluida {
    opacity: 0.6;
    background-color: #f8f9fa !important;
}
.atv-concluida:before {
    border-color: #198754 !important;
    background: #198754 !important;
}

.btn-concluir-wrapper { cursor: pointer; }
.check-circle-atv { font-size: 28px; color: #ccc; transition: color 0.2s; }
.check-circle-atv:hover { color: #198754; }
.text-success-check { color: #198754 !important; }
.atv-textarea-inline { background: transparent; border: none; resize: none; box-shadow: none !important; padding: 0; }

/* ==========================================
   GRADE DE MÓDULOS (PEDIDOS E CAMPANHAS)
   ========================================== */
.grid-modulos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 8px;
    margin-top: 10px;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 5px;
}

.modulo-checkbox {
    display: block;
    padding: 8px 5px;
    text-align: center;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.8rem;
    transition: all 0.2s;
    user-select: none;
}

.modulo-checkbox:hover { border-color: var(--primary); }
.modulo-checkbox input { display: none; }
.modulo-checkbox.checked { background-color: var(--primary); color: white; border-color: var(--primary); }

/* ==========================================
   UTILITIES E ANIMAÇÕES
   ========================================== */
.cursor-pointer { cursor: pointer; }

.alert-pulse { animation: pulse-red 1.5s infinite; }
@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }


/* ==========================================
   PATCH MOBILE (RESPONSIVIDADE COMPLETA)
   ========================================== */
.sidebar-overlay { display: none; }

@media (max-width: 768px) {
    #wrapper {
        flex-direction: column;
    }
    
    /* Esconde a barra lateral na esquerda */
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        height: 100vh;
        transition: left 0.3s ease-in-out;
    }
    
    /* Classe adicionada via JS para mostrar o menu */
    .sidebar.show-mobile {
        left: 0;
    }
    
    /* Fundo escuro quando o menu estiver aberto */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0,0,0,0.6);
        z-index: 1040; /* Fica logo abaixo da sidebar */
        transition: opacity 0.3s ease;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    /* Ajuste da margem principal no celular */
    main {
        padding: 15px !important;
    }
    
    /* Ajuste para colar a barra top no teto do celular */
    .custom-mobile-header {
        margin: -15px -15px 15px -15px !important;
    }
}