/* ==========================================================================
   DIÁRIO DE CLASSE DIGITAL - PRINT STYLESHEET
   Estilos específicos para impressão oficial em folhas A4
   ========================================================================== */

@media print {
  /* Ocultar elementos desnecessários na impressão */
  #sidebar,
  #top-header,
  .demo-banner,
  .diary-toolbar,
  .page-actions,
  .diary-legend,
  .btn,
  .modal-backdrop,
  #toast-container,
  .student-actions-menu,
  .th-activity-actions,
  #relatorios-nav-tabs,
  .ficha-student-bar {
    display: none !important;
  }

  body, html {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 10pt !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #main-wrapper {
    margin: 0 !important;
    padding: 0 !important;
  }

  #main-content {
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  .diary-container, .card {
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }

  /* Cabeçalho Oficial de Impressão */
  .print-official-header {
    display: block !important;
    text-align: center;
    border-bottom: 2px solid #000;
    padding-bottom: 8px;
    margin-bottom: 12px;
  }

  .print-official-header h2 {
    font-size: 14pt;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 4px;
  }

  .print-official-header .school-info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    font-size: 9pt;
    text-align: left;
    margin-top: 6px;
    gap: 4px;
  }

  /* Tabela de Impressão */
  .table-scroll-wrapper {
    overflow: visible !important;
  }

  .diary-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 8pt !important;
  }

  .diary-table th,
  .diary-table td {
    border: 1px solid #000000 !important;
    padding: 3px 2px !important;
    color: #000000 !important;
  }

  .diary-table thead tr:first-child th {
    background: #e2e8f0 !important;
    color: #000000 !important;
    font-weight: bold !important;
  }

  .diary-table thead tr:nth-child(2) th {
    background: #f1f5f9 !important;
    color: #000000 !important;
  }

  .sticky-col-num,
  .sticky-col-name,
  .sticky-col-status {
    position: static !important;
  }

  .grade-input {
    border: none !important;
    background: transparent !important;
    font-size: 8pt !important;
    font-weight: bold !important;
    height: auto !important;
  }

  .final-average-badge {
    background: transparent !important;
    border: none !important;
    color: #000000 !important;
    font-weight: bold !important;
  }

  /* Quebra de Página */
  .page-break {
    page-break-after: always;
  }

  @page {
    size: A4 landscape;
    margin: 1cm;
  }
}

/* Oculto em tela normal */
.print-official-header {
  display: none;
}
