/* 출력 견적서 전용 표준 */
/* 프로젝트 선택은 기존 검색 행 안에서 줄바꿈한다. */
body:not(.pdf-view) .estimate-list-filters .project-filter-select {
  min-width: 0;
  max-width: 240px;
  flex: 0 1 150px;
}
body.pdf-view [data-project-field] { display: none; }

/* 작성 선택기는 유지하고 PDF와 인쇄에는 줄바꿈 가능한 이름만 표시한다. */
body .print-management-page .quote-meta .document-project-row { display: none; }
body.pdf-view .print-management-page .quote-meta .document-project-row { display: grid; }
body .print-management-page .quote-meta [data-document-project] {
  display: block;
  min-width: 0;
  height: auto;
  padding: 6px 8px;
  border: 0;
  background: #ffffff;
  color: #111827;
  font-weight: 600;
  letter-spacing: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
@media print {
  body .print-management-page .quote-meta .document-project-row { display: grid; }
}

body:not(.pdf-view) .print-management-page .quote-meta,
body:not(.pdf-view) .print-management-page .supplier-card {
  border: 1px solid #9fb5ca;
  border-radius: 0;
  box-shadow: none;
}
body:not(.pdf-view) .print-management-page .quote-meta {
  gap: 0;
  padding: 0;
}

body:not(.pdf-view) .print-management-page .quote-meta::before,
body:not(.pdf-view) .print-management-page .supplier-card::before {
  margin: 0;
  border-bottom: 1px solid #9fb5ca;
}

body:not(.pdf-view) .print-management-page .supplier-grid {
  gap: 0;
}

body:not(.pdf-view) .print-management-page .supplier-row {
  min-height: 30px;
  padding: 0;
  border: 0;
  border-right: 1px solid #9fb5ca;
  border-bottom: 1px solid #9fb5ca;
}

body:not(.pdf-view) .print-management-page .supplier-row:nth-child(2n),
body:not(.pdf-view) .print-management-page .supplier-row.supplier-registration,
body:not(.pdf-view) .print-management-page .supplier-row.supplier-address,
body:not(.pdf-view) .print-management-page .supplier-row.supplier-manager {
  border-right: 0;
}

body:not(.pdf-view) .print-management-page .supplier-row.supplier-manager {
  border-bottom: 0;
}

body:not(.pdf-view) .print-management-page .supplier-row input {
  min-height: 28px;
  height: 28px;
  border: 0;
  border-radius: 0;
}


body:not(.pdf-view) .print-management-page .quote-meta label,
body:not(.pdf-view) .print-management-page .quote-meta label.customer-name-row,
body:not(.pdf-view) .print-management-page .quote-meta label.quote-date-row,
body:not(.pdf-view) .print-management-page .quote-meta label.quote-period-row {
  grid-template-columns: 78px minmax(0, 1fr);
  min-height: 30px;
}

body:not(.pdf-view) .print-management-page .quote-meta::before,
body:not(.pdf-view) .print-management-page .supplier-card::before {
  height: 30px;
  padding: 0 10px;
  background: #1d3557;
  font-size: 12px;
}

body:not(.pdf-view) .print-management-page .quote-meta span,
body:not(.pdf-view) .print-management-page .supplier-row span {
  border-color: #9fb5ca;
}

body:not(.pdf-view) .print-management-page .quote-meta input,
body:not(.pdf-view) .print-management-page .quote-meta select {
  min-height: 28px;
  height: 28px;
  border: 0;
  border-radius: 0;
  font-size: 12px;
}

body:not(.pdf-view) .print-management-page .quote-summary-bar.summary-table-row {
  gap: 0;
  margin: 14px 0;
  border: 1px solid #9fb5ca;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
}

body:not(.pdf-view) .print-management-page .quote-summary-bar.summary-table-row .summary-cell {
  min-height: 62px;
  padding: 6px 8px;
  border-right: 1px solid #9fb5ca;
  border-radius: 0;
}

body:not(.pdf-view) .print-management-page .quote-summary-bar.summary-table-row .summary-cell:last-child {
  border-right: 0;
}

body:not(.pdf-view) .print-management-page .quote-card,
body:not(.pdf-view) .print-management-page .quote-card-head,
body:not(.pdf-view) .print-management-page .quote-group,
body:not(.pdf-view) .print-management-page .quote-results,
body:not(.pdf-view) .print-management-page .added-items,
body:not(.pdf-view) .print-management-page .added-table,
body:not(.pdf-view) .print-management-page .added-table th,
body:not(.pdf-view) .print-management-page .added-table td {
  border-color: #9fb5ca;
  border-radius: 0;
}

body:not(.pdf-view) .print-management-page .quote-card {
  padding: 10px;
  font-size: 12px;
}

body:not(.pdf-view) .print-management-page .quote-card-head {
  padding-bottom: 8px;
}

body:not(.pdf-view) .print-management-page .quote-card label,
body:not(.pdf-view) .print-management-page .quote-card output {
  border-radius: 0;
}

body:not(.pdf-view) .print-management-page .quote-card label > span,
body:not(.pdf-view) .print-management-page .quote-card output > span {
  font-size: 12px;
}

body:not(.pdf-view) .print-management-page .quote-card input,
body:not(.pdf-view) .print-management-page .quote-card select {
  min-height: 30px;
  height: 30px;
  border-radius: 0;
  font-size: 12px;
}

body:not(.pdf-view) .print-management-page .quote-card .date-field,
body:not(.pdf-view) .print-management-page .quote-card .quote-card-discount {
  border: 1px solid #9fb5ca;
  border-radius: 0;
}

body:not(.pdf-view) .print-management-page .quote-card .date-field input,
body:not(.pdf-view) .print-management-page .quote-card .quote-card-discount input {
  border: 0;
}

body:not(.pdf-view) .print-management-page .added-table th,
body:not(.pdf-view) .print-management-page .added-table td {
  height: 30px;
  padding: 6px 8px;
  border-right: 1px solid #9fb5ca;
  border-bottom: 1px solid #9fb5ca;
  font-size: 12px;
  line-height: 1.35;
}

body:not(.pdf-view) .print-management-page .added-table th {
  background: #d5e4f2;
}

body:not(.pdf-view) .print-management-page .added-table .work-description {
  padding: 6px 8px;
}

body:not(.pdf-view) .print-management-page .estimate-customer-items-table {
  width: 100%;
  min-width: 1250px !important;
  table-layout: fixed;
}

body:not(.pdf-view) .print-management-page .estimate-customer-items-table th,
body:not(.pdf-view) .print-management-page .estimate-customer-items-table td {
  white-space: normal !important;
  overflow-wrap: anywhere;
  vertical-align: middle;
}

.estimate-customer-items-table col.date-col { width: 90px; }
.estimate-customer-items-table col.project-col { width: 120px; }
.estimate-customer-items-table col.title-col { width: 140px; }
.estimate-customer-items-table col.manager-col { width: 80px; }
.estimate-customer-items-table col.note-col { width: 100px; }
.estimate-customer-items-table col.unit-col,
.estimate-customer-items-table col.supply-col,
.estimate-customer-items-table col.amount-col { width: 100px; }
.estimate-customer-items-table col.quantity-col { width: 50px; }
.estimate-customer-items-table col.tax-col { width: 80px; }
.estimate-customer-items-table col.discount-col { width: 60px; }

body:not(.pdf-view) .print-management-page .estimate-detail-summary-grid {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed;
}

body:not(.pdf-view) .print-management-page .estimate-detail-summary-grid td {
  width: 33.333333% !important;
  padding: 8px 6px !important;
  text-align: center !important;
  vertical-align: top;
  white-space: normal !important;
  overflow-wrap: anywhere;
}

body:not(.pdf-view) .print-management-page .estimate-detail-summary-grid .detail-summary-label {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  color: #1d3557;
}

body:not(.pdf-view) .print-management-page .estimate-detail-summary-grid .detail-summary-value {
  display: block;
  font-size: 12px;
  line-height: 1.4;
}

body:not(.pdf-view) .print-management-page .estimate-list-filters label,
body:not(.pdf-view) .print-management-page .estimate-list-filters input,
body:not(.pdf-view) .print-management-page .estimate-list-filters select {
  border-radius: 0;
  font-size: 12px;
}

body:not(.pdf-view) .print-management-page .estimate-list-filters.compact-search-bar {
  display: flex !important;
  max-width: 780px;
  margin-left: auto !important;
}

body:not(.pdf-view) .print-management-page .estimate-list-filters.compact-search-bar input,
body:not(.pdf-view) .print-management-page .estimate-list-filters.compact-search-bar button {
  min-height: 28px !important;
  height: 28px !important;
  font-size: 11px !important;
}

/* 모바일에서도 네 글자 상태 문구와 배지 여백이 셀 안에 들어가도록 유지합니다. */
body:not(.pdf-view) .print-management-page .estimates-wrap .estimates-table .status-col,
body:not(.pdf-view) .print-management-page .estimates-wrap .estimates-table .estimate-status-cell {
  width: 76px !important;
  min-width: 76px !important;
}

/* PDF 미리보기와 인쇄에서 견적 정보의 여백과 선을 동일하게 유지합니다. */
@media screen and (min-width: 901px), print {
  body.pdf-view .print-management-page .sheet-header {
    grid-template-columns: minmax(0, 38fr) minmax(0, 62fr) !important;
    align-items: start !important;
  }
}

body.pdf-view .print-management-page .quote-meta,
body.pdf-view .print-management-page .supplier-card {
  border: 1px solid #9fb5ca !important;
}

body.pdf-view .print-management-page .quote-meta {
  gap: 0 !important;
  padding: 0 !important;
  align-content: start !important;
  align-self: start !important;
}

body.pdf-view .print-management-page .quote-meta::before,
body.pdf-view .print-management-page .supplier-card::before {
  margin: 0 !important;
  border-bottom: 1px solid #9fb5ca !important;
}

body.pdf-view .print-management-page .quote-meta label,
body.pdf-view .print-management-page .supplier-row {
  border-color: #9fb5ca !important;
}

body.pdf-view .print-management-page .quote-meta span,
body.pdf-view .print-management-page .quote-meta input,
body.pdf-view .print-management-page .quote-meta select,
body.pdf-view .print-management-page .supplier-row span,
body.pdf-view .print-management-page .supplier-row input {
  min-width: 0 !important;
  border-color: #9fb5ca !important;
}

/* 웹 PDF 미리보기는 기존 화면 글꼴 크기를 유지합니다. */
@media screen {
  body.pdf-view .print-management-page .quote-meta,
  body.pdf-view .print-management-page .supplier-card,
  body.pdf-view .print-management-page .quote-meta label,
  body.pdf-view .print-management-page .supplier-row,
  body.pdf-view .print-management-page .quote-meta span,
  body.pdf-view .print-management-page .quote-meta input,
  body.pdf-view .print-management-page .quote-meta select,
  body.pdf-view .print-management-page .supplier-row span,
  body.pdf-view .print-management-page .supplier-row input {
    font-size: 12px !important;
    line-height: 1.35 !important;
  }

  body.pdf-view .print-management-page .quote-meta::before,
  body.pdf-view .print-management-page .supplier-card::before {
    font-size: 13px !important;
  }
}

/* 실제 PDF 인쇄에서만 긴 문구가 표를 벗어나지 않도록 글꼴을 줄입니다. */
@media print {
  body.pdf-view .print-management-page .quote-meta,
  body.pdf-view .print-management-page .supplier-card,
  body.pdf-view .print-management-page .quote-meta label,
  body.pdf-view .print-management-page .supplier-row,
  body.pdf-view .print-management-page .quote-meta span,
  body.pdf-view .print-management-page .quote-meta input,
  body.pdf-view .print-management-page .quote-meta select,
  body.pdf-view .print-management-page .supplier-row span,
  body.pdf-view .print-management-page .supplier-row input,
  body.pdf-view .print-management-page .quote-meta::before,
  body.pdf-view .print-management-page .supplier-card::before {
    font-size: 10.5px !important;
    line-height: 1.25 !important;
  }
}

body.pdf-view .print-management-page .quote-summary-bar.summary-table-row,
body.pdf-view .print-management-page .added-table {
  border: 1px solid #9fb5ca !important;
  border-collapse: collapse !important;
}

body.pdf-view .print-management-page .quote-summary-bar.summary-table-row .summary-cell,
body.pdf-view .print-management-page .added-table th,
body.pdf-view .print-management-page .added-table td {
  border-color: #9fb5ca !important;
  border-width: 1px !important;
}

body.pdf-view .print-management-page .quote-summary-bar.summary-table-row .summary-grand {
  align-items: flex-end !important;
  justify-items: end !important;
  grid-column: 4 / -1 !important;
  border-left: 1px solid #9fb5ca !important;
  text-align: right !important;
}

body.pdf-view .print-management-page .quote-summary-bar.summary-table-row .summary-grand span,
body.pdf-view .print-management-page .quote-summary-bar.summary-table-row .summary-grand strong {
  width: 100% !important;
  text-align: right !important;
}

@media screen and (max-width: 760px) {
  body:not(.pdf-view) #estimateListFilters .period-presets > button[data-period-preset] {
    padding: 0 2px !important;
  }

  body:not(.pdf-view) .print-management-page .estimate-list-filters.compact-search-bar .period-range input[type="month"] {
    flex-basis: 80px !important;
    width: 80px !important;
    padding-right: 2px !important;
    padding-left: 2px !important;
  }
}

@media screen and (max-width: 760px) {
  body:not(.pdf-view) .print-management-page .estimate-list-filters.compact-search-bar {
    max-width: none;
  }

  body:not(.pdf-view) .print-management-page .quote-meta label.customer-name-row {
    grid-template-columns: 64px minmax(0, 1fr) !important;
  }
  body:not(.pdf-view) .print-management-page .quote-summary-bar.summary-table-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body:not(.pdf-view) .print-management-page .quote-summary-bar.summary-table-row .summary-cell:nth-child(2n) {
    border-right: 0;
  }

  body:not(.pdf-view) .print-management-page .quote-summary-bar.summary-table-row .summary-cell:nth-child(n + 3) {
    border-top: 1px solid #9fb5ca;
  }

  body:not(.pdf-view) .print-management-page .estimates-wrap .estimates-table {
    min-width: 940px !important;
  }

  body:not(.pdf-view) .print-management-page .estimates-wrap .estimates-table th.project-col,
  body:not(.pdf-view) .print-management-page .estimates-wrap .estimates-table td.project-col { min-width: 120px !important; }
  body:not(.pdf-view) .print-management-page .estimates-wrap .estimates-table th.customer-col,
  body:not(.pdf-view) .print-management-page .estimates-wrap .estimates-table td.customer-col { min-width: 150px !important; }
  body:not(.pdf-view) .print-management-page .estimates-wrap .estimates-table th.title-col,
  body:not(.pdf-view) .print-management-page .estimates-wrap .estimates-table td.title-col { min-width: 160px !important; }
  body:not(.pdf-view) .print-management-page .estimates-wrap .estimates-table th.date-col,
  body:not(.pdf-view) .print-management-page .estimates-wrap .estimates-table td.date-col { min-width: 90px !important; }
  body:not(.pdf-view) .print-management-page .estimates-wrap .estimates-table th.amount-col,
  body:not(.pdf-view) .print-management-page .estimates-wrap .estimates-table td.amount-col { min-width: 105px !important; }

  body:not(.pdf-view) .print-management-page .estimates-table col.status-col { width: 60px !important; }
  body:not(.pdf-view) .print-management-page .estimates-table col.date-col { width: 90px !important; }
  body:not(.pdf-view) .print-management-page .estimates-table col.customer-col { width: 150px !important; }
  body:not(.pdf-view) .print-management-page .estimates-table col.project-col { width: 120px !important; }
  body:not(.pdf-view) .print-management-page .estimates-table col.title-col { width: 160px !important; }
  body:not(.pdf-view) .print-management-page .estimates-table col.amount-col { width: 105px !important; }

  body:not(.pdf-view) .print-management-page .estimates-table col.manager-col,
  body:not(.pdf-view) .print-management-page .estimates-table col.count-col,
  body:not(.pdf-view) .print-management-page .estimates-table col.supply-col,
  body:not(.pdf-view) .print-management-page .estimates-table col.tax-col,
  body:not(.pdf-view) .print-management-page .estimates-table th.manager-col,
  body:not(.pdf-view) .print-management-page .estimates-table td.manager-col,
  body:not(.pdf-view) .print-management-page .estimates-table th.count-col,
  body:not(.pdf-view) .print-management-page .estimates-table td.count-col,
  body:not(.pdf-view) .print-management-page .estimates-table th.supply-col,
  body:not(.pdf-view) .print-management-page .estimates-table td.supply-col,
  body:not(.pdf-view) .print-management-page .estimates-table th.tax-col,
  body:not(.pdf-view) .print-management-page .estimates-table td.tax-col {
    display: none;
  }

  body:not(.pdf-view) .print-management-page .estimates-table th,
  body:not(.pdf-view) .print-management-page .estimates-table td {
    padding: 6px 7px;
    font-size: 12px;
  }

  body:not(.pdf-view) .print-management-page .estimates-table td.customer-col,
  body:not(.pdf-view) .print-management-page .estimates-table td.project-col,
  body:not(.pdf-view) .print-management-page .estimates-table td.title-col {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

#addedRowsTable .added-item-inline-input { width:100%; min-width:55px; box-sizing:border-box; margin:0; padding:4px 6px; font:inherit; }
#addedRowsTable .money-col .added-item-inline-input { text-align:right; }

/* Shared web view and PDF use the same complete column proportions. */
body.pdf-view #addedRowsTable :is(col, th, td).quote-no-col { width: 15% !important; }
body.pdf-view #addedRowsTable :is(col, th, td).work-note-col { width: 22% !important; }
body.pdf-view #addedRowsTable :is(col, th, td).work-col { width: 33% !important; }
body.pdf-view #addedRowsTable :is(col, th, td).single-price-col { width: 7% !important; }
body.pdf-view #addedRowsTable :is(col, th, td).qty-col { width: 4% !important; }
body.pdf-view #addedRowsTable :is(col, th, td).money-col { width: 7% !important; }
body.pdf-view #addedRowsTable :is(col, th, td).tax-col { width: 5% !important; }
body.pdf-view #addedRowsTable :is(col, th, td).total-col { width: 7% !important; }
body.pdf-view #addedRowsTable :is(th, td).quote-no-col,
body.pdf-view #addedRowsTable :is(th, td).work-note-col {
  white-space: normal !important;
  overflow-wrap: anywhere;
  padding: 5px 8px !important;
}
