/* ==========================================================================
   물류 단가표 (Logistics Unit Prices) ECOUNT ERP 고밀도 스타일시트
   사내 입출고 / 실시간 재고 모듈 완벽 동기화 테마
   ========================================================================== */

:root {
    --erp-primary: #2563eb;
    --erp-primary-hover: #1d4ed8;
    --erp-primary-light: #eff6ff;
    --erp-success: #10b981;
    --erp-warning: #f59e0b;
    --erp-danger: #ef4444;
    --erp-dark: #1e293b;
    --erp-header-bg: #1e293b;
    --erp-th-bg: #f8fafc;
    --erp-border: #cbd5e1;
    --erp-border-light: #e2e8f0;
    --erp-text: #1e293b;
    --erp-text-muted: #64748b;
    --erp-row-hover: #f1f5f9;
    --erp-row-active: #eff6ff;
    --erp-row-height: 26px;
    --erp-font-size: 11.5px;
}

/* 기본 레이아웃 */
body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans KR', sans-serif;
    background-color: #f8fafc;
    color: var(--erp-text);
    margin: 0;
    padding: 6px 10px;
    font-size: var(--erp-font-size);
    line-height: 1.35;
    -webkit-font-smoothing: antialiased;
}

/* ── 1. ECOUNT ERP 1행 탑 툴바 (.erp-top-toolbar) ── */
.erp-top-toolbar {
    background: #ffffff;
    border: 1px solid var(--erp-border);
    border-radius: 2px;
    padding: 4px 8px;
    min-height: 34px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.erp-title-tag {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding-right: 10px;
    border-right: 1px solid var(--erp-border-light);
    letter-spacing: -0.3px;
}

/* 실시간 통계 뱃지 */
.erp-badge-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.erp-stat-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    line-height: 1.3;
}

.erp-stat-badge.badge-dark {
    background: #1e293b;
    color: #ffffff;
}

.erp-stat-badge.badge-blue {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.erp-stat-badge.badge-green {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

/* 탭 버튼 그룹 (자재분류 퀵 필터) */
.erp-tab-group {
    display: inline-flex;
    gap: 2px;
    background: #f1f5f9;
    padding: 2px;
    border-radius: 2px;
}

.erp-tab-btn {
    padding: 2px 9px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: 2px;
    background: transparent;
    color: var(--erp-text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 18px;
    user-select: none;
}

.erp-tab-btn:hover {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.7);
}

.erp-tab-btn.active {
    background: #ffffff !important;
    color: var(--erp-primary) !important;
    border-color: var(--erp-border) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* ── 2. ECOUNT ERP 2행 필터 리본 (.erp-filter-ribbon) ── */
.erp-filter-ribbon {
    background: #ffffff;
    border: 1px solid var(--erp-border);
    border-radius: 2px;
    padding: 4px 8px;
    min-height: 34px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.erp-select-target {
    width: 110px !important;
    height: 26px !important;
    font-size: 11.5px !important;
    padding: 1px 20px 1px 6px !important;
    border: 1px solid var(--erp-border) !important;
    border-radius: 2px !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
    cursor: pointer;
}

.erp-search-box {
    width: 240px;
    position: relative;
}

.erp-search-box .form-control {
    height: 26px !important;
    font-size: 11.5px !important;
    padding-left: 7px;
    padding-right: 22px;
    border-radius: 2px;
    border: 1px solid var(--erp-border);
}

.erp-search-box .form-control:focus {
    border-color: var(--erp-primary);
    box-shadow: 0 0 0 1.5px rgba(37, 99, 235, 0.2);
}

.erp-subsearch-group {
    width: 170px;
}

.erp-subsearch-group .input-group-text {
    height: 24px;
    font-size: 11px;
    padding: 0 5px;
    background: #f8fafc;
    border-color: var(--erp-border);
}

.erp-subsearch-group .form-control {
    height: 24px !important;
    font-size: 11.5px !important;
    padding: 1px 6px;
    border-color: var(--erp-border);
}

/* ── 3. ECOUNT ERP 버튼 시스템 ── */
.btn-erp {
    height: 26px;
    font-size: 11.5px;
    font-weight: 600;
    padding: 0 9px;
    border-radius: 2px;
    background: #ffffff;
    border: 1px solid var(--erp-border);
    color: #334155;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.1s ease;
    white-space: nowrap;
    text-decoration: none;
    user-select: none;
}

.btn-erp:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

.btn-erp-primary {
    background: var(--erp-primary);
    border-color: var(--erp-primary);
    color: #ffffff;
}

.btn-erp-primary:hover {
    background: var(--erp-primary-hover);
    border-color: var(--erp-primary-hover);
    color: #ffffff;
}

.btn-erp-success {
    background: #10b981;
    border-color: #059669;
    color: #ffffff;
}

.btn-erp-success:hover {
    background: #059669;
    border-color: #047857;
    color: #ffffff;
}

.erp-tool-btn {
    height: 24px;
    font-size: 11px;
    font-weight: 600;
    padding: 0 8px;
    border-radius: 2px;
    background: #ffffff;
    border: 1px solid var(--erp-border-light);
    color: #334155;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    transition: all 0.1s ease;
    white-space: nowrap;
}

.erp-tool-btn:hover {
    background: #f1f5f9;
    border-color: var(--erp-border);
    color: #0f172a;
}

/* ── 4. ERP 고밀도 시트 그리드 (.erp-sheet-table) ── */
.erp-grid-wrapper {
    background: #ffffff;
    border: 1px solid var(--erp-border);
    border-radius: 2px;
    overflow-x: auto;
    overflow-y: auto;
    min-height: 240px;
    max-height: calc(100vh - 120px);
    box-sizing: border-box;
    position: relative;
}

.erp-sheet-table {
    width: 100%;
    max-width: none;
    border-collapse: collapse !important;
    font-size: 11.5px;
    table-layout: fixed !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    border: 1px solid var(--erp-border) !important;
    background-color: #ffffff !important;
}

/* Sticky 헤더 */
.erp-sheet-table thead th {
    background-color: var(--erp-th-bg) !important;
    background-clip: padding-box !important;
    color: #1e293b !important;
    font-weight: 700 !important;
    text-align: center !important;
    vertical-align: middle !important;
    padding: 2px 4px !important;
    font-size: 11px !important;
    border: 1px solid var(--erp-border) !important;
    white-space: nowrap !important;
    position: sticky !important;
    top: 0;
    z-index: 6;
    height: 26px !important;
    line-height: 1.2 !important;
    box-sizing: border-box !important;
    user-select: none;
    overflow: visible !important;
}

/* 정렬 가능한 헤더 */
.erp-sheet-table thead th.sortable {
    cursor: pointer !important;
    transition: background-color 0.12s ease, color 0.12s ease;
}
.erp-sheet-table thead th.sortable:hover {
    background-color: #e2e8f0 !important;
    color: var(--erp-primary) !important;
}
.erp-sheet-table thead th.sorted-th {
    background-color: #eff6ff !important;
    color: var(--erp-primary) !important;
    border-bottom: 2px solid var(--erp-primary) !important;
}
.sort-icon {
    font-size: 12px;
    vertical-align: middle;
    color: #94a3b8;
    transition: color 0.12s ease, transform 0.12s ease;
}
.erp-sheet-table thead th.sortable:hover .sort-icon {
    color: var(--erp-primary);
}
.sort-icon.active {
    color: var(--erp-primary) !important;
    font-weight: 700;
}

/* 헤더 열 너비 및 정렬 규격 */
.th-no          { width: 54px !important; }
.th-category    { width: 80px !important; }
.th-item        { min-width: 200px !important; }
.th-spec        { width: 130px !important; }
.th-unit        { width: 50px !important; }
.th-buy-price   { width: 100px !important; }
.th-sell-price  { width: 100px !important; }
.th-margin-amt  { width: 90px !important; }
.th-margin-rate { width: 75px !important; }
.th-supplier    { width: 115px !important; }
.th-destination { width: 115px !important; }
.th-history     { width: 70px !important; }
.th-action      { width: 55px !important; }

/* 본문 행 및 셀 */
.erp-sheet-table tbody td {
    padding: 1px 6px !important;
    border: 1px solid var(--erp-border) !important;
    vertical-align: middle !important;
    background-color: #ffffff;
    background-clip: padding-box !important;
    height: 26px !important;
    box-sizing: border-box !important;
    font-size: 11.5px;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.erp-sheet-table tbody tr {
    transition: background-color 0.1s ease;
}

.erp-sheet-table tbody tr:hover td {
    background-color: var(--erp-row-hover) !important;
}

.erp-sheet-table tbody tr:nth-child(even) td {
    background-color: #fafbfc;
}
.erp-sheet-table tbody tr:nth-child(even):hover td {
    background-color: var(--erp-row-hover) !important;
}

.erp-sheet-table tbody tr.selected-row td {
    background-color: #eff6ff !important;
}
.erp-sheet-table tbody tr.selected-row:hover td {
    background-color: #dbeafe !important;
}

/* ── 키보드 포커스 행 (.focused-row) - ECOUNT ERP 표준 스타일 ── */
.erp-sheet-table tbody tr.focused-row td {
    background-color: #e0f2fe !important;
    border-top: 1px solid #0284c7 !important;
    border-bottom: 1px solid #0284c7 !important;
}
.erp-sheet-table tbody tr.focused-row td:first-child {
    border-left: 3px solid #0284c7 !important;
}
.erp-sheet-table tbody tr.focused-row td:last-child {
    border-right: 1px solid #0284c7 !important;
}

/* 포커스된 행이 선택(체크)도 되어 있을 때 */
.erp-sheet-table tbody tr.focused-row.selected-row td {
    background-color: #bae6fd !important;
    border-top: 1px solid #0284c7 !important;
    border-bottom: 1px solid #0284c7 !important;
}
.erp-sheet-table tbody tr.focused-row.selected-row td:first-child {
    border-left: 3px solid #0284c7 !important;
}
.erp-sheet-table tbody tr.focused-row.selected-row td:last-child {
    border-right: 1px solid #0284c7 !important;
}

.row-index {
    text-align: center !important;
    color: var(--erp-text-muted) !important;
    background-color: #f8fafc !important;
    font-weight: 600 !important;
    padding: 1px 2px !important;
}
.row-index .form-check-input,
.th-no .form-check-input {
    width: 13px !important;
    height: 13px !important;
    margin: 0 !important;
    cursor: pointer;
}
.row-index .row-num {
    font-size: 10.5px;
    color: var(--erp-text-muted);
}

.btn-erp.btn-del {
    color: #dc2626 !important;
    border-color: #fca5a5 !important;
    background-color: #fef2f2 !important;
}
.btn-erp.btn-del:hover {
    background-color: #fee2e2 !important;
    border-color: #ef4444 !important;
    color: #b91c1c !important;
}

/* 숫자 셀 (tabular-nums 고정폭 숫자) */
.td-num {
    text-align: right !important;
    font-variant-numeric: tabular-nums !important;
}

.td-buy {
    text-align: right !important;
    font-variant-numeric: tabular-nums !important;
    font-weight: 600 !important;
    color: #334155 !important;
}

.td-sell {
    text-align: right !important;
    font-variant-numeric: tabular-nums !important;
    font-weight: 700 !important;
    color: var(--erp-primary) !important;
}

.td-margin-amt {
    text-align: right !important;
    font-variant-numeric: tabular-nums !important;
    font-weight: 600;
}

/* 자재분류 뱃지 */
.category-pill {
    display: inline-block;
    padding: 1px 6px;
    font-size: 10.5px;
    font-weight: 600;
    border-radius: 3px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

/* 마진 배지 */
.margin-badge {
    font-size: 10.5px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    display: inline-block;
    line-height: 14px;
    font-variant-numeric: tabular-nums;
}
.margin-high {
    background-color: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}
.margin-mid {
    background-color: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}
.margin-low {
    background-color: #fef9c3;
    color: #a16207;
    border: 1px solid #fef08a;
}
.margin-loss {
    background-color: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* 히스토리 버튼 */
.btn-hist {
    font-size: 10.5px;
    font-weight: 600;
    padding: 1px 6px;
    height: 20px;
    line-height: 16px;
    border-radius: 2px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    transition: all 0.1s ease;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.btn-hist:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

/* 액션 버튼 */
.btn-table-action {
    padding: 2px 4px;
    font-size: 12px;
    line-height: 1;
    border: none;
    background: transparent;
    color: #64748b;
    border-radius: 2px;
    cursor: pointer;
    transition: color 0.1s ease, background-color 0.1s ease;
}
.btn-table-action:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}
.btn-table-action.btn-del:hover {
    background-color: #fee2e2;
    color: #ef4444;
}

/* ── 5. 하단 합계 요약 바 (tfoot) ── */
.erp-sheet-table tfoot td {
    padding: 3px 6px !important;
    background-color: #f8fafc !important;
    background-clip: padding-box !important;
    border: 1px solid var(--erp-border) !important;
    font-size: 11.5px;
    font-weight: 700;
    vertical-align: middle !important;
    height: 26px !important;
    color: #0f172a;
    position: sticky;
    bottom: 0;
    z-index: 5;
}

/* 자동완성 드롭다운 */
.autocomplete-suggestions { 
    border: 1px solid #cbd5e1; 
    max-height: 220px; 
    overflow-y: auto; 
    position: absolute; 
    top: 100%; 
    left: 0; 
    z-index: 1090; 
    background: #ffffff; 
    width: 100%; 
    border-radius: 2px; 
    display: none; 
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08); 
}
.autocomplete-suggestion { 
    padding: 5px 8px; 
    cursor: pointer; 
    font-size: 11.5px; 
    color: #1e293b; 
    border-bottom: 1px solid #f1f5f9; 
    transition: background 0.1s ease; 
}
.autocomplete-suggestion:hover,
.autocomplete-suggestion.active-suggestion { 
    background-color: #2563eb !important; 
    color: #ffffff !important; 
    font-weight: 600; 
}

/* 타임라인 출처 배지 */
.source-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 4px;
    border-radius: 2px;
}
.source-direct {
    background-color: #fef3c7;
    color: #d97706;
    border: 1px solid #fde68a;
}
.source-inbound {
    background-color: #dcfce7;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}
.source-outbound {
    background-color: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}
.source-manual {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

/* 변동폭 텍스트 */
.diff-up { color: #dc2626; font-size: 10.5px; font-weight: 600; }
.diff-down { color: #2563eb; font-size: 10.5px; font-weight: 600; }
.diff-same { color: #94a3b8; font-size: 10.5px; }

/* ERP 고밀도 모달 폼 스타일 */
.erp-modal-label {
    font-size: 11.5px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 2px;
}
.erp-modal-input {
    height: 28px !important;
    font-size: 11.5px !important;
    border-radius: 2px !important;
    border: 1px solid var(--erp-border) !important;
    padding: 2px 8px !important;
}
.erp-modal-input:focus {
    border-color: var(--erp-primary) !important;
    box-shadow: 0 0 0 1.5px rgba(37, 99, 235, 0.2) !important;
}

/* ── 5. 규격 비교 매트릭스 시스템 스타일 ── */

/* 테이블 내 클릭 가능한 규격 뱃지 버튼 */
.btn-spec-pill {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 11px;
    color: #1e293b;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    transition: all 0.15s ease;
}
.btn-spec-pill:hover {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1d4ed8;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.15);
}

/* 뷰 모드 토글 버튼 그룹 */
.erp-view-toggle {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    padding: 2px;
    border-radius: 3px;
    border: 1px solid var(--erp-border-light);
}
.erp-view-toggle .btn-erp {
    border: none !important;
    background: transparent;
    color: #475569;
    padding: 2px 8px;
    font-size: 11px;
    border-radius: 2px;
}
.erp-view-toggle .btn-erp.active {
    background: #ffffff !important;
    color: #1d4ed8 !important;
    font-weight: 700;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   5. 견적 비교 테이블 (Quotation Comparison Table) & 섹션 카드 스타일
   ========================================================================== */
.quote-section-card {
    background: #ffffff;
    border: 1px solid var(--erp-border);
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-bottom: 12px;
    transition: all 0.15s ease;
}
.quote-section-card:hover {
    border-color: #94a3b8;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.quote-section-header {
    background: #f8fafc;
    border-bottom: 1px solid var(--erp-border);
    padding: 7px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.quote-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    user-select: none;
    transition: color 0.15s ease;
}
.quote-section-title:hover {
    color: #2563eb;
}
.btn-edit-sec {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    font-size: 11px;
    font-weight: 500;
    padding: 1px 7px;
    height: 22px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-edit-sec:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.quote-spec-badge {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.quote-spec-badge strong {
    color: #15803d;
    font-weight: 700;
}

/* 비교 대조 테이블 */
.quote-compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11.5px;
    background: #ffffff;
    table-layout: auto;
}
.quote-compare-table th {
    background-color: #f1f5f9;
    color: #334155;
    font-weight: 700;
    font-size: 11px;
    text-align: center;
    vertical-align: middle;
    padding: 6px 8px;
    border: 1px solid var(--erp-border);
    white-space: nowrap;
}
.quote-compare-table td {
    padding: 5px 8px;
    border: 1px solid var(--erp-border);
    vertical-align: middle;
    font-size: 11.5px;
    white-space: nowrap;
}
.quote-compare-table tbody tr:hover td {
    background-color: #f8fafc;
}

/* 최저가 추천 행 하이라이트 */
.quote-compare-table tr.row-best-price td {
    background-color: #f0fdf4 !important;
}
.quote-compare-table tr.row-best-price td.td-price-main {
    font-weight: 700 !important;
    color: #15803d !important;
}

/* 체크박스 및 미선택(인쇄 제외) 행 시각 효과 */
.quote-item-chk {
    cursor: pointer;
    width: 14px;
    height: 14px;
}
.quote-compare-table tr.row-unselected td {
    opacity: 0.42;
    background-color: #f8fafc !important;
}
.quote-compare-table tr.row-unselected:hover td {
    opacity: 0.75;
    background-color: #f1f5f9 !important;
}

/* 인쇄 설정 모달 스타일 커스텀 */
#printOptionModal .modal-body {
    background-color: #f8fafc;
}
#printOptionModal .form-check-input {
    cursor: pointer;
}
#printOptionModal .form-check-label {
    cursor: pointer;
    user-select: none;
}

/* 뱃지: 최저가 추천 & 단위 환산 단가 */
.badge-best-pick {
    background: #16a34a;
    color: #ffffff;
    font-weight: 700;
    font-size: 10.5px;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.badge-norm-price {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    font-weight: 700;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
}
.badge-savings {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    font-weight: 600;
    font-size: 10.5px;
    padding: 1px 5px;
    border-radius: 3px;
}

/* 운임 조건 뱃지 */
.badge-freight-in {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 2px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.badge-freight-ex {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #cbd5e1;
    font-size: 10px;
    font-weight: 500;
    padding: 1px 5px;
    border-radius: 2px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

/* 섹션 검토 의견(메모) 바 */
.quote-section-memo {
    background: #fafbfc;
    border-top: 1px dashed var(--erp-border);
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.quote-section-memo .memo-label {
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    white-space: nowrap;
}
.quote-section-memo .memo-input {
    font-size: 11.5px;
    height: 26px;
    border-radius: 2px;
    border: 1px solid var(--erp-border);
    padding: 2px 8px;
    background: #ffffff;
    flex: 1;
}
.quote-section-memo .memo-input:focus {
    border-color: var(--erp-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* ==========================================================================
   6. 공식 결재/보고용 A4 가로 인쇄 서식 (@media print)
   ========================================================================== */
.print-only {
    display: none;
}

@media print {
    @page {
        size: A4 landscape;
        margin: 10mm 8mm 10mm 8mm;
    }

    html,
    html body,
    body,
    body.modal-open {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
        background: #ffffff !important;
        padding: 0 !important;
        margin: 0 !important;
        font-size: 9.5pt !important;
        color: #000000 !important;
        font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Malgun Gothic', sans-serif !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* 화면 UI 요소 전체 숨김 */
    .no-print,
    .erp-top-toolbar,
    .erp-filter-ribbon,
    .btn-erp,
    .btn-close,
    .modal,
    .modal-backdrop,
    .form-check-input,
    .btn-table-action,
    .btn-hist,
    .modal-footer,
    #priceGridWrapper,
    #itemPaginationBar,
    #quoteComparisonWrapper {
        display: none !important;
    }

    /* 인쇄 전용 보고서 컨테이너 활성화 */
    .print-only,
    #printArea,
    .print-container {
        display: block !important;
        position: static !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* 인쇄 섹션 및 테이블 다중 페이지 넘김(Pagination) 제어 */
    .print-quote-section {
        margin-bottom: 20px !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .print-quote-table {
        width: 100% !important;
        border-collapse: collapse !important;
        page-break-inside: auto !important;
    }

    .print-quote-table thead {
        display: table-header-group !important;
    }

    .print-quote-table tr {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .print-summary-box {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .report-page {
        width: 100% !important;
        color: #1e293b !important;
    }

    /* 상단 공식 결재 헤더 */
    .report-header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: flex-start !important;
        border-bottom: 2px solid #0f172a !important;
        padding-bottom: 8px !important;
        margin-bottom: 12px !important;
    }

    .report-meta {
        font-size: 8.5pt !important;
        color: #475569 !important;
        line-height: 1.5 !important;
    }

    .report-title-box {
        text-align: center !important;
        flex: 1 !important;
        padding: 0 16px !important;
    }
    .report-title-box h2 {
        font-size: 18pt !important;
        font-weight: 800 !important;
        color: #0f172a !important;
        margin: 0 0 4px 0 !important;
        letter-spacing: 2px !important;
    }
    .report-title-box p {
        font-size: 9pt !important;
        color: #64748b !important;
        margin: 0 !important;
    }

    /* 결재란 */
    .report-approval-box table {
        border-collapse: collapse !important;
        text-align: center !important;
        font-size: 8.5pt !important;
    }
    .report-approval-box th,
    .report-approval-box td {
        border: 1px solid #334155 !important;
        padding: 3px 8px !important;
    }
    .report-approval-box th {
        background-color: #f1f5f9 !important;
        font-weight: 600 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .report-approval-box .th-side {
        width: 22px !important;
        font-size: 8pt !important;
        line-height: 1.2 !important;
        background-color: #f8fafc !important;
    }
    .report-approval-box .sign-td {
        width: 55px !important;
        height: 44px !important;
    }

    /* 보고서 개요 박스 */
    .report-summary-box {
        background-color: #f8fafc !important;
        border: 1px solid #cbd5e1 !important;
        padding: 6px 10px !important;
        font-size: 9pt !important;
        margin-bottom: 14px !important;
        line-height: 1.4 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* 섹션별 보고서 블록 */
    .report-section {
        margin-bottom: 18px !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .report-section-title {
        font-size: 11pt !important;
        font-weight: 700 !important;
        color: #0f172a !important;
        margin-bottom: 6px !important;
        display: flex !important;
        justify-content: space-between !important;
        border-bottom: 1.5px solid #64748b !important;
        padding-bottom: 3px !important;
    }
    .report-section-count {
        font-size: 8.5pt !important;
        font-weight: 500 !important;
        color: #64748b !important;
    }

    /* 보고서 표 */
    .report-table {
        width: 100% !important;
        border-collapse: collapse !important;
        font-size: 8.5pt !important;
        margin-bottom: 6px !important;
    }
    .report-table th,
    .report-table td {
        border: 1px solid #94a3b8 !important;
        padding: 4px 6px !important;
        vertical-align: middle !important;
    }
    .report-table th {
        background-color: #f1f5f9 !important;
        color: #0f172a !important;
        font-weight: 700 !important;
        text-align: center !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .report-table tr.report-best-row td {
        background-color: #f0fdf4 !important;
        font-weight: 600 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .report-memo-box {
        background-color: #ffffff !important;
        border: 1px solid #cbd5e1 !important;
        padding: 4px 8px !important;
        font-size: 8.5pt !important;
        color: #334155 !important;
    }

    .report-footer-stamp {
        margin-top: 20px !important;
        text-align: center !important;
        font-size: 11pt !important;
        font-weight: 700 !important;
        letter-spacing: 4px !important;
        color: #0f172a !important;
        border-top: 1px solid #cbd5e1 !important;
        padding-top: 10px !important;
    }
}

/* ── 7. ECOUNT ERP 전표/마스터 폼 테이블 그리드 스타일 (.erp-form-table) ── */
.erp-form-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    margin-bottom: 0;
}
.erp-form-table th {
    background-color: #f8fafc;
    color: #334155;
    font-size: 11.5px;
    font-weight: 600;
    padding: 3px 8px;
    border: 1px solid #cbd5e1;
    white-space: nowrap;
    vertical-align: middle;
    text-align: center;
    height: 30px;
}
.erp-form-table td {
    padding: 0;
    border: 1px solid #cbd5e1;
    vertical-align: middle;
    background-color: #ffffff;
    height: 30px;
    position: relative;
}
.erp-form-table .form-control,
.erp-form-table .form-select {
    width: 100%;
    height: 30px !important;
    font-size: 12px !important;
    padding: 2px 8px !important;
    border-radius: 0 !important;
    border: none !important;
    outline: none !important;
    color: #1e293b;
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
}
.erp-form-table .form-control:focus,
.erp-form-table .form-select:focus {
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    background-color: transparent !important;
}
.erp-form-table input[type=number]::-webkit-inner-spin-button,
.erp-form-table input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.erp-form-table input[type=number] {
    -moz-appearance: textfield;
}
.erp-form-table td:focus-within {
    box-shadow: inset 0 0 0 2px #2563eb !important;
    background-color: #eff6ff !important;
    position: relative !important;
    z-index: 5 !important;
}
.erp-form-table .input-group {
    flex-wrap: nowrap;
    width: 100%;
    height: 30px;
}
.erp-form-table .input-group .form-control {
    border-radius: 0 !important;
}
.erp-form-table .input-group-text {
    height: 30px;
    padding: 0 8px;
    font-size: 11px;
    background-color: #f8fafc;
    border: none;
    border-left: 1px solid #cbd5e1;
    color: #64748b;
    border-radius: 0 !important;
}

/* ── 7. ERP 페이징 컨트롤 바 (.erp-pagination-bar) ── */
.erp-pagination-bar {
    font-size: 11.5px;
    min-height: 34px;
    box-sizing: border-box;
    background: #f8fafc;
    border-color: var(--erp-border) !important;
    user-select: none;
}

.erp-page-size-select {
    width: 110px !important;
    height: 24px !important;
    font-size: 11px !important;
    padding: 1px 18px 1px 6px !important;
    border: 1px solid var(--erp-border) !important;
    border-radius: 2px !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
    cursor: pointer;
}

.erp-pagination-bar .btn-erp {
    height: 24px;
    padding: 0 8px;
    font-size: 11.5px;
    min-width: 24px;
    justify-content: center;
}

.erp-pagination-bar .btn-erp.active {
    background: var(--erp-primary) !important;
    border-color: var(--erp-primary) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
}

.erp-pagination-bar .btn-erp:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background-color: #f1f5f9 !important;
    border-color: var(--erp-border) !important;
    color: #94a3b8 !important;
}

/* ==========================================================================
   6. ERP 모달 상단 시야 배치 & 위치 최적화
   ========================================================================== */
.modal-dialog {
    margin: 45px auto !important;
    max-height: calc(100vh - 90px);
}

@media (max-width: 576px) {
    .modal-dialog {
        margin: 20px auto !important;
    }
}

/* ==========================================================================
   8. 단가구분 뱃지 & 다중통화 / 환율 & 운임지역 스타일
   ========================================================================== */
/* 단가 구분 뱃지 */
.badge-pt-quote {
    background-color: #e0f2fe !important;
    color: #0369a1 !important;
    border: 1px solid #bae6fd;
    font-size: 10.5px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
    white-space: nowrap;
}
.badge-pt-contract {
    background-color: #dcfce7 !important;
    color: #15803d !important;
    border: 1px solid #bbf7d0;
    font-size: 10.5px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
    white-space: nowrap;
}
.badge-pt-spot {
    background-color: #fef3c7 !important;
    color: #b45309 !important;
    border: 1px solid #fde68a;
    font-size: 10.5px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
    white-space: nowrap;
}
.badge-pt-std {
    background-color: #f3e8ff !important;
    color: #6b21a8 !important;
    border: 1px solid #e9d5ff;
    font-size: 10.5px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
    white-space: nowrap;
}

/* 운임 지역 ECOUNT ERP 사각 버튼 & 칩 */
.erp-region-btn,
.region-chip {
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 2px;
    cursor: pointer;
    line-height: 1.3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s ease;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.03);
}
.erp-region-btn:hover,
.region-chip:hover {
    background-color: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}
.erp-region-btn.active,
.region-chip.active {
    background-color: #2563eb !important;
    color: #ffffff !important;
    border-color: #1d4ed8 !important;
    font-weight: 600;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* 외화 + 원화 병기 셀 */
.currency-dual-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
}
.currency-foreign {
    font-size: 11.5px;
    font-weight: 700;
    color: #1e293b;
}
.currency-krw {
    font-size: 10px;
    color: #64748b;
}

/* 견적 비교 테이블 환율 수정 뱃지 버튼 */
.rate-badge-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10.5px;
    padding: 1px 6px;
    border-radius: 3px;
    background-color: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
}
.rate-badge-btn:hover {
    background-color: #15803d;
    color: #ffffff;
    border-color: #15803d;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.rate-badge-btn i {
    font-size: 11px;
}

/* 하차도 지역 뱃지 */
.badge-freight-region {
    display: inline-block;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
    font-size: 9.5px;
    color: #0369a1;
    background: #e0f2fe;
    padding: 0 4px;
    border-radius: 2px;
    border: 1px solid #bae6fd;
    margin-left: 2px;
}

/* ==========================================================================
   9. 라디오 버튼 왜곡 방지 & 정통 ECOUNT ERP 세그먼트 토글 스타일
   ========================================================================== */
/* 라디오 버튼 왜곡 방지 및 완벽한 정원형 보장 */
.form-check-input[type="radio"] {
    width: 14px !important;
    height: 14px !important;
    min-width: 14px !important;
    min-height: 14px !important;
    max-width: 14px !important;
    max-height: 14px !important;
    flex-shrink: 0 !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 50% !important;
    margin: 0 !important;
    vertical-align: middle;
}
.form-check-input[type="checkbox"] {
    width: 14px !important;
    height: 14px !important;
    min-width: 14px !important;
    min-height: 14px !important;
    max-width: 14px !important;
    max-height: 14px !important;
    flex-shrink: 0 !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 2px !important;
    margin: 0 !important;
    vertical-align: middle;
}

/* ECOUNT ERP 정통 세그먼트 토글 버튼 그룹 */
.erp-segmented-group {
    display: inline-flex;
    border: 1px solid #cbd5e1;
    border-radius: 2px;
    background-color: #f1f5f9;
    padding: 2px;
    gap: 2px;
}
.erp-seg-btn {
    border: 1px solid transparent;
    background: transparent;
    color: #475569;
    font-size: 11.5px;
    font-weight: 500;
    padding: 3px 12px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.12s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1.35;
    user-select: none;
}
.erp-seg-btn:hover {
    color: #0f172a;
    background-color: #e2e8f0;
}
.erp-seg-btn.active {
    background-color: #2563eb !important;
    color: #ffffff !important;
    font-weight: 600;
    border-color: #1d4ed8 !important;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.15);
}

/* 하차도 상세 운임 패널 (이카운트 스타일 정돈) */
.freight-detail-box {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 2px;
    padding: 6px 8px;
    margin-top: 4px;
}
.freight-field-label {
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    min-width: 65px;
    flex-shrink: 0;
}

/* ==========================================================================
   10. 마스터-디테일 모달 그리드 인라인 시트 스타일
   ========================================================================== */
#priceModal .modal-dialog {
    max-width: 1440px !important;
    width: 95vw !important;
    margin: 1.25rem auto;
}
#modalGridTable td {
    padding: 2px 4px !important;
    vertical-align: middle;
    height: 30px;
}
#modalGridTable input.form-control {
    height: 25px !important;
    padding: 2px 6px !important;
    font-size: 11px !important;
    border-radius: 2px;
    border-color: #cbd5e1;
    background-color: #ffffff;
}
#modalGridTable select.form-select {
    height: 25px !important;
    padding: 2px 18px 2px 6px !important;
    font-size: 11px !important;
    border-radius: 2px;
    border-color: #cbd5e1;
    background-color: #ffffff;
    background-position: right 4px center !important;
    background-size: 10px 8px !important;
}
#priceModal .form-control:focus,
#priceModal .form-select:focus {
    outline: none !important;
    border-color: #2563eb !important;
    box-shadow: none !important;
}
#modalGridTable input.form-control:focus,
#modalGridTable select.form-select:focus {
    outline: none !important;
    border-color: #2563eb !important;
    box-shadow: none !important;
    background-color: #f0f7ff !important;
}
#modalGridTable tr.selected-row {
    background-color: #eff6ff !important;
}
#modalGridTable .btn-grid-del {
    border: none;
    background: transparent;
    color: #94a3b8;
    padding: 2px 5px;
    border-radius: 2px;
    cursor: pointer;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
#modalGridTable .btn-grid-del:hover {
    color: #ef4444;
    background-color: #fee2e2;
}
/* ==========================================================================
   11. 인쇄 맞춤 설정 모달 보고서 프리셋 토글 버튼 스타일
   ========================================================================== */
.btn-preset-toggle {
    background-color: #ffffff;
    border: 1.5px solid #cbd5e1;
    color: #475569;
    font-size: 11.5px;
    font-weight: 500;
    padding: 7px 10px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s ease-in-out;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    position: relative;
    user-select: none;
}
.btn-preset-toggle:hover {
    background-color: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}
.btn-preset-toggle:active {
    transform: translateY(1px);
}

/* 1) 구매/대외 발주용 선택(Active) 상태 */
.btn-preset-toggle.preset-external.active {
    background-color: #ecfdf5 !important;
    border: 2px solid #059669 !important;
    color: #065f46 !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.18) !important;
}
.btn-preset-toggle.preset-external.active .preset-icon {
    color: #059669 !important;
}

/* 2) 내부 경영진 결재용 선택(Active) 상태 */
.btn-preset-toggle.preset-internal.active {
    background-color: #eff6ff !important;
    border: 2px solid #2563eb !important;
    color: #1e40af !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.18) !important;
}
.btn-preset-toggle.preset-internal.active .preset-icon {
    color: #2563eb !important;
}

/* 선택 상태 인라인 뱃지 */
.preset-selected-tag {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 2px;
    font-weight: 700;
    display: none;
}
.btn-preset-toggle.active .preset-selected-tag {
    display: inline-block;
}
.btn-preset-toggle.preset-external.active .preset-selected-tag {
    background-color: #059669;
    color: #ffffff;
}
.btn-preset-toggle.preset-internal.active .preset-selected-tag {
    background-color: #2563eb;
    color: #ffffff;
}

/* ── 모달 뷰포트 중앙 배치 및 상단 잘림 방지 ── */
.modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 1055 !important;
}

.modal.fade .modal-dialog.modal-dialog-centered {
    min-height: calc(100% - 2rem) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-top: 1rem !important;
    margin-bottom: 1rem !important;
}

/* ── 설계/권장 기준품 (Benchmark Spec Row) 스타일 ── */
.row-benchmark-spec {
    background-color: #f1f5f9 !important;
    border-top: 1.5px solid #0f172a !important;
    border-bottom: 2px solid #94a3b8 !important;
}
.row-benchmark-spec td {
    background-color: #f1f5f9 !important;
    color: #334155;
    font-size: 11.5px;
}
.row-benchmark-spec:hover td {
    background-color: #e2e8f0 !important;
}

/* ── ECOUNT ERP 스타일 명세서형 모달 폼 테이블 ── */
.erp-modal-form-wrap {
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    overflow: hidden;
    background-color: #ffffff;
}

.erp-modal-form-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-bottom: 0;
}

.erp-modal-form-table tr {
    border-bottom: 1px solid #e2e8f0;
}

.erp-modal-form-table tr:last-child {
    border-bottom: none;
}

/* 그룹 구분 헤더 행 */
.erp-modal-form-table .erp-group-header-row th {
    background: linear-gradient(90deg, #f1f5f9 0%, #f8fafc 100%);
    color: #0f172a;
    font-weight: 700;
    font-size: 11.5px;
    padding: 7px 10px;
    border-top: 1px solid #cbd5e1;
    border-bottom: 1px solid #cbd5e1;
    letter-spacing: -0.2px;
}

.erp-modal-form-table .erp-group-header-row:first-child th {
    border-top: none;
}

/* 레이블 셀 (th) */
.erp-modal-form-table th.erp-th-label {
    background-color: #f8fafc;
    color: #334155;
    font-weight: 600;
    font-size: 11.5px;
    padding: 7px 10px;
    vertical-align: middle;
    border-right: 1px solid #e2e8f0;
    white-space: nowrap;
}

.erp-modal-form-table th.erp-th-label.required::after {
    content: " *";
    color: #ef4444;
    font-weight: 700;
}

/* 인풋 셀 (td) */
.erp-modal-form-table td.erp-td-input {
    padding: 5px 8px;
    vertical-align: middle;
    background-color: #ffffff;
}

.erp-modal-form-table td.erp-td-input .form-control {
    font-size: 12px;
    padding: 5px 8px;
    height: 31px;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    color: #0f172a;
    transition: all 0.15s ease;
}

.erp-modal-form-table td.erp-td-input .form-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
    background-color: #ffffff;
}

.erp-modal-form-table td.erp-td-input .form-control::placeholder {
    color: #94a3b8;
    font-size: 11.5px;
}

/* 안내 가이드 박스 */
.erp-modal-guide-box {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 3.5px solid #2563eb;
    border-radius: 3px;
    padding: 8px 12px;
    font-size: 11px;
    color: #334155;
    line-height: 1.45;
}

/* 모달 헤더 & 푸터 ERP 스타일 */
.erp-modal-header {
    background: #1e293b !important;
    border-bottom: 1px solid #0f172a !important;
    padding: 10px 14px !important;
}

.erp-modal-title {
    font-size: 13.5px !important;
    font-weight: 700 !important;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #ffffff;
}

.erp-modal-footer {
    background: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
    padding: 8px 14px !important;
}

.erp-kbd {
    background-color: #ffffff;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 10.5px;
    font-family: inherit;
    box-shadow: 0 1px 1px rgba(0,0,0,0.06);
}

/* ── ECOUNT ERP 스타일 서브그리드 (복수 설계기준품 입력 테이블) ── */
.erp-subgrid-wrap {
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    background: #ffffff;
    overflow: hidden;
}

.erp-subgrid-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: 11.5px;
}

.erp-subgrid-table thead th {
    background-color: #f1f5f9;
    color: #334155;
    font-weight: 600;
    padding: 6px 8px;
    text-align: center;
    border-bottom: 1px solid #cbd5e1;
    border-right: 1px solid #e2e8f0;
    white-space: nowrap;
    font-size: 11px;
}
.erp-subgrid-table thead th:last-child {
    border-right: none;
}

.erp-subgrid-table tbody td {
    padding: 4px 6px;
    border-bottom: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    vertical-align: middle;
    background-color: #ffffff;
}
.erp-subgrid-table tbody td:last-child {
    border-right: none;
}

.erp-subgrid-table tbody tr:last-child td {
    border-bottom: none;
}

.erp-subgrid-table tbody tr:hover td {
    background-color: #f8fafc;
}

.erp-subgrid-table .form-control {
    font-size: 11.5px;
    padding: 4px 7px;
    height: 28px;
    border: 1px solid #cbd5e1;
    border-radius: 2px;
}

.erp-subgrid-table .form-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.btn-subgrid-add {
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 3px;
    line-height: 1.4;
    transition: all 0.15s ease;
}

.btn-subgrid-del {
    padding: 2px 5px;
    font-size: 13px;
    line-height: 1;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #94a3b8;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-subgrid-del:hover {
    background-color: #fee2e2;
    color: #ef4444;
    border-color: #fca5a5;
}

/* ══════════════════════════════════════════════════════════════
   MOBILE SPECIALIZED UI/UX OPTIMIZATIONS (≤ 768px)
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    body {
        padding: 8px 10px 80px 10px !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        background-color: #f8fafc !important;
    }

    /* 모바일 헤더 */
    .mobile-price-header {
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 10px 12px;
        margin-bottom: 10px;
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    }
    .mobile-head-btn {
        width: 32px;
        height: 32px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        font-size: 16px;
        padding: 0;
        background: #ffffff;
        border: 1px solid #cbd5e1;
        color: #334155;
        transition: all 0.15s ease;
        flex-shrink: 0;
    }
    .mobile-head-btn:active {
        background: #f1f5f9;
        transform: scale(0.95);
    }
    .mobile-head-btn.btn-outline-primary {
        border-color: #93c5fd;
        color: #2563eb;
        background: #f0f7ff;
    }
    .mobile-header-title {
        font-size: 15px;
        font-weight: 700;
        color: #0f172a;
        white-space: nowrap;
        letter-spacing: -0.02em;
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }
    .mobile-icon-toggle {
        width: 30px;
        height: 32px;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        font-size: 15px !important;
    }
    .mobile-view-toggle .btn.active {
        background-color: #2563eb !important;
        color: #ffffff !important;
        border-color: #2563eb !important;
    }
    .mobile-filter-badge {
        position: absolute;
        top: -3px;
        right: -3px;
        width: 8px;
        height: 8px;
        background-color: #ef4444;
        border-radius: 50%;
        border: 2px solid #ffffff;
    }

    /* 모바일 검색창 */
    .mobile-search-strip .form-control {
        height: 38px !important;
        font-size: 13.5px !important;
        border-color: #cbd5e1 !important;
    }
    .mobile-search-strip .btn {
        height: 38px !important;
        font-size: 13px !important;
        font-weight: 600;
    }

    /* 모바일 카테고리 칩 스와이프 바 */
    .mobile-cat-scroll-wrapper {
        position: relative;
        width: 100%;
        overflow: hidden;
    }
    .mobile-cat-scroll-wrapper::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 4px;
        width: 24px;
        background: linear-gradient(to right, rgba(248, 250, 252, 0), rgba(241, 245, 249, 0.95));
        pointer-events: none;
        border-radius: 0 8px 8px 0;
    }
    .category-pills-scroll-track {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
        gap: 6px !important;
        padding: 2px 28px 6px 4px !important;
        width: 100% !important;
        scrollbar-width: thin;
        cursor: grab;
        user-select: none;
    }
    .category-pills-scroll-track.is-dragging {
        cursor: grabbing !important;
        scroll-behavior: auto !important;
    }
    .category-pills-scroll-track::-webkit-scrollbar {
        height: 3px;
    }
    .category-pills-scroll-track::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 4px;
    }
    .category-pills-scroll-track::-webkit-scrollbar-track {
        background: transparent;
    }
    .category-pills-scroll-track .btn {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        padding: 4px 12px !important;
        font-size: 12px !important;
        height: 28px !important;
        line-height: 18px !important;
        border-radius: 14px !important;
        user-select: none;
    }
    .category-pills-scroll-track .btn.btn-primary {
        background-color: #2563eb !important;
        border-color: #2563eb !important;
        color: #ffffff !important;
        font-weight: 700 !important;
        box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25) !important;
    }

    /* 초슬림 1라인 KPI 요약 바 */
    .mobile-price-kpi-bar {
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 6px 10px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 11.5px;
        color: #334155;
        gap: 6px;
        overflow: hidden;
    }
    .kpi-scroll-container {
        display: flex;
        align-items: center;
        gap: 8px;
        overflow-x: auto;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .kpi-scroll-container::-webkit-scrollbar {
        display: none;
    }
    .mobile-price-kpi-bar .kpi-item {
        display: inline-flex;
        align-items: center;
        gap: 3px;
        white-space: nowrap !important;
        flex-shrink: 0;
        font-size: 11.5px;
    }
    .mobile-price-kpi-bar .kpi-item strong {
        font-size: 12px;
        color: #0f172a;
        white-space: nowrap !important;
    }
    .kpi-divider {
        font-size: 10px;
        color: #cbd5e1 !important;
        flex-shrink: 0;
    }

    /* 모바일 단가 카드 컨테이너 */
    .price-cards-container {
        display: block;
        padding-bottom: 40px;
    }
    .mobile-empty-state {
        text-align: center;
        padding: 48px 16px;
        background: #ffffff;
        border-radius: 12px;
        border: 1px dashed #cbd5e1;
        margin: 12px 0;
    }

    /* 모바일 단가 카드 */
    .mobile-price-card {
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 12px 14px;
        margin-bottom: 10px;
        box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
        transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.15s ease;
    }
    .mobile-price-card:active {
        transform: scale(0.995);
    }
    .mobile-price-card.selected-card {
        border-color: #93c5fd;
        background-color: #f8faff;
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
    }

    .mobile-price-card-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-bottom: 8px;
        border-bottom: 1px solid #f1f5f9;
        margin-bottom: 8px;
    }

    /* 마진율 뱃지 */
    .mobile-margin-badge {
        font-size: 11.5px;
        font-weight: 700;
        padding: 3px 7px;
        border-radius: 6px;
        letter-spacing: -0.01em;
        display: inline-flex;
        align-items: center;
        white-space: nowrap !important;
    }
    .mobile-margin-badge.margin-high {
        background: #ecfdf5;
        color: #059669;
        border: 1px solid #a7f3d0;
    }
    .mobile-margin-badge.margin-mid {
        background: #eff6ff;
        color: #2563eb;
        border: 1px solid #bfdbfe;
    }
    .mobile-margin-badge.margin-low {
        background: #fffbeb;
        color: #d97706;
        border: 1px solid #fde68a;
    }
    .mobile-margin-badge.margin-loss {
        background: #fef2f2;
        color: #dc2626;
        border: 1px solid #fecaca;
    }
    .mobile-margin-badge.badge-unregistered {
        background: #f1f5f9;
        color: #64748b;
        border: 1px solid #cbd5e1;
        font-weight: 600;
        font-size: 11px;
    }

    .mobile-price-card-body {
        cursor: pointer;
        margin-bottom: 8px;
    }
    .mobile-price-title {
        font-size: 15px;
        font-weight: 700;
        color: #0f172a;
        line-height: 1.35;
        margin-bottom: 5px;
        word-break: break-all;
    }
    .mobile-price-meta {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 5px;
        margin-bottom: 4px;
    }
    .mobile-price-meta .spec-pill {
        font-size: 11px;
        padding: 2px 7px;
        border-radius: 5px;
        background: #f1f5f9;
        color: #334155;
        border: 1px solid #e2e8f0;
        font-weight: 500;
        display: inline-flex;
        align-items: center;
        gap: 2px;
    }
    .mobile-price-meta .supplier-pill {
        font-size: 11px;
        padding: 2px 7px;
        border-radius: 5px;
        background: #f8fafc;
        color: #475569;
        border: 1px solid #e2e8f0;
        display: inline-flex;
        align-items: center;
        gap: 2px;
    }
    .mobile-price-meta .unit-pill {
        font-size: 10.5px;
        padding: 1px 6px;
        border-radius: 4px;
        background: #ffffff;
        color: #64748b;
        border: 1px solid #cbd5e1;
    }
    .mobile-price-note {
        font-size: 11px;
        color: #64748b;
        background: #f8fafc;
        padding: 4px 8px;
        border-radius: 6px;
        border-left: 2px solid #cbd5e1;
        margin-top: 5px;
    }

    /* 4단 비교 가격 그리드 (매입단가, 매출단가, 마진액, 마진율) */
    .mobile-price-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 8px 8px;
        margin-bottom: 8px;
    }
    @media (max-width: 375px) {
        .mobile-price-grid {
            grid-template-columns: 1fr 1fr;
            row-gap: 8px;
        }
    }
    .price-box {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }
    .price-box-label {
        font-size: 10px;
        color: #64748b;
        font-weight: 600;
        margin-bottom: 2px;
        letter-spacing: -0.02em;
        white-space: nowrap;
    }
    .price-box-val {
        font-size: 12px;
        font-weight: 700;
        color: #1e293b;
        line-height: 1.25;
        letter-spacing: -0.02em;
        word-break: break-all;
    }
    .sell-box .price-box-val {
        color: #2563eb;
        font-weight: 800;
    }
    .margin-box .price-box-val {
        font-weight: 800;
    }
    .margin-box-loss {
        background: #fff5f5;
        border-radius: 4px;
        padding: 2px 4px;
    }
    .margin-rate-box {
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 6px;
        padding: 3px 5px;
    }
    .margin-rate-box.margin-high {
        background: #ecfdf5;
        border-color: #a7f3d0;
    }
    .margin-rate-box.margin-high .price-box-val {
        color: #059669;
        font-weight: 800;
    }
    .margin-rate-box.margin-mid {
        background: #eff6ff;
        border-color: #bfdbfe;
    }
    .margin-rate-box.margin-mid .price-box-val {
        color: #2563eb;
        font-weight: 800;
    }
    .margin-rate-box.margin-low {
        background: #fffbeb;
        border-color: #fde68a;
    }
    .margin-rate-box.margin-low .price-box-val {
        color: #d97706;
        font-weight: 800;
    }
    .margin-rate-box.margin-loss {
        background: #fef2f2;
        border-color: #fecaca;
    }
    .margin-rate-box.margin-loss .price-box-val {
        color: #dc2626;
        font-weight: 800;
    }
    .margin-rate-box.margin-rate-none {
        background: #f8fafc;
        border-color: #e2e8f0;
    }
    .margin-rate-box.margin-rate-none .price-box-val {
        color: #94a3b8;
        font-weight: 600;
        font-size: 11px;
    }

    /* 카드 푸터 */
    .mobile-price-card-footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-top: 8px;
        border-top: 1px dashed #e2e8f0;
    }
    .btn-card-hist {
        background: #f8fafc;
        border: 1px solid #cbd5e1;
        color: #475569;
        font-size: 11px;
        font-weight: 600;
        padding: 4px 8px;
        border-radius: 6px;
        display: inline-flex;
        align-items: center;
        gap: 3px;
        transition: all 0.15s ease;
    }
    .btn-card-hist:active {
        background: #e2e8f0;
        color: #1e293b;
    }
    .btn-card-action {
        background: #ffffff;
        border: 1px solid #cbd5e1;
        color: #334155;
        font-size: 11px;
        font-weight: 600;
        padding: 4px 8px;
        border-radius: 6px;
        display: inline-flex;
        align-items: center;
        gap: 3px;
        transition: all 0.15s ease;
    }
    .btn-card-action.btn-del {
        color: #dc2626;
        border-color: #fecaca;
        background: #ffffff;
    }
    .btn-card-action:active {
        background: #f1f5f9;
        transform: scale(0.96);
    }

    /* 플로팅 일괄 선택 액션 바 */
    .mobile-batch-bar {
        position: fixed;
        bottom: 16px;
        left: 16px;
        right: 16px;
        background: #1e293b;
        color: #ffffff;
        border-radius: 12px;
        padding: 10px 14px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        z-index: 1050;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
        animation: slideUpBatch 0.2s ease-out;
    }
    @keyframes slideUpBatch {
        from { transform: translateY(100%); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }

    /* 뷰 모드 전환 (테이블 모드 시 스타일) */
    .mobile-hidden-table {
        display: none !important;
    }
    .mobile-hidden-cards {
        display: none !important;
    }
    .erp-grid-wrapper {
        min-height: 380px !important;
        height: 65vh !important;
        border-radius: 8px !important;
        margin-bottom: 12px !important;
    }

    /* 모바일 필터 바텀시트 드로어 */
    .mobile-filter-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        backdrop-filter: blur(2px);
        z-index: 1055;
    }
    .mobile-filter-drawer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #ffffff;
        z-index: 1060;
        border-radius: 20px 20px 0 0;
        max-height: 80vh;
        display: flex;
        flex-direction: column;
        transform: translateY(100%);
        transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.15);
    }
    .mobile-filter-drawer.open {
        transform: translateY(0);
    }

    /* 모바일 모달 최적화 */
    .modal-dialog {
        margin: 8px !important;
        max-width: calc(100% - 16px) !important;
    }
    .modal-content {
        border-radius: 12px !important;
    }

    /* 단가표 #priceModal 모바일 전용 반응형 레이아웃 */
    #priceModal .modal-dialog {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0.5rem auto !important;
        padding: 0 4px;
    }
    #priceModal .modal-content {
        border-radius: 14px !important;
        border: none;
        overflow: hidden;
    }
    #priceModal .modal-body {
        max-height: calc(90vh - 48px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 10px !important;
    }
    .mobile-price-modal-container .card {
        border-radius: 10px !important;
        border-color: #e2e8f0 !important;
    }
    .mobile-price-modal-container .card-header {
        border-top-left-radius: 9px !important;
        border-top-right-radius: 9px !important;
        background: #f8fafc !important;
        border-bottom: 1px solid #e2e8f0 !important;
    }
    .mobile-modal-margin-card {
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        padding: 10px 12px;
    }
    .mob-preview-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    .mob-preview-box {
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 6px 4px;
        text-align: center;
        transition: all 0.2s ease;
    }
    .mob-preview-label {
        font-size: 10px;
        color: #64748b;
        font-weight: 600;
        margin-bottom: 2px;
        letter-spacing: -0.02em;
        white-space: nowrap;
    }
    .mob-preview-val {
        font-size: 12px;
        font-weight: 700;
        letter-spacing: -0.02em;
        word-break: break-all;
    }
    .mob-preview-box.profit-positive {
        background: #ecfdf5;
        border-color: #a7f3d0;
    }
    .mob-preview-box.profit-positive .mob-preview-val {
        color: #059669;
    }
    .mob-preview-box.profit-loss {
        background: #fef2f2;
        border-color: #fecaca;
    }
    .mob-preview-box.profit-loss .mob-preview-val {
        color: #dc2626;
    }
    .mob-curr-symbol {
        font-size: 12px;
        background-color: #f1f5f9;
        border-color: #cbd5e1;
    }
    .mobile-modal-actions button {
        height: 38px;
        border-radius: 8px;
        font-size: 12.5px;
    }
}


