/* Sipariş Takip → SİPARİŞLERİ YAZDIR (order-print.js). A4, defter sayfası görünümü. */
#opRoot {
  --op-row: 6.7mm;          /* 40 satır + 2 satırlık başlık A4'e sığar */
  --op-ink: #1d2f6f;
  --op-line: #c7d2e6;
  --op-mark: #ffd28a;
  position: fixed; inset: 0; z-index: 1000; overflow: auto;
  background: #e9edf1;
}
.op-bar {
  position: sticky; top: 0; z-index: 2;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 18px; background: #fff; border-bottom: 1px solid #d7dee4; box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.op-bar b { display: block; font-size: 16px; }
.op-bar small { color: #6b7780; }
.op-actions { display: flex; gap: 8px; }
.op-sheets { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 22px 12px 40px; }

.op-sheet {
  position: relative; box-sizing: border-box; width: 210mm; height: 297mm; overflow: hidden;
  padding: 9mm 7mm 0 14mm; background-color: #fff; color: var(--op-ink);
  font-family: Georgia, 'Times New Roman', serif;
  box-shadow: 0 4px 18px rgba(0,0,0,.15);
  /* Defter çizgileri: her satırın altında ince çizgi, sayfa boyunca */
  background-image:
    linear-gradient(to right, transparent 10mm, #9fb0cf 10mm, #9fb0cf 10.3mm, transparent 10.3mm),
    repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--op-row) - .25mm), var(--op-line) calc(var(--op-row) - .25mm), var(--op-line) var(--op-row));
  background-position: 0 0, 0 9mm;
  background-size: 100% 100%, 100% var(--op-row);
  background-repeat: no-repeat, repeat-y;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.op-head {
  height: calc(var(--op-row) * 2); display: flex; justify-content: space-between; align-items: flex-end;
  padding: 0 2mm calc(var(--op-row) * .25);
}
.op-head h1 { margin: 0; font-size: 19pt; font-weight: 700; letter-spacing: .2px; }
.op-head span { font-size: 12pt; font-weight: 700; }
.op-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.op-col { min-width: 0; padding: 0 2mm; border-left: 1px dashed #aab8d4; }
.op-col:first-child { border-left: 0; }
.op-row {
  height: var(--op-row); box-sizing: border-box; display: flex; align-items: flex-end; gap: 2mm;
  padding-bottom: 1.1mm; white-space: nowrap; overflow: hidden;
}
.op-region span { font-size: 11.5pt; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.op-cust span {
  font-family: Arial, Helvetica, sans-serif; font-size: 8pt; font-weight: 800; letter-spacing: .2px;
  background: var(--op-mark); padding: 0 1.2mm; border-radius: 1px;
  overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.op-note { font-size: 7.5pt; font-style: italic; color: #8a5a00; padding-left: 1.5mm; overflow: hidden; text-overflow: ellipsis; }
.op-item { padding-left: 2.5mm; justify-content: space-between; }
.op-name { font-size: 8pt; font-style: italic; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.op-item b { flex: 0 0 auto; font-size: 8.5pt; font-weight: 700; }

/* Telefonda önizleme sığsın */
@media screen and (max-width: 860px) {
  .op-sheets { zoom: .46; padding-top: 30px; }
}

/* Yazdırırken yalnız sayfalar */
@media print {
  @page { size: A4 portrait; margin: 0; }
  body.op-printing > *:not(#opRoot) { display: none !important; }
  body.op-printing { background: #fff !important; }
  #opRoot { position: static; overflow: visible; background: #fff; }
  .op-bar { display: none; }
  .op-sheets { display: block; padding: 0; zoom: 1; }
  .op-sheet { box-shadow: none; break-after: page; page-break-after: always; }
  .op-sheet:last-child { break-after: auto; page-break-after: auto; }
}
