.order-document {
  font-family: Arial, sans-serif;
  color: #66517f;
  background: white;
  font-size: 14px;
}
.od-header {
  display: grid;
  grid-template-columns: 160px minmax(140px, 1fr) minmax(180px, 1.2fr);
  gap: 12px;
  padding: 24px;
  background: #eee5f7;
  border-bottom: 2px solid #a58ab9;
}
.od-logo {
  width: 150px;
  height: 85px;
  object-fit: contain;
  grid-column: 1;
  grid-row: 1;
}
.od-title {
  grid-column: 2;
  grid-row: 1;
  text-align: center;
}
.od-title h2 {
  font-size: 18px;
  margin: 0 0 5px;
}
.od-legal {
  font-size: 9px;
  line-height: 1.3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.od-legal b {
  font-size: 14px;
  border: 1px solid #a58ab9;
  border-radius: 4px;
  padding: 2px 8px;
}
.od-date {
  grid-column: 3;
  grid-row: 1;
  text-align: right;
  font-size: 16px;
}
.od-date p {
  font-size: 14px;
  margin-top: 10px;
}
.od-client {
  grid-column: 1/3;
  grid-row: 2;
}
.od-client > b {
  font-size: 18px;
}
.od-client p {
  font-size: 12px;
  margin: 5px 0;
}
.od-body {
  padding: 24px;
}
.od-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.od-table th {
  background: #eee6f6;
  text-align: left;
  font-size: 13px;
  padding: 12px;
}
.od-table td {
  background: white;
  padding: 12px;
  font-size: 14px;
}
.od-table th,
.od-table td {
  border: 1px solid #ddd4e5;
}
.od-table th:first-child {
  width: 58%;
}
.od-table th:nth-child(2),
.od-table td:nth-child(2) {
  width: 15%;
  text-align: center;
}
.od-table th:last-child,
.od-table td:last-child {
  text-align: right;
}
.od-counts {
  display: flex;
  gap: 20px;
  margin: 20px 0;
}
.od-counts span {
  border: 1px solid #ddd4e5;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 12px;
  background: #faf7fc;
}
.od-counts b {
  margin-left: 12px;
}
.od-summary p {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin: 8px 0;
}
.od-notes {
  white-space: pre-wrap;
  font-size: 13px;
}
.od-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  border-top: 2px solid #a58ab9;
  padding-top: 16px;
  font-size: 19px;
}
.od-total strong {
  font-size: 28px;
}
.od-table tr,
.od-counts,
.od-total {
  break-inside: avoid;
}
.od-table thead {
  display: table-header-group;
}
@media (max-width: 650px) {
  .od-header {
    grid-template-columns: 100px minmax(95px, 1fr) minmax(130px, 1.2fr);
    gap: 8px;
    padding: 20px;
  }
  .od-logo {
    width: 100px;
    height: 70px;
  }
  .od-title h2 {
    font-size: 14px;
  }
  .od-date {
    font-size: 11px;
  }
  .od-client > b {
    font-size: 15px;
  }
}
@media print {
  html,
  body {
    margin: 0;
    padding: 0;
  }
  .order-document {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  @page {
    size: A4;
    margin: 12mm 8mm 16mm;
    @bottom-right {
      content: counter(page) ' de ' counter(pages);
      font: 9px Arial;
      color: #66517f;
    }
  }
}

.prep-qty {
  font-size: 22px;
}
.delivery-copy + .delivery-copy {
  break-before: page;
}
.delivery-copy > h3 {
  font: 12px Arial;
  color: #444;
}
.prep-print .od-header {
  background: white;
  border-color: #aaa;
}
.prep-print .od-table th,
.prep-print .od-counts span {
  background: white;
}
.prep-print .order-document {
  color: #333;
}
