body { font-size: 14px; background-color: #f4f6f9; color: #333; }
#wrapper { display: flex; width: 100%; min-height: 100vh; }

#sidebar {
    min-width: 250px; max-width: 250px;
    background: #343a40; color: #fff;
    transition: all 0.3s ease; z-index: 1000; flex-shrink: 0;
}
#sidebar.collapsed { margin-left: -250px; }
#sidebar .sidebar-header { padding: 20px; background: #2c3136; text-align: center; font-weight: bold; }
.nav-link { color: #c2c7d0; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,0.1); }
.main-icon { margin-right: 10px; font-size: 1rem; }
.submenu { background: #3d444b; list-style: none; padding: 0; }
.submenu .nav-link { padding-left: 50px; font-size: 13px; }
.chevron-icon { transition: transform 0.25s ease; }
.nav-link[aria-expanded="true"] .chevron-icon { transform: rotate(180deg); }

#content { width: 100%; min-width: 0; flex-grow: 1; }
.main-header { background: #fff; border-bottom: 1px solid #dee2e6; padding: 10px 20px; position: sticky; top: 0; z-index: 900; }
.content-wrapper { padding: 20px; }

/* 리스트 공통 */
.search-box { background: #fff; border-radius: 8px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); border: 1px solid #e9ecef; }
.search-row { display: grid; grid-template-columns: 100px 1fr; align-items: center; gap: 15px; margin-bottom: 15px; }
.search-label { font-size: 0.875rem; color: #555; font-weight: 600; }
.search-content { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.date-group { display: flex; align-items: center; gap: 6px; }
.date-sep { white-space: nowrap; }
.input-keyword { max-width: 500px; flex: 1; min-width: 120px; }
.input-select  { width: 120px; }
.input-date    { width: 160px; }

input[type=text]:read-only{ background-color: #EEE;}
input[type=text]:disabled{ background-color: #DDD;}
input.form-control.xd-datepicker, input.form-control.xd-datetimepicker[readonly][readonly]{ background-color: #FFF !important;}

.search-btn-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
    margin-top: 5px;
}

.table-responsive { background: #fff; border-radius: 8px; }
.table { min-width: 1000px; }
.table-thumb { width: 60px; height: 60px; object-fit: cover; border-radius: 4px; }

#overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 999; }
#overlay.show { display: block; }

@media (max-width: 768px) {
    #sidebar { position: fixed; left: -250px; height: 100vh; margin-left: 0 !important; }
    #sidebar.active { left: 0; }

    .search-row { grid-template-columns: 1fr; gap: 6px; }
    .input-select { width: 100%; }
    .input-keyword { max-width: 100%; width: 100%; }

    .date-group { display: grid; grid-template-columns: 1fr 18px 1fr; align-items: center; width: 100%; }
    .date-sep { text-align: center; }
    .input-date { width: 100%; }

    .search-btn-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        justify-content: unset;
    }
    .search-btn-row .btn { width: 100%; }

    .mobile-qty.hide{
        display: none;
    }    

    .select-mb-idx, #target-mb-ids{
        width: 100% !important;
    }

    .ol-finish-cell { min-width: 108px; }
    .ol-finish-wrap { gap: 4px; }
    .ol-finish-input {
        height: auto !important;
        min-height: 38px;
        min-width: 100px !important;
    }
    .ol-finish-clear {
        font-size: 1.3rem;
        padding: 0 4px;
    }
}

.div-category-search.hide{
    display: none;
}  

@media (max-width: 400px) {
    .date-group { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
    .date-sep { display: none; }
    .input-date { width: 100%; }

    .mobile-qty.hide{
        display: none;
    }
    
    .select-mb-idx, #target-mb-ids{
        width: 100% !important;
    }    
}

/* 페이지네이션 스타일 */
/* Pagination — Bootstrap 5 호환 */

.pg_wrap {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
  }
  
  .pg {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
  }
  
  /* 스크린리더 전용 — 시각적으로 숨김 */
  .sound_only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  
  /* 공통 버튼 베이스 */
  .pg_current,
  .pg_page,
  .pg_end {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 400;
    text-decoration: none;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    cursor: pointer;
  }
  
  /* 현재 페이지 */
  .pg_current {
    background: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.35);
  }
  
  /* 일반 페이지 버튼 */
  .pg_page {
    color: #0d6efd;
    background: #fff;
    border-color: #dee2e6;
  }
  
  .pg_page:hover {
    background: #e9f0ff;
    border-color: #0d6efd;
    color: #0d6efd;
  }
  
  /* 맨끝 버튼 */
  .pg_end {
    color: #6c757d;
    background: #fff;
    border-color: #dee2e6;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
  }
  
  .pg_end:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    color: #343a40;
  }

  /* 맨끝/처음 버튼의 텍스트를 숨기고 기호로 교체 */
.pg_start,
.pg_end {
  font-size: 0;          /* 원래 텍스트 숨김 */
}

.pg_start::before {
  content: '«';
  font-size: 1rem;
}

.pg_end::after {
  content: '»';
  font-size: 1rem;
}

/* 모달 배경 설정 */
/* Modal — Bootstrap 5 호환 */
 
/* 오버레이 (dim 배경) */
.div-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1050;
  display: none;
}
 
/* 모달 박스 */
.modal-content {
  position: relative;
  background: #fff;
  border-radius: 12px;
  border: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  width: 600px;
  max-width: 90%;
  padding: 0;
  overflow: hidden;
}
 
/* 닫기 버튼 행 */
.modal-content > .close {
  position: absolute;
  top: 12px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #6c757d;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
  z-index: 1;
}
 
.modal-content > .close:hover {
  background: #f1f3f5;
  color: #212529;
}
 
/* 본문 영역 */
.modal-body {
  padding: 48px 28px 28px; /* 닫기 버튼 높이만큼 상단 여백 */
  color: #495057;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* 폼 공통 */
/* ── 폼 박스 ── */
.form-box {
    background: #fff; border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* 테이블 스타일 폼 */
.form-table { width: 100%; border-collapse: collapse; }
.form-table tr { border-bottom: 1px solid #e9ecef; }
.form-table tr:last-child { border-bottom: none; }

.form-table th {
    width: 160px;
    background: #f8f9fa;
    padding: 14px 20px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #555;
    vertical-align: middle;
    white-space: nowrap;
    border-right: 1px solid #e9ecef;
}

.form-table th .required {
    color: #dc3545;
    margin-left: 3px;
}

.form-table td { padding: 12px 20px; vertical-align: middle; }

/* 체크박스 / 라디오 간격 */
.check-group { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.check-group .form-check { margin: 0; padding: 0; display: flex; align-items: center; gap: 6px; }
.check-group .form-check-input { margin: 0; }
.check-group .form-check-label { margin: 0; cursor: pointer; }

/* 파일첨부 */
.file-list { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.file-item {
    display: inline-flex; align-items: center; gap: 6px;
    background: #f1f3f5; border-radius: 4px;
    padding: 4px 10px; font-size: 13px; color: #495057;
    width: fit-content;
}
.file-item .btn-remove {
    background: none; border: none; padding: 0;
    color: #adb5bd; cursor: pointer; line-height: 1;
    font-size: 14px;
}
.file-item .btn-remove:hover { color: #dc3545; }

/* 버튼 영역 */
.form-footer {
    padding: 16px 20px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    display: flex;
    justify-content: center;
    gap: 8px;
}

/* ── 색상 스와치 ── */
.color-swatch {
    display: inline-block;
    width: 16px; height: 16px;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.15);
    vertical-align: middle;
    margin-right: 2px;
}

/* ── 이미지 미리보기 ── */
.image-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    width: 100%;
}

.image-preview-item {
    position: relative;
    width: 110px; height: 110px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    overflow: hidden;
    background: #f8f9fa;
    flex-shrink: 0;
}

.image-preview-item img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}

/* 삭제 버튼: 우상단 오버레이 */
.image-preview-item .btn-image-delete {
    position: absolute;
    top: 4px; right: 4px;
    width: 22px; height: 22px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.image-preview-item .btn-image-delete:hover { background: #dc3545; }

/* 이미지 개수 뱃지 */
.img-count-badge {
    font-size: 12px;
    color: #6c757d;
    margin-top: 6px;
}

/* ── 모바일 (폼 전용 추가분) ── */
@media (max-width: 768px) {
    .form-table,
    .form-table tbody,
    .form-table tr,
    .form-table th,
    .form-table td { display: block; width: 100%; }

    .form-table tr { border-bottom: none; padding-bottom: 4px; }
    .form-table tr + tr { border-top: 1px solid #e9ecef; }

    .form-table th {
        border-right: none;
        background: transparent;
        padding: 14px 16px 4px;
        color: #666;
    }
    .form-table td { padding: 4px 16px 14px; }

    .form-footer { flex-direction: column; }
    .form-footer .btn { width: 100%; }

    .image-preview-item { width: 90px; height: 90px; }
}

/* 자동완성 결과 */
.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 200;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    list-style: none;
    margin: 4px 0 0;
    padding: 4px 0;
    min-width: 280px;
    max-height: 220px;
    overflow-y: auto;
}
.autocomplete-results .list-item {
    padding: 8px 14px;
    font-size: 0.875rem;
    color: #333;
    cursor: pointer;
}
.autocomplete-results .list-item:hover {
    background: #e9f0ff;
    color: #0d6efd;
}

/* 폼 간격 축소 — product_form 전용 */
.form-table-sm th { padding: 8px 16px; }
.form-table-sm td { padding: 6px 16px; }

/* 선택 회원 태그 가로 나열 */
#selected-members { display: flex; flex-direction: row; flex-wrap: wrap; gap: 6px; }

/* 키워드 태그 삭제 버튼 */
.keyword-tag .btn-remove { font-size: 13px; }

/* 사이드바 기본 배경 및 링크 스타일 */
#sidebar {
    background-color: #2c3e50; /* 어두운 네이비 톤 */
    min-height: 100vh;
}

#sidebar .nav-link {
    color: rgba(255, 255, 255, 0.7); /* 기본 글자색 (약간 투명하게) */
    transition: all 0.3s;
    padding: 10px 20px;
    border-left: 4px solid transparent; /* 강조를 위한 왼쪽 선 미리 확보 */
}

/* 1. 마우스를 올렸을 때 (Hover) */
#sidebar .nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

/* 2. 현재 활성화된 메뉴 (Active) - PHP에서 .active 클래스를 붙였을 때 */
#sidebar .nav-link.active {
    color: #fff !important;
    font-weight: 600; /* 글자 굵게 */
    background-color: #34495e; /* 배경을 살짝 밝게 */
    border-left: 4px solid #3498db; /* 왼쪽에 포인트 컬러 선 생성 (추천: 파란색) */
}

/* 3. 펼쳐진 부모 메뉴 강조 (Submenu가 열렸을 때 상위 메뉴) */
#sidebar .nav-link:not(.collapsed) {
    color: #fff;
    background-color: rgba(0, 0, 0, 0.1);
}

/* 4. 서브메뉴(하위메뉴) 스타일 */
#sidebar .submenu {
    background-color: #1a252f; /* 서브메뉴는 조금 더 어둡게 해서 깊이감 부여 */
}

#sidebar .submenu .nav-link {
    padding-left: 50px; /* 서브메뉴는 오른쪽으로 더 밀기 */
    font-size: 0.9rem;
}

#sidebar .submenu .nav-link.active {
    color: #3498db !important; /* 서브메뉴 활성화 시 글자색만 포인트 */
    background-color: transparent;
    border-left: none; /* 서브메뉴는 왼쪽 선 제외 (깔끔하게) */
}

/* 상품등록 키워드 표시 */
#keyword-tags{ 
    display:flex;
    flex-direction:row;
    flex-wrap:wrap;
    gap:6px;
    margin-bottom:6px;
    min-height:0; 
}
.keyword-item {
    display:inline-flex;
    align-items:center;
    gap:4px;
    background:#f1f3f5;
    border-radius:4px;
    padding:3px 8px;
    font-size:13px;
    color:#495057;
}

/* 상품목록 중간관리자 선택페이지  */
.manager-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 16px 12px 12px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
    margin: 0;
    text-align: center;
}
.manager-card:hover {
    border-color: #0d6efd;
    box-shadow: 0 2px 10px rgba(13,110,253,.15);
}
.manager-card.selected {
    border-color: #0d6efd;
    background: #f0f5ff;
    box-shadow: 0 2px 10px rgba(13,110,253,.2);
}

.manager-card-img {
    width: 72px; height: 72px;
    border-radius: 50%;
    overflow: hidden;
    background: #f1f3f5;
    flex-shrink: 0;
}
.manager-card-img img {
    width: 100%; height: 100%; object-fit: cover;
}
.manager-card-no-img {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; color: #adb5bd;
}

.manager-card-info { width: 100%; }
.manager-card-name {
    font-weight: 600; font-size: .9rem; color: #212529;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.manager-card-id {
    font-size: .78rem; color: #6c757d;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.manager-card-check .form-check-input {
    width: 1.1rem; height: 1.1rem; cursor: pointer;
}



/* 교환 / 환불신청 */
.br-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
}
.br-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.br-card.is-replied { border-left: 4px solid #198754; }
.br-card.is-wait    { border-left: 4px solid #ffc107; }

/* ── 문의 본문 ── */
.br-body {
    display: flex;
    gap: 16px;
    padding: 16px;
}

/* 썸네일 */
.br-thumb-wrap { flex-shrink: 0; }
.br-thumb {
    width: 72px; height: 72px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #e9ecef;
    display: block;
}
.br-thumb-empty {
    width: 72px; height: 72px;
    border-radius: 8px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ced4da;
    font-size: 1.4rem;
}

/* 메인 정보 */
.br-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 메타 행 */
.br-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: .83rem;
}
.br-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 700;
    flex-shrink: 0;
}
.badge-replied { background: #d1e7dd; color: #0f5132; }
.badge-wait    { background: #fff3cd; color: #664d03; }

.br-code, .br-personal, .br-qty, .br-date {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}
.br-code     { font-weight: 600; color: #343a40; }
.br-qty      { color: #495057; }
.br-date     { color: #868e96; }
.br-requester{ color: #6c757d; }
.br-actions  { display: flex; gap: 4px; }

/* 버튼 xs */
.btn-xs {
    padding: 1px 8px;
    font-size: .75rem;
    border-radius: 4px;
}

/* 요청 내용 */
.br-content {
    font-size: .9rem;
    color: #343a40;
    line-height: 1.65;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 10px 14px;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ── 답변 영역 ── */
.br-reply {
    border-top: 1px dashed #dee2e6;
    background: #f0faf4;
    padding: 14px 16px 14px calc(16px + 72px + 16px); /* 썸네일 너비만큼 들여쓰기 */
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.br-reply-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .85rem;
    color: #198754;
}
.br-reply-content {
    font-size: .9rem;
    color: #343a40;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-all;
}

@media (max-width: 576px) {
    .br-thumb { width: 52px; height: 52px; }
    .br-thumb-empty { width: 52px; height: 52px; }
    .br-reply { padding-left: 16px; }
    .br-reply-form { padding-left: 16px; }
    .br-meta { gap: 6px; }
}

/* ── 답변 입력 폼 (관리자) ── */
.br-reply-form {
    border-top: 1px dashed #dee2e6;
    background: #f8fbff;
    padding: 14px 16px 14px calc(16px + 72px + 16px);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.br-reply-form-header {
    font-size: .85rem;
    font-weight: 600;
    color: #0d6efd;
    display: flex;
    align-items: center;
    gap: 5px;
}
.br-reply-form-body .reply-textarea {
    font-size: .9rem;
    resize: vertical;
}

/* 주문목록 */ 
/* ── 메인 테이블 ── */
.order-list-table { min-width: 1000px; }
.order-list-table thead th { font-size: .8rem; white-space: nowrap; }
.order-list-table tbody td { font-size: .85rem; }
.order-list-table tbody tr.ol-row td {
    border-top: 2px solid #dee2e6;
    vertical-align: top;
    padding-top: 10px;
    padding-bottom: 10px;
}

/* ── 이미지 + 상품명 ── */
.ol-thumb-cell { padding: 8px 6px !important; }
.ol-prod-thumb-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}
.ol-prod-thumb-wrap:last-child { margin-bottom: 0; }
.ol-thumb {
    width: 52px; height: 52px; border-radius: 7px;
    object-fit: cover; border: 1px solid #e9ecef;
    display: block;
}
.ol-thumb-empty {
    width: 52px; height: 52px; border-radius: 7px;
    background: #f8f9fa; border: 1px solid #e9ecef;
    display: flex; align-items: center; justify-content: center;
    color: #ced4da; font-size: 1.1rem;
}
.ol-prod-name {
    font-size: .72rem;
    color: #495057;
    word-break: keep-all;
    text-align: center;
    line-height: 1.3;
}

/* ── 품번 구분선 ── */
.ol-codeline { margin-bottom: 8px; line-height: 1.4; }
.ol-codeline:last-child { margin-bottom: 0; }

/* ── 수량 블록 ── */
.ol-prod-block-title {
    font-size: .78rem;
    font-weight: 600;
    color: #343a40;
    margin-bottom: 5px;
    padding-bottom: 4px;
    border-bottom: 1px solid #e9ecef;
}
.ol-prod-block-title .text-muted { font-weight: 400; font-size: .73rem; }

/* ── 인라인 수량 테이블 ── */
.ol-qty-table {
    width: 100%; border-collapse: collapse;
    font-size: .78rem; white-space: nowrap;
}
.ol-qty-table thead tr { background: #f1f3f5; }
.ol-qty-table thead th {
    padding: 3px 8px; font-weight: 600; color: #868e96;
    border: 1px solid #dee2e6; text-align: center;
}
.ol-qty-table tbody td {
    padding: 0 !important; border: 1px solid #e9ecef;
    text-align: center; color: #343a40;
}
.ol-qty-table tbody tr:hover td { background: #f8f9fa; }

/* ── 색상 도트 ── */
.ol-color-rect {
    display: inline-block;
    width: 14px; height: 14px;
    border-radius: 10%;
    border: 1px solid rgba(0,0,0,.15);
    margin-right: 3px;
    flex-shrink: 0;
}

/* ── 주문상태 배지 ── */
.ol-status-cell { padding: 6px 8px !important; vertical-align: top !important; }
.ol-state-badge {
    display: inline-block; padding: 3px 8px; border-radius: 10px;
    font-size: .75rem; font-weight: 700; white-space: nowrap;
}
.badge-done    { background: #d1e7dd; color: #0f5132; }
.badge-partial { background: #fff3cd; color: #856404; }
.badge-nosend  { background: #fde8e8; color: #c0392b; }
.badge-cancel  { background: #e9ecef; color: #6c757d; }
/* 취소상태 셀렉트 */
.ol-cancel-status { font-size: .78rem; padding: 2px 20px 2px 6px; }
.ol-cancel-status.changed { border-color: #ffc107; background-color: #fffdf0; }
.ol-cancel-status[data-orig="0"]  { background-color: #f8f9fa; color: #495057; }
.ol-cancel-status[data-orig="-1"] { background-color: #fff3cd; color: #856404; font-weight:600; }
.ol-cancel-status[data-orig="-2"] { background-color: #f8d7da; color: #842029; font-weight:600; }

/* ── 완료예정일 ── */
.ol-finish-cell { padding: 6px 8px !important;  }
.ol-finish-wrap { display: flex; align-items: center; gap: 3px; }
.ol-finish-input {
    font-size: .78rem; cursor: pointer;
    background: #fff !important; min-width: 0; flex: 1;
}
.ol-finish-input.is-set { border-color: #0d6efd; color: #0d6efd; font-weight: 600; }
.ol-finish-clear {
    flex-shrink: 0; background: none; border: none;
    padding: 0 2px; color: #adb5bd; cursor: pointer;
    line-height: 1; font-size: 1rem;
}
.ol-finish-clear:hover { color: #dc3545; }

/* ── 주문상태별 행 배경 ── */
/* table-hover 의 :hover 보다 우선 적용되도록 !important 사용 */
.ol-state-pending td                    { background-color: #f8f9fa !important; }
.ol-state-pending td:first-child        { border-left: 3px solid #adb5bd; }

.ol-state-done td                       { background-color: #f0faf4 !important; }
.ol-state-done td:first-child           { border-left: 3px solid #198754; }

.ol-state-nosend td                     { background-color: #fffdf0 !important; }
.ol-state-nosend td:first-child         { border-left: 3px solid #ffc107; }

.ol-state-partial td                    { background-color: #f0f8ff !important; }
.ol-state-partial td:first-child        { border-left: 3px solid #0dcaf0; }

.ol-state-cancel td                     { background-color: #fff5f5 !important; color: #adb5bd; }
.ol-state-cancel td:first-child         { border-left: 3px solid #dc3545; }

/* hover 시 살짝 어둡게 */
.ol-state-pending:hover td              { background-color: #eef0f2 !important; }
.ol-state-done:hover td                 { background-color: #e2f4ea !important; }
.ol-state-nosend:hover td               { background-color: #fff8d6 !important; }
.ol-state-partial:hover td              { background-color: #e2f1fb !important; }
.ol-state-cancel:hover td               { background-color: #fde8e8 !important; }


/* ── 정산 요약 테이블 ── */
.ol-summary-wrap { overflow-x: auto; }
.ol-summary-table { min-width: 600px; font-size: .82rem; }
.ol-summary-table thead th {
    text-align: center; white-space: nowrap;
    padding: 6px 10px; font-size: .78rem;
}
.ol-summary-table tbody td { padding: 6px 10px; }
.ol-sum-num { text-align: right; white-space: nowrap; font-family: monospace; }

/* ── 버튼 xs ── */
.btn-xs { padding: 2px 8px; font-size: .75rem; border-radius: 4px; }

/* 체크리스트 스타일 */
/* ── 테이블 ── */
.ocl-table { min-width: 960px; }
.ocl-table thead th { font-size: .79rem; white-space: nowrap; }
.ocl-table tbody td { font-size: .84rem; }
.ocl-table tbody tr.ocl-row td { vertical-align: middle; }

/* 확인 완료 행 배경 */
.ocl-row-done td { background: #f6fff6 !important; color: #3a7d44; }

/* ── 이미지 + 상품명 ── */
.ocl-thumb-cell { padding: 6px 5px !important; }
.ocl-thumb {
    width: 44px; height: 44px; border-radius: 6px;
    object-fit: cover; border: 1px solid #e9ecef;
    display: block; margin: 0 auto 3px;
}
.ocl-thumb-empty {
    width: 44px; height: 44px; border-radius: 6px;
    background: #f8f9fa; border: 1px solid #e9ecef;
    display: flex; align-items: center; justify-content: center;
    color: #ced4da; font-size: 1rem; margin: 0 auto 3px;
}
.ocl-prod-name {
    font-size: .70rem; color: #495057;
    word-break: keep-all; line-height: 1.2;
    max-width: 70px; text-align: center; margin: 0 auto;
}

/* ── 색상 도트 ── */
.ocl-color-dot {
    display: inline-block;
    width: 14px; height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,.18);
    vertical-align: middle;
    margin-right: 4px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.12);
}

/* ── 확인여부 셀 ── */
.ocl-cs-cell { padding: 5px 7px !important; vertical-align: middle !important; }
.ocl-cs-sel { font-size: .78rem; padding: 2px 20px 2px 6px; }
.ocl-cs-sel.changed { border-color: #ffc107; background-color: #fffdf0; }

/* ── 메모 셀 ── */
.ocl-check_memo-cell { padding: 5px 7px !important; min-width: 200px; vertical-align: middle !important; }
.ocl-check_memo-wrap { display: flex; flex-direction: row; align-items: center; gap: 4px; }
.ocl-check_memo-input { flex: 1; font-size: .78rem; }
.ocl-check_memo-input.changed { border-color: #ffc107; }
.ocl-check_memo-input.saved   { border-color: #198754; }

/* 주문확인 프린트 스타일 */ 
@media print {
    /* 화면 요소 전체 숨김 */
    body * { visibility: hidden; }

    /* 인쇄 전용 영역만 표시 */
    #print-wrap,
    #print-wrap * { visibility: visible; }
    #print-title  { display: block !important; visibility: visible !important; }

    #print-wrap {
        position: fixed;
        top: 0; left: 0;
        width: 100%;
        padding: 8px;
        background: #fff;
    }

    html, body { overflow: hidden !important; }

    .table-responsive {
        overflow: visible !important;
        box-shadow: none !important;
    }

    /* 인쇄 전용 테이블 스타일 */
    #ocl-print-table table {
        width: 100% !important;
        min-width: 0 !important;
        table-layout: fixed;
        border-collapse: collapse;
        font-size: .72rem;
    }
    #ocl-print-table th,
    #ocl-print-table td {
        padding: 4px 5px !important;
        border: 1px solid #ccc !important;
        word-break: break-all;
        white-space: normal !important;
        vertical-align: middle;
    }
    #ocl-print-table thead th {
        background: #e9ecef !important;
        font-weight: 600;
        text-align: center;
    }
    #ocl-print-table .pt-done td { background: #f6fff6 !important; }
    #ocl-print-table .pt-amount  { text-align: right; color: #dc3545; font-weight: 700; }
    #ocl-print-table .pt-num     { text-align: right; }
    #ocl-print-table .pt-center  { text-align: center; }

    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    #ocl-spinner-overlay { display: none !important; }
}

/* 신상목록 */
.product-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.07);
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.15s;
}
.product-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,.12);
}

/* 이미지 래퍼 — relative 필수 */
.product-card-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f8f9fa;
    flex-shrink: 0;
    position: relative;
}
.product-card-img img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.product-card-no-img {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem; color: #dee2e6;
}

/* ── 하단 오버레이 ── */
.product-card-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 18px 7px 7px;
    /* 아래쪽이 진하고 위쪽이 투명한 그라디언트 */
    background-color: rgba(0, 0, 0, 0.4);  /*linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.55) 100%);*/
    display: flex;
    flex-direction: column;
    gap: 4px;
    /* 카드 호버 시 살짝 올라오는 효과 */
    transform: translateY(0);
    transition: opacity 0.2s;
}
/* 사이즈 태그 행 */
.pco-sizes {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}
.pco-size-tag {
    background: rgba(255,255,255,0.22);
    color: #fff;
    font-size: .65rem;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
    border: 1px solid rgba(255,255,255,0.4);
    line-height: 1.5;
    white-space: nowrap;
}
/* 색상 도트 행 */
.pco-colors {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.pco-color-dot {
    width: 13px; height: 13px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.8);
    display: inline-block;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    flex-shrink: 0;
}

/* 카드 바디 — 8열에서 패딩 축소 */
.product-card-body {
    padding: 8px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.product-card-code {
    font-size: .7rem;
    color: #868e96;
}
.product-card-name {
    font-size: .8rem;
    font-weight: 600;
    color: #212529;
    line-height: 1.3;
    /* 2줄까지만 표시 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-card-price {
    font-size: .85rem;
    font-weight: 700;
    color: #0d6efd;
    margin-top: auto;
}
.product-card-btns {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}
/* 8열에서 버튼 텍스트 줄어듦 방지 */
.product-card-btns .btn {
    font-size: .75rem;
    padding: 5px 4px;
}

/* 반응형 — xl 미만(1200px)에서는 기본 Bootstrap 열 수 따름 */
@media (max-width: 1199px) {
    .product-card-overlay { padding: 14px 6px 6px; }
}
@media (max-width: 575px) {
    .product-card-overlay { padding: 12px 5px 5px; }
    .pco-size-tag { font-size: .6rem; }
}

/* 품번 목록 */

/* 상품 주문 */
.order-form-wrap {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    overflow: hidden;
}

/* ── 왼쪽 패널 ── */
.order-form-left {
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
}
.order-img-wrap { padding: 16px 16px 0; }
.order-img-main {
    width: 100%; aspect-ratio: 1/1;
    border-radius: 8px; overflow: hidden;
    background: #f8f9fa;
    display: flex; align-items: center; justify-content: center;
}
.order-img-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.order-img-empty { font-size: 3rem; color: #dee2e6; }
.order-img-thumbs {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-top: 8px;
}
.order-img-thumb {
    width: 52px; height: 52px;
    border-radius: 5px; overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer; flex-shrink: 0;
}
.order-img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.order-img-thumb.active { border-color: #0d6efd; }

/* 상품 정보 블록 */
.order-product-info {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-size: .88rem;
}
.order-product-name {
    font-size: 1rem;
    font-weight: 700;
    color: #212529;
}
.order-product-price {
    font-size: 1rem;
    font-weight: 700;
    color: #0d6efd;
}

/* 라벨-값 행 */
.order-info-row {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.5;
}
.order-info-label {
    flex-shrink: 0;
    width: 85px;
    color: #868e96;
    font-size: .82rem;
    padding-top: 1px;
}
.order-info-value {
    flex: 1;
    color: #343a40;
    word-break: break-all;
}
.order-info-divider {
    border-top: 1px dashed #dee2e6;
    margin: 2px 0;
}

/* 메모 표시(상품 쪽) */
.order-info-memo .order-memo-text {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: .83rem;
    color: #495057;
    line-height: 1.55;
}

/* ── 오른쪽 패널 ── */
.order-form-right { display: flex; flex-direction: column; }

/* 섹션 구분 타이틀 */
.order-section-title {
    padding: 10px 16px;
    font-size: .87rem;
    font-weight: 600;
    color: #495057;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.order-table-wrap { overflow-y: auto; max-height: 380px; }
.order-table { min-width: 0 !important; }
.order-table th { font-size: .82rem; white-space: nowrap; }

/* 색상 그룹 구분선 */
.order-table tbody tr.color-first td {
    border-top: 2px solid #dee2e6;
}

/* 수량 입력 강조 */
.order-qty-input.has-value {
    background-color: #fff3cd;
    border-color: #ffc107;
    font-weight: 600;
}
tr.order-row.has-value td { background-color: #fffdf0; }

/* 메모 입력 섹션 */
.order-memo-section { border-top: 1px solid #e9ecef; }

/* 사이즈/색상 테이블 */

/* 주문 상세 페이지 */
.od-bottom-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    align-items: start;
}
.od-col-left, .od-col-right { min-width: 0; }

.od-section-title {
    font-size: .9rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid #e9ecef;
}

/* ── 상품정보 좌측 th ── */
.od-col-left .form-table th { width: 80px; }

/* ── 스크롤 테이블 공통 ── */

.od-table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8f9fa;
}

/* ── 주문/처리 테이블 ── */
.order-detail-table { min-width: 0 !important; }
.order-detail-table th,
.order-detail-table td { font-size: .82rem; }

/* ── 상품 이미지 갤러리 ── */
.od-img-gallery {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    padding: 10px 12px;
    overflow-x: auto;
    border-bottom: 1px solid #e9ecef;
    background: #fafafa;
}
.od-img-wrap {
    flex-shrink: 0;
    display: block;
    width: 80px; height: 80px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #dee2e6;
    background: #fff;
}
.od-img-wrap img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: opacity 0.15s;
}
.od-img-wrap:hover img { opacity: 0.82; }

/* ── 처리 등록 박스 ── */
.od-process-box {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,.07);
}
.od-process-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.od-process-row {
    display: flex;
    gap: 6px;
    align-items: center;
}
.od-process-row .form-select,
.od-process-row .form-control { flex: 1; min-width: 0; }

/* ── 모바일 ── */
@media (max-width: 900px) {
    .od-bottom-grid { grid-template-columns: 1fr; }
    .od-process-row { flex-wrap: wrap; }
}

/* ── 주문 상품 행 선택 강조 ── */
#order-item-table tbody tr[data-opc-idx] { cursor: pointer; }
#order-item-table tbody tr.opc-row-selected td {
    background-color: #e7f0ff !important;
    border-top-color: #b6d0ff;
    border-bottom-color: #b6d0ff;
}
#order-item-table tbody tr.opc-row-selected:first-child td { border-top-color: #b6d0ff; }


@media (max-width: 768px) {
    .order-form-left { border-right: none; border-bottom: 1px solid #e9ecef; }
    .order-img-main { aspect-ratio: 4/3; }
    .order-table-wrap { max-height: none; }
    .order-history-panel { border-top: 1px solid #e9ecef; border-left: none !important; }
}

/* ── 주문 히스토리 패널 ── */
.order-history-panel {
    border-left: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.order-history-list {
    overflow-y: auto;
    flex: 1;
    max-height: 600px;
}
.order-history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #adb5bd;
    font-size: .85rem;
}
.order-history-empty i {
    font-size: 2rem;
    margin-bottom: 8px;
}

/* 수량 초기화 버튼 */
.order-qty-reset-btn {
    font-size: .75rem;
    padding: 2px 10px;
    line-height: 1.6;
    border-radius: 20px;
    display: none;
    align-items: center;
    gap: 4px;
}

/* 주문 건별 그룹 */
.order-history-group {
    border-bottom: 2px solid #e9ecef;
    cursor: pointer;
    transition: background .15s;
}
.order-history-group:last-child { border-bottom: none; }
.order-history-group:hover { background: #f0f4ff; }
.order-history-group.selected { background: #e7f0ff; }
.order-history-group.selected .order-history-group-header {
    background: #d0e2ff;
}

.order-history-group-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-size: .78rem;
    user-select: none;
}
.order-history-date { color: #495057; font-weight: 600; }
.order-history-od   { color: #adb5bd; font-size: .72rem; word-break: break-all; }
.order-history-group-total { font-size: .78rem; color: #495057; white-space: nowrap; }
.order-history-group-total strong, .manager-wechat-id { color: #0d6efd !important; }

/* 내부 테이블 */
.order-history-table-wrap { overflow-x: auto; }
.order-history-table {
    font-size: .78rem;
    min-width: 0 !important;
    margin-bottom: 0 !important;
}
.order-history-table thead th {
    font-size: .72rem;
    color: #868e96;
    font-weight: 600;
    background: transparent;
    padding: 5px 8px;
    white-space: nowrap;
    border-bottom-width: 1px;
}
.order-history-table tbody td {
    padding: 4px 8px;
    vertical-align: middle;
    white-space: nowrap;
    border-bottom: 1px solid #f1f3f5;
}
.order-history-table tbody tr:last-child td { border-bottom: none; }

/* 로딩 스피너 오버레이 */
#spinner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.3);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
#spinner-overlay.hidden { display: none; }
#spinner-box {
    background: #fff;
    border-radius: 12px;
    padding: 32px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
    min-width: 160px;
}
.spinner-ring {
    width: 44px;
    height: 44px;
    border: 4px solid #e9ecef;
    border-top-color: #212529;
    border-radius: 50%;
    animation: ocl-spin .7s linear infinite;
}
@keyframes ocl-spin { to { transform: rotate(360deg); } }
#spinner-text {
    font-size: .92rem;
    color: #495057;
    font-weight: 500;
    letter-spacing: .02em;
}

/* 주문상품목록 아이템 수 조절 */
@media (min-width: 1200px) {
    .product-grid-10 > .col {
        width: 10%; /* 100% ÷ 10 */
        flex: 0 0 10%;
        max-width: 10%;
    }
}


/* 팝업 기본 스타일 */
.custom-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* 화면 정중앙 배치 */
    width: 90%; /* 모바일에서는 화면의 90% 차지 */
    max-width: 400px; /* PC에서는 최대 400px까지만 커짐 */
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    z-index: 9999;
    overflow: hidden;
}

/* 제목 영역 */
.popup-header {
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    margin: 0;
}
.popup-header h4 {
    margin: 0;
    font-size: 16px;
    color: #333;
    text-align: center;
}

/* 이미지 영역 (비율 유지하며 꽉 차게) */
.popup-body img {
    width: 100%;
    height: auto;
    display: block;
}

/* 하단 버튼 및 체크박스 영역 */
.popup-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #333;
    color: #fff;
    font-size: 14px;
}
.popup-footer label {
    cursor: pointer;
}
.popup-footer button {
    background: none;
    border: none;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    padding: 5px 10px;
}

/* 토스트 메시지 */
#div-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #343a40;
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.85rem;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    white-space: nowrap;
}
#div-toast.show { opacity: 1; }

/* 카드 래퍼 — 하트 버튼의 기준점 */
.manager-card-wrap {
    position: relative;
}

.manager-card{
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

/* 하트 버튼 */
.manager-bookmark-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    width: 30px;
    height: 30px;
    /* border-radius: 50%; */ 
    border: none;
    background: rgba(255, 255, 255, 0.92);
    /* box-shadow: 0 1px 4px rgba(0,0,0,0.15); */ 
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    /*transition: transform 0.15s ease, background 0.15s ease;*/
    font-size: 0.85rem;
    line-height: 1;
    padding: 0;
}
.manager-bookmark-btn:hover {
    /*transform: scale(1.15);*/
    background: #fff;
}

/* 북마크 상태별 색상 */
.manager-bookmark-btn.bookmarked i   { color: #e03131; }
.manager-bookmark-btn:not(.bookmarked) i { color: #ced4da; }

/* 빈 상태 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    background: #fff;
    border: 1px dashed #dee2e6;
    border-radius: 12px;
    text-align: center;
}
.empty-state-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #fff0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}
.empty-state-icon i {
    font-size: 2.2rem;
    color: #e03131;
}
.empty-state-title {
    font-size: 1rem;
    font-weight: 600;
    color: #343a40;
    margin-bottom: 8px;
}
.empty-state-desc {
    font-size: 0.85rem;
    color: #868e96;
    line-height: 1.6;
    margin: 0;
}


/* ── 기본(PC): 한 줄 정렬 ── */
.po-list-actions {
    display: flex;
    gap: 0.5rem;
}

/* ── 모바일: 툴바(건수+버튼) 깨짐 방지 ── */
@media (max-width: 576px) {
    .po-list-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .po-list-actions .btn {
        flex: 1;            /* 버튼 2개가 너비를 균등하게 나눠 가짐 */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

