/* =========================================================================
   consolidado.css - Folha de Estilos Exclusiva do Consolidado Anual
   Layout Minimalista, Progress Bar Elegante e Diagnósticos Claros
   ========================================================================= */

.card-aba-consolidado { border-color: var(--accent-violet); }
.card-titulo-consolidado { color: var(--accent-violet); border: none; padding: 0; margin: 0; display: flex; align-items: center; gap: 8px; }

.container-tabela-consolidado-scroll {
    overflow-x: auto; max-height: 65vh; border-radius: 8px; border: 1px solid var(--border-card); background: var(--bg-card);
}

.tabela-consolidado { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.tabela-consolidado th, .tabela-consolidado td { padding: 10px 12px; border: 1px solid var(--border-card); text-align: center; white-space: nowrap; vertical-align: middle; }
.tabela-consolidado th { background-color: var(--bg-secondary); color: var(--text-muted); font-weight: 600; position: sticky; top: 0; z-index: 5; }

.tabela-consolidado td.col-nome-aluno { text-align: left; font-weight: 600; color: var(--text-main); max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.tabela-consolidado th.th-bim { width: 55px; text-align: center; }
.tabela-consolidado th.th-alerta { width: 120px; text-align: center; }
.tabela-consolidado th.th-acao { width: 45px; text-align: center; }

.linha-boletim-primeiro td { border-top: 2px solid var(--border-card) !important; }
.linha-boletim-subseq td { border-top: 1px dashed rgba(255, 255, 255, 0.06) !important; }

/* Botão da Sanfona */
.btn-sanfona-boletim { background: transparent; border: none; color: #38bdf8; cursor: pointer; padding: 4px; display: inline-flex; align-items: center; justify-content: center; transition: transform 0.2s ease, color 0.2s ease; }
.btn-sanfona-boletim.aberto { transform: rotate(180deg); color: #f59e0b; }

/* Status Macros com Fundo Sólido */
.badge-status-macro { padding: 4px 10px; border-radius: 6px; font-weight: 700; font-size: 0.78rem; display: inline-block; white-space: nowrap; background-color: var(--bg-primary) !important; }
.badge-status-macro.aprovado { border: 1px solid #10b981 !important; color: #34d399 !important; }
.badge-status-macro.seguro { border: 1px solid #38bdf8 !important; color: #38bdf8 !important; }
.badge-status-macro.alerta { border: 1px solid #eab308 !important; color: #facc15 !important; }
.badge-status-macro.risco { border: 1px solid #ef4444 !important; color: #f87171 !important; }
.badge-status-macro.rec-final { border: 1px solid #f97316 !important; color: #fb923c !important; }
.badge-status-macro.neutro { border: 1px solid #475569 !important; color: #94a3b8 !important; }

/* -------------------------------------------------------------------------
   LAYOUT DA SANFONA (ESTANQUE E SEM TRANSBORDO)
   ------------------------------------------------------------------------- */
.tr-sanfona-detalhe { display: none; }
.tr-sanfona-detalhe.aberto { display: table-row !important; }
.tr-sanfona-detalhe td { 
    background: #0b1120 !important; 
    padding: 16px 20px !important; 
    white-space: normal !important; 
    border-bottom: 2px solid #334155 !important; 
}

.painel-sanfona-clean {
    display: flex;
    gap: 24px;
    align-items: flex-start; /* Alinha o topo do alerta com o simulador */
    background: var(--bg-primary);
    border: 1px solid var(--border-card);
    border-radius: 8px;
    padding: 20px;
    text-align: left;
    white-space: normal !important;
}

@media (max-width: 850px) {
    .painel-sanfona-clean { flex-direction: column; align-items: stretch; gap: 16px; }
}

/* Bloco Esquerdo: Status e Progresso */
.sanfona-bloco-status {
    flex: 1;
    min-width: 0 !important; /* Obriga o Flexbox a respeitar o limite horizontal */
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Alertas de Contexto (Verde, Amarelo, Vermelho, Laranja) */
.alerta-clean-box { 
    padding: 12px 16px; 
    border-radius: 6px; 
    font-size: 0.85rem; 
    line-height: 1.45; 
    display: flex; 
    flex-direction: column; 
    gap: 4px; 
    white-space: normal !important; /* Quebra natural de linha */
    word-break: break-word;
    overflow-wrap: break-word;
}

.alerta-clean-box strong { font-size: 0.9rem; }
.alerta-clean-box.success { background: rgba(16, 185, 129, 0.08); border-left: 3px solid #10b981; color: #d1fae5; }
.alerta-clean-box.success strong { color: #34d399; }
.alerta-clean-box.warning { background: rgba(245, 158, 11, 0.08); border-left: 3px solid #f59e0b; color: #fef3c7; }
.alerta-clean-box.warning strong { color: #fbbf24; }
.alerta-clean-box.danger { background: rgba(239, 68, 68, 0.08); border-left: 3px solid #ef4444; color: #fee2e2; }
.alerta-clean-box.danger strong { color: #f87171; }
.alerta-clean-box.exam { background: rgba(249, 115, 22, 0.08); border-left: 3px solid #f97316; color: #ffedd5; }
.alerta-clean-box.exam strong { color: #fb923c; }
.alerta-clean-box.neutral { background: rgba(71, 85, 105, 0.1); border-left: 3px solid #64748b; color: #f8fafc; }

/* Barra de Progresso Fina e Elegante */
.barra-progresso-minimalista {
    position: relative;
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}

.marcador-meta-24 {
    position: absolute;
    left: 60%; /* 24 pontos de 40 possíveis = 60% */
    top: 0;
    height: 100%;
    width: 2px;
    background: rgba(255, 255, 255, 0.3);
    z-index: 3;
}

.marcador-meta-24-tag {
    position: absolute;
    top: -20px;
    left: calc(60% - 14px);
    font-size: 0.65rem;
    font-weight: bold;
    color: var(--text-muted);
}

.progress-fill { height: 100%; border-radius: 4px; transition: width 0.4s ease; }
.progress-fill.seguro { background-color: #10b981; }
.progress-fill.atencao { background-color: #f59e0b; }
.progress-fill.critico { background-color: #ef4444; }

/* Bloco Direito: Simulador (Fixo e Protegido contra Encolhimento) */
.sanfona-bloco-simulador {
    width: 320px;
    flex-shrink: 0; /* Impede a compressão pelo bloco da esquerda */
    background: rgba(0, 0, 0, 0.2);
    border: 1px dashed var(--border-card);
    border-radius: 6px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-sizing: border-box;
    white-space: normal !important;
}

@media (max-width: 850px) { 
    .sanfona-bloco-simulador { 
        width: 100%; 
        border-left: none; 
        border-top: 1px dashed var(--border-card); 
    } 
}

.simulador-titulo { font-size: 0.88rem; font-weight: 700; color: #38bdf8; display: flex; align-items: center; gap: 6px; }
.simulador-linha { display: flex; justify-content: space-between; align-items: center; }
.simulador-resultado { font-size: 0.82rem; color: var(--text-muted); margin-top: 5px; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 8px; }
.badge-status-macro.conselho { border: 1px solid #ef4444 !important; color: #f87171 !important; background: rgba(239, 68, 68, 0.12) !important; }
