/* ═══════════════════════════════════════════════
   견적서 관리 페이지 (quotes.css)
   ═══════════════════════════════════════════════ */

/* ── 페이지 기본 ── */
#page-quotes .header { border-bottom: 1px solid var(--border); }
#quotesBody { padding: 0; }

/* ── 팁 배너 ── */
.qt-tip-banner {
  background: #FAF5E8;
  border-bottom: 1px solid #E8DFC4;
  padding: 10px 20px;
  font-size: 12px;
  color: #8B6F2A;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.qt-tip-banner .qt-tip-text { flex: 1; line-height: 1.5; }
.qt-tip-banner .qt-tip-close {
  background: none; border: none; font-size: 16px; cursor: pointer;
  color: #8B6F2A; padding: 0 4px; line-height: 1;
}
.qt-tip-banner .qt-tip-close:hover { color: #5B4820; }

/* ── 메인 탭 (상태별) ── */
.qt-main-tabs {
  display: flex;
  gap: 2px;
  padding: 8px 20px 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
  overflow-x: auto;
  flex-shrink: 0;
}
.qt-main-tab {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--txt2);
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
}
.qt-main-tab:hover { background: var(--bg); color: var(--txt); }
.qt-main-tab.active {
  background: var(--bg2);
  border-color: var(--border);
  color: var(--txt);
  font-weight: 600;
}
.qt-main-tab .qt-tab-count {
  color: var(--txt3); font-weight: 400; margin-left: 5px; font-size: 11px;
}
.qt-main-tab.active .qt-tab-count { color: var(--txt2); }

/* ── 툴바 (검색·필터) ── */
.qt-toolbar {
  display: flex;
  gap: 8px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  flex-wrap: wrap;
  background: var(--bg2);
  flex-shrink: 0;
}
.qt-search-input {
  flex: 1;
  max-width: 280px;
  padding: 7px 10px 7px 30px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  background: var(--bg2) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%238A8677' stroke-width='1.8' stroke-linecap='round'><circle cx='7' cy='7' r='5'/><path d='M11 11l3 3'/></svg>") no-repeat 9px center;
  background-size: 14px;
  color: var(--txt);
}
.qt-search-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.qt-filter-group { display: flex; gap: 4px; align-items: center; }
.qt-filter-label { font-size: 11px; color: var(--txt3); margin-right: 4px; }
.qt-filter-tag {
  padding: 5px 10px;
  font-size: 11px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--txt2);
  cursor: pointer;
  white-space: nowrap;
}
.qt-filter-tag:hover { background: var(--bg); color: var(--txt); }
.qt-filter-tag.active { background: var(--accent, #5B6B52); color: #fff; border-color: var(--accent, #5B6B52); }

/* ── 테이블 컨테이너 ── */
.qt-table-wrap {
  flex: 1;
  overflow: auto;
  background: var(--bg2);
  position: relative;
  padding: 0 12px;
}
.qt-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}
.qt-table thead th:last-child,
.qt-table tbody td:last-child { padding-right: 16px; }
.qt-table thead th:first-child,
.qt-table tbody td:first-child { padding-left: 8px; }
.qt-table thead th {
  background: var(--bg3);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--txt2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
  font-size: 11px;
  user-select: none;
  white-space: nowrap;
}
.qt-table thead th.qt-col-sortable { cursor: pointer; }
.qt-table thead th.qt-col-sortable:hover { background: var(--border); }
.qt-table thead th .qt-sort-ind { margin-left: 4px; font-size: 9px; color: var(--accent, #5B6B52); }
.qt-table tbody td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--txt);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.qt-table tbody tr { cursor: pointer; }
.qt-table tbody tr:hover { background: var(--bg3); }
.qt-table tbody tr.qt-row-checked { background: #F0EFE4; }
.qt-table tbody tr.qt-row-checked:hover { background: #E8E6D6; }
.qt-table tbody tr.qt-row-expired td { color: var(--txt3); }

.qt-col-check { width: 36px; text-align: center; padding: 0 !important; }
.qt-col-check input[type=checkbox] { cursor: pointer; width: 14px; height: 14px; margin: 0; }
.qt-col-no { width: 130px; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.qt-col-no code { color: var(--accent, #5B6B52); font-size: 11px; font-weight: 600; background: none; padding: 0; }
.qt-col-partner { width: 140px; font-weight: 500; }
.qt-col-project { width: auto; }
.qt-col-status { width: 80px; text-align: center; }
.qt-col-count { width: 54px; text-align: right; color: var(--txt2); font-variant-numeric: tabular-nums; }
.qt-col-total { width: 120px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.qt-col-date { width: 100px; color: var(--txt2); font-size: 11px; text-align: center; font-variant-numeric: tabular-nums; }
.qt-col-author { width: 76px; color: var(--txt2); text-align: center; }

/* 헤더 정렬을 본문과 동기화 */
.qt-table thead th.qt-col-status { text-align: center; }
.qt-table thead th.qt-col-count  { text-align: right; padding-right: 14px; }
.qt-table thead th.qt-col-total  { text-align: right; padding-right: 14px; }
.qt-table thead th.qt-col-date   { text-align: center; }
.qt-table thead th.qt-col-author { text-align: center; }
.qt-table tbody td.qt-col-count  { padding-right: 14px; }
.qt-table tbody td.qt-col-total  { padding-right: 14px; }

.qt-status-badge {
  display: inline-block;
  padding: 3px 9px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 4px;
  letter-spacing: 0.3px;
}
.qt-status-draft { background: #F0EEE6; color: #6B6858; }
.qt-status-sent { background: #E3EEF9; color: #2E5A8A; }
.qt-status-invoiced { background: #EEE5F5; color: #6B3D8A; }
.qt-status-won { background: #DCEFE3; color: #2D7A48; }
.qt-status-lost { background: #F5E0E0; color: #8A3333; }
.qt-status-expired { background: #EEE; color: #999; }

.qt-muted { color: var(--txt3) !important; }

/* ── 빈 상태 ── */
.qt-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--txt3);
  font-size: 13px;
}
.qt-empty .qt-empty-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.4; }
.qt-empty .qt-empty-title { font-size: 14px; color: var(--txt2); margin-bottom: 4px; font-weight: 600; }
.qt-empty .qt-empty-sub { font-size: 12px; color: var(--txt3); }
.qt-empty .qt-empty-cta {
  margin-top: 16px;
  padding: 8px 18px;
  background: var(--accent, #5B6B52);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.qt-empty .qt-empty-cta:hover { opacity: 0.9; }

/* ── 플로팅 체크바 (bulk-bar) ── */
.qt-bulk-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--txt);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  display: flex;
  gap: 12px;
  align-items: center;
  z-index: 1000;
  font-size: 12px;
}
.qt-bulk-bar .qt-bulk-count { font-weight: 600; }
.qt-bulk-bar .qt-bulk-count b { color: #FFD966; font-size: 13px; }
.qt-bulk-bar button {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 5px 12px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
}
.qt-bulk-bar button:hover { background: rgba(255,255,255,0.2); }
.qt-bulk-bar button.qt-bulk-danger { border-color: #E88; color: #FCC; }
.qt-bulk-bar button.qt-bulk-danger:hover { background: #8A3333; color: #fff; border-color: #C66; }
.qt-bulk-bar .qt-bulk-close {
  background: none; border: none; color: rgba(255,255,255,0.6);
  font-size: 18px; cursor: pointer; padding: 0 4px; line-height: 1;
  margin-left: 4px;
}
.qt-bulk-bar .qt-bulk-close:hover { color: #fff; }

/* ── 반응형 ── */
@media (max-width: 900px) {
  .qt-col-date { display: none; }
  .qt-col-author { display: none; }
  .qt-toolbar { padding: 8px 12px; }
  .qt-main-tabs { padding: 6px 12px 0; }
  .qt-search-input { max-width: none; }
}
@media (max-width: 640px) {
  .qt-col-count { display: none; }
  .qt-col-partner { width: 110px; }
  .qt-table thead th, .qt-table tbody td { padding: 9px 8px; }
}

/* ═══════════════════════════════════════════════
   거래처 피커 (qt-pp)
   ═══════════════════════════════════════════════ */
.qt-pp-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 20000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.qt-pp-modal {
  background: var(--bg2);
  border-radius: 10px;
  width: 540px; max-width: 100%;
  max-height: 80vh;
  display: flex; flex-direction: column;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  overflow: hidden;
}
.qt-pp-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 14px; font-weight: 700;
  display: flex; justify-content: space-between; align-items: center;
  color: var(--txt);
}
.qt-pp-close {
  background: none; border: none;
  font-size: 20px; cursor: pointer;
  color: var(--txt3); padding: 0 4px; line-height: 1;
}
.qt-pp-close:hover { color: var(--txt); }
.qt-pp-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 14px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.qt-pp-tab {
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-bottom: none;
  background: var(--bg2);
  color: var(--txt2);
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  transition: all 0.12s;
  position: relative;
  top: 1px;
}
.qt-pp-tab:hover {
  background: var(--bg3);
  color: var(--txt);
}
.qt-pp-tab.active {
  background: var(--bg);
  color: var(--cs2-accent, #D97706);
  border-color: var(--border);
  border-bottom: 1px solid var(--bg);
  font-weight: 700;
  z-index: 1;
}
.qt-pp-tab.active::after {
  content: '';
  position: absolute;
  left: 12px; right: 12px; top: 0;
  height: 2px;
  background: var(--cs2-accent, #D97706);
  border-radius: 2px;
}
.qt-pp-body {
  flex: 1;
  overflow-y: auto;
  display: flex; flex-direction: column;
}

/* 검색 모드 */
.qt-pp-search-wrap { padding: 12px 18px; border-bottom: 1px solid var(--border); }
.qt-pp-search-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  background: var(--bg2); color: var(--txt);
}
.qt-pp-search-input:focus {
  outline: 2px solid var(--accent, #5B6B52);
  outline-offset: -1px; border-color: var(--accent, #5B6B52);
}
.qt-pp-list { padding: 4px 0; }
.qt-pp-item {
  padding: 10px 18px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  transition: background 0.1s;
}
.qt-pp-item:hover { background: var(--bg3); }
.qt-pp-item-name {
  font-weight: 600; color: var(--txt);
  margin-bottom: 3px;
  display: flex; align-items: center; gap: 6px;
}
.qt-pp-item-type {
  font-size: 10px; font-weight: 500;
  background: var(--bg3); color: var(--txt2);
  padding: 1px 6px; border-radius: 3px;
  border: 1px solid var(--border);
}
.qt-pp-item-sub { font-size: 11px; color: var(--txt3); }
.qt-pp-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--txt3); font-size: 12px;
}
.qt-pp-empty-icon { font-size: 36px; opacity: 0.4; margin-bottom: 10px; }
.qt-pp-empty-sub {
  font-size: 11px; margin-top: 8px;
  color: var(--txt3); line-height: 1.6;
}

/* 직접입력 모드 */
.qt-pp-manual { padding: 16px 18px; }
.qt-pp-manual-hint {
  background: #F7F5EE;
  border: 1px solid #E8DFC4;
  border-radius: 5px;
  padding: 8px 12px;
  font-size: 11px; color: #8B6F2A;
  margin-bottom: 14px;
  line-height: 1.5;
}
.qt-pp-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.qt-pp-field { display: flex; flex-direction: column; gap: 4px; }
.qt-pp-field-full { grid-column: 1 / -1; }
.qt-pp-field label {
  font-size: 11px; font-weight: 500;
  color: var(--txt3);
}
.qt-pp-field label .req { color: #C44; }
.qt-pp-field input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 12px;
  background: var(--bg2); color: var(--txt);
  font-family: inherit;
}
.qt-pp-field input:focus {
  outline: 2px solid var(--accent, #5B6B52);
  outline-offset: -1px; border-color: var(--accent, #5B6B52);
}
.qt-pp-manual-foot {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap;
}
.qt-pp-save-checkbox {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--txt2);
  cursor: pointer; user-select: none;
}
.qt-pp-save-checkbox input { cursor: pointer; }
.qt-pp-submit {
  background: var(--accent, #5B6B52);
  color: #fff; border: 1px solid var(--accent, #5B6B52);
  padding: 9px 16px;
  border-radius: 6px;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
}
.qt-pp-submit:hover { opacity: 0.9; }

@media (max-width: 600px) {
  .qt-pp-form-grid { grid-template-columns: 1fr; }
  .qt-pp-manual-foot { flex-direction: column; align-items: stretch; }
  .qt-pp-submit { width: 100%; }
}

/* ═══════════════════════════════════════════════
   견적 상세 편집 모달 (qt-dm)
   ═══════════════════════════════════════════════ */
.qt-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.qt-detail-modal {
  background: var(--bg2);
  border-radius: 12px;
  width: 1040px; max-width: 100%;
  max-height: 92vh;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  overflow: hidden;
}

/* ─── 문의 컨텍스트 있을 때: 모달 폭 확장 + 본문 2컬럼 ─── */
.qt-detail-modal.qt-dm-has-inq {
  width: min(1360px, 96vw);
}
.qt-dm-body-wrap {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}
.qt-detail-modal.qt-dm-has-inq .qt-dm-body-wrap > .qt-dm-scroll {
  flex: 1;
  min-width: 0;
}

/* 우측 문의 패널 */
.qt-dm-inq-panel {
  width: 300px;
  flex-shrink: 0;
  background: #FFFBF0;
  border-left: 1px solid #FAC775;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.2s ease;
}
.qt-dm-inq-panel.qt-dm-inq-collapsed {
  width: 36px;
}
.qt-dm-inq-head {
  padding: 12px 14px;
  background: #FEF3DA;
  border-bottom: 1px solid #FAC775;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}
.qt-dm-inq-head-title {
  font-size: 12px;
  font-weight: 600;
  color: #7A4A08;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
}
.qt-dm-inq-toggle {
  background: #FFFFFF;
  border: 1px solid #FAC775;
  color: #7A4A08;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}
.qt-dm-inq-toggle:hover { background: #FAC775; }

.qt-dm-inq-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}
.qt-dm-inq-panel.qt-dm-inq-collapsed .qt-dm-inq-head-title,
.qt-dm-inq-panel.qt-dm-inq-collapsed .qt-dm-inq-body {
  display: none;
}
.qt-dm-inq-panel.qt-dm-inq-collapsed .qt-dm-inq-head {
  padding: 8px 6px;
  justify-content: center;
}

/* 패널 내부: 고객 정보 */
.qt-dm-inq-section {
  font-size: 11px;
  color: #7A4A08;
  font-weight: 500;
  margin-bottom: 5px;
  margin-top: 14px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.qt-dm-inq-section:first-child { margin-top: 0; }
.qt-dm-inq-name {
  font-size: 15px;
  font-weight: 600;
  color: #1A1A1A;
  margin-bottom: 4px;
}
.qt-dm-inq-type-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.qt-dm-inq-type-badges .badge {
  background: #FFFFFF;
  border: 1px solid #FAC775;
  color: #7A4A08;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}
.qt-dm-inq-contact {
  background: #FFFFFF;
  border: 1px solid #FAC775;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 11px;
  margin-bottom: 10px;
}
.qt-dm-inq-contact-row {
  display: flex;
  gap: 6px;
  padding: 3px 0;
  color: #1A1A1A;
  align-items: center;
}
.qt-dm-inq-contact-row .ico { font-size: 11px; width: 14px; flex-shrink: 0; }
.qt-dm-inq-contact-row a {
  color: #1565C0;
  text-decoration: none;
  word-break: break-all;
}
.qt-dm-inq-contact-row a:hover { text-decoration: underline; }

.qt-dm-inq-content-box {
  background: #FFFFFF;
  border: 1px solid #FAC775;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 11px;
  color: #1A1A1A;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 240px;
  overflow-y: auto;
}
.qt-dm-inq-attach {
  background: #FFFFFF;
  border: 1px solid #FAC775;
  border-radius: 6px;
  padding: 8px 10px;
  margin-top: 8px;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: #1A1A1A;
  text-decoration: none;
  transition: background .1s;
}
.qt-dm-inq-attach:hover { background: #FEF3DA; }
.qt-dm-inq-attach-name {
  flex: 1;
  color: #1A1A1A;
  word-break: break-all;
}
.qt-dm-inq-attach-size {
  color: #9A9A9A;
  font-size: 10px;
  flex-shrink: 0;
}
.qt-dm-inq-footer-actions {
  display: flex;
  gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #FAC775;
}
.qt-dm-inq-footer-actions button {
  flex: 1;
  background: #FFFFFF;
  border: 1px solid #FAC775;
  color: #7A4A08;
  font-size: 11px;
  padding: 6px 8px;
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
}
.qt-dm-inq-footer-actions button:hover {
  background: #FAC775;
  color: #412402;
}

/* 다크모드 */
body.dark .qt-dm-inq-panel {
  background: #2e2a1e;
  border-left-color: #7A4A08;
}
body.dark .qt-dm-inq-head {
  background: #3a2f1a;
  border-bottom-color: #7A4A08;
}
body.dark .qt-dm-inq-head-title { color: #F0D78C; }
body.dark .qt-dm-inq-toggle {
  background: #242220;
  border-color: #7A4A08;
  color: #F0D78C;
}
body.dark .qt-dm-inq-toggle:hover { background: #7A4A08; }
body.dark .qt-dm-inq-name { color: #EDEAE4; }
body.dark .qt-dm-inq-section { color: #F0D78C; }
body.dark .qt-dm-inq-type-badges .badge,
body.dark .qt-dm-inq-contact,
body.dark .qt-dm-inq-content-box,
body.dark .qt-dm-inq-attach {
  background: #242220;
  border-color: #7A4A08;
  color: #EDEAE4;
}
body.dark .qt-dm-inq-contact-row,
body.dark .qt-dm-inq-attach-name { color: #EDEAE4; }
body.dark .qt-dm-inq-footer-actions {
  border-top-color: #7A4A08;
}
body.dark .qt-dm-inq-footer-actions button {
  background: #242220;
  border-color: #7A4A08;
  color: #F0D78C;
}
.qt-dm-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
  flex-shrink: 0;
}
.qt-dm-title {
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; gap: 10px;
  color: var(--txt);
}
.qt-dm-no {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  color: var(--accent, #5B6B52);
  background: var(--bg2);
  padding: 3px 9px; border-radius: 4px;
  border: 1px solid var(--border);
  font-weight: 600;
}
.qt-dm-close {
  background: none; border: none;
  font-size: 22px; cursor: pointer;
  color: var(--txt3); padding: 0 6px; line-height: 1;
}
.qt-dm-close:hover { color: var(--txt); }
.qt-dm-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
}

/* 메타 섹션 (거래처/프로젝트명/날짜 등) */
.qt-dm-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.qt-dm-field { display: flex; flex-direction: column; gap: 4px; }
.qt-dm-field-full { grid-column: 1 / -1; }
.qt-dm-field-span2 { grid-column: span 2; }
.qt-dm-field label {
  font-size: 11px; font-weight: 500;
  color: var(--txt3);
}
.qt-dm-field label .req { color: #C44; }
.qt-dm-field input,
.qt-dm-field select,
.qt-dm-field textarea {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 12px;
  background: var(--bg2); color: var(--txt);
  font-family: inherit;
}
.qt-dm-field textarea { resize: vertical; min-height: 50px; font-family: inherit; }
.qt-dm-field input:focus,
.qt-dm-field select:focus,
.qt-dm-field textarea:focus {
  outline: 2px solid var(--accent, #5B6B52);
  outline-offset: -1px; border-color: var(--accent, #5B6B52);
}
.qt-dm-field input:read-only,
.qt-dm-field-readonly input {
  background: var(--bg3); color: var(--txt2); cursor: default;
}
.qt-dm-partner-info {
  font-size: 11px; color: var(--txt3);
  margin-top: 4px; line-height: 1.5;
}
.qt-dm-partner-edit {
  background: none; border: none;
  color: var(--accent, #5B6B52);
  font-size: 11px; cursor: pointer;
  padding: 0; margin-left: 6px;
}
.qt-dm-partner-edit:hover { text-decoration: underline; }

/* VAT 토글 바 */
.qt-dm-vat-bar {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 14px;
  background: #F7F5EE;
  border: 1px solid #E8DFC4;
  border-radius: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.qt-dm-vat-label { font-size: 12px; font-weight: 600; color: #8B6F2A; }
.qt-dm-vat-toggle {
  display: inline-flex;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px; padding: 2px; gap: 2px;
}
.qt-dm-vat-toggle button {
  padding: 5px 12px; font-size: 11px;
  border: none; background: transparent;
  color: var(--txt2); border-radius: 4px;
  cursor: pointer; font-weight: 500;
}
.qt-dm-vat-toggle button.active { background: var(--accent, #5B6B52); color: #fff; }
.qt-dm-vat-hint { font-size: 11px; color: #8B6F2A; margin-left: auto; }

/* 섹션 제목 */
.qt-dm-section-title {
  font-size: 13px; font-weight: 700;
  color: var(--txt);
  margin: 4px 0 10px;
  display: flex; justify-content: space-between; align-items: center;
}
.qt-dm-section-title .qt-dm-section-sub {
  font-weight: 400; font-size: 11px; color: var(--txt3);
}
.qt-dm-add-item-btn {
  font-size: 11px; font-weight: 500;
  padding: 6px 12px;
  border: 1px solid var(--border);
  background: var(--bg2); color: var(--txt);
  border-radius: 5px; cursor: pointer;
}
.qt-dm-add-item-btn:hover { background: var(--bg3); border-color: var(--border2); }

/* 제품 테이블 */
.qt-dm-items-wrap {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg2);
}
.qt-dm-items {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  table-layout: fixed;
}
.qt-dm-items thead th {
  background: var(--bg3);
  padding: 8px 8px;
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  color: var(--txt2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.qt-dm-items thead th.qt-dm-th-right { text-align: right; }
.qt-dm-items thead th.qt-dm-th-center { text-align: center; }
.qt-dm-items tbody tr {
  position: relative;
  transition: background 0.1s;
}
.qt-dm-items tbody tr:hover { background: var(--bg3); }
.qt-dm-items tbody tr.qt-dm-row-checked { background: #F0EFE4; }
.qt-dm-items tbody tr.qt-dm-row-checked:hover { background: #E8E6D6; }
.qt-dm-items tbody td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.qt-dm-items tbody tr:last-child td { border-bottom: none; }

/* 컬럼 너비 (중요도별) */
.qt-dm-col-insert { width: 28px; padding: 0 !important; text-align: center; }
.qt-dm-col-check { width: 30px; padding: 0 !important; text-align: center; }
.qt-dm-col-no { width: 30px; text-align: center; color: var(--txt3); font-size: 11px; }
.qt-dm-col-name { width: auto; min-width: 240px; } /* 가장 중요 - 최대 공간 */
.qt-dm-col-code { width: 110px; }
.qt-dm-col-spec { width: 55px; } /* 단위 - 수량과 동일 */
.qt-dm-col-qty { width: 55px; text-align: right; }
.qt-dm-col-price { width: 85px; text-align: right; }
.qt-dm-col-disc { width: 55px; text-align: right; }
.qt-dm-col-supply { width: 100px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.qt-dm-col-vat { width: 80px; text-align: right; font-variant-numeric: tabular-nums; color: var(--txt2); }
.qt-dm-col-memo { width: 90px; }
.qt-dm-col-actions { width: 50px; padding: 0 !important; text-align: center; }

/* 헤더 가운데 정렬 */
.qt-dm-items thead th {
  text-align: center !important;
  vertical-align: middle;
}

/* 품목 셀 wrap - input + 버튼 정렬 */
.qt-dm-inline-name-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
}
.qt-dm-inline-name-wrap .qt-dm-inline-name {
  flex: 1;
  min-width: 0;
}
.qt-dm-name-btn {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--bg2);
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--txt2);
  transition: all 0.1s;
}
.qt-dm-name-btn:hover {
  background: var(--cs2-accent-softer, #FFFBF0);
  border-color: var(--cs2-accent, #D97706);
  color: var(--cs2-accent, #D97706);
}
.qt-dm-name-btn-db:hover {
  background: var(--cs2-accent-softer, #FFFBF0);
}
.qt-dm-bom-btn.qt-dm-bom-has {
  background: rgba(15, 110, 86, 0.1);
  border-color: var(--green, #0F6E56);
  color: var(--green, #0F6E56);
  font-weight: 600;
}

/* 인라인 인풋 */
.qt-dm-inline-input {
  width: 100%;
  padding: 5px 7px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 3px;
  font-size: 11px;
  color: var(--txt);
  font-family: inherit;
}
.qt-dm-inline-input:hover { background: var(--bg2); border-color: var(--border); }
/* 숫자 input의 spin 버튼 (▲▼) 숨김 */
.qt-dm-inline-input::-webkit-outer-spin-button,
.qt-dm-inline-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.qt-dm-inline-input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}
.qt-dm-inline-input:focus {
  outline: none;
  background: var(--bg2);
  border-color: var(--accent, #5B6B52);
  box-shadow: 0 0 0 2px rgba(91,107,82,0.2);
}
.qt-dm-inline-input.qt-dm-right { text-align: right; font-variant-numeric: tabular-nums; }
.qt-dm-inline-name { font-weight: 600; }

/* 호버시 ＋ 삽입 버튼 */
.qt-dm-insert-btn {
  width: 22px; height: 22px;
  background: var(--accent, #5B6B52);
  color: #fff; border: none;
  border-radius: 50%; cursor: pointer;
  font-size: 13px; line-height: 1;
  font-weight: 600;
  display: none;
  align-items: center; justify-content: center;
  margin: 0 auto;
  transition: transform 0.1s;
}
.qt-dm-items tbody tr:hover .qt-dm-insert-btn { display: inline-flex; }
.qt-dm-insert-btn:hover { transform: scale(1.15); }

/* 체크박스 */
.qt-dm-items tbody input[type=checkbox] {
  width: 13px; height: 13px; cursor: pointer; margin: 0;
}

/* 액션 버튼 (복제 / 삭제) */
.qt-dm-row-action {
  width: 24px; height: 24px;
  border: 1px solid var(--border);
  background: var(--bg2);
  border-radius: 4px; cursor: pointer;
  font-size: 12px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--txt2);
  margin: 0 1px;
}
.qt-dm-row-action:hover { background: var(--bg3); color: var(--txt); }
.qt-dm-row-action.qt-dm-action-danger:hover {
  background: #FEE; color: #C44; border-color: #FCC;
}
.qt-dm-row-action.qt-dm-action-dup:hover { color: var(--accent, #5B6B52); border-color: var(--accent, #5B6B52); }

/* 빈 제품 행 */
.qt-dm-items-empty {
  text-align: center;
  padding: 30px 20px;
  color: var(--txt3); font-size: 12px;
}
.qt-dm-items-empty-sub { font-size: 11px; margin-top: 6px; }

/* 합계 영역 */
.qt-dm-summary-wrap {
  display: flex; justify-content: flex-end;
  margin-top: 14px;
}
.qt-dm-summary {
  width: 340px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 18px;
}
.qt-dm-summary-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 0;
  font-size: 12px; color: var(--txt2);
}
.qt-dm-summary-row.qt-dm-total {
  border-top: 2px solid var(--txt);
  margin-top: 6px; padding-top: 10px;
  font-size: 15px; font-weight: 700; color: var(--txt);
}
.qt-dm-summary-row .qt-dm-amount { font-variant-numeric: tabular-nums; }
.qt-dm-discount-input {
  width: 90px; padding: 4px 8px;
  border: 1px solid var(--border); border-radius: 4px;
  text-align: right; font-size: 12px;
  background: var(--bg2); color: var(--txt);
  font-variant-numeric: tabular-nums; font-family: inherit;
}
.qt-dm-hangul { text-align: right; font-size: 10px; color: var(--txt3); margin-top: 4px; font-style: italic; }

/* 내부 원가 요약 (admin만) */
.qt-dm-internal {
  background: #FFF8E8;
  border: 1px solid #E8DFC4;
  border-radius: 6px;
  padding: 10px 14px;
  margin-top: 12px;
  font-size: 11px;
  display: flex; gap: 18px; align-items: center;
  flex-wrap: wrap;
}
.qt-dm-internal-lock { color: #8B6F2A; font-weight: 700; }
.qt-dm-internal-metric { color: var(--txt2); }
.qt-dm-internal-metric b { color: var(--txt); font-weight: 600; margin-left: 3px; }

/* 비고 */
.qt-dm-memo-wrap { margin-top: 16px; }
.qt-dm-memo-wrap label {
  font-size: 11px; font-weight: 500; color: var(--txt3);
  display: block; margin-bottom: 4px;
}
.qt-dm-memo-wrap textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 12px; font-family: inherit;
  min-height: 54px;
  background: var(--bg2); color: var(--txt);
  resize: vertical;
}
.qt-dm-memo-wrap textarea:focus {
  outline: 2px solid var(--accent, #5B6B52);
  outline-offset: -1px; border-color: var(--accent, #5B6B52);
}

/* 푸터 버튼 영역 */
.qt-dm-foot {
  display: flex; justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg3);
  gap: 10px; flex-wrap: wrap;
  flex-shrink: 0;
}
.qt-dm-foot-left, .qt-dm-foot-right {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.qt-dm-btn {
  padding: 7px 13px;
  border: 1px solid var(--border2);
  background: var(--bg2); color: var(--txt);
  border-radius: 5px;
  font-size: 12px; font-weight: 500;
  cursor: pointer; font-family: inherit;
}
.qt-dm-btn:hover { background: var(--bg3); }
.qt-dm-btn-primary {
  background: var(--accent, #5B6B52);
  color: #fff; border-color: var(--accent, #5B6B52);
}
.qt-dm-btn-primary:hover { opacity: 0.9; }
.qt-dm-btn-danger { color: #C44; border-color: #FCC; }
.qt-dm-btn-danger:hover { background: #FEE; }

/* 제품 행 플로팅 bulk-bar (상세모달 내) */
.qt-dm-item-bulk {
  position: sticky; bottom: 10px;
  margin: 12px auto 0; width: fit-content;
  background: var(--txt); color: #fff;
  padding: 8px 14px; border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  display: flex; gap: 10px; align-items: center;
  font-size: 11px; z-index: 10;
}
.qt-dm-item-bulk b { color: #FFD966; }
.qt-dm-item-bulk button {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 4px 10px; border-radius: 4px;
  font-size: 10px; cursor: pointer;
}
.qt-dm-item-bulk button:hover { background: rgba(255,255,255,0.2); }
.qt-dm-item-bulk button.qt-dm-bulk-danger { border-color: #E88; color: #FCC; }
.qt-dm-item-bulk button.qt-dm-bulk-danger:hover { background: #8A3333; color: #fff; border-color: #C66; }

/* 반응형 */
@media (max-width: 900px) {
  .qt-dm-meta { grid-template-columns: 1fr 1fr; }
  .qt-dm-col-memo { display: none; }
  .qt-dm-col-spec { width: 90px; }
}
@media (max-width: 700px) {
  .qt-dm-meta { grid-template-columns: 1fr; }
  .qt-dm-field-span2 { grid-column: 1 / -1; }
  .qt-dm-summary { width: 100%; }
  .qt-dm-col-vat { display: none; }
  .qt-dm-foot-left, .qt-dm-foot-right { width: 100%; justify-content: flex-start; }
}

/* 품목 재고 뱃지 (행 포커스 시 품목명 위에 말풍선) */
.qt-dm-stock-pop {
  position: absolute;
  bottom: calc(100% + 4px); left: 0;
  padding: 3px 8px; border-radius: 4px;
  font-size: 10px; font-weight: 600;
  background: #2D3328; color: #F5F1E6;
  border: 1px solid #2D3328;
  white-space: nowrap; user-select: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  display: none; z-index: 10;
  pointer-events: none;
}
.qt-dm-stock-pop::after {
  content: ''; position: absolute;
  top: 100%; left: 12px;
  border: 4px solid transparent;
  border-top-color: #2D3328;
}
.qt-dm-inline-name-wrap:focus-within .qt-dm-stock-pop {
  display: inline-block;
}
.qt-dm-stock-pop.qt-dm-stock-unset {
  background: #6F6C64; border-color: #6F6C64;
}
.qt-dm-stock-pop.qt-dm-stock-unset::after { border-top-color: #6F6C64; }
.qt-dm-stock-pop.qt-dm-stock-short {
  background: #C33; border-color: #C33; color: #FFF;
  animation: qtStockPulse 1.4s ease-in-out infinite;
}
.qt-dm-stock-pop.qt-dm-stock-short::after { border-top-color: #C33; }
@keyframes qtStockPulse {
  0%, 100% { box-shadow: 0 4px 12px rgba(204,51,51,0.4); }
  50% { box-shadow: 0 4px 20px rgba(204,51,51,0.8); }
}

/* 품목 자동완성 드롭다운 — body 포털 (overflow:hidden 컨테이너 회피) */
.qt-dm-item-suggest-portal {
  z-index: 20000 !important;
  max-width: 420px;
  background: #FFFFFF;
  border: 1px solid #A89880;
  border-radius: 6px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.24);
  max-height: 280px;
  overflow-y: auto;
}
.qt-dm-item-suggest-active {
  background: #F5F1E6 !important;
}

/* 견적 편집 모달 헤더 액션 (미리보기·인쇄·PDF·더보기) */
.qt-dm-head-actions {
  display: flex; align-items: center; gap: 4px;
  margin-left: auto; margin-right: 8px;
}
.qt-dm-head-btn {
  padding: 6px 11px;
  font-size: 12px;
  background: transparent;
  color: #4A5A42;
  border: 1px solid #D4CFC0;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
}
.qt-dm-head-btn:hover {
  background: #F4F1E8;
  border-color: #A89880;
}
.qt-dm-head-btn.qt-dm-head-more {
  padding: 6px 10px;
  font-size: 16px;
  line-height: 1;
  letter-spacing: 1px;
  font-weight: 700;
}
.qt-dm-head-more-wrap {
  position: relative;
}
.qt-dm-more-menu {
  position: absolute;
  top: calc(100% + 6px); right: 0;
  background: #FFFFFF;
  border: 1px solid #C8BFA8;
  border-radius: 6px;
  padding: 4px;
  min-width: 160px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  z-index: 1000;
}
.qt-dm-more-item {
  padding: 9px 14px;
  font-size: 13px;
  color: #2D3328;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: background 0.1s;
}
.qt-dm-more-item:hover { background: #F4F1E8; }
.qt-dm-more-item.qt-dm-more-danger { color: #A33; }
.qt-dm-more-item.qt-dm-more-danger:hover { background: #FBEAEA; }
.qt-dm-more-sep {
  height: 1px; background: #E5E0D4;
  margin: 4px 0;
}

/* 푸터 좌측이 비어도 공간 유지 (space-between을 위해) */
.qt-dm-foot-left:empty { flex: 1; }

/* 명세서 모드 계좌정보 블록 */
.qt-dm-bank-wrap {
  margin-top: 14px;
  padding: 14px 18px;
  background: #FAF6EC;
  border: 1px solid #D4C9A8;
  border-radius: 8px;
}
.qt-dm-bank-head {
  font-size: 13px;
  font-weight: 700;
  color: #4A3B1F;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.qt-dm-bank-sub {
  font-size: 11px; font-weight: 500;
  color: #8A7A4A;
}
.qt-dm-bank-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 12px;
}
.qt-dm-bank-field {
  display: flex; flex-direction: column; gap: 3px;
}
.qt-dm-bank-label {
  font-size: 10px; font-weight: 600;
  color: #8A7A4A;
  letter-spacing: 0.3px;
}
.qt-dm-bank-val {
  font-size: 13px; font-weight: 500;
  color: #2D2820;
  font-variant-numeric: tabular-nums;
}
.qt-dm-bank-empty {
  font-size: 12px; color: #8A7A4A;
  display: flex; align-items: center; gap: 10px;
}
@media (max-width: 700px) {
  .qt-dm-bank-grid { grid-template-columns: 1fr; }
}

/* 종결 상태 · 상태 변경 드롭다운 (푸터) */
.qt-dm-restore-wrap {
  position: relative;
  display: inline-block;
}
.qt-dm-restore-menu {
  position: absolute;
  bottom: calc(100% + 6px); right: 0;
  background: #FFFFFF;
  border: 1px solid #C8BFA8;
  border-radius: 6px;
  padding: 4px;
  min-width: 150px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  z-index: 1000;
}
.qt-dm-restore-item {
  padding: 9px 14px;
  font-size: 13px;
  color: #2D3328;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.qt-dm-restore-item:hover { background: #F4F1E8; }

/* 수주(won) 상태: 잠금 */
.qt-dm-locked-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px;
  margin-bottom: 16px;
  background: #EDF5E8;
  border: 1px solid #B4D099;
  border-radius: 8px;
  color: #2D5522;
}
.qt-dm-locked-icon {
  font-size: 20px;
  flex-shrink: 0;
}
.qt-dm-locked-text {
  display: flex; flex-direction: column; gap: 2px;
  font-size: 12px;
  line-height: 1.5;
}
.qt-dm-locked-text b { font-size: 13px; color: #1F3E17; }
.qt-dm-locked-text span { color: #527040; }

/* 잠금 상태 전체 스타일 */
.qt-dm-locked .qt-dm-scroll input:disabled,
.qt-dm-locked .qt-dm-scroll textarea:disabled,
.qt-dm-locked .qt-dm-scroll select:disabled {
  background: #F7F5EE !important;
  color: #5A5850 !important;
  cursor: not-allowed;
  opacity: 1;
}
.qt-dm-locked .qt-dm-scroll button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
/* 잠금 상태에서 '+ 제품 추가', 행 호버 액션, BOM/제품DB 버튼 등 숨김 */
.qt-dm-locked .qt-dm-add-item-btn,
.qt-dm-locked .qt-dm-row-act-wrap,
.qt-dm-locked .qt-dm-action-danger,
.qt-dm-locked .qt-dm-name-btn,
.qt-dm-locked .qt-dm-item-bulk,
.qt-dm-locked .qt-dm-partner-edit,
.qt-dm-locked .qt-dm-partner-search,
.qt-dm-locked .qt-dm-col-act,
.qt-dm-locked .qt-dm-col-check,
.qt-dm-locked .qt-dm-col-actions {
  display: none !important;
}
.qt-dm-locked .qt-dm-items tbody tr:hover { background: transparent !important; }

/* ═══════════════════════════════════════════════
   거래명세서 (invoices.js) 전용 스타일
   ═══════════════════════════════════════════════ */

/* 상태 뱃지 */
.iv-status-badge {
  display: inline-block;
  padding: 3px 9px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 4px;
  letter-spacing: 0.3px;
}
.iv-status-draft { background: #F0EEE6; color: #6B6858; }
.iv-status-issued { background: #EEE5F5; color: #6B3D8A; }
.iv-status-cancelled { background: #F5E0E0; color: #8A3333; }

/* 모달 헤더 액션 버튼 (invoices-detail 전용) */
.iv-dm-head-btn {
  padding: 6px 11px;
  font-size: 12px;
  background: transparent;
  color: #4A5A42;
  border: 1px solid #D4CFC0;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
}
.iv-dm-head-btn:hover {
  background: #F4F1E8;
  border-color: #A89880;
}

/* 견적 참조 뱃지 */
#ivModalQuoteRef {
  font-size: 10px;
  color: #888680;
  padding: 3px 9px;
  background: #F0EEE6;
  border-radius: 4px;
}
#ivModalQuoteRef code {
  background: none;
  padding: 0;
  color: #4A5A42;
  font-weight: 600;
}

/* 출고 진행률 카드 (편집 모달 상단) */
.iv-shipment-card {
  background: #F4F1E8;
  border: 1px solid #D4CFC0;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
}
.iv-shipment-card .iv-ship-label {
  font-weight: 600;
  color: #5F5E5A;
}
.iv-shipment-card .iv-ship-stat {
  color: #5F5E5A;
}
.iv-shipment-card .iv-ship-stat b {
  color: #2D2820;
  font-variant-numeric: tabular-nums;
}
.iv-shipment-card .iv-ship-stat.ship-cur b { color: #2E5A8A; }
.iv-shipment-card .iv-ship-stat.ship-remain b { color: #2D7A48; }
.iv-shipment-card .iv-ship-badge-ok {
  margin-left: auto;
  color: #2D7A48;
  font-weight: 600;
}
.iv-shipment-card .iv-ship-badge-partial {
  margin-left: auto;
  color: #8B6F2A;
  font-weight: 600;
}

/* 재고 부족 경고 배너 */
.iv-stock-warning {
  background: #FDECEC;
  border: 1px solid #F0B8B8;
  border-radius: 6px;
  padding: 10px 14px;
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: #8A3333;
}
.iv-stock-warning b { color: #5A1919; }

/* 명세서 안내 배너 (보라) */
.iv-info-banner {
  background: #EEE5F5;
  border: 1px solid #C6B3D8;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.iv-info-banner-icon { font-size: 16px; flex-shrink: 0; }
.iv-info-banner-title { font-size: 12px; font-weight: 600; color: #4A1F6B; }
.iv-info-banner-sub { font-size: 11px; color: #6B3D8A; margin-top: 2px; }

/* 명세서 품목 테이블 - 견적량/출고량 2컬럼 비교 */
.iv-item-quoted { color: #888; font-variant-numeric: tabular-nums; }
.iv-item-qty-input { width: 52px; text-align: right; }
.iv-item-match-missing {
  background: #F0F0F0;
  color: #888;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
}
.iv-item-stock-short {
  background: #FDECEC;
  color: #C33;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
}

/* 명세서 발행 후: 출고 로그 박스 */
.iv-stock-log {
  background: #F5F9EE;
  border: 1px solid #C0D0B0;
  border-radius: 6px;
  padding: 10px 14px;
  margin-top: 12px;
}
.iv-stock-log-head {
  font-size: 11px;
  font-weight: 600;
  color: #3B6D11;
  margin-bottom: 6px;
}
.iv-stock-log-row {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: #5F5E5A;
  padding: 3px 0;
  font-variant-numeric: tabular-nums;
}
.iv-stock-log-row b { color: #2D2820; }

/* ═══════════════════════════════════════════════
   거래명세서 레이아웃 (iv-* 클래스를 qt-* 스타일 alias)
   ═══════════════════════════════════════════════ */

/* 팁 배너 */
.iv-tip-banner {
  background: #FAF5E8;
  border-bottom: 1px solid #E8DFC4;
  padding: 10px 20px;
  font-size: 12px;
  color: #8B6F2A;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.iv-tip-banner .iv-tip-text { flex: 1; line-height: 1.5; }
.iv-tip-banner .iv-tip-close {
  background: none; border: none; font-size: 16px; cursor: pointer;
  color: #8B6F2A; padding: 0 4px; line-height: 1;
}
.iv-tip-banner .iv-tip-close:hover { color: #5B4820; }

/* 메인 탭 */
.iv-main-tabs {
  display: flex; gap: 2px;
  padding: 8px 20px 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
  overflow-x: auto;
  flex-shrink: 0;
}
.iv-main-tab {
  padding: 8px 14px;
  font-size: 12px; font-weight: 500;
  color: var(--txt2);
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
}
.iv-main-tab:hover { color: var(--txt); background: var(--border); }
.iv-main-tab.active {
  color: var(--accent, #5B6B52);
  background: var(--bg2);
  border-color: var(--border);
  border-bottom: 1px solid var(--bg2);
  margin-bottom: -1px;
  font-weight: 600;
}
.iv-tab-count {
  display: inline-block;
  padding: 1px 7px;
  margin-left: 4px;
  background: var(--border);
  color: var(--txt2);
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
}
.iv-main-tab.active .iv-tab-count {
  background: var(--accent, #5B6B52);
  color: #FFF;
}

/* 툴바 (검색 + 필터) */
.iv-toolbar {
  display: flex; gap: 12px; align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
}
.iv-search-input {
  flex: 1; max-width: 360px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--bg3);
}
.iv-search-input:focus {
  outline: none;
  border-color: var(--accent, #5B6B52);
  background: #FFF;
}

/* 테이블 영역 */
.iv-table-wrap {
  flex: 1;
  overflow: auto;
  background: var(--bg2);
  position: relative;
  padding: 0 12px;
}
.iv-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}
.iv-table thead th:last-child,
.iv-table tbody td:last-child { padding-right: 16px; }
.iv-table thead th:first-child,
.iv-table tbody td:first-child { padding-left: 8px; }
.iv-table thead th {
  background: var(--bg3);
  padding: 10px 12px;
  text-align: left;
  color: var(--txt2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
  font-size: 11px;
  user-select: none;
  white-space: nowrap;
}
.iv-table thead th.iv-col-sortable { cursor: pointer; }
.iv-table thead th.iv-col-sortable:hover { background: var(--border); }
.iv-table thead th .iv-sort-ind { margin-left: 4px; font-size: 9px; color: var(--accent, #5B6B52); }
.iv-table tbody td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--txt);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.iv-table tbody tr { cursor: pointer; }
.iv-table tbody tr:hover { background: var(--bg3); }

.iv-col-no { width: 130px; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.iv-col-no code { color: #6B3D8A; font-size: 11px; font-weight: 600; background: none; padding: 0; }
.iv-col-qref { width: 120px; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.iv-col-qref code, .iv-qref-code { color: #2E5A8A; font-size: 10px; font-weight: 500; background: none; padding: 0; }
.iv-col-partner { width: 140px; font-weight: 500; }
.iv-col-project { width: auto; }
.iv-col-status { width: 80px; text-align: center; }
.iv-col-total { width: 120px; text-align: right; padding-right: 14px; font-variant-numeric: tabular-nums; font-weight: 600; }
.iv-col-date { width: 100px; color: var(--txt2); font-size: 11px; text-align: center; font-variant-numeric: tabular-nums; }
.iv-col-tax { width: 96px; text-align: center; }
.iv-col-author { width: 76px; color: var(--txt2); text-align: center; }

.iv-table thead th.iv-col-status { text-align: center; }
.iv-table thead th.iv-col-total { text-align: right; padding-right: 14px; }
.iv-table thead th.iv-col-date { text-align: center; }
.iv-table thead th.iv-col-tax { text-align: center; }
.iv-table thead th.iv-col-author { text-align: center; }

/* 세금계산서 배지 */
.iv-tax-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.iv-tax-badge-issued { background: #DCEFE3; color: #1F6B3D; }
.iv-tax-badge-none { background: #F0EDE5; color: #888680; }

.iv-muted { color: var(--txt3); }

/* 빈 상태 */
.iv-empty {
  padding: 80px 20px;
  text-align: center;
}
.iv-empty-icon { font-size: 42px; margin-bottom: 14px; opacity: 0.4; }
.iv-empty-title { font-size: 15px; font-weight: 600; color: var(--txt); margin-bottom: 6px; }
.iv-empty-sub { font-size: 12px; color: var(--txt2); }

/* 견적 리스트 출고 진행률 뱃지 */
.qt-ship-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 2px 6px;
  font-size: 9px;
  font-weight: 600;
  border-radius: 3px;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}
.qt-ship-badge.qt-ship-done { background: #DCEFE3; color: #2D7A48; }
.qt-ship-badge.qt-ship-partial { background: #FCF1D9; color: #8B6F2A; }
.qt-ship-badge.qt-ship-none { background: #EEE; color: #888; }

/* ═══════════════════════════════════════════════
   거래명세서 편집 모달 (invoices.js 실제 클래스)
   ═══════════════════════════════════════════════ */

/* 메타 정보 블록 */
.iv-dm-meta {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.iv-dm-meta-block {
  background: #FFF;
  border: 1px solid #E5E0D4;
  border-radius: 6px;
  padding: 10px 14px;
}
.iv-dm-meta-label {
  font-size: 10px;
  font-weight: 600;
  color: #888680;
  letter-spacing: 0.3px;
}
.iv-dm-meta-main {
  font-size: 13px;
  font-weight: 600;
  color: #2D2820;
  margin-top: 2px;
}
.iv-dm-meta-sub {
  font-size: 11px;
  color: #5F5E5A;
  margin-top: 3px;
  line-height: 1.6;
}

/* 출고 통계 배지 */
.iv-dm-stats {
  background: #F4F1E8;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.iv-dm-stats-item {
  display: flex;
  gap: 4px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.iv-dm-stats-label {
  color: #5F5E5A;
}
.iv-dm-stats-item b { color: #2D2820; }
.iv-dm-stats-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: #2D7A48;
}

/* 품목 테이블 */
.iv-dm-items-wrap {
  background: #FFF;
  border: 1px solid #E5E0D4;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 12px;
}
.iv-dm-items-header {
  padding: 10px 14px;
  background: #F7F5EE;
  border-bottom: 1px solid #E5E0D4;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.iv-dm-items-title {
  font-size: 13px;
  font-weight: 600;
  color: #2D2820;
}
.iv-dm-items-title small {
  color: #888;
  font-weight: normal;
  margin-left: 4px;
}
.iv-dm-items-actions {
  display: flex;
  gap: 6px;
}
.iv-dm-items-actions button {
  padding: 5px 10px;
  font-size: 11px;
  border: 1px solid #D4CFC0;
  border-radius: 5px;
  background: #FFF;
  color: #4A5A42;
  cursor: pointer;
}
.iv-dm-items-actions button:hover {
  background: #F4F1E8;
}
.iv-dm-items-actions .iv-dm-btn-small {
  border-color: #C0D0B0;
  color: #3B6D11;
  background: #F5F9EE;
}
.iv-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.iv-items-table thead th {
  padding: 8px 12px;
  background: #FAF9F4;
  border-bottom: 1px solid #E5E0D4;
  font-size: 10px;
  font-weight: 600;
  color: #888680;
  text-align: left;
  white-space: nowrap;
}
.iv-items-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #F0EDE4;
  vertical-align: middle;
}
.iv-items-table tbody tr:last-child td { border-bottom: none; }
.iv-col-del { width: 32px; text-align: center; }
.iv-col-qqty, .iv-col-qty, .iv-col-price, .iv-col-supply {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.iv-col-qqty { width: 80px; color: #888; }
.iv-col-qty { width: 80px; }
.iv-col-price { width: 90px; color: #5F5E5A; }
.iv-col-supply { width: 110px; font-weight: 600; color: #2D2820; }
.iv-items-table thead th.iv-col-qqty,
.iv-items-table thead th.iv-col-qty,
.iv-items-table thead th.iv-col-price,
.iv-items-table thead th.iv-col-supply { text-align: right; }
.iv-items-table .iv-inline-input {
  width: 60px;
  padding: 4px 8px;
  border: 1px solid #D4CFC0;
  border-radius: 4px;
  font-size: 12px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  background: #FFF;
}
.iv-items-table .iv-inline-input:focus {
  outline: none;
  border-color: #6B3D8A;
}
.iv-items-table .iv-inline-input[disabled] {
  background: #F7F5EE;
  color: #888;
  cursor: not-allowed;
}
.iv-item-name {
  font-weight: 500;
  color: #2D2820;
}
.iv-item-sub {
  font-size: 10px;
  color: #888;
  margin-top: 2px;
}
.iv-item-del {
  width: 24px; height: 24px;
  padding: 0;
  background: transparent;
  border: none;
  color: #C33;
  cursor: pointer;
  border-radius: 4px;
}
.iv-item-del:hover { background: #FBEAEA; }

/* 재고 상태 뱃지 (품목 셀 내부) */
.iv-stock-ok, .iv-stock-short, .iv-stock-unset, .iv-stock-none {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
  vertical-align: middle;
}
.iv-stock-ok { background: #EEF3EA; color: #3B6D11; }
.iv-stock-short { background: #FDECEC; color: #C33; animation: ivStockPulse 1.6s ease-in-out infinite; }
.iv-stock-unset { background: #F0F0F0; color: #888; }
.iv-stock-none { background: #E8E5DC; color: #888; }
@keyframes ivStockPulse {
  0%, 100% { background: #FDECEC; }
  50% { background: #FAD5D5; }
}

/* 빈 품목 */
.iv-dm-items-empty {
  padding: 40px 20px;
  text-align: center;
  color: #888;
  font-size: 12px;
}

/* 재고 경고 배너 (실제 클래스명) */
.iv-dm-stock-warn {
  background: #FDECEC;
  border: 1px solid #F0B8B8;
  border-radius: 6px;
  padding: 10px 14px;
  margin-top: 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 11px;
  color: #8A3333;
}
.iv-dm-stock-warn > span:first-child { font-size: 16px; line-height: 1; }
.iv-dm-stock-warn b { color: #5A1919; display: block; margin-bottom: 2px; }
.iv-dm-stock-warn > div > span { color: #8A3333; line-height: 1.5; }

/* 요약 */
.iv-dm-summary {
  background: #FAF9F4;
  padding: 12px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 24px;
  font-size: 12px;
  border-top: 1px solid #E5E0D4;
}
.iv-dm-sum-row {
  display: flex;
  gap: 6px;
}
.iv-dm-sum-row span:first-child { color: #888; }
.iv-dm-sum-row b {
  color: #2D2820;
  font-variant-numeric: tabular-nums;
}
.iv-dm-sum-row.iv-dm-sum-total b {
  color: #2D2820;
  font-size: 14px;
  font-weight: 700;
}

/* 하단 (계좌 + 메모) */
.iv-dm-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}
.iv-dm-bank {
  background: #FAF6EC;
  border: 1px solid #D4C9A8;
  border-radius: 6px;
  padding: 10px 14px;
}
.iv-dm-bank-head {
  font-size: 10px;
  font-weight: 600;
  color: #8A7A4A;
  margin-bottom: 4px;
}
.iv-dm-bank-body {
  font-size: 11px;
  color: #2D2820;
  line-height: 1.6;
}
.iv-dm-memo-wrap {
  background: #FFF;
  border: 1px solid #E5E0D4;
  border-radius: 6px;
  padding: 10px 14px;
}
.iv-dm-memo-wrap label {
  font-size: 10px;
  font-weight: 600;
  color: #888680;
  display: block;
  margin-bottom: 4px;
}
.iv-dm-memo-wrap textarea {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 11px;
  resize: none;
  min-height: 36px;
  font-family: inherit;
  color: #2D2820;
}
.iv-dm-memo-wrap textarea:focus { outline: none; }
.iv-dm-memo-wrap textarea[disabled] { color: #888; }

/* 안내 배너 (발행 전 / 발행됨) */
.iv-info-banner {
  background: #EEE5F5;
  border: 1px solid #C6B3D8;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.iv-info-banner > span:first-child { font-size: 16px; line-height: 1; }
.iv-info-banner b { color: #4A1F6B; display: block; font-size: 12px; margin-bottom: 2px; }
.iv-info-banner span:last-child { color: #6B3D8A; font-size: 11px; }

/* 발행됨 잠금 배너 */
.iv-locked-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px;
  margin-bottom: 14px;
  background: #EEE5F5;
  border: 1px solid #C6B3D8;
  border-radius: 8px;
  color: #4A1F6B;
}
.iv-locked-icon { font-size: 20px; flex-shrink: 0; }
.iv-locked-text { display: flex; flex-direction: column; gap: 2px; font-size: 12px; line-height: 1.5; }
.iv-locked-text b { font-size: 13px; color: #26124A; }
.iv-locked-text span { color: #6B3D8A; }

/* 취소 배너 */
.iv-cancelled-banner {
  background: #F5E0E0;
  border: 1px solid #E0B8B8;
  color: #5A1919;
  padding: 12px 18px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 12px;
}
.iv-cancelled-banner b { font-size: 13px; }

/* 잠금 상태 전체 */
.iv-dm-locked .iv-dm-scroll input:disabled,
.iv-dm-locked .iv-dm-scroll textarea:disabled,
.iv-dm-locked .iv-dm-scroll select:disabled {
  background: #F7F5EE !important;
  color: #5A5850 !important;
  cursor: not-allowed;
  opacity: 1;
}
.iv-dm-locked .iv-item-del { display: none; }
.iv-dm-locked .iv-dm-items-actions { display: none; }

/* 푸터 버튼 */
.iv-dm-foot-left, .iv-dm-foot-right {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.iv-dm-foot-left:empty { flex: 1; }
.iv-dm-btn {
  padding: 7px 13px;
  font-size: 12px;
  background: transparent;
  color: #4A5A42;
  border: 1px solid #D4CFC0;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.iv-dm-btn:hover { background: #F4F1E8; border-color: #A89880; }
.iv-dm-btn.iv-dm-btn-primary {
  background: #6B3D8A;
  color: #FFF;
  border-color: #6B3D8A;
}
.iv-dm-btn.iv-dm-btn-primary:hover { background: #5A2D78; border-color: #5A2D78; }
.iv-dm-btn.iv-dm-btn-danger {
  color: #8A3333;
  border-color: #E8C0C0;
}
.iv-dm-btn.iv-dm-btn-danger:hover { background: #FBEAEA; border-color: #D08080; }

/* ═══════════════════════════════════════════════
   명세서 편집 모달 기본 레이아웃 (qt-modal 스타일 복제)
   ═══════════════════════════════════════════════ */
.iv-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(40,40,40,0.6);
  z-index: 10000;
  display: none;
  align-items: center; justify-content: center;
}
.iv-modal-overlay[style*="flex"],
.iv-modal-overlay[style*="block"] {
  display: flex !important;
}
.iv-detail-modal {
  background: #FFF;
  width: 92vw; max-width: 1100px;
  max-height: 92vh;
  display: flex; flex-direction: column;
  border-radius: 10px;
  border: 0.5px solid #C8BFA8;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.iv-dm-head {
  background: #FFFFFF;
  border-bottom: 1px solid #E5E0D4;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.iv-dm-title {
  display: flex; align-items: center; gap: 10px;
  color: #1F2420;
  font-weight: 700;
  font-size: 15px;
  flex-wrap: wrap;
}
.iv-dm-no {
  background: #F4F1E8;
  color: #6B3D8A;
  border: 1px solid #C8BFA8;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 4px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.iv-dm-quote-ref {
  font-size: 10px;
  color: #888680;
  padding: 3px 9px;
  background: #F0EEE6;
  border-radius: 4px;
}
.iv-dm-quote-ref code {
  background: none;
  padding: 0;
  color: #2E5A8A;
  font-weight: 600;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10px;
}
.iv-dm-head-actions {
  display: flex; align-items: center; gap: 4px;
  margin-left: auto; margin-right: 8px;
}
.iv-dm-close {
  background: transparent;
  border: none;
  font-size: 18px;
  color: #6B6858;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 4px;
}
.iv-dm-close:hover { background: #F4F1E8; color: #1F2420; }
.iv-dm-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  background: #FAFAF7;
}
.iv-dm-foot {
  background: #FAFAF7;
  border-top: 1px solid #E5E0D4;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* 명세서 리스트 체크박스 컬럼 */
.iv-col-check {
  width: 36px;
  text-align: center;
  padding: 0 !important;
}
.iv-col-check input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: #6B3D8A;
}
.iv-table tbody tr.iv-row-checked {
  background: #F6F0FA;
}
.iv-table tbody tr.iv-row-checked:hover {
  background: #EEE5F5;
}

/* Floating 벌크 바 */
.iv-float-bar {
  position: sticky;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  margin: 16px auto 12px;
  background: #2D3328;
  color: #F7F3ED;
  padding: 10px 16px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.25);
  z-index: 90;
  width: fit-content;
}
.iv-float-count {
  font-size: 12px;
  font-weight: 600;
  padding-right: 6px;
  border-right: 1px solid rgba(255,255,255,0.2);
}
.iv-float-btn {
  padding: 6px 12px;
  font-size: 11px;
  background: transparent;
  color: #F7F3ED;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 5px;
  cursor: pointer;
}
.iv-float-btn:hover {
  background: rgba(255,255,255,0.1);
}
.iv-float-btn-danger {
  border-color: #E06B6B;
  color: #FFB0B0;
}
.iv-float-btn-danger:hover {
  background: rgba(224,107,107,0.15);
  color: #FFD8D8;
}

/* input[type=number] 스피너 제거 (전역) */
.iv-inline-input::-webkit-outer-spin-button,
.iv-inline-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.iv-inline-input {
  -moz-appearance: textfield;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════════
   발주서 (purchase-orders.js) - 주황/앰버 테마
   ═══════════════════════════════════════════════ */

/* 상태 뱃지 */
.po-status-badge {
  display: inline-block;
  padding: 3px 9px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 4px;
  letter-spacing: 0.3px;
}
.po-status-draft { background: #F0EEE6; color: #6B6858; }
.po-status-sent { background: #FAEEDA; color: #854F0B; }
.po-status-received { background: #DCEFE3; color: #2D7A48; }
.po-status-cancelled { background: #F5E0E0; color: #8A3333; }

/* 팁 배너 */
.po-tip-banner {
  background: #FAEEDA;
  border-bottom: 1px solid #E8C48F;
  padding: 10px 20px;
  font-size: 12px;
  color: #854F0B;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.po-tip-banner .po-tip-text { flex: 1; line-height: 1.5; }
.po-tip-banner .po-tip-close {
  background: none; border: none; font-size: 16px; cursor: pointer;
  color: #854F0B; padding: 0 4px; line-height: 1;
}

/* 메인 탭 */
.po-main-tabs {
  display: flex; gap: 2px;
  padding: 8px 20px 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
  overflow-x: auto;
  flex-shrink: 0;
}
.po-main-tab {
  padding: 8px 14px;
  font-size: 12px; font-weight: 500;
  color: var(--txt2);
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  white-space: nowrap;
}
.po-main-tab:hover { color: var(--txt); background: var(--border); }
.po-main-tab.active {
  color: #854F0B;
  background: var(--bg2);
  border-color: var(--border);
  border-bottom: 1px solid var(--bg2);
  margin-bottom: -1px;
  font-weight: 600;
}
.po-tab-count {
  display: inline-block;
  padding: 1px 7px;
  margin-left: 4px;
  background: var(--border);
  color: var(--txt2);
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
}
.po-main-tab.active .po-tab-count {
  background: #854F0B;
  color: #FFF;
}

/* 툴바 */
.po-toolbar {
  display: flex; gap: 12px; align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
}
.po-search-input {
  flex: 1; max-width: 360px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--bg3);
}
.po-search-input:focus {
  outline: none;
  border-color: #854F0B;
  background: #FFF;
}

/* 테이블 */
.po-table-wrap {
  flex: 1;
  overflow: auto;
  background: var(--bg2);
  padding: 0 12px;
}
.po-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}
.po-table thead th {
  background: var(--bg3);
  padding: 10px 12px;
  text-align: left;
  color: var(--txt2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
  font-size: 11px;
  white-space: nowrap;
}
.po-table thead th.po-col-sortable { cursor: pointer; }
.po-table thead th.po-col-sortable:hover { background: var(--border); }
.po-table thead th .po-sort-ind { margin-left: 4px; font-size: 9px; color: #854F0B; }
.po-table tbody td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--txt);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.po-table tbody tr { cursor: pointer; }
.po-table tbody tr:hover { background: var(--bg3); }
.po-table tbody tr.po-row-checked { background: #FDF5E6; }
.po-table tbody tr.po-row-checked:hover { background: #FAEEDA; }

/* 컬럼 너비 */
.po-col-check { width: 36px; text-align: center; padding: 0 !important; }
.po-col-check input[type="checkbox"] { width: 14px; height: 14px; cursor: pointer; accent-color: #854F0B; }
.po-col-no { width: 140px; font-family: ui-monospace, monospace; }
.po-col-no code { color: #854F0B; font-size: 11px; font-weight: 600; background: none; padding: 0; }
.po-col-partner { width: auto; font-weight: 500; }
.po-col-status { width: 100px; text-align: center; }
.po-col-total { width: 120px; text-align: right; padding-right: 14px; font-variant-numeric: tabular-nums; font-weight: 600; }
.po-col-date { width: 100px; color: var(--txt2); font-size: 11px; text-align: center; font-variant-numeric: tabular-nums; }
.po-col-author { width: 76px; color: var(--txt2); text-align: center; }
.po-muted { color: var(--txt3); }

.po-table thead th.po-col-status,
.po-table thead th.po-col-date,
.po-table thead th.po-col-author { text-align: center; }
.po-table thead th.po-col-total { text-align: right; padding-right: 14px; }

/* 빈 상태 */
.po-empty {
  padding: 80px 20px;
  text-align: center;
}
.po-empty-icon { font-size: 42px; margin-bottom: 14px; opacity: 0.4; }
.po-empty-title { font-size: 15px; font-weight: 600; color: var(--txt); margin-bottom: 6px; }
.po-empty-sub { font-size: 12px; color: var(--txt2); }

/* 편집 모달 기본 레이아웃 (다음 턴에 내용 채울 예정) */
.po-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(40,40,40,0.6);
  z-index: 10000;
  display: none;
  align-items: center; justify-content: center;
}
.po-modal-overlay[style*="flex"],
.po-modal-overlay[style*="block"] { display: flex !important; }
.po-detail-modal {
  background: #FFF;
  width: 92vw; max-width: 1100px;
  max-height: 92vh;
  display: flex; flex-direction: column;
  border-radius: 10px;
  border: 0.5px solid #C8BFA8;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.po-dm-head {
  background: #FFFFFF;
  border-bottom: 1px solid #E5E0D4;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.po-dm-title {
  display: flex; align-items: center; gap: 10px;
  color: #1F2420;
  font-weight: 700;
  font-size: 15px;
  flex-wrap: wrap;
}
.po-dm-no {
  background: #FAEEDA;
  color: #854F0B;
  border: 1px solid #E8C48F;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 4px;
  font-family: ui-monospace, monospace;
}
.po-dm-head-actions {
  display: flex; align-items: center; gap: 4px;
  margin-left: auto; margin-right: 8px;
}
.po-dm-close {
  background: transparent;
  border: none;
  font-size: 18px;
  color: #6B6858;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 4px;
}
.po-dm-close:hover { background: #FAEEDA; color: #1F2420; }
.po-dm-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  background: #FAFAF7;
}
.po-dm-foot {
  background: #FAFAF7;
  border-top: 1px solid #E5E0D4;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════
   발주서 편집 모달 내부
   ═══════════════════════════════════════════════ */

/* 헤더 액션 버튼 */
.po-dm-head-btn {
  padding: 6px 11px;
  font-size: 12px;
  background: transparent;
  color: #4A5A42;
  border: 1px solid #D4CFC0;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.po-dm-head-btn:hover {
  background: #FAEEDA;
  border-color: #E8C48F;
}

/* 안내 배너들 */
.po-info-banner {
  background: #FAEEDA;
  border: 1px solid #E8C48F;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.po-info-banner > span:first-child { font-size: 16px; line-height: 1; }
.po-info-banner b { color: #633806; display: block; font-size: 12px; margin-bottom: 2px; }
.po-info-banner span:last-child { color: #854F0B; font-size: 11px; }

.po-locked-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px;
  margin-bottom: 14px;
  background: #FAEEDA;
  border: 1px solid #E8C48F;
  border-radius: 8px;
  color: #633806;
}
.po-locked-icon { font-size: 20px; flex-shrink: 0; }
.po-locked-text { display: flex; flex-direction: column; gap: 2px; font-size: 12px; line-height: 1.5; }
.po-locked-text b { font-size: 13px; color: #412402; }
.po-locked-text span { color: #854F0B; }

.po-received-banner {
  background: #DCEFE3;
  border: 1px solid #9FE1CB;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.po-received-banner > span:first-child { font-size: 16px; line-height: 1; }
.po-received-banner b { color: #085041; display: block; font-size: 12px; margin-bottom: 2px; }
.po-received-banner span:last-child { color: #0F6E56; font-size: 11px; }

.po-cancelled-banner {
  background: #F5E0E0;
  border: 1px solid #E0B8B8;
  color: #5A1919;
  padding: 12px 18px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 12px;
}
.po-cancelled-banner b { font-size: 13px; }

/* 메타 블록 */
.po-dm-meta {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.po-dm-meta-block {
  background: #FFF;
  border: 1px solid #E5E0D4;
  border-radius: 6px;
  padding: 10px 14px;
}
.po-dm-meta-label {
  font-size: 10px;
  font-weight: 600;
  color: #888680;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.po-dm-meta-main {
  font-size: 13px;
  font-weight: 600;
  color: #2D2820;
  margin-top: 2px;
}
.po-dm-meta-sub {
  font-size: 11px;
  color: #5F5E5A;
  margin-top: 3px;
  line-height: 1.6;
}
.po-dm-meta-main input[type="date"] {
  width: 140px;
  padding: 3px 6px;
  border: 1px solid #D4CFC0;
  border-radius: 4px;
  font-size: 12px;
  font-family: inherit;
}
.po-dm-meta-sub input[type="date"] {
  width: 140px;
  padding: 3px 6px;
  border: 1px solid #D4CFC0;
  border-radius: 4px;
  font-size: 11px;
  font-family: inherit;
}

.po-dm-pick-btn {
  padding: 3px 8px;
  font-size: 10px;
  background: #FFF;
  border: 1px solid #D4CFC0;
  border-radius: 4px;
  color: #4A5A42;
  cursor: pointer;
}
.po-dm-pick-btn:hover { background: #FAEEDA; border-color: #E8C48F; }

/* 재고 부족 힌트 배너 */
.po-shortage-hint {
  background: #F5F9EE;
  border: 1px solid #C0D0B0;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: #3B6D11;
}
.po-shortage-hint > span:first-child { font-size: 16px; }
.po-shortage-hint > div { flex: 1; }
.po-shortage-hint b { color: #27500A; }
.po-shortage-btn {
  padding: 5px 12px;
  font-size: 11px;
  background: #97C459;
  color: #173404;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
}
.po-shortage-btn:hover { background: #7FB045; }

/* 품목 테이블 */
.po-dm-items-wrap {
  background: #FFF;
  border: 1px solid #E5E0D4;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 12px;
}
.po-dm-items-header {
  padding: 10px 14px;
  background: #F7F5EE;
  border-bottom: 1px solid #E5E0D4;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.po-dm-items-title {
  font-size: 13px;
  font-weight: 600;
  color: #2D2820;
}
.po-dm-items-title small {
  color: #888;
  font-weight: normal;
  margin-left: 4px;
}
.po-dm-items-actions {
  display: flex;
  gap: 6px;
}
.po-dm-items-actions button {
  padding: 5px 10px;
  font-size: 11px;
  border: 1px solid #D4CFC0;
  border-radius: 5px;
  background: #FFF;
  color: #4A5A42;
  cursor: pointer;
}
.po-dm-items-actions button:hover {
  background: #FAEEDA;
  border-color: #E8C48F;
}

.po-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.po-items-table thead th {
  padding: 8px 12px;
  background: #FAF9F4;
  border-bottom: 1px solid #E5E0D4;
  font-size: 10px;
  font-weight: 600;
  color: #888680;
  text-align: center;
  white-space: nowrap;
}
.po-items-table tbody td {
  padding: 6px 8px;
  border-bottom: 1px solid #F0EDE4;
  vertical-align: middle;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}
.po-items-table .po-col-check { width: 30px; padding: 0 !important; text-align: center; }
.po-items-table .po-col-no {
  width: 30px !important;
  text-align: center;
  color: #888;
  font-family: inherit !important;
}
.po-items-table .po-col-no code { all: unset; }
.po-items-table tbody tr:last-child td { border-bottom: none; }
.po-items-table .po-col-name { width: auto; min-width: 180px; }
.po-items-table .po-col-code { width: 95px; }
.po-items-table .po-col-spec { width: 75px; }
.po-items-table .po-col-stock { width: 70px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.po-items-table .po-col-qty { width: 75px; text-align: right; }
.po-items-table .po-col-price { width: 85px; text-align: right; }
.po-items-table .po-col-supply { width: 100px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: #2D2820; }
.po-items-table .po-col-del { width: 36px; text-align: center; }

/* 품목 셀 wrap (돋보기 + input) */
.po-items-table .po-name-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}
.po-items-table .po-name-wrap .po-inline-text {
  flex: 1;
  min-width: 0;
}
.po-name-btn {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid #D4CFC0;
  background: #FAF9F4;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #666;
}
.po-name-btn:hover {
  background: #FFFBF0;
  border-color: #D97706;
  color: #D97706;
}
.po-inline-input.po-right { text-align: right; }

.po-inline-input {
  width: 100%;
  padding: 4px 8px;
  border: 1px solid #D4CFC0;
  border-radius: 4px;
  font-size: 12px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  background: #FFF;
  box-sizing: border-box;
}
.po-inline-input:focus {
  outline: none;
  border-color: #854F0B;
}
.po-inline-input::-webkit-outer-spin-button,
.po-inline-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.po-inline-input { -moz-appearance: textfield; }
.po-inline-input[disabled] {
  background: #F7F5EE;
  color: #888;
}

.po-inline-text {
  width: 100%;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 12px;
  background: transparent;
  font-family: inherit;
  color: #2D2820;
}
.po-inline-text:hover { border-color: #E5E0D4; }
.po-inline-text:focus {
  outline: none;
  border-color: #854F0B;
  background: #FFF;
}
.po-inline-text[disabled] {
  background: transparent;
  color: #888;
  cursor: not-allowed;
}

.po-item-sub {
  font-size: 10px;
  color: #888;
  margin-top: 2px;
  padding-left: 8px;
}

.po-item-del {
  width: 24px; height: 24px;
  padding: 0;
  background: transparent;
  border: none;
  color: #C33;
  cursor: pointer;
  border-radius: 4px;
}
.po-item-del:hover { background: #FBEAEA; }

.po-stock-ok { color: #3B6D11; }
.po-stock-low { color: #BA7517; }
.po-stock-zero { color: #C33; }

.po-dm-items-empty {
  padding: 40px 20px;
  text-align: center;
  color: #888;
  font-size: 12px;
}

/* 요약 */
.po-dm-summary {
  background: #FAF9F4;
  padding: 12px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 24px;
  font-size: 12px;
  border-top: 1px solid #E5E0D4;
}
.po-dm-sum-row { display: flex; gap: 6px; }
.po-dm-sum-row span:first-child { color: #888; }
.po-dm-sum-row span:last-child { color: #2D2820; font-weight: 500; font-variant-numeric: tabular-nums; }
.po-dm-sum-row.po-dm-sum-total span:last-child {
  color: #2D2820;
  font-size: 14px;
  font-weight: 700;
}

/* 하단 블록 */
.po-dm-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}
.po-dm-bank {
  background: #FFF;
  border: 1px solid #E5E0D4;
  border-radius: 6px;
  padding: 10px 14px;
}
.po-dm-bank-head {
  font-size: 10px;
  font-weight: 600;
  color: #888680;
  margin-bottom: 4px;
}
.po-dm-bank-body {
  font-size: 11px;
  color: #2D2820;
  line-height: 2;
}
.po-dm-bank-body input {
  display: inline-block;
  min-width: 160px;
}
.po-dm-memo-wrap {
  background: #FFF;
  border: 1px solid #E5E0D4;
  border-radius: 6px;
  padding: 10px 14px;
}
.po-dm-memo-wrap label {
  font-size: 10px;
  font-weight: 600;
  color: #888680;
  display: block;
  margin-bottom: 4px;
}
.po-dm-memo-wrap textarea {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 11px;
  resize: none;
  min-height: 50px;
  font-family: inherit;
  color: #2D2820;
}
.po-dm-memo-wrap textarea:focus { outline: none; }

/* 잠금 스타일 */
.po-dm-locked .po-item-del,
.po-dm-locked .po-dm-items-actions,
.po-dm-locked .po-dm-pick-btn { display: none !important; }

/* 푸터 버튼 */
.po-dm-foot-left, .po-dm-foot-right {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.po-dm-btn {
  padding: 7px 13px;
  font-size: 12px;
  background: transparent;
  color: #4A5A42;
  border: 1px solid #D4CFC0;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.po-dm-btn:hover { background: #FAEEDA; border-color: #E8C48F; }
.po-dm-btn.po-dm-btn-primary {
  background: #854F0B;
  color: #FFF;
  border-color: #854F0B;
}
.po-dm-btn.po-dm-btn-primary:hover { background: #633806; border-color: #633806; }

/* ═══════════════════════════════════════════════
   발주서 제품 피커 모달
   ═══════════════════════════════════════════════ */
.po-picker-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 20100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.po-picker-modal {
  background: #FFF;
  width: 780px;
  max-width: 100%;
  max-height: 85vh;
  border-radius: 12px;
  border: 0.5px solid #C8BFA8;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.po-picker-head {
  padding: 16px 20px;
  border-bottom: 1px solid #E5E0D4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FAFAF7;
  flex-shrink: 0;
}
.po-picker-title {
  font-size: 15px;
  font-weight: 700;
  color: #1F2420;
}
.po-picker-sub {
  font-size: 11px;
  color: #6B6858;
  margin-top: 2px;
}
.po-picker-sub b {
  color: #854F0B;
}
.po-picker-close {
  background: transparent;
  border: none;
  font-size: 18px;
  color: #6B6858;
  cursor: pointer;
  padding: 4px 10px;
}
.po-picker-close:hover { color: #1F2420; }

.po-picker-toolbar {
  padding: 12px 20px;
  background: #FFF;
  border-bottom: 1px solid #E5E0D4;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
}
.po-picker-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #F7F5EE;
  border: 1px solid #D4CFC0;
  border-radius: 6px;
}
.po-picker-search span { font-size: 13px; color: #888; }
.po-picker-search input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 12px;
  outline: none;
  font-family: inherit;
}
.po-picker-filters { display: flex; gap: 4px; }
.po-picker-flt {
  padding: 6px 10px;
  font-size: 10px;
  background: transparent;
  border: 1px solid #D4CFC0;
  color: #6B6858;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
}
.po-picker-flt:hover { background: #FAEEDA; }
.po-picker-flt.active {
  background: #FAEEDA;
  border-color: #E8C48F;
  color: #854F0B;
}

.po-picker-list-head {
  padding: 10px 14px 6px;
  background: #FAFAF7;
  border-bottom: 1px solid #F0EDE4;
  display: grid;
  grid-template-columns: 30px 1fr 60px 80px 80px 80px;
  gap: 10px;
  font-size: 10px;
  font-weight: 600;
  color: #888680;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}
.po-picker-list {
  flex: 1;
  overflow-y: auto;
  background: #FAFAF7;
}
.po-picker-row {
  padding: 10px 14px;
  border-bottom: 1px solid #F0EDE4;
  display: grid;
  grid-template-columns: 30px 1fr 60px 80px 80px 80px;
  gap: 10px;
  align-items: center;
  cursor: pointer;
}
.po-picker-row:hover { background: #F7F5EE; }
.po-picker-row-hl { background: #FFF4E6; }
.po-picker-row-hl:hover { background: #FCE8CE; }
.po-picker-row-added {
  opacity: 0.55;
  cursor: not-allowed;
}
.po-picker-row-added:hover { background: #FAFAF7; }
.po-picker-row-added .po-picker-n1 { text-decoration: line-through; color: #888; }

.po-picker-chk input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: #854F0B;
  cursor: pointer;
}
.po-picker-name { overflow: hidden; }
.po-picker-n1 {
  font-size: 13px;
  font-weight: 600;
  color: #2D2820;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.po-picker-n2 {
  font-size: 10px;
  color: #888;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.po-picker-vendor { color: #854F0B; }
.po-picker-stock {
  text-align: right;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.po-picker-minstock,
.po-picker-price {
  text-align: right;
  font-size: 11px;
  color: #2D2820;
  font-variant-numeric: tabular-nums;
}
.po-picker-status { text-align: right; }
.po-picker-badge {
  font-size: 9px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  display: inline-block;
}
.po-stat-zero { background: #FCEBEB; color: #791F1F; }
.po-stat-low { background: #FAEEDA; color: #854F0B; }
.po-stat-ok { background: #DCEFE3; color: #2D7A48; }
.po-stat-none { background: #E8E6DD; color: #888; }

.po-picker-empty {
  padding: 60px 20px;
  text-align: center;
  color: #888;
  font-size: 12px;
}

.po-picker-foot {
  padding: 12px 20px;
  border-top: 1px solid #E5E0D4;
  background: #FAFAF7;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.po-picker-summary {
  font-size: 12px;
  color: #6B6858;
}
.po-picker-btn {
  padding: 8px 14px;
  font-size: 12px;
  background: transparent;
  border: 1px solid #D4CFC0;
  color: #4A5A42;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}
.po-picker-btn:hover { background: #FAEEDA; border-color: #E8C48F; }
.po-picker-btn-primary {
  background: #854F0B;
  color: #FFF;
  border-color: #854F0B;
  font-weight: 600;
}
.po-picker-btn-primary:hover:not(:disabled) {
  background: #633806;
  border-color: #633806;
}

/* ═══════════════════════════════════════════════
   발주서 품목 테이블 - 새 컬럼 클래스 (리스트와 분리)
   ═══════════════════════════════════════════════ */
.po-items-table .po-item-chk {
  width: 32px;
  text-align: center;
  padding: 0 !important;
}
.po-items-table .po-item-chk input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: #854F0B;
}
.po-items-table .po-item-no {
  width: 36px;
  text-align: center;
  color: #888;
  font-family: inherit;
  font-size: 11px;
}
.po-items-table .po-item-name { width: auto; }
.po-items-table .po-item-stock {
  width: 80px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.po-items-table .po-item-qty {
  width: 90px;
  text-align: right;
}
.po-items-table .po-item-price {
  width: 100px;
  text-align: right;
}
.po-items-table .po-item-supply {
  width: 110px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #2D2820;
}
.po-items-table .po-item-del {
  width: 32px;
  text-align: center;
}
.po-items-table thead th.po-item-stock,
.po-items-table thead th.po-item-qty,
.po-items-table thead th.po-item-price,
.po-items-table thead th.po-item-supply {
  text-align: right;
}
.po-items-table tbody tr.po-item-checked {
  background: #FFF4E0;
}
.po-items-table tbody tr.po-item-checked:hover {
  background: #FAEEDA;
}
.po-items-table .po-item-del-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: none;
  color: #C33;
  cursor: pointer;
  border-radius: 4px;
}
.po-items-table .po-item-del-btn:hover {
  background: #FBEAEA;
}

/* 품목 벌크 바 */
.po-item-bulk-bar {
  background: #2D3328;
  color: #F7F3ED;
  padding: 10px 16px;
  border-top: 1px solid #E5E0D4;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.po-item-bulk-bar b {
  color: #FCDE5A;
  font-weight: 700;
}
.po-item-bulk-btn {
  padding: 6px 12px;
  font-size: 11px;
  background: rgba(255,255,255,0.1);
  color: #F7F3ED;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
}
.po-item-bulk-btn:hover {
  background: rgba(255,255,255,0.2);
}
.po-item-bulk-danger {
  border-color: #E06B6B;
  color: #FFCCCC;
}
.po-item-bulk-danger:hover {
  background: rgba(224,107,107,0.2);
  color: #FFF;
}

/* 제품 피커 전체선택 헤더 */
.po-picker-list-head input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: #854F0B;
  cursor: pointer;
}

/* ═══════════════════════════════════════════════
   발주서 편집 모달 - ellipsis 완전 제거 (최우선)
   ═══════════════════════════════════════════════ */
.po-detail-modal .po-items-table td,
.po-detail-modal .po-items-table th {
  text-overflow: clip !important;
  overflow: visible !important;
  white-space: nowrap !important;
}
.po-detail-modal .po-items-table .po-item-no {
  width: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
  text-align: center !important;
  color: #888 !important;
  font-family: inherit !important;
  font-size: 12px !important;
  padding: 10px 4px !important;
}
.po-detail-modal .po-items-table .po-item-chk {
  width: 36px !important;
  min-width: 36px !important;
  max-width: 36px !important;
  padding: 10px 8px !important;
  text-align: center !important;
}
.po-detail-modal .po-items-table .po-item-qty,
.po-detail-modal .po-items-table .po-item-price {
  padding: 10px 8px !important;
}
.po-detail-modal .po-items-table .po-item-qty input,
.po-detail-modal .po-items-table .po-item-price input {
  width: 72px !important;
  min-width: 72px !important;
  padding: 6px 10px !important;
  border: 1px solid #D4CFC0 !important;
  border-radius: 4px !important;
  font-size: 12px !important;
  text-align: right !important;
  font-variant-numeric: tabular-nums !important;
  background: #FFF !important;
  box-sizing: border-box !important;
}
.po-detail-modal .po-items-table .po-item-stock {
  width: 90px !important;
  text-align: right !important;
  padding: 10px 12px !important;
}
.po-detail-modal .po-items-table .po-item-supply {
  width: 120px !important;
  text-align: right !important;
  padding: 10px 12px !important;
}
.po-detail-modal .po-items-table .po-item-name {
  padding: 10px 12px !important;
  text-align: left !important;
}
.po-detail-modal .po-items-table .po-item-name .po-inline-text {
  width: 100% !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  padding: 4px 6px !important;
  border-radius: 4px !important;
  color: #2D2820 !important;
  font-family: inherit !important;
  box-sizing: border-box !important;
}
.po-detail-modal .po-items-table .po-item-name .po-inline-text:hover {
  border-color: #E5E0D4 !important;
}
.po-detail-modal .po-items-table .po-item-name .po-inline-text:focus {
  outline: none !important;
  border-color: #854F0B !important;
  background: #FFF !important;
}
.po-detail-modal .po-items-table .po-item-sub {
  font-size: 10px !important;
  color: #999 !important;
  margin-top: 2px !important;
  padding-left: 8px !important;
}
.po-detail-modal .po-items-table .po-item-del {
  width: 40px !important;
  text-align: center !important;
  padding: 10px 4px !important;
}
.po-detail-modal .po-items-table thead th {
  text-align: left !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  color: #888680 !important;
  padding: 10px 8px !important;
  background: #FAF9F4 !important;
  border-bottom: 1px solid #E5E0D4 !important;
}
.po-detail-modal .po-items-table thead th.po-item-chk,
.po-detail-modal .po-items-table thead th.po-item-no,
.po-detail-modal .po-items-table thead th.po-item-del {
  text-align: center !important;
}
.po-detail-modal .po-items-table thead th.po-item-stock,
.po-detail-modal .po-items-table thead th.po-item-qty,
.po-detail-modal .po-items-table thead th.po-item-price,
.po-detail-modal .po-items-table thead th.po-item-supply {
  text-align: right !important;
}

/* 제품 피커 전체선택 체크박스 - 강제 표시 */
.po-picker-list-head {
  padding: 10px 14px 6px !important;
  background: #FAFAF7 !important;
  border-bottom: 1px solid #F0EDE4 !important;
  display: grid !important;
  grid-template-columns: 36px 1fr 80px 80px 80px 80px !important;
  gap: 10px !important;
  align-items: center !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  color: #888680 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.3px !important;
}
.po-picker-list-head > div:first-child {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.po-picker-list-head input[type="checkbox"] {
  width: 16px !important;
  height: 16px !important;
  accent-color: #854F0B !important;
  cursor: pointer !important;
  margin: 0 !important;
}
.po-picker-row {
  display: grid !important;
  grid-template-columns: 36px 1fr 80px 80px 80px 80px !important;
}

/* ═══════════════════════════════════════════════
   발주서 리스트 테이블 - 시인성 개선 v2
   ═══════════════════════════════════════════════ */
#page-purchase-orders .po-table-wrap {
  background: #FAFAF7 !important;
  border-radius: 10px !important;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08) !important;
  overflow: hidden !important;
  border: 1px solid #E5E0D4 !important;
  margin-top: 12px !important;
}
#page-purchase-orders .po-table {
  width: 100% !important;
  border-collapse: collapse !important;
  background: transparent !important;
}
#page-purchase-orders .po-table thead tr {
  background: #EDE6D3 !important;
  border-bottom: 2px solid #C8BFA8 !important;
}
#page-purchase-orders .po-table thead th {
  padding: 12px 10px !important;
  color: #4A4538 !important;
  font-weight: 700 !important;
  font-size: 11px !important;
  letter-spacing: 0.3px !important;
  border: none !important;
  background: transparent !important;
  text-align: left !important;
}
#page-purchase-orders .po-table thead th.po-col-status,
#page-purchase-orders .po-table thead th.po-col-date,
#page-purchase-orders .po-table thead th.po-col-author,
#page-purchase-orders .po-table thead th.po-col-check {
  text-align: center !important;
}
#page-purchase-orders .po-table thead th.po-col-total {
  text-align: right !important;
}
#page-purchase-orders .po-table tbody tr {
  background: #FFF !important;
  border-bottom: 1px solid #EAE4D3 !important;
  cursor: pointer !important;
  transition: background 0.12s;
}
#page-purchase-orders .po-table tbody tr:nth-child(even) {
  background: #F7F5EE !important;
}
#page-purchase-orders .po-table tbody tr:hover {
  background: #FFF7E6 !important;
}
#page-purchase-orders .po-table tbody tr.po-row-checked {
  background: #FFEFD5 !important;
}
#page-purchase-orders .po-table tbody tr.po-row-checked:hover {
  background: #FCE3B3 !important;
}
#page-purchase-orders .po-table tbody td {
  padding: 12px 10px !important;
  color: #2D2820 !important;
  border: none !important;
  vertical-align: middle !important;
  font-size: 12px !important;
}
#page-purchase-orders .po-col-no code {
  color: #854F0B !important;
  font-weight: 600 !important;
  font-size: 11px !important;
  background: none !important;
  padding: 0 !important;
  font-family: ui-monospace, Menlo, monospace !important;
}
#page-purchase-orders .po-col-partner {
  font-weight: 500 !important;
  color: #2D2820 !important;
}
#page-purchase-orders .po-col-status {
  text-align: center !important;
}
#page-purchase-orders .po-col-total {
  text-align: right !important;
  font-variant-numeric: tabular-nums !important;
  font-weight: 600 !important;
}
.po-total-num {
  color: #2D2820;
}
.po-total-unit {
  color: #888;
  font-weight: 400;
  font-size: 10px;
  margin-left: 2px;
}
#page-purchase-orders .po-col-date {
  text-align: center !important;
  color: #6B6858 !important;
  font-variant-numeric: tabular-nums !important;
}
#page-purchase-orders .po-col-author {
  text-align: center !important;
  color: #6B6858 !important;
}

/* 상태 뱃지 — 알약 모양 */
.po-status-badge {
  display: inline-block !important;
  padding: 3px 10px !important;
  border-radius: 10px !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0.2px !important;
}
.po-status-badge.po-status-draft {
  background: #FAEEDA !important;
  color: #854F0B !important;
}
.po-status-badge.po-status-sent {
  background: #E6F1FB !important;
  color: #0C447C !important;
}
.po-status-badge.po-status-received {
  background: #DCEFE3 !important;
  color: #2D7A48 !important;
}
.po-status-badge.po-status-cancelled {
  background: #EDEAE0 !important;
  color: #6B6858 !important;
}

/* ASAP 알약 */
.po-asap-pill {
  display: inline-block;
  background: #FCEBEB;
  color: #993C1D;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* 체크박스 컬럼 */
#page-purchase-orders .po-col-check {
  width: 36px !important;
  text-align: center !important;
  padding: 12px 0 !important;
}
#page-purchase-orders .po-col-check input[type="checkbox"] {
  width: 14px !important;
  height: 14px !important;
  accent-color: #854F0B !important;
  cursor: pointer !important;
}

/* ═══════════════════════════════════════════════
   발주서 플로팅 선택바 (드래그 이동)
   ═══════════════════════════════════════════════ */
.po-float-bar {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  background: #2D3328;
  color: #F7F3ED;
  padding: 10px 16px 10px 12px;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  z-index: 9500;
  user-select: none;
}
.po-float-bar b {
  color: #FCDE5A;
  font-weight: 700;
}
.po-float-handle {
  cursor: move;
  padding: 4px 6px;
  color: #A89880;
  font-size: 14px;
  border-right: 1px solid rgba(255,255,255,0.15);
  margin-right: 4px;
}
.po-float-handle:hover {
  color: #F7F3ED;
}
.po-float-btn {
  padding: 6px 12px;
  font-size: 11px;
  background: rgba(255,255,255,0.1);
  color: #F7F3ED;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
}
.po-float-btn:hover {
  background: rgba(255,255,255,0.2);
}
.po-float-btn-danger {
  border-color: #E06B6B;
  color: #FFCCCC;
}
.po-float-btn-danger:hover {
  background: rgba(224,107,107,0.25);
  color: #FFF;
}

/* ═══════════════════════════════════════════════
   입고 전표 (Receives) - 청록 테마
   ═══════════════════════════════════════════════ */
#page-receives .page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 12px;
}
#page-receives .page-title {
  font-size: 20px;
  font-weight: 700;
  color: #1F2420;
  margin: 0;
}
#page-receives .page-actions {
  display: flex;
  gap: 8px;
}
#page-receives .page-body {
  flex: 1;
  overflow: auto;
  padding: 8px 24px 24px;
}

.rc-btn {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid #D4CFC0;
  background: #FFF;
  color: #2D3328;
  cursor: pointer;
  font-family: inherit;
}
.rc-btn-ghost:hover { background: #FAEEDA; }
.rc-btn-primary {
  background: #0C7D7D;
  border-color: #0C7D7D;
  color: #FFF;
}
.rc-btn-primary:hover { background: #086868; border-color: #086868; }

/* 안내 배너 */
.rc-tip {
  background: #E6F3F3;
  border: 1px solid #B5DDDD;
  color: #0C4A4A;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.rc-tip b { color: #083838; }
.rc-tip-close {
  background: transparent;
  border: none;
  color: #0C4A4A;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
}

/* 탭 */
.rc-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 12px;
  border-bottom: 1px solid #E5E0D4;
}
.rc-tab {
  background: transparent;
  border: none;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #888680;
  cursor: pointer;
  font-family: inherit;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.rc-tab:hover { color: #2D3328; }
.rc-tab-active {
  color: #0C7D7D;
  border-bottom-color: #0C7D7D;
}
.rc-tab-count {
  font-size: 10px;
  background: #E5E0D4;
  color: #6B6858;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 700;
}
.rc-tab-active .rc-tab-count {
  background: #E6F3F3;
  color: #0C7D7D;
}

/* 툴바 */
.rc-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.rc-search-wrap {
  flex: 1;
  max-width: 360px;
}
.rc-search {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #D4CFC0;
  border-radius: 6px;
  font-size: 12px;
  background: #FFF;
  font-family: inherit;
  outline: none;
}
.rc-search:focus { border-color: #0C7D7D; }

/* 테이블 */
.rc-table-wrap {
  background: #FAFAF7;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  overflow: hidden;
  border: 1px solid #E5E0D4;
  margin-top: 4px;
}
.rc-table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
}
.rc-table thead tr {
  background: #D8EBEB;
  border-bottom: 2px solid #9AC8C8;
}
.rc-table thead th {
  padding: 12px 10px;
  color: #083838;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.3px;
  text-align: left;
}
.rc-table thead th.rc-col-check,
.rc-table thead th.rc-col-status,
.rc-table thead th.rc-col-date,
.rc-table thead th.rc-col-items,
.rc-table thead th.rc-col-author { text-align: center; }
.rc-table thead th.rc-col-total { text-align: right; }

.rc-table tbody tr {
  background: #FFF;
  border-bottom: 1px solid #EAE4D3;
  cursor: pointer;
  transition: background 0.12s;
}
.rc-table tbody tr:nth-child(even) { background: #F7F5EE; }
.rc-table tbody tr:hover { background: #E6F3F3; }
.rc-table tbody tr.rc-row-checked { background: #C5E5E5; }
.rc-table tbody tr.rc-row-checked:hover { background: #A8D5D5; }
.rc-table tbody td {
  padding: 12px 10px;
  color: #2D2820;
  font-size: 12px;
  vertical-align: middle;
}

.rc-col-check { width: 36px; text-align: center; padding: 12px 0 !important; }
.rc-col-check input[type="checkbox"] {
  width: 14px; height: 14px;
  accent-color: #0C7D7D;
  cursor: pointer;
}
.rc-col-no { width: 140px; }
.rc-col-no code {
  color: #0C7D7D;
  font-weight: 600;
  font-size: 11px;
  background: none;
  font-family: ui-monospace, Menlo, monospace;
}
.rc-col-partner { font-weight: 500; }
.rc-col-status { width: 100px; text-align: center; }
.rc-col-total { width: 120px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.rc-total-num { color: #2D2820; }
.rc-total-unit { color: #888; font-weight: 400; font-size: 10px; margin-left: 2px; }
.rc-col-date { width: 100px; text-align: center; color: #6B6858; font-variant-numeric: tabular-nums; }
.rc-col-items { width: 70px; text-align: center; color: #6B6858; }
.rc-col-author { width: 80px; text-align: center; color: #6B6858; }
.rc-muted { color: #AAA; }

/* 상태 뱃지 */
.rc-status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.rc-status-badge.rc-status-draft {
  background: #FAEEDA;
  color: #854F0B;
}
.rc-status-badge.rc-status-issued {
  background: #DCEFE3;
  color: #2D7A48;
}
.rc-status-badge.rc-status-cancelled {
  background: #EDEAE0;
  color: #6B6858;
}

/* 빈 상태 */
.rc-empty {
  padding: 60px 20px;
  text-align: center;
  color: #888;
}
.rc-empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }
.rc-empty-title { font-size: 14px; font-weight: 600; color: #6B6858; margin-bottom: 6px; }
.rc-empty-sub { font-size: 12px; color: #999; }

/* ═══════════════════════════════════════════════
   입고 전표 편집 모달
   ═══════════════════════════════════════════════ */
.rc-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 19000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.rc-detail-modal {
  background: #FFF;
  width: 820px;
  max-width: 100%;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.rc-dm-head {
  padding: 16px 20px;
  background: #FAFAF7;
  border-bottom: 1px solid #E5E0D4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.rc-dm-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  color: #1F2420;
}
.rc-dm-no {
  font-size: 11px;
  color: #0C7D7D;
  font-weight: 600;
  background: none;
  font-family: ui-monospace, Menlo, monospace;
}
.rc-dm-close {
  background: transparent;
  border: none;
  font-size: 18px;
  color: #6B6858;
  cursor: pointer;
  padding: 4px 10px;
}
.rc-dm-close:hover { color: #1F2420; }

.rc-dm-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #FAFAF7;
}
.rc-dm-foot {
  padding: 12px 20px;
  background: #FAFAF7;
  border-top: 1px solid #E5E0D4;
  flex-shrink: 0;
}
.rc-dm-foot-btns {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.rc-btn-danger {
  background: #C33;
  color: #FFF;
  border-color: #C33;
}
.rc-btn-danger:hover { background: #A22; border-color: #A22; }

/* 배너 */
.rc-dm-banner {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 16px;
  line-height: 1.5;
}
.rc-dm-banner b { font-weight: 700; }
.rc-dm-banner-info { background: #E6F3F3; color: #0C4A4A; border: 1px solid #B5DDDD; }
.rc-dm-banner-ok { background: #DCEFE3; color: #2D5128; border: 1px solid #9DCCA8; }
.rc-dm-banner-muted { background: #EDEAE0; color: #6B6858; border: 1px solid #D4CFC0; }

/* 메타 그리드 */
.rc-dm-meta-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.rc-dm-meta-block {
  background: #FFF;
  border: 1px solid #E5E0D4;
  border-radius: 8px;
  padding: 12px 14px;
}
.rc-dm-meta-label {
  font-size: 10px;
  font-weight: 700;
  color: #888680;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 6px;
}
.rc-dm-meta-main { font-size: 13px; color: #2D2820; }
.rc-dm-meta-name { font-weight: 600; }
.rc-dm-meta-sub2 { font-size: 11px; color: #888; margin-top: 2px; }
.rc-dm-meta-btn {
  margin-top: 8px;
  padding: 6px 12px;
  background: #E6F3F3;
  border: 1px solid #9AC8C8;
  color: #0C4A4A;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.rc-dm-meta-btn:hover { background: #D0E8E8; }
.rc-dm-meta-main input[type="date"] {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #D4CFC0;
  border-radius: 5px;
  font-size: 12px;
  font-family: inherit;
  background: #FFF;
  outline: none;
}

/* 품목 테이블 */
.rc-dm-items-wrap {
  background: #FFF;
  border: 1px solid #E5E0D4;
  border-radius: 8px;
  padding: 12px 16px 16px;
  margin-bottom: 16px;
}
.rc-dm-items-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.rc-dm-items-title { font-size: 13px; font-weight: 700; color: #2D2820; }
.rc-dm-items-title small { font-weight: 500; color: #888; font-size: 11px; }
.rc-dm-items-actions { display: flex; gap: 6px; }
.rc-dm-items-actions button {
  padding: 6px 10px;
  font-size: 11px;
  background: #FFF;
  border: 1px solid #D4CFC0;
  color: #2D3328;
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
}
.rc-dm-items-actions button:hover { background: #FAEEDA; border-color: #E8C48F; }
.rc-dm-items-empty {
  padding: 40px 20px;
  text-align: center;
  color: #AAA;
  font-size: 12px;
  border: 1px dashed #E5E0D4;
  border-radius: 6px;
}

.rc-items-table {
  width: 100%;
  border-collapse: collapse;
}
.rc-items-table thead th {
  padding: 10px 8px;
  font-size: 10px;
  font-weight: 700;
  color: #888680;
  text-align: left;
  border-bottom: 1px solid #E5E0D4;
  background: #FAF9F4;
}
.rc-items-table thead th.rc-item-no { text-align: center; width: 40px; }
.rc-items-table thead th.rc-item-stock,
.rc-items-table thead th.rc-item-qty,
.rc-items-table thead th.rc-item-price,
.rc-items-table thead th.rc-item-supply { text-align: right; }
.rc-items-table thead th.rc-item-del { width: 36px; }
.rc-items-table tbody td {
  padding: 10px 8px;
  border-bottom: 1px solid #F0EDE4;
  vertical-align: middle;
  font-size: 12px;
}
.rc-items-table tbody tr:last-child td { border-bottom: none; }
.rc-items-table .rc-item-no { width: 40px; text-align: center; color: #888; }
.rc-items-table .rc-item-name { text-align: left; }
.rc-items-table .rc-item-stock { width: 90px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.rc-stock-cur { color: #2D7A48; }
.rc-items-table .rc-item-qty,
.rc-items-table .rc-item-price { width: 100px; text-align: right; }
.rc-items-table .rc-item-qty input,
.rc-items-table .rc-item-price input {
  width: 72px;
  padding: 6px 10px;
  border: 1px solid #D4CFC0;
  border-radius: 4px;
  font-size: 12px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  background: #FFF;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
}
.rc-items-table .rc-item-qty input:focus,
.rc-items-table .rc-item-price input:focus { border-color: #0C7D7D; }
.rc-items-table .rc-item-supply {
  width: 120px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #2D2820;
}
.rc-items-table .rc-item-del { width: 36px; text-align: center; }
.rc-item-del-btn {
  width: 24px; height: 24px; padding: 0;
  background: transparent; border: none;
  color: #C33; cursor: pointer; border-radius: 4px;
}
.rc-item-del-btn:hover { background: #FBEAEA; }

.rc-inline-text {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  padding: 4px 6px;
  border-radius: 4px;
  color: #2D2820;
  font-family: inherit;
  box-sizing: border-box;
  outline: none;
}
.rc-inline-text:hover { border-color: #E5E0D4; }
.rc-inline-text:focus { border-color: #0C7D7D; background: #FFF; }
.rc-item-sub { font-size: 10px; color: #999; margin-top: 2px; padding-left: 8px; }

/* 합계 */
.rc-dm-summary {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #E5E0D4;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}
.rc-dm-sum-row {
  display: flex;
  gap: 20px;
  font-size: 12px;
  color: #6B6858;
  font-variant-numeric: tabular-nums;
}
.rc-dm-sum-row span:first-child { color: #888; }
.rc-dm-sum-row span:last-child { min-width: 100px; text-align: right; color: #2D2820; font-weight: 600; }
.rc-dm-sum-total { font-size: 14px; }
.rc-dm-sum-total span:last-child { color: #0C7D7D; font-weight: 700; }

/* 메모 */
.rc-dm-memo-block {
  background: #FFF;
  border: 1px solid #E5E0D4;
  border-radius: 8px;
  padding: 12px 14px;
}
.rc-dm-memo {
  width: 100%;
  min-height: 60px;
  border: 1px solid #E5E0D4;
  border-radius: 5px;
  padding: 8px 10px;
  font-size: 12px;
  font-family: inherit;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}
.rc-dm-memo:focus { border-color: #0C7D7D; }

/* ═══════════════════════════════════════════════
   제품 사양 탭 - 부자재 섬네일
   ═══════════════════════════════════════════════ */
.pd-sub-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
  background: #FAFAF7;
  border-radius: 8px;
  border: 1px solid #E5E0D4;
}
.pd-sub-thumb {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #D4CFC0;
  background: #FFF;
  cursor: pointer;
}
.pd-sub-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pd-sub-thumb-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.6);
  color: #FFF;
  font-size: 9px;
  padding: 2px 4px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pd-sub-thumb-del {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0,0,0,0.65);
  color: #FFF;
  border: none;
  font-size: 10px;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
}
.pd-sub-thumb:hover .pd-sub-thumb-del { opacity: 1; }
.pd-sub-thumb-del:hover { background: #C33; }

.pd-sub-thumb-add {
  width: 80px;
  height: 80px;
  border: 2px dashed #D4CFC0;
  border-radius: 6px;
  background: #FFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #A89880;
  transition: all 0.15s;
}
.pd-sub-thumb-add:hover {
  border-color: #854F0B;
  color: #854F0B;
  background: #FAEEDA;
}
.pd-sub-thumb-add span {
  font-size: 24px;
  font-weight: 300;
}

.rc-dm-banner-link {
  background: #F0EEFF;
  color: #3D2B82;
  border: 1px solid #C7BEFF;
}
.rc-dm-banner-link b { color: #1F0E66; font-family: ui-monospace, Menlo, monospace; }
