/***********************************************************************
 * 🌐 [ GLOBAL SECTOR ] 전역 설정 및 공통 UI
 ***********************************************************************/

/* =====================================================================
   [1] 전역 설정 (Global Settings)
   - 숨김 처리, 폼 크기 제한, 기본 입력칸 디자인 통일, 숫자 스피너 제거
===================================================================== */
/* 관계형 필드 옆 기본 아이콘 숨기기 */
.related-widget-wrapper-link { display: none !important; }

/* 폼 큰박스 제한 */
div > fieldset { width: 30% !important; margin: 0 auto; }

/* 필수 항목 에러 메시지 숨기기 (밀림 방지) */
.errornote, .errorlist.nonfield, .form-row .errorlist { display: none !important; }
.form-row.errors { margin: 0 !important; padding: 0 !important; border: none !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;    /* 💡 다른 칸들과 동일하게 38px로 높이 확장 */
    line-height: 38px !important;
    padding: 0 10px !important; 
    border: 1px solid #e2e8f0 !important; 
    border-radius: 6px !important;
    box-sizing: border-box !important;
}

/* 크롬, 사파리, 엣지 등 WebKit 기반 브라우저 숫자 화살표 제거 */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

/* 파이어폭스(Firefox) 등 기타 브라우저 숫자 화살표 제거 */
input[type="number"] {
    -moz-appearance: textfield !important;
    appearance: textfield !important;
}
/* =====================================================================
   [2] 공통 UI 요소 (Common UI Elements)
   - 우측 상단 버튼 레이아웃, 커스텀 페이지네이션 디자인
===================================================================== */
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; padding: 1rem 0.5rem !important;
    border-top: 1px solid #e5e7eb !important; margin-top: 1rem !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; }

/* =====================================================================
   [3] 전역 인라인(Inline) 테이블 공통 디자인
   - 읽기 전용 필드, 하단 추가 버튼 글로벌 스타일
===================================================================== */
/* 읽기 전용 필드 공통 디자인 */
.readonly-field {
    background-color: #f8fafc !important; border: 1px solid #e2e8f0 !important; 
    border-radius: 6px !important; color: #94a3b8 !important; cursor: not-allowed !important; 
    pointer-events: none !important; text-align: center; height: 38px !important; box-shadow: none !important;
}
select.readonly-field { appearance: none; -webkit-appearance: none; }

/* 전역 인라인 하단 "추가" 버튼 디자인 및 왼쪽 정렬 */
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; }

/* =====================================================================
   [4] 전역 목록(List) 테이블 공통 디자인
   - 모든 메뉴의 리스트 화면 열 헤더 및 내용 중앙 정렬
===================================================================== */
/* 테이블 셀 및 데이터 중앙 정렬 */
#result_list th,
#result_list td {
    vertical-align: middle !important; 
    text-align: center !important;
}

/* Unfold 테마 특성상 테이블 헤더 안의 a 태그나 flex 컨테이너 중앙 정렬 */
#result_list thead th .flex,
#result_list thead th a {
    justify-content: center !important; 
    text-align: center !important; 
    width: 100% !important;
}

/***********************************************************************
 * 👥 [ HR SECTOR ] 인사 관리 (Employee 등)
 ***********************************************************************/
/* 현재 인사 관리 전용 개별 커스텀 CSS는 전역(Global)의 Input 크기 조절에 병합되어 있습니다. */
/* 추후 직원(Employee) 모델 등 HR 전용 스타일이 필요할 경우 여기에 추가하세요. */


/***********************************************************************
 * 💼 [ SALES SECTOR ] 영업 관리 (Customer, MeetingLog 등)
 ***********************************************************************/

/* =====================================================================
   [1] 영업 관리: 고객사 (Customer Model)
   - 4단 Grid 배치, 인라인 테이블 너비 최적화, 삭제 버튼 보정
===================================================================== */
body.model-customer .max-w-2xl { max-width: 100% !important; }

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;
}

/* 기존 데이터 위에 뜨는 객체 이름 텍스트 숨기기 */
body.model-customer .inline-group tbody tr p { 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;
}

/* 담당자 인라인 테이블 열(Column) 너비 세팅 */
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_address { width: auto !important; }
body.model-customer .inline-group th.column-cc_max, body.model-customer .inline-group td.field-cc_max { width: 150px !important; } 
body.model-customer .inline-group th.column-cc_memo { width: 15% !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 td.original {
    display: none !important; width: 0 !important; padding: 0 !important; border: none !important;
}

/* 추가 버튼 패딩 */
body.model-customer .inline-group tr.add-row td {
    padding: 10px !important; 
}

/* =====================================================================
   [2] 영업 관리: 고객 상담일지 (MeetingLog Model)
   - 상단 2단, 하단 1단 확장 레이아웃
===================================================================== */
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;
}
body.model-meetinglog .submit-row { width: 100% !important; margin-top: 15px !important; }


/***********************************************************************
 * 📦 [ ORDERS SECTOR ] 수주 및 견적 관리 (Estimate, ManageScheduleGoods)
 ***********************************************************************/

/* =====================================================================
   [1] 수주 관리: 견적 (Estimate Model) 레이아웃 및 인라인 테이블
   - 페이지 너비 100% 확장, 상품(Goods) 인라인 가로 스크롤 허용
===================================================================== */
/* 폼 컨테이너 100% 확장 */
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: 98% !important;
    width: 98% !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;
}

/* 상품 인라인 100% 확장 및 가로 스크롤 허용 */
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: 2800px !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; 
}

/* =====================================================================
   [2] 수주 관리: 견적 (Estimate Model) 상품 인라인 개별 열 너비
===================================================================== */
/* 상태 및 구분 계열 */
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_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_processing_company, body.model-estimate .inline-group td.field-goods_hr_processing_company { width: 110px !important; }
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; }

/* 중량 및 기타 수치 */
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 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_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: 250px !important; }
body.model-estimate .inline-group th:last-child, body.model-estimate .inline-group td.delete { width: 60px !important; text-align: center !important; }

/* 납품예정일 예외 처리 (좌측 정렬) */
body.model-estimate .inline-group td.field-goods_hr_expected_delivery_date input,
body.model-estimate .inline-group td.field-goods_plate_expected_delivery_date input,
body.model-estimate .inline-group td.field-goods_body_expected_delivery_date input {
    text-align-last: left !important; 
}

/* 객체 이름 숨기기 및 장고 시스템 컬럼 숨기기 */
body.model-estimate .inline-group tbody tr p { display: none !important; }
body.model-estimate .inline-group td.original { display: none !important; width: 0 !important; padding: 0 !important; border: none !important; }

/* =====================================================================
   [3] 수주 관리: 견적 (Estimate) 부가 UI 기능 (판전개 버튼, 다중 선택)
===================================================================== */
/* 판전개 버튼 커스텀 */
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: 30px !important; line-height: 30px !important; margin-top: -2px !important; 
}

/* 견적요청업체 Select2 다중 드롭다운 커스텀 */
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;
}
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;
}
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: 30px !important;
}
body.model-estimate .select2-container--default .select2-selection--multiple {
    border: 1px solid #dadada !important; border-radius: 6px !important; min-height: 30px !important; 
    height: auto !important; padding: 2px 4px !important; background-color: white !important;
    display: flex !important; align-items: center !important; flex-wrap: wrap !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;
}
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: 5px !important; padding-bottom: 0 !important; }

/* =====================================================================
   [4] 상품 일정 관리 (ManageScheduleGoods): 메인 폼 & 공통 정보 레이아웃
===================================================================== */
/* 폼 전체 너비 100% 확장 (중복 제거 통합) */
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;
}

/* 읽기 전용(Readonly) 텍스트 박스 디자인 */
body.model-manageschedulegoods fieldset.module .readonly {
    display: block !important; width: 100% !important; height: 38px !important; line-height: 38px !important;
    background-color: #f8fafc !important; border: 1px solid #e2e8f0 !important; border-radius: 6px !important;
    padding: 0 12px !important; color: #334155 !important; font-weight: 500 !important; box-sizing: border-box !important;
    white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !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;
}

/* 💡 [추가] 특이사항(notes)은 예외적으로 왼쪽 정렬 유지 및 줄바꿈 허용 */
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;
}

/* =====================================================================
   [5] 상품 일정 관리 (ManageScheduleGoods): 상세 일정 (Inline) 레이아웃
===================================================================== */
/* 💡 [수정] 인라인 테이블 너비를 80%로 줄이고 정중앙에 배치 */
body.model-manageschedulegoods .inline-group { 
    width: 90% !important; 
    margin: 30px auto 40px auto !important; /* 위아래 여백을 주고 좌우를 auto로 두어 가운데 정렬 */
    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; 
}

/* 원래 데이터 행(Original) 및 텍스트 껍데기 완벽 숨기기 (중복 통합) */
body.model-manageschedulegoods .inline-group tbody tr:has(td.original),
body.model-manageschedulegoods .inline-group td.original,
body.model-manageschedulegoods .inline-group tbody tr p {
    display: none !important;
    height: 0 !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !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: 0 !important; }

/* 입력칸(Input) 디자인 보정 */
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 td.delete div.flex-row { display: none !important; }

/* 하단 추가 버튼 여백 */
body.model-manageschedulegoods .inline-group tr.add-row td {
    text-align: left !important; padding: 10px !important; border-bottom: none !important;
}

/* =====================================================================
   [6] 상품 일정 관리 (ManageScheduleGoods): 목록(List) 화면
===================================================================== */
/* 테이블 전체 크기 확보 및 가로 스크롤 허용 */
body.model-manageschedulegoods #result_list { 
    display: table !important; table-layout: fixed !important; min-width: 1900px !important; border-collapse: separate !important;
}

/* 셀 안의 내용물 중앙 정렬 */
body.model-manageschedulegoods #result_list th,
body.model-manageschedulegoods #result_list td {
    vertical-align: middle !important; text-align: center !important;
}
body.model-manageschedulegoods #result_list thead th .flex,
body.model-manageschedulegoods #result_list thead th a {
    justify-content: center !important; text-align: center !important; width: 100% !important;
}

/* 개별 컬럼 너비 설정 */
body.model-manageschedulegoods #result_list th.action-checkbox-column { width: 40px !important; }
body.model-manageschedulegoods #result_list th.column-get_customer_name { width: 200px !important; }
body.model-manageschedulegoods #result_list th.column-get_employee_name { width: 80px !important; }
body.model-manageschedulegoods #result_list th.column-goods_customer_product_number { width: 110px !important; }
body.model-manageschedulegoods #result_list th.column-goods_order_date,
body.model-manageschedulegoods #result_list th.column-goods_finishing_diagram_sending_date,
body.model-manageschedulegoods #result_list th.column-goods_hr_expected_delivery_date,
body.model-manageschedulegoods #result_list th.column-goods_plate_expected_delivery_date,
body.model-manageschedulegoods #result_list th.column-goods_body_expected_delivery_date { width: 110px !important; }
body.model-manageschedulegoods #result_list th.column-get_finishing_delay { width: 90px !important; }
body.model-manageschedulegoods #result_list th.column-goods_safety_weight { width: 80px !important; }
body.model-manageschedulegoods #result_list th.column-goods_hr_country { width: 80px !important; }
body.model-manageschedulegoods #result_list th.column-goods_a_machining,
body.model-manageschedulegoods #result_list th.column-goods_b_machining { width: 90px !important; }
body.model-manageschedulegoods #result_list th.column-goods_hr_processing_company { width: 110px !important; }
body.model-manageschedulegoods #result_list th.column-goods_notes { width: 250px !important; }
body.model-manageschedulegoods #result_list th.column-get_schedule_summary { width: 200px !important; }

/* 모바일 가상 라벨 숨김 */
body.model-manageschedulegoods #result_list td::before { display: none !important; }

/* =====================================================================
   [7] 상품 견적 관리 (GoodsEstimate): 상세 화면 레이아웃 100% 확장
===================================================================== */
/* 1. 폼 전체 너비 100% 확장 (중앙 좁은 제한 해제) */
body.model-goodsestimate #content-main,
body.model-goodsestimate form#goodsestimate_form,
body.model-goodsestimate form#goodsestimate_form > div,
body.model-goodsestimate fieldset.module,
body.model-goodsestimate .max-w-2xl {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
}

/* 2. 필드들을 가로로 꽉 차게 균등 분할 */
body.model-goodsestimate fieldset.module .form-row {
    display: flex !important;
    flex-direction: row !important;
    gap: 20px !important;
    width: 100% !important;
}

body.model-goodsestimate fieldset.module .form-row > div {
    flex: 1 !important;
    min-width: 0 !important;
}

/* 3. 읽기 전용(Readonly) 및 입력(Input) 칸 통합 디자인 통일 */
body.model-goodsestimate fieldset.module .readonly,
body.model-goodsestimate fieldset.module input[type="number"],
body.model-goodsestimate fieldset.module input[type="text"] {
    display: block !important; 
    width: 100% !important; 
    height: 38px !important; 
    line-height: 38px !important; /* readonly 텍스트 세로 중앙 정렬용 */
    border: 1px solid #e2e8f0 !important; 
    border-radius: 6px !important;
    padding: 0 12px !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; /* 💡 모든 글자와 숫자 가운데 정렬 */
    box-shadow: none !important;   /* 💡 Unfold 기본 그림자 제거 */
}

/* 4. 읽기 전용(Readonly) 칸은 회색 배경으로 변경 */
body.model-goodsestimate fieldset.module .readonly {
    background-color: #f8fafc !important; 
    cursor: not-allowed !important;
}

/* 5. 사용자가 입력하는 칸은 흰색 배경 유지 */
body.model-goodsestimate fieldset.module input[type="number"],
body.model-goodsestimate fieldset.module input[type="text"] {
    background-color: #ffffff !important; 
}

/* 6. 사용자가 입력하는 칸 클릭(Focus) 시 보라색(#9333ea) 효과 통일 */
body.model-goodsestimate fieldset.module input[type="number"]:focus,
body.model-goodsestimate fieldset.module input[type="text"]:focus {
    border-color: #9333ea !important;
    outline: 1px solid #9333ea !important;
    box-shadow: 0 0 0 1px #9333ea !important; /* 좀 더 선명하고 예쁜 보라색 테두리 */
}

