/* Друковані форми (прев'ю, друк і PDF) */
.page {
  background: #fff;
  color: #000;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  font-family: "Times New Roman", "Liberation Serif", "Tinos", Times, serif;
}
.page.portrait { width: 210mm; min-height: 297mm; padding: 14mm 14mm 14mm 20mm; }
.page.landscape { width: 297mm; min-height: 210mm; padding: 10mm 12mm 10mm 14mm; }
.page * { box-sizing: border-box; }

/* ── Рахунок / накладна / акт (стиль lex.trade, Roboto) ── */
.page.cdoc { padding: 15mm 15mm 15mm 20mm; font-family: 'Roboto', Arial, sans-serif; font-size: 11pt; line-height: 1.35; }
.cdoc * { font-family: inherit; line-height: inherit; color: #000; margin: 0; }
.cdoc b { font-weight: 700; }
.cdoc .d-title { font-size: 16pt; font-weight: 700; text-align: center; margin-top: 4mm; }
.cdoc .d-date { text-align: center; margin-bottom: 8mm; }
.cdoc .d-place { font-size: 10pt; }
.cdoc .d-parties { width: 100%; border-collapse: collapse; margin-bottom: 5mm; }
.cdoc .d-parties td { width: 50%; padding: 0 6mm 4mm 0; vertical-align: top; }
.cdoc .d-pl { font-size: 9pt; color: #555; }
.cdoc .d-pn { font-weight: 700; }
.cdoc .d-plines { font-size: 10pt; }
.cdoc .d-basis { margin-bottom: 5mm; }
.cdoc .d-text { margin-bottom: 4mm; text-align: justify; }
.cdoc table.d-items { width: 100%; border-collapse: collapse; margin-bottom: 3mm; }
.cdoc table.d-items th, .cdoc table.d-items td { border: .3mm solid #000; padding: 1.5mm 2mm; vertical-align: top; }
.cdoc table.d-items th { font-weight: 700; text-align: center; background: #f2f2f2; font-size: 10pt; vertical-align: middle; }
.cdoc table.d-items th small { font-size: 8pt; font-weight: 400; }
.cdoc table.d-items tr { page-break-inside: avoid; break-inside: avoid; }
.cdoc .c-n { width: 9mm; text-align: center; }
.cdoc .c-u { width: 14mm; text-align: center; }
.cdoc .c-q { width: 16mm; text-align: right; }
.cdoc .c-p { width: 24mm; text-align: right; white-space: nowrap; }
.cdoc .c-s { width: 26mm; text-align: right; white-space: nowrap; }
.cdoc table.d-totals { margin-left: auto; border-collapse: collapse; margin-bottom: 4mm; }
.cdoc table.d-totals td { padding: .5mm 0 .5mm 8mm; text-align: right; white-space: nowrap; }
.cdoc table.d-totals .d-total td { font-weight: 700; font-size: 12pt; }
.cdoc .d-words { margin-bottom: 6mm; }
.cdoc .d-note { margin-bottom: 8mm; font-size: 10pt; }
.cdoc table.d-signs { width: 100%; border-collapse: collapse; margin-top: 10mm; }
.cdoc table.d-signs td { width: 50%; padding: 0 6mm 0 0; vertical-align: top; }
.cdoc .d-sl { font-weight: 700; margin-bottom: 6mm; }
.cdoc .d-sline { display: flex; align-items: flex-end; gap: 2mm; font-size: 10pt; white-space: nowrap; }
.cdoc .d-spos, .cdoc .d-sname { flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; }
.cdoc .d-sdash { flex: 1 0 25mm; border-bottom: .3mm solid #000; height: 4mm; }
.cdoc .d-foot { font-size: 8pt; margin-top: 10mm; }

/* ── ТТН ── */
.ttn { font-size: 10.5pt; line-height: 1.25; }
.ttn .u { display: inline-flex; flex-direction: column; vertical-align: top; min-width: 10mm; }
.ttn .uv { border-bottom: 1px solid #000; padding: 0 1.5mm; min-height: 1.3em; text-decoration: none; }
.ttn .uc { font-size: 7.3pt; line-height: 1.15; text-align: center; padding-top: .3mm; }
.ttn .grow { flex: 1; }
.ttn .t-row { display: flex; align-items: flex-start; gap: 2mm; }
.ttn .t-row.sb { justify-content: space-between; }
.ttn .t-row.gap { margin-top: 5mm; }
.ttn .t-row.gap2 { margin-top: 7mm; }
.ttn .t-row.ind { margin-top: 2mm; padding-left: 4mm; }
.ttn .t-row + .t-row { margin-top: 3mm; }
.ttn .t-row .t-row { margin-top: 0; }
.ttn .t-appx { margin-left: 168mm; font-size: 10.5pt; margin-bottom: 7mm; }
.ttn .t-title { text-align: center; font-weight: 700; font-size: 11.5pt; }
.ttn .t-num { text-align: center; font-weight: 700; margin-bottom: 5mm; }
.ttn .t-num .uv { text-align: center; }
.ttn .w-num { min-width: 18mm; }
.ttn .w-day { min-width: 10mm; }
.ttn .w-mon { min-width: 26mm; }
.ttn .w-yr { min-width: 13mm; }
.ttn .w-place { min-width: 50mm; }
.ttn .w-car { width: 55mm; }
.ttn .w-kind { min-width: 55mm; max-width: 80mm; }
.ttn .w-point { min-width: 70mm; max-width: 95mm; }
.ttn .w-words { min-width: 25mm; max-width: 60mm; }
.ttn .w-recv { width: 78mm; }
.ttn .w-dim { width: 25mm; margin-left: 6mm; }
.ttn .w-dim .uv, .ttn .w-wt .uv { text-align: center; }
.ttn .w-wt { width: 70mm; margin-left: 6mm; }
.ttn .w-sum { min-width: 70mm; max-width: 125mm; }
.ttn .w-vat { min-width: 60mm; }
.ttn .t-vl { width: 72mm; }
.ttn .t-veh .u { flex-shrink: 0; }
.ttn table.t-box { width: 100%; border-collapse: collapse; margin-top: 4mm; }
.ttn table.t-box td { border: 1px solid #000; width: 50%; vertical-align: top; padding: 1mm 1.5mm 1.5mm; }
.ttn .t-party { display: flex; gap: 4mm; margin-top: 5mm; }
.ttn .t-pl { width: 34mm; flex-shrink: 0; }
.ttn .t-back { text-align: right; font-style: italic; }
.ttn .t-sub { text-align: center; font-weight: 700; margin: 2mm 0 3mm; }
.ttn table.t-grid { width: 100%; border-collapse: collapse; }
.ttn table.t-grid th, .ttn table.t-grid td { border: 1px solid #000; padding: 1mm 1.2mm; vertical-align: top; }
.ttn table.t-grid th { font-weight: 400; font-size: 8.5pt; text-align: center; vertical-align: middle; }
.ttn table.t-grid tr.nums td { text-align: center; font-size: 9pt; padding: .4mm; }
.ttn table.t-grid tr { page-break-inside: avoid; break-inside: avoid; }
.ttn table.t-grid tr.blank td { height: 7mm; }
.ttn table.cargo td { font-size: 10.5pt; }
.ttn table.cargo .k1 { width: 15mm; }
.ttn table.cargo .k2 { width: 38mm; }
.ttn .c { text-align: center; }
.ttn .r { text-align: right; white-space: nowrap; }
.ttn .t-sigs { display: flex; justify-content: space-around; text-align: center; margin-top: 7mm; }
.ttn .t-sigs > div { width: 46%; }
.ttn .sigu { display: flex; width: 100%; margin-top: 3mm; }
.ttn .sigu .uv { text-align: center; margin: 0 14mm; }
.ttn table.ops { margin-top: 2mm; }
.ttn table.ops td { height: 7.5mm; }
.ttn .t-notes { border-top: 1px solid #000; margin-top: 5mm; padding-top: 2mm; font-size: 7.3pt; line-height: 1.3; }
.ttn .t-notes p { margin: 0; text-indent: 3mm; }

/* Режим генерації PDF: без мінімальної висоти, щоб не з'являлись порожні сторінки */
/* Генерація PDF: кожна сторінка — щонайменше А4; довший вміст ділиться на наступні аркуші А4 */
.pdf-mode .page { overflow: visible; }
