/* ==========================================================================
   Boletim escolar (formato oficial) — tela e impressão
   ========================================================================== */

.bo-camada {
  position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column;
  background: rgba(11, 20, 64, .55); backdrop-filter: blur(3px); animation: subir .25s var(--ease);
}
body.bo-aberto { overflow: hidden; }
.bo-barra {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: var(--navy-900); color: #fff;
}
.bo-barra strong { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.bo-acoes { display: flex; flex-wrap: wrap; gap: 8px; }
.bo-rolagem { flex: 1; overflow: auto; padding: 16px; }

.bo-folha {
  /* a folha acompanha a largura da tabela (sem barra de rolagem dentro dela) */
  width: max-content; min-width: 1240px; max-width: none; margin: 0 auto; padding: 28px 24px 22px; background: #fff; color: #111;
  font-family: Arial, Helvetica, sans-serif; box-shadow: 0 20px 60px -20px rgba(0, 0, 0, .5);
}
.bo-cab { display: flex; gap: 40px; align-items: flex-start; }
.bo-logo { width: 110px; height: auto; object-fit: contain; flex: none; margin: 2px 10px 0; }
.bo-escola strong { display: block; font-size: 13px; letter-spacing: .02em; margin-bottom: 14px; }
.bo-escola p { margin: 0 0 4px; font-size: 14px; white-space: pre; }
.bo-escola .bo-rec { margin-top: 18px; }
.bo-titulo { text-align: center; font-size: 22px; font-weight: 800; letter-spacing: .02em; margin: 18px 0 14px; color: #111; }
.bo-aluno { display: flex; gap: 12px; align-items: center; }
.bo-foto { width: 150px; height: 150px; object-fit: cover; object-position: center top; flex: none; }
.bo-sem-foto { display: grid; place-items: center; background: #E8ECF5; color: #2B3F8F; font-size: 34px; font-weight: 800; }
.bo-aluno dl { margin: 0; display: grid; gap: 6px; font-size: 12px; }
.bo-aluno dl div { display: flex; gap: 4px; }
.bo-aluno dt { font-weight: 400; }
.bo-aluno dd { margin: 0; font-weight: 700; }
.bo-curso { margin: 14px 0 10px; font-size: 11.5px; font-weight: 700; }

.bo-tabela-wrap { overflow: visible; }
.bo-tabela { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.bo-tabela th, .bo-tabela td { padding: 4px 2.5px; border-bottom: 1px solid #E5E7EB; text-align: center; white-space: nowrap; }
.bo-tabela thead th { font-weight: 700; background: #fff; border-bottom: 1px solid #D1D5DB; }
.bo-tabela thead tr:first-child th { border-left: 1px solid #E5E7EB; }
.bo-tabela .bo-disc { text-align: left; font-weight: 700; padding-left: 4px; min-width: 150px; }
.bo-tabela tbody th.bo-disc { font-weight: 700; }
.bo-tabela tbody tr:nth-child(even) { background: #FAFBFD; }
.bo-v.bo-ok { color: #1D4ED8; }
.bo-v.bo-baixa { color: #DC2626; }
.bo-v.bo-forte { font-weight: 700; }
.bo-tot { width: 46px; white-space: normal !important; }
.bo-sit { text-align: left !important; white-space: nowrap !important; padding-left: 6px !important; }
/* borda externa da tabela */
.bo-tabela { border: 2px solid #6B7280; }
.bo-tabela thead tr:first-child th.bo-disc { border-left: 0; }
/* mesma borda separando o cabeçalho das notas */
.bo-tabela thead tr:last-child th, .bo-tabela thead th[rowspan] { border-bottom: 2px solid #6B7280; }
.bo-tabela tbody tr:last-child th, .bo-tabela tbody tr:last-child td { border-bottom: 0; }
/* separadores: linha forte entre os bimestres, fina entre REC e MED dentro do bimestre */
.bo-tabela .bo-ini { border-left: 2px solid #6B7280 !important; }
.bo-tabela .bo-sub { border-left: 1px solid #D1D5DB !important; }
.bo-tabela thead th.bo-grupo { background: #F3F4F6; }
.bo-tabela tbody td.bo-ini { padding-left: 5px; }
.bo-tabela .bo-disc { padding-left: 6px !important; min-width: 120px; max-width: 150px; white-space: normal !important; line-height: 1.2; }
.bo-rodape { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 14px; font-size: 9.5px; color: #6B7280; }

/* impressão: só a folha, A4 deitado */
@media print {
  @page { size: A4 landscape; margin: 8mm; }
  body.bo-aberto > *:not(.bo-camada) { display: none !important; }
  body.bo-aberto { background: #fff !important; overflow: visible; }
  .bo-camada { position: static; background: none; backdrop-filter: none; animation: none; display: block; }
  .bo-barra { display: none; }
  .bo-rolagem { overflow: visible; padding: 0; }
  .bo-folha { width: auto; min-width: 0; box-shadow: none; padding: 0; zoom: 1 !important; }
  .bo-tabela-wrap { overflow: visible; }
  .bo-tabela { font-size: 8.6px; }
  .bo-tabela th, .bo-tabela td { padding: 3px 2px; }
  .bo-tabela tbody tr:nth-child(even) { background: none; }
  .bo-tabela tr { break-inside: avoid; }
  .marca-dagua, .listras-dagua { display: none !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media (prefers-reduced-motion: reduce) { .bo-camada { animation: none; } }
