/* 매출 화면 전용 표준 */
body:not(.pdf-view) .sales-page .sales-side-nav {
  width: 156px;
  min-width: 156px;
  padding: 10px !important;
  border-radius: 8px;
}

body:not(.pdf-view) .sales-page .sales-side-nav > strong {
  font-size: 13px;
}

body:not(.pdf-view) .sales-page .sales-side-nav .sales-view-button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
}

body:not(.pdf-view) .sales-page .sales-side-nav .sales-view-button.active {
  background: #1f6c90;
}

body:not(.pdf-view) .sales-page .sales-filters,
body:not(.pdf-view) .sales-page .receivable-filters {
  align-items: center;
  gap: 8px;
}

body:not(.pdf-view) .sales-page .sales-filters input,
body:not(.pdf-view) .sales-page .sales-filters select,
body:not(.pdf-view) .sales-page .receivable-filters input,
body:not(.pdf-view) .sales-page .receivable-filters select {
  min-height: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: 0;
  font-size: 12px;
}

body:not(.pdf-view) .sales-page .sales-filters input::placeholder,
body:not(.pdf-view) .sales-page .receivable-filters input::placeholder {
  color: #64748b;
  font-size: 12px;
  opacity: 1;
}

body:not(.pdf-view) .sales-page .sales-table th,
body:not(.pdf-view) .sales-page .sales-table td,
body:not(.pdf-view) .sales-page .receivables-table th,
body:not(.pdf-view) .sales-page .receivables-table td {
  padding: 6px 8px;
  border-color: #9fb5ca;
  font-size: 12px;
  line-height: 1.35;
  vertical-align: middle;
}

body:not(.pdf-view) .sales-page .sales-table th,
body:not(.pdf-view) .sales-page .receivables-table th {
  background: #d5e4f2;
  color: #071a2f;
  font-weight: 700;
}

/* 매출 표의 제목과 일반 값은 중앙, 금액 값만 오른쪽으로 정렬합니다. */
body:not(.pdf-view) .sales-page .sales-table th,
body:not(.pdf-view) .sales-page .sales-table td:not(.amount-cell) {
  text-align: center !important;
}

body:not(.pdf-view) .sales-page .sales-table td.amount-cell {
  text-align: right !important;
}

body:not(.pdf-view) .sales-page .sales-table .table-link,
body:not(.pdf-view) .sales-page .sales-table .status-badge,
body:not(.pdf-view) .sales-page .sales-table button,
body:not(.pdf-view) .sales-page .receivables-table .table-link,
body:not(.pdf-view) .sales-page .receivables-table .receivable-status,
body:not(.pdf-view) .sales-page .receivables-table button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 8px;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

body:not(.pdf-view) .sales-page table.sales-item-table[data-management-icons="off"] {
  min-width: 1160px !important;
  table-layout: fixed !important;
}

body:not(.pdf-view) .sales-page .sales-customer-table {
  min-width: 760px !important;
}

/* 합계 행과 상세 행 모두 제목과 프로젝트를 중심으로 읽을 수 있게 배분합니다. */
body:not(.pdf-view) .sales-page .sales-customer-table .customer-col { width: 24% !important; }
body:not(.pdf-view) .sales-page .sales-customer-table .source-col { width: 8% !important; }
body:not(.pdf-view) .sales-page .sales-customer-table .count-col { width: 8% !important; }
body:not(.pdf-view) .sales-page .sales-customer-table .status-col { width: 12% !important; }
body:not(.pdf-view) .sales-page .sales-customer-table .supply-col { width: 17% !important; }
body:not(.pdf-view) .sales-page .sales-customer-table .tax-col { width: 13% !important; }
body:not(.pdf-view) .sales-page .sales-customer-table .amount-col { width: 18% !important; }
body:not(.pdf-view) .sales-page table.sales-item-table[data-management-icons="off"] .customer-col { width: 112px !important; }
body:not(.pdf-view) .sales-page table.sales-item-table[data-management-icons="off"] .source-col { width: 54px !important; }
body:not(.pdf-view) .sales-page table.sales-item-table[data-management-icons="off"] .status-col { width: 66px !important; }
body:not(.pdf-view) .sales-page table.sales-item-table[data-management-icons="off"] .date-col { width: 84px !important; }
body:not(.pdf-view) .sales-page table.sales-item-table[data-management-icons="off"] .project-col { width: 140px !important; }
body:not(.pdf-view) .sales-page table.sales-item-table[data-management-icons="off"] .title-col { width: auto !important; }
body:not(.pdf-view) .sales-page table.sales-item-table[data-management-icons="off"] .count-col { width: 48px !important; text-align: center; }
body:not(.pdf-view) .sales-page table.sales-item-table[data-management-icons="off"] .supply-col { width: 96px !important; }
body:not(.pdf-view) .sales-page table.sales-item-table[data-management-icons="off"] .tax-col { width: 80px !important; }
body:not(.pdf-view) .sales-page table.sales-item-table[data-management-icons="off"] .amount-col { width: 100px !important; }
body:not(.pdf-view) .sales-page table.sales-item-table[data-management-icons="off"] .action-col,
body:not(.pdf-view) .sales-page table.sales-item-table[data-management-icons="off"] .sales-action-cell {
  width: 86px !important; min-width: 0 !important; max-width: 86px !important;
}
body:not(.pdf-view) .sales-page .sales-table :is(.sales-title-link, .sales-customer-link, .sales-action-text),
body:not(.pdf-view) .sales-page .sales-table :is(.sales-title-link, .sales-customer-link, .sales-action-text):hover {
  min-width: 0 !important; min-height: 0 !important; height: auto !important;
  padding: 3px 0 !important; border: 0 !important; border-radius: 0 !important;
  background: transparent !important; box-shadow: none !important;
  color: #0b5f7a !important; white-space: normal !important; overflow-wrap: anywhere;
  font-size: 11px !important; line-height: 1.4 !important; text-align: center !important;
}
body:not(.pdf-view) .sales-page .sales-table .sales-payment-confirm,
body:not(.pdf-view) .sales-page .sales-table .sales-payment-confirm:hover { color: #1d4ed8 !important; }
body:not(.pdf-view) .sales-page .sales-table .sales-payment-complete,
body:not(.pdf-view) .sales-page .sales-table .sales-payment-complete:hover { color: #15803d !important; }
body:not(.pdf-view) .sales-page .sales-table .sales-payment-pending { color: #64748b !important; }
body:not(.pdf-view) .sales-page .sales-table .table-link:hover { text-decoration: underline; }
/* 출처 셀 전체를 출력은 파랑, 렌탈은 주황으로 구분하고 진한 글자로 읽기 쉽게 표시합니다. */
body:not(.pdf-view) .sales-page .sales-table td.source-print { background: #bfdbfe !important; color: #1e40af !important; }
body:not(.pdf-view) .sales-page .sales-table td.source-rental { background: #fed7aa !important; color: #9a3412 !important; }
body:not(.pdf-view) .sales-page .sales-source-text { background: transparent; color: inherit; font-weight: 700; }
body:not(.pdf-view) .sales-page .sales-table .project-col { overflow-wrap: anywhere; }
body:not(.pdf-view) .sales-page :is(#salesFilters, #receivableFilters) .action-icon-period::before {
  background-image: url('../images/quote-period.png?v=20261015-bold-period-1');
}

body:not(.pdf-view) .sales-page .receivables-table {
  min-width: 1060px;
}

body:not(.pdf-view) .sales-page .sales-dashboard-grid > .sales-dashboard-card:first-child {
  display: none;
}

@media screen and (max-width: 760px) {
  body:not(.pdf-view) .sales-page .sales-filters,
  body:not(.pdf-view) .sales-page .receivable-filters {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  }

  body:not(.pdf-view) .sales-page .sales-filters input[type="search"],
  body:not(.pdf-view) .sales-page .receivable-filters input[type="search"] {
    grid-column: 1 / -1;
  }

  body:not(.pdf-view) .sales-page .sales-filters button,
  body:not(.pdf-view) .sales-page .receivable-filters button {
    min-height: 32px;
  }

  body:not(.pdf-view) .sales-page .sales-table th,
  body:not(.pdf-view) .sales-page .sales-table td,
  body:not(.pdf-view) .sales-page .receivables-table th,
  body:not(.pdf-view) .sales-page .receivables-table td {
    font-size: 12px;
  }
}

body:not(.pdf-view) .sales-page .sales-filters.compact-search-bar,
body:not(.pdf-view) .sales-page #salesReceivablesView > .receivable-filters.compact-search-bar {
  display: flex !important;
  grid-template-columns: none !important;
  min-height: 0;
}

/* 미수금 화면에서는 전용 검색 영역만 표시합니다. */
body.sales-receivables-active:not(.pdf-view) .sales-page #salesFilters {
  display: none !important;
}

body:not(.pdf-view) .sales-page .compact-search-bar .compact-search-input {
  min-height: 28px;
}

body:not(.pdf-view) .sales-page .compact-search-bar input,
body:not(.pdf-view) .sales-page .compact-search-bar select,
body:not(.pdf-view) .sales-page .compact-search-bar button {
  min-height: 28px !important;
  height: 28px !important;
  font-size: 11px !important;
}

@media screen and (max-width: 760px) {
  body:not(.pdf-view) #salesFilters .period-presets > button[data-period-preset],
  body:not(.pdf-view) #receivableFilters .period-presets > button[data-period-preset] {
    padding: 0 2px !important;
  }

  body:not(.pdf-view) .sales-page .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) .sales-page .sales-filters.compact-search-bar,
  body:not(.pdf-view) .sales-page #salesReceivablesView > .receivable-filters.compact-search-bar {
    display: flex !important;
  }
}
/* 매출 상태는 공통 이미지 변환과 분리한 텍스트로 표시합니다. */
body:not(.pdf-view) .sales-page .sales-status-text {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}
body:not(.pdf-view) .sales-page .sales-status-text.status-pending { color: #64748b; }
body:not(.pdf-view) .sales-page .sales-status-text.status-confirmed { color: #0f766e; }
body:not(.pdf-view) .sales-page .sales-status-text.status-paid { color: #15803d; }
body:not(.pdf-view) .sales-page .sales-status-text.status-partial { color: #b45309; }
body:not(.pdf-view) .sales-page .sales-status-text.status-overpaid { color: #7c2d12; }

#salesMonthlySettlements { margin-top: 24px; }
#salesMonthlySettlements[hidden], #salesMonthlySettlements [hidden] { display: none !important; }
.sales-settlement-panel { margin: 16px 0; padding: 16px; border: 1px solid #d8e0ea; border-radius: 12px; background: #fff; }
.sales-settlement-panel > summary { cursor: pointer; font-weight: 700; font-size: 15px; }
.sales-settlement-panel > p { margin: 10px 0; color: #526176; line-height: 1.6; }
.sales-settlement-panel .card { margin: 16px 0; padding-top: 12px; border-top: 1px solid #d8e0ea; }
.sales-settlement-panel table { width: 100%; min-width: 680px; }
.sales-settlement-panel th, .sales-settlement-panel td { padding: 8px; text-align: left; border-bottom: 1px solid #e6ebf1; }
.sales-settlement-panel input[type="number"] { width: 130px; max-width: 100%; }
.sales-settlement-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.sales-settlement-filters label { display: inline-flex; align-items: center; gap: 8px; width: auto; margin: 0; }
.sales-settlement-filters input[type="month"] { width: 150px; margin: 0; }
.sales-settlement-panel .quote-text-action { width: auto; min-height: 30px; padding: 5px 12px; color: #17324d; background: #edf4fa; border: 1px solid #bed0df; border-radius: 6px; font-size: 12px; }
.sales-settlement-panel .quote-text-action:disabled { opacity: .5; cursor: default; }
.sales-settlement-panel[data-period-managed] .sales-settlement-filters { display: none !important; }
.sales-settlement-source { cursor: pointer; color: inherit; font: inherit; border: 0; background: transparent; padding: 0; text-decoration: underline; text-underline-offset: 4px; }
.sales-settlement-source:focus-visible { outline: 2px solid #2563eb; outline-offset: 4px; }
.rental-settlement-table { min-width: 1080px !important; }
.settlement-table .settlement-project-total { background: #eaf2f8; font-weight: 700; }
.settlement-table tfoot { background: #dceaf5; font-weight: 700; }
.settlement-table .settlement-customer-total { border-top: 2px solid #92adc2; }
.settlement-rental-type { color: #17324d; font-size: 12px; white-space: nowrap; }
.print-settlement-table { min-width: 840px !important; }
.settlement-table .settlement-project-heading th { background: #c8ddef; text-align: left; }
.settlement-table .settlement-estimate-heading th { background: #f2f6fa; text-align: left; font-weight: 600; }
.settlement-excluded-row td { color: #7b8794; background: #f3f4f6; }
.settlement-excluded-row input[type="number"] { color: #7b8794; }

@media screen {
  html.sales-scroll-page {
    overflow-x: hidden;
    overflow-y: scroll;
    scrollbar-gutter: stable;
    scrollbar-width: auto;
  }
  html.sales-scroll-page:not(.login-locked) > body:not(.pdf-view) {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }
  html.sales-scroll-page::-webkit-scrollbar { width: 12px; }
  html.sales-scroll-page::-webkit-scrollbar-track { background: #e2e8f0; }
  html.sales-scroll-page::-webkit-scrollbar-thumb {
    background: #7b8da3;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
  }
  html.sales-scroll-page::-webkit-scrollbar-thumb:hover { background: #52677e; }
}

/* 출력·렌탈 정산 표 공통 간격과 견적 상세 링크 */
.sales-settlement-panel .settlement-table th,
.sales-settlement-panel .settlement-table td { padding: 7px 10px; vertical-align: middle; line-height: 1.45; }
.sales-settlement-panel .settlement-table thead th { white-space: nowrap; }
.sales-settlement-panel .settlement-table input[type="number"] { margin: 0; min-height: 30px; padding: 4px 8px; }
.settlement-table .settlement-quote-link { color: #175a78; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.settlement-table .settlement-quote-link:hover { color: #0d3e57; }
.settlement-table .settlement-quote-link:focus-visible { outline: 2px solid #2563eb; outline-offset: 3px; }
.settlement-table .settlement-excluded-row .settlement-quote-link { color: #64748b; }

.sales-action-cell small { display:block; color:#64748b; margin-top:4px; }
.sales-action-cell button { margin:2px 4px; white-space:nowrap; }
.invoice-col { min-width:110px; white-space:nowrap; }

.sales-detail-selection-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin:12px 0; }
.sales-detail-selection-actions small { color:#64748b; }

.sales-customer-detail-table button.sales-status-action { background:transparent !important; border:0 !important; border-radius:0 !important; box-shadow:none !important; padding:0 !important; min-height:0 !important; width:auto !important; color:#175a78; font:inherit; cursor:pointer; text-decoration:underline; text-underline-offset:3px; }
.sales-customer-detail-table button.sales-status-action:hover { color:#0d3e57; }
.sales-customer-detail-table button.sales-status-action:focus-visible { outline:2px solid #2563eb; outline-offset:3px; }

.sales-customer-detail-table input[type="checkbox"] { width:14px !important; height:14px !important; min-width:14px !important; min-height:14px !important; padding:0 !important; margin:0 !important; vertical-align:middle; }
.sales-customer-detail-table label.sales-select-all { display:inline-flex; align-items:center; gap:5px; margin:0; width:auto; white-space:nowrap; font:inherit; cursor:pointer; }
.sales-page .sales-item-table th,.sales-page .sales-item-table td { padding:6px 8px; vertical-align:middle; line-height:1.45; }
.sales-page .sales-item-table .status-col { min-width:120px; white-space:nowrap; }
.sales-page .sales-item-table .confirmation-col { min-width:64px; white-space:nowrap; }
.sales-page .sales-item-table .invoice-col,.sales-page .sales-item-table .sales-action-cell { min-width:110px; white-space:nowrap; }
.sales-page .sales-item-table .date-col { white-space:nowrap; }
.sales-page .sales-item-table .project-col,.sales-page .sales-item-table .title-col { min-width:140px; overflow-wrap:anywhere; }
.sales-page .sales-item-table .amount-cell { white-space:nowrap; }
.sales-state-dialog { border:1px solid #b9cbd9; border-radius:10px; padding:20px; min-width:280px; }
.sales-state-dialog::backdrop { background:rgba(15,23,42,.3); }
.sales-state-dialog select { display:block; width:100%; margin-top:8px; }
.sales-state-dialog p { margin-bottom:0; text-align:right; }
body:not(.pdf-view) .sales-page table.sales-item-table[data-management-icons="off"] { min-width:1500px !important; table-layout:fixed !important; }
body:not(.pdf-view) .sales-page table.sales-item-table[data-management-icons="off"] .status-col { width:130px !important; min-width:130px !important; }
body:not(.pdf-view) .sales-page table.sales-item-table[data-management-icons="off"] .confirmation-col { width:64px !important; }
body:not(.pdf-view) .sales-page table.sales-item-table[data-management-icons="off"] .invoice-col,
body:not(.pdf-view) .sales-page table.sales-item-table[data-management-icons="off"] .action-col,
body:not(.pdf-view) .sales-page table.sales-item-table[data-management-icons="off"] .sales-action-cell { width:120px !important; min-width:120px !important; max-width:120px !important; }
body:not(.pdf-view) .sales-page table.sales-item-table[data-management-icons="off"] .title-col { width:160px !important; }

body:not(.pdf-view) .sales-page table.sales-customer-table { min-width:1200px !important; }
body:not(.pdf-view) .sales-page table.sales-customer-table .customer-col { width:150px !important; }
body:not(.pdf-view) .sales-page table.sales-customer-table .project-col { width:150px !important; }
body:not(.pdf-view) .sales-page table.sales-customer-table .source-col { width:55px !important; }
body:not(.pdf-view) .sales-page table.sales-customer-table .count-col { width:55px !important; }
body:not(.pdf-view) .sales-page table.sales-customer-table .status-col { width:90px !important; }
body:not(.pdf-view) .sales-page table.sales-customer-table :is(.supply-col,.tax-col,.amount-col) { width:110px !important; }
body:not(.pdf-view) .sales-page table.sales-customer-table :is(.invoice-col,.payment-col) { width:155px !important; white-space:normal; }

body:not(.pdf-view) .sales-page table.sales-customer-table td.sales-complete-cell {
  background: #e4f4e9 !important;
  color: #17643b !important;
  font-weight: 600;
}
body:not(.pdf-view) .sales-page table.sales-customer-table td.sales-complete-cell .table-link { color: #17643b !important; }

body:not(.pdf-view) .sales-page table.sales-customer-table td[data-sales-group-mode] { cursor: pointer; }
body:not(.pdf-view) .sales-page table.sales-customer-table td[data-sales-group-mode]:hover { box-shadow: inset 0 0 0 2px #86a4be; }
body:not(.pdf-view) .sales-page table.sales-customer-table td[data-sales-group-mode]:focus-visible { outline: 2px solid #25769a; outline-offset: -2px; }
body:not(.pdf-view) .sales-page table.sales-customer-table td[data-sales-group-mode][aria-busy="true"] { cursor: progress; }

@media(max-width:1250px){body:not(.pdf-view) :is(#salesFilters,#receivableFilters).compact-search-bar{flex-wrap:wrap;}}
