/* ============================================
   견적서 (Quotations) — qt- prefixed
   mia quotation.html + quotation-single.html 기준
   ============================================ */

/* --- Layout --- */
.qt-layout {
  display: flex;
  gap: 0;
  height: 100%;
  min-height: 0;
}

.qt-left-panel {
  width: 340px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--tint, #CDD0D9);
  background: #fff;
  overflow: hidden;
}

.qt-right-panel {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 1.5rem;
  background: var(--background, #F5F6F8);
}

/* --- 검색 + 추가 --- */
.qt-search-wrap {
  display: flex;
  gap: 0.5rem;
  padding: 1rem;
  border-bottom: 1px solid var(--tint, #CDD0D9);
}

.qt-search-wrap input {
  flex: 1;
  border: 1px solid var(--tint, #CDD0D9);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--brand, #2C3344);
  outline: none;
  transition: border-color 0.2s;
}

.qt-search-wrap input:focus {
  border-color: #3B82F6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.qt-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #3B82F6;
  color: #fff;
  text-decoration: none;
  transition: background 0.2s;
}

.qt-add-btn:hover {
  background: #1E40AF;
}

/* --- 상태 탭 --- */
.qt-status-tabs {
  display: flex;
  border-bottom: 1px solid var(--tint, #CDD0D9);
  flex-shrink: 0;
}

.qt-status-tab {
  flex: 1;
  padding: 0.625rem 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--light, #9CA1B4);
  background: transparent;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.qt-status-tab:hover {
  color: var(--secondary, #3B4256);
}

.qt-status-tab.active {
  color: var(--secondary, #3B4256);
  border-bottom-color: var(--secondary, #3B4256);
}

/* --- 목록 --- */
.qt-list {
  flex: 1;
  overflow-y: auto;
}

.qt-list-item {
  display: block;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--bg-light, #ECEDF1);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
  cursor: pointer;
}

.qt-list-item:hover {
  background: var(--bg-light, #ECEDF1);
}

.qt-list-item.selected {
  background: rgba(59, 130, 246, 0.06);
  border-left: 3px solid #3B82F6;
}

.qt-list-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.qt-list-number {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--brand, #2C3344);
}

.qt-list-date {
  font-size: 0.75rem;
  color: var(--light, #9CA1B4);
}

.qt-list-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.qt-list-partner {
  font-size: 0.8125rem;
  color: var(--tertiary, #6B7285);
}

.qt-list-amount {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--brand, #2C3344);
}

.qt-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--light, #9CA1B4);
  font-size: 0.875rem;
}

/* --- 뱃지 --- */
.qt-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.6875rem;
  font-weight: 600;
}

.qt-badge-draft { background: rgba(107, 114, 133, 0.1); color: #6B7285; }
.qt-badge-confirmed { background: rgba(34, 197, 94, 0.1); color: #15803D; }
.qt-badge-sent { background: rgba(249, 158, 11, 0.1); color: #B45309; }
.qt-badge-cancelled { background: rgba(239, 68, 68, 0.08); color: #DC2626; }

/* --- show (single) 레이아웃 --- */
.qts-layout {
  display: flex;
  gap: 1.5rem;
  height: 100%;
  min-height: 0;
}

.qts-left-col {
  flex: 3;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.qts-right-col {
  flex: 7;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.qts-panel {
  background: #fff;
  border: 1px solid var(--tint, #CDD0D9);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.qts-right-panel {
  overflow-y: auto;
  padding: 1.5rem;
}

/* --- 탭 헤더 --- */
.qts-tab-header {
  display: flex;
  border-bottom: 1px solid var(--tint, #CDD0D9);
  flex-shrink: 0;
}

.qts-tab {
  flex: 1;
  padding: 10px 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--light, #9CA1B4);
  border: none;
  background: transparent;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-family: inherit;
}

.qts-tab.active {
  color: var(--secondary, #3B4256);
  border-bottom-color: var(--secondary, #3B4256);
}

/* --- 탭 패널 --- */
.qts-tab-pane {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}

.qts-tab-pane.active {
  display: flex;
  flex-direction: column;
}

/* --- 정보 영역 --- */
.qts-info-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 16px;
}

.qts-info-item {
  flex: 1;
}

.qts-label {
  display: block;
  font-size: 0.75rem;
  color: var(--light, #9CA1B4);
  font-weight: 500;
}

.qts-value {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--brand, #2C3344);
}

.qts-section-title {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--light, #9CA1B4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--tint, #CDD0D9);
}

/* --- 폼 --- */
.qts-form-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.qts-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
}

.qts-form-label {
  font-size: 0.75rem;
  color: var(--tertiary, #6B7285);
  font-weight: 600;
}

.qts-form-label i {
  width: 14px;
  margin-right: 4px;
  color: var(--light, #9CA1B4);
}

.qts-form-value {
  font-size: 0.9375rem;
  color: var(--brand, #2C3344);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.qts-form-text {
  font-size: 0.875rem;
  color: var(--brand, #2C3344);
}

.qts-form-control {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--tint, #CDD0D9);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--brand, #2C3344);
  background: #fff;
  outline: none;
  transition: border-color 0.2s;
  height: 36px;
  line-height: 1.2;
}

select.qts-form-control {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%239CA1B4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.qts-form-control:focus {
  border-color: #3B82F6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.qts-row {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
}

.qts-flex-1 { flex: 1; min-width: 0; }
.qts-flex-3 { flex: 3; min-width: 0; }
.qts-flex-7 { flex: 7; min-width: 0; }

.qts-grade-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --- 버튼 --- */
.qts-btn-area {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 1.25rem;
}

.qts-btn-row {
  display: flex;
  gap: 0.5rem;
}

.qts-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  outline: none;
  text-decoration: none;
  font-family: inherit;
}

.qts-btn-primary {
  background: #3B82F6;
  color: #fff;
}

.qts-btn-primary:hover {
  background: #1E40AF;
}

.qts-btn-secondary {
  background: #fff;
  color: var(--tertiary, #6B7285);
  border: 1px solid var(--tint, #CDD0D9);
}

.qts-btn-secondary:hover {
  background: var(--bg-light, #ECEDF1);
  color: var(--brand, #2C3344);
}

.qts-btn-danger {
  background: rgba(239, 68, 68, 0.08);
  color: #DC2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.qts-btn-danger:hover {
  background: rgba(239, 68, 68, 0.15);
}

.qts-btn-full { width: 100%; }
.qts-btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.qts-btn-convert { border-color: #3B82F6; color: #3B82F6; }
.qts-btn-convert:hover { background: rgba(59, 130, 246, 0.06); }

/* --- 라인 테이블 --- */
.qts-panel-tab {
  display: inline-block;
  padding: 8px 20px;
  border: 1px solid var(--tint, #CDD0D9);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--tertiary, #6B7285);
}

.qts-mt { margin-top: 1.5rem; }

.qts-panel-body {
  border-top: 1px solid var(--tint, #CDD0D9);
  padding-top: 1rem;
}

.qts-table {
  width: 100%;
  font-size: 0.875rem;
  border-collapse: collapse;
}

.qts-table thead {
  background: var(--background, #F5F6F8);
}

.qts-table th {
  padding: 0.625rem 0.75rem;
  text-align: left;
  font-weight: 600;
  color: var(--tertiary, #6B7285);
  font-size: 0.8125rem;
  border-bottom: 2px solid var(--tint, #CDD0D9);
}

.qts-table td {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--bg-light, #ECEDF1);
  color: var(--brand, #2C3344);
  vertical-align: middle;
}

.qts-table tbody tr:hover {
  background: var(--bg-light, #ECEDF1);
}

.qts-table input[type="text"],
.qts-table input[type="number"] {
  border: 1px solid var(--tint, #CDD0D9);
  border-radius: 6px;
  padding: 0.375rem 0.5rem;
  font-size: 0.8125rem;
  width: 100%;
  box-sizing: border-box;
  color: var(--brand, #2C3344);
  background: #fff;
  font-family: inherit;
  height: 30px;
}

.qts-table input[type="text"]:focus,
.qts-table input[type="number"]:focus {
  outline: none;
  border-color: #3B82F6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.08);
}

.qt-row-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #3B82F6;
}

.qt-text-center { text-align: center; }
.qt-text-right { text-align: right; }
.qt-text-muted { color: var(--light, #9CA1B4); }
.qt-fw-600 { font-weight: 600; }
.qt-fw-700 { font-weight: 700; }

/* column widths */
.qts-th-check { width: 40px; }
.qts-th-no { width: 50px; }
.qts-th-product { width: 150px; }
.qts-th-dim { width: 90px; }
.qts-th-finish { width: 100px; }
.qts-th-option { width: 140px; }
.qts-th-qty { width: 60px; }
.qts-th-price { width: 100px; }
.qts-th-amount { width: 110px; }

/* --- 라인 액션 --- */
.qts-line-actions {
  display: flex;
  gap: 0.5rem;
  padding-top: 1rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--bg-light, #ECEDF1);
}

/* --- 테이블 푸터 (합계) --- */
.qts-table-footer {
  display: flex;
  justify-content: flex-end;
  gap: 2rem;
  padding-top: 1rem;
  margin-top: 0.75rem;
  border-top: 2px solid var(--tint, #CDD0D9);
}

.qts-footer-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qts-footer-label {
  font-size: 0.8125rem;
  color: var(--tertiary, #6B7285);
  font-weight: 500;
}

.qts-footer-value {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--brand, #2C3344);
}

.qts-total {
  font-size: 1.125rem;
  font-weight: 800;
  color: #1E40AF;
}

/* --- 단가 상세 (7-step) --- */
.qts-detail-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.qts-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0;
}

.qts-detail-label {
  font-size: 0.8125rem;
  color: var(--tertiary, #6B7285);
  white-space: nowrap;
}

.qts-detail-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand, #2C3344);
  text-align: right;
  white-space: nowrap;
}

.qts-separator {
  border-top: 1px solid var(--tint, #CDD0D9);
  margin-top: 0.375rem;
  padding-top: 0.625rem;
}

.qts-final-label {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--brand, #2C3344);
}

.qts-final-value {
  font-size: 0.875rem;
  font-weight: 800;
  color: #E94B3C;
}

/* --- 타임라인 --- */
.qt-timeline {
  position: relative;
  padding-left: 24px;
}

.qt-timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--tint, #CDD0D9);
}

.qt-timeline-item {
  position: relative;
  padding-bottom: 1.25rem;
}

.qt-timeline-item:last-child {
  padding-bottom: 0;
}

.qt-timeline-dot {
  position: absolute;
  left: -24px;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-light, #ECEDF1);
  border: 2px solid var(--tint, #CDD0D9);
}

.qt-timeline-dot.active {
  background: #3B82F6;
  border-color: #3B82F6;
}

.qt-timeline-dot.completed {
  background: #22C55E;
  border-color: #22C55E;
}

.qt-timeline-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.qt-timeline-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand, #2C3344);
}

.qt-timeline-sub {
  font-size: 0.75rem;
  color: var(--light, #9CA1B4);
  margin-top: 2px;
}

.qt-timeline-date {
  font-size: 0.75rem;
  color: var(--light, #9CA1B4);
  flex-shrink: 0;
}

/* --- 거래처 모달 --- */
.qt-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
}

.qt-modal-overlay.active {
  display: flex;
}

.qt-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.qt-modal-container {
  position: relative;
  background: #fff;
  border-radius: 16px;
  width: 600px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
}

.qt-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--tint, #CDD0D9);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.qt-modal-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--brand, #2C3344);
}

.qt-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--light, #9CA1B4);
  font-size: 1.25rem;
  transition: color 0.2s;
}

.qt-modal-close:hover {
  color: var(--brand, #2C3344);
}

.qt-modal-search {
  padding: 16px 24px;
  border-bottom: 1px solid var(--bg-light, #ECEDF1);
}

.qt-modal-search-input {
  width: 100%;
  border: 1px solid var(--tint, #CDD0D9);
  border-radius: 8px;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  color: var(--brand, #2C3344);
  background: var(--background, #F5F6F8);
  outline: none;
}

.qt-modal-search-input:focus {
  border-color: #3B82F6;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.qt-modal-body {
  overflow-y: auto;
  flex: 1;
}

.qt-partner-row {
  display: flex;
  align-items: center;
  padding: 12px 24px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--bg-light, #ECEDF1);
  gap: 12px;
}

.qt-partner-row:hover {
  background: rgba(59, 130, 246, 0.04);
}

.qt-partner-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-light, #ECEDF1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tertiary, #6B7285);
  font-size: 0.875rem;
  flex-shrink: 0;
}

.qt-partner-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand, #2C3344);
}

.qt-partner-meta {
  font-size: 0.75rem;
  color: var(--light, #9CA1B4);
  margin-top: 2px;
}

/* --- 등급 뱃지 --- */
.qt-grade-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 0.625rem;
  font-weight: 700;
}

.qt-grade-A { background: rgba(34, 197, 94, 0.12); color: #15803D; }
.qt-grade-B { background: rgba(249, 158, 11, 0.12); color: #B45309; }
.qt-grade-C { background: rgba(239, 68, 68, 0.1); color: #DC2626; }
.qt-grade-D { background: rgba(107, 114, 133, 0.12); color: #6B7285; }

/* --- 거래처 select 래퍼 (select + 검색 아이콘) --- */
.qt-partner-select-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qt-partner-select-wrap .qts-form-control {
  flex: 1;
}

.qt-partner-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--tint, #CDD0D9);
  background: #fff;
  color: var(--tertiary, #6B7285);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}

.qt-partner-search-btn:hover {
  background: var(--bg-light, #ECEDF1);
  color: var(--brand, #2C3344);
}

/* --- 모달 섹션 레이블 --- */
.qt-modal-section-label {
  padding: 8px 24px 4px;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--light, #9CA1B4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--background, #F5F6F8);
}

/* --- 모달 링크 --- */
.qt-modal-link {
  color: #3B82F6;
  text-decoration: none;
  font-weight: 600;
}

.qt-modal-link:hover {
  text-decoration: underline;
}

/* --- 모달 푸터 --- */
.qt-modal-footer {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding: 1rem 1.5rem 1.25rem;
  border-top: 1px solid var(--tint, #CDD0D9);
}

/* --- 편집 잠금 배너 --- */
.qt-edit-lock-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1.25rem;
  background: rgba(249, 158, 11, 0.08);
  border-bottom: 1px solid rgba(249, 158, 11, 0.25);
  font-size: 0.875rem;
  color: var(--brand, #2C3344);
}

.qt-lock-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(249, 158, 11, 0.2);
  color: #B45309;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.qt-lock-readonly {
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  background: rgba(249, 158, 11, 0.15);
  color: #B45309;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: auto;
}

.qt-lock-request-btn {
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(249, 158, 11, 0.4);
  background: #fff;
  color: #B45309;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.qt-lock-request-btn:hover {
  background: rgba(249, 158, 11, 0.08);
}

/* --- 단가 상세 2-column 그리드 --- */
.qt-pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 2rem;
  background: var(--bg-light, #ECEDF1);
  border-radius: 8px;
  padding: 1rem;
}

.qt-pricing-col {
  min-width: 0;
}

.qt-pricing-col-title {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--light, #9CA1B4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--tint, #CDD0D9);
}

/* --- 라인 번호 표시 --- */
.qt-line-no {
  font-size: 0.8125rem;
  color: var(--light, #9CA1B4);
}

/* --- 치수/마감재 입력 (라인 테이블 내) --- */
.qt-dim-input {
  border: 1px solid var(--tint, #CDD0D9);
  border-radius: 6px;
  padding: 0.375rem 0.5rem;
  font-size: 0.8125rem;
  color: var(--brand, #2C3344);
  background: #fff;
}

.qt-dim-input:focus {
  outline: none;
  border-color: #3B82F6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.08);
}

/* ============================================
   견적서 목록 상단 헤더바 (quotation.html 기준)
   ============================================ */

.qt-header-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  background: #fff;
  border-radius: 12px;
  padding: 1rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-bottom: 1rem;
  border: 1px solid var(--tint, #CDD0D9);
}

.qt-header-bar-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.qt-header-bar-label {
  font-size: 0.75rem;
  color: var(--light, #9CA1B4);
  font-weight: 500;
}

.qt-header-bar-value {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--brand, #2C3344);
}

/* --- 등급 뱃지 (헤더바용 amber) --- */
.qt-badge-grade {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.6875rem;
  font-weight: 600;
  background: rgba(249, 158, 11, 0.12);
  color: #B45309;
}

/* --- 폼 그리드 (qt prefix — 목록/생성 폼) --- */
.qt-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.qt-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.qt-form-label {
  font-size: 0.75rem;
  color: var(--tertiary, #6B7285);
  font-weight: 600;
}

.qt-form-label i {
  width: 14px;
  margin-right: 4px;
}

.qt-form-value {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--brand, #2C3344);
}

.qt-form-control {
  border: 1px solid var(--tint, #CDD0D9);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--brand, #2C3344);
  background: #fff;
  outline: none;
  width: 100%;
  transition: border-color 0.2s;
  font-family: inherit;
}

.qt-form-control:focus {
  border-color: #3B82F6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.qt-search-icon {
  cursor: pointer;
  color: var(--tertiary, #6B7285);
  transition: color 0.2s;
}

.qt-search-icon:hover {
  color: #3B82F6;
}

/* --- 라인 테이블 (qt prefix — 목록 인라인 편집) --- */
.qt-table-wrapper {
  overflow-x: auto;
}

.qt-ls-base {
  width: 100%;
  font-size: 0.875rem;
  border-collapse: collapse;
}

.qt-ls-base thead {
  background: var(--background, #F5F6F8);
}

.qt-ls-base th {
  padding: 0.625rem 0.75rem;
  text-align: left;
  font-weight: 600;
  color: var(--tertiary, #6B7285);
  font-size: 0.8125rem;
  border-bottom: 2px solid var(--tint, #CDD0D9);
}

.qt-ls-base td {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--bg-light, #ECEDF1);
  color: var(--brand, #2C3344);
  vertical-align: middle;
}

.qt-ls-base tbody tr:hover {
  background: var(--bg-light, #ECEDF1);
}

.qt-ls-2 td input[type="text"] {
  border: 1px solid var(--tint, #CDD0D9);
  border-radius: 6px;
  padding: 0.375rem 0.5rem;
  font-size: 0.8125rem;
  width: 100%;
  color: var(--brand, #2C3344);
  background: #fff;
  outline: none;
  font-family: inherit;
}

.qt-ls-2 td input[type="text"]:focus {
  border-color: #3B82F6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.08);
}

/* --- 라인 액션 (qt prefix) --- */
.qt-line-actions {
  display: flex;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--bg-light, #ECEDF1);
}

/* --- 버튼 (qt prefix — 공통) --- */
.qt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  outline: none;
  text-decoration: none;
  font-family: inherit;
}

.qt-btn-primary {
  background: #3B82F6;
  color: #fff;
}

.qt-btn-primary:hover {
  background: #1E40AF;
}

.qt-btn-secondary {
  background: #fff;
  color: var(--tertiary, #6B7285);
  border: 1px solid var(--tint, #CDD0D9);
}

.qt-btn-secondary:hover {
  background: var(--bg-light, #ECEDF1);
  color: var(--brand, #2C3344);
}

.qt-btn-danger {
  background: rgba(239, 68, 68, 0.08);
  color: #DC2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.qt-btn-danger:hover {
  background: rgba(239, 68, 68, 0.15);
}

.qt-btn-small {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

/* --- 테이블 푸터 (qt prefix — 합계 영역) --- */
.qt-table-footer {
  display: flex;
  justify-content: flex-end;
  gap: 2rem;
  padding-top: 1rem;
  margin-top: 0.75rem;
  border-top: 2px solid var(--tint, #CDD0D9);
}

.qt-table-footer-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qt-table-footer-label {
  font-size: 0.8125rem;
  color: var(--tertiary, #6B7285);
  font-weight: 500;
}

.qt-table-footer-value {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--brand, #2C3344);
}

.qt-table-footer-value.qt-total {
  font-size: 1.125rem;
  font-weight: 800;
  color: #1E40AF;
}

/* --- 단가 상세 rows (qt prefix) --- */
.qt-detail-rows {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.qt-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.375rem 0;
}

.qt-detail-row-label {
  font-size: 0.8125rem;
  color: var(--tertiary, #6B7285);
}

.qt-detail-row-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand, #2C3344);
}

.qt-detail-row-separator {
  border-top: 1px solid var(--tint, #CDD0D9);
  margin-top: 0.375rem;
  padding-top: 0.625rem;
}

/* --- 견적서 복사 버튼 --- */
.qt-copy-quote {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--tertiary, #6B7285);
  background: white;
  border: 1px solid var(--tint, #CDD0D9);
  cursor: pointer;
  transition: all 0.2s;
}

.qt-copy-quote:hover {
  background: var(--bg-light, #ECEDF1);
  color: var(--brand, #2C3344);
  border-color: var(--light, #9CA1B4);
}

/* --- 토스트 알림 --- */
.qt-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--brand, #2C3344);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 60;
  animation: qt-slideIn 0.3s ease;
}

@keyframes qt-slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

.qt-toast-success {
  background: #22C55E;
}

/* --- 충돌 모달 --- */
.qt-conflict-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
}

.qt-conflict-modal-overlay.active {
  display: flex;
}

.qt-conflict-modal {
  background: white;
  border-radius: 16px;
  width: 480px;
  max-width: 95vw;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.qt-conflict-modal-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--tint, #CDD0D9);
}

.qt-conflict-modal-header i {
  color: #F59E0B;
  font-size: 1.25rem;
}

.qt-conflict-modal-header span {
  font-weight: 700;
  font-size: 1rem;
  color: var(--brand, #2C3344);
}

.qt-conflict-modal-body {
  padding: 1.25rem 1.5rem;
}

.qt-conflict-modal-footer {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--bg-light, #ECEDF1);
  justify-content: flex-end;
}

/* --- 모달 헤더 세부 --- */
.qt-modal-header-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--brand, #2C3344);
}

.qt-modal-header-sub {
  font-size: 0.8125rem;
  color: var(--light, #9CA1B4);
  margin-top: 2px;
}

.qt-modal-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--light, #9CA1B4);
  font-size: 1.25rem;
  transition: color 0.2s;
  font-family: inherit;
}

.qt-modal-close-btn:hover {
  color: var(--brand, #2C3344);
}

/* --- 모달 검색박스 --- */
.qt-modal-search-box {
  padding: 16px 24px;
  border-bottom: 1px solid var(--bg-light, #ECEDF1);
}

.qt-modal-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

/* --- 거래처 섹션 레이블 --- */
.qt-partner-section-label {
  padding: 8px 24px 6px;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--light, #9CA1B4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--background, #F5F6F8);
  border-bottom: 1px solid var(--bg-light, #ECEDF1);
}

/* --- 거래처 행 세부 --- */
.qt-partner-row-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-light, #ECEDF1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tertiary, #6B7285);
  font-size: 0.875rem;
  flex-shrink: 0;
}

.qt-partner-row-info {
  flex: 1;
  min-width: 0;
}

.qt-partner-row-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand, #2C3344);
}

.qt-partner-row-meta {
  font-size: 0.75rem;
  color: var(--light, #9CA1B4);
  margin-top: 2px;
}

.qt-partner-row-phone {
  font-size: 0.75rem;
  color: var(--tertiary, #6B7285);
  flex-shrink: 0;
}

/* --- 거래처 빈 상태 --- */
.qt-partner-empty {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--light, #9CA1B4);
  font-size: 0.875rem;
}

.qt-partner-empty-link {
  color: #3B82F6;
  text-decoration: none;
  font-weight: 600;
}

.qt-partner-empty-link:hover {
  text-decoration: underline;
}
