/* =====================================================================
   [호랑이 ERP] 커스텀 CSS (admin_custom.css)
   - 전역 스타일, 레이아웃 확장, 각 앱별(영업, 수주, 수리) UI 디테일 보정
===================================================================== */

/* =====================================================================
   사이드바 검색창 마진
   ⚠️ 직계 자식(>) 한정 — `div:has(#nav-filter)`는 #nav-filter를 자손으로 가진
   모든 조상(#page 등)에 매칭돼 페이지 전체에 12px 여백을 만들어 하단 sticky
   저장바/페이지네이터가 화면 바닥에 안 붙는 버그를 유발했음.
===================================================================== */
div:has(> #nav-filter) {
    margin-top: 8px !important;
    margin-bottom: 4px !important;
}

/* =====================================================================
   📅 일정달력 모달
===================================================================== */
#sch-cal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 9999;
    display: flex; align-items: center; justify-content: center;
}
.sch-modal {
    background: #fff; border-radius: 12px; padding: 24px;
    width: 96vw; max-width: 1800px; max-height: 90vh; overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.sch-modal-header { display: flex; justify-content: flex-end; align-items: center; margin-bottom: 8px; }
.sch-close-btn { background: none; border: none; font-size: 20px; cursor: pointer; color: #64748b; line-height: 1; }
.sch-dates-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 16px;
    margin-bottom: 14px; padding: 12px; background: #f8fafc;
    border-radius: 8px; border: 1px solid #e2e8f0;
}
.sch-dates-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: #475569; align-items: center; text-align: center; }
.sch-dates-grid input[type="date"] { padding: 5px 8px; border: 1px solid #cbd5e1; border-radius: 5px; font-size: 13px; text-align: center; width: 100%; box-sizing: border-box; }
.sch-dates-grid input[type="date"]::-webkit-datetime-edit { display: flex; justify-content: center; }
.sch-dates-grid input[type="date"]::-webkit-datetime-edit-fields-wrapper { display: flex; justify-content: center; }
.sch-dates-grid select { padding: 5px 6px; border: 1px solid #cbd5e1; border-radius: 5px; font-size: 13px; text-align: center; width: 100%; }
.sch-cal-outer { display: flex; gap: 16px; align-items: stretch; }
.sch-cal-wrap { flex: 1; overflow-x: auto; }
.sch-cal-section { margin-bottom: 10px; }
.sch-cal-table { border-collapse: collapse; font-size: 11px; width: 100%; min-width: 680px; }
.sch-cal-table th, .sch-cal-table td { border: 1px solid #e2e8f0; padding: 3px 1px; text-align: center; min-width: 42px; height: 26px; box-sizing: border-box; }
.sch-row-lbl { background: #f1f5f9 !important; font-weight: 700; padding: 3px 8px !important; white-space: nowrap; min-width: 58px !important; }
.sch-day-hdr { background: #f1f5f9; font-weight: 600; }
.sch-date-hdr { font-size: 10px; white-space: nowrap; background: #fff; }
.sch-date-hdr.saturday { background: #bae6fd !important; color: #0369a1; }
.sch-date-hdr.sunday   { background: #fee2e2 !important; color: #b91c1c; }
.sch-cell { cursor: pointer; transition: opacity .1s; }
.sch-cell:hover { opacity: .75; }
.sch-bz-wrap { display: flex; flex-direction: column; gap: 10px; min-width: 200px; width: 200px; flex-shrink: 0; }
.sch-bz-section { display: flex; flex-direction: column; gap: 4px; }
.sch-bz-label { font-size: 13px; font-weight: 700; color: #475569; text-align: center; }
/* 커스텀 체크박스 드롭다운 */
.sch-bz-dd { position: relative; width: 100%; }
.sch-bz-dd-trigger { display: flex; justify-content: space-between; align-items: flex-start; padding: 6px 8px; height: 80px; border: 1px solid #cbd5e1; border-radius: 5px; font-size: 12px; color: #334155; background: #fff; cursor: pointer; user-select: none; box-sizing: border-box; }
#sch-bz-display { white-space: pre-wrap; word-break: break-word; flex: 1; }
.sch-bz-dd-trigger:hover { border-color: #94a3b8; }
.sch-bz-arrow { font-size: 10px; color: #94a3b8; margin-left: 4px; flex-shrink: 0; }
.sch-bz-dd-panel { display: none; position: absolute; top: calc(100% + 2px); left: 0; right: 0; background: #fff; border: 1px solid #cbd5e1; border-radius: 5px; box-shadow: 0 4px 12px rgba(0,0,0,.12); z-index: 10010; padding: 4px 0; }
.sch-bz-dd-panel.open { display: block; }
.sch-bz-dd-panel label { display: flex; align-items: center; gap: 6px; padding: 5px 10px; font-size: 12px; color: #334155; cursor: pointer; white-space: nowrap; }
.sch-bz-dd-panel label:hover { background: #f1f5f9; }
.sch-bz-dd-panel input[type="checkbox"] { margin: 0; cursor: pointer; }
.sch-bz-ta { width: 100%; height: 130px; min-height: 130px; max-height: 130px; border: 1px solid #cbd5e1; border-radius: 5px; padding: 5px 8px; font-size: 13px; color: #334155; resize: none; box-sizing: border-box; outline: none; }
.sch-bz-ta:focus { border-color: #0369a1; box-shadow: 0 0 0 1px #0369a1; }
.sch-modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding-top: 14px; border-top: 1px solid #e2e8f0; margin-top: 10px; }
.sch-btn { padding: 7px 20px; border-radius: 7px; font-size: 13px; font-weight: 600; border: none; cursor: pointer; }
.sch-btn-cancel { background: #f1f5f9; color: #475569; }
.sch-btn-apply { background: #0369a1; color: #fff; }
/* 일정 다중 적용 대상 선택 */
.sch-target-section { margin-bottom: 12px; padding: 10px 14px; background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 8px; }
.sch-target-title { font-size: 13px; font-weight: 700; color: #0369a1; margin-bottom: 8px; }
.sch-target-list { display: flex; flex-wrap: wrap; gap: 6px; }
.sch-target-item { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; background: #fff; border: 1.5px solid #cbd5e1; border-radius: 20px; font-size: 12px; font-weight: 600; color: #334155; cursor: pointer; user-select: none; transition: border-color .15s, background .15s; }
.sch-target-item:hover { border-color: #0369a1; background: #e0f2fe; }
.sch-target-item:has(input:checked) { border-color: #0369a1; background: #e0f2fe; color: #0369a1; }
.sch-target-item.sch-target-current { border-color: #0284c7; }
.sch-target-item input[type="checkbox"] { margin: 0; cursor: pointer; accent-color: #0369a1; }


/* 사이드바 로고 헤더 아래 여백 제거 */
#nav-sidebar-inner > div:first-child {
    margin-bottom: 0 !important;
}
/* 첫 번째 섹션(영업 관리) 위 실선 제거 및 여백 */
#nav-sidebar-apps .simplebar-content > div:first-child hr {
    display: none !important;
}
#nav-sidebar-apps .simplebar-content > div:first-child {
    margin-top: 12px !important;
}

/* =====================================================================
   🌐 [PART 1] GLOBAL SECTOR (전역 설정 및 공통 UI)
   - 폼 크기, 정렬, 페이지네이션, 읽기전용(Readonly) 공통 디자인을 정의합니다.
===================================================================== */

/* 0-1. 전역 리스트 체크박스 가운데 정렬 */
#result_list th.action-checkbox-column,
#result_list td.action-checkbox {
    text-align: center !important;
    vertical-align: middle !important;
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    padding-left: 4px !important;
    padding-right: 4px !important;
}
#result_list td.action-checkbox input[type="checkbox"] {
    margin: 0 auto !important;
    display: block !important;
}

/* 0-2. 전역 리스트 테이블 열 구분선 + 좌우 패딩 균일화 + 행 높이 통일 */
#result_list th,
#result_list td {
    border-right: 1px solid #e5e7eb !important;
    padding-left: 5px !important;
    padding-right: 5px !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
}
/* 행 높이 최솟값 고정 (내용이 많으면 자동 확장) */
#result_list tbody tr {
    height: 44px !important;
}
#result_list th:last-child,
#result_list td:last-child {
    border-right: none !important;
}

/* 0-3. 전역 체크박스 선택 행 하이라이트 (연녹색 파스텔) */
#result_list tbody tr.selected td,
#result_list tbody tr.selected th {
    background-color: #d1fae5 !important;
}

/* 0-4. 전역 리스트 열 헤더 배경색 */
#result_list thead tr {
    background-color: #e8edf5 !important;
}
.dark #result_list thead tr {
    background-color: #1e2535 !important;
}
/* sticky 검색/버튼 바 (JS가 body에 주입, estimate changelist) */
#sticky_search_bar {
    background-color: #ffffff;
}
.dark #sticky_search_bar {
    background-color: #0f172a;
    border-bottom-color: #1e293b !important;
}
/* 클론 sticky 헤더 (JS가 body에 주입) */
#sticky_result_container {
    background-color: #ffffff;
}
.dark #sticky_result_container {
    background-color: #0f172a;
}
#sticky_result_thead thead tr {
    background-color: #e8edf5 !important;
}
.dark #sticky_result_thead thead tr {
    background-color: #1e2535 !important;
}
#sticky_result_thead th {
    text-align: center !important;
    justify-content: center !important;
    border-right: 1px solid #e5e7eb !important;
    padding-left: 5px !important;
    padding-right: 5px !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
}
#sticky_result_thead th:last-child {
    border-right: none !important;
}
#sticky_result_thead th .flex {
    justify-content: center !important;
}

/* 0-4. 전역 리스트 컬럼 너비 표준화 (table-layout: fixed) */
#result_list {
    table-layout: fixed !important;
    width: 100% !important;
}
/* 셀 overflow 처리 */
#result_list th,
#result_list td {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* 날짜 열 — 100px */
#result_list .column-est_date,
#result_list .column-goods_order_date,
#result_list .column-meet_date,
#result_list .column-col_deposit_date,
#result_list .column-repair_receipt_date,
#result_list .column-repair_transfer_date,
#result_list .column-goods_assembly_diagram_sending_date,
#result_list .column-goods_finishing_diagram_sending_date,
#result_list .column-ti_date_1,
#result_list .column-get_est_date,
#result_list .column-get_order_date,
#result_list .column-get_estimate_date,
#result_list .column-get_board_date,
#result_list .column-get_arrival_date,
#result_list .column-get_delivery_date,
#result_list .column-get_cn_shipping_date,
#result_list .column-get_schedule_date { width: 100px !important; }

/* 불리언 아이콘 열 — 64px */
#result_list .column-cc_default,
#result_list .column-cc_keyman,
#result_list .column-get_cc_default,
#result_list .column-get_cc_keyman,
#result_list .column-cus_payment_confirmed,
#result_list .column-get_payment_confirmed,
#result_list .column-is_active,
#result_list .column-is_staff,
#result_list .column-get_is_emergency,
#result_list .column-get_is_emergency_order { width: 64px !important; }

/* ===== 고객 그룹(customergroup) 목록 열너비 — 컬럼별 개별 조정 ===== */
/* 아래 px 값만 바꾸면 각 열 너비를 독립적으로 조정할 수 있음 */
body.model-customergroup #result_list .column-cg_name                    { width: 200px !important; }  /* 고객그룹 */
body.model-customergroup #result_list .column-cg_competitors             { width: auto !important; }  /* 경합업체 (나머지 폭 자동) */
body.model-customergroup #result_list .column-cg_credit_sales            { width: 130px !important; }  /* 외상매출 */
body.model-customergroup #result_list .column-cg_order_amount            { width: 130px !important; }  /* 수주금액 */
body.model-customergroup #result_list .column-get_total_amount           { width: 130px !important; }  /* 합계 */
body.model-customergroup #result_list .column-get_credit_limit_display   { width: 130px !important; }  /* 여신한도 */
body.model-customergroup #result_list .column-get_bond_age_display       { width:  80px !important; }  /* 채권월령 */
body.model-customergroup #result_list .column-get_bond_age_limit_display { width:  90px !important; }  /* 채권월령 한도 */
body.model-customergroup #result_list .column-cg_payment_due_date        { width: 100px !important; }  /* 결제예정일 */
body.model-customergroup #result_list .column-get_payment_amount_display { width: 130px !important; }  /* 결제예정금액 */
body.model-customergroup #result_list .column-get_customer_list          { width: auto !important; }  /* 소속 고객사 (나머지 폭 자동) */

/* ===== [전역] 목록(change-list)·등록/수정(change-form) 페이지: 상단 Unfold 헤더 숨김 ===== */
body.change-list #main > div:has(#header-inner),
body.change-list #main > div:first-child,
body.change-form #main > div:has(#header-inner),
body.change-form #main > div:first-child { display: none !important; }

/* ===== [전역] change/add 폼: #page는 뷰포트를 채워 하단 sticky 저장바가 화면 바닥에 붙게 함 =====
   (기존 min-height:0 해킹은 위 `div:has(#nav-filter)` 여백 버그로 생긴 스크롤바를 없애려던 것.
    선택자를 직계자식으로 좁혀 여백 버그를 없앤 지금은 Unfold 기본 min-h-screen(100vh)이면 충분 —
    짧은 폼에서 스크롤바도 안 생기고 저장바도 하단 고정됨.) */
body.change-form #page { min-height: 100vh !important; }

/* 상태 열 — 72px */
#result_list .column-goods_status { width: 72px !important; }
#result_list .column-goods_status_check { width: 80px !important; }
#result_list .column-get_delay_status { width: 72px !important; }

/* 담당자 열 — 72px */
#result_list .column-employee,
#result_list .column-get_employee_name { width: 72px !important; }

/* 고객사 열 — 150px */
#result_list .column-customer,
#result_list .column-cus_name_kr,
#result_list .column-get_cus_name_kr,
#result_list .column-get_customer_name { width: 150px !important; }

/* [송금(TT)] 열 너비 */
.model-remittancett #result_list .column-get_estimate_date   { width: 100px !important; }
.model-remittancett #result_list .column-get_classification  { width: 130px !important; }
.model-remittancett #result_list .column-get_goods_status    { width: 100px !important; }
.model-remittancett #result_list .column-get_order_date      { width: 100px !important; }
.model-remittancett #result_list .column-get_exchange_rate   { width:  70px !important; }
.model-remittancett #result_list .column-get_processing_company { width: 100px !important; }
.model-remittancett #result_list .column-get_est_price_cny   { width: 150px !important; }
.model-remittancett #result_list .column-get_final_price_cny { width: 150px !important; }
.model-remittancett #result_list .column-goods_tt_date       { width: 150px !important; }
body.model-remittancett.change-list td.field-goods_tt_date   { position: relative; }


/* 중문명 열 — 100px */
#result_list .column-cus_name_cn,
#result_list .column-get_cus_name_cn { width: 100px !important; }

/* 연락처 열 — 120px */
#result_list .column-cc_phone_display,
#result_list .column-emp_phone_display,
#result_list .column-get_phone { width: 120px !important; }

/* 이메일 열 — 160px */
#result_list .column-cc_email,
#result_list .column-emp_email,
#result_list .column-get_emp_email { width: 160px !important; }

/* 금액 열 — 100px */
#result_list .column-get_formatted_est_price,
#result_list .column-get_formatted_nego1,
#result_list .column-get_formatted_nego2,
#result_list .column-get_cn_est_price,
#result_list .column-get_cn_final_price,
#result_list .column-amount_display,
#result_list .column-display_ti_total_1,
#result_list .column-repair_total_cost,
#result_list .column-get_formatted_basic_fee,
#result_list .column-get_formatted_forklift_fee,
#result_list .column-get_formatted_safety_weight,
#result_list .column-get_safety_weight,
#result_list .column-get_cn_safety_weight_list,
#result_list .column-cg_credit_sales,
#result_list .column-cg_order_amount,
#result_list .column-get_total_amount,
#result_list .column-cg_sales_amount,
#result_list .column-cg_collection_amount { width: 100px !important; }

/* 사업자등록번호 — 130px */
#result_list .column-get_formatted_business_number { width: 130px !important; }

/* 대표자명 — 72px (이름 최대 4자) */
#result_list .column-cus_business_representative_name,
#result_list .column-get_cus_representative { width: 72px !important; }

/* 대표 담당자 — 180px (이름 + 연락처 조합) */
#result_list .column-default_contact_display { width: 180px !important; }

/* 직책/직무/지역구분 등 짧은 분류 텍스트 — 80px */
#result_list .column-cc_position,
#result_list .column-cc_job,
#result_list .column-cc_region_classification,
#result_list .column-emp_position,
#result_list .column-emp_dept,
#result_list .column-emp_team,
#result_list .column-repair_liable_party,
#result_list .column-sche_classification,
#result_list .column-display_sche_classification,
#result_list .column-get_classification,
#result_list .column-cg_bond_age { width: 80px !important; }

/* 견적진행업체 — 90px */
#result_list .column-goods_processing_company,
#result_list .column-get_goods_processing_companies { width: 90px !important; }

/* 协力사 编号 — 100px */
#result_list .column-get_cn_unique_number { width: 100px !important; }

/* 스태프/직원 ID — 100px */
#result_list .column-username,
#result_list .column-emp_id { width: 100px !important; }

/* 1. 전역 라벨 중앙 정렬 */
.change-form label,
.change-form .flex-col > label {
    text-align: center !important;
}

/* 전역 리스트 헤더(th) 중앙 정렬 */
#result_list th {
    text-align: center !important;
}

/* 전역 리스트 셀(td, tbody th) 중앙 정렬 — Unfold는 list_display_links 필드를 tbody>th로 렌더링 */
#result_list td,
#result_list tbody th {
    text-align: center !important;
    vertical-align: middle !important;
    justify-content: center !important;
}
#result_list td a,
#result_list tbody th a {
    display: block !important;
    text-align: center !important;
}

/* 2. 전역 Input/Select 강제 중앙 정렬 및 브라우저 스피너 제거 */
body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
body select,
body .js-money-formatting,
body .readonly-field,
body .readonly,
body .field-line .readonly {
    text-align: center !important;
    text-align-last: center !important;
}
body input::placeholder {
    text-align: center !important;
}

/* textarea 중앙 정렬 */
body textarea {
    text-align: center !important;
}

/* 완성예정일 + 납품예정일 좌측 정렬 (아이콘 겹침 방지) */
#content-main .inline-group td.field-goods_hr_completion_date input,
#content-main .inline-group td.field-goods_plate_completion_date input,
#content-main .inline-group td.field-goods_body_completion_date input,
#content-main .inline-group td.field-goods_hr_expected_delivery_date input,
#content-main .inline-group td.field-goods_plate_expected_delivery_date input,
#content-main .inline-group td.field-goods_body_expected_delivery_date input {
    text-align: left !important;
    text-align-last: left !important;
    padding-left: 12px !important;
}

/* 관계형 필드 옆 기본 아이콘 숨기기 & 폼 박스, 에러 메시지 정리 */
.related-widget-wrapper-link { display: none !important; }
div > fieldset { width: 30% !important; margin: 0 auto; }
.errornote, .errorlist.nonfield, .form-row .errorlist, .errorlist { display: none !important; }
.form-row.errors { margin: 0 !important; padding: 0 !important; border: none !important; }
/* 에러 텍스트 div 숨김 - tabular inline은 plain text(errorlist 미사용)이므로 별도 처리 */
.errors div.text-red-600,
.errors span.text-red-600 { display: none !important; }

/* 외주 견적(VendorQuoteCN) / 진행현황(VendorProgressCN) 상세 폼 전체 너비 */
.app-orders.model-vendorquotecn.change-form div > fieldset,
.app-orders.model-vendorquotecn.change-form .container,
.app-orders.model-vendorquotecn.change-form .max-w-2xl,
.app-orders.model-vendorquotecn.change-form .max-w-3xl,
.app-orders.model-vendorquotecn.change-form .max-w-5xl,
.app-orders.model-vendorquotecn.change-form .max-w-7xl,
.app-orders.model-vendorprogresscn.change-form div > fieldset,
.app-orders.model-vendorprogresscn.change-form .container,
.app-orders.model-vendorprogresscn.change-form .max-w-2xl,
.app-orders.model-vendorprogresscn.change-form .max-w-3xl,
.app-orders.model-vendorprogresscn.change-form .max-w-5xl,
.app-orders.model-vendorprogresscn.change-form .max-w-7xl {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* 상품 견적 계산용 데이터 행 숨김 (JS가 DOM에서 읽는 hidden div, 라벨만 노출되던 문제) */
.field-row:has(#calc-dataset) {
    display: none !important;
}

/* 상품 견적 기본정보 - 업체별 견적금액 행 상단 여백 (1행 lg:grid-cols-7 바로 다음 행) */
.app-orders.model-goodsestimate.change-form .lg\:grid-cols-7 + .field-row {
    margin-top: 20px !important;
}

/* 상품 견적 상세 폼 - 상단 헤더(브레드크럼/히스토리) 숨김 */
body.model-goodsestimate.change-form #main > div:first-child {
    display: none !important;
}
body.model-goodsestimate.change-form #content-main {
    margin-top: 1rem !important;
}

/* 공통 Input 필드 및 날짜 필드 디자인 강제 통일 */
.vTextField, .vBigIntegerField, .vIntegerField, .js-phone-formatting,
#id_emp_position, #id_emp_team, #id_emp_dept, #id_cus_region_classification, #id_cus_business_classification, #id_cc_max,
.js-date-formatting, .vDateField, input[type="date"] {
    width: 100% !important; 
    max-width: 100% !important; 
    min-width: 0 !important;    
    height: 38px !important;    
    line-height: 38px !important;
    padding: 0 10px !important; 
    border: 1px solid #e2e8f0 !important; 
    border-radius: 6px !important;
    box-sizing: border-box !important;
}

/* 브라우저 숫자 화살표 제거 (WebKit & Firefox) */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}
input[type="number"] {
    -moz-appearance: textfield !important;
    appearance: textfield !important;
}

/* 2. 전역 화면 너비 100% 꽉 차게 확장 (목록 & 상세 화면 모두 적용) */
body.change-list #content-main,
body.change-list .container,
body.change-list .max-w-7xl,
body.change-form #content-main,
body.change-form .container,
body.change-form .max-w-2xl,
body.change-form .max-w-3xl,
body.change-form .max-w-5xl,
body.change-form .max-w-7xl {
    max-width: 100% !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* 3. 공통 UI 요소 (우측 상단 액션 버튼, 커스텀 페이지네이션) */
ul.object-tools {
    display: flex !important; gap: 8px !important; position: absolute !important;
    top: -0.5rem !important; right: 0em !important; margin: 0 !important;
    padding: 0 !important; list-style: none !important; z-index: 40 !important;
}
ul.object-tools li a {
    display: flex !important; align-items: center !important; height: 2.25rem !important;
    padding: 0 1rem !important; background-color: white !important; border: 1px solid #e5e7eb !important;
    border-radius: 0.375rem !important; color: #4b5563 !important; font-size: 0.875rem !important;
    font-weight: 500 !important; text-decoration: none !important; text-transform: uppercase !important;
    box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05) !important; transition: all 0.2s !important;
}
ul.object-tools li a:hover { background-color: #f9fafb !important; color: #111827 !important; border-color: #d1d5db !important; }

.custom-paginator-container {
    display: flex !important; justify-content: space-between !important; align-items: center !important;
    width: 100% !important;
    /* 사이드바 하단 사용자영역(64px)과 높이·위치를 맞추고, 자체 상단선/여백 제거 */
    height: 64px !important; padding: 0 0.5rem !important;
    border-top: none !important; margin-top: 0 !important;
}

/* 하단 sticky 바(저장바·페이지네이터) 래퍼의 상단 경계선 제거 —
   사이드바 하단과 어긋나 보이던 윗줄을 없앰 */
#submit-row > div,
div:has(> .custom-paginator-container) {
    border-top: none !important;
}
.paginator-left { flex: 1; text-align: left; }
.paginator-center { flex: 2; display: flex; justify-content: center; }
.paginator-right { flex: 1; }
.pagination-btn-group { display: flex; gap: 0.4rem; align-items: center; }
.total-badge {
    font-size: 0.9rem; color: #374151; background-color: #f3f4f6;
    padding: 0.4rem 0.8rem; border-radius: 9999px; font-weight: 500;
}
.custom-page-btn {
    display: flex; align-items: center; justify-content: center; min-width: 2.2rem; height: 2.2rem;
    padding: 0 0.5rem; background-color: white; border: 1px solid #e5e7eb; border-radius: 0.375rem;
    color: #4b5563; font-size: 0.9rem; text-decoration: none; transition: all 0.2s; cursor: pointer; font-weight: 500;
}
.custom-page-btn:hover { background-color: #f9fafb; border-color: #d1d5db; color: #111827; }
.custom-page-btn.active { background-color: #9333ea !important; color: white !important; border-color: #9333ea !important; font-weight: bold; }
.custom-page-btn.disabled { color: #d1d5db !important; border-color: #f3f4f6 !important; background-color: white !important; cursor: default !important; pointer-events: none; }
.jump-btn, .nav-btn { font-size: 0.8rem; color: #6b7280; }

/* 4. 전역 인라인(Inline) 테이블 및 읽기 전용(Readonly) 공통 디자인 */
body .readonly-field, body .readonly, body input[readonly], body input[disabled],
body select[readonly], body select[disabled], body textarea[readonly], body textarea[disabled] {
    background-color: #e2e8f0 !important; color: #475569 !important;
    border: 1px solid #cbd5e1 !important; border-radius: 6px !important; 
    cursor: not-allowed !important; text-align: center; 
    height: auto !important; min-height: 38px !important; box-shadow: none !important;
}
select.readonly-field { appearance: none; -webkit-appearance: none; }

/* 다크모드 대응 */
.dark body .readonly-field, .dark body .readonly,
.dark body input[readonly], .dark body input[disabled],
.dark body select[readonly], .dark body select[disabled],
.dark body textarea[readonly], .dark body textarea[disabled] {
    background-color: #334155 !important; color: #94a3b8 !important; border-color: #475569 !important;
}

/* 🚨 예외 처리: 사업장 소재지 & 사업자등록증 사본 (흰색/투명 원상복구) */
body.model-customer input[name*="address"][readonly],
body.model-customer input[name*="addr"][readonly],
body.model-customercontact input[name*="address"][readonly],
body.model-customercontact input[name*="addr"][readonly],
body.model-customer table input[id$="-cc_address"] {
    background-color: #ffffff !important; color: #334155 !important;
    cursor: pointer !important; border-color: #e2e8f0 !important;
}

/* ── ERP 전체 필드 오류 통일 스타일 ── */
.erp-field-error,
body.model-customer input[name*="address"].erp-field-error,
body.model-customer input[name*="addr"].erp-field-error,
body.model-customer table input[id$="-cc_address"].erp-field-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

/* 서버 사이드 에러(Django/Unfold) 두꺼운 outline 제거 후 통일 */
.errors input, .errors select, .errors textarea,
.form-row.errors input, .form-row.errors select, .form-row.errors textarea {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}
.errors input:focus, .errors select:focus, .errors textarea:focus,
.form-row.errors input:focus, .form-row.errors select:focus, .form-row.errors textarea:focus {
    outline: 2px solid rgba(239, 68, 68, 0.4) !important;
    outline-offset: 0 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}
/* Select2 위젯(autocomplete_fields 등) 에러 테두리 통일 */
.errors .select2-selection--single,
.errors .select2-selection--multiple {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

body.model-customer input[type="file"],
body.model-customer .field-cus_business_registration_image .readonly,
body.model-customer .field-cus_business_registration_image input[readonly],
body.model-customer .field-cus_business_registration_image input[disabled] {  
    background-color: transparent !important; color: #334155 !important;
    cursor: default !important; border: none !important; 
}

/* 예외 처리 다크모드 대응 */
.dark body.model-customer input[name*="address"][readonly],
.dark body.model-customer input[name*="addr"][readonly],
.dark body.model-customercontact input[name*="address"][readonly],
.dark body.model-customercontact input[name*="addr"][readonly],
.dark body.model-customer table input[id$="-cc_address"] {
    background-color: #0f172a !important; color: #f8fafc !important; border-color: #334155 !important;
}
.dark body.model-customer input[type="file"],
.dark body.model-customer .field-cus_business_registration_image .readonly,
.dark body.model-customer .field-cus_business_registration_image input[readonly],
.dark body.model-customer .field-cus_business_registration_image input[disabled] {
    background-color: #0f172a !important; color: #f8fafc !important; border-color: #334155 !important;
}

/* 인라인 하단 "추가" 버튼 디자인 및 왼쪽 정렬 */
body .inline-group tr.add-row td {
    display: table-cell !important; text-align: left !important; 
    padding: 10px!important; border-bottom: none !important;
}
body .inline-group tr.add-row td a {
    background-color: #f1f5f9 !important; color: #9333ea !important;            
    border: 1px solid #9333ea !important; border-radius: 6px !important;        
    padding: 6px 16px !important; font-size: 13px !important; font-weight: bold !important;        
    display: inline-flex !important; align-items: center !important; justify-content: center !important;
    margin: 0 !important; float: left !important; transition: all 0.2s ease !important; 
}
body .inline-group tr.add-row td a:hover { background-color: #9333ea !important; color: white !important; }

/* 장고 기본 더미 시스템 컬럼 껍데기 완벽 숨기기 */
body .inline-group tbody tr:has(td.original),
body .inline-group td.original,
body .inline-group tbody tr p {
    display: none !important; height: 0 !important; border: none !important;
    margin: 0 !important; padding: 0 !important; width: 0 !important;
}

/* 5. 전역 목록(List) 테이블 헤더/내용 중앙 정렬 */
#result_list th, #result_list td {
    vertical-align: middle !important; text-align: center !important;
}
#result_list thead th .flex, #result_list thead th a {
    justify-content: center !important; text-align: center !important; width: 100% !important;
}


/* =====================================================================
   💼 [PART 2] SALES SECTOR (영업 관리)
   - 고객사, 고객그룹, 고객 담당자, 상담일지 UI 제어
===================================================================== */

/* ---------------------------------------------------------------------
   [2-0] 고객 그룹 (CustomerGroup Model) 목록 열 너비
   → 상단 "고객 그룹(customergroup) 목록 열너비 — 컬럼별 개별 조정" 블록으로 일원화함
--------------------------------------------------------------------- */

/* ---------------------------------------------------------------------
   [2-1] 고객사 (Customer Model)
--------------------------------------------------------------------- */
body.model-customer .max-w-2xl { max-width: 100% !important; }

/* 목록 주소:상세주소 = 2:1 비율 (절대값 고정 — 비율 % 쓰면 체크박스 등 다른 열이 흔들림) */
body.model-customer.change-list #result_list .column-get_cus_name_kr         { width: 200px !important; }
body.model-customer.change-list #result_list .column-get_employee_name        { width: 80px !important; }
body.model-customer.change-list #result_list .column-get_cus_representative   { width: 80px !important; }
body.model-customer.change-list #result_list .column-get_cus_address_detail   { width: 110px !important; }
body.model-customer.change-list #result_list .column-default_contact_display  { width: 200px !important; }
/* 체크박스 열 고정 (table-layout:fixed 환경에서 다른 열 조정에 영향받지 않도록 명시) */
body.model-customer.change-list #result_list th.action-checkbox-column,
body.model-customer.change-list #result_list td.action-checkbox {
    width: 36px !important;
    min-width: 36px !important;
}

/* ---------------------------------------------------------------------
   [2-2] 고객 담당자 (CustomerContact Model) 리스트 정렬 및 열 너비
--------------------------------------------------------------------- */
/* 열 너비 개별 오버라이드 */
body.model-customercontact.change-list #result_list .column-customer          { width: 200px !important; }
body.model-customercontact.change-list #result_list .column-cc_name           { width: 130px !important; }
body.model-customercontact.change-list #result_list .column-cc_address_detail { width: 110px !important; }
body.model-customercontact.change-list #result_list .column-cc_email          { width: 200px !important; }
body.model-customercontact.change-list #result_list .column-get_cc_default,
body.model-customercontact.change-list #result_list .column-get_cc_keyman     { width: 52px !important; }

body.model-customercontact.change-list #result_list tbody th.field-customer {
    text-align: center !important;
    justify-content: center !important;
}
body.model-customercontact.change-list #result_list tbody th.field-customer a {
    display: block !important;
    text-align: center !important;
}

/* 4단 Grid 분할 레이아웃 */
body.model-customer #customer_form > div {
    display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; 
    gap: 20px !important; align-items: stretch !important; 
}
body.model-customer #customer_form > div > * { grid-column: 1 / -1 !important; }
body.model-customer #customer_form > div > fieldset.module {
    grid-column: span 1 !important; width: 100% !important; margin: 0 !important;
    display: flex !important; flex-direction: column !important;
}
body.model-customer fieldset.module > div { flex-grow: 1 !important; height: 100% !important; }

body.model-customer .inline-group, body.model-customer .inline-related, body.model-customer .submit-row {
    grid-column: 1 / -1 !important; width: 100% !important; margin-top: 0px !important;
}
body.model-customer .inline-group fieldset { width: 100% !important; max-width: 100% !important; margin: 0 !important; }

body.model-customer input[type="text"], body.model-customer input[type="number"],
body.model-customer select, body.model-customer .js-date-formatting, body.model-customer .js-phone-formatting {
    width: 100% !important; height: 38px !important; padding: 0 10px !important; box-sizing: border-box !important;
}
#erp-cus-search-field-select,
body.model-customer .erp-search-dropdown {
    width: auto !important; height: 36px !important; padding: 5px 8px !important;
}

/* 사업자등록증 이미지 크기 제한 및 기본 비우기 숨김 */
body.model-customer .field-cus_business_registration_image img {
    max-width: 100% !important; max-height: 230px !important; object-fit: contain !important;   
    border-radius: 8px !important; border: 1px solid #e2e8f0 !important; margin-bottom: 10px !important;
}
body.model-customer .field-cus_business_registration_image label:has(input[name$="-clear"]) {
    display: none !important;
}

/* 고객 담당자 인라인 헤더(라벨) 및 열 너비 세팅 */
body.model-customer .inline-group th { text-align: center !important; vertical-align: middle !important; }
body.model-customer .inline-group th span.flex, body.model-customer .inline-group th div.flex { justify-content: center !important; width: 100% !important; }

/* 고객 담당자 인라인: 기본배송지 & 주문결정 토글 버튼 정중앙 정렬 */
body.model-customer .inline-group td.field-cc_default div.flex-row,
body.model-customer .inline-group td.field-cc_keyman div.flex-row {
    justify-content: center !important;
    width: 100% !important;
}

body.model-customer .inline-group td.field-cc_default input[type="checkbox"],
body.model-customer .inline-group td.field-cc_keyman input[type="checkbox"] {
    margin: 0 auto !important;
}

body.model-customer .inline-group table { table-layout: fixed !important; width: 100% !important; }
body.model-customer .inline-group th.column-cc_default, body.model-customer .inline-group td.field-cc_default,
body.model-customer .inline-group th.column-cc_keyman, body.model-customer .inline-group td.field-cc_keyman { width: 70px !important; text-align: center !important; }
body.model-customer .inline-group th.column-cc_name, body.model-customer .inline-group th.column-cc_position, body.model-customer .inline-group th.column-cc_job { width: 6% !important; }
body.model-customer .inline-group th.column-cc_phone { width: 10% !important; }
body.model-customer .inline-group th.column-cc_email { width: 13% !important; }
body.model-customer .inline-group th.column-cc_region_classification, body.model-customer .inline-group td.field-cc_region_classification { width: 100px !important; }
body.model-customer .inline-group th.column-cc_address, body.model-customer .inline-group th.column-cc_address_detail { width: auto !important; }
body.model-customer .inline-group th.column-cc_max, body.model-customer .inline-group td.field-cc_max { width: 120px !important; } 
body.model-customer .inline-group th.column-cc_memo { width: 10% !important; }

body.model-customer .inline-group th:last-child, body.model-customer .inline-group td.delete,
body.model-customer .inline-group td:last-child { 
    width: 60px !important; text-align: center !important; vertical-align: middle !important; 
    padding-left: 0 !important; padding-right: 0 !important; 
}
body.model-customer .inline-group tr.add-row td { padding: 10px !important; }


/* 기본정보 고객그룹 필드 가운데정렬 */
body.model-customer .field-customer_group .select2-selection__rendered,
body.model-customer .field-customer_group .select2-search__field {
    text-align: center !important;
}
body.model-customer .field-customer_group .select2-selection--single {
    display: flex !important; align-items: center !important; justify-content: center !important;
}
body.model-customer .field-customer_group .select2-selection__arrow {
    display: none !important;
}

/* ---------------------------------------------------------------------
   [2-2] 고객 그룹 (CustomerGroup Model)
--------------------------------------------------------------------- */
body.model-customergroup #content-main, body.model-customergroup form#customergroup_form,
body.model-customergroup form#customergroup_form > div, body.model-customergroup fieldset.module,
body.model-customergroup .max-w-2xl {
    max-width: 100% !important; width: 100% !important; margin: 0 !important;
}

body.model-customergroup #customergroup_form > div > fieldset.module > .form-row {
    display: flex !important; flex-direction: row !important; gap: 15px !important; width: 100% !important;
}
body.model-customergroup #customergroup_form > div > fieldset.module > .form-row > div {
    flex: 1 !important; min-width: 0 !important;
}

body.model-customergroup #customergroup_form > div > fieldset.module > .form-row .readonly,
body.model-customergroup #customergroup_form > div > fieldset.module > .form-row input[type="text"] {
    display: block !important; width: 100% !important; height: 38px !important; line-height: 38px !important;
    border: 1px solid #e2e8f0 !important; border-radius: 6px !important; padding: 0 12px !important;
    text-align: center !important; box-sizing: border-box !important; box-shadow: none !important;
}
body.model-customergroup #customergroup_form > div > fieldset.module > .form-row .readonly { background-color: #f8fafc !important; }

/* 하위 소속 고객사 (Inline) 테이블 */
body.model-customergroup .inline-group { width: 100% !important; max-width: 100% !important; margin-top: 20px !important; }
body.model-customergroup .inline-group table { width: 100% !important; table-layout: fixed !important;  }
body.model-customergroup .inline-group tr.form-row { display: table-row !important; height: 40px !important; } 
body.model-customergroup .inline-group td { display: table-cell !important; }

body.model-customergroup .inline-group th, body.model-customergroup .inline-group td { 
    text-align: center !important; vertical-align: middle !important; padding: 8px !important; height: 40px !important; 
}
body.model-customergroup .inline-group th span.flex { justify-content: center !important; width: 100% !important; }

body.model-customergroup .inline-group td .readonly, body.model-customergroup .inline-group td p {
    border: none !important; background: transparent !important; height: auto !important; min-height: 0 !important; 
    padding: 0 !important; margin: 0 !important; line-height: normal !important;
    box-shadow: none !important; font-weight: 500 !important; text-align: center !important;
}
body.model-customergroup .inline-group tr.add-row { display: none !important; }


/* ---------------------------------------------------------------------
   [2-3] 고객 상담일지 (MeetingLog Model)
--------------------------------------------------------------------- */
/* 목록 열 너비 */
body.model-meetinglog.change-list #result_list .column-get_customer_name { width: 200px !important; }
body.model-meetinglog.change-list #result_list .column-get_contact_name  { width: 80px !important; }
body.model-meetinglog.change-list #result_list .column-get_department     { width: 100px !important; }
body.model-meetinglog.change-list #result_list .column-employee          { width: 80px !important; }
/* short_details: auto (너비 미지정 → 남은 공간 흡수) */

body.model-meetinglog .max-w-2xl { max-width: 100% !important; }

body.model-meetinglog #meetinglog_form > div {
    display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; 
    gap: 20px !important; align-items: start !important; 
}
body.model-meetinglog #meetinglog_form > div > * { grid-column: 1 / -1 !important; }

body.model-meetinglog #meetinglog_form > div > fieldset.module:nth-of-type(1),
body.model-meetinglog #meetinglog_form > div > fieldset.module:nth-of-type(2) {
    grid-column: span 1 !important; width: 100% !important; margin: 0 !important;
    display: flex !important; flex-direction: column !important;
}
body.model-meetinglog #meetinglog_form > div > fieldset.module:nth-of-type(1) > div,
body.model-meetinglog #meetinglog_form > div > fieldset.module:nth-of-type(2) > div {
    flex-grow: 1 !important; height: 350px !important;
}

body.model-meetinglog #meetinglog_form > div > fieldset.module:nth-of-type(3) {
    grid-column: 1 / -1 !important; width: 100% !important; margin-top: 10px !important;
}
body.model-meetinglog #meetinglog_form > div > fieldset.module:nth-of-type(3) .max-w-2xl { max-width: 100% !important; }
body.model-meetinglog textarea {
    width: 100% !important; max-width: 100% !important; min-height: 200px !important;
    resize: vertical !important; box-sizing: border-box !important;
    text-align: left !important;
}
body.model-meetinglog #id_meet_details {
    text-align: left !important;
}
body.model-meetinglog .submit-row { width: 100% !important; margin-top: 15px !important; }


/* ---------------------------------------------------------------------
   [2-4] 고객 담당자 (CustomerContact Model)
--------------------------------------------------------------------- */
body.model-customercontact form#customercontact_form > div > fieldset.module {
    width: 100% !important;
    max-width: 900px !important; 
    margin: 0 auto 30px auto !important;
    padding: 20px 30px !important; 
}

body.model-customercontact fieldset.module .form-row {
    display: flex !important;
    flex-direction: row !important;
    gap: 20px !important;
    width: 100% !important;
}
body.model-customercontact fieldset.module .form-row > div {
    flex: 1 !important;
    min-width: 0 !important;
}

body.model-customercontact .field-customer,
body.model-customercontact .field-customer .related-widget-wrapper {
    width: 100% !important;
    display: flex !important;
}

body.model-customercontact .field-customer .select2-container {
    width: 100% !important;
    min-width: 100% !important;
}

body.model-customercontact fieldset.module .form-row:has(input[type="checkbox"]),
body.model-customercontact fieldset.module .form-row:has(.checkbox-row) {
    justify-content: space-around !important;
    text-align: center !important;
}


/* ---------------------------------------------------------------------
   [2-5] 직원 (Employee Model)
--------------------------------------------------------------------- */
body.model-employee.change-form .max-w-2xl,
body.model-employee.change-form .max-w-3xl,
body.model-employee.change-form .max-w-5xl,
body.model-employee.change-form div > fieldset {
    max-width: 100% !important;
    width: 100% !important;
}

body.model-employee #employee_form > div > fieldset.module .form-row {
    display: flex !important;
    flex-direction: row !important;
    gap: 16px !important;
    width: 100% !important;
}

body.model-employee #employee_form > div > fieldset.module .form-row > div {
    flex: 1 !important;
    min-width: 0 !important;
}

body.model-employee #employee_form > div > fieldset.module .form-row input,
body.model-employee #employee_form > div > fieldset.module .form-row select {
    width: 100% !important;
    box-sizing: border-box !important;
}


/* =====================================================================
   📦 [PART 3] ORDERS SECTOR (수주 및 견적 관리)
   - 견적서, 상품 일정, 수주/실주 대시보드
===================================================================== */

/* ---------------------------------------------------------------------
   [3-0] 견적 리스트 (Estimate Changelist) 열 너비 고정
   제번(get_goods_cpn)은 너비 미지정 → 나머지 공간 전부 흡수
--------------------------------------------------------------------- */
body.model-estimate.change-list #result_list {
    table-layout: fixed !important;
    width: 100% !important;
}
body.model-estimate.change-list #result_list th.column-est_date,
body.model-estimate.change-list #result_list td.field-est_date                { width: 100px !important; }
body.model-estimate.change-list #result_list th.column-customer,
body.model-estimate.change-list #result_list td.field-customer                 { width: 200px !important; }
/* 고객제번(get_goods_cpn): 너비 미지정 → auto */
body.model-estimate.change-list #result_list th.column-employee,
body.model-estimate.change-list #result_list td.field-employee                 { width: 80px !important; }
/* 상품 상태 요약: 5개 pill 1줄 */
body.model-estimate.change-list #result_list th.column-get_goods_status_counts,
body.model-estimate.change-list #result_list td.field-get_goods_status_counts  { width: 300px !important; }

/* 견적진행업체: 여러 업체 표시 가능 */
body.model-estimate.change-list #result_list th.column-get_goods_processing_companies,
body.model-estimate.change-list #result_list td.field-get_goods_processing_companies { width: 130px !important; }
body.model-estimate.change-list #result_list th.column-get_goods_est_processing_companies,
body.model-estimate.change-list #result_list td.field-get_goods_est_processing_companies { width: 100px !important; }
/* 총 견적금액: 40,000,000 기준 */
body.model-estimate.change-list #result_list th.column-display_est_total_price,
body.model-estimate.change-list #result_list td.field-display_est_total_price  { width: 100px !important; }
/* 확인 상태: 🚨 확인필요 기준 */
body.model-estimate.change-list #result_list th.column-check_status,
body.model-estimate.change-list #result_list td.field-check_status             { width: 64px !important; }

/* 제번: 전역 nowrap 예외 — 줄바꿈 허용 */
body.model-estimate.change-list #result_list td.field-get_goods_cpn { white-space: normal !important; word-break: break-all !important; }

/* ── 거래처원장(TradeLedger) 목록 — 열너비 (일자/고객그룹/제번만 고정, 나머지 auto) ── */
body.model-tradeledgerentry.change-list #result_list .column-display_entry_date { width: 100px !important; } /* 일자 */
body.model-tradeledgerentry.change-list #result_list .column-get_customer       { width: 300px !important; } /* 고객그룹 */
body.model-tradeledgerentry.change-list #result_list .column-get_cpn            { width: 200px !important; } /* 제번 */
/* 매출·수금·외상매출·수주 = 남는 폭 auto 분배 (지정 안 함) */

/* ---------------------------------------------------------------------
   [3-1] 견적서 (Estimate Model) 메인 폼 & 상품 인라인 레이아웃
--------------------------------------------------------------------- */
body.model-estimate #content-main, body.model-estimate form#estimate_form,
body.model-estimate form#estimate_form > div, body.model-estimate fieldset,
body.model-estimate .max-w-2xl { max-width: 100% !important; width: 100% !important; }

body.model-estimate #estimate_form > div > fieldset.module .form-row { display: flex !important; gap: 15px !important; }
body.model-estimate #estimate_form > div > fieldset.module .form-row > div { flex: 1 !important; min-width: 0 !important; }

/* 상품(자식) 인라인 가로 스크롤 테이블 세팅 */
body.model-estimate .inline-group, body.model-estimate .inline-related {
    width: 100% !important; max-width: 100% !important; margin-left: 0 !important; margin-right: 0 !important;
    overflow-x: auto !important; display: block !important;
}
body.model-estimate .inline-group table { width: 100% !important; min-width: 3220px !important; table-layout: fixed !important; }
body.model-estimate .inline-group td div, body.model-estimate .inline-group td input {
    min-width: 0 !important; max-width: 100% !important; width: 100% !important; box-sizing: border-box !important;
}
body.model-estimate .inline-group th { text-align: center !important; vertical-align: middle !important; padding-left: 5px !important; padding-right: 5px !important; }
body.model-estimate .inline-group th span.flex { justify-content: center !important; width: 100% !important; }
body.model-estimate .inline-group td input, body.model-estimate .inline-group td select { text-align: center !important; text-align-last: center !important; }
body.model-estimate .inline-group tr.add-row td { padding: 10px 10px 18px 10px !important; }

/* ── 견적 기본 정보 구역 — 각 필드 너비 개별 세팅 ──
   아래 각 nth-child의 px 값만 바꾸면 해당 필드 너비가 조정됩니다.
   (필드를 채우고 남는 폭이 필요하면 그 항목을 `flex: 1 1 auto !important;`로 바꾸세요) */
body.model-estimate .form-row:has(.field-customer) {
    display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important;
    gap: 15px !important; width: 100% !important;
}
body.model-estimate .form-row:has(.field-customer) > div:nth-child(1) { flex: 1 1 auto !important; }                              /* 고객사 (나머지 폭 auto) */
body.model-estimate .form-row:has(.field-customer) > div:nth-child(2) { flex: 0 0 150px !important; max-width: 150px !important; } /* 고객사명(CN) */
body.model-estimate .form-row:has(.field-customer) > div:nth-child(3) { flex: 0 0 100px !important; max-width: 100px !important; } /* 채권 월령 */
body.model-estimate .form-row:has(.field-customer) > div:nth-child(4) { flex: 0 0 100px !important; max-width: 100px !important; } /* 영업 확인 */
body.model-estimate .form-row:has(.field-customer) > div:nth-child(5) { flex: 0 0 130px !important; max-width: 130px !important; } /* 담당자 */
body.model-estimate .form-row:has(.field-customer) > div:nth-child(6) { flex: 0 0 150px !important; max-width: 150px !important; } /* 견적일자 */
body.model-estimate .form-row:has(.field-customer) > div:nth-child(7) { flex: 0 0 150px !important; max-width: 150px !important; } /* 유효기간 */
body.model-estimate .form-row:has(.field-customer) > div:nth-child(8) { flex: 0 0 200px !important; max-width: 200px !important; } /* 총 견적금액 */
/* 좁은 칸에서 값이 글자 단위로 세로로 쪼개지지 않게 (라벨 제외, 값만 한 줄 유지) */
body.model-estimate .form-row:has(.field-customer) .readonly,
body.model-estimate .form-row:has(.field-customer) input,
body.model-estimate .form-row:has(.field-customer) select {
    white-space: nowrap !important;
}

/* 배송지(담당자) 구역 너비 황금비율 세팅 */
body.model-estimate .form-row:has(.field-contact) { 
    display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important;
    gap: 15px !important; width: 100% !important; 
}
body.model-estimate .form-row:has(.field-contact) > div:nth-child(1) { flex: 0 0 200px !important; max-width: 200px !important; } /* 담당자 */
body.model-estimate .form-row:has(.field-contact) > div:nth-child(2) { flex: 0 0 200px !important; max-width: 200px !important; } /* 연락처 */
body.model-estimate .form-row:has(.field-contact) > div:nth-child(3) { flex: 0 0 90px !important; max-width: 90px !important; }  /* 지역구분 */
select#id_cc_region_classification, 
select[id$="-cc_region_classification"] {
    pointer-events: none !important; /* 마우스 클릭 완전히 차단 */
    background-color: #f1f5f9 !important; /* 수정 불가 느낌의 옅은 회색 배경 */
    color: #64748b !important; /* 글자색도 약간 흐리게 */
    touch-action: none !important; /* 모바일 터치 차단 */
}
body.model-estimate .form-row:has(.field-contact) > div:nth-child(4) { flex: 1 1 auto !important; min-width: 250px !important; max-width: none !important; } /* 주소 */
body.model-estimate .form-row:has(.field-contact) > div:nth-child(5) { flex: 0 0 300px !important; max-width: 300px !important; } /* 상세주소 */
body.model-estimate .form-row:has(.field-contact) > div:nth-child(6) { flex: 0 0 250px !important; max-width: 250px !important; } /* 차량최대진입 */

/* 상품 인라인 boolean 토글 — 체크 시 원 우측 끝 보정 */
body.model-estimate .inline-group td.field-goods_is_emergency input[type="checkbox"]:checked::after { left: 50px !important; }
body.model-estimate .inline-group td.field-goods_is_print input[type="checkbox"]:checked::after { left: 17px !important; }

/* 상품 인라인 개별 열 너비 고정 */
body.model-estimate .inline-group th.column-goods_status, body.model-estimate .inline-group td.field-goods_status{ width: 70px !important; }
body.model-estimate .inline-group th.column-goods_is_emergency, body.model-estimate .inline-group td.field-goods_is_emergency { width: 80px !important; text-align: center !important; }
body.model-estimate .inline-group th.column-goods_is_print, body.model-estimate .inline-group td.field-goods_is_print { width: 45px !important; text-align: center !important; }
body.model-estimate .inline-group th.column-goods_type, body.model-estimate .inline-group td.field-goods_type { width: 80px !important; }
body.model-estimate .inline-group th.column-goods_customer_product_number, body.model-estimate .inline-group td.field-goods_customer_product_number { width: 120px !important; }
body.model-estimate .inline-group th.column-goods_classification, body.model-estimate .inline-group td.field-goods_classification { width: 160px !important; }

body.model-estimate .inline-group th.column-goods_x, body.model-estimate .inline-group td.field-goods_x,
body.model-estimate .inline-group th.column-goods_y, body.model-estimate .inline-group td.field-goods_y,
body.model-estimate .inline-group th.column-goods_a, body.model-estimate .inline-group td.field-goods_a,
body.model-estimate .inline-group th.column-goods_b, body.model-estimate .inline-group td.field-goods_b,
body.model-estimate .inline-group th.column-goods_c, body.model-estimate .inline-group td.field-goods_c { width: 80px !important; }

body.model-estimate .inline-group th.column-goods_a_material, body.model-estimate .inline-group td.field-goods_a_material,
body.model-estimate .inline-group th.column-goods_b_material, body.model-estimate .inline-group td.field-goods_b_material,
body.model-estimate .inline-group th.column-goods_s_material, body.model-estimate .inline-group td.field-goods_s_material,
body.model-estimate .inline-group th.column-goods_eject_material, body.model-estimate .inline-group td.field-goods_eject_material { width: 110px !important; }
body.model-estimate .inline-group th.column-goods_a_machining, body.model-estimate .inline-group td.field-goods_a_machining,
body.model-estimate .inline-group th.column-goods_b_machining, body.model-estimate .inline-group td.field-goods_b_machining { width: 80px !important; }
body.model-estimate .inline-group th.column-goods_bush_egp, body.model-estimate .inline-group td.field-goods_bush_egp,
body.model-estimate .inline-group th.column-goods_bush_gp, body.model-estimate .inline-group td.field-goods_bush_gp { width: 125px !important; }
body.model-estimate .inline-group th.column-goods_hr_country, body.model-estimate .inline-group td.field-goods_hr_country,
body.model-estimate .inline-group th.column-goods_hr_company, body.model-estimate .inline-group td.field-goods_hr_company { width: 110px !important; }
body.model-estimate .inline-group th.column-goods_deliveries_number, body.model-estimate .inline-group td.field-goods_deliveries_number { width: 65px !important; }
body.model-estimate .inline-group select.erp-delivery-count-select {
    width: 60px;
    padding: 8px 20px 8px 6px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    background-color: #fff;
    box-shadow: 0 1px 2px 0 rgba(0,0,0,.05);
    box-sizing: border-box;
    appearance: auto;
    cursor: pointer;
    line-height: 1.25rem;
}
body.model-estimate .inline-group th.column-goods_quantity, body.model-estimate .inline-group td.field-goods_quantity { width: 65px !important; }
body.model-estimate .inline-group td.field-goods_quantity input { width: 100% !important; box-sizing: border-box !important; }
body.model-estimate .inline-group th.column-goods_net_weight, body.model-estimate .inline-group td.field-goods_net_weight,
body.model-estimate .inline-group th.column-goods_safety_weight, body.model-estimate .inline-group td.field-goods_safety_weight { width: 80px !important; }
body.model-estimate .inline-group th.column-goods_basic_fee, body.model-estimate .inline-group td.field-goods_basic_fee,
body.model-estimate .inline-group th.column-goods_forklift_fee, body.model-estimate .inline-group td.field-goods_forklift_fee { width: 100px !important; }
body.model-estimate .inline-group th.column-goods_est_price, body.model-estimate .inline-group td.field-goods_est_price { width: 120px !important; }

body.model-estimate .inline-group th.column-goods_hr_completion_date, body.model-estimate .inline-group td.field-goods_hr_completion_date,
body.model-estimate .inline-group th.column-goods_plate_completion_date, body.model-estimate .inline-group td.field-goods_plate_completion_date,
body.model-estimate .inline-group th.column-goods_body_completion_date, body.model-estimate .inline-group td.field-goods_body_completion_date,
body.model-estimate .inline-group th.column-goods_hr_expected_delivery_date, body.model-estimate .inline-group td.field-goods_hr_expected_delivery_date,
body.model-estimate .inline-group th.column-goods_plate_expected_delivery_date, body.model-estimate .inline-group td.field-goods_plate_expected_delivery_date,
body.model-estimate .inline-group th.column-goods_body_expected_delivery_date, body.model-estimate .inline-group td.field-goods_body_expected_delivery_date { width: 140px !important; }
body.model-estimate .inline-group th.column-goods_notes, body.model-estimate .inline-group td.field-goods_notes { width: 200px !important; min-width: 200px !important; max-width: 200px !important; }
body.model-estimate .inline-group td.field-goods_notes input { width: 100% !important; max-width: 100% !important; box-sizing: border-box !important; }

body.model-estimate .inline-group th:last-child,
body.model-estimate .inline-group td.delete {
    width: 60px !important;
    min-width: 60px !important;
    text-align: center !important;
}
/* 기존 행의 delete toggle(flex-row)은 숨기고 inline-deletelink 텍스트만 표시 */
body.model-estimate .inline-group td.delete div.flex-row { display: none !important; }
body.model-estimate .inline-group td.delete .inline-deletelink { color: #ef4444 !important; font-size: 13px !important; font-weight: 600 !important; text-decoration: none !important; cursor: pointer !important; display: block !important; }
/* th:last-child 이후에 선언하여 last-child 매칭 시 덮어씌워지는 문제 방지 */
body.model-estimate .inline-group th.column-goods_request_company_multi, body.model-estimate .inline-group td.field-goods_request_company_multi { width: 230px !important; min-width: 230px !important; }


/* ---------------------------------------------------------------------
   [3-2] 견적 (Estimate) 부가 UI (판전개 버튼, 다중 선택 Select2)
--------------------------------------------------------------------- */
body.model-estimate .inline-group th.column-plate_deployment_button, 
body.model-estimate .inline-group td.field-plate_deployment_button {
    width: 60px !important; min-width: 60px !important; text-align: center !important; vertical-align: middle !important; padding: 0 !important; margin: 0 !important; 
}
body.model-estimate .inline-group td.field-plate_deployment_button > div,
body.model-estimate .inline-group td.field-plate_deployment_button div.flex-row,
body.model-estimate .inline-group td.field-plate_deployment_button div.readonly {
    border: none !important; background: transparent !important; box-shadow: none !important; padding: 0 !important; margin: 0 !important; width: 100% !important; height: 100% !important; display: flex !important; align-items: center !important; justify-content: center !important;
}
body.model-estimate .inline-group td.field-plate_deployment_button a { height: 38px !important; line-height: 38px !important; margin-top: 1px !important; }
/* 판전개 버튼: 기본 상태에서는 readonly wrapper의 cursor:not-allowed 제거 */
body.model-estimate .inline-group td.field-plate_deployment_button div.readonly { cursor: default !important; }
body.model-estimate .inline-group td.field-plate_deployment_button a { cursor: pointer !important; }
/* 부품 모드에서만 not-allowed 커서 */
body.model-estimate .inline-group td.field-plate_deployment_button.parts-locked a { cursor: not-allowed !important; }

/* 일정달력 버튼 */
body.model-estimate .inline-group th.column-schedule_calendar_button,
body.model-estimate .inline-group td.field-schedule_calendar_button {
    width: 60px !important; min-width: 60px !important; text-align: center !important; vertical-align: middle !important; padding: 0 !important; margin: 0 !important;
}
body.model-estimate .inline-group td.field-schedule_calendar_button > div,
body.model-estimate .inline-group td.field-schedule_calendar_button div.flex-row,
body.model-estimate .inline-group td.field-schedule_calendar_button div.readonly {
    border: none !important; background: transparent !important; box-shadow: none !important; padding: 0 !important; margin: 0 !important; width: 100% !important; height: 100% !important; display: flex !important; align-items: center !important; justify-content: center !important;
}
body.model-estimate .inline-group td.field-schedule_calendar_button a { height: 38px !important; line-height: 38px !important; margin-top: 1px !important; cursor: pointer !important; }

/* 부품 모드: disabled input/select 색상을 unfold Tailwind보다 높은 specificity로 강제 */
body.model-estimate .inline-group input:disabled,
body.model-estimate .inline-group select:disabled {
    background-color: #e2e8f0 !important;
    color: #475569 !important;
    border-color: #cbd5e1 !important;
}

body.model-estimate select.select2-hidden-accessible { position: absolute !important; width: 0 !important; height: 0 !important; padding: 0 !important; margin: 0 !important; border: none !important; opacity: 0 !important; }
/* select2 미초기화 시 native multi-select가 펼쳐져 겹치는 현상 방지 */
body.model-estimate .inline-group td.field-goods_request_company_multi select:not(.select2-hidden-accessible) { max-height: 38px !important; overflow: hidden !important; }
body.model-estimate .inline-group td.field-goods_request_company_multi span.select2.select2-container,
body.model-estimate .inline-group td.field-goods_request_company_multi span.select2.select2-container:focus,
body.model-estimate .inline-group td.field-goods_request_company_multi span.select2.select2-container.select2-container--focus { border: none !important; border-width: 0 !important; box-shadow: none !important; outline: none !important; background: transparent !important; min-width: 200px !important; width: 100% !important; }
body.model-estimate .inline-group td.field-goods_request_company_multi div.flex-row,
body.model-estimate .inline-group td.field-goods_request_company_multi div.flex-col { border: none !important; background: transparent !important; box-shadow: none !important; margin: 0 !important; padding: 0 !important; display: flex !important; align-items: center !important; justify-content: center !important; width: 100% !important; height: 100% !important; min-height: 38px !important; }
body.model-estimate .select2-container--default .select2-selection--multiple { border: 1px solid #dadada !important; border-radius: 6px !important; height: 38px !important; overflow: hidden !important; padding: 2px 4px !important; background-color: white !important; display: flex !important; align-items: center !important; flex-wrap: nowrap !important; cursor: pointer !important; transition: border-color 0.2s; }
body.model-estimate .select2-container--default.select2-container--focus .select2-selection--multiple { border-color: #9333ea !important; outline: none !important; }
body.model-estimate .select2-container--default .select2-selection--multiple .select2-selection__rendered { display: flex !important; flex-wrap: wrap !important; align-items: center !important; width: 100% !important; margin: 0 !important; padding: 0 !important; list-style: none !important; }
body.model-estimate .select2-container--default .select2-selection--multiple .select2-selection__choice { background-color: #f1f5f9 !important; color: #334155 !important; border: 1px solid #e2e8f0 !important; border-radius: 9999px !important; padding: 0 8px 0 10px !important; margin: 2px 4px 2px 0 !important; height: 22px !important; display: inline-flex !important; align-items: center !important; font-size: 12px !important; font-weight: 500 !important; flex-direction: row-reverse !important; white-space: nowrap !important; min-width: 40px !important; }
body.model-estimate .select2-container--default .select2-selection--multiple .select2-selection__choice__remove { color: #94a3b8 !important; margin-left: 6px !important; margin-right: 0 !important; border: none !important; font-size: 14px !important; line-height: 1 !important; }
body.model-estimate .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover { color: #ef4444 !important; background: transparent !important; }
body.model-estimate .select2-search.select2-search--inline { display: none !important; }
.select2-container--default .select2-results__option { font-size: 13px !important; color: #333 !important; padding: 6px 12px !important; }
.select2-container--default .select2-results__option[aria-selected="true"] { background-color: #f8fafc !important; color: #0f172a !important; font-weight: 600 !important; display: flex !important; justify-content: space-between !important; align-items: center !important; }
.select2-container--default .select2-results__option[aria-selected="true"]::after { content: '\2713' !important; color: #475569 !important; font-size: 14px !important; }
body.model-estimate .inline-group td.field-goods_request_company_multi { vertical-align: middle !important; padding-top: 0 !important; padding-bottom: 0 !important; margin-bottom: 1px !important; }

/* ---------------------------------------------------------------------
   flatpickr 날짜 범위 피커 전역 스타일
--------------------------------------------------------------------- */
.erp-date-range-picker,
.erp-date-range-picker.flatpickr-input,
.erp-date-range-picker:read-only { background: #fff !important; cursor: pointer !important; color: #374151 !important; }
.flatpickr-calendar { font-family: inherit; font-size: 12px; z-index: 99999 !important; }
.flatpickr-day.inRange { background: #ede9fe !important; border-color: #ede9fe !important; color: #5b21b6 !important; }
.flatpickr-day.startRange, .flatpickr-day.endRange { background: #7c3aed !important; border-color: #7c3aed !important; }
.flatpickr-day.selected { background: #7c3aed !important; border-color: #7c3aed !important; }

/* ---------------------------------------------------------------------
   [3-2-1] 수리 관리 (Repair Model)
--------------------------------------------------------------------- */
/* 목록 열 너비 */
body.model-repair.change-list #result_list .column-get_goods_info       { width: 400px !important; }
body.model-repair.change-list #result_list .column-repair_liable_party { width: 150px !important; }
body.model-repair.change-list #result_list .column-repair_vendor        { width: 150px !important; }
body.model-repair.change-list #result_list .column-repair_method        { width: 150px !important; }
/* repair_details, get_goods_info: auto */

/* 수리내역 입력 좌측 정렬 */
body.model-repair .field-repair_details input,
body.model-repair .field-repair_details textarea {
    text-align: left !important;
    text-align-last: left !important;
}

/* ---------------------------------------------------------------------
   [3-3] 수주/실주 관리 (OrderDropGoods Proxy Model)
--------------------------------------------------------------------- */
body.model-orderdropgoods .actions { display: none !important; }
body.model-orderdropgoods #changelist-form > .sticky,
body.model-orderdropgoods #changelist-form > div:has(select[name="action"]) { display: none !important; }

/* 목록 열 너비 */
body.model-orderdropgoods.change-list #result_list .column-get_est_date           { width: 100px !important; }
body.model-orderdropgoods.change-list #result_list .column-get_customer_name      { width: 200px !important; }
/* goods_customer_product_number: auto */
body.model-orderdropgoods.change-list #result_list .column-goods_classification   { width: 120px !important; }
body.model-orderdropgoods.change-list #result_list .column-get_employee_name      { width: 80px !important; }
body.model-orderdropgoods.change-list #result_list .column-goods_status           { width: 80px !important; }
body.model-orderdropgoods.change-list #result_list .column-goods_dropped_reason   { width: 100px !important; }
body.model-orderdropgoods.change-list #result_list .column-get_processing_company  { width: 100px !important; }
body.model-orderdropgoods.change-list #result_list .column-get_formatted_est_price { width: 100px !important; }
body.model-orderdropgoods.change-list #result_list .column-get_formatted_nego1    { width: 100px !important; }
body.model-orderdropgoods.change-list #result_list .column-get_formatted_nego2    { width: 100px !important; }
body.model-orderdropgoods.change-list #result_list .column-get_assembly_date      { width: 100px !important; }
body.model-orderdropgoods.change-list #result_list .column-get_finishing_date     { width: 100px !important; }
body.model-orderdropgoods.change-list #result_list .column-get_confirm_manager      { width: 80px !important; }
body.model-orderdropgoods.change-list #result_list .column-get_is_emergency_order { width: 52px !important; text-align: center !important; }

/* ---------------------------------------------------------------------
   [3-4] 상품 일정 관리 (ManageScheduleGoods Proxy Model)
--------------------------------------------------------------------- */
body.model-manageschedulegoods.change-list #result_list th.action-checkbox-column,
body.model-manageschedulegoods.change-list #result_list td.action-checkbox {
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
}

body.model-manageschedulegoods #content-main, body.model-manageschedulegoods form#manageschedulegoods_form,
body.model-manageschedulegoods form#manageschedulegoods_form > div, body.model-manageschedulegoods fieldset.module,
body.model-manageschedulegoods .max-w-2xl { max-width: 100% !important; width: 100% !important; margin: 0 !important; }

body.model-manageschedulegoods fieldset.module .form-row > div { flex: 1 !important; min-width: 0 !important; }

body.model-manageschedulegoods fieldset.module .readonly {
    display: block !important; width: 100% !important; height: 38px !important; line-height: 38px !important;
    background-color: #e2e8f0 !important; border: 1px solid #cbd5e1 !important; border-radius: 6px !important;
    padding: 0 12px !important; color: #475569 !important; font-weight: 500 !important; box-sizing: border-box !important;
    white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; cursor: not-allowed !important;
}

body.model-manageschedulegoods fieldset.module .readonly,
body.model-manageschedulegoods fieldset.module input,
body.model-manageschedulegoods fieldset.module select { text-align: center !important; text-align-last: center !important; }

body.model-manageschedulegoods fieldset.module .field-goods_notes .readonly,
body.model-manageschedulegoods fieldset.module .field-goods_notes input,
body.model-manageschedulegoods fieldset.module .field-goods_notes textarea {
    white-space: normal !important; height: auto !important; min-height: 38px !important; line-height: 1.5 !important; padding: 8px 12px !important;
    text-align: left !important; text-align-last: left !important;
}

/* 상품 일정 인라인 테이블 */
body.model-manageschedulegoods .inline-group { width: 90% !important; margin: 30px auto 40px auto !important; overflow-x: auto !important; }
body.model-manageschedulegoods .inline-group table { width: 100% !important; table-layout: fixed !important; min-width: 1000px !important; border-collapse: collapse !important; }
body.model-manageschedulegoods .inline-group th, body.model-manageschedulegoods .inline-group td { text-align: center !important; vertical-align: middle !important; border-bottom: 1px solid #e2e8f0 !important; padding: 8px !important; }
body.model-manageschedulegoods .inline-group th span.flex, body.model-manageschedulegoods .inline-group th a { justify-content: center !important; width: 100% !important; }
body.model-manageschedulegoods .inline-group td div { justify-content: center !important; min-width: 0 !important; }

body.model-manageschedulegoods .inline-group th.column-sche_classification, body.model-manageschedulegoods .inline-group td.field-sche_classification { width: 100px !important; }
body.model-manageschedulegoods .inline-group th.column-sche_completion_date, body.model-manageschedulegoods .inline-group th.column-sche_ship_date, body.model-manageschedulegoods .inline-group th.column-sche_arrival_date, body.model-manageschedulegoods .inline-group th.column-sche_delivery_date, body.model-manageschedulegoods .inline-group th.column-sche_actual_completion_date { width: 150px !important; }
body.model-manageschedulegoods .inline-group th:last-child, body.model-manageschedulegoods .inline-group td.delete { width: 60px !important; min-width: 60px !important; max-width: 60px !important; padding: 4px 8px !important; }
/* 체크박스 숨기고, 감싸는 div 마진 제거 → JS 버튼과 new-row 앵커 위치 통일 */
body.model-manageschedulegoods .inline-group td.delete input[type="checkbox"] { display: none !important; }
body.model-manageschedulegoods .inline-group td.delete div { margin-top: 0 !important; display: flex !important; justify-content: center !important; align-items: center !important; }
/* JS 삭제 버튼 & Django inline-deletelink 동일 스타일 */
body.model-manageschedulegoods .inline-group td.delete button,
body.model-manageschedulegoods .inline-group td.delete a.inline-deletelink { color: #dc2626 !important; font-weight: 700 !important; font-size: 13px !important; cursor: pointer !important; background: none !important; border: none !important; padding: 0 !important; text-decoration: none !important; display: block !important; text-align: center !important; width: 100% !important; }

body.model-manageschedulegoods .inline-group td input[type="text"], body.model-manageschedulegoods .inline-group td input[type="date"], body.model-manageschedulegoods .inline-group td .vDateField {
    width: 130px !important; max-width: 100% !important; margin: 0 auto !important; display: block !important; text-align: center !important; border: 1px solid #d1d5db !important; border-radius: 6px !important; height: 38px !important; box-sizing: border-box !important;
}
body.model-manageschedulegoods .inline-group tr.add-row td { text-align: left !important; padding: 10px !important; border-bottom: none !important; }

/* 상품 일정 목록 화면 테이블 레이아웃 */
body.model-manageschedulegoods #result_list { 
    display: table !important; table-layout: fixed !important; min-width: 1300px !important; border-collapse: separate !important; 
}
body.model-manageschedulegoods #result_list td::before { display: none !important; }

body.model-manageschedulegoods #result_list th.action-checkbox-column,
body.model-manageschedulegoods #result_list td.action-checkbox {
    width: 36px !important; min-width: 36px !important; max-width: 36px !important; padding: 0 !important;
}
body.model-manageschedulegoods #result_list th.action-checkbox-column > *,
body.model-manageschedulegoods #result_list td.action-checkbox > * {
    display: flex !important; justify-content: center !important; align-items: center !important; width: fit-content !important; margin: 0 auto !important;
}

body.model-manageschedulegoods #result_list th.column-goods_order_date                    { width: 100px !important; }
body.model-manageschedulegoods #result_list th.column-get_customer_name                   { width: 200px !important; }
body.model-manageschedulegoods #result_list th.column-get_customer_name_cn                 { width: 70px !important; }
body.model-manageschedulegoods #result_list th.column-goods_classification                 { width: 130px !important; }
body.model-manageschedulegoods #result_list th.column-memo_button                          { width: 50px !important; text-align: center !important; }
body.model-manageschedulegoods #result_list td.field-memo_button                           { text-align: center !important; }
body.model-manageschedulegoods #result_list th.column-get_employee_name                   { width: 80px !important; }
body.model-manageschedulegoods #result_list th.column-goods_status                        { width: 80px !important; }
body.model-manageschedulegoods #result_list th.column-get_is_emergency_order              { width: 52px !important; text-align: center !important; }
body.model-manageschedulegoods #result_list td.field-get_is_emergency_order               { text-align: center !important; }
body.model-manageschedulegoods #result_list th.column-get_processing_company             { width: 130px !important; }
body.model-manageschedulegoods #result_list th.column-get_schedule_summary                { width: 90px !important; }
body.model-manageschedulegoods #result_list th.column-goods_finishing_diagram_sending_date { width: 100px !important; }
body.model-manageschedulegoods #result_list th.column-get_finishing_delay                 { width: 80px !important; }
body.model-manageschedulegoods #result_list th.column-get_expected_delivery_dates         { width: 130px !important; }
body.model-manageschedulegoods #result_list th.column-get_completion_date                 { width: 100px !important; }
body.model-manageschedulegoods #result_list th.column-get_actual_completion_date          { width: 100px !important; }
body.model-manageschedulegoods #result_list th.column-goods_notes                         { width: 120px !important; }
body.model-manageschedulegoods #result_list th.column-get_delay_status                    { width: 90px !important; }

/* 스케줄 목록: <br>으로 다중 항목을 표시하는 열은 줄바꿈 허용 + 행 높이 자동 */
body.model-manageschedulegoods.change-list #result_list tbody tr {
    height: auto !important;
    min-height: 44px !important;
}
body.model-manageschedulegoods.change-list #result_list td.field-get_schedule_summary,
body.model-manageschedulegoods.change-list #result_list td.field-get_expected_delivery_dates,
body.model-manageschedulegoods.change-list #result_list td.field-get_completion_date,
body.model-manageschedulegoods.change-list #result_list td.field-get_actual_completion_date {
    white-space: normal !important;
    word-break: break-word !important;
    line-height: 1.6 !important;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
}

/* ---------------------------------------------------------------------
   [3-5] 상품 견적 관리 (GoodsEstimate Proxy Model)
--------------------------------------------------------------------- */
/* 목록 열 너비 (전역값과 다른 것만 오버라이드) */
body.model-goodsestimate.change-list #result_list .column-get_customer_name        { width: 200px !important; }
body.model-goodsestimate.change-list #result_list .column-goods_classification     { width: 120px !important; }
body.model-goodsestimate.change-list #result_list .column-goods_deliveries_number  { width: 60px !important; }
body.model-goodsestimate.change-list #result_list .column-get_final_profit_rate    { width: 80px !important; }
body.model-goodsestimate.change-list #result_list .column-goods_exchange_rate      { width: 60px !important; }
body.model-goodsestimate.change-list #result_list .column-get_effective_price      { width: 100px !important; }
body.model-goodsestimate.change-list #result_list .column-get_employee_name        { width: 80px !important; }
body.model-goodsestimate.change-list #result_list .column-goods_status             { width: 80px !important; }
body.model-goodsestimate.change-list #result_list .column-get_formatted_safety_weight { width: 80px !important; }
body.model-goodsestimate.change-list #result_list .column-goods_status_check       { width: 100px !important; }
body.model-goodsestimate.change-list #result_list .column-goods_detail_desc        { width: 100px !important; }

/* 상세 폼 견적 및 상품 정보 — H/R 가공국(36번째 트랙) 100px 고정 */
body.model-goodsestimate.change-form fieldset.module:nth-of-type(2) .form-row,
body.model-goodsestimate.change-form .egt-row {
    grid-template-columns: repeat(35, minmax(0, 1fr)) 100px repeat(2, minmax(0, 1fr)) !important;
}
/* goods_customer_product_number: auto (너비 미지정) */

body.model-goodsestimate #content-main, body.model-goodsestimate form#goodsestimate_form,
body.model-goodsestimate form#goodsestimate_form > div, body.model-goodsestimate fieldset.module { 
    max-width: 100% !important; width: 100% !important; min-width: 0 !important; margin: 0 !important; 
}

/* 1번 구역: 기본 정보 (상단 박스) */
body.model-goodsestimate fieldset.module:nth-of-type(1) { margin-bottom: 20px !important; padding: 15px !important; border: 1px solid #e2e8f0 !important; border-radius: 8px !important; background-color: #ffffff !important; }
body.model-goodsestimate fieldset.module:nth-of-type(1) div.form-rows { margin: 0 !important; padding: 0 !important; border: none !important; box-shadow: none !important; background: transparent !important; }
body.model-goodsestimate fieldset.module:nth-of-type(1) .form-row { display: flex !important; flex-direction: row !important; gap: 20px !important; border: none !important; padding: 0 !important; margin: 0 !important; }
body.model-goodsestimate fieldset.module:nth-of-type(1) .form-row > div { flex: 1 !important; min-width: 0 !important; padding: 0 !important; border: none !important; }
body.model-goodsestimate fieldset.module:nth-of-type(1) label { display: block !important; text-align: center !important; margin-bottom: 8px !important; font-weight: bold !important; font-size: 14px !important; color: #0f172a !important; }

body.model-goodsestimate fieldset.module:nth-of-type(1) .readonly,
body.model-goodsestimate fieldset.module:nth-of-type(1) .readonly-field,
body.model-goodsestimate fieldset.module:nth-of-type(1) div[class*="get_"] { 
    background-color: #e2e8f0 !important; color: #475569 !important; font-weight: 500 !important; font-size: 13px !important; 
    border: 1px solid #cbd5e1 !important; border-radius: 6px !important; height: 38px !important; line-height: 38px !important; 
    display: flex !important; align-items: center !important; justify-content: center !important; margin: 0 !important; cursor: not-allowed !important; 
}
body.model-goodsestimate fieldset.module:nth-of-type(1) input {
    display: block !important; width: 100% !important; height: 38px !important; line-height: 38px !important;
    border: 1px solid #e2e8f0 !important; border-radius: 6px !important; padding: 0 10px !important; color: #334155 !important;
    font-weight: 500 !important; box-sizing: border-box !important; background-color: #ffffff !important; margin: 0 !important;
}
body.model-goodsestimate fieldset.module:nth-of-type(1) input:focus { border-color: #9333ea !important; outline: 1px solid #9333ea !important; box-shadow: 0 0 0 1px #9333ea !important; }

/* 2번 구역: 견적 및 상품 정보 (가로 스크롤 영역) */
body.model-goodsestimate fieldset.module:nth-of-type(2) { margin: 0 !important; padding: 0 !important; border: none !important; }
body.model-goodsestimate fieldset.module:nth-of-type(2) div.form-rows {
    display: block !important; width: 100% !important; max-width: 100% !important; min-width: 0 !important;
    overflow-x: auto !important; overflow-y: hidden !important; margin: 0 !important; padding: 0 !important; border: none !important; box-shadow: none !important; background: transparent !important;
}
body.model-goodsestimate fieldset.module:nth-of-type(2) .form-row { 
    display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important; width: max-content !important; min-width: 100% !important; gap: 0 !important; margin: 0 !important; padding: 0 0 10px 0 !important; 
}
body.model-goodsestimate fieldset.module:nth-of-type(2) .form-row > div { 
    flex: 0 0 130px !important; width: 130px !important; max-width: 130px !important; min-width: 130px !important; 
    padding: 0 4px !important; margin: 0 !important; box-sizing: border-box !important; 
}
body.model-goodsestimate fieldset.module:nth-of-type(2) .form-row > div label { white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; display: block !important; width: 100% !important; text-align: center !important; font-size: 13px !important; }

body.model-goodsestimate fieldset.module:nth-of-type(2) .readonly,
body.model-goodsestimate fieldset.module:nth-of-type(2) input[type="number"],
body.model-goodsestimate fieldset.module:nth-of-type(2) input[type="text"],
body.model-goodsestimate fieldset.module:nth-of-type(2) select {
    display: block !important; width: 100% !important; height: 38px !important; line-height: 38px !important;
    border: 1px solid #e2e8f0 !important; border-radius: 6px !important; padding: 0 10px !important; color: #334155 !important;
    font-weight: 500 !important; box-sizing: border-box !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; text-align: center !important; margin: 0 !important;
    min-width: 0 !important; /* 박스 삐져나옴 방지 */
}
body.model-goodsestimate fieldset.module:nth-of-type(2) .readonly, body.model-goodsestimate fieldset.module:nth-of-type(2) input[readonly] { background-color: #e2e8f0 !important; color: #475569 !important; border-color: #cbd5e1 !important; cursor: not-allowed !important; }
body.model-goodsestimate fieldset.module:nth-of-type(2) input[type="number"], body.model-goodsestimate fieldset.module:nth-of-type(2) input[type="text"], body.model-goodsestimate fieldset.module:nth-of-type(2) select { background-color: #ffffff !important; }

/* ---------------------------------------------------------------------
   [3-6] 상품 일정 관리(실제) (ManageActualSchedule Proxy Model)
--------------------------------------------------------------------- */
body.model-manageactualschedule #content-main,
body.model-manageactualschedule form#manageactualschedule_form,
body.model-manageactualschedule form#manageactualschedule_form > div,
body.model-manageactualschedule fieldset.module,
body.model-manageactualschedule .max-w-2xl {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
}

body.model-manageactualschedule fieldset.module .form-row {
    display: flex !important;
    flex-direction: row !important;
    gap: 20px !important;
    width: 100% !important;
}
body.model-manageactualschedule fieldset.module .form-row > div {
    flex: 1 !important;
    min-width: 0 !important;
}

/* 기본 정보 행 — 주문일자/고객사/고객제번/구분/완성일 너비 개별 지정 */
body.model-manageactualschedule fieldset.module .form-row > div.field-get_order_date     { flex: 0 0 100px !important; max-width: 100px !important; }
body.model-manageactualschedule fieldset.module .form-row > div.field-get_customer_name  { flex: 1 1 auto !important; max-width: none !important; }
body.model-manageactualschedule fieldset.module .form-row > div.field-get_cpn            { flex: 0 0 200px !important; max-width: 200px !important; }
body.model-manageactualschedule fieldset.module .form-row > div.field-sche_classification { flex: 0 0 100px !important; max-width: 100px !important; }
body.model-manageactualschedule fieldset.module .form-row > div.field-sche_completion_date { flex: 0 0 100px !important; max-width: 100px !important; }

body.model-manageactualschedule fieldset.module select,
body.model-manageactualschedule fieldset.module input[type="text"],
body.model-manageactualschedule fieldset.module input[type="number"],
body.model-manageactualschedule fieldset.module input[type="date"],
body.model-manageactualschedule fieldset.module .readonly {
    width: 100% !important;
    height: 38px !important;
    line-height: 38px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px !important;
    padding: 0 10px !important;
    background-color: #ffffff !important;
    box-sizing: border-box !important;
    color: #334155 !important;
    font-size: 14px !important;
    text-align: center !important;
}

body.model-manageactualschedule fieldset.module .readonly,
body.model-manageactualschedule fieldset.module input[readonly] {
    background-color: #e2e8f0 !important;
    color: #475569 !important;
    border-color: #cbd5e1 !important;
    cursor: not-allowed !important;
    font-weight: bold !important;
}

/* manageactualschedule 리스트 컬럼 너비 */
body.model-manageactualschedule #result_list th.column-get_order_date    { width: 100px !important; }
body.model-manageactualschedule #result_list th.column-get_customer_name { width: 200px !important; }
/* get_cpn: auto */
body.model-manageactualschedule #result_list th.column-sche_classification { width: 90px !important; }
body.model-manageactualschedule #result_list th.column-get_goods_status   { width: 70px !important; }
body.model-manageactualschedule #result_list th.column-get_goods_notes    { width: 150px !important; }
body.model-manageactualschedule #result_list th.column-get_delivery_address { width: 300px !important; }
body.model-manageactualschedule #result_list th.column-get_hr_company     { width: 150px !important; }
body.model-manageactualschedule #result_list th.column-get_bl_no         { width: 170px !important; }
body.model-manageactualschedule #result_list th.column-sche_completion_date { width: 100px !important; }
body.model-manageactualschedule #result_list th.column-get_arrival_date  { width: 100px !important; }
body.model-manageactualschedule #result_list th.column-get_domestic_fee  { width: 120px !important; }
body.model-manageactualschedule #result_list th.column-get_shipping_fee  { width: 120px !important; }
body.model-manageactualschedule #result_list th.column-get_delivery_date { width: 100px !important; }
body.model-manageactualschedule #result_list th.column-get_dis_fee       { width: 120px !important; }

/* ---------------------------------------------------------------------
   [수리/가공 배송] add/change 폼 — 컨테이너/입력칸 최대 너비 사용
   (Unfold 그리드는 유지하되 max-w-2xl 폭 제한을 풀어 각 칸이 열을 꽉 채움)
--------------------------------------------------------------------- */
body.model-repairprocessdelivery #content-main,
body.model-repairprocessdelivery form#repairprocessdelivery_form,
body.model-repairprocessdelivery form#repairprocessdelivery_form > div,
body.model-repairprocessdelivery fieldset.module,
body.model-repairprocessdelivery .max-w-2xl {
    max-width: 100% !important;
    width: 100% !important;
}

/* [기본 정보] 행: 그리드 → flex 전환해 필드별 너비 지정 가능 (상품ID ~ 배송중량) */
body.model-repairprocessdelivery fieldset.rpd-basic .form-row {
    display: flex !important;
    flex-direction: row !important;
    gap: 16px !important;
}
body.model-repairprocessdelivery fieldset.rpd-basic .form-row > div {
    min-width: 0 !important;   /* flex 오버플로 방지 (flex 값은 아래 필드별 규칙이 지정) */
}
/* ↓ 개별 열너비 — px 값만 바꾸면 조정됨 (auto = 남는 공간 채움).
   selector에 '.form-row >'를 넣어 일반 규칙보다 우선순위를 확실히 높인다. */
body.model-repairprocessdelivery fieldset.rpd-basic .form-row > .field-goods      { flex: 0 0 400px !important; }  /* 상품ID */
body.model-repairprocessdelivery fieldset.rpd-basic .form-row > .field-rpd_date   { flex: 0 0 140px !important; }  /* 배차일자 */
body.model-repairprocessdelivery fieldset.rpd-basic .form-row > .field-rpd_reason { flex: 1 1 auto !important; }   /* 배차사유 */
body.model-repairprocessdelivery fieldset.rpd-basic .form-row > .field-rpd_goods  { flex: 1 1 auto !important; }   /* 배송물건(구체적) */
body.model-repairprocessdelivery fieldset.rpd-basic .form-row > .field-rpd_weight { flex: 0 0 120px !important; }  /* 배송중량 */

/* [수리/가공 배송] 목록(changelist) 컬럼 너비 — px 값만 바꾸면 조정됨 */
body.model-repairprocessdelivery #result_list th.column-rpd_date                 { width: 100px !important; }  /* 배차일자 */
body.model-repairprocessdelivery #result_list th.column-get_goods                { width: 400px !important; }  /* 고객사 / 제번 */
body.model-repairprocessdelivery #result_list th.column-rpd_goods                { width: auto !important; }   /* 배송물건(구체적) — 남는 공간 */
body.model-repairprocessdelivery #result_list th.column-rpd_reason               { width: 150px !important; }  /* 배차사유 */
body.model-repairprocessdelivery #result_list th.column-rpd_weight               { width: 100px !important; }  /* 배송중량 */
body.model-repairprocessdelivery #result_list th.column-rpd_origin_customer      { width: 200px !important; }  /* 상차지_업체명 */
body.model-repairprocessdelivery #result_list th.column-rpd_origin_phone         { width: 120px !important; }  /* 상차지_연락처 */
body.model-repairprocessdelivery #result_list th.column-rpd_destination_customer { width: 200px !important; }  /* 하차지_업체명 */
body.model-repairprocessdelivery #result_list th.column-rpd_destination_phone    { width: 120px !important; }  /* 하차지_연락처 */

/* =====================================================================
   [3번 구역: 과거 이력 검색창 테이블]
   바깥 스크롤 최소화를 위해 3구역 내부에 전용 스크롤 생성
===================================================================== */
body.model-goodsestimate fieldset.module:nth-of-type(3) div.form-rows {
    border: none !important; box-shadow: none !important; background-color: transparent !important; padding: 0 !important; margin: 0 !important;
    /* 바깥(form-rows) 스크롤 제거 → 이력표(.hs-table-container)만 단일 스크롤.
       (예전엔 form-rows에도 max-height+overflow가 있어 세로 스크롤이 2개였음) */
    overflow: visible !important;
}
body.model-goodsestimate fieldset.module:nth-of-type(3) .form-row, body.model-goodsestimate fieldset.module:nth-of-type(3) .field-line { border: none !important; padding: 0 !important; margin: 0 !important; }
body.model-goodsestimate fieldset.module:nth-of-type(3) label { display: none !important; }

body.model-goodsestimate table.hs-table { 
    width: max-content !important; min-width: 100% !important; table-layout: fixed !important; border-collapse: collapse !important; 
}
body.model-goodsestimate table.hs-table th, body.model-goodsestimate table.hs-table td {
    width: 130px !important; max-width: 130px !important; min-width: 130px !important;
    padding: 8px 4px !important; text-align: center !important; vertical-align: middle !important;
    box-sizing: border-box !important; overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important;
    border-bottom: 1px solid #e2e8f0 !important; border-right: 1px solid #e2e8f0 !important; 
}

/* 3구역 헤더 세로 틀고정: position sticky로 스크롤 시 천장 고정 */
body.model-goodsestimate table.hs-table th {
    border-top: 1px solid #e2e8f0 !important;
    color: #334155 !important;
    font-weight: bold !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 20 !important;
    background-color: #f1f5f9 !important;
    box-shadow: 0 1px 0 #e2e8f0 !important;
}


/* =====================================================================
   [2, 3구역] 열 너비 및 가로 스크롤 동기화 (nth-child 기반 공유)
===================================================================== */
body.model-goodsestimate fieldset.module:nth-of-type(2) .form-row > div:nth-child(1), body.model-goodsestimate table.hs-table th:nth-child(1), body.model-goodsestimate table.hs-table td:nth-child(1) { flex: 0 0 120px !important; width: 120px !important; max-width: 120px !important; min-width: 120px !important; }
body.model-goodsestimate fieldset.module:nth-of-type(2) .form-row > div:nth-child(2), body.model-goodsestimate table.hs-table th:nth-child(2), body.model-goodsestimate table.hs-table td:nth-child(2) { flex: 0 0 150px !important; width: 150px !important; max-width: 150px !important; min-width: 150px !important; }
body.model-goodsestimate fieldset.module:nth-of-type(2) .form-row > div:nth-child(3), body.model-goodsestimate table.hs-table th:nth-child(3), body.model-goodsestimate table.hs-table td:nth-child(3) { flex: 0 0 140px !important; width: 140px !important; max-width: 140px !important; min-width: 140px !important; }
body.model-goodsestimate fieldset.module:nth-of-type(2) .form-row > div:nth-child(4), body.model-goodsestimate table.hs-table th:nth-child(4), body.model-goodsestimate table.hs-table td:nth-child(4) { flex: 0 0 70px !important; width: 70px !important; max-width: 70px !important; min-width: 70px !important; }
body.model-goodsestimate fieldset.module:nth-of-type(2) .form-row > div:nth-child(5), body.model-goodsestimate table.hs-table th:nth-child(5), body.model-goodsestimate table.hs-table td:nth-child(5) { flex: 0 0 70px !important; width: 70px !important; max-width: 70px !important; min-width: 70px !important; }
body.model-goodsestimate fieldset.module:nth-of-type(2) .form-row > div:nth-child(7), body.model-goodsestimate table.hs-table th:nth-child(7), body.model-goodsestimate table.hs-table td:nth-child(7) { flex: 0 0 70px !important; width: 70px !important; max-width: 70px !important; min-width: 70px !important; }
body.model-goodsestimate fieldset.module:nth-of-type(2) .form-row > div:nth-child(8), body.model-goodsestimate table.hs-table th:nth-child(8), body.model-goodsestimate table.hs-table td:nth-child(8) { flex: 0 0 100px !important; width: 100px !important; max-width: 100px !important; min-width: 100px !important; }
body.model-goodsestimate fieldset.module:nth-of-type(2) .form-row > div:nth-child(13), body.model-goodsestimate table.hs-table th:nth-child(13), body.model-goodsestimate table.hs-table td:nth-child(13) { flex: 0 0 70px !important; width: 70px !important; max-width: 70px !important; min-width: 70px !important; }
body.model-goodsestimate fieldset.module:nth-of-type(2) .form-row > div:nth-child(14), body.model-goodsestimate table.hs-table th:nth-child(14), body.model-goodsestimate table.hs-table td:nth-child(14) { flex: 0 0 110px !important; width: 110px !important; max-width: 110px !important; min-width: 110px !important; }
body.model-goodsestimate fieldset.module:nth-of-type(2) .form-row > div:nth-child(25), body.model-goodsestimate fieldset.module:nth-of-type(2) .form-row > div:nth-child(26), body.model-goodsestimate fieldset.module:nth-of-type(2) .form-row > div:nth-child(27), body.model-goodsestimate fieldset.module:nth-of-type(2) .form-row > div:nth-child(28),
body.model-goodsestimate table.hs-table th:nth-child(25), body.model-goodsestimate table.hs-table td:nth-child(25), body.model-goodsestimate table.hs-table th:nth-child(26), body.model-goodsestimate table.hs-table td:nth-child(26), body.model-goodsestimate table.hs-table th:nth-child(27), body.model-goodsestimate table.hs-table td:nth-child(27), body.model-goodsestimate table.hs-table th:nth-child(28), body.model-goodsestimate table.hs-table td:nth-child(28) { flex: 0 0 90px !important; width: 90px !important; max-width: 90px !important; min-width: 90px !important; }
body.model-goodsestimate fieldset.module:nth-of-type(2) .form-row > div:nth-child(29), body.model-goodsestimate table.hs-table th:nth-child(29), body.model-goodsestimate table.hs-table td:nth-child(29) { flex: 0 0 230px !important; width: 230px !important; max-width: 230px !important; min-width: 230px !important; }
body.model-goodsestimate fieldset.module:nth-of-type(2) .form-row > div:nth-child(30), body.model-goodsestimate table.hs-table th:nth-child(30), body.model-goodsestimate table.hs-table td:nth-child(30) { flex: 0 0 80px !important; width: 80px !important; max-width: 80px !important; min-width: 80px !important; }
body.model-goodsestimate fieldset.module:nth-of-type(2) .form-row > div:nth-child(31), body.model-goodsestimate fieldset.module:nth-of-type(2) .form-row > div:nth-child(32), body.model-goodsestimate fieldset.module:nth-of-type(2) .form-row > div:nth-child(33),
body.model-goodsestimate table.hs-table th:nth-child(31), body.model-goodsestimate table.hs-table td:nth-child(31), body.model-goodsestimate table.hs-table th:nth-child(32), body.model-goodsestimate table.hs-table td:nth-child(32), body.model-goodsestimate table.hs-table th:nth-child(33), body.model-goodsestimate table.hs-table td:nth-child(33) { flex: 0 0 90px !important; width: 90px !important; max-width: 90px !important; min-width: 90px !important; }
body.model-goodsestimate fieldset.module:nth-of-type(2) .form-row > div:nth-child(34), body.model-goodsestimate table.hs-table th:nth-child(34), body.model-goodsestimate table.hs-table td:nth-child(34) { flex: 0 0 100px !important; width: 100px !important; max-width: 100px !important; min-width: 100px !important; }
body.model-goodsestimate fieldset.module:nth-of-type(2) .form-row > div:nth-child(35), body.model-goodsestimate table.hs-table th:nth-child(35), body.model-goodsestimate table.hs-table td:nth-child(35) { flex: 0 0 100px !important; width: 100px !important; max-width: 100px !important; min-width: 100px !important; }


/* =====================================================================
   [2, 3구역 가로+세로 스크롤 십자가 틀고정 (Sticky)]
===================================================================== */
body.model-goodsestimate fieldset.module:nth-of-type(2) .form-row > div:nth-child(-n+3), 
body.model-goodsestimate table.hs-table th:nth-child(-n+3), 
body.model-goodsestimate table.hs-table td:nth-child(-n+3) { 
    position: sticky !important; z-index: 10 !important; background-clip: padding-box !important; 
}
body.model-goodsestimate fieldset.module:nth-of-type(2) .form-row > div:nth-child(1), body.model-goodsestimate table.hs-table th:nth-child(1), body.model-goodsestimate table.hs-table td:nth-child(1) { left: 0 !important; }
body.model-goodsestimate fieldset.module:nth-of-type(2) .form-row > div:nth-child(2), body.model-goodsestimate table.hs-table th:nth-child(2), body.model-goodsestimate table.hs-table td:nth-child(2) { left: 120px !important; }
body.model-goodsestimate fieldset.module:nth-of-type(2) .form-row > div:nth-child(3), body.model-goodsestimate table.hs-table th:nth-child(3), body.model-goodsestimate table.hs-table td:nth-child(3) { left: 270px !important; box-shadow: 2px 0 5px -2px rgba(0,0,0,0.1) !important; }

/* 폼 배경색 */
body.model-goodsestimate fieldset.module:nth-of-type(2) .form-row > div:nth-child(-n+3) { background-color: #ffffff !important; }

/* 데이터(td) 배경색 및 호버 효과 */
body.model-goodsestimate table.hs-table td:nth-child(-n+3) { background-color: #ffffff !important; }
body.model-goodsestimate table.hs-table tbody tr:hover td:nth-child(-n+3) { background-color: #f1f5f9 !important; }

/* 가로+세로 틀고정이 겹치는 왼쪽 상단 3칸: z-index를 30으로 올려 데이터 위에 항상 표시 */
body.model-goodsestimate table.hs-table th:nth-child(-n+3) {
    background-color: #f1f5f9 !important;
    z-index: 30 !important;
}


/* =====================================================================
   🛠️ [PART 4] REPAIR & EXCEPTIONS (수리 관리 및 기타 예외 처리)
===================================================================== */

/* ---------------------------------------------------------------------
   [4-1] 수리 관리 (Repair Model)
--------------------------------------------------------------------- */
body.model-repair #content-main, body.model-repair form#repair_form,
body.model-repair form#repair_form > div, body.model-repair fieldset.module,
body.model-repair .max-w-2xl { 
    max-width: 100% !important; width: 100% !important; margin: 0 !important; 
}
body.model-repair fieldset.module .form-row { 
    display: flex !important; flex-direction: row !important; gap: 20px !important; width: 100% !important; 
}
body.model-repair fieldset.module .form-row > div { 
    flex: 1 !important; min-width: 0 !important; 
}
body.model-repair textarea {
    width: 100% !important; max-width: 100% !important; min-height: 200px !important; 
    resize: vertical !important; box-sizing: border-box !important;
}
body.model-repair fieldset.module select, body.model-repair fieldset.module input[type="text"],
body.model-repair fieldset.module input[type="number"], body.model-repair fieldset.module input[type="date"],
body.model-repair fieldset.module .readonly {
    width: 100% !important; height: 38px !important; line-height: 38px !important;
    border: 1px solid #e2e8f0 !important; border-radius: 6px !important; padding: 0 10px !important;
    background-color: #ffffff !important; box-sizing: border-box !important; color: #334155 !important;
    font-size: 14px !important;
}
body.model-repair fieldset.module .readonly, body.model-repair fieldset.module input[readonly] {
    background-color: #e2e8f0 !important; color: #475569 !important; border-color: #cbd5e1 !important;
    cursor: not-allowed !important; font-weight: bold !important; text-align: right !important;
}

/* 상단 6개 필드 너비 최적화 */
body.model-repair .field-repair_receipt_date { flex-basis: 12% !important; max-width: 12% !important; }
body.model-repair .field-goods { flex-basis: 40% !important; max-width: 40% !important; }
body.model-repair .field-repair_vendor { flex-basis: 12% !important; max-width: 12% !important; }
body.model-repair .field-repair_liable_party { flex-basis: 12% !important; max-width: 12% !important; }
body.model-repair .field-repair_method { flex-basis: 12% !important; max-width: 12% !important; }
body.model-repair .field-repair_transfer_date { flex-basis: 12% !important; max-width: 12% !important; }


/* ---------------------------------------------------------------------
   [4-2] 기타 예외 스크롤 및 컴포넌트 처리
--------------------------------------------------------------------- */
/* 고객 상담일지: 자동완성(Select2) 드롭다운 100% 강제 채우기 */
body.model-meetinglog .field-contact .related-widget-wrapper,
body.model-meetinglog .field-employee .related-widget-wrapper {
    width: 100% !important; flex-grow: 1 !important; display: flex !important;
}
body.model-meetinglog .select2-container--admin-autocomplete,
body.model-meetinglog .select2-container {
    width: 100% !important; min-width: 100% !important;
}
body.model-meetinglog .select2-container--admin-autocomplete .select2-selection--single {
    height: 38px !important; border-radius: 6px !important;
    display: flex !important; align-items: center !important; justify-content: center !important; box-shadow: none !important;
}
body.model-meetinglog .select2-container--admin-autocomplete .select2-selection__rendered {
    line-height: normal !important; text-align: center !important; width: 100% !important; padding-left: 0 !important;
}
body.model-meetinglog .select2-container--admin-autocomplete .select2-selection__arrow {
    height: 36px !important; top: 0 !important;
}

/* =====================================================================
   💰 [PART 5] FINANCE SECTOR (재무 및 수금 관리)
===================================================================== */
body.model-customercollection .max-w-2xl { max-width: 100% !important; }

/* ---------------------------------------------------------------------
   [5-1] 전체 컨테이너 통일 (바깥 테두리 삭제, 순정 유지)
--------------------------------------------------------------------- */
body.model-customercollection form#customercollection_form > div > fieldset.module {
    width: 100% !important;
    max-width: 1000px !important;
    margin: 0 auto 30px auto !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.model-customercollection .inline-group {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto 30px auto !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* 인라인 내부 fieldset: 전역 div>fieldset{width:30%} 덮어쓰기 */
body.model-customercollection .inline-related fieldset {
    width: 100% !important;
    margin: 0 !important;
}

/* ---------------------------------------------------------------------
   [5-2] 1번, 2번 섹터 '안쪽 하얀 박스' 내부 정렬 완벽 통일
--------------------------------------------------------------------- */
body.model-customercollection .form-rows .form-row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 30px !important;
    width: 100% !important;
    padding: 20px 30px !important;
    margin: 0 !important;
    border: none !important;
}

body.model-customercollection .inline-group fieldset.module .form-row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    gap: 30px !important;
    width: 100% !important;
    padding: 20px 30px !important;
    margin: 0 !important;
    border: none !important;
}

body.model-customercollection .form-rows .form-row > div,
body.model-customercollection .inline-group fieldset.module .form-row > div {
    padding: 0 !important; min-width: 0 !important; border: none !important;
}

/* 1,2 섹터 모든 제목 글자 중앙 정렬 통일 */
body.model-customercollection fieldset.module label {
    text-align: center !important; width: 100% !important; display: block !important; margin-bottom: 8px !important;
}

/* ---------------------------------------------------------------------
   [5-3] 개별 필드 너비 조절 (비율 할당)
--------------------------------------------------------------------- */
body.model-customercollection .field-customer .related-widget-wrapper { width: 100% !important; display: flex !important; }
body.model-customercollection .field-customer .select2-container { width: 100% !important; min-width: 100% !important; }

/* 📌 1번 섹터: 기본 수금 정보 */
body.model-customercollection .field-col_deposit_date div.min-w-56 { min-width: 0 !important; }
body.model-customercollection .field-col_deposit_date { flex: 0 0 150px !important; max-width: 150px !important; }
body.model-customercollection .field-customer { flex: 1 1 auto !important; min-width: 250px !important; } /* 남는 공간 쫙 차지! */
body.model-customercollection .field-col_method { flex: 0 0 200px !important; max-width: 200px !important; }
body.model-customercollection .field-col_amount { flex: 0 0 150px !important; max-width: 150px !important; }

/* 📌 2번 섹터: 계좌이체 (3칸) */
body.model-customercollection .field-trans_bank { flex: 0 0 200px !important; max-width: 200px !important; }
body.model-customercollection .field-trans_depositor { flex: 0 0 200px !important; max-width: 200px !important; }

/* 📌 2번 섹터: 카드 (5칸) */

body.model-customercollection .field-card_company { flex: 0 0 200px !important; max-width: 200px !important; }
body.model-customercollection .field-card_fee_rate { flex: 0 0 100px !important; max-width: 100px !important; }
body.model-customercollection .field-card_payment_date div.min-w-56 { min-width: 0 !important; }
body.model-customercollection .field-card_payment_date { flex: 0 0 150px !important; max-width: 150px !important; }
body.model-customercollection .field-card_bank { flex: 0 0 200px !important; max-width: 200px !important; }
body.model-customercollection .field-card_deposit_amount { flex: 0 0 150px !important; max-width: 150px !important; }

/* 📌 2번 섹터: 전자어음 (6칸) */
/* Unfold의 min-w-56(224px) 기본값 제거 — 이 제약이 있으면 6칸이 박스 밖으로 밀림 */
body.model-customercollection .field-bill_issue_date div.min-w-56,
body.model-customercollection .field-bill_due_date div.min-w-56 { min-width: 0 !important; }
body.model-customercollection .field-bill_no { flex: 0 0 280px !important; max-width: 280px !important; }
body.model-customercollection .field-bill_issuer { flex: 0 0 200px !important; max-width: 200px !important; }
body.model-customercollection .field-bill_issue_date { flex: 0 0 150px !important; max-width: 150px !important;}
body.model-customercollection .field-bill_due_date { flex: 0 0 150px !important; max-width: 150px !important; }
body.model-customercollection .field-bill_bank { flex: 0 0 200px !important; max-width: 200px !important; }
body.model-customercollection .field-bill_deposit_amount { flex: 0 0 150px !important; max-width: 150px !important; }
body.model-customercollection .field-bill_payment_status { flex: 0 0 200px !important; max-width: 200px !important; }
body.model-customercollection .field-bill_payment_status select { width: 100% !important; }

/* ---------------------------------------------------------------------
   [5-4] 불필요한 인라인 '삭제' 버튼 완벽 숨기기
--------------------------------------------------------------------- */
body.model-customercollection .inline-group .inline-deletelink {
    display: none !important;
}

/* ---------------------------------------------------------------------
   [5-4] 불필요한 인라인 안쪽 제목줄(#1) 완벽 숨기기
--------------------------------------------------------------------- */
/* 안쪽 h3 태그(제목줄)를 아예 날려버려서 군더더기 없는 입력 폼만 남깁니다! */
body.model-customercollection .inline-group .inline-related > h3 {
    display: none !important;
}


/* customercollection 리스트 컬럼 너비 */
body.model-customercollection #result_list th.action-checkbox-column,
body.model-customercollection #result_list td.action-checkbox {
    width: 36px !important; min-width: 36px !important; max-width: 36px !important;
}
body.model-customercollection #result_list th.column-col_deposit_date { width: 300px !important; }
body.model-customercollection #result_list th.column-customer          { width: 400px !important; }
/* col_method: auto */
body.model-customercollection #result_list th.column-amount_display    { width: 150px !important; }


/* =====================================================================
   💰 [PART 6] FINANCE SECTOR - TAX INVOICE (세금계산서 상세화면 절대무적 확장)
===================================================================== */

body.model-taxinvoice #content-main { max-width: 100% !important; }
body.model-taxinvoice form#taxinvoice_form {
    max-width: 1400px !important;
    margin: 0 auto !important;
}

body.model-taxinvoice fieldset.module {
    width: 100% !important;
    max-width: 100% !important;
}

body.model-taxinvoice .max-w-2xl,
body.model-taxinvoice .max-w-4xl,
body.model-taxinvoice .min-w-56 {
    max-width: 100% !important;
    min-width: 0 !important;
}

body.model-taxinvoice .form-rows .form-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 20px !important;
    width: 100% !important;
}

/* ---------------------------------------------------------------------
   [기본 정보 박스] - 1번째 묶음
--------------------------------------------------------------------- */
/* 📌 첫 번째 줄 (5칸 정렬: 날짜, 고객사, 사업자번호(고객사), 제번, 수주금액) */
body.model-taxinvoice fieldset:nth-of-type(1) .form-row:first-child > div:nth-child(1) { flex: 0 0 140px !important; }
body.model-taxinvoice fieldset:nth-of-type(1) .form-row:first-child > div:nth-child(2) { flex: 0 0 300px !important; }
body.model-taxinvoice fieldset:nth-of-type(1) .form-row:first-child > div:nth-child(3) { flex: 0 0 190px !important; }
body.model-taxinvoice fieldset:nth-of-type(1) .form-row:first-child > div:nth-child(4) { flex: 0 0 210px !important; }
body.model-taxinvoice fieldset:nth-of-type(1) .form-row:first-child > div:nth-child(5) { flex: 1 1 auto !important; min-width: 150px !important; }

/* 📌 두 번째 줄 (3칸 정렬: 세금발행 고객사, 사업자번호(세금발행), 특이사항) */
body.model-taxinvoice fieldset:nth-of-type(1) .form-row.last > div:nth-child(1) { flex: 0 0 300px !important; max-width: 300px !important; }
body.model-taxinvoice fieldset:nth-of-type(1) .form-row.last > div:nth-child(2) { flex: 0 0 200px !important; max-width: 200px !important; }
body.model-taxinvoice fieldset:nth-of-type(1) .form-row.last > div:nth-child(3) { flex: 1 1 auto !important; }

/* 세금발행 고객사 드롭다운 꽉 채우기 + 텍스트 가운데 정렬 */
body.model-taxinvoice fieldset:nth-of-type(1) .form-row.last > div:nth-child(1) .select2-container { width: 100% !important; }
body.model-taxinvoice .field-customer .select2-selection__rendered { text-align: center !important; }

/* 특이사항 메모장 높이를 드롭다운이랑 비슷하게 맞춰서 안 어색하게 만들기 */
body.model-taxinvoice #id_ti_note { 
    width: 100% !important; 
    height: 42px !important; 
    min-height: 42px !important;
    resize: vertical !important; /* 필요하면 마우스로 늘릴 수 있게 허용 */
}
/* ---------------------------------------------------------------------
   [1차, 2차 발행 정보 박스] - 2번째, 3번째 묶음
--------------------------------------------------------------------- */
/* 4개의 칸(날짜, 금액, 부가세, 합계)을 1:1:1:1 비율로 예쁘게 나누기 */
body.model-taxinvoice fieldset:nth-of-type(2) .form-row > div,
body.model-taxinvoice fieldset:nth-of-type(3) .form-row > div {
    flex: 1 1 0% !important;
    min-width: 150px !important;
}

/* taxinvoice 리스트 컬럼 너비 */
body.model-taxinvoice #result_list th.column-get_estimate_date    { width: 100px !important; }
body.model-taxinvoice #result_list th.column-get_goods_customer   { width: 200px !important; }
/* get_goods_number: auto */
body.model-taxinvoice #result_list th.column-get_goods_classification { width: 110px !important; }
body.model-taxinvoice #result_list th.column-get_goods_status     { width: 100px !important; }
body.model-taxinvoice #result_list th.column-customer             { width: 200px !important; }
body.model-taxinvoice #result_list th.column-display_ti_date_1    { width: 100px !important; }
body.model-taxinvoice #result_list th.column-display_ti_amount_1  { width: 130px !important; }
body.model-taxinvoice #result_list th.column-display_ti_vat_1     { width: 130px !important; }
body.model-taxinvoice #result_list th.column-display_ti_total_1   { width: 130px !important; }
body.model-taxinvoice #result_list th.column-ti_note              { width: 150px !important; }

/* =====================================================================
   🔍 [ERP 공통] 커스텀 필터 패널 — Unfold 기본 요소 정리 + 간격 통일
   (manageschedulegoods / goodsestimate / vendorquotecn / vendorprogresscn /
    estimate / repair / orderdropgoods / manageactualschedule /
    customergroup / meetinglog / customer / customercollection / taxinvoice)
===================================================================== */
body.model-manageschedulegoods #changelist-filter a.xfull,
body.model-manageschedulegoods #changelist-filter li.xfull,
body.model-manageschedulegoods #changelist-filter p.xfull,
body.model-manageschedulegoods #changelist-filter-count,
body.model-schedulecheckgoods #changelist-filter a.xfull,
body.model-schedulecheckgoods #changelist-filter li.xfull,
body.model-schedulecheckgoods #changelist-filter p.xfull,
body.model-schedulecheckgoods #changelist-filter-count,
body.model-goodsestimate #changelist-filter a.xfull,
body.model-goodsestimate #changelist-filter li.xfull,
body.model-goodsestimate #changelist-filter p.xfull,
body.model-goodsestimate #changelist-filter-count,
body.model-vendorquotecn #changelist-filter a.xfull,
body.model-vendorquotecn #changelist-filter li.xfull,
body.model-vendorquotecn #changelist-filter p.xfull,
body.model-vendorquotecn #changelist-filter-count,
body.model-vendorprogresscn #changelist-filter a.xfull,
body.model-vendorprogresscn #changelist-filter li.xfull,
body.model-vendorprogresscn #changelist-filter p.xfull,
body.model-vendorprogresscn #changelist-filter-count,
body.model-estimate #changelist-filter a.xfull,
body.model-estimate #changelist-filter li.xfull,
body.model-estimate #changelist-filter p.xfull,
body.model-estimate #changelist-filter-count,
body.model-repair #changelist-filter a.xfull,
body.model-repair #changelist-filter li.xfull,
body.model-repair #changelist-filter p.xfull,
body.model-repair #changelist-filter-count,
body.model-orderdropgoods #changelist-filter a.xfull,
body.model-orderdropgoods #changelist-filter li.xfull,
body.model-orderdropgoods #changelist-filter p.xfull,
body.model-orderdropgoods #changelist-filter-count,
body.model-manageactualschedule #changelist-filter a.xfull,
body.model-manageactualschedule #changelist-filter li.xfull,
body.model-manageactualschedule #changelist-filter p.xfull,
body.model-manageactualschedule #changelist-filter-count,
body.model-repairprocessdelivery #changelist-filter a.xfull,
body.model-repairprocessdelivery #changelist-filter li.xfull,
body.model-repairprocessdelivery #changelist-filter p.xfull,
body.model-repairprocessdelivery #changelist-filter-count,
body.model-customergroup #changelist-filter a.xfull,
body.model-customergroup #changelist-filter li.xfull,
body.model-customergroup #changelist-filter p.xfull,
body.model-customergroup #changelist-filter-count,
body.model-meetinglog #changelist-filter a.xfull,
body.model-meetinglog #changelist-filter li.xfull,
body.model-meetinglog #changelist-filter p.xfull,
body.model-meetinglog #changelist-filter-count,
body.model-customer #changelist-filter a.xfull,
body.model-customer #changelist-filter li.xfull,
body.model-customer #changelist-filter p.xfull,
body.model-customer #changelist-filter-count,
body.model-customercollection #changelist-filter a.xfull,
body.model-customercollection #changelist-filter li.xfull,
body.model-customercollection #changelist-filter p.xfull,
body.model-customercollection #changelist-filter-count,
body.model-taxinvoice #changelist-filter a.xfull,
body.model-taxinvoice #changelist-filter li.xfull,
body.model-taxinvoice #changelist-filter p.xfull,
body.model-taxinvoice #changelist-filter-count {
    display: none !important;
}

body.model-manageschedulegoods #changelist-filter h3,
body.model-schedulecheckgoods #changelist-filter h3,
body.model-goodsestimate #changelist-filter h3,
body.model-vendorquotecn #changelist-filter h3,
body.model-vendorprogresscn #changelist-filter h3,
body.model-estimate #changelist-filter h3,
body.model-repair #changelist-filter h3,
body.model-orderdropgoods #changelist-filter h3,
body.model-manageactualschedule #changelist-filter h3,
body.model-repairprocessdelivery #changelist-filter h3,
body.model-customergroup #changelist-filter h3,
body.model-meetinglog #changelist-filter h3,
body.model-customer #changelist-filter h3,
body.model-customercollection #changelist-filter h3,
body.model-taxinvoice #changelist-filter h3,
body.model-remittancett #changelist-filter h3 {
    margin: 12px 0 4px 0 !important;
    font-size: 12px;
    font-weight: 700 !important;
}

body.model-manageschedulegoods #changelist-filter ul,
body.model-schedulecheckgoods #changelist-filter ul,
body.model-goodsestimate #changelist-filter ul,
body.model-vendorquotecn #changelist-filter ul,
body.model-vendorprogresscn #changelist-filter ul,
body.model-estimate #changelist-filter ul,
body.model-repair #changelist-filter ul,
body.model-orderdropgoods #changelist-filter ul,
body.model-manageactualschedule #changelist-filter ul,
body.model-repairprocessdelivery #changelist-filter ul,
body.model-customergroup #changelist-filter ul,
body.model-meetinglog #changelist-filter ul,
body.model-customer #changelist-filter ul,
body.model-customercollection #changelist-filter ul,
body.model-taxinvoice #changelist-filter ul,
body.model-remittancett #changelist-filter ul {
    margin: 0 !important;
    padding: 0 !important;
}

body.model-manageschedulegoods #changelist-filter li,
body.model-schedulecheckgoods #changelist-filter li,
body.model-goodsestimate #changelist-filter li,
body.model-vendorquotecn #changelist-filter li,
body.model-vendorprogresscn #changelist-filter li,
body.model-estimate #changelist-filter li,
body.model-repair #changelist-filter li,
body.model-orderdropgoods #changelist-filter li,
body.model-manageactualschedule #changelist-filter li,
body.model-repairprocessdelivery #changelist-filter li,
body.model-customergroup #changelist-filter li,
body.model-meetinglog #changelist-filter li,
body.model-customer #changelist-filter li,
body.model-customercollection #changelist-filter li,
body.model-taxinvoice #changelist-filter li,
body.model-remittancett #changelist-filter li {
    padding: 0 !important;
}

body.model-manageschedulegoods #changelist-filter-extra-actions,
body.model-schedulecheckgoods #changelist-filter-extra-actions,
body.model-goodsestimate #changelist-filter-extra-actions,
body.model-vendorquotecn #changelist-filter-extra-actions,
body.model-vendorprogresscn #changelist-filter-extra-actions,
body.model-estimate #changelist-filter-extra-actions,
body.model-repair #changelist-filter-extra-actions,
body.model-orderdropgoods #changelist-filter-extra-actions,
body.model-manageactualschedule #changelist-filter-extra-actions,
body.model-repairprocessdelivery #changelist-filter-extra-actions,
body.model-customergroup #changelist-filter-extra-actions,
body.model-meetinglog #changelist-filter-extra-actions,
body.model-customer #changelist-filter-extra-actions,
body.model-customercollection #changelist-filter-extra-actions,
body.model-taxinvoice #changelist-filter-extra-actions,
body.model-remittancett #changelist-filter-extra-actions {
    display: none !important;
}

body.model-manageschedulegoods #changelist-filter .flex.flex-col.gap-4,
body.model-schedulecheckgoods #changelist-filter .flex.flex-col.gap-4,
body.model-goodsestimate #changelist-filter .flex.flex-col.gap-4,
body.model-vendorquotecn #changelist-filter .flex.flex-col.gap-4,
body.model-vendorprogresscn #changelist-filter .flex.flex-col.gap-4,
body.model-estimate #changelist-filter .flex.flex-col.gap-4,
body.model-repair #changelist-filter .flex.flex-col.gap-4,
body.model-orderdropgoods #changelist-filter .flex.flex-col.gap-4,
body.model-manageactualschedule #changelist-filter .flex.flex-col.gap-4,
body.model-repairprocessdelivery #changelist-filter .flex.flex-col.gap-4,
body.model-customergroup #changelist-filter .flex.flex-col.gap-4,
body.model-meetinglog #changelist-filter .flex.flex-col.gap-4,
body.model-customer #changelist-filter .flex.flex-col.gap-4,
body.model-customercollection #changelist-filter .flex.flex-col.gap-4,
body.model-taxinvoice #changelist-filter .flex.flex-col.gap-4,
body.model-remittancett #changelist-filter .flex.flex-col.gap-4 {
    gap: 1px !important;
}

/* 모델별 고유 오버라이드 */
body.model-manageschedulegoods .column-get_processing_company,
body.model-manageschedulegoods .field-get_processing_company {
    width: 70px !important;
    max-width: 70px !important;
    min-width: 70px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}
body.model-manageschedulegoods #erp-customer-search-wrap {
    padding-top: 0 !important;
    margin-top: 0 !important;
}
body.model-manageschedulegoods #erp-customer-search-wrap h3 {
    margin-top: 0 !important;
    padding-top: 2px !important;
}
body.model-goodsestimate #erp-ge-customer-search-wrap {
    padding-top: 0 !important;
    margin-top: 0 !important;
}
body.model-goodsestimate #erp-ge-customer-search-wrap h3 {
    margin-top: 0 !important;
    padding-top: 2px !important;
}

/* vendorquotecn 리스트 컬럼 너비 */
body.model-vendorquotecn #result_list th.column-get_est_date              { width: 100px !important; }
body.model-vendorquotecn #result_list th.column-get_customer_name         { width: 100px !important; }
body.model-vendorquotecn #result_list th.column-get_cn_unique_number      { width: 100px !important; }
/* get_cpn: auto */
body.model-vendorquotecn #result_list th.column-get_employee_name         { width: 80px !important; }
body.model-vendorquotecn #result_list th.column-get_classification        { width: 80px !important; }
body.model-vendorquotecn #result_list th.column-get_type_and_spec_kr      { width: 200px !important; }
body.model-vendorquotecn #result_list th.column-get_safety_weight         { width: 80px !important; }
body.model-vendorquotecn #result_list th.column-get_cn_safety_weight_list { width: 80px !important; }
body.model-vendorquotecn #result_list th.column-get_cn_est_price          { width: 100px !important; }
body.model-vendorquotecn #result_list th.column-get_cn_final_price        { width: 100px !important; }
body.model-vendorquotecn #result_list th.column-get_cn_memo               { width: 100px !important; }
body.model-vendorquotecn #result_list th.column-get_is_emergency          { width: 52px !important; }

/* vendorprogresscn 리스트 컬럼 너비 */
body.model-vendorprogresscn #result_list th.column-get_order_date            { width: 100px !important; }
body.model-vendorprogresscn #result_list th.column-get_customer_name         { width: 100px !important; }
body.model-vendorprogresscn #result_list th.column-get_cn_unique_number      { width: 100px !important; }
/* get_cpn: auto */
body.model-vendorprogresscn #result_list th.column-get_classification        { width: 80px !important; }
body.model-vendorprogresscn #result_list th.column-display_sche_classification { width: 120px !important; }
body.model-vendorprogresscn #result_list th.column-get_employee_name         { width: 100px !important; }
body.model-vendorprogresscn #result_list th.column-get_schedule_date         { width: 100px !important; }
body.model-vendorprogresscn #result_list th.column-get_completion_dates      { width: 100px !important; }
body.model-vendorprogresscn #result_list th.column-get_vpn_net_weight        { width: 100px !important; }
body.model-vendorprogresscn #result_list th.column-get_cn_shipping_date      { width: 100px !important; }

/* employee 리스트 컬럼 너비 */
body.model-employee #result_list th.action-checkbox-column,
body.model-employee #result_list td.action-checkbox {
    width: 36px !important; min-width: 36px !important; max-width: 36px !important;
}
body.model-employee #result_list th.column-emp_id            { width: 100px !important; }
body.model-employee #result_list th.column-emp_name          { width: 80px !important; }
body.model-employee #result_list th.column-emp_position      { width: 80px !important; }
body.model-employee #result_list th.column-emp_dept          { width: 100px !important; }
body.model-employee #result_list th.column-emp_team          { width: 80px !important; }
body.model-employee #result_list th.column-emp_phone_display { width: 120px !important; }
body.model-employee #result_list th.column-emp_email { width: auto !important; }

/* =====================================================================
   👤 [ERP 사용자] User 관리 폼 스타일
===================================================================== */

/* 상단 네비게이션 바 (back arrow / 히스토리 / + 버튼) 숨기기 */
/* ERP 사용자 change form */
body.model-user.change-form div.z-40.mb-6.border-b { display: none !important; }

body.model-user.change-form .\@container { padding: 20px 0 0 0 !important; }
body.model-user.change-form #content {
    max-width: none !important; width: 100% !important; padding: 0 24px !important;
}
body.model-user.change-form .max-w-xl,
body.model-user.change-form .max-w-2xl,
body.model-user.change-form .max-w-3xl,
body.model-user.change-form .max-w-5xl,
body.model-user.change-form .max-w-7xl,
body.model-user.change-form div > fieldset {
    max-width: 100% !important; width: 100% !important;
}
body.model-user.change-form input[type="text"],
body.model-user.change-form input[type="email"],
body.model-user.change-form input[type="password"] {
    max-width: 100% !important; width: 100% !important;
}

/* 불필요한 도움말·해시 숨기기 */
body.model-user.change-form .field-username .leading-relaxed,
body.model-user.change-form .field-is_active .leading-relaxed,
body.model-user.change-form .field-is_staff .leading-relaxed,
body.model-user.change-form .field-is_superuser .leading-relaxed { display: none !important; }
body.model-user.change-form .field-password .readonly { display: none !important; }

/* ── 수정 폼 기본 정보 행 (7 cols): first_name(편집가능) 유무로 add/change 구분 ── */
body.model-user.change-form .field-row:has(.field-first_name) {
    grid-template-columns: 150px 120px 1fr 220px 200px 200px 205px !important;
}

/* ── 추가 폼 기본 정보 행 (2 cols): first_name 없는 경우 ── */
body.model-user.change-form .field-row:has(.field-username):not(:has(.field-first_name)) {
    grid-template-columns: 300px 440px !important;
}

/* ── 권한 행 (3 cols): is_active / is_staff / is_superuser ── */
body.model-user.change-form .field-row:has(.field-is_active) {
    grid-template-columns: 100px 148px 175px !important;
}
body.model-user.change-form .field-is_staff label { white-space: nowrap !important; }

/* 접속 기록 (기본 정보 2행에 통합) */
body.model-user.change-form .field-last_login .readonly,
body.model-user.change-form .field-date_joined .readonly {
    font-size: 13px !important; color: #374151 !important;
}

/* 권한 그룹 드롭다운 - 래퍼와 select 너비를 column에 맞게 동일하게 */
body.model-user.change-form .field-group_select .grow.relative,
body.model-user.change-form .field-group_select select {
    max-width: 100% !important; width: 100% !important;
}

/* 비밀번호 초기화 버튼 */
.user-pw-reset-btn {
    display: inline-block !important; padding: 7px 18px !important;
    background: #ef4444 !important; color: #fff !important;
    border-radius: 8px !important; text-decoration: none !important;
    font-size: 13px !important; font-weight: 600 !important;
    transition: background 0.15s !important; white-space: nowrap !important;
}
.user-pw-reset-btn:hover { background: #dc2626 !important; color: #fff !important; }

/* 비밀번호 초기화 readonly 래퍼 → 버튼만 노출 */
.field-get_password_reset_button .readonly {
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    max-width: none !important;
}
.field-get_password_reset_button label { display: none !important; }

/* model-user 리스트 컬럼 너비 */
body.model-user #result_list th.action-checkbox-column,
body.model-user #result_list td.action-checkbox {
    width: 36px !important; min-width: 36px !important; max-width: 36px !important;
}
body.model-user #result_list th.column-username      { width: 130px !important; }
body.model-user #result_list th.column-first_name    { width: 130px !important; }
body.model-user #result_list th.column-get_group     { width: 100px !important; }
body.model-user #result_list th.column-get_position  { width: 80px !important; }
body.model-user #result_list th.column-get_dept      { width: 80px !important; }
body.model-user #result_list th.column-get_phone     { width: 120px !important; }
body.model-user #result_list th.column-get_emp_email { width: auto !important; }
body.model-user #result_list th.column-last_login    { width: 200px !important; }
body.model-user #result_list th.column-is_active     { width: 52px !important; }
body.model-user #result_list th.column-get_is_staff  { width: 52px !important; }

/* model-employee 리스트 컬럼 너비 */
body.model-employee #result_list th.column-emp_id   { width: 100px !important; }
body.model-employee #result_list th.column-emp_name { width: 130px !important; }

/* model-logentry 리스트 컬럼 너비 */
body.model-logentry #result_list th.column-get_action_time  { width: 180px !important; }
body.model-logentry #result_list th.column-user             { width: 100px !important; }
body.model-logentry #result_list th.column-get_content_type { width: 180px !important; }
body.model-logentry #result_list th.column-get_object_display { width: 250px !important; }
body.model-logentry #result_list th.column-get_action_flag  { width: 80px !important; }
/* get_parsed_message: auto */

/* model-group 리스트 컬럼 너비 */
body.model-group #result_list th.action-checkbox-column,
body.model-group #result_list td.action-checkbox        { width: 36px !important; min-width: 36px !important; max-width: 36px !important; }
body.model-group #result_list th.column-name            { width: 150px !important; }

/* =====================================================================
   🔑 [권한 그룹] 권한 설정 그리드
===================================================================== */
.erp-perm-grid {
    overflow-x: auto;
}
.erp-perm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.erp-perm-table thead th {
    padding: 8px 14px;
    background: #f5f3ff;
    color: #5b21b6;
    font-weight: 700;
    border-bottom: 2px solid #ede9fe;
    text-align: center;
}
.erp-perm-table thead th:first-child {
    text-align: left;
}
.erp-perm-table .perm-app-header td {
    padding: 7px 14px;
    background: #f3f4f6;
    font-weight: 700;
    font-size: 12px;
    color: #4b5563;
    border-top: 2px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}
.perm-section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.perm-section-all {
    accent-color: #7c3aed;
    width: 15px;
    height: 15px;
    cursor: pointer;
}
.erp-perm-table .perm-model-row td {
    padding: 6px 14px;
    border-bottom: 1px solid #f3f4f6;
}
.erp-perm-table .col-model-name {
    color: #111827;
    font-weight: 500;
}
.erp-perm-table .col-check {
    text-align: center;
}
.erp-perm-table .col-check input[type="checkbox"] {
    accent-color: #7c3aed;
    width: 15px;
    height: 15px;
    cursor: pointer;
}
.erp-perm-table .perm-model-row:hover {
    background: #faf5ff;
}


/* =====================================================================
   🎨 [필터 공통] Flatpickr 보라색 테마 + 입력/pill 일관성
===================================================================== */

/* flatpickr 선택일/범위 — 보라색(#7c3aed) 테마 */
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected.inRange,
.flatpickr-day.startRange.inRange,
.flatpickr-day.endRange.inRange,
.flatpickr-day.selected:focus,
.flatpickr-day.startRange:focus,
.flatpickr-day.endRange:focus,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover,
.flatpickr-day.selected.prevMonthDay,
.flatpickr-day.startRange.prevMonthDay,
.flatpickr-day.endRange.prevMonthDay,
.flatpickr-day.selected.nextMonthDay,
.flatpickr-day.startRange.nextMonthDay,
.flatpickr-day.endRange.nextMonthDay {
    background: #7c3aed !important;
    border-color: #7c3aed !important;
    color: #fff !important;
}

/* flatpickr 범위 중간 날짜 — 연보라색 */
.flatpickr-day.inRange {
    background: #ede9fe !important;
    border-color: #ede9fe !important;
    box-shadow: -5px 0 0 #ede9fe, 5px 0 0 #ede9fe !important;
    color: #4c1d95 !important;
}

/* flatpickr 오늘 날짜 테두리 */
.flatpickr-day.today:not(.selected):not(.startRange):not(.endRange) {
    border-color: #7c3aed !important;
    color: #7c3aed !important;
}
.flatpickr-day.today:not(.selected):not(.startRange):not(.endRange):hover {
    background: #ede9fe !important;
    border-color: #7c3aed !important;
}

/* flatpickr 헤더 화살표 hover */
.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg { fill: #7c3aed !important; }

/* 날짜 범위 picker 트리거 입력 포커스 */
.erp-drp-range-trigger:focus {
    border-color: #7c3aed !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(124,58,237,0.15) !important;
}

/* pill 버튼 hover */
.erp-pill:hover {
    opacity: 0.85;
}

/* =====================================================================
   🧹 [전역 UI] 불필요한 Unfold 기본 UI 요소 숨기기
===================================================================== */

/* 상단 네비게이션 경로(영업 관리 > 고객사 등) 텍스트 숨기기 */
div.flex.flex-row.grow > h1 {
    display: none !important;
}

/* 햄버거 메뉴 버튼 우측 세로 구분선 숨기기 */
div.flex.flex-row.grow > span.w-px {
    display: none !important;
}

/* =====================================================================
   🚚 [배송비 관리] 열너비 auto
===================================================================== */
body.model-shippingfee #result_list { table-layout: auto !important; }
body.model-shippingfee #result_list th,
body.model-shippingfee #result_list td { width: auto !important; min-width: 0 !important; }
body.model-shippingfee #result_list th.action-checkbox-column,
body.model-shippingfee #result_list td.action-checkbox { width: 36px !important; min-width: 36px !important; }


/* =====================================================================
   🚨 [견적] 지역구분 미설정 시 빨간 테두리 / readonly div 오류 공통 스타일
===================================================================== */
body .erp-readonly-error {
    border-color: #ef4444 !important;
    background-color: #fff5f5 !important;
    color: #ef4444 !important;
}

/* 견적 페이지 고객사 Select2 / input 중앙정렬 */
body.model-estimate .field-customer .select2-selection__rendered,
body.model-estimate .field-customer .select2-search__field,
body.model-estimate .field-customer input[type="text"],
body.model-estimate .field-customer input[type="search"] {
    text-align: center !important;
}
body.model-estimate .field-customer .select2-selection--single {
    display: flex !important; align-items: center !important; justify-content: center !important;
}
body.model-estimate .field-customer .select2-selection__arrow {
    display: none !important;
}

/* ── 일정 확인 (ScheduleCheckGoods) 열너비 ───────────────────────────── */
body.model-schedulecheckgoods.change-list #result_list .column-get_estimate_date            { width: 100px !important; }
body.model-schedulecheckgoods.change-list #result_list .column-get_customer_name            { width: 150px !important; }
body.model-schedulecheckgoods.change-list #result_list .column-get_region                   { width:  80px !important; }
body.model-schedulecheckgoods.change-list #result_list .column-get_employee_name            { width:  70px !important; }
body.model-schedulecheckgoods.change-list #result_list .column-goods_status                 { width: 100px !important; }
body.model-schedulecheckgoods.change-list #result_list .column-get_type_and_spec            { width: 200px !important; }
body.model-schedulecheckgoods.change-list #result_list .column-goods_safety_weight          { width:  70px !important; }
body.model-schedulecheckgoods.change-list #result_list .column-get_effective_price          { width: 110px !important; }
body.model-schedulecheckgoods.change-list #result_list .column-goods_hr_completion_date     { width: 100px !important; }
body.model-schedulecheckgoods.change-list #result_list .column-goods_plate_completion_date  { width: 100px !important; }
body.model-schedulecheckgoods.change-list #result_list .column-goods_body_completion_date   { width: 100px !important; }
body.model-schedulecheckgoods.change-list #result_list .column-goods_hr_expected_delivery_date    { width: 100px !important; }
body.model-schedulecheckgoods.change-list #result_list .column-goods_plate_expected_delivery_date { width: 100px !important; }
body.model-schedulecheckgoods.change-list #result_list .column-goods_body_expected_delivery_date  { width: 100px !important; }

/* 견적 목록 검색창 너비 축소 (버튼 한 줄 유지) */
body.model-estimate.change-list #changelist-search > div { width: 250px !important; }

/* sticky 검색바에서도 검색박스 폭을 250px로 제한(한 줄 유지).
   flex-grow는 건드리지 않음 — 정상 툴바처럼 폼이 늘어나야 검색박스가 왼쪽에 붙음
   (flex-grow:0이면 #toolbar의 justify-content:space-between 때문에 검색폼이 가운데로 밀림)
   (클론은 id가 제거되므로 form[role="search"]로 타겟) */
body.model-estimate #sticky_search_bar form[role="search"] > div { width: 250px !important; }

/* ===== 상품견적 변경폼 "전체화면" 모드 — 견적및상품정보 + 이력검색만 크게 ===== */
/* #content-main을 화면 전체로 오버레이하고, 기본정보(첫 fieldset)는 숨김 */
body.model-goodsestimate.change-form.ge-fs #content-main {
    position: fixed !important;
    inset: 0 !important;
    z-index: 9998 !important;
    margin: 0 !important;
    max-width: none !important;
    width: 100vw !important;
    background: #ffffff !important;
    overflow: hidden !important;   /* 바깥 스크롤 제거 → 이력표만 단일 스크롤 */
    padding: 14px 20px 10px !important;
}
.dark body.model-goodsestimate.change-form.ge-fs #content-main { background: #0f172a !important; }
/* 기본정보(첫 fieldset)는 전체화면에서 숨김 */
body.model-goodsestimate.change-form.ge-fs fieldset.module:nth-of-type(1) { display: none !important; }
/* 전체화면: 여백 축소 + 위쪽 "견적 및 상품 정보"는 최대 32vh로 제한(자체 스크롤) → 이력표가 더 넓게 */
body.model-goodsestimate.change-form.ge-fs fieldset.module { margin-bottom: 8px !important; }
body.model-goodsestimate.change-form.ge-fs fieldset.module > h2 { margin-bottom: 8px !important; }
body.model-goodsestimate.change-form.ge-fs fieldset.module:nth-of-type(2) .form-rows {
    max-height: 32vh !important;
    overflow-y: auto !important;
}

/* =====================================================================
   📱 전역 모바일 사이드바 열기 버튼 (admin_custom.js가 주입)
   - 관리자 헤더를 숨긴 풀스크린 페이지(영업통계·휴가 캘린더 등)에서
     모바일(≤1279px)일 때 ☰ 버튼을 좌상단에 고정 표시.
   - 채권월령처럼 자체 메뉴 버튼이 있는 페이지에는 주입하지 않음(중복 방지).
===================================================================== */
#global-mobile-menu{
  display:none; position:fixed; top:8px; left:8px; z-index:50;
  font-size:18px; line-height:1; padding:6px 11px;
  border:1px solid #e5e7eb; border-radius:8px;
  background:#fff; color:#374151; cursor:pointer;
  box-shadow:0 1px 4px rgba(0,0,0,.18); align-items:center;
}
#global-mobile-menu:hover{ border-color:#d8b4fe; color:#7e22ce; }
@media (max-width:1279px){ #global-mobile-menu{ display:inline-flex; } }
.dark #global-mobile-menu{ background:#111827; border-color:#374151; color:#e5e7eb; }
.dark #global-mobile-menu:hover{ border-color:#9333ea; color:#e9d5ff; }



/* =====================================================================
   📱 고객사·고객그룹 목록(changelist) 반응형
   - Unfold은 lg(1024px) 미만에서 표를 카드형으로 쌓는데, 컬럼이 많은(12열)
     이 두 목록은 라벨·값이 겹쳐 깨진다. → 좁은 화면에선 카드형 대신
     '가로 스크롤 표'로 표시. 이 두 페이지에만 적용(body class로 스코프).
   - 변경 폼(change form)은 Unfold 기본이 정상 → 건드리지 않음.
===================================================================== */
@media (max-width: 1023px) {
  body.change-list.model-customer #result_list,
  body.change-list.model-customergroup #result_list {
    display: table !important; width: auto !important; min-width: 100% !important;
  }
  body.change-list.model-customer #result_list thead,
  body.change-list.model-customergroup #result_list thead { display: table-header-group !important; }
  body.change-list.model-customer #result_list tbody,
  body.change-list.model-customergroup #result_list tbody { display: table-row-group !important; background: transparent !important; }
  body.change-list.model-customer #result_list tr,
  body.change-list.model-customergroup #result_list tr {
    display: table-row !important; border: 0 !important; margin: 0 !important;
    border-radius: 0 !important; box-shadow: none !important;
  }
  body.change-list.model-customer #result_list th,
  body.change-list.model-customer #result_list td,
  body.change-list.model-customergroup #result_list th,
  body.change-list.model-customergroup #result_list td {
    display: table-cell !important; white-space: nowrap !important;
    max-width: 240px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle;
    border-bottom: 1px solid #eef1f5 !important;
  }
  /* 카드형 라벨(::before) 숨김 */
  body.change-list.model-customer #result_list td::before,
  body.change-list.model-customergroup #result_list td::before { display: none !important; }
}

@media (max-width: 1023px) {
  /* 첫 열(행 헤더 th)의 카드형 라벨(::before)도 숨김 */
  body.change-list.model-customer #result_list tbody th::before,
  body.change-list.model-customergroup #result_list tbody th::before { display: none !important; }
}


/* =====================================================================
   📱 전역 ☰ 버튼 겹침 방지 — 표준 관리자 페이지(목록/폼)
   - 버튼 표시 시(body.has-global-menu) 좌상단 고정 ☰(top:8, ~36px)이
     상단 검색바/필드와 겹치므로, 표준 페이지 콘텐츠에 상단 여백을 준다.
   - 대시보드는 body에 change-list/change-form 클래스가 없고 자체 padding-top으로
     이미 처리하므로 여기 규칙의 영향을 받지 않는다.
===================================================================== */
@media (max-width: 1279px) {
  body.has-global-menu.change-list #content,
  body.has-global-menu.change-form #content,
  body.has-global-menu.delete-confirmation #content { padding-top: 46px !important; }
}


/* =====================================================================
   📱 고객사 추가/수정 폼: 4단 Grid 레이아웃을 모바일/태블릿에서 접기
   - 위 'body.model-customer #customer_form > div'가 미디어쿼리 없이 4열이라
     좁은 화면에서 짓눌림 → 태블릿(≤1279) 2열, 휴대폰(≤768) 1열로 접는다.
   - 데스크톱(>1279)은 기존 4열 유지.
===================================================================== */
@media (max-width: 1279px) {
  body.model-customer #customer_form > div { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 768px) {
  body.model-customer #customer_form > div { grid-template-columns: 1fr !important; }
}


/* =====================================================================
   📱 거래지원장 목록(changelist) 반응형 — 고객사/고객그룹과 동일
   (Unfold 카드형 깨짐 → 좁은 화면에서 가로 스크롤 표로)
===================================================================== */
@media (max-width: 1023px) {
  body.change-list.model-tradeledgerentry #result_list {
    display: table !important; width: auto !important; min-width: 100% !important;
  }
  body.change-list.model-tradeledgerentry #result_list thead { display: table-header-group !important; }
  body.change-list.model-tradeledgerentry #result_list tbody { display: table-row-group !important; background: transparent !important; }
  body.change-list.model-tradeledgerentry #result_list tr {
    display: table-row !important; border: 0 !important; margin: 0 !important;
    border-radius: 0 !important; box-shadow: none !important;
  }
  body.change-list.model-tradeledgerentry #result_list th,
  body.change-list.model-tradeledgerentry #result_list td {
    display: table-cell !important; white-space: nowrap !important;
    max-width: 240px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle;
    border-bottom: 1px solid #eef1f5 !important;
  }
  body.change-list.model-tradeledgerentry #result_list td::before,
  body.change-list.model-tradeledgerentry #result_list tbody th::before { display: none !important; }
}


/* =====================================================================
   📱 스크롤 시 상단 고정되는 검색바(#sticky_search_bar)가
      좌상단 전역 ☰ 버튼과 겹치지 않도록 좌측 여백 확보.
===================================================================== */
@media (max-width: 1279px) {
  body.has-global-menu #sticky_search_bar { padding-left: 52px !important; box-sizing: border-box !important; }
}


/* =====================================================================
   📱 배송지 관리(CustomerContact) 반응형
===================================================================== */
/* (1) 목록: 카드형 깨짐 → 가로 스크롤 표 */
@media (max-width: 1023px) {
  body.change-list.model-customercontact #result_list { display: table !important; width: auto !important; min-width: 100% !important; }
  body.change-list.model-customercontact #result_list thead { display: table-header-group !important; }
  body.change-list.model-customercontact #result_list tbody { display: table-row-group !important; background: transparent !important; }
  body.change-list.model-customercontact #result_list tr { display: table-row !important; border: 0 !important; margin: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
  body.change-list.model-customercontact #result_list th,
  body.change-list.model-customercontact #result_list td { display: table-cell !important; white-space: nowrap !important; max-width: 240px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; border-bottom: 1px solid #eef1f5 !important; }
  body.change-list.model-customercontact #result_list td::before,
  body.change-list.model-customercontact #result_list tbody th::before { display: none !important; }
}
/* (2) 변경 폼: 4필드 한 줄(.form-row flex-row)이 휴대폰에서 넘침 → 세로로 접기 */
@media (max-width: 768px) {
  body.model-customercontact fieldset.module .form-row { flex-direction: column !important; gap: 0 !important; }
  body.model-customercontact fieldset.module .form-row > div { flex: 0 0 auto !important; width: 100% !important; }
}


/* =====================================================================
   📱 H/R 가공업체(hrcompany) + 고객 상담일지(meetinglog) 반응형
===================================================================== */
/* (1) 목록: 카드형 깨짐 → 가로 스크롤 표 */
@media (max-width: 1023px) {
  body.change-list.model-meetinglog #result_list,
  body.change-list.model-hrcompany #result_list { display: table !important; width: auto !important; min-width: 100% !important; }
  body.change-list.model-meetinglog #result_list thead,
  body.change-list.model-hrcompany #result_list thead { display: table-header-group !important; }
  body.change-list.model-meetinglog #result_list tbody,
  body.change-list.model-hrcompany #result_list tbody { display: table-row-group !important; background: transparent !important; }
  body.change-list.model-meetinglog #result_list tr,
  body.change-list.model-hrcompany #result_list tr { display: table-row !important; border: 0 !important; margin: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
  body.change-list.model-meetinglog #result_list th, body.change-list.model-meetinglog #result_list td,
  body.change-list.model-hrcompany #result_list th, body.change-list.model-hrcompany #result_list td {
    display: table-cell !important; white-space: nowrap !important; max-width: 240px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; border-bottom: 1px solid #eef1f5 !important; }
  body.change-list.model-meetinglog #result_list td::before, body.change-list.model-meetinglog #result_list tbody th::before,
  body.change-list.model-hrcompany #result_list td::before, body.change-list.model-hrcompany #result_list tbody th::before { display: none !important; }
}
/* (2) 고객 상담일지 폼: 2단 그리드 → 휴대폰 1단 */
@media (max-width: 768px) {
  body.model-meetinglog #meetinglog_form > div { grid-template-columns: 1fr !important; }
}

@media (max-width: 768px) {
  /* 상담일지 폼: 2단 정렬용 고정높이(350px)를 1단에선 해제 → 겹침 방지 */
  body.model-meetinglog #meetinglog_form > div > fieldset.module:nth-of-type(1) > div,
  body.model-meetinglog #meetinglog_form > div > fieldset.module:nth-of-type(2) > div { height: auto !important; }
}


/* =====================================================================
   🖥️📱 H/R 가공업체 변경 폼: fieldset(내용 영역)이 좁게 가운데 정렬되는 문제
   - 부모(flex flex-col)가 fieldset을 내용 폭으로 줄여 아주 작게 보임(107~324px).
   - 다른 폼처럼 fieldset을 전체폭으로 늘린다.
===================================================================== */
body.model-hrcompany #hrcompany_form > div { align-items: stretch !important; }
body.model-hrcompany #hrcompany_form > div > fieldset.module { width: 100% !important; max-width: 100% !important; }


/* 상담일지 폼: fieldset 고정높이(350px)가 필드 7개를 못 담아 키맨/연락처가 삐져나옴
   → 전 폭에서 height:auto로 해제(내용만큼 늘어나게). */
body.model-meetinglog #meetinglog_form > div > fieldset.module:nth-of-type(1) > div,
body.model-meetinglog #meetinglog_form > div > fieldset.module:nth-of-type(2) > div { height: auto !important; }


/* =====================================================================
   📱 [수주 관리] 일정 확인(ScheduleCheckGoods) 목록 반응형
   - Unfold은 lg(1024px) 미만에서 표를 카드형으로 쌓는데, 14열짜리 이 목록은
     라벨·값이 겹쳐 깨진다. → 좁은 화면(모바일·태블릿)에선 카드형 대신
     '가로 스크롤 표'로 표시. (데스크톱 열너비 규칙은 그대로 유지)
===================================================================== */
@media (max-width: 1023px) {
  body.change-list.model-schedulecheckgoods #result_list {
    display: table !important; width: auto !important; min-width: 100% !important;
  }
  body.change-list.model-schedulecheckgoods #result_list thead { display: table-header-group !important; }
  body.change-list.model-schedulecheckgoods #result_list tbody { display: table-row-group !important; background: transparent !important; }
  body.change-list.model-schedulecheckgoods #result_list tr {
    display: table-row !important; border: 0 !important; margin: 0 !important;
    border-radius: 0 !important; box-shadow: none !important;
  }
  body.change-list.model-schedulecheckgoods #result_list th,
  body.change-list.model-schedulecheckgoods #result_list td {
    display: table-cell !important; white-space: nowrap !important;
    max-width: 240px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle;
    border-bottom: 1px solid #eef1f5 !important;
  }
  /* 카드형 라벨(::before) 숨김 */
  body.change-list.model-schedulecheckgoods #result_list td::before,
  body.change-list.model-schedulecheckgoods #result_list tbody th::before { display: none !important; }
}


/* =====================================================================
   📱 [수주 관리] 일정 확인 — 모바일/태블릿 필터를 "하단 바텀시트"로 전환
   - Unfold 기본 필터는 list_filter_sheet=True라 항상 우측 w-80(320px) 슬라이드오버.
     좁은 화면에선 이 카드가 뷰포트 밖으로 밀리거나 내부 pill이 잘려 깨진다.
   - 그래서 ≤1023px에서는 아예 다른 방식으로: 컨테이너를 뷰포트 크기로 고정하고
     세로 배치(위=백드롭 탭하여 닫기 / 아래=전폭 시트)로 바꾼다.
     시트는 전폭(태블릿은 560px 중앙)·둥근 상단·세로 스크롤. pill이 전폭에서 정상 줄바꿈.
===================================================================== */
@media (max-width: 1023px) {
  /* 오버레이 컨테이너를 뷰포트에 정확히 고정 (넓은 표로 인한 밀림 방지) */
  body.model-schedulecheckgoods #changelist-filter {
    position: fixed !important; inset: 0 !important;
    left: 0 !important; right: 0 !important; top: 0 !important; bottom: 0 !important;
    width: 100vw !important; height: 100dvh !important; max-width: 100vw !important;
    flex-direction: column !important; align-items: stretch !important;
    justify-content: flex-end !important;
  }
  /* 상단 영역 = 백드롭(탭하면 닫힘) */
  body.model-schedulecheckgoods #changelist-filter > #changelist-filter-close {
    width: auto !important; height: auto !important;
    flex: 1 1 auto !important; min-height: 12vh !important;
  }
  /* 하단 시트 카드: 전폭(아이패드 포함 양옆 꽉 차게), 상단 라운드, 세로 스크롤 */
  body.model-schedulecheckgoods #changelist-filter > div:last-child {
    width: 100% !important; max-width: none !important; align-self: stretch !important;
    flex: 0 0 auto !important; margin: 0 !important;
    max-height: 85vh !important; overflow-y: auto !important; overflow-x: hidden !important;
    border-radius: 16px 16px 0 0 !important;
  }
  /* 시트 내부 모든 요소가 시트 폭을 넘지 못하게 → pill 정상 줄바꿈 */
  body.model-schedulecheckgoods #changelist-filter > div:last-child *:not(svg):not(path) {
    max-width: 100% !important; min-width: 0 !important;
  }
  body.model-schedulecheckgoods #changelist-filter [data-simplebar],
  body.model-schedulecheckgoods #changelist-filter .simplebar-mask,
  body.model-schedulecheckgoods #changelist-filter .simplebar-offset,
  body.model-schedulecheckgoods #changelist-filter .simplebar-content-wrapper,
  body.model-schedulecheckgoods #changelist-filter .simplebar-content {
    width: 100% !important; max-width: 100% !important; overflow-x: hidden !important;
  }
}
