/* Печать отчёта: виден только #report, A4, 15 мм поля */

@media print {
  /* Печать черно-белая (ТЗ 9.3): фон бумаги белый, заголовки отчёта без фирменного цвета */
  body {
    background: #fff !important;
  }
  #report h1,
  #report h2,
  #report h3 {
    color: #000 !important;
  }

  /* Печать отчёта из диалога: когда диалог открыт (body.report-open ставит
     app.js), печатается только диалог. При закрытом диалоге правила не
     действуют, и Ctrl+P печатает страницу как есть (ревью 2026-10-23:
     раньше на любой вкладке печатался пустой лист или устаревший отчёт). */

  /* Скрываем всё кроме диалога */
  body.report-open > *:not(#report-dialog) {
    display: none !important;
  }

  body.report-open dialog#report-dialog {
    display: block !important;
    position: static !important;
    width: 100% !important;
    max-width: none !important;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
  }

  dialog#report-dialog .dialog-toolbar {
    display: none !important;
  }

  #report {
    width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
    height: auto !important;
  }

  /* Разрывы страниц между разделами */
  #report h2 {
    page-break-after: avoid;
    page-break-inside: avoid;
  }

  #report table {
    page-break-inside: avoid;
  }

  @page {
    size: A4;
    margin: 15mm;
  }

  #report table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 8px;
  }

  #report th,
  #report td {
    border: 1px solid #000;
    padding: 4px 6px;
    text-align: right;
    font-size: 10pt;
  }

  #report th {
    text-align: left;
    background: #eee;
  }

  code,
  .formula {
    font-family: monospace;
    font-size: 10pt;
  }

  .ok {
    color: #000 !important;
  }
  .bad {
    color: #000 !important;
    font-weight: 700 !important;
  }

  h1 {
    font-size: 14pt;
  }
  h2 {
    font-size: 12pt;
  }

  /* Печатная записка (print-note.js): шрифт Times New Roman, формулы курсивом,
     полная таблица К.1 мелким кеглем. Нумерация страниц - только в Word-версии
     (колонтитул docx): фиксированный печатный колонтитул в браузере наезжал на
     последнюю строку текста, от него отказались (проверка 20.11.2026) */
  #report .print-note {
    font-family: 'Times New Roman', serif;
  }
  #report .print-note .note-header {
    border-bottom: 2px solid #000 !important;
  }
  #report .print-note .note-formula {
    font-family: 'Times New Roman', serif;
    font-style: italic;
    font-size: 10.5pt;
  }
  #report .print-note .row-pick td,
  #report .print-note .k1-pick {
    background: #eee !important;
  }
  #report .print-note .k1-full {
    page-break-inside: auto;
  }
  #report .print-note .k1-full tr {
    page-break-inside: avoid;
  }
  #report .print-note .k1-full th,
  #report .print-note .k1-full td {
    font-size: 7pt;
    padding: 1px 2px;
  }
  /* Подписи в таблицах записки - слева (как в эталоне) */
  #report .print-note .cell-label,
  #report .print-note .subst-table td:nth-child(1),
  #report .print-note .subst-table td:nth-child(2),
  #report .print-note .subst-table td:nth-child(4) {
    text-align: left;
  }
}
