.mng-content-layout {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    height: 100%;
}

.order-page-wrapper {
    height: 100%;
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 10px;
    overflow: hidden;
}

/* 타이틀 영역 */
.visual_tit {
    margin-bottom: -9px;
}
.visual_tit h1 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 4px;
    color: #111;
}
.visual_tit h1 span {
    font-size: 14px;
    font-weight: 400;
    color: #666;
    margin-left: 8px;
}

/* 조회 조건 영역 */
.search-area {
    background: #fff;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    position: sticky;
    top: 0;
    z-index: 100;
}
.search-row {
    display: flex;
    gap: 16px;
    flex: 1;
}
.search-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.search-group label {
    font-size: 13px;
    font-weight: 700;
    color: #111; /* 진한 검은색으로 변경 */
}
.search-group label.required::before {
    content: '*';
    color: var(--primary-orange);
    margin-right: 4px;
}
.search-input,
.search-select {
    height: 30px;
    padding: 4px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    color: #111; /* 진한 검은색으로 변경 */
    transition: all 0.2s;
    width: 100%; /* 너비 자동 조절을 위해 100%로 설정 */
}
.search-input:focus,
.search-select:focus {
    outline: none;
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgba(255, 81, 23, 0.1);
}

/* 날짜 범위 */
.date-range {
    display: flex;
    align-items: center;
    gap: 8px;
}
.date-input {
    width: 130px;
    text-align: center;
}

/* 커스텀 멀티 셀렉트 */
.custom-multiselect {
    position: relative;
    width: 200px;
}
.multiselect-selected {
    height: 30px;
    padding: 4px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.multiselect-selected::after {
    content: '';
    width: 0; height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #6b7280;
    margin-left: 8px;
}
.multiselect-dropdown {
    position: absolute;
    top: 34px;
    left: 0;
    width: 100%;
    max-height: 250px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 100;
    display: none;
    overflow-y: auto;
    padding: 6px 0;
}
.multiselect-dropdown.show {
    display: block;
}
.multiselect-item {
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
}
.multiselect-item:hover {
    background: #f9fafb;
}
.multiselect-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* 버튼 영역 */
.search-btns {
    display: flex;
    gap: 6px;
    margin-left: auto;
}
.btn-primary {
    background: var(--primary-brown);
    color: #fff;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    width: 80px;
    height: 30px;
    padding: 0;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.2s;
}
.btn-primary:hover { background: #1a1410; }
.btn-reset {
    background: #fff;
    border: 1px solid #e5e7eb;
    color: #374151;
    border-radius: 8px;
    width: 79px;
    height: 30px;
    padding: 0;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.2s;
}
.btn-reset:hover { background: #f9fafb; }

/* 그리드 영역 */
.grid-container {
    background: #fff;
    border-radius: 12px;
    padding: 14px 0 14px 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
.grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 2px solid var(--primary-orange); /* 주황색 라인 확장 적용 */
    padding-bottom: 4px;
    padding-right: 16px;
}
.grid-title {
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}
.grid-count {
    background: #fff7ed;
    color: var(--primary-orange);
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 13px;
    border: 1px solid #ffedd5;
}
.grid-actions {
    display: flex;
    gap: 8px;
}
.grid-scroll {
    flex: auto;
    overflow-y: auto;
    border: none;
    border-radius: 0;
    min-height: 0;
    padding-right: 4px;
}
.orders-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 1000px;
}
.orders-table thead th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    padding: 4px 6px;
    font-weight: 700;
    text-align: left;
    color: #475569;
    border-bottom: 2px solid #eef2f6;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
}
.orders-table thead th:hover {
    background: #f1f5f9;
}
.orders-table thead th.sort-active {
    color: var(--primary-orange);
}
.orders-table thead th i {
    margin-left: 4px;
    font-size: 13px;
    opacity: 0.5;
}
.orders-table tbody td {
    padding: 4px 6px;
    border-bottom: 1px solid #f1f5f9;
    color: #111; /* 진한 검은색으로 변경 */
}
.orders-table tbody tr:hover {
    background: #f8fafc;
}
.orders-table tbody tr.active-row {
    background: #fffaf0 !important;
}

/* 복사 가능 셀 스타일 */
.copyable {
    cursor: pointer;
    transition: background-color 0.1s;
}
.copyable:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

/* 페이징 영역 */
.grid-footer {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.page-size-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px; /* 사이즈 축소 */
    color: #666;
}
.page-size-selector select {
    padding: 4px 8px; /* 패딩 축소 */
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px; /* 폰트 사이즈 축소 */
    height: 28px; /* 높이 고정 */
}
.pagination {
    display: flex;
    gap: 4px;
}
.page-link {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
.page-link:hover {
    border-color: var(--primary-orange);
    color: var(--primary-orange);
}
.page-link.active {
    background: var(--primary-orange);
    color: #fff;
    border-color: var(--primary-orange);
}
.page-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 신규등록/삭제 버튼 */
.btn-add {
    background: var(--primary-orange);
    color: #fff;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    padding: 0 10px;
    height: 28px;
    font-size: 11px;
    font-weight: 700;
}
.btn-delete {
    background: #fff;
    border: 1px solid #111;
    color: #111;
    cursor: pointer;
    border-radius: 8px;
    padding: 0 10px;
    height: 28px;
    font-size: 11px;
    font-weight: 700;
}
.btn-add:hover { opacity: 0.9; }
.btn-delete:hover { background: #f9fafb; }

/* Flatpickr 커스텀 */
.flatpickr-current-month .numInputWrapper {
    width: 65px !important;
}
.flatpickr-current-month input.cur-year {
    font-weight: 700 !important;
    color: #111 !important;
}
.flatpickr-current-month .cur-month {
    font-weight: 700 !important;
    color: #111 !important;
}
.year-suffix {
    color: #111;
}

/* --- 로그 조회 버튼 스타일 --- */
.btn-log-trigger {
    padding: 2px 12px;
    background-color: #fff1f0;
    color: #f5222d;
    border: 1px solid #ffa39e;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    height: 22px;
    line-height: 1;
}

.btn-log-trigger:hover {
    background-color: #f5222d;
    color: #fff;
    border-color: #f5222d;
}

/* --- 변경 로그 모달 스타일 (order_summary.css 표준 이식) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000; /* 기존 모달보다 높게 설정 */
}

.history-modal {
    background: #fff;
    width: 480px;
    max-height: 85vh;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modal-up 0.3s ease-out;
}

@keyframes modal-up {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 32px 32px 20px;
    border-bottom: 1px solid #f1f5f9;
}

.modal-title-group {
    text-align: center;
}

.modal-sub-title {
    font-size: 13px;
    color: #94a3b8;
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

.modal-main-title {
    font-size: 22px;
    color: #1e293b;
    font-weight: 800;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    background: #f8fafc;
    flex: 1;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    background: #fff;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid #edf2f7;
    transition: transform 0.2s;
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.history-type-badge {
    background: #f1f5f9;
    color: #64748b;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
}

.history-date {
    font-size: 13px;
    color: #94a3b8;
}

.history-content {
    font-size: 13px;
    color: #334155;
    font-weight: 400;
    line-height: 1.4;
}

/* 강조 텍스트 */
.history-content strong {
    font-weight: 700;
    color: #0f172a;
    margin-right: 2px;
}

.history-content .highlight {
    color: #f26522;
    font-weight: 600;
}

.no-history {
    text-align: center;
    padding: 40px;
    color: #94a3b8;
    font-size: 14px;
}

.modal-footer {
    padding: 24px;
    text-align: center;
    border-top: 1px solid #f1f5f9;
}

.btn-close-modal {
    padding: 12px 60px;
    background: #f1f5f9;
    color: #475569;
    border: none;
    border-radius: 100px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-close-modal:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* ==========================================================
 * 전역 커스텀 검색 가능 셀렉트박스 (Searchable Select Box)
 * ========================================================== */
.custom-searchable-select {
    display: inline-block;
    vertical-align: middle;
}

.custom-searchable-select .css-input-wrap {
    width: 100%;
}

.custom-searchable-select .css-text-input {
    background-color: #fff;
    font-size: 13px;
    font-weight: 500;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    height: 30px;
    padding: 4px 24px 4px 8px;
    transition: all 0.2s ease;
}

.custom-searchable-select .css-text-input:focus {
    border-color: #f26522;
    box-shadow: 0 0 0 3px rgba(242, 101, 34, 0.15);
    outline: none;
}

.custom-searchable-select .css-arrow {
    transition: transform 0.2s ease;
}

.custom-searchable-select .css-dropdown {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

.custom-searchable-select .css-option {
    padding: 8px 12px;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
    border-bottom: 1px solid #f8fafc;
}

.custom-searchable-select .css-option:last-child {
    border-bottom: none;
}

.custom-searchable-select .css-option:hover,
.custom-searchable-select .css-option.highlighted {
    background-color: #f1f5f9;
    color: #0f172a;
}

.custom-searchable-select .css-option.selected {
    background-color: #eff6ff;
    color: #2563eb;
    font-weight: 700;
}

.custom-searchable-select .css-no-result {
    padding: 12px;
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
}
@media (max-width: 600px) {
    /* 주문취합 표 상자 */
    .orders-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 13px;
        min-width: 800px;
    }
    .grid-container {
        background: initial;
        border-radius: 0;
        padding: 0;
        box-shadow: initial;

        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
    }

    .search-row {
        display: grid !important;
        grid-template-columns: 2fr 1fr !important;
        grid-template-rows: auto auto !important;
        gap: 10px;
        width: 100% !important;
    }
    .search-row > :first-child {
        grid-column: 1 / 3;
    }
    .date-range {
        width: 100%;
        align-items: center !important;
        justify-content: center;
        height: 30px;
        display: flex;
    }
    .date-input {
        width: 100%;
        text-align: center;
        align-items: center;
        transform: translateX(-20px);
    }
    
    .date-range .flatpickr-mobile {
        box-sizing: border-box;
        height: 100% !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        line-height: 1 !important;
        vertical-align: middle;
    }

    .search-group label {
        white-space: nowrap;
    }
    .search-row {position: relative;}
    .search-group:nth-child(4) {
        position: absolute;
        top: 80px;
        left: 0;
        gap: 6px !important;
    }
    .search-group {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 4px;
        width: 100%;
    }
    #searchComp,
    .css-input-wrap,
    .custom-searchable-select {
        width: 100% !important;
    }
    .grid-scroll {
        overflow-y: auto;
        border: none;
        border-radius: 0;
        min-height: 0;
        padding-right: 4px;
        touch-action: pan-x pan-y;
    }
    #th-orderComp {
        width: 115px !important;
    }
    .grid-scroll .comp-name {
        width: 100px;
    }
    #th-deliveryId {
        width: 30px !important;
    }
    .orders-table tbody td {
        padding: 2px 6px;
        border-bottom: 1px solid #f1f5f9;
        color: #111;
    }
    #th-orderBobQty,
    #th-orderPullQty {
        width: 50px !important;
    }
    .search-group label {
        font-size: 10px;
        font-weight: 700;
        color: #111;
    }
}
@media (max-width: 400px) {
    .search-group:nth-child(4) {
        top: 85px;
    }
}
