:root {
  --grid: #1f2933;
  --header: #d8e7f7;
  --header-strong: #b9d2ec;
  --cell: #eef5fc;
  --white: #ffffff;
  --ink: #111827;
  --muted: #5f6b7a;
  --accent: #206a8f;
  --accent-dark: #174d68;
  --card-line: #8fa0b1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: #edf1f5;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", Arial, sans-serif;
  font-size: 13px;
}


.login-locked body {
  overflow: hidden;
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(12, 23, 36, 0.72);
  backdrop-filter: blur(4px);
}

.login-box {
  width: min(360px, 100%);
  padding: 24px;
  border: 1px solid #9fb2c6;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.login-box h2 {
  margin: 0 0 16px;
  font-size: 22px;
  font-weight: 800;
}

.login-box label {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

.login-box input {
  height: 38px;
  border: 1px solid var(--grid);
  background: #f8fbff;
  text-align: left;
  padding: 0 10px;
}

.login-box button {
  width: 100%;
  margin-top: 12px;
}

.login-message {
  min-height: 18px;
  margin: 8px 0 0;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 700;
}
.sheet {
  width: min(1760px, calc(100vw - 32px));
  margin: 24px auto;
  padding: 22px;
  background: var(--white);
  border: 1px solid #c7d0db;
  box-shadow: 0 18px 45px rgba(21, 35, 52, 0.14);
}

.sheet-header {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(560px, 1.2fr);
  gap: 12px;
  align-items: stretch;
  margin-bottom: 10px;
}

h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0;
}

.home-title {
  color: inherit;
  text-decoration: none;
}

.home-title:hover {
  color: var(--accent);
}

/* ===============================
   Compact Unified Info Cards
================================= */
.quote-meta,
.supplier-card {
  border: 1px solid #cfd8e3;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  min-width: 0;
}

.quote-meta {
  display: grid;
  gap: 0;
  padding: 0;
  align-self: stretch;
}

.quote-meta::before,
.supplier-card::before {
  content: "견적 정보";
  display: flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  background: linear-gradient(135deg, #1d3557 0%, #274c77 100%);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.supplier-card::before {
  content: "공급자 정보";
  grid-column: 1 / -1;
}

.quote-meta label {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  min-height: 30px;
  align-items: center;
  border-bottom: 1px solid #e6edf5;
}

.quote-meta label:last-child {
  border-bottom: 0;
}

.quote-meta span,
.supplier-row span {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f7fb;
  border-right: 1px solid #e0e7ef;
  color: #26384f;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.quote-meta input {
  height: 28px;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  text-align: left;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: #111827;
}

.supplier-card {
  grid-column: 2;
  display: grid;
  grid-template-columns: 1fr;
}

.supplier-side {
  display: none;
}

.supplier-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.supplier-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  min-height: 30px;
  border-right: 1px solid #e6edf5;
  border-bottom: 1px solid #e6edf5;
}

.supplier-row:nth-child(2n),
.supplier-row.supplier-registration,
.supplier-row.supplier-address,
.supplier-row.supplier-manager {
  border-right: 0;
}

.supplier-row.supplier-registration,
.supplier-row.supplier-address,
.supplier-row.supplier-manager {
  grid-column: 1 / -1;
}

.supplier-row.supplier-manager {
  border-bottom: 0;
}

.supplier-row input {
  min-width: 0;
  padding: 0 8px;
  border: 0;
  background: #ffffff;
  font-size: 12px;
  font-weight: 600;
  color: #111827;
}

.summary {
  display: grid;
  grid-template-columns: minmax(580px, 1fr) 220px;
  gap: 10px 12px;
  align-items: stretch;
}

.info-grid {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  border-top: 1px solid var(--grid);
  border-left: 1px solid var(--grid);
}

.info-grid label,
.controls label {
  min-width: 0;
}

.info-grid label {
  display: grid;
  grid-template-columns: 82px 1fr;
  border-right: 1px solid var(--grid);
  border-bottom: 1px solid var(--grid);
}

.info-grid span {
  display: grid;
  place-items: center;
  min-height: 34px;
  background: var(--header);
  border-right: 1px solid var(--grid);
  font-weight: 700;
}

input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: center;
  outline: 2px solid transparent;
  outline-offset: -2px;
}

input:focus {
  background: #fffdf0;
  outline-color: var(--accent);
}

select {
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: center;
  outline: 2px solid transparent;
  outline-offset: -2px;
}

select:focus {
  background: #fffdf0;
  outline-color: var(--accent);
}

.total-box {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  align-content: center;
  justify-items: end;
  padding: 12px 16px;
  border: 2px solid var(--accent-dark);
  background: #f8fbff;
}

.total-box span {
  color: var(--muted);
  font-weight: 700;
}

.total-box strong {
  margin-top: 4px;
  font-size: 27px;
  color: var(--accent-dark);
}


.quote-summary-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 10px;
  margin-bottom: 14px;
}
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 16px;
}

.controls label {
  display: grid;
  grid-template-columns: 64px 130px;
  align-items: center;
  height: 34px;
  border: 1px solid var(--grid);
  background: var(--cell);
}

.controls span {
  display: grid;
  place-items: center;
  align-self: stretch;
  border-right: 1px solid var(--grid);
  background: var(--header);
  font-weight: 700;
}

button {
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--accent-dark);
  background: var(--accent);
  color: white;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

.tabs {
  display: flex;
  gap: 4px;
  margin: 7px 0 7px;
  border-bottom: 2x solid var(--accent-dark);
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  flex-direction: row;
}

.tab {
  min-width: 96px;
  border-bottom: 0;
  background: #d7e4ef;
  color: var(--ink);
}

.tab.active {
  background: var(--accent-dark);
  color: white;
}

.tab-link {
  display: grid;
  place-items: center;
  height: 34px;
  padding: 0 14px;
  text-decoration: none;
}

.list-header {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.estimates-table {
  min-width: 980px;
}

.estimates-table td:nth-child(n + 5) {
  font-variant-numeric: tabular-nums;
}



.estimate-number-link {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.estimate-number-link:hover {
  text-decoration: underline;
}


.pagination {
  display: flex;
  gap: 4px;
  justify-content: center;
  align-items: center;
  margin-top: 10px;
}

.pagination button {
  height: 28px;
  min-width: 32px;
  padding: 0 9px;
  font-size: 11px;
}

.pagination button.active {
  background: var(--accent);
  border-color: var(--accent-dark);
  color: #ffffff;
}

.pdf-view .tabs,
.pdf-view #data,
.pdf-view #quoteRows {
  display: none !important;
}

.pdf-view .no-print {
  display: none !important;
}

.pdf-view #estimate,
.pdf-view .panel.active {
  display: block;
}
.panel {
  display: none;
}

.panel.active {
  display: block;
}

.work-section h2 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 800;
}

.section-head {
  display: flex;
  gap: 16px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 10px;
}

.quote-totals {
  grid-column: 1 / -1;
  grid-row: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  border-top: 1px solid var(--grid);
  border-left: 1px solid var(--grid);
  min-width: 0;
}

.quote-totals span {
  display: grid;
  grid-template-columns: 72px 1fr;
  min-height: 34px;
  border-right: 1px solid var(--grid);
  border-bottom: 1px solid var(--grid);
  background: var(--cell);
  align-items: center;
  text-align: center;
}

.quote-totals span::first-line {
  font-weight: 700;
}

.quote-totals strong {
  height: 100%;
  display: grid;
  place-items: center;
  border-left: 1px solid var(--grid);
  background: #d7e9f6;
  font-variant-numeric: tabular-nums;
}


body:not(.pdf-view) #estimate.active #quoteRows,
body:not(.pdf-view) #estimate.active .quote-list,
body:not(.pdf-view) #estimate.active .quote-card {
  visibility: visible !important;
  opacity: 1 !important;
}

body:not(.pdf-view) #estimate.active #quoteRows,
body:not(.pdf-view) #estimate.active .quote-list,
body:not(.pdf-view) #estimate.active .quote-card {
  display: grid !important;
}
.quote-list {
  display: grid;
  gap: 12px;
}

.added-items {
  margin-top: 10px;
  overflow: auto;
  border: 1px solid #9aa8b7;
  background: #ffffff;
}

.added-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 11px;
}

.added-table th,
.added-table td {
  height: 28px;
  padding: 0 6px;
  border-right: 1px solid #9aa8b7;
  border-bottom: 1px solid #9aa8b7;
  text-align: center;
  vertical-align: middle;
}

.added-table th {
  background: var(--header-strong);
  font-weight: 800;
}

.added-table .date-col {
  width: 9%;
}

.added-table .work-col {
  width: 51%;
}

.added-table .qty-col,
.added-table .discount-col,
.added-table .delete-col {
  width: 7%;
}

.added-table .money-col,
.added-table .tax-col,
.added-table .total-col {
  width: 9%;
}

.added-table td {
  background: #f8fbff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.added-table .work-description {
  padding: 4px 8px;
  text-align: left;
  line-height: 1.35;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.added-table button {
  height: 20px;
  padding: 0 8px;
  font-size: 10px;
  background: #6b7280;
  border-color: #4b5563;
}

.quote-card {
  display: grid;
  grid-template-columns: 1.35fr 0.95fr 0.85fr 0.8fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--card-line);
  background: #f8fbff;
  font-size: 12px;
}

.quote-card-head {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--card-line);
  padding-bottom: 8px;
}

.date-field {
  width: 180px;
}


.quote-group {
  display: grid;
  gap: 6px;
  align-content: start;
}

.material-group {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.option-group,
.process-group,
.size-group {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.group-title {
  grid-column: 1 / -1;
  display: flex;
  min-height: 34px;
  gap: 6px;
  align-items: center;
  font-weight: 800;
  color: var(--accent-dark);
}

.quote-group label,
.quote-group output,
.date-field {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  min-height: 30px;
  border: 1px solid var(--card-line);
  background: var(--cell);
}

.quote-group span,
.date-field span,
.quote-group output span,
.quote-results span {
  display: grid;
  place-items: center;
  background: var(--header);
  border-right: 1px solid var(--card-line);
  font-weight: 700;
  text-align: center;
}

.quote-group output strong {
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
}

.quote-group button {
  min-height: 34px;
}

.quote-results {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(8, minmax(110px, 1fr));
  border-top: 1px solid var(--card-line);
  border-left: 1px solid var(--card-line);
}

.quote-results output {
  display: grid;
  grid-template-rows: 22px 30px;
  border-right: 1px solid var(--card-line);
  border-bottom: 1px solid var(--card-line);
  background: var(--cell);
}

.quote-results strong {
  display: grid;
  place-items: center;
  padding: 0 6px;
  font-variant-numeric: tabular-nums;
}

.quote-results .final strong {
  background: #d7e9f6;
  color: var(--accent-dark);
  font-size: 14px;
}

.quote-card-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 2px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--grid);
}

#data .table-wrap {
  max-height: 360px;
}

.estimate-table {
  width: 100%;
  min-width: 2060px;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  height: 32px;
  padding: 0;
  border-right: 1px solid var(--grid);
  border-bottom: 1px solid var(--grid);
  text-align: center;
  vertical-align: middle;
}

thead th {
  background: var(--header-strong);
  font-weight: 800;
  line-height: 1.18;
}

thead tr:nth-child(2) th {
  background: var(--header);
}

tbody td {
  background: var(--cell);
}

tbody tr:nth-child(even) td {
  background: #dfeaf5;
}

tbody td:nth-last-child(-n + 4),
tfoot td {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

td[data-result] {
  padding: 0 6px;
  text-align: right;
}

tfoot th,
tfoot td {
  height: 36px;
  background: #d7e9f6;
  font-size: 14px;
}

tfoot th {
  text-align: right;
  padding-right: 12px;
}

.date-text {
  font-variant-numeric: tabular-nums;
}

.data-head {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 4px;
}

.data-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.data-head h2,
.data-head h3 {
  margin: 0;
  font-weight: 800;
}

.data-head h2 {
  font-size: 16px;
}

.data-head h3 {
  font-size: 13px;
}

.data-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 11px;
}

.data-table th {
  background: var(--header-strong);
  font-weight: 800;
}

.data-table th,
.data-table td {
  height: 24px;
}

.data-table td {
  background: var(--cell);
}

.data-table input {
  min-height: 22px;
  padding: 0 4px;
}

.data-table input[type="checkbox"] {
  width: 13px;
  height: 13px;
}

.data-table button {
  height: 22px;
  padding: 0 7px;
  font-size: 10px;
}

.add-current-row {
  height: 28px;
  padding: 0 12px;
  background: #6b7280;
  border-color: #4b5563;
  font-size: 12px;
  line-height: 1;
}

.reset-primary,
.reset-secondary,
.reset-options,
.reset-processing {
  height: 20px;
  padding: 0 6px;
  background: #6b7280;
  border-color: #4b5563;
  font-size: 10px;
  line-height: 1;
}

.add-current-row:hover,
.reset-primary:hover,
.reset-secondary:hover,
.reset-options:hover,
.reset-processing:hover {
  background: #4b5563;
}

.data-table.compact {
  min-width: 240px;
}

.price-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
  align-items: start;
}

.price-card {
  min-width: 0;
}

.price-card .table-wrap {
  max-height: 260px;
}

.hint {
  margin: 2px 0 6px;
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 920px) {
  
.sheet {
    width: calc(100vw - 16px);
    margin: 8px auto;
    padding: 12px;
  }

  .sheet-header,
  
.summary {
      grid-column: 1 / -1;
grid-template-columns: 1fr;
  }

  .info-grid {
    grid-column: 1;
    grid-row: auto;
    grid-template-columns: 1fr;
  }

  .total-box,
  .quote-totals {
    grid-column: 1;
    grid-row: auto;
  }

  
.controls {
    justify-content: flex-start;
  }

  .section-head {
    display: grid;
  }

  .quote-totals,
  .quote-card,
  .quote-results {
    grid-template-columns: 1fr;
  }

  .material-group,
  .option-group,
  .process-group,
  .size-group {
    grid-template-columns: 1fr;
  }

  .price-sections {
    grid-template-columns: 1fr;
  }
}

@media print {
  @page {
    size: auto;
    margin: 10mm;
  }

  body {
    background: #ffffff;
  }

  .no-print,
  .tabs,
  #data,
  #quoteRows,
  .quote-list {
    display: none !important;
  }

  #estimate,
  .panel.active {
    display: block !important;
  }

  .sheet {
    width: min(1760px, calc(100vw - 32px));
    margin: 24px auto;
    padding: 22px;
    background: var(--white);
    border: 1px solid #c7d0db;
    box-shadow: none;
  }

  input,
  select,
  textarea {
    appearance: none;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    color: #111827;
  }

  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

body.main-edit-mode #estimate,
body.main-edit-mode #quoteRows,
body.main-edit-mode .quote-list,
body.main-edit-mode .quote-card {
  visibility: visible !important;
  opacity: 1 !important;
}

body.main-edit-mode #estimate {
  display: block !important;
}

body.main-edit-mode #quoteRows,
body.main-edit-mode .quote-list,
body.main-edit-mode .quote-card {
  display: grid !important;
}

body.main-edit-mode .quote-list {
  gap: 12px;
}



/* ===============================
   Global Unified Header
================================= */
.global-topbar {
  width: 100%;
  background: linear-gradient(135deg, #1d3557 0%, #274c77 100%);
  border-bottom: 4px solid #16324a;
  box-shadow: 0 4px 18px rgba(0,0,0,0.12);
}

.topbar-inner {
  width: min(1760px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 18px 24px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #ffffff;
}

.topbar-brand strong {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.topbar-brand span {
  font-size: 20px;
  font-weight: 600;
  opacity: 0.92;
}

.sheet {
  margin-top: 18px;
}

.tabs {
  border-radius: 10px;
  overflow: hidden;
}

.tab {
  font-weight: 700;
}


.customer-estimate-link {
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.customer-estimate-link:hover {
  color: var(--accent);
}

/* ===============================
   Estimate inline detail panel
================================= */
.table-link {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.estimate-detail-panel {
  margin-top: 18px;
  border: 1px solid #cfd8e3;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.detail-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  background: #f4f7fb;
  border-bottom: 1px solid #dfe7f0;
}

.detail-panel-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  color: #1d3557;
}

.detail-panel-head p {
  margin: 4px 0 0;
  color: #516173;
  font-size: 12px;
  font-weight: 700;
}

.detail-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.month-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid #d8e1ec;
  border-radius: 10px;
  background: #ffffff;
}

.month-filter span,
.month-filter em {
  color: #42536a;
  font-size: 12px;
  font-weight: 800;
  font-style: normal;
}

.month-filter input {
  height: 28px;
  border: 1px solid #cfd8e3;
  border-radius: 7px;
  padding: 0 6px;
  font-size: 12px;
}

.estimate-detail-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.estimate-detail-card {
  border: 1px solid #d8e1ec;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.estimate-detail-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: linear-gradient(135deg, #1d3557 0%, #274c77 100%);
  color: #fff;
}

.estimate-detail-summary strong {
  display: block;
  font-size: 15px;
  font-weight: 900;
}

.estimate-detail-summary span {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  opacity: 0.9;
}

.detail-total {
  text-align: right;
  white-space: nowrap;
}

.detail-total b {
  display: block;
  margin-top: 3px;
  font-size: 16px;
}

.detail-table-wrap {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.detail-item-table {
  min-width: 900px;
  margin: 0;
}

.detail-item-table th,
.detail-item-table td {
  height: 30px;
  padding: 5px 7px;
  font-size: 11px;
}

.detail-empty {
  padding: 24px;
  text-align: center;
  color: #64748b;
  font-weight: 800;
}


.estimate-detail-summary > div:first-child span:first-child {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
}


/* ===============================
   Saved estimate PDF preview
================================= */
.pdf-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #d8e1ec;
  border-radius: 10px;
  background: #f8fafc;
  color: #42536a;
  font-size: 12px;
  font-weight: 800;
}

.estimate-pdf-preview {
  width: 100%;
  height: min(82vh, 980px);
  border: 1px solid #d8e1ec;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.02);
}

.pdf-view .pdf-screen-download {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 16px;
  border-radius: 9px;
  background: #1d3557;
  border-color: #1d3557;
  color: #ffffff;
  font-weight: 900;
}

.pdf-view .controls.no-print {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #ffffff;
  padding: 8px 0;
  border-bottom: 1px solid #e5edf5;
}




.pdf-preview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pdf-preview-actions .primary {
  background: #1d3557;
  border-color: #1d3557;
  color: #ffffff;
  font-weight: 900;
}


/* ===============================
   PDF header row rules by screen type
================================= */
.single-pdf-view .quote-period-row {
  display: none !important;
}

.customer-pdf-view .quote-date-row {
  display: none !important;
}

.customer-pdf-view .quote-period-row {
  display: grid !important;
}

.customer-pdf-view #quotePeriod {
  pointer-events: auto;
  background: #ffffff;
}


/* ===============================
   Multi-platform Responsive Layout
   PC / Tablet / Mobile
================================= */

/* 기본 화면 폭 안정화 */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  -webkit-text-size-adjust: 100%;
}

.sheet,
.page,
.container,
.saved-page,
.saved-wrap,
.estimates-page,
.estimates-container {
  max-width: 100%;
  box-sizing: border-box;
}

/* 큰 화면 */
@media screen and (min-width: 1280px) {
  .sheet {
    width: min(1760px, calc(100vw - 48px));
  }

  .estimate-pdf-preview {
    height: min(82vh, 980px);
  }
}

/* 태블릿 */
@media screen and (max-width: 1024px) {
  .global-topbar .topbar-inner,
  .topbar-inner {
    width: calc(100vw - 24px);
    padding: 14px 12px;
  }

  .topbar-brand {
    gap: 8px;
    flex-wrap: wrap;
  }

  .topbar-brand strong {
    font-size: 22px;
  }

  .topbar-brand span {
    font-size: 16px;
  }

  .sheet {
    width: calc(100vw - 20px);
    margin: 10px auto;
    padding: 12px;
  }

  .sheet-header {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  .supplier-card {
    grid-column: auto;
  }

  .supplier-grid {
    grid-template-columns: 1fr 1fr;
  }

  .summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .controls,
  .toolbar,
  .filters,
  .saved-toolbar,
  .detail-toolbar,
  .pdf-preview-toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }

  .estimate-pdf-preview {
    height: 76vh;
  }
}

/* 모바일 공통 */
@media screen and (max-width: 768px) {
  body {
    font-size: 13px;
  }

  h1 {
    font-size: 22px;
  }

  .global-topbar .topbar-inner,
  .topbar-inner {
    width: calc(100vw - 16px);
    padding: 12px 8px;
  }

  .topbar-brand strong {
    font-size: 20px;
  }

  .topbar-brand span {
    font-size: 14px;
  }

  .sheet {
    width: calc(100vw - 12px);
    margin: 8px auto;
    padding: 10px;
    border-radius: 10px;
  }

  .quote-meta label,
  .supplier-row {
    grid-template-columns: 74px minmax(0, 1fr);
    min-height: 34px;
  }

  .supplier-grid {
    grid-template-columns: 1fr;
  }

  .supplier-row,
  .supplier-row:nth-child(2n) {
    border-right: 0;
  }

  .quote-meta span,
  .supplier-row span {
    font-size: 11px;
  }

  .quote-meta input,
  .supplier-row input,
  input,
  select,
  textarea {
    font-size: 13px;
    min-height: 32px;
  }

  .summary {
    grid-template-columns: 1fr;
  }

  .tabs {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .controls,
  .toolbar,
  .filters,
  .saved-toolbar,
  .detail-toolbar,
  .pdf-preview-toolbar,
  .pdf-preview-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 6px;
  }

  .controls button,
  .toolbar button,
  .filters button,
  .saved-toolbar button,
  .detail-toolbar button,
  .pdf-preview-actions button,
  button {
    min-height: 36px;
    padding: 0 10px;
  }

  /* 테이블은 모바일에서 가로 스크롤 */
  .items-table,
  .table-wrap,
  .saved-table-wrap,
  .detail-table-wrap,
  .estimate-list-wrap,
  .items-section,
  .saved-list {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 760px;
  }

  .estimate-pdf-preview {
    width: 100%;
    height: 72vh;
    border-radius: 10px;
  }

  .pdf-preview-toolbar {
    align-items: flex-start;
  }

  .pdf-preview-toolbar > span {
    width: 100%;
  }

  .pdf-preview-actions {
    width: 100%;
  }

  .pdf-preview-actions button {
    flex: 1 1 120px;
  }
}

/* 소형 모바일 */
@media screen and (max-width: 480px) {
  h1 {
    font-size: 20px;
  }

  .topbar-brand {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .sheet {
    width: calc(100vw - 8px);
    padding: 8px;
  }

  .quote-meta::before,
  .supplier-card::before {
    height: 30px;
    font-size: 12px;
  }

  .quote-meta label,
  .supplier-row {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .summary-card,
  .card,
  .quote-meta,
  .supplier-card {
    border-radius: 9px;
  }

  table {
    min-width: 860px;
  }

  th,
  td {
    font-size: 11px;
    padding: 5px 4px;
  }

  .estimate-pdf-preview {
    height: 68vh;
  }
}

/* 모바일에서는 PDF 미리보기 화면을 더 넓게 */
@media screen and (max-width: 768px) {
  .pdf-view .sheet {
    width: 100%;
    max-width: 100%;
  }
}

/* 인쇄는 A4 세로 유지 */
@media print {
  @page {
    size: A4 portrait;
    margin: 10mm;
  }

  html,
  body {
    width: 210mm !important;
    min-width: 210mm !important;
    overflow: visible !important;
  }

  .sheet {
    width: 190mm !important;
    max-width: 190mm !important;
  }

  table {
    min-width: 0 !important;
  }
}


/* 작업내역 일자 옆 할인율 칸 제거 보정 */
.items-table th.item-discount,
.items-table td.item-discount,
.items-table .item-discount,
.items-table [data-field="discountRate"],
.items-table [data-name="discountRate"] {
  display: none !important;
}


/* 작업내역 할인율 컬럼 */
.discount-field {
  min-width: 72px;
  width: 72px;
  text-align: center;
}

.line-discount-field {
  width: 100%;
  min-width: 60px;
  text-align: center;
}

/* 모바일 */
@media screen and (max-width: 768px) {
  .discount-field {
    min-width: 64px;
    width: 64px;
  }

  .line-discount-field {
    min-width: 54px;
    font-size: 12px;
  }
}



/* 모바일 */
@media screen and (max-width: 768px) {
  .quote-card-head {
    align-items: flex-start;
  }

  .quote-card-discount {
    width: 100%;
    justify-content: flex-end;
  }

  .quote-discount-rate {
    width: 72px;
    min-width: 72px;
  }
}


/* quote-card-head 할인율 입력칸 */
.quote-card-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.quote-card-head .date-field,
.quote-card-head .quote-card-discount {
  width: auto;
  min-width: 150px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  margin: 0;
}

.quote-card-head .quote-card-discount {
  min-width: 138px;
}

.quote-card-head .quote-card-discount input {
  width: 72px;
  min-width: 72px;
  text-align: center;
  font-weight: 800;
}

@media screen and (max-width: 768px) {
  .quote-card-head {
    align-items: stretch;
  }

  .quote-card-head .date-field,
  .quote-card-head .quote-card-discount {
    min-width: 0;
    flex: 1 1 140px;
  }

  .quote-card-head .quote-card-discount input {
    width: 100%;
    min-width: 0;
  }
}


/* 작업내역 수정 버튼 / 데이터관리 카드 숨김 보정 */
.added-table .edit-col,
.added-table .delete-col {
  width: 6.5%;
}

.added-table .edit-row-button {
  background: #1d3557;
  border-color: #1d3557;
  color: #ffffff;
  font-weight: 800;
}

.quote-card-head .quote-card-discount {
  display: grid !important;
  grid-template-columns: 58px 82px !important;
  min-height: 32px;
  align-items: center;
  border: 1px solid var(--card-line);
  background: var(--cell);
  border-radius: 6px;
  overflow: hidden;
}

.quote-card-head .quote-card-discount span {
  height: 100%;
  display: grid;
  place-items: center;
  background: var(--header);
  border-right: 1px solid var(--card-line);
  font-weight: 800;
  color: var(--accent-dark);
}

.quote-card-head .quote-card-discount input {
  height: 100%;
  width: 82px !important;
  min-width: 82px !important;
  border: 0;
  background: #ffffff;
  text-align: center;
  font-weight: 900;
}

body.main-edit-mode #estimate:not(.active),
body.main-edit-mode #estimate:not(.active) #quoteRows,
body.main-edit-mode #estimate:not(.active) .quote-list,
body.main-edit-mode #estimate:not(.active) .quote-card {
  display: none !important;
  visibility: hidden !important;
}

@media screen and (max-width: 768px) {
  .quote-card-head .quote-card-discount {
    grid-template-columns: 54px minmax(64px, 1fr) !important;
  }

  .quote-card-head .quote-card-discount input {
    width: 100% !important;
    min-width: 0 !important;
  }
}




/* ==================================
   PDF Preview Fit Fix
   - 미리보기 화면에서 A4 세로 폭에 맞게 자동 축소
   - 오른쪽 잘림/가로 스크롤 방지
================================== */

/* 저장견적 탭 안의 미리보기 iframe은 세로형 종이처럼 표시 */
.estimate-pdf-preview {
  display: block;
  width: 100%;
  max-width: 1200px;
  height: 1200px;
  max-height: 82vh;
  margin: 0 auto;
  border: 1px solid #d8e1ec;
  border-radius: 10px;
  background: #ffffff;
}

/* iframe 내부 PDF 화면 */
body.pdf-view {
  width: 1200px !important;
  max-width: 1100px !important;
  min-width: 0 !important;
  margin: 0 auto !important;
  padding: 0 !important;
  overflow-x: hidden !important;
  background: #ffffff !important;
}

/* PDF 화면의 견적서 본문을 A4 세로 폭에 맞춤 */
body.pdf-view .sheet {
  width: 1200px !important;
  max-width: 1120px !important;
  min-width: 0 !important;
  margin: 0 auto !important;
  padding: 0 10px 24px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

/* 상단 브랜드바도 본문 폭에 맞춤 */
body.pdf-view .global-topbar {
  width: 1100px !important;
  max-width: 1100px !important;
  min-width: 0 !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
}

body.pdf-view .topbar-inner {
  width: 100% !important;
  max-width: 100% !important;
  padding: 18px 24px !important;
  box-sizing: border-box !important;
}

/* 견적정보/공급자정보가 오른쪽으로 밀리지 않도록 압축 */
body.pdf-view .sheet-header {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: 0.95fr 1.25fr !important;
  gap: 12px !important;
  align-items: start !important;
  box-sizing: border-box !important;
}

body.pdf-view .quote-meta,
body.pdf-view .supplier-card {
  min-width: 0 !important;
  width: 80% !important;
  box-sizing: border-box !important;
}

body.pdf-view .supplier-grid {
  grid-template-columns: 1fr 1fr !important;
}

/* 합계 영역은 한 줄 유지 */
body.pdf-view .summary,
body.pdf-view .quote-summary,
body.pdf-view .amount-summary,
body.pdf-view .total-summary,
body.pdf-view .estimate-summary {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 0 !important;
  box-sizing: border-box !important;
}

/* 작업내역은 가로스크롤 없이 폭에 맞춤 */
body.pdf-view .items-table,
body.pdf-view .items-section,
body.pdf-view .table-wrap,
body.pdf-view table {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

body.pdf-view th,
body.pdf-view td {
  font-size: 10px !important;
  padding: 5px 4px !important;
  line-height: 1.25 !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;
  white-space: normal !important;
}

/* 긴 작업내용 컬럼 중심으로 보이게 */
body.pdf-view th:nth-child(2),
body.pdf-view td:nth-child(2) {
  width: 43% !important;
}

body.pdf-view th:not(:nth-child(2)),
body.pdf-view td:not(:nth-child(2)) {
  width: auto !important;
}

/* 미리보기 안에서는 불필요한 가로 스크롤 제거 */
body.pdf-view .items-table,
body.pdf-view .items-section {
  overflow-x: hidden !important;
}

/* 실제 PDF 출력도 세로 A4 폭에 맞춤 */
@page {
  size: A4 portrait;
  margin: 8mm;
}

@media print {
  html,
  body {
    width: 210mm !important;
    min-width: 0 !important;
    max-width: 210mm !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #ffffff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.pdf-view {
    width: 210mm !important;
    max-width: 210mm !important;
    overflow: visible !important;
  }

  body.pdf-view .global-topbar,
  body.pdf-view .sheet {
    width: 194mm !important;
    max-width: 194mm !important;
    margin: 0 auto !important;
  }

  body.pdf-view .sheet {
    padding: 0 !important;
  }

  body.pdf-view table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
  }

  body.pdf-view th,
  body.pdf-view td {
    font-size: 8.5px !important;
    padding: 3px 3px !important;
  }

  .no-print,
  .tabs,
  .controls,
  .pdf-preview-toolbar,
  .pdf-preview-actions,
  button {
    display: none !important;
  }
}


/* 합계 전체를 한 줄 테이블처럼 고정 */
.quote-summary-bar {
  display: grid !important;
  grid-template-columns: minmax(0, 4fr) minmax(180px, 0.85fr) !important;
  align-items: stretch !important;
  gap: 0 !important;
  width: 100% !important;
  margin: 22px 0 28px !important;
  border: 1px solid #244f7a !important;
  background: #ffffff !important;
  overflow: hidden !important;
}

/* 공급가액/세액/할인율/금액 */
.quote-totals {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  align-items: stretch !important;
  gap: 0 !important;
  min-width: 0 !important;
  height: 70px !important;
  border: 0 !important;
}

.quote-totals span {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  height: 70px !important;
  min-height: 70px !important;
  padding: 0 8px !important;
  border: 0 !important;
  border-right: 1px solid #b8c7d7 !important;
  background: #f8fbff !important;
  color: #111827 !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 1.3 !important;
  text-align: center !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

.quote-totals span:last-child {
  border-right: 0 !important;
}

.quote-totals span strong {
  display: block !important;
  width: auto !important;
  height: auto !important;
  margin: 6px 0 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #111827 !important;
  font-size: 16px !important;
  font-weight: 900 !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
}

/* 견적 합계 박스를 같은 높이/같은 행으로 고정 */
.total-box {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  height: 70px !important;
  min-height: 70px !important;
  margin: 0 !important;
  padding: 0 10px !important;
  border: 0 !important;
  border-left: 2px solid #244f7a !important;
  background: #ffffff !important;
  box-sizing: border-box !important;
  text-align: center !important;
  align-self: stretch !important;
}

.total-box span {
  display: block !important;
  margin: 0 !important;
  color: #174d68 !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
}

.total-box strong {
  display: block !important;
  margin: 6px 0 0 !important;
  color: #0f4d82 !important;
  font-size: 28px !important;
  font-weight: 900 !important;
  line-height: 1.05 !important;
  white-space: nowrap !important;
}

/* PDF 미리보기에서도 동일 적용 */
body.pdf-view .quote-summary-bar {
  grid-template-columns: minmax(0, 4fr) minmax(180px, 0.85fr) !important;
  align-items: stretch !important;
}

body.pdf-view .quote-totals,
body.pdf-view .quote-totals span,
body.pdf-view .total-box {
  height: 70px !important;
  min-height: 70px !important;
}

/* 실제 PDF 출력에서는 높이만 살짝 압축 */
@media print {
  body.pdf-view .quote-summary-bar {
    grid-template-columns: minmax(0, 4fr) minmax(28mm, 0.85fr) !important;
    margin: 8px 0 12px !important;
    align-items: stretch !important;
  }

  body.pdf-view .quote-totals {
    height: 42px !important;
    min-height: 42px !important;
  }

  body.pdf-view .quote-totals span,
  body.pdf-view .total-box {
    height: 42px !important;
    min-height: 42px !important;
    padding: 0 2px !important;
  }

  body.pdf-view .quote-totals span {
    font-size: 8px !important;
  }

  body.pdf-view .quote-totals span strong {
    margin-top: 3px !important;
    font-size: 9px !important;
  }

  body.pdf-view .total-box span {
    font-size: 8.5px !important;
  }

  body.pdf-view .total-box strong {
    margin-top: 3px !important;
    font-size: 14px !important;
  }
}


/* =========================================================
   FINAL SUMMARY TABLE ROW FIX
   합계 영역을 실제 1행 테이블처럼 고정
========================================================= */

.quote-summary-bar.summary-table-row {
  display: grid !important;
  grid-template-columns: 1fr 1fr 1fr 1fr 1.25fr !important;
  width: 100% !important;
  margin: 22px 0 28px !important;
  padding: 0 !important;
  border: 1px solid #244f7a !important;
  background: #ffffff !important;
  overflow: hidden !important;
  gap: 0 !important;
  align-items: stretch !important;
}

.quote-summary-bar.summary-table-row .summary-cell {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  height: 70px !important;
  min-height: 70px !important;
  padding: 0 8px !important;
  border-right: 1px solid #b8c7d7 !important;
  background: #f8fbff !important;
  box-sizing: border-box !important;
  text-align: center !important;
  white-space: nowrap !important;
}

.quote-summary-bar.summary-table-row .summary-cell:last-child {
  border-right: 0 !important;
}

.quote-summary-bar.summary-table-row .summary-cell span {
  display: block !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #111827 !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
}

.quote-summary-bar.summary-table-row .summary-cell strong {
  display: block !important;
  width: auto !important;
  height: auto !important;
  margin: 7px 0 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #111827 !important;
  font-size: 17px !important;
  font-weight: 900 !important;
  line-height: 1.1 !important;
}

.quote-summary-bar.summary-table-row .summary-grand {
  background: #ffffff !important;
  border-left: 2px solid #244f7a !important;
}

.quote-summary-bar.summary-table-row .summary-grand span {
  color: #174d68 !important;
  font-size: 13px !important;
  font-weight: 900 !important;
}

.quote-summary-bar.summary-table-row .summary-grand strong {
  color: #0f4d82 !important;
  font-size: 28px !important;
}

/* 기존 quote-totals / total-box 규칙이 남아 있어도 이 구조에는 영향 없음 */
.quote-summary-bar.summary-table-row .quote-totals,
.quote-summary-bar.summary-table-row .total-box {
  display: contents !important;
}

/* PDF 미리보기 */
body.pdf-view .quote-summary-bar.summary-table-row {
  grid-template-columns: 1fr 1fr 1fr 1fr 1.25fr !important;
  align-items: stretch !important;
}

body.pdf-view .quote-summary-bar.summary-table-row .summary-cell {
  height: 64px !important;
  min-height: 64px !important;
}

/* 실제 출력 */
@media print {
  body.pdf-view .quote-summary-bar.summary-table-row {
    grid-template-columns: 1fr 1fr 1fr 1fr 1.15fr !important;
    margin: 8px 0 12px !important;
  }

  body.pdf-view .quote-summary-bar.summary-table-row .summary-cell {
    height: 42px !important;
    min-height: 42px !important;
    padding: 0 2px !important;
  }

  body.pdf-view .quote-summary-bar.summary-table-row .summary-cell span {
    font-size: 8px !important;
  }

  body.pdf-view .quote-summary-bar.summary-table-row .summary-cell strong {
    margin-top: 3px !important;
    font-size: 9px !important;
  }

  body.pdf-view .quote-summary-bar.summary-table-row .summary-grand strong {
    font-size: 14px !important;
  }
}

/* =========================================================
   Estimate PDF Preview Stability Fix
   - 저장견적 상세의 iframe이 부모 폭을 넘지 않게 고정
   - iframe 내부 PDF 화면은 화면 미리보기에서만 반응형으로 표시
========================================================= */
.estimate-detail-panel,
.estimate-detail-body,
.pdf-preview-toolbar,
.pdf-preview-actions {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.estimate-detail-panel {
  width: 100% !important;
  overflow: hidden !important;
}

.estimate-detail-body {
  width: 100% !important;
  overflow: hidden !important;
}

.pdf-preview-toolbar {
  width: 100% !important;
}

.estimate-pdf-preview {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: clamp(640px, 78vh, 980px) !important;
  max-height: none !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

@media screen and (max-width: 768px) {
  .estimate-pdf-preview {
    height: 72vh !important;
    min-height: 520px !important;
  }
}

@media screen and (max-width: 480px) {
  .estimate-pdf-preview {
    height: 70vh !important;
    min-height: 460px !important;
  }
}

@media screen {
  body.pdf-view {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  body.pdf-view .global-topbar,
  body.pdf-view .sheet {
    width: min(100%, 1120px) !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
  }

  body.pdf-view .sheet {
    padding: 0 10px 24px !important;
    overflow: hidden !important;
  }

  body.pdf-view .topbar-inner {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 14px 16px !important;
    box-sizing: border-box !important;
  }

  body.pdf-view .sheet-header {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr) !important;
    gap: 10px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  body.pdf-view .quote-meta,
  body.pdf-view .supplier-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  body.pdf-view .quote-meta label,
  body.pdf-view .supplier-row,
  body.pdf-view .supplier-grid,
  body.pdf-view input {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  body.pdf-view .quote-summary-bar,
  body.pdf-view .added-items,
  body.pdf-view .table-wrap,
  body.pdf-view table {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  body.pdf-view table {
    table-layout: fixed !important;
  }

  body.pdf-view th,
  body.pdf-view td {
    word-break: keep-all !important;
    overflow-wrap: anywhere !important;
    white-space: normal !important;
  }
}

@media screen and (max-width: 900px) {
  body.pdf-view .sheet-header {
    grid-template-columns: 1fr !important;
  }

  body.pdf-view .quote-summary-bar,
  body.pdf-view .quote-summary-bar.summary-table-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}


/* =========================================================
   PDF Download Layout Match Fix
   - PDF 다운로드/인쇄 시에도 미리보기와 같은 레이아웃 비율 유지
========================================================= */
@page {
  size: A4 portrait;
  margin: 8mm;
}

@media print {
  html,
  body,
  body.pdf-view {
    width: 210mm !important;
    max-width: 210mm !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #ffffff !important;
    box-sizing: border-box !important;
  }

  body.pdf-view .global-topbar,
  body.pdf-view .sheet {
    width: 194mm !important;
    max-width: 194mm !important;
    min-width: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
  }

  body.pdf-view .global-topbar {
    box-shadow: none !important;
  }

  body.pdf-view .topbar-inner {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 4mm 5mm !important;
    box-sizing: border-box !important;
  }

  body.pdf-view .sheet {
    padding: 0 0 8mm !important;
    border: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  body.pdf-view .sheet-header {
    display: grid !important;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr) !important;
    gap: 3mm !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  body.pdf-view .quote-meta,
  body.pdf-view .supplier-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  body.pdf-view .quote-meta label,
  body.pdf-view .supplier-row,
  body.pdf-view .supplier-grid,
  body.pdf-view input {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  body.pdf-view .quote-summary-bar,
  body.pdf-view .quote-summary-bar.summary-table-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr 1fr 1.25fr !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 4mm 0 5mm !important;
    align-items: stretch !important;
    gap: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  body.pdf-view .quote-summary-bar.summary-table-row .summary-cell,
  body.pdf-view .quote-totals,
  body.pdf-view .quote-totals span,
  body.pdf-view .total-box {
    height: 16mm !important;
    min-height: 16mm !important;
    padding: 0 2mm !important;
    box-sizing: border-box !important;
  }

  body.pdf-view .quote-summary-bar.summary-table-row .summary-cell span,
  body.pdf-view .quote-totals span,
  body.pdf-view .total-box span {
    font-size: 9px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
  }

  body.pdf-view .quote-summary-bar.summary-table-row .summary-cell strong,
  body.pdf-view .quote-totals span strong {
    margin-top: 3px !important;
    font-size: 10px !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
  }

  body.pdf-view .quote-summary-bar.summary-table-row .summary-grand strong,
  body.pdf-view .total-box strong {
    margin-top: 3px !important;
    font-size: 16px !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
  }

  body.pdf-view .added-items,
  body.pdf-view .table-wrap,
  body.pdf-view .items-table,
  body.pdf-view .items-section,
  body.pdf-view table {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    box-sizing: border-box !important;
    overflow: visible !important;
  }

  body.pdf-view th,
  body.pdf-view td {
    font-size: 8.5px !important;
    padding: 3px 3px !important;
    line-height: 1.25 !important;
    word-break: keep-all !important;
    overflow-wrap: anywhere !important;
    white-space: normal !important;
  }

  body.pdf-view th:nth-child(2),
  body.pdf-view td:nth-child(2) {
    width: 43% !important;
  }

  .no-print,
  .tabs,
  .controls,
  .pdf-preview-toolbar,
  .pdf-preview-actions,
  button {
    display: none !important;
  }
}

/* 데이터관리 탭에서는 견적정보/공급자정보 헤더 숨김 */
body.data-tab-active:not(.pdf-view) .sheet-header {
  display: none !important;
}

/* =========================================================
   Final Page Consistency Layer
   - 견적서 / 데이터관리 / 저장견적 페이지의 공통 폭, 여백, 탭, 테이블 톤 통일
   - PDF 미리보기와 실제 출력 규칙은 기존 pdf-view / print 규칙을 우선 사용
========================================================= */
body:not(.pdf-view) {
  min-width: 0 !important;
  overflow-x: hidden !important;
  background: #edf1f5 !important;
  color: var(--ink) !important;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", Arial, sans-serif !important;
  font-size: 13px !important;
}

body:not(.pdf-view) .global-topbar {
  width: 100% !important;
  background: linear-gradient(135deg, #1d3557 0%, #274c77 100%) !important;
  border-bottom: 4px solid #16324a !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12) !important;
}

body:not(.pdf-view) .topbar-inner,
body:not(.pdf-view) .sheet {
  width: min(1760px, calc(100vw - 32px)) !important;
  max-width: 1760px !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

body:not(.pdf-view) .topbar-inner {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin: 0 auto !important;
  padding: 18px 24px !important;
}

body:not(.pdf-view) .topbar-brand {
  display: flex !important;
  align-items: baseline !important;
  gap: 10px !important;
  min-width: 0 !important;
  color: #ffffff !important;
}

body:not(.pdf-view) .topbar-brand strong {
  font-size: 24px !important;
  font-weight: 900 !important;
  line-height: 1.15 !important;
  white-space: nowrap !important;
}

body:not(.pdf-view) .topbar-brand span {
  font-size: 15px !important;
  font-weight: 800 !important;
  opacity: 0.9 !important;
  white-space: nowrap !important;
}

body:not(.pdf-view) .sheet {
  margin: 18px auto 28px !important;
  padding: 18px !important;
  background: #ffffff !important;
  border: 1px solid #c7d0db !important;
  border-radius: 12px !important;
  box-shadow: 0 18px 45px rgba(21, 35, 52, 0.14) !important;
}

body:not(.pdf-view) .list-header,
body:not(.pdf-view) .sheet-header {
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

body:not(.pdf-view) .list-header {
  display: grid !important;
  gap: 10px !important;
  margin: 0 0 12px !important;
}

body:not(.pdf-view) .sheet-header {
  margin: 0 0 12px !important;
}

body:not(.pdf-view) .tabs {
  display: flex !important;
  align-items: stretch !important;
  gap: 4px !important;
  width: 100% !important;
  min-width: 0 !important;
  margin: 8px 0 12px !important;
  padding: 0 !important;
  border-bottom: 2px solid var(--accent-dark) !important;
  border-radius: 0 !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch !important;
}

body:not(.pdf-view) .tab,
body:not(.pdf-view) .tabs .tab,
body:not(.pdf-view) .tabs .tab-link {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
  min-width: 104px !important;
  height: 36px !important;
  padding: 0 14px !important;
  border: 1px solid var(--accent-dark) !important;
  border-bottom: 0 !important;
  border-radius: 0 !important;
  background: #d7e4ef !important;
  color: var(--ink) !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  text-decoration: none !important;
  white-space: nowrap !important;
}

body:not(.pdf-view) .tabs .tab.active,
body:not(.pdf-view) .tabs .tab-link.active {
  background: var(--accent-dark) !important;
  color: #ffffff !important;
}

body:not(.pdf-view) .panel.active {
  display: block !important;
}

body:not(.pdf-view) .controls,
body:not(.pdf-view) .data-head,
body:not(.pdf-view) .detail-panel-head,
body:not(.pdf-view) .pdf-preview-toolbar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

body:not(.pdf-view) .controls,
body:not(.pdf-view) .data-head {
  margin: 0 0 8px !important;
}

body:not(.pdf-view) .data-head h2,
body:not(.pdf-view) .data-head h3,
body:not(.pdf-view) .detail-panel-head h2,
body:not(.pdf-view) .list-header h1 {
  margin: 0 !important;
  color: #1d3557 !important;
  font-weight: 900 !important;
  letter-spacing: 0 !important;
}

body:not(.pdf-view) .data-head h2,
body:not(.pdf-view) .detail-panel-head h2 {
  font-size: 18px !important;
}

body:not(.pdf-view) .data-head h3 {
  font-size: 14px !important;
}

body:not(.pdf-view) .list-header h1 {
  font-size: 24px !important;
}

body:not(.pdf-view) .data-actions,
body:not(.pdf-view) .detail-panel-actions,
body:not(.pdf-view) .pdf-preview-actions {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  min-width: 0 !important;
}

body:not(.pdf-view) button,
body:not(.pdf-view) .controls button,
body:not(.pdf-view) .data-actions button,
body:not(.pdf-view) .detail-panel-actions button,
body:not(.pdf-view) .pdf-preview-actions button {
  min-height: 34px !important;
  padding: 0 14px !important;
  border: 1px solid #1d5d7d !important;
  border-radius: 7px !important;
  background: #1d5d7d !important;
  color: #ffffff !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  cursor: pointer !important;
}

body:not(.pdf-view) button:hover,
body:not(.pdf-view) .controls button:hover,
body:not(.pdf-view) .data-actions button:hover,
body:not(.pdf-view) .detail-panel-actions button:hover,
body:not(.pdf-view) .pdf-preview-actions button:hover {
  background: #174d68 !important;
  border-color: #174d68 !important;
}

body:not(.pdf-view) .table-wrap,
body:not(.pdf-view) .estimates-wrap,
body:not(.pdf-view) .estimate-detail-panel,
body:not(.pdf-view) .price-card,
body:not(.pdf-view) .added-items {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

body:not(.pdf-view) .table-wrap,
body:not(.pdf-view) .estimates-wrap {
  overflow: auto !important;
  border: 1px solid #9fb2c6 !important;
  border-radius: 8px !important;
  background: #ffffff !important;
}

body:not(.pdf-view) .data-table,
body:not(.pdf-view) .added-table,
body:not(.pdf-view) .estimates-table {
  width: 100% !important;
  min-width: 620px !important;
  border-collapse: collapse !important;
  table-layout: fixed !important;
  background: #ffffff !important;
}

body:not(.pdf-view) .data-table th,
body:not(.pdf-view) .data-table td,
body:not(.pdf-view) .added-table th,
body:not(.pdf-view) .added-table td,
body:not(.pdf-view) .estimates-table th,
body:not(.pdf-view) .estimates-table td {
  height: 26px !important;
  padding: 3px 5px !important;
  border: 1px solid #9fb2c6 !important;
  font-size: 12px !important;
  line-height: 1.25 !important;
  vertical-align: middle !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;
}

body:not(.pdf-view) .data-table th,
body:not(.pdf-view) .added-table th,
body:not(.pdf-view) .estimates-table th {
  background: #d8e7f7 !important;
  color: #111827 !important;
  font-weight: 900 !important;
  text-align: center !important;
}

body:not(.pdf-view) .data-table td,
body:not(.pdf-view) .added-table td,
body:not(.pdf-view) .estimates-table td {
  background: #ffffff !important;
}

body:not(.pdf-view) .data-table input,
body:not(.pdf-view) .data-table select,
body:not(.pdf-view) .added-table input,
body:not(.pdf-view) .added-table select {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 22px !important;
  padding: 0 4px !important;
  border: 1px solid #c7d0db !important;
  background: #ffffff !important;
  font-size: 12px !important;
  box-sizing: border-box !important;
}

body:not(.pdf-view) .price-sections {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
  gap: 10px !important;
  width: 100% !important;
  min-width: 0 !important;
}

body:not(.pdf-view) .price-card,
body:not(.pdf-view) .estimate-detail-panel {
  border: 1px solid #cfd8e3 !important;
  border-radius: 12px !important;
  background: #ffffff !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08) !important;
  overflow: hidden !important;
}

body:not(.pdf-view) .estimate-detail-body {
  display: grid !important;
  gap: 12px !important;
  width: 100% !important;
  padding: 14px !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

body:not(.pdf-view).data-tab-active .sheet-header {
  display: none !important;
}

@media screen and (max-width: 1024px) {
  body:not(.pdf-view) .topbar-inner,
  body:not(.pdf-view) .sheet {
    width: calc(100vw - 20px) !important;
  }

  body:not(.pdf-view) .sheet {
    margin: 10px auto 18px !important;
    padding: 12px !important;
  }

  body:not(.pdf-view) .sheet-header {
    grid-template-columns: 1fr !important;
  }

  body:not(.pdf-view) .supplier-card {
    grid-column: auto !important;
  }
}

@media screen and (max-width: 768px) {
  body:not(.pdf-view) {
    font-size: 13px !important;
  }

  body:not(.pdf-view) .topbar-inner,
  body:not(.pdf-view) .sheet {
    width: calc(100vw - 12px) !important;
  }

  body:not(.pdf-view) .topbar-inner {
    padding: 12px 8px !important;
  }

  body:not(.pdf-view) .topbar-brand {
    flex-wrap: wrap !important;
    gap: 4px 8px !important;
  }

  body:not(.pdf-view) .topbar-brand strong {
    font-size: 20px !important;
  }

  body:not(.pdf-view) .topbar-brand span {
    font-size: 13px !important;
  }

  body:not(.pdf-view) .sheet {
    padding: 10px !important;
    border-radius: 10px !important;
  }

  body:not(.pdf-view) .controls,
  body:not(.pdf-view) .data-head,
  body:not(.pdf-view) .detail-panel-head,
  body:not(.pdf-view) .pdf-preview-toolbar {
    align-items: stretch !important;
  }

  body:not(.pdf-view) .data-actions,
  body:not(.pdf-view) .detail-panel-actions,
  body:not(.pdf-view) .pdf-preview-actions {
    width: 100% !important;
    justify-content: flex-start !important;
  }

  body:not(.pdf-view) .tab,
  body:not(.pdf-view) .tabs .tab,
  body:not(.pdf-view) .tabs .tab-link {
    min-width: 92px !important;
    height: 34px !important;
    padding: 0 10px !important;
    font-size: 12px !important;
  }

  body:not(.pdf-view) .data-table,
  body:not(.pdf-view) .added-table,
  body:not(.pdf-view) .estimates-table {
    min-width: 720px !important;
  }
}

/* 저장견적 리스트: 금액 셀과 삭제 버튼 셀 분리 */
body:not(.pdf-view) .estimates-table .amount-cell {
  text-align: right !important;
  font-variant-numeric: tabular-nums !important;
}

body:not(.pdf-view) .estimates-table .estimate-delete-cell {
  width: 72px !important;
  text-align: center !important;
}

body:not(.pdf-view) .estimates-table .estimate-delete-cell button {
  min-height: 24px !important;
  height: 24px !important;
  padding: 0 9px !important;
  border-color: #9b1c1c !important;
  background: #b91c1c !important;
  color: #ffffff !important;
  font-size: 11px !important;
}

body:not(.pdf-view) .estimates-table .estimate-delete-cell button:hover {
  border-color: #7f1d1d !important;
  background: #991b1b !important;
}

/* 저장견적 리스트 컬럼 폭 고정: 삭제 버튼이 금액 셀에 붙어 보이지 않게 분리 */
body:not(.pdf-view) .estimates-table .saved-id-col { width: 7%; }
body:not(.pdf-view) .estimates-table .quote-no-col { width: 15%; }
body:not(.pdf-view) .estimates-table .customer-col { width: 16%; }
body:not(.pdf-view) .estimates-table .manager-col { width: 11%; }
body:not(.pdf-view) .estimates-table .count-col { width: 7%; }
body:not(.pdf-view) .estimates-table .supply-col { width: 12%; }
body:not(.pdf-view) .estimates-table .tax-col { width: 10%; }
body:not(.pdf-view) .estimates-table .amount-col { width: 14%; }
body:not(.pdf-view) .estimates-table .delete-action-col { width: 8%; }

body:not(.pdf-view) .estimates-table th:nth-child(8),
body:not(.pdf-view) .estimates-table td:nth-child(8) {
  text-align: right !important;
  border-right: 1px solid #9fb2c6 !important;
}

body:not(.pdf-view) .estimates-table th:nth-child(9),
body:not(.pdf-view) .estimates-table td:nth-child(9) {
  text-align: center !important;
  border-left: 1px solid #9fb2c6 !important;
}

body:not(.pdf-view) .estimates-table .amount-cell strong {
  display: block !important;
  width: 100% !important;
  text-align: right !important;
}

body:not(.pdf-view) .estimates-table .estimate-delete-cell {
  padding-left: 4px !important;
  padding-right: 4px !important;
}

/* 데이터관리 탭 전용 컴팩트 테이블 */
body:not(.pdf-view) #data {
  font-size: 11px !important;
}

body:not(.pdf-view) #data .data-head {
  min-height: 28px !important;
  margin-bottom: 5px !important;
  gap: 6px !important;
}

body:not(.pdf-view) #data .data-head h2 {
  font-size: 15px !important;
}

body:not(.pdf-view) #data .data-head h3 {
  font-size: 12px !important;
}

body:not(.pdf-view) #data .data-actions button {
  min-height: 28px !important;
  height: 28px !important;
  padding: 0 10px !important;
  font-size: 11px !important;
  border-radius: 6px !important;
}

body:not(.pdf-view) #data .hint {
  margin: 3px 0 6px !important;
  font-size: 10.5px !important;
  line-height: 1.35 !important;
}

body:not(.pdf-view) #data .table-wrap {
  max-height: 500px !important;
  border-radius: 6px !important;
}

body:not(.pdf-view) #data #mappingTable,
body:not(.pdf-view) #data .data-table.compact {
  min-width: 360px !important;
  table-layout: fixed !important;
}

body:not(.pdf-view) #data #mappingTable th,
body:not(.pdf-view) #data #mappingTable td,
body:not(.pdf-view) #data .data-table.compact th,
body:not(.pdf-view) #data .data-table.compact td {
  height: 20px !important;
  min-height: 20px !important;
  padding: 1px 3px !important;
  font-size: 10.5px !important;
  line-height: 1.15 !important;
}

body:not(.pdf-view) #data #mappingTable input,
body:not(.pdf-view) #data #mappingTable select,
body:not(.pdf-view) #data .data-table.compact input,
body:not(.pdf-view) #data .data-table.compact select {
  min-height: 18px !important;
  height: 18px !important;
  padding: 0 3px !important;
  font-size: 10.5px !important;
  line-height: 1 !important;
  border-radius: 3px !important;
}

body:not(.pdf-view) #data #mappingTable input[type="checkbox"] {
  width: 12px !important;
  height: 12px !important;
  min-height: 12px !important;
  padding: 0 !important;
}

body:not(.pdf-view) #data #mappingTable th:first-child,
body:not(.pdf-view) #data #mappingTable td:first-child {
  width: 44px !important;
  text-align: center !important;
}

body:not(.pdf-view) #data #mappingTable th:nth-child(2),
body:not(.pdf-view) #data #mappingTable td:nth-child(2) {
  width: 96px !important;
}

body:not(.pdf-view) #data #mappingTable th:nth-child(5),
body:not(.pdf-view) #data #mappingTable td:nth-child(5) {
  width: 88px !important;
}

body:not(.pdf-view) #data .price-sections {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)) !important;
  gap: 7px !important;
}

body:not(.pdf-view) #data .price-card {
  border-radius: 8px !important;
  box-shadow: none !important;
}

body:not(.pdf-view) #data .price-card .data-head {
  padding: 5px 6px !important;
  margin: 0 !important;
  border-bottom: 1px solid #cfd8e3 !important;
  background: #f4f7fb !important;
}

body:not(.pdf-view) #data .price-card .table-wrap {
  max-height: 300px !important;
  border: 0 !important;
  border-radius: 0 !important;
}

body:not(.pdf-view) #data .data-table.compact th:first-child,
body:not(.pdf-view) #data .data-table.compact td:first-child {
  width: 62% !important;
}

body:not(.pdf-view) #data .data-table.compact th:last-child,
body:not(.pdf-view) #data .data-table.compact td:last-child {
  width: 38% !important;
}

/* 데이터관리 탭: 좌우 스크롤 없이 폭 안에 맞춤 */
body:not(.pdf-view) #data .table-wrap,
body:not(.pdf-view) #data .price-card .table-wrap {
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

body:not(.pdf-view) #data #mappingTable,
body:not(.pdf-view) #data .data-table.compact {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  table-layout: fixed !important;
}

body:not(.pdf-view) #data #mappingTable th,
body:not(.pdf-view) #data #mappingTable td,
body:not(.pdf-view) #data .data-table.compact th,
body:not(.pdf-view) #data .data-table.compact td {
  padding-left: 2px !important;
  padding-right: 2px !important;
  font-size: 10px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body:not(.pdf-view) #data #mappingTable input,
body:not(.pdf-view) #data #mappingTable select,
body:not(.pdf-view) #data .data-table.compact input,
body:not(.pdf-view) #data .data-table.compact select {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  padding-left: 2px !important;
  padding-right: 2px !important;
  font-size: 10px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

body:not(.pdf-view) #data #mappingTable th:first-child,
body:not(.pdf-view) #data #mappingTable td:first-child {
  width: 34px !important;
}

body:not(.pdf-view) #data #mappingTable th:nth-child(2),
body:not(.pdf-view) #data #mappingTable td:nth-child(2) {
  width: 13% !important;
}

body:not(.pdf-view) #data #mappingTable th:nth-child(3),
body:not(.pdf-view) #data #mappingTable td:nth-child(3) {
  width: 28% !important;
}

body:not(.pdf-view) #data #mappingTable th:nth-child(4),
body:not(.pdf-view) #data #mappingTable td:nth-child(4) {
  width: 26% !important;
}

body:not(.pdf-view) #data #mappingTable th:nth-child(5),
body:not(.pdf-view) #data #mappingTable td:nth-child(5) {
  width: 17% !important;
}

body:not(.pdf-view) #data .price-sections {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
}

body:not(.pdf-view) #data .data-table.compact th:first-child,
body:not(.pdf-view) #data .data-table.compact td:first-child {
  width: 58% !important;
}

body:not(.pdf-view) #data .data-table.compact th:last-child,
body:not(.pdf-view) #data .data-table.compact td:last-child {
  width: 42% !important;
}

@media screen and (max-width: 768px) {
  body:not(.pdf-view) #data #mappingTable,
  body:not(.pdf-view) #data .data-table.compact {
    min-width: 0 !important;
  }

  body:not(.pdf-view) #data .price-sections {
    grid-template-columns: 1fr !important;
  }
}

/* 견적서 탭: 작업내역 헤더 안의 저장 버튼 오른쪽 정렬 */
body:not(.pdf-view) .work-section .section-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  width: 100% !important;
  margin-bottom: 8px !important;
}

body:not(.pdf-view) .work-section .section-head h2 {
  margin: 0 !important;
}

body:not(.pdf-view) .section-save-button {
  margin-left: auto !important;
  min-height: 32px !important;
  padding: 0 16px !important;
  border-radius: 7px !important;
  background: #1d5d7d !important;
  border-color: #1d5d7d !important;
  color: #ffffff !important;
  font-size: 12px !important;
  font-weight: 900 !important;
}

body:not(.pdf-view) .section-save-button:hover {
  background: #174d68 !important;
  border-color: #174d68 !important;
}

@media screen and (max-width: 768px) {
  body:not(.pdf-view) .work-section .section-head {
    align-items: stretch !important;
  }

  body:not(.pdf-view) .section-save-button {
    margin-left: 0 !important;
  }
}

/* 견적서 카드 리셋 버튼 소형화 */
body:not(.pdf-view) .quote-group .reset-primary,
body:not(.pdf-view) .quote-group .reset-secondary,
body:not(.pdf-view) .quote-group .reset-options,
body:not(.pdf-view) .quote-group .reset-processing {
  min-height: 18px !important;
  height: 18px !important;
  padding: 0 5px !important;
  border-radius: 4px !important;
  background: #6b7280 !important;
  border-color: #4b5563 !important;
  color: #ffffff !important;
  font-size: 9px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
}

body:not(.pdf-view) .quote-group .reset-primary:hover,
body:not(.pdf-view) .quote-group .reset-secondary:hover,
body:not(.pdf-view) .quote-group .reset-options:hover,
body:not(.pdf-view) .quote-group .reset-processing:hover {
  background: #4b5563 !important;
  border-color: #374151 !important;
}

body:not(.pdf-view) .quote-group .group-title {
  min-height: 26px !important;
  gap: 4px !important;
}

/* 데이터관리 탭 숫자 입력 스핀 버튼 숨김 */
body:not(.pdf-view) #data input[type="number"] {
  appearance: textfield !important;
  -moz-appearance: textfield !important;
}

body:not(.pdf-view) #data input[type="number"]::-webkit-outer-spin-button,
body:not(.pdf-view) #data input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}

/* 전체 페이지 숫자 입력 스핀 버튼 숨김 */
input[type="number"] {
  appearance: textfield !important;
  -moz-appearance: textfield !important;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}

/* PDF 보기 화면 상단 다운로드 툴바 */
.pdf-view .controls.no-print {
  display: flex !important;
  justify-content: flex-end;
  align-items: center;
}

@media print {
  .pdf-view .controls.no-print {
    display: none !important;
  }
}
/* PDF 보기 화면 다운로드 버튼 강제 표시 */
.pdf-view #pdfScreenDownload,
.pdf-view .controls.no-print #pdfScreenDownload {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}
/* PDF 보기 화면 독립 다운로드 툴바 */
.pdf-screen-toolbar {
  display: flex !important;
  justify-content: flex-end;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 8px 12px;
  background: #ffffff;
  border-bottom: 1px solid #e5edf5;
}

.pdf-screen-toolbar .pdf-screen-download {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 16px;
  border-radius: 9px;
  background: #1d3557;
  border: 1px solid #1d3557;
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
}

@media print {
  .pdf-screen-toolbar {
    display: none !important;
  }
}
/* =========================================================
   Mobile Clean Layout
   - 작은 화면에서 전체 페이지 가로 깨짐 방지
   - 입력 카드는 세로로 정리하고, 넓은 표만 내부 스크롤 처리
========================================================= */
@media screen and (max-width: 768px) {
  html,
  body:not(.pdf-view) {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    font-size: 12px !important;
  }

  body:not(.pdf-view) .global-topbar,
  body:not(.pdf-view) .topbar-inner,
  body:not(.pdf-view) .sheet {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  body:not(.pdf-view) .global-topbar {
    padding: 0 6px !important;
  }

  body:not(.pdf-view) .topbar-inner {
    padding: 10px 8px !important;
  }

  body:not(.pdf-view) .topbar-brand {
    gap: 6px !important;
    min-width: 0 !important;
  }

  body:not(.pdf-view) .topbar-brand strong {
    font-size: 17px !important;
    line-height: 1.15 !important;
  }

  body:not(.pdf-view) .topbar-brand span {
    font-size: 12px !important;
  }

  body:not(.pdf-view) .sheet {
    margin: 6px 0 14px !important;
    padding: 8px !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  body:not(.pdf-view) .list-header,
  body:not(.pdf-view) .sheet-header,
  body:not(.pdf-view) .panel,
  body:not(.pdf-view) .work-section,
  body:not(.pdf-view) .quote-list,
  body:not(.pdf-view) .quote-card,
  body:not(.pdf-view) .quote-group {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  body:not(.pdf-view) .tabs {
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    margin: 4px 0 8px !important;
    padding-bottom: 0 !important;
    -webkit-overflow-scrolling: touch !important;
  }

  body:not(.pdf-view) .tabs .tab,
  body:not(.pdf-view) .tabs .tab-link {
    min-width: 82px !important;
    height: 32px !important;
    padding: 0 9px !important;
    font-size: 11px !important;
  }

  body:not(.pdf-view) .sheet-header {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    margin-bottom: 8px !important;
  }

  body:not(.pdf-view) .quote-meta,
  body:not(.pdf-view) .supplier-card {
    border-radius: 8px !important;
  }

  body:not(.pdf-view) .quote-meta::before,
  body:not(.pdf-view) .supplier-card::before {
    height: 28px !important;
    padding: 0 9px !important;
    font-size: 11px !important;
  }

  body:not(.pdf-view) .quote-meta label,
  body:not(.pdf-view) .supplier-row {
    grid-template-columns: 64px minmax(0, 1fr) !important;
    min-height: 29px !important;
  }

  body:not(.pdf-view) .supplier-grid {
    grid-template-columns: 1fr !important;
  }

  body:not(.pdf-view) .supplier-row,
  body:not(.pdf-view) .supplier-row:nth-child(2n) {
    border-right: 0 !important;
  }

  body:not(.pdf-view) .quote-meta span,
  body:not(.pdf-view) .supplier-row span,
  body:not(.pdf-view) .quote-group span,
  body:not(.pdf-view) .date-field span,
  body:not(.pdf-view) .group-title {
    font-size: 10px !important;
    line-height: 1.15 !important;
  }

  body:not(.pdf-view) input,
  body:not(.pdf-view) select,
  body:not(.pdf-view) textarea,
  body:not(.pdf-view) .quote-meta input,
  body:not(.pdf-view) .supplier-row input {
    min-width: 0 !important;
    min-height: 28px !important;
    height: 28px !important;
    padding: 0 6px !important;
    font-size: 11px !important;
    box-sizing: border-box !important;
  }

  body:not(.pdf-view) button {
    min-height: 30px !important;
    height: 30px !important;
    padding: 0 9px !important;
    font-size: 11px !important;
    white-space: nowrap !important;
  }

  body:not(.pdf-view) .reset-primary,
  body:not(.pdf-view) .reset-secondary,
  body:not(.pdf-view) .reset-options,
  body:not(.pdf-view) .reset-processing {
    min-height: 22px !important;
    height: 22px !important;
    padding: 0 6px !important;
    font-size: 10px !important;
  }

  body:not(.pdf-view) .quote-summary-bar,
  body:not(.pdf-view) .quote-summary-bar.summary-table-row {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px !important;
    margin-bottom: 10px !important;
  }

  body:not(.pdf-view) .quote-summary-bar .summary-cell,
  body:not(.pdf-view) .quote-summary-bar .summary-grand {
    min-width: 0 !important;
    min-height: 52px !important;
    padding: 7px 6px !important;
  }

  body:not(.pdf-view) .quote-summary-bar .summary-grand {
    grid-column: 1 / -1 !important;
  }

  body:not(.pdf-view) .summary-cell span,
  body:not(.pdf-view) .total-box span {
    font-size: 10px !important;
  }

  body:not(.pdf-view) .summary-cell strong,
  body:not(.pdf-view) .total-box strong {
    font-size: 14px !important;
  }

  body:not(.pdf-view) .section-head,
  body:not(.pdf-view) .data-head,
  body:not(.pdf-view) .detail-panel-head {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  body:not(.pdf-view) .section-head h2,
  body:not(.pdf-view) .data-head h2 {
    font-size: 14px !important;
  }

  body:not(.pdf-view) .section-save-button,
  body:not(.pdf-view) .data-actions,
  body:not(.pdf-view) .detail-panel-actions {
    width: 100% !important;
    margin-left: 0 !important;
    justify-content: flex-end !important;
    flex-wrap: wrap !important;
  }

  body:not(.pdf-view) .quote-card {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    padding: 8px !important;
    border-radius: 8px !important;
    font-size: 11px !important;
  }

  body:not(.pdf-view) .quote-card-head {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
    padding-bottom: 6px !important;
  }

  body:not(.pdf-view) .date-field,
  body:not(.pdf-view) .quote-card-head .quote-card-discount,
  body:not(.pdf-view) .quote-group label,
  body:not(.pdf-view) .quote-group output {
    grid-template-columns: 62px minmax(0, 1fr) !important;
    min-height: 28px !important;
  }

  body:not(.pdf-view) .material-group,
  body:not(.pdf-view) .option-group,
  body:not(.pdf-view) .process-group,
  body:not(.pdf-view) .size-group {
    grid-template-columns: 1fr !important;
    gap: 5px !important;
  }

  body:not(.pdf-view) .group-title {
    min-height: 26px !important;
    gap: 5px !important;
  }

  body:not(.pdf-view) .quote-card-actions {
    justify-content: stretch !important;
    padding-top: 0 !important;
  }

  body:not(.pdf-view) .quote-card-actions .add-current-row {
    width: 100% !important;
  }

  body:not(.pdf-view) .table-wrap,
  body:not(.pdf-view) .estimates-wrap,
  body:not(.pdf-view) .items-section,
  body:not(.pdf-view) .estimate-list-wrap,
  body:not(.pdf-view) .detail-table-wrap {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
  }

  body:not(.pdf-view) .added-table,
  body:not(.pdf-view) .estimates-table {
    min-width: 620px !important;
    font-size: 10px !important;
  }

  body:not(.pdf-view) .data-table {
    min-width: 560px !important;
    font-size: 10px !important;
  }

  body:not(.pdf-view) #data .data-table.compact,
  body:not(.pdf-view) #data #mappingTable {
    min-width: 520px !important;
  }

  body:not(.pdf-view) .data-table th,
  body:not(.pdf-view) .data-table td,
  body:not(.pdf-view) .added-table th,
  body:not(.pdf-view) .added-table td,
  body:not(.pdf-view) .estimates-table th,
  body:not(.pdf-view) .estimates-table td {
    height: 24px !important;
    padding: 2px 3px !important;
    font-size: 10px !important;
    line-height: 1.2 !important;
  }

  body:not(.pdf-view) .added-table .work-description {
    white-space: normal !important;
    line-height: 1.25 !important;
  }

  body:not(.pdf-view) .estimate-pdf-preview {
    width: 100% !important;
    height: 72vh !important;
    max-height: 72vh !important;
    border-radius: 8px !important;
  }
}

@media screen and (max-width: 480px) {
  body:not(.pdf-view) {
    font-size: 11px !important;
  }

  body:not(.pdf-view) .sheet {
    padding: 6px !important;
  }

  body:not(.pdf-view) .topbar-brand strong {
    font-size: 15px !important;
  }

  body:not(.pdf-view) .tabs .tab,
  body:not(.pdf-view) .tabs .tab-link {
    min-width: 76px !important;
    height: 30px !important;
    padding: 0 7px !important;
    font-size: 10px !important;
  }

  body:not(.pdf-view) .quote-meta label,
  body:not(.pdf-view) .supplier-row,
  body:not(.pdf-view) .date-field,
  body:not(.pdf-view) .quote-card-head .quote-card-discount,
  body:not(.pdf-view) .quote-group label,
  body:not(.pdf-view) .quote-group output {
    grid-template-columns: 58px minmax(0, 1fr) !important;
  }

  body:not(.pdf-view) .quote-card-head {
    grid-template-columns: 1fr !important;
  }

  body:not(.pdf-view) .quote-summary-bar,
  body:not(.pdf-view) .quote-summary-bar.summary-table-row {
    grid-template-columns: 1fr 1fr !important;
    gap: 5px !important;
  }

  body:not(.pdf-view) .added-table,
  body:not(.pdf-view) .estimates-table {
    min-width: 560px !important;
  }

  body:not(.pdf-view) .data-table,
  body:not(.pdf-view) #data .data-table.compact,
  body:not(.pdf-view) #data #mappingTable {
    min-width: 500px !important;
  }
}
/* =========================================================
   Mobile Table Text Fit
   - 견적리스트 견적번호 말줄임
   - 데이터관리 테이블 모바일 화면 폭 맞춤
========================================================= */
@media screen and (max-width: 768px) {
  body:not(.pdf-view) .estimates-table .quote-no-col {
    width: 20% !important;
  }

  body:not(.pdf-view) .estimates-table td:nth-child(2) {
    min-width: 0 !important;
    max-width: 0 !important;
    overflow: hidden !important;
  }

  body:not(.pdf-view) .estimate-number-link {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--accent-dark) !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    text-align: left !important;
    line-height: 1.25 !important;
  }

  body:not(.pdf-view) #data .table-wrap,
  body:not(.pdf-view) #data .price-card .table-wrap {
    overflow-x: hidden !important;
  }

  body:not(.pdf-view) #data #mappingTable,
  body:not(.pdf-view) #data .data-table.compact {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: fixed !important;
  }

  body:not(.pdf-view) #data #mappingTable th,
  body:not(.pdf-view) #data #mappingTable td,
  body:not(.pdf-view) #data .data-table.compact th,
  body:not(.pdf-view) #data .data-table.compact td {
    min-width: 0 !important;
    max-width: none !important;
    padding: 1px 2px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body:not(.pdf-view) #data #mappingTable input,
  body:not(.pdf-view) #data #mappingTable select,
  body:not(.pdf-view) #data .data-table.compact input,
  body:not(.pdf-view) #data .data-table.compact select {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 22px !important;
    min-height: 22px !important;
    padding: 0 2px !important;
    font-size: 10px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body:not(.pdf-view) #data #mappingTable input[type="checkbox"] {
    display: inline-block !important;
    width: 12px !important;
    min-width: 12px !important;
    height: 12px !important;
    min-height: 12px !important;
    padding: 0 !important;
  }

  body:not(.pdf-view) #data #mappingTable th:first-child,
  body:not(.pdf-view) #data #mappingTable td:first-child {
    width: 26px !important;
  }

  body:not(.pdf-view) #data #mappingTable th:nth-child(2),
  body:not(.pdf-view) #data #mappingTable td:nth-child(2) {
    width: 16% !important;
  }

  body:not(.pdf-view) #data #mappingTable th:nth-child(3),
  body:not(.pdf-view) #data #mappingTable td:nth-child(3) {
    width: 29% !important;
  }

  body:not(.pdf-view) #data #mappingTable th:nth-child(4),
  body:not(.pdf-view) #data #mappingTable td:nth-child(4) {
    width: 29% !important;
  }

  body:not(.pdf-view) #data #mappingTable th:nth-child(5),
  body:not(.pdf-view) #data #mappingTable td:nth-child(5) {
    width: 20% !important;
  }
}

@media screen and (max-width: 480px) {
  body:not(.pdf-view) .estimates-table .quote-no-col {
    width: 18% !important;
  }

  body:not(.pdf-view) #data #mappingTable th:first-child,
  body:not(.pdf-view) #data #mappingTable td:first-child {
    width: 24px !important;
  }

  body:not(.pdf-view) #data #mappingTable input,
  body:not(.pdf-view) #data #mappingTable select,
  body:not(.pdf-view) #data .data-table.compact input,
  body:not(.pdf-view) #data .data-table.compact select {
    font-size: 9px !important;
    height: 20px !important;
    min-height: 20px !important;
  }

  body:not(.pdf-view) #data #mappingTable th,
  body:not(.pdf-view) #data #mappingTable td,
  body:not(.pdf-view) #data .data-table.compact th,
  body:not(.pdf-view) #data .data-table.compact td {
    font-size: 9px !important;
  }
}
/* =========================================================
   Price Group Table Column Fix
   - 거래처 그룹/그룹 단가관리 전용 컬럼 폭 보정
========================================================= */
body:not(.pdf-view) #data .price-group-card {
  grid-column: 1 / -1 !important;
}

body:not(.pdf-view) #data .group-table,
body:not(.pdf-view) #data .group-price-table {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  table-layout: fixed !important;
}

body:not(.pdf-view) #data .group-table th,
body:not(.pdf-view) #data .group-table td,
body:not(.pdf-view) #data .group-price-table th,
body:not(.pdf-view) #data .group-price-table td {
  min-width: 0 !important;
  max-width: none !important;
  padding: 3px 4px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body:not(.pdf-view) #data .group-table th:nth-child(1),
body:not(.pdf-view) #data .group-table td:nth-child(1) {
  width: 60% !important;
}

body:not(.pdf-view) #data .group-table th:nth-child(2),
body:not(.pdf-view) #data .group-table td:nth-child(2) {
  width: 40% !important;
}

body:not(.pdf-view) #data .group-price-table th:nth-child(1),
body:not(.pdf-view) #data .group-price-table td:nth-child(1) {
  width: 18% !important;
}

body:not(.pdf-view) #data .group-price-table th:nth-child(2),
body:not(.pdf-view) #data .group-price-table td:nth-child(2) {
  width: 14% !important;
}

body:not(.pdf-view) #data .group-price-table th:nth-child(3),
body:not(.pdf-view) #data .group-price-table td:nth-child(3) {
  width: 30% !important;
}

body:not(.pdf-view) #data .group-price-table th:nth-child(4),
body:not(.pdf-view) #data .group-price-table td:nth-child(4) {
  width: 18% !important;
}

body:not(.pdf-view) #data .group-price-table th:nth-child(5),
body:not(.pdf-view) #data .group-price-table td:nth-child(5) {
  width: 20% !important;
}

body:not(.pdf-view) #data .group-table input,
body:not(.pdf-view) #data .group-price-table input {
  width: 100% !important;
  min-width: 0 !important;
}
/* Group Price Empty Note */
body:not(.pdf-view) #data .data-empty-note {
  margin: 8px 0 0;
  padding: 8px 10px;
  border: 1px solid rgba(26, 64, 86, 0.18);
  background: rgba(26, 64, 86, 0.04);
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.4;
}
/* =========================================================
   Customer Management Tab
========================================================= */
body:not(.pdf-view) #customers .price-sections {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
  gap: 10px !important;
  width: 100% !important;
  min-width: 0 !important;
}

body:not(.pdf-view) #customers .price-group-card {
  grid-column: 1 / -1 !important;
}

body:not(.pdf-view) #customers .table-wrap,
body:not(.pdf-view) #customers .price-card .table-wrap {
  overflow-x: hidden !important;
}

body:not(.pdf-view) #customers .data-table,
body:not(.pdf-view) #customers .data-table.compact {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  table-layout: fixed !important;
}

body:not(.pdf-view) #customers .data-table th,
body:not(.pdf-view) #customers .data-table td {
  height: 24px !important;
  padding: 2px 3px !important;
  font-size: 10px !important;
  line-height: 1.2 !important;
}

body:not(.pdf-view) #customers .data-table input,
body:not(.pdf-view) #customers .data-table select {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 22px !important;
  min-height: 22px !important;
  padding: 0 3px !important;
  font-size: 10px !important;
}

body:not(.pdf-view) #customers .group-table th:nth-child(1),
body:not(.pdf-view) #customers .group-table td:nth-child(1) { width: 60% !important; }
body:not(.pdf-view) #customers .group-table th:nth-child(2),
body:not(.pdf-view) #customers .group-table td:nth-child(2) { width: 40% !important; }
body:not(.pdf-view) #customers .group-price-table th:nth-child(1),
body:not(.pdf-view) #customers .group-price-table td:nth-child(1) { width: 18% !important; }
body:not(.pdf-view) #customers .group-price-table th:nth-child(2),
body:not(.pdf-view) #customers .group-price-table td:nth-child(2) { width: 14% !important; }
body:not(.pdf-view) #customers .group-price-table th:nth-child(3),
body:not(.pdf-view) #customers .group-price-table td:nth-child(3) { width: 30% !important; }
body:not(.pdf-view) #customers .group-price-table th:nth-child(4),
body:not(.pdf-view) #customers .group-price-table td:nth-child(4) { width: 18% !important; }
body:not(.pdf-view) #customers .group-price-table th:nth-child(5),
body:not(.pdf-view) #customers .group-price-table td:nth-child(5) { width: 20% !important; }

body:not(.pdf-view) #customers .data-empty-note {
  margin: 8px 0 0;
  padding: 8px 10px;
  border: 1px solid rgba(26, 64, 86, 0.18);
  background: rgba(26, 64, 86, 0.04);
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.4;
}

@media screen and (max-width: 640px) {
  body:not(.pdf-view) #customers .price-sections {
    grid-template-columns: 1fr !important;
  }
}
/* Customer Group Save Button Match */
body:not(.pdf-view) #customers .customer-group-save {
  min-height: 28px !important;
  height: 28px !important;
  padding: 0 10px !important;
  border: 1px solid #1d5d7d !important;
  border-radius: 6px !important;
  background: #1d5d7d !important;
  color: #ffffff !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
}

body:not(.pdf-view) #customers .customer-group-save:hover {
  background: #174d68 !important;
  border-color: #174d68 !important;
}
/* =========================================================
   Unified Button Size Theme
   - 리셋 버튼과 견적리스트 삭제 버튼은 기존 스타일 유지
========================================================= */
body:not(.pdf-view) button:not(.tab):not(.reset-primary):not(.reset-secondary):not(.reset-options):not(.reset-processing):not(.table-link):not([data-action="delete"]),
body:not(.pdf-view) .data-actions button,
body:not(.pdf-view) .detail-panel-actions button,
body:not(.pdf-view) .pdf-preview-actions button,
body:not(.pdf-view) .section-save-button,
body:not(.pdf-view) .add-current-row {
  min-height: 28px !important;
  height: 28px !important;
  padding: 0 10px !important;
  border: 1px solid #2f6f73 !important;
  border-radius: 6px !important;
  background: #2f6f73 !important;
  color: #ffffff !important;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", Arial, sans-serif !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

body:not(.pdf-view) button:not(.tab):not(.reset-primary):not(.reset-secondary):not(.reset-options):not(.reset-processing):not(.table-link):not([data-action="delete"]):hover,
body:not(.pdf-view) .data-actions button:hover,
body:not(.pdf-view) .detail-panel-actions button:hover,
body:not(.pdf-view) .pdf-preview-actions button:hover,
body:not(.pdf-view) .section-save-button:hover,
body:not(.pdf-view) .add-current-row:hover {
  border-color: #255f63 !important;
  background: #255f63 !important;
}

body:not(.pdf-view) .quote-group .reset-primary,
body:not(.pdf-view) .quote-group .reset-secondary,
body:not(.pdf-view) .quote-group .reset-options,
body:not(.pdf-view) .quote-group .reset-processing,
body:not(.pdf-view) .estimates-table .estimate-delete-cell button {
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", Arial, sans-serif !important;
}
/* =========================================================
   Receivables Page
========================================================= */
body:not(.pdf-view) .receivable-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 8px;
  margin: 8px 0;
}

body:not(.pdf-view) .receivable-summary > div {
  min-width: 0;
  border: 1px solid #cfd8e3;
  background: #f7fafc;
  padding: 8px 10px;
}

body:not(.pdf-view) .receivable-summary span {
  display: block;
  margin-bottom: 4px;
  color: #516173;
  font-size: 11px;
}

body:not(.pdf-view) .receivable-summary strong {
  display: block;
  color: #1d3557;
  font-size: 16px;
  font-weight: 600;
}

body:not(.pdf-view) .receivable-filters,
body:not(.pdf-view) .receivable-form {
  display: grid;
  grid-template-columns: 1.4fr 150px 150px 150px auto;
  gap: 6px;
  align-items: end;
  margin: 8px 0;
}

body:not(.pdf-view) .receivable-form {
  grid-template-columns: repeat(4, minmax(130px, 1fr)) auto;
  align-items: end;
}

body:not(.pdf-view) .receivable-form label {
  display: grid;
  gap: 3px;
  color: #334155;
  font-size: 11px;
}

body:not(.pdf-view) .receivable-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  height: 22px;
  border-radius: 999px;
  font-size: 11px;
  color: #ffffff;
  background: #64748b;
}

body:not(.pdf-view) .receivable-status.status-unpaid { background: #64748b; }
body:not(.pdf-view) .receivable-status.status-partial { background: #b7791f; }
body:not(.pdf-view) .receivable-status.status-overdue { background: #b91c1c; }
body:not(.pdf-view) .receivable-status.status-paid { background: #2f6f73; }

body:not(.pdf-view) .receivables-table .memo-cell {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body:not(.pdf-view) .receivable-detail-body {
  padding: 10px;
}

body:not(.pdf-view) .receivable-payments-table {
  margin-top: 8px;
}

@media screen and (max-width: 900px) {
  body:not(.pdf-view) .receivable-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body:not(.pdf-view) .receivable-filters,
  body:not(.pdf-view) .receivable-form {
    grid-template-columns: 1fr 1fr;
  }
}

@media screen and (max-width: 520px) {
  body:not(.pdf-view) .receivable-summary,
  body:not(.pdf-view) .receivable-filters,
  body:not(.pdf-view) .receivable-form {
    grid-template-columns: 1fr;
  }
}
body:not(.pdf-view) .receivable-customer-link {
  color: #1d5d7d !important;
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
}

body:not(.pdf-view) .receivable-back-row td {
  text-align: left !important;
  background: #f7fafc !important;
}

body:not(.pdf-view) .receivable-estimate-row td {
  background: #ffffff;
}

body:not(.pdf-view) .data-table .receivable-customer-link,
body:not(.pdf-view) .receivables-table .receivable-customer-link {
  display: inline !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #111827 !important;
  box-shadow: none !important;
  font: inherit !important;
  line-height: inherit !important;
  text-align: left !important;
  text-decoration: none !important;
  white-space: normal !important;
}

body:not(.pdf-view) .data-table .receivable-customer-link:hover,
body:not(.pdf-view) .receivables-table .receivable-customer-link:hover {
  background: transparent !important;
  color: #0f4f63 !important;
  text-decoration: underline !important;
}
body:not(.pdf-view) .receivable-filters {
  grid-template-columns: 1.4fr 150px 150px 150px auto auto !important;
}

@media screen and (max-width: 900px) {
  body:not(.pdf-view) .receivable-filters {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media screen and (max-width: 520px) {
  body:not(.pdf-view) .receivable-filters {
    grid-template-columns: 1fr !important;
  }
}
body:not(.pdf-view) .receivable-info-form {
  grid-template-columns: 180px !important;
  margin-bottom: 6px;
}

body:not(.pdf-view) .receivable-payment-form {
  grid-template-columns: 150px 150px minmax(180px, 1fr) auto !important;
}

body:not(.pdf-view) .receivable-action-buttons {
  display: flex;
  gap: 6px;
  align-items: end;
  justify-content: flex-end;
}

body:not(.pdf-view) .receivable-action-buttons button {
  white-space: nowrap;
}

@media screen and (max-width: 900px) {
  body:not(.pdf-view) .receivable-info-form,
  body:not(.pdf-view) .receivable-payment-form {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media screen and (max-width: 520px) {
  body:not(.pdf-view) .receivable-info-form,
  body:not(.pdf-view) .receivable-payment-form {
    grid-template-columns: 1fr !important;
  }

  body:not(.pdf-view) .receivable-action-buttons {
    justify-content: stretch;
  }

  body:not(.pdf-view) .receivable-action-buttons button {
    flex: 1 1 0;
  }
}
body:not(.pdf-view) .receivable-detail-panel {
  margin: 10px 0 12px;
}

body:not(.pdf-view) .receivable-estimate-row.active td {
  background: #eef7f8 !important;
}
body:not(.pdf-view) .receivable-payment-form {
  grid-template-columns: 150px 150px 150px minmax(180px, 1fr) auto !important;
}

@media screen and (max-width: 900px) {
  body:not(.pdf-view) .receivable-payment-form {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media screen and (max-width: 520px) {
  body:not(.pdf-view) .receivable-payment-form {
    grid-template-columns: 1fr !important;
  }
}
body:not(.pdf-view) .receivable-customer-summary-row td {
  background: #ffffff !important;
  font-size: 12px !important;
  height: 30px !important;
}

body:not(.pdf-view) .receivable-detail-panel .receivable-payment-form {
  grid-template-columns: 150px 150px 150px minmax(220px, 1fr) auto !important;
  align-items: end !important;
  gap: 8px !important;
}

body:not(.pdf-view) .receivable-detail-panel .receivable-payment-form label {
  display: grid !important;
  gap: 4px !important;
  font-size: 11px !important;
  color: #334155 !important;
}

body:not(.pdf-view) .receivable-detail-panel .receivable-payment-form input {
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 9px !important;
  border: 1px solid #b8c7d9 !important;
  border-radius: 6px !important;
  background: #ffffff !important;
  color: #111827 !important;
  font-size: 12px !important;
  text-align: left !important;
  box-sizing: border-box !important;
}

body:not(.pdf-view) .receivable-detail-panel .receivable-payment-form input:focus {
  border-color: #1d6f86 !important;
  background: #f8fcfd !important;
  outline: 2px solid rgba(29, 111, 134, 0.16) !important;
  outline-offset: 0 !important;
}

body:not(.pdf-view) .receivable-detail-panel .receivable-action-buttons button {
  height: 32px !important;
  min-height: 32px !important;
}

@media screen and (max-width: 900px) {
  body:not(.pdf-view) .receivable-detail-panel .receivable-payment-form {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media screen and (max-width: 520px) {
  body:not(.pdf-view) .receivable-detail-panel .receivable-payment-form {
    grid-template-columns: 1fr !important;
  }
}
/* no-payment-list: hide legacy payment list if cached markup remains */
body:not(.pdf-view) .receivable-payments-table {
  display: none !important;
}