/**
 * 주문관리 페이지 전용 CSS (admin_common.css 위에서 동작)
 * 사용되지 않는 사이드바/검색/액션버튼/반응형 스타일 제거 완료
 */

/* ═══════════════════════════════════════
   레이아웃: 상단 테이블 + 리사이저 + 하단 요약
   ═══════════════════════════════════════ */
.content-wrapper {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.main-div {
    flex: 1;
    min-height: 200px;
    height: 70%;
    padding: 0 15px 5px;
    overflow: auto;
    transition: height 0.1s ease;
}

.table-container {
    display: inline-block;
    height: 100%;
    border-radius: 6px;
    background: white;
    width: fit-content;
}

/* ═══════════════════════════════════════
   리사이저 (상/하 영역 드래그 조절)
   ═══════════════════════════════════════ */
.resizer {
    width: 100%;
    height: 10px;
    background: #e0e0e0;
    cursor: row-resize;
    position: relative;
    user-select: none;
    transition: background 0.2s;
    z-index: 10;
}
.resizer:hover { background: #bdbdbd; }
.resizer:active, .resizer.active { background: #9e9e9e; }

.resizer-handle {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 50px; height: 4px;
    background: #757575;
    border-radius: 2px;
}
.resizer:hover .resizer-handle { background: #616161; }

.resizing { user-select: none !important; cursor: row-resize !important; }
.resizing * { pointer-events: none !important; }

/* ═══════════════════════════════════════
   하단 영역 (요약 테이블)
   ═══════════════════════════════════════ */
.bottom-div {
    height: 200px;
    min-height: 100px;
    padding: 0 15px 15px;
    width: 100%;
    transition: height 0.1s ease;
}

.bottom-container {
    height: 100%;
    background: white;
    border-radius: 6px;
    padding: 12px;
}

/* ═══════════════════════════════════════
   데이터 테이블
   ═══════════════════════════════════════ */
.data-table {
    table-layout: fixed;
    border-collapse: collapse;
    white-space: nowrap;
}

/* 헤더 — sticky 고정, 불투명 배경으로 행 비침 방지 */
.data-table thead th {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 8px 10px;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    color: #495057;
    background-color: #eceef0;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    box-shadow: 0 2px 0 #bbb;
}
.data-table thead th:first-child { border-left: none; }
.data-table thead th:last-child { border-right: none; }

/* 데이터 셀 */
.data-table td {
    padding: 8px 10px;
    border: 1px solid #eee;
    white-space: nowrap;
    text-align: center;
}

/* rowspan 셀 수직 가운데 */
.data-table td[rowspan] {
    vertical-align: middle;
}

/* 숫자 데이터 — 오른쪽 정렬 */
.data-table td.input-values,
.data-table td.size-info,
.data-table td.cost-calc,
.data-table td.category-info {
    text-align: right;
    padding-right: 12px;
}

/* 컬럼 너비 */
.data-table td.category-info:nth-child(8),
.data-table th.category-info:nth-child(8) {
    width: 80px; min-width: 80px; max-width: 80px;
}
.data-table td.category-info:nth-child(9),
.data-table th.category-info:nth-child(9) {
    width: 120px; min-width: 120px; max-width: 120px;
}

/* 텍스트 데이터 — 가운데 정렬 */
.data-table td.basic-info,
.data-table td.options {
    text-align: center;
}

/* 옵션 컬럼 최소 너비 */
.data-table td.options,
.data-table th.options {
    min-width: 160px;
}

/* ═══════════════════════════════════════
   행 스타일
   ═══════════════════════════════════════ */
.data-table tbody tr:hover { background-color: #f0f4ff; }
.data-table tbody tr:nth-child(even) { background-color: #fafafa; }

/* 만료된 행 — 빨간 배경 */
.data-table tr.expired { background-color: #fce4ec !important; }
.data-table tr.expired:hover { background-color: #f8bbd0 !important; }

/* 행 선택 dim 효과 */
.row-dimmed { opacity: 0.3; transition: opacity 0.3s ease; }

/* 체크박스 */
.data-table input[type="checkbox"] { width: 16px; height: 16px; }

/* ═══════════════════════════════════════
   컬럼 토글 (숨김 처리)
   ═══════════════════════════════════════ */
.hidden-column {
    display: none !important;
    width: 0 !important; height: 0 !important;
    padding: 0 !important; border: 0 !important;
    margin: 0 !important; overflow: hidden !important;
}

/* ═══════════════════════════════════════
   검색 하이라이트
   ═══════════════════════════════════════ */
.search-highlight { background-color: #ffeb3b; }
.search-highlight.current { background-color: #ffc107; }

/* ═══════════════════════════════════════
   날짜/시간
   ═══════════════════════════════════════ */
.timestamps .date { color: #333; font-weight: 500; }
.timestamps .time { color: #666; margin-left: 5px; }

/* ═══════════════════════════════════════
   로딩 인디케이터
   ═══════════════════════════════════════ */
.loading {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255,255,255,0.95);
    padding: 20px 40px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 10000;
    display: none;
    font-size: 16px; color: #333;
}
.loading.active { display: block; }

/* ═══════════════════════════════════════
   하단 요약 테이블 (summary-table)
   ═══════════════════════════════════════ */
.summary-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.summary-table th,
.summary-table td {
    padding: 8px 10px;
    border: 1px solid #eee;
    white-space: nowrap;
    text-align: center;
    width: 10%;
}

.summary-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.summary-table td.price { font-weight: 500; color: #333; }
.summary-table td.discount { color: #e91e63; }
.summary-table td.final-price { font-weight: 600; color: #2196f3; }

.summary-table td.memo {
    text-align: left;
    white-space: pre-wrap;
    padding: 12px;
    background: #f8f9fa;
    min-height: 80px;
}

/* ═══════════════════════════════════════
   SweetAlert2 커스텀
   ═══════════════════════════════════════ */
.custom-complete-popup,
.custom-loading-popup,
.custom-success-popup,
.custom-error-popup {
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12) !important;
}

.custom-complete-title {
    font-size: 20px !important; font-weight: 600 !important;
    color: #2c3e50 !important; margin-bottom: 10px !important;
}

.custom-complete-content {
    font-size: 14px !important; line-height: 1.5 !important;
}

.custom-complete-confirm,
.custom-success-confirm {
    background: #28a745 !important; color: white !important;
    border: none !important; border-radius: 6px !important;
    padding: 10px 20px !important; font-size: 14px !important; font-weight: 500 !important;
}
.custom-complete-confirm:hover,
.custom-success-confirm:hover {
    background: #218838 !important; transform: translateY(-1px) !important;
}

.custom-complete-cancel {
    background: #6c757d !important; color: white !important;
    border: none !important; border-radius: 6px !important;
    padding: 10px 20px !important; font-size: 14px !important; font-weight: 500 !important;
}
.custom-complete-cancel:hover {
    background: #545b62 !important; transform: translateY(-1px) !important;
}

.custom-error-confirm {
    background: #dc3545 !important; color: white !important;
    border: none !important; border-radius: 6px !important;
    padding: 10px 20px !important; font-size: 14px !important; font-weight: 500 !important;
}
.custom-error-confirm:hover {
    background: #c82333 !important; transform: translateY(-1px) !important;
}
