/* Собственные печатные формы. A4 и поля задаются в миллиметрах; интерфейс не попадает на бумагу. */
@page svod-print { size: A4 portrait; margin: 15mm; }
@page svod-print-wide { size: A4 landscape; margin: 15mm; }
.ms-print-body { margin: 0; background: #e7e7e7; color: #000; font: 10pt/1.25 Arial, Helvetica, sans-serif; }
.ms-print-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 18px; background: #fff; border-bottom: 1px solid #ccc; font: 12px/18px Arial, sans-serif; }
.ms-print-toolbar .ms-btn { margin: 0; }
.ms-print-toolbar span { margin: 0 8px; color: #666; }
.ms-print-pdf-hint { margin: 14px auto; width: 180mm; max-width: calc(100% - 30px); font: 13px/18px Arial, sans-serif; }
.ms-print-sheet { page: svod-print; box-sizing: border-box; width: 210mm; min-height: 297mm; margin: 20px auto; padding: 15mm; background: #fff; box-shadow: 0 1px 5px #aaa; overflow-wrap: anywhere; }
.ms-print-facture, .ms-print-torg12 { page: svod-print-wide; width: 297mm; min-height: 210mm; }
.ms-print-sheet h1 { margin: 7mm 0 5mm; padding-bottom: 3mm; border-bottom: 2px solid #000; font: bold 14pt/1.25 Arial, sans-serif; }
.ms-print-sheet h2 { margin: 2mm 0; font-size: 12pt; }
.ms-print-sheet p { margin: 3mm 0; }
.ms-print-sheet small { display: block; margin-top: 1mm; font-size: 8pt; font-weight: normal; }
.ms-print-code { margin: 0 0 3mm auto; max-width: 80mm; text-align: right; font-size: 8pt; }
.ms-print-field { display: flex; gap: 3mm; margin: 2mm 0; align-items: baseline; }
.ms-print-field > span { flex: none; max-width: 55mm; font-weight: normal; }
.ms-print-field > div { flex: 1; min-width: 0; min-height: 4mm; border-bottom: .2mm solid #777; white-space: pre-wrap; }
.ms-print-bank, .ms-print-grid { width: 100%; margin: 4mm 0; border-collapse: collapse; table-layout: auto; font: inherit; color: #000; }
.ms-print-bank td, .ms-print-grid td, .ms-print-grid th { border: .25mm solid #000; padding: 1.3mm; vertical-align: top; }
.ms-print-bank td { height: 4mm; }
.ms-print-bank td:nth-last-child(-n+2) { white-space: nowrap; }
.ms-print-grid th { font-weight: bold; text-align: center; vertical-align: middle; }
.ms-print-positions { font-size: 8pt; }
.ms-print-positions .ms-print-item-name { min-width: 37mm; }
.ms-print-grid .ms-print-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; overflow-wrap: normal; }
.ms-print-facture .ms-print-positions, .ms-print-torg12 .ms-print-positions { font-size: 7pt; }
.ms-print-facture .ms-print-positions td, .ms-print-facture .ms-print-positions th,
.ms-print-torg12 .ms-print-positions td, .ms-print-torg12 .ms-print-positions th { padding: .8mm; }
.ms-print-facture .ms-print-item-name, .ms-print-torg12 .ms-print-item-name { min-width: 30mm; }
.ms-print-totals { margin: 3mm 0 3mm auto; width: 78mm; break-inside: avoid; }
.ms-print-totals > div { display: flex; justify-content: space-between; gap: 4mm; margin: 1.5mm 0; }
.ms-print-totals b { white-space: nowrap; }
.ms-print-words { font-weight: bold; }
.ms-print-signatures { margin-top: 8mm; break-inside: avoid; }
.ms-print-signatures p { display: flex; align-items: baseline; gap: 5mm; min-height: 7mm; }
.ms-print-sign { display: inline-block; min-width: 65mm; min-height: 4mm; border-bottom: .25mm solid #000; }
.ms-print-stamp { display: inline-block; padding: 5mm 8mm; }
.ms-print-note { border-top: .2mm solid #999; padding-top: 2mm; font-size: 8pt; }
.ms-print-center { text-align: center; }
.ms-print-cash-layout { display: flex; gap: 5mm; }
.ms-print-cash-main { flex: 1; min-width: 0; }
.ms-print-cash-main h1 { font-size: 12pt; }
.ms-print-cash-receipt { box-sizing: border-box; width: 58mm; flex: none; padding-left: 4mm; border-left: .3mm dashed #000; font-size: 9pt; }
.ms-print-cash-receipt .ms-print-field { display: block; }
.ms-print-cash-receipt .ms-print-sign { min-width: 45mm; }
.ms-print-cash-codes { font-size: 8pt; }
.ms-print-cash-codes td { height: 5mm; }
.ms-print-payment-grid td { min-height: 5mm; padding: 2mm; }
.ms-print-purpose { height: 18mm; }
.ms-print-background { pointer-events: none; }
.ms-print-dialog { position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.5); font: 12px/1.4 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #222; }
.ms-print-dialog-panel { box-sizing: border-box; position: relative; width: 530px; max-width: calc(100vw - 30px); max-height: calc(100vh - 40px); display: flex; flex-direction: column; padding: 0 15px; margin: 0; background: #fff; border-radius: 5px; box-shadow: 0 0 25px #333; }
.ms-print-dialog-head { flex: none; padding: 17px 30px 15px 0; }
.ms-print-dialog-head h2 { margin: 0; font-size: 20px; line-height: 24px; }
.ms-print-dialog-close { position: absolute; right: 10px; top: 15px; width: 23px; height: 23px; border-radius: 50%; background: #eee; color: #666; text-decoration: none; text-align: center; font: bold 20px/22px Arial, sans-serif; }
.ms-print-dialog-close:hover { background: #ccc; color: #222; }
.ms-print-dialog-body { flex: 1; min-height: 0; overflow: auto; }
.ms-print-dialog-body > p { margin: 0 0 16px; }
.ms-print-format-label { display: flex; flex-direction: column; gap: 4px; margin: 5px 0 15px; }
.ms-print-format-label .ms-select { width: 100%; max-width: 390px; }
.ms-print-remember { margin-bottom: 10px; }
.ms-print-dialog-foot { display: flex; flex: none; padding: 12px 0 15px; }
.ms-print-dialog-bundle { width: 630px; }
.ms-print-dialog-bundle fieldset { margin: 0 0 15px; padding: 0; border: 0; }
.ms-print-dialog-bundle legend { padding: 0 0 7px; font-size: 14px; font-weight: bold; }
.ms-print-bundle-row { display: flex; justify-content: space-between; align-items: center; gap: 15px; min-height: 29px; }
.ms-print-bundle-row > label:last-child { white-space: nowrap; }
.ms-print-bundle-row .ms-input { width: 45px; }
.ms-print-selection-error { color: #b00; }
.ms-print-error { padding: 24px; }
@media screen and (max-width: 810px) { .ms-print-body main { overflow-x: auto; } .ms-print-sheet { margin: 12px; } }
@media print {
  .ms-print-body { margin: 0; padding: 0; background: #fff; }
  .ms-print-toolbar, .ms-print-pdf-hint { display: none !important; }
  .ms-print-sheet { width: auto; min-height: 0; margin: 0; padding: 0; border: 0; box-shadow: none; break-after: page; page-break-after: always; }
  .ms-print-sheet:last-child { break-after: auto; page-break-after: auto; }
  .ms-print-sheet thead { display: table-header-group; }
  .ms-print-sheet tr { break-inside: avoid; page-break-inside: avoid; }
  .ms-print-sheet h1, .ms-print-sheet h2 { break-after: avoid; }
}
