/* ============================================
   Dashboard Análise Comportamental - CSS
   ============================================ */

/* Header */
.dashboard-header {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 24px;
    margin-bottom: 24px;
    pointer-events: auto !important;  
} 

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
}

.header-left {
    flex: 1;
}

.header-left h1 {
    font-size: 28px;
    font-weight: bold;
    color: #1f2937;
    margin: 0 0 20px 0;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.header-actions .btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.header-actions .btn-primary {
    background: #2563eb;
    color: white;
}

.header-actions .btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.header-actions .btn-secondary {
    background: #6b7280;
    color: white;
}

.header-actions .btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(107, 114, 128, 0.3);
}

/* Busca de Respondente */
.respondente-search {
    margin-top: 16px;
}

.respondente-search label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.search-wrapper {
    position: relative;
    max-width: 600px;
    pointer-events: auto !important;  
}

#search-respondente {
    width: 100%;
    padding: 10px 40px 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

#search-respondente:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
     pointer-events: auto !important;  
    cursor: text !important;          
    user-select: text !important;    
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

/* Dropdown de Sugestões */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    margin-top: 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
}

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s;
}

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

.suggestion-item:hover {
    background: #eff6ff;
}

.suggestion-nome {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.suggestion-detalhes {
    font-size: 12px;
    color: #6b7280;
}

.suggestion-empty {
    padding: 16px;
    text-align: center;
    color: #9ca3af;
}

/* Respondente Info */
.respondente-info {
    margin-top: 16px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 12px 16px;
    max-width: 400px;
}

.info-label {
    font-size: 11px;
    font-weight: 600;
    color: #2563eb;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.info-nome {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.info-details {
    font-size: 12px;
    color: #6b7280;
}

.info-details span {
    margin-right: 12px;
}

/* Tabs */
.dashboard-tabs {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 24px;
    overflow: hidden;
}

.tabs-wrapper {
    display: flex;
    overflow-x: auto;
    border-bottom: 2px solid #e5e7eb;
}

.tab-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    border: none;
    background: transparent;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    color: #6b7280;
    font-weight: 500;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #1f2937;
    background: #f9fafb;
}

.tab-btn.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    background: #eff6ff;
}

.tab-btn i {
    font-size: 16px;
}

/* Content */
.dashboard-content {
    min-height: 400px;
}

/* Card da Teoria */
.teoria-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    margin-bottom: 24px;
    overflow: hidden;
}

.teoria-header {
    padding: 20px 24px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.teoria-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.teoria-title h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.teoria-title i {
    font-size: 24px;
}

.toggle-icon {
    font-size: 18px;
    transition: transform 0.3s;
}

.teoria-card.expanded .toggle-icon {
    transform: rotate(180deg);
}

.teoria-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(255,255,255,0.1);
    border-top: 1px solid rgba(255,255,255,0.2);
}

.teoria-card.expanded .teoria-content {
    max-height: 500px;
    padding: 20px 24px;
}

.teoria-item {
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.6;
}

.teoria-item:last-child {
    margin-bottom: 0;
}

.teoria-item strong {
    font-weight: 600;
}

/* Seção de Dimensões */
.dimensoes-section {
    background: white;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

.dimensoes-section h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

.dimensoes-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.dimensoes-grid.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.dimensoes-grid.grid-5 {
    grid-template-columns: repeat(5, 1fr);
}

/* Card de Dimensão */
.dimensao-card {
    position: relative;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.3s;
    cursor: pointer;
}

.dimensao-card:hover {
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
    transform: translateY(-4px);
}

.help-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    color: #2563eb;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.help-btn:hover {
    background: #eff6ff;
    color: #1d4ed8;
}

.dimensao-content {
    text-align: center;
}

.polo {
    font-size: 40px;
    font-weight: bold;
    margin-bottom: 8px;
}

.dimensao-content h4 {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 12px 0;
}

.percentual {
    font-size: 32px;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 8px;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-danger { background: #dc2626; color: white; }
.badge-warning { background: #f59e0b; color: white; }
.badge-info { background: #eab308; color: white; }
.badge-primary { background: #2563eb; color: white; }
.badge-secondary { background: #6b7280; color: white; }
.badge-purple { background: #8b5cf6; color: white; }

.comportamento {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    text-align: left;
}

.comportamento strong {
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.comportamento p {
    font-size: 12px;
    color: #4b5563;
    margin: 4px 0 0 0;
    line-height: 1.4;
}

/* Gráficos */
.graficos-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.grafico-card {
    background: white;
    border-radius: 8px;
    padding: 24px;
}

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

.grafico-card h4 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.grafico-card canvas {
    max-height: 300px;
}

/* Modal de Informações */
.info-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.info-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.info-modal-header {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    color: white;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-modal-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.close-modal {
    background: transparent;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.close-modal:hover {
    background: rgba(255,255,255,0.2);
}

.info-modal-body {
    padding: 24px;
}

.info-section {
    margin-bottom: 20px;
    padding: 16px;
    border-radius: 8px;
}

.info-section:last-child {
    margin-bottom: 0;
}

.info-section.definicao {
    background: #eff6ff;
    border-left: 4px solid #2563eb;
}

.info-section.comportamento-section {
    background: #ecfdf5;
    border-left: 4px solid #10b981;
}

.info-section.intensidade {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
}

.info-section h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-section p {
    margin: 0;
    line-height: 1.6;
    color: #374151;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 1200px) {
    .dimensoes-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
    }
    
    .header-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .header-actions .btn {
        flex: 1;
        justify-content: center;
    }
    
    .dimensoes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .graficos-grid {
        grid-template-columns: 1fr;
    }
    
    .tabs-wrapper {
        overflow-x: scroll;
    }
}

        @media (max-width: 480px) {
        .dimensoes-grid {
            grid-template-columns: 1fr;
        }

    /* =========================================================
    AUDITORIA (MapPersona theme: azul + cinza + branco + preto)
    Escopo: só dentro de .auditoria-container
    ========================================================= */

    .auditoria-container {
        color: #111827; /* preto/cinza bem escuro */
    }

    /* Card principal */
    .auditoria-container .teoria-card {
        border: 1px solid #e5e7eb;      /* cinza claro */
        background: #ffffff;
        border-radius: 12px;
    }

    /* Header do card */
    .auditoria-container .teoria-header {
        background: linear-gradient(90deg, #0b3a6a 0%, #145a9e 100%); /* azul */
        color: #ffffff;
        border-radius: 12px 12px 0 0;
        padding: 12px 14px;
    }

    .auditoria-container .teoria-header h3,
    .auditoria-container .teoria-header i {
        color: #ffffff !important;
    }

    /* Conteúdo do card */
    .auditoria-container .teoria-content {
        background: #ffffff;
        color: #111827;
        padding: 14px;
    }

    /* Linhas (itens) */
    .auditoria-container .teoria-item {
        border-left: 4px solid #145a9e; /* azul */
        padding-left: 10px;
        margin: 10px 0;
        color: #111827;
    }

    /* Separadores */
    .auditoria-container hr {
        border: 0;
        border-top: 1px solid #e5e7eb; /* cinza claro */
    }

    /* Tabela (A..I) */
    .auditoria-container table.table {
        background: #ffffff;
        color: #111827;
    }

    .auditoria-container table.table thead th {
        background: #111827; /* preto */
        color: #ffffff;
        border-color: #111827;
        font-weight: 700;
        white-space: nowrap;
    }

    .auditoria-container table.table tbody td {
        border-color: #e5e7eb;
        vertical-align: top;
    }

    /* Zebra suave */
    .auditoria-container table.table tbody tr:nth-child(even) {
        background: #f9fafb; /* cinza super leve */
    }

    /* Destaque de Score (A/B/C...) */
    .auditoria-container table.table tbody td:first-child strong {
        color: #145a9e; /* azul */
    }

    /* JSON (detalhes) */
    .auditoria-container .auditoria-json {
        background: #0b1220; /* preto-azulado */
        color: #e5e7eb;      /* cinza claro */
        padding: 12px;
        border-radius: 10px;
        white-space: pre-wrap;
        border: 1px solid rgba(229, 231, 235, 0.18);
    }

    /* Alertas dentro da auditoria (se houver) */
    .auditoria-container .alert {
        border-radius: 12px;
    }

    /* ============================
    AUDITORIA - PALETA LOGO (AZUL/CINZA/BRANCO/PRETO)
    Escopo: .audit-scope
    ============================ */

    .audit-scope {
        --mp-blue: #1f4e79;      /* ajuste fino aqui se quiser */
        --mp-blue-2: #163a5a;
        --mp-gray: #6b7280;
        --mp-gray-2: #e5e7eb;
        --mp-white: #ffffff;
        --mp-black: #111827;

        color: var(--mp-black) !important;
        background: var(--mp-white) !important;
    }

    /* zera qualquer “vinho/roxo/gradiente” herdado */
    .audit-scope * {
        background-image: none !important;
    }

    .audit-scope .audit-header {
        border: 1px solid var(--mp-gray-2);
        border-left: 6px solid var(--mp-blue);
        border-radius: 10px;
        padding: 14px;
        background: var(--mp-white) !important;
    }

    .audit-scope .audit-title {
        display: flex;
        align-items: center;
        gap: 10px;
        color: var(--mp-blue) !important;
        font-weight: 700;
        font-size: 16px;
        margin-bottom: 6px;
    }

    .audit-scope .audit-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 14px;
        color: var(--mp-gray) !important;
        font-size: 12px;
        margin-bottom: 12px;
    }

    .audit-scope .audit-kpis {
        display: flex;
        gap: 12px;
        flex-wrap: wrap;
    }

    .audit-scope .kpi {
        border: 1px solid var(--mp-gray-2);
        border-radius: 10px;
        padding: 10px 12px;
        min-width: 180px;
        background: var(--mp-white) !important;
    }

    .audit-scope .kpi-label {
        color: var(--mp-gray) !important;
        font-size: 12px;
    }

    .audit-scope .kpi-value {
        color: var(--mp-black) !important;
        font-size: 18px;
        font-weight: 800;
        margin-top: 2px;
    }

    .audit-scope .kpi-badge {
        display: inline-block;
        margin-top: 6px;
        padding: 2px 8px;
        border-radius: 999px;
        font-size: 11px;
        font-weight: 700;
        color: var(--mp-blue) !important;
        background: #eef5ff !important;
        border: 1px solid #cfe2ff;
    }

    .audit-scope .audit-card {
        margin-top: 14px;
        border: 1px solid var(--mp-gray-2);
        border-radius: 10px;
        overflow: hidden;
        background: var(--mp-white) !important;
    }

    .audit-scope .audit-card-header {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 14px;
        background: #f6f8fb !important;
        color: var(--mp-blue) !important;
        font-weight: 800;
        border-bottom: 1px solid var(--mp-gray-2);
    }

    .audit-scope .audit-card-body {
        padding: 12px 14px;
        background: var(--mp-white) !important;
    }

    .audit-scope .audit-table-wrap {
        overflow: auto;
        border: 1px solid var(--mp-gray-2);
        border-radius: 10px;
    }

    .audit-scope table.audit-table {
        width: 100%;
        border-collapse: collapse;
        background: var(--mp-white) !important;
    }

    .audit-scope .audit-table thead th {
        position: sticky;
        top: 0;
        background: #f6f8fb !important;
        color: var(--mp-black) !important;
        font-size: 12px;
        text-align: left;
        padding: 10px;
        border-bottom: 1px solid var(--mp-gray-2);
        white-space: nowrap;
    }

    .audit-scope .audit-table tbody td {
        padding: 10px;
        border-bottom: 1px solid var(--mp-gray-2);
        font-size: 12px;
        color: var(--mp-black) !important;
        vertical-align: top;
        background: var(--mp-white) !important;
    }

    .audit-scope .audit-table tbody tr:hover td {
        background: #f9fbff !important;
    }

    .audit-scope .audit-text-block h4 {
        margin: 12px 0 6px 0;
        color: var(--mp-blue) !important;
        font-size: 13px;
        font-weight: 800;
    }

    .audit-scope .audit-text-block p {
        margin: 0 0 10px 0;
        color: var(--mp-black) !important;
        line-height: 1.4;
    }

}