/* Печатные формы: экран — лист на бетонном фоне, печать — только лист */

.printable { min-height: 100vh; background: var(--concrete); padding-bottom: 30px; }
.print-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: var(--asphalt);
  color: #fff;
}
.print-bar .seg { background: transparent; border-color: #5b6a72; }
.print-bar .seg button { color: #dfe5e2; }
.print-bar .seg button.on { background: var(--bunker); }

.sheet {
  position: relative;
  background: #fff;
  color: #000;
  width: 210mm;
  min-height: 297mm;
  margin: 18px auto;
  padding: 14mm 14mm 16mm;
  border: 1px solid var(--rule);
  font-size: 12px;
  line-height: 1.35;
}
.sheet.landscape { width: 297mm; min-height: 210mm; }
.sheet table { border-collapse: collapse; width: 100%; }
.sheet .grid th, .sheet .grid td { border: 1px solid #000; padding: 3px 5px; vertical-align: top; }
.sheet .grid th { font-weight: 600; text-align: center; background: #f2f2f2; }
.sheet .c { text-align: center; }
.sheet .r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sheet .cap { font-size: 10px; color: #444; }
.sheet .bank { margin-bottom: 14px; }
.doc-title { font-size: 17px; font-weight: 700; margin: 6px 0 10px; padding-bottom: 6px; border-bottom: 2px solid #000; }
.parties { margin-bottom: 10px; }
.parties td { padding: 2px 6px 2px 0; vertical-align: top; }
.parties td:first-child { width: 90px; white-space: nowrap; }
.parties.compact td:first-child { width: 130px; }
.totals { width: auto !important; margin: 6px 0 8px auto; }
.totals td { padding: 1px 0 1px 18px; }
.small-print { font-size: 10px; color: #444; }
.signs { display: grid; gap: 18px; margin-top: 22px; }
.signs.two { grid-template-columns: 1fr 1fr; gap: 40px; }
.signs .line { display: inline-block; width: 140px; border-bottom: 1px solid #000; margin: 0 6px; }
.sign-row { margin-top: 18px; }
.upd-head { display: grid; grid-template-columns: 200px 1fr; gap: 14px; margin-bottom: 10px; }
.upd-left { border-right: 2px solid #000; padding-right: 10px; }
.void {
  position: absolute;
  top: 38%;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 64px;
  font-weight: 700;
  color: rgba(165, 71, 58, 0.25);
  transform: rotate(-18deg);
  pointer-events: none;
  text-transform: uppercase;
}

/* Наклейки на контейнеры */
.labels { display: grid; gap: 8mm; width: 210mm; margin: 18px auto; padding: 10mm; background: #fff; border: 1px solid var(--rule); }
.labels.big { grid-template-columns: repeat(2, 1fr); }
.labels.mid { grid-template-columns: repeat(3, 1fr); gap: 5mm; }
.label {
  border: 1.5px dashed #888;
  padding: 5mm;
  text-align: center;
  break-inside: avoid;
  display: grid;
  justify-items: center;
  gap: 2mm;
  color: #000;
}
.label img { width: 100%; max-width: 70mm; aspect-ratio: 1; }
.labels.mid .label img { max-width: 48mm; }
.label .l-no { font-size: 44px; font-weight: 700; letter-spacing: 0.08em; line-height: 1; background: #000; color: #fff; padding: 2mm 5mm; border-radius: 2mm; }
.labels.mid .label .l-no { font-size: 30px; }
.label .l-org { font-size: 11px; }
.label .l-type { font-size: 13px; }

@media print {
  @page { size: A4; margin: 10mm; }
  body { background: #fff; }
  .print-bar { display: none; }
  .printable { background: #fff; padding: 0; min-height: 0; }
  .sheet, .labels { margin: 0; border: 0; width: auto; min-height: 0; padding: 0; }
  .sheet .grid th { background: #f2f2f2 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .label .l-no { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
/* Широкие формы (УПД, маршрутный лист) печатаются альбомом */
@page land { size: A4 landscape; margin: 8mm; }
@media print { .sheet.landscape { page: land; } }
