/* PDF çıktısı ve önizleme — voyage-design-system.css ile uyumlu.
   Önizleme (#pdfPreviewBody) ve indirme (#pdfSheet) AYNI sınıfları kullanır: .pdf-scope.pdf-preview-inner */

/* Görünmez; boyut sıfır olmamalı — html2canvas ölçüm için genişlik gerekir */
#pdfExportRoot {
  position: fixed;
  left: -12000px;
  top: 0;
  z-index: -1;
  pointer-events: none;
  overflow: visible;
}

#pdfExportRoot #pdfSheet {
  display: block;
  width: 297mm;
  min-width: 297mm;
  min-height: 1px;
}

/* ——— Ortak ——— */
.pdf-scope {
  --pdf-gold: var(--gold);
  --pdf-border: var(--border);
  text-rendering: optimizeLegibility;
}

.pdf-scope .pdf-document {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Tek düzen: A4 yatay genişliği (önizleme = indirme; html2canvas için aynı piksel düzeni) */
.pdf-scope.pdf-preview-inner .pdf-document {
  width: 297mm;
  max-width: 297mm;
  margin: 0 auto;
  box-sizing: border-box;
}

.pdf-scope.pdf-preview-inner .pdf-page {
  width: 297mm;
  max-width: 297mm;
  box-sizing: border-box;
  padding: 5mm 6mm 6mm;
  margin: 0 auto 20px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 16px);
  overflow: visible;
  box-shadow: var(--shadow);
  font-family: var(--font-sans);
  font-size: 8px;
  line-height: 1.4;
  min-height: 0;
  height: auto !important;
  max-height: none !important;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.pdf-scope.pdf-preview-inner .pdf-page:last-child {
  margin-bottom: 0;
}

/* Geçici yakalama katmanı (body’de) — önizleme ile aynı sınıflar */
#pdfCaptureStage.pdf-scope {
  box-sizing: border-box;
}

#pdfExportRoot .pdf-scope.pdf-preview-inner .pdf-document,
#pdfExportRoot .pdf-scope.pdf-preview-inner .pdf-page {
  width: 297mm;
  max-width: 297mm;
}

.pdf-scope .pdf-page--2 {
  page-break-before: always;
  break-before: page;
}

.pdf-scope .pdf-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6mm;
  padding-bottom: 3mm;
  margin-bottom: 3mm;
  border-bottom: 2px solid var(--gold-light);
}

.pdf-scope .pdf-head-left {
  flex: 1;
  min-width: 0;
}

.pdf-scope .pdf-menu-col {
  min-width: 0;
}

.pdf-scope .pdf-head-kicker {
  font-size: 6.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}

.pdf-scope .pdf-head-title {
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  margin: 1mm 0 0;
  line-height: 1.2;
}

.pdf-scope .pdf-head-right {
  text-align: right;
  flex-shrink: 0;
}

.pdf-scope .pdf-head-hotel {
  font-family: var(--font-serif);
  font-size: 10px;
  font-weight: 600;
  color: var(--gold);
}

.pdf-scope .pdf-head-meta {
  font-size: 8px;
  color: var(--text-dim);
  margin-top: 1mm;
}

.pdf-scope .pdf-head-page {
  font-size: 7px;
  color: var(--text-xdim);
  margin-top: 1mm;
  letter-spacing: 0.06em;
}

.pdf-scope.pdf-preview-inner .pdf-page-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: none;
  overflow: visible;
}

.pdf-scope .pdf-stat-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.pdf-scope .pdf-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius, 10px);
  padding: 6px 8px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.pdf-scope .pdf-stat--gold {
  background: var(--gold-bg);
  border-color: var(--gold-light);
}

.pdf-scope .pdf-stat--green {
  background: var(--green-bg);
  border-color: rgba(45, 106, 79, 0.25);
}

.pdf-scope .pdf-stat--amber {
  background: var(--yellow-bg);
  border-color: rgba(146, 103, 42, 0.25);
}

.pdf-scope .pdf-stat-label {
  display: block;
  font-size: 6px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.pdf-scope .pdf-stat-val {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.1;
}

.pdf-scope .pdf-stat--gold .pdf-stat-val {
  color: var(--gold);
}

.pdf-scope .pdf-stat--green .pdf-stat-val {
  color: var(--green);
}

.pdf-scope .pdf-stat--amber .pdf-stat-val {
  color: var(--yellow);
}

.pdf-scope .pdf-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  min-height: 0;
}

.pdf-scope .pdf-row--3 > .pdf-blk {
  flex: 1;
  min-width: 0;
}

.pdf-scope .pdf-row--bottom {
  align-items: stretch;
}

.pdf-scope .pdf-blk {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 8px 10px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pdf-scope .pdf-blk--full {
  flex: 1;
  min-height: 0;
}

.pdf-scope.pdf-preview-inner .pdf-blk--notes .pdf-notlar {
  max-height: none;
}

.pdf-scope .pdf-blk--bars {
  flex: 1.1;
}

.pdf-scope .pdf-blk--menus {
  flex: 1;
  min-height: 0;
}

.pdf-scope .pdf-blk-title {
  font-family: var(--font-serif);
  font-size: 8px;
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.pdf-scope .pdf-kv {
  font-size: 8px;
  margin-bottom: 3px;
}

.pdf-scope .pdf-kv span {
  color: var(--text-dim);
  font-weight: 600;
  margin-right: 4px;
}

.pdf-scope .pdf-dim {
  color: var(--text-xdim);
  font-weight: 500;
}

.pdf-scope .pdf-kv--lead {
  font-family: var(--font-serif);
  font-size: 9px;
  color: var(--text);
  margin-bottom: 4px;
}

.pdf-scope .pdf-kv--sub {
  font-size: 7.5px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.pdf-scope .pdf-kv--meet {
  font-size: 7.5px;
  margin-bottom: 4px;
}

.pdf-scope .pdf-notlar {
  font-size: 7.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  overflow: visible;
  max-height: none;
}

.pdf-scope .pdf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 7.5px;
}

.pdf-scope .pdf-table th,
.pdf-scope .pdf-table td {
  border: 1px solid var(--border);
  padding: 4px 6px;
  text-align: left;
  vertical-align: top;
}

.pdf-scope .pdf-table th {
  background: var(--surface2);
  color: var(--text-dim);
  font-weight: 600;
  font-size: 6.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pdf-scope .pdf-table--compact td {
  padding: 3px 5px;
}

.pdf-scope .pdf-bars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 12px;
  font-size: 7.5px;
}

.pdf-scope .pdf-bar-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  padding: 3px 0;
  border-bottom: 1px dotted var(--border);
}

.pdf-scope .pdf-bar-name {
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 0;
}

.pdf-scope .pdf-bar-h {
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pdf-scope .pdf-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 7px;
  font-weight: 600;
}

.pdf-scope .pdf-badge-acik {
  background: var(--green-bg);
  color: var(--green);
}

.pdf-scope .pdf-badge-kapali {
  background: var(--red-bg);
  color: var(--red);
}

.pdf-scope .pdf-anim-table {
  font-size: 7px;
}

.pdf-scope .pdf-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pdf-scope .pdf-menu-cols {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.pdf-scope .pdf-menu-h {
  font-weight: 700;
  color: var(--gold);
  font-size: 8px;
  margin-bottom: 4px;
}

.pdf-scope .pdf-menu-pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-sans);
  font-size: 7px;
  line-height: 1.4;
  color: var(--text);
  max-height: none;
  overflow: visible;
}

.pdf-scope .pdf-izinli-pre {
  margin: 4px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-sans);
  font-size: 7px;
  line-height: 1.35;
  color: var(--text);
}

.pdf-scope .pdf-blk-title--sub {
  margin-top: 8px;
  font-size: 8px;
}

.pdf-scope .pdf-asistan-table td:first-child {
  width: 28%;
}

/* Modal önizleme: kaydırma alanı */
#pdfPreviewOverlay.modal-overlay {
  z-index: 200;
}

#pdfPreviewOverlay .modal.pdf-preview-modal {
  width: min(98vw, 1240px);
  max-width: 1240px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

#pdfPreviewOverlay .pdf-preview-body {
  flex: 1;
  overflow: auto;
  padding: 16px 20px;
  background: var(--bg);
  min-height: 200px;
  max-height: 72vh;
}

#pdfPreviewOverlay .pdf-preview-inner {
  min-width: min(100%, 297mm);
}
