/* ================================================================
   PERFIL DO ESTUDANTE — ficha de acompanhamento (modal único)
   Diagnósticos + apontamentos automáticos + campos livres com
   sugestões editáveis + linhas de assinatura configuráveis.
   ================================================================ */

/* Botões do cabeçalho do modal na MESMA altura do "X" de fechar */
.student-modal .modal-header .btn-sm { min-height: 40px; height: 40px; }
.student-modal .modal-header .icon-btn { height: 40px; }

/* A ficha dentro de uma "página" de papel — quase como o impresso */
.student-modal .modal-body { background: #e9edf3; padding: 18px 14px 26px; }
.pf-pagina {
  max-width: 1040px; margin: 0 auto; background: #fff;
  border: 1px solid var(--border, #dfe5ef); border-radius: 12px;
  box-shadow: 0 12px 34px rgba(20, 48, 79, .12); overflow: hidden;
}
.pf-bloco { padding: 20px 26px; border-bottom: 1px solid var(--border, #dfe5ef); }
.pf-bloco:last-child { border-bottom: none; }
.pf-bloco h2 {
  font-size: 11px; letter-spacing: .9px; text-transform: uppercase;
  color: #24406b; margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.pf-tag {
  font-size: 9px; letter-spacing: .2px; background: var(--primary-soft, #e8eefc);
  color: var(--primary, #2457d6); padding: 2px 8px; border-radius: 999px; text-transform: none;
}

/* KPIs */
.pf-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.pf-kpi { border: 1px solid var(--border, #dfe5ef); border-radius: 11px; padding: 11px 14px; background: var(--surface, #fff); }
.pf-kpi .v { font-size: 22px; font-weight: 800; letter-spacing: -.5px; }
.pf-kpi .l { font-size: 11px; color: var(--muted, #64748b); font-weight: 650; margin-top: 1px; }
.pf-kpi-atencao { background: #fffdf5; border-color: #f1d595; }
.pf-kpi-critico { background: #fff7f8; border-color: #f5c2cb; }

/* Tabela de diagnóstico */
.pf-tabela-wrap { overflow-x: auto; border: 1px solid var(--border, #dfe5ef); border-radius: 10px; }
.pf-tabela { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 12px; }
.pf-tabela th, .pf-tabela td {
  border-right: 1px solid #e3e8f0; border-bottom: 1px solid #e3e8f0;
  padding: 6px 10px; text-align: center; white-space: nowrap;
  background: var(--surface, #fff);
}
.pf-tabela th { background: #eef2f7; font-size: 10.5px; vertical-align: middle; }
.pf-comp { text-align: left !important; font-weight: 650; }
.pf-grupo { border-left: 2px solid #b8c2d0 !important; }
.pf-tabela tbody tr:last-child td { border-bottom: none; }
.pf-tabela th:last-child, .pf-tabela td:last-child { border-right: none; }

/* Cores de risco — mesmas faixas da página Risco */
.pf-crit { background: #f5c2cb !important; color: #83152b; font-weight: 700; }
.pf-abaixo { background: #f1d595 !important; color: #6b4a00; font-weight: 700; }
.pf-ok { background: #e7f5e9 !important; color: #0b7a4b; font-weight: 700; }
.pf-falta { background: #fde3cd !important; font-weight: 700; }
.pf-exame { background: #ede9fe !important; font-weight: 700; }
.pf-tot { background: #f6f8fb !important; font-weight: 700; }
.pf-faltas td { background: #f6f8fb !important; font-weight: 700; font-size: 11px; color: #475569; }
/* Nota em BADGE colorida pelo risco + "|" + faltas: o fundo da célula
   fica neutro (branco) e quem carrega a cor é a badge da nota. */
.pf-nota-badge {
  display: inline-block; padding: 1.5px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 800; line-height: 1.55;
}
.pf-faltas-sep { color: #8fa0b2; margin: 0 6px; font-weight: 400; }
.pf-faltas-qtd { color: #33415a; font-size: 9.5px; font-weight: 800; border-radius: 999px; padding: 1.5px 8px; }
/* RAV dentro da célula do bimestre (Opção B): badge no tamanho das
   outras métricas — azul se recuperou, vermelha se não recuperou */
.pf-rav-badge {
  display: inline-block; margin-top: 3px; padding: 1px 8px;
  border-radius: 999px; font-size: 9.5px; font-weight: 800;
  background: #ede9fe; color: #5b21b6; cursor: help;
}
.pf-rav-recuperou { background: #e6eefc; color: #1c4bb0; }
.pf-rav-nao { background: #fde8ec; color: #c92b3a; }
/* "!" de número fora do padrão (0–10) na fonte — dica no hover */
.pf-aviso {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 999px; cursor: help;
  background: #c92b3a; color: #fff; font-size: 10px; font-weight: 800;
}

/* Apontamentos automáticos */
.pf-apontamentos { display: grid; gap: 8px; }
.pf-apont {
  display: flex; gap: 10px; align-items: flex-start;
  background: #fbfcfe; border: 1px solid var(--border, #dfe5ef);
  border-radius: 10px; padding: 10px 13px; font-size: 12.5px; line-height: 1.5;
}
.pf-nivel {
  font-size: 9.5px; font-weight: 800; padding: 2px 8px; border-radius: 999px;
  flex-shrink: 0; margin-top: 1px;
}
.pf-nivel-alta { background: var(--danger-soft, #fde8ec); color: var(--danger, #c92b3a); }
.pf-nivel-media { background: var(--warning-soft, #fdf3d8); color: var(--warning, #b45309); }
.pf-nivel-ok { background: var(--success-soft, #e3f4ea); color: var(--success, #0b7a4b); }
.pf-nivel-rav { background: #ede9fe; color: #6d28d9; }
/* (os apontamentos automáticos por regras saíram da interface —
   o bloco de insights gerados por IA entra aqui no futuro) */

/* Campos livres com rótulo editável */
.pf-campo { margin-bottom: 14px; }
.pf-campo-topo { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pf-rotulo {
  flex: 1; min-width: 260px;
  border: 1px dashed transparent; border-radius: 7px; padding: 3px 7px;
  font-size: 11.5px; font-weight: 800; font-family: inherit;
  color: var(--text, #172033); background: transparent;
}
.pf-rotulo:hover { border-color: #c8d2e0; background: #fafbfe; }
.pf-rotulo:focus { outline: none; border-color: var(--primary, #2457d6); background: #fff; }
.pf-sugestao {
  font-size: 9px; font-weight: 700; background: #eef2f8; color: #5b6b82;
  padding: 2px 8px; border-radius: 999px;
}
.pf-remover {
  margin-left: auto; font-size: 10.5px; color: var(--muted, #64748b);
  cursor: pointer; border: none; background: none;
}
.pf-remover:hover { color: var(--danger, #c92b3a); }
.pf-campo textarea {
  width: 100%; min-height: 80px; border: 1px solid var(--border, #dfe5ef);
  border-radius: 10px; padding: 11px 13px; font-size: 12.5px; line-height: 1.6;
  font-family: inherit; resize: vertical; background: #fcfdff;
  overflow: hidden; text-align: justify;
}
.pf-campo textarea:focus { outline: 2px solid var(--primary-soft, #e8eefc); border-color: var(--primary, #2457d6); }
.pf-addcampo {
  display: flex; flex-direction: column; gap: 5px; font-size: 11.5px;
  color: var(--muted, #64748b); margin: 2px 0 14px;
}
.pf-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.pf-addcampo input[type="checkbox"] { accent-color: var(--primary, #2457d6); width: 15px; height: 15px; }
.pf-addcampo-dica { font-size: 10.5px; font-style: italic; opacity: 0.85; }

/* Linhas de assinatura (prévia viva) */
.pf-assinatura-ctrl {
  display: flex; align-items: center; gap: 9px; font-size: 11.5px;
  color: var(--muted, #64748b); background: #f7f9fc;
  border: 1px solid var(--border, #dfe5ef); border-radius: 10px;
  padding: 9px 13px; width: fit-content;
}
.pf-assinatura-ctrl input {
  width: 58px; border: 1px solid var(--border, #dfe5ef); border-radius: 7px;
  padding: 5px 8px; font-size: 12.5px; font-family: inherit; text-align: center;
}
.pf-assinatura-ctrl b { color: var(--text, #172033); }
.pf-assinaturas-preview { margin-top: 16px; display: grid; gap: 20px; width: 100%; }
.pf-assinatura-linha { display: flex; flex-direction: column; align-items: flex-start; }
.pf-linha-assin { width: 100%; border-top: 1px solid #222; padding-top: 6px; text-align: left; }
.pf-assin-label {
  width: 100%; margin-top: 4px; border: 1px dashed transparent; border-radius: 6px;
  padding: 2px 6px; font-size: 10px; color: #555; font-family: inherit;
  text-align: left; background: transparent;
}
.pf-assin-label:hover { border-color: #c8d2e0; background: #fafbfe; }
.pf-assin-label:focus { outline: none; border-color: var(--primary, #2457d6); background: #fff; }

/* Rodapé do modal */
.pf-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 26px; background: #fafbfe;
}
.pf-foot .dica { font-size: 10.5px; color: var(--muted, #64748b); line-height: 1.5; }
.pf-foot-botoes { display: flex; gap: 8px; }

@media print {
  .pf-bloco { padding: 8px 0; }
  .pf-foot, .pf-assinatura-ctrl, .pf-addcampo, .pf-remover, .pf-sugestao { display: none !important; }
}