/* ============================================================
   SmartFabX — shared print sheets
   A4 portrait, table-header-group, no UI chrome.
   Used by Print Preview / Export PDF / Assembly / Stock / Cut Opt.
   ============================================================ */

@page {
  size: A4 portrait;
  margin: 8mm;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #fff;
  color: #000;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 8.5pt;
  line-height: 1.25;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.sfx-print-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: #0f172a;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.sfx-print-toolbar button {
  border: 0;
  border-radius: 6px;
  padding: 6px 12px;
  font-weight: 700;
  cursor: pointer;
}

.sfx-print-toolbar .sfx-print-go { background: #2563eb; color: #fff; }
.sfx-print-toolbar .sfx-print-close { background: #e2e8f0; color: #0f172a; }

.sfx-sheet {
  width: 100%;
  max-width: 194mm;
  margin: 0 auto;
  padding: 0;
  background: #fff;
}

.sfx-doc-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  border: 1px solid #000;
  padding: 5px 8px;
  margin-bottom: 6px;
  align-items: start;
}

.sfx-doc-head h1 {
  margin: 0;
  font-size: 13pt;
  font-weight: 700;
  line-height: 1.2;
}

.sfx-doc-meta {
  text-align: right;
  font-size: 7.5pt;
  line-height: 1.35;
  white-space: nowrap;
}

.sfx-banner {
  background: #1a3356;
  color: #fff;
  padding: 4px 8px;
  font-size: 8.5pt;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.sfx-unit-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid #000;
  margin-bottom: 6px;
  font-size: 8pt;
}

.sfx-unit-cell {
  border-right: 1px solid #000;
  padding: 4px 6px;
}

.sfx-unit-cell:last-child { border-right: none; }
.sfx-unit-label {
  font-size: 6.5pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #333;
}
.sfx-unit-value {
  font-size: 10pt;
  font-weight: 700;
  line-height: 1.15;
}

.sfx-section-head {
  border: 1px solid #000;
  border-bottom: none;
  padding: 3px 6px;
  font-weight: 700;
  font-size: 8.5pt;
  text-transform: uppercase;
  margin: 6px 0 0;
  background: #f3f4f6;
  page-break-after: avoid;
}

.sfx-section-body {
  border: 1px solid #000;
  padding: 4px 6px 5px;
  margin-bottom: 0;
}

.sfx-subsec {
  font-size: 7.5pt;
  font-weight: 700;
  text-transform: uppercase;
  margin: 4px 0 2px;
}

.sfx-spec-grid {
  display: grid;
  grid-template-columns: minmax(100px, 130px) 1fr minmax(100px, 130px) 1fr;
  border: 1px solid #000;
  font-size: 8pt;
}

.sfx-spec-grid > div {
  padding: 3px 5px;
  border-bottom: 1px solid #000;
  border-right: 1px solid #000;
  word-break: break-word;
}

.sfx-spec-grid .lbl {
  background: #f3f4f6;
  font-weight: 700;
}

.sfx-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 7.5pt;
  margin: 0 0 4px;
  border: 1px solid #000;
}

.sfx-table thead { display: table-header-group; }
.sfx-table tfoot { display: table-footer-group; }
.sfx-table tr { page-break-inside: avoid; break-inside: avoid; }

.sfx-table thead {
  background: #1a3356;
  color: #fff;
}

.sfx-table th,
.sfx-table td {
  border: 1px solid #000;
  padding: 2px 4px;
  vertical-align: middle;
  overflow: hidden;
}

.sfx-table th {
  font-size: 7pt;
  text-transform: uppercase;
  letter-spacing: .02em;
  text-align: left;
}

.sfx-table .c, .sfx-table th.c { text-align: center; }
.sfx-table .r, .sfx-table th.r { text-align: right; font-variant-numeric: tabular-nums; }
.sfx-table td b { font-weight: 700; }

.sfx-thumb {
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  text-align: center;
  padding: 1px !important;
}

.sfx-thumb img {
  width: 34px;
  height: 22px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  background: #fff;
}

.sfx-thumb-ph {
  font-size: 6pt;
  font-weight: 700;
  color: #333;
}

.sfx-empty {
  text-align: center;
  color: #444;
  padding: 4px;
  font-size: 7.5pt;
}

.sfx-footer {
  text-align: center;
  font-size: 6.5pt;
  color: #333;
  margin-top: 8px;
  padding-top: 4px;
  border-top: 1px solid #000;
}

.sfx-footer p { margin: 2px 0; }

.sfx-elev-wrap {
  border: 1px solid #000;
  padding: 4px;
  text-align: center;
  margin-bottom: 6px;
  page-break-inside: avoid;
  max-height: 260px;
  overflow: hidden;
}

.sfx-elev-wrap svg {
  max-width: 100%;
  max-height: 220px;
  width: auto;
  height: auto;
  display: block;
  margin: 0 auto;
}

.sfx-bar-svg {
  width: 100%;
  height: 28px;
  display: block;
  border: 1px solid #000;
  background: #fff;
}

.sfx-opt-bar {
  page-break-inside: avoid;
  break-inside: avoid;
  margin: 0 0 4px;
}

@media print {
  .sfx-print-toolbar { display: none !important; }
  .sfx-sheet { max-width: none; padding: 0; }
  body { margin: 0; }
}
