/* goldenbooks-web/assets/css/print.css */
@page {
  size: letter portrait;
  margin: 12mm;
}

* { box-sizing: border-box; }
body {
  font-family: 'Segoe UI', -apple-system, sans-serif;
  color: #111827;
  background: #e5e7eb;
  margin: 0;
  padding: 20px;
  font-size: 13px;
  line-height: 1.45;
}

.print-toolbar {
  max-width: 820px;
  margin: 0 auto 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1b2a4a;
  color: #fff;
  padding: 10px 16px;
  border-radius: 6px;
}
.print-toolbar button {
  padding: 6px 14px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}
.btn-print { background: #2563eb; color: #fff; }
.btn-close { background: #475569; color: #fff; margin-left: 6px; }

.sheet {
  position: relative;
  max-width: 820px;
  min-height: 1020px;
  margin: 0 auto;
  background: #fff;
  padding: 32px 36px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.doc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #1e3a8a;
  padding-bottom: 16px;
  margin-bottom: 20px;
}
.company-block h2 { margin: 0 0 4px; font-size: 20px; color: #1e3a8a; }
.company-logo { max-height: 54px; margin-bottom: 6px; display: block; }
.doc-title-block { text-align: right; }
.doc-title { font-size: 26px; font-weight: 800; letter-spacing: 1px; color: #1e3a8a; margin: 0 0 8px; }

.meta-table { border-collapse: collapse; margin-left: auto; font-size: 12px; }
.meta-table th, .meta-table td { border: 1px solid #cbd5e1; padding: 4px 10px; }
.meta-table th { background: #f1f5f9; text-align: center; font-weight: 600; }

.addr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 18px;
}
.addr-box { border: 1px solid #cbd5e1; border-radius: 4px; overflow: hidden; }
.addr-box-title { background: #f1f5f9; padding: 5px 10px; font-weight: 700; font-size: 12px; border-bottom: 1px solid #cbd5e1; }
.addr-box-body { padding: 8px 10px; min-height: 70px; white-space: pre-line; }

.info-strip {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 12px;
}
.info-strip th, .info-strip td { border: 1px solid #cbd5e1; padding: 5px 8px; text-align: center; }
.info-strip th { background: #f8fafc; font-weight: 600; }

.items-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 18px;
}
.items-table th, .items-table td { border: 1px solid #cbd5e1; padding: 7px 8px; vertical-align: top; }
.items-table th { background: #1e3a8a; color: #fff; font-weight: 600; font-size: 12px; }
.items-table tr { page-break-inside: avoid; }

.text-right { text-align: right !important; }
.text-center { text-align: center !important; }

.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  page-break-inside: avoid;
}
.message-box { flex: 1; border: 1px solid #e2e8f0; padding: 10px; border-radius: 4px; min-height: 70px; font-size: 12px; }
.totals-table { width: 280px; border-collapse: collapse; }
.totals-table td { padding: 6px 10px; border: 1px solid #cbd5e1; }
.totals-table .grand-row { background: #eff6ff; font-size: 15px; font-weight: 800; color: #1e3a8a; }

/* PAID / VOID 상태 스탬프 (Ch 3 Basic Customization 반영) */
.status-stamp {
  position: absolute;
  top: 165px;
  left: 50%;
  transform: translateX(-50%) rotate(-18deg);
  font-size: 48px;
  font-weight: 900;
  letter-spacing: 6px;
  padding: 6px 24px;
  border: 6px solid;
  border-radius: 10px;
  opacity: 0.22;
  pointer-events: none;
  z-index: 5;
}
.stamp-paid { color: #16a34a; border-color: #16a34a; }
.stamp-void { color: #dc2626; border-color: #dc2626; }

.sign-box {
  margin-top: 36px;
  display: flex;
  justify-content: space-between;
  gap: 30px;
  page-break-inside: avoid;
}
.sign-line { flex: 1; border-top: 1px solid #334155; padding-top: 6px; font-size: 12px; color: #475569; }

@media print {
  body { background: #fff; padding: 0; }
  .print-toolbar { display: none !important; }
  .sheet { box-shadow: none; padding: 0; max-width: 100%; min-height: auto; }
}