/* ============================================================
   auditorias.css — Complice Manager v3.0
   Cards de auditoria, layout responder, sidebar, anexos
   ============================================================ */

/* ── Grid de Cards ────────────────────────────────────────── */
.audit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
    margin-top: 20px;
}

.audit-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, transform .15s;
    position: relative;
    overflow: hidden;
}

/* Barra de status no topo */
.audit-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.audit-card.rascunho::before     { background: var(--text-faint); }
.audit-card.em_andamento::before { background: var(--accent); }
.audit-card.concluida::before    { background: var(--success); }

.audit-card:hover {
    border-color: #c7d7f5;
    box-shadow: 0 4px 16px rgba(37,99,235,.08);
    transform: translateY(-1px);
}

/* ── Header do card ───────────────────────────────────────── */
.audit-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 12px;
}

.audit-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    flex: 1;
}

.audit-card-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.audit-card-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Progress do card ─────────────────────────────────────── */
.progress-wrap {
    height: 5px;
    background: #f1f5f9;
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 5px;
}
.progress-fill {
    height: 100%;
    border-radius: 99px;
    background: var(--accent);
    transition: width .5s ease;
}
.progress-label {
    font-size: 11px;
    color: var(--text-faint);
    font-family: var(--font-mono);
}

/* ── Layout Responder ─────────────────────────────────────── */
.responder-layout {
    display: grid;
    grid-template-columns: 256px 1fr;
    gap: 0;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* ── Sidebar de perguntas ─────────────────────────────────── */
.responder-sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 16px 0;
}
.responder-sidebar::-webkit-scrollbar       { width: 3px; }
.responder-sidebar::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

.sidebar-group-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: var(--text-faint);
    padding: 10px 16px 4px;
}

.sidebar-pergunta-item {
    padding: 9px 16px;
    cursor: pointer;
    border-left: 2px solid transparent;
    transition: background .12s, border-color .12s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sidebar-pergunta-item:hover  { background: #f8fafc; }
.sidebar-pergunta-item.active {
    background: var(--accent-soft);
    border-left-color: var(--accent);
}

.sidebar-pergunta-item .pq-num {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--accent);
    background: var(--accent-muted);
    padding: 2px 5px;
    border-radius: 4px;
    flex-shrink: 0;
}
.sidebar-pergunta-item .pq-text {
    font-size: 12px;
    line-height: 1.3;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}
.sidebar-pergunta-item .pq-status {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-left: auto;
}
.pq-status.respondida    { background: var(--success); }
.pq-status.nao_aplicavel { background: var(--warning); }
.pq-status.pendente      { background: #e2e8f0; }

/* ── Conteúdo de respostas ────────────────────────────────── */
.responder-content {
    overflow-y: auto;
    padding: 28px 32px;
    background: var(--bg);
}
.responder-content::-webkit-scrollbar       { width: 4px; }
.responder-content::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* ── Card de pergunta ─────────────────────────────────────── */
.pergunta-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
}

.pergunta-numero {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--accent);
    background: var(--accent-muted);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    display: inline-block;
    margin-bottom: 8px;
    letter-spacing: .2px;
}
.pergunta-grupo-tag {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .9px;
    margin-bottom: 8px;
}
.pergunta-texto {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.proposta-evidencia {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: var(--radius-md);
    padding: 11px 14px;
    margin-bottom: 20px;
    font-size: 12.5px;
    color: #0369a1;
    display: flex;
    gap: 8px;
    line-height: 1.5;
}
.proposta-evidencia i { flex-shrink: 0; margin-top: 1px; }

.resposta-section  { margin-bottom: 20px; }
.resposta-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .9px;
    margin-bottom: 8px;
}

/* ── Políticas vinculadas ─────────────────────────────────── */
.politicas-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.politica-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 9px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.politica-item .pi-icon {
    width: 26px; height: 26px;
    border-radius: var(--radius-sm);
    background: var(--accent-muted);
    color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; flex-shrink: 0;
}
.politica-item .pi-name {
    font-size: 12px; font-weight: 500;
    flex: 1; min-width: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    color: var(--text-primary);
}
.politica-item .pi-code {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--accent);
    background: var(--accent-muted);
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

/* ── Anexos ───────────────────────────────────────────────── */
.anexos-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.anexo-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 9px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.anexo-item .ax-icon {
    width: 26px; height: 26px;
    border-radius: var(--radius-sm);
    background: var(--warning-soft);
    color: var(--warning);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; flex-shrink: 0;
}
.anexo-item .ax-info  { flex: 1; min-width: 0; }
.anexo-item .ax-name  { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-primary); }
.anexo-item .ax-meta  { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

/* ── Status selector ──────────────────────────────────────── */
.status-selector { display: flex; gap: 8px; flex-wrap: wrap; }

.status-btn {
    padding: 6px 14px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    transition: border-color .12s, color .12s, background .12s;
    font-family: var(--font-sans);
    line-height: 1;
}
.status-btn:hover { border-color: var(--accent); color: var(--accent); }
.status-btn.active.respondida    { background: var(--success-soft); border-color: var(--success); color: var(--success-text); }
.status-btn.active.nao_aplicavel { background: var(--warning-soft); border-color: var(--warning); color: var(--warning-text); }

/* ── Progress bar de auditoria ────────────────────────────── */
.audit-progress-bar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 10px 32px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}
.audit-progress-info  { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.audit-progress-track { flex: 1; height: 5px; background: #f1f5f9; border-radius: 99px; overflow: hidden; }
.audit-progress-fill  { height: 100%; border-radius: 99px; background: var(--accent); transition: width .4s ease; }

/* ── Tabs ─────────────────────────────────────────────────── */
.tabs-bar { display: flex; gap: 4px; margin-bottom: 20px; }

.tab-btn {
    padding: 6px 14px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    transition: background .12s, color .12s;
    font-family: var(--font-sans);
    line-height: 1;
}
.tab-btn:hover  { background: #f1f5f9; color: var(--text-primary); }
.tab-btn.active { background: var(--accent); color: #fff; }

/* ── Seleção de política no modal ─────────────────────────── */
.politica-select-item {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    margin-bottom: 6px;
    transition: border-color .12s, background .12s;
    display: flex;
    align-items: center;
    gap: 10px;
}
.politica-select-item:hover    { border-color: var(--accent); background: var(--accent-soft); }
.politica-select-item.selected { border-color: var(--accent); background: var(--accent-soft); }

.politica-select-item .check {
    width: 16px; height: 16px;
    border-radius: 4px;
    border: 1.5px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: all .12s;
    font-size: 10px;
}
.politica-select-item.selected .check {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}