/* ===== 매장출고 모바일 피킹리스트 ===== */
/* OzCenter PickingMobile.jsx 완전 동일 UI */

:root {
    --primary-50: #f5f3ff;
    --primary-100: #ede9fe;
    --primary-200: #ddd6fe;
    --primary-300: #c4b5fd;
    --primary-400: #a78bfa;
    --primary-500: #8b5cf6;
    --primary-600: #7c3aed;
    --primary-700: #6d28d9;
    --primary-800: #5b21b6;
    --primary-900: #4c1d95;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --slate-50: #F8FAFC;
    --slate-100: #F1F5F9;
    --slate-200: #E2E8F0;
    --slate-300: #CBD5E1;
    --slate-400: #94A3B8;
    --slate-500: #64748B;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1E293B;
    --slate-900: #0F172A;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--slate-50);
    color: var(--slate-900);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    min-height: 100vh;
    min-height: 100dvh;
}

.app {
    max-width: 100%;
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* ===== 헤더 ===== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: white;
    padding: 12px 16px 8px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 0 4px;
    flex-wrap: nowrap;
    gap: 8px;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;          /* 버튼은 줄바꿈되므로 제목·이름 배지는 줄이지 않음 */
    min-width: 0;
    overflow: hidden;
}

.header-title h1 {
    font-size: 20px;
    font-weight: 900;
    color: var(--slate-900);
    white-space: nowrap;
}

.pack-badge {
    padding: 2px 6px;
    border-radius: 20px;
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.5px;
    background: var(--primary-600);
    color: white;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
    white-space: nowrap;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-tap-highlight-color: transparent;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;          /* 버튼이 많아 좁은 화면을 넘치면 두 줄로 (가로 스크롤·잘림 방지) */
    gap: 5px;
    min-width: 0;
}

/* 품목/대기 칩: 세로 스택으로 가로폭 절약 (좁은 화면 잘림 방지) */
.header-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
    line-height: 1.3;
}

.stat-chip {
    font-size: 10px;
    font-weight: 700;
    color: var(--slate-500);
    white-space: nowrap;
}

.stat-chip em {
    color: var(--primary-600);
    font-style: normal;
    font-weight: 900;
}

/* 아이콘 버튼 (로그/취소) */
.header-icon-btn {
    min-width: 44px;
    height: 40px;
    padding: 0 8px;
    border: none;
    border-radius: 10px;
    background: #3b82f6;
    color: white;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-shrink: 0;
    white-space: nowrap;
    transition: transform 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.header-icon-btn:active { transform: scale(0.9); }
.header-icon-btn.danger {
    background: #ff4757;
    font-size: 15px;
}

/* ===== 도메인 선택 ===== */
.domain-select-wrap {
    margin-bottom: 8px;
}

.domain-select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--slate-200);
    border-radius: 16px;
    background: white;
    color: var(--slate-700);
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 900;
    cursor: pointer;
    appearance: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.domain-select:focus {
    outline: none;
    border-color: var(--primary-500);
}

/* ===== 층 전환 ===== */
.floor-switch {
    display: flex;
    background: rgba(226, 232, 240, 0.5);
    padding: 4px;
    border-radius: 16px;
    margin-bottom: 8px;
}

.floor-btn {
    flex: 1;
    padding: 6px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--slate-400);
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.25s ease;
}

.floor-btn.active {
    background: white;
    color: var(--primary-600);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ===== 보기 전환 (대기/완료) ===== */
.view-switch {
    display: flex;
    background: rgba(226, 232, 240, 0.5);
    padding: 4px;
    border-radius: 16px;
    margin-top: 6px;
}

.view-btn {
    flex: 1;
    padding: 6px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--slate-400);
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.view-btn.active {
    background: white;
    color: var(--primary-600);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.done-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 16px;
    padding: 0 5px;
    border-radius: 8px;
    background: var(--success);
    color: white;
    font-size: 9px;
    font-weight: 900;
}

/* ===== 매장 필터 ===== */
/* ===== 헤더 접기/펼치기 ===== */
.header-toggle-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 0;
}
.mobile-date-input {
    flex: 1;
    padding: 6px 8px;
    border: 1.5px solid var(--slate-200);
    border-radius: 12px;
    background: white;
    color: var(--primary-600);
    font-size: 13px;
    font-weight: 700;
    outline: none;
    font-family: 'Inter', sans-serif;
    min-width: 104px; /* 날짜(2026-07-15) 잘림 방지 하한 */
}
.header-toggle-btn {
    padding: 4px 10px;
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    background: white;
    color: var(--slate-500);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap; /* "▲ 접기" 2줄 줄바꿈 방지 */
    flex-shrink: 0;
    transition: all 0.15s;
}
.capacity-setting {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    color: var(--slate-500);
    white-space: nowrap;
}
.capacity-setting select {
    padding: 3px;
    border: 1px solid var(--slate-200);
    border-radius: 6px;
    background: white;
    color: var(--slate-700);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    outline: none;
}
.header-toggle-btn:active { transform: scale(0.9); }
.header-collapse {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 400px;
    opacity: 1;
}
.header-collapse.collapsed {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
}

/* 초소형 화면(≤349px) 안전장치: 헤더 1행/필터행이 절대 잘리지 않게 축소 */
@media (max-width: 349px) {
    .header-stats { display: none; }
    .header-title h1 { font-size: 18px; }
    .header-icon-btn { min-width: 40px; padding: 0 6px; font-size: 16px; }
    .mobile-date-input { min-width: 100px; font-size: 12px; }
    .ordertype-filter-btn { min-width: 34px; padding: 0 6px; font-size: 11px; }
    .header-toggle-btn { padding: 4px 8px; font-size: 10px; }
}

/* ===== 유저 메뉴 (이름 배지 탭 → 로그아웃/앱 다운로드) ===== */
.user-menu-popup {
    background: white;
    border-radius: 20px;
    width: 88%;
    max-width: 320px;
    padding: 22px 20px 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    text-align: center;
    animation: popupIn 0.2s ease;
}
@keyframes popupIn {
    from { opacity: 0; transform: translateY(14px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.user-menu-avatar {
    width: 56px;
    height: 56px;
    margin: 0 auto 8px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary-600), #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}
.user-menu-name {
    font-size: 17px;
    font-weight: 800;
    color: var(--slate-900);
    word-break: break-all;
}
.user-menu-role {
    font-size: 11px;
    font-weight: 700;
    color: var(--slate-400);
    margin-bottom: 16px;
}
.user-menu-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    padding: 13px;
    margin-bottom: 8px;
    border: 1px solid var(--slate-200);
    border-radius: 12px;
    background: var(--slate-50);
    color: var(--slate-700);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.user-menu-item:active { transform: scale(0.97); }
.user-menu-item .user-menu-sub {
    font-size: 11px;
    font-weight: 600;
    color: var(--slate-400);
}
.user-menu-item.danger {
    border-color: rgba(255, 71, 87, 0.35);
    background: rgba(255, 71, 87, 0.06);
    color: #ff4757;
}
.user-menu-close {
    margin-top: 4px;
    padding: 8px 18px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--slate-400);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

/* ===== 완료 카드 숫자 영역 전체 클릭 ===== */
.done-card .pick-qty {
    cursor: pointer;
    position: relative;
}
.done-card .pick-qty:active {
    transform: scale(0.95);
}
.done-card .cancel-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 6px 14px;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.15s ease;
}
.done-card .cancel-btn:active {
    transform: scale(0.9);
}

/* 상품별 일괄패킹: 선택 토글 (취소 버튼 왼쪽) */
.done-card .pack-select-toggle {
    position: absolute;
    bottom: 12px;
    right: 92px;
    background: rgba(255,255,255,0.92);
    color: #334155;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    padding: 6px 12px;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    white-space: nowrap;
    transition: transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.done-card .pack-select-toggle:active {
    transform: scale(0.9);
}
.done-card.pack-selected .pack-select-toggle {
    background: #10b981;
    color: #fff;
    border-color: #10b981;
}
.done-card.pack-selected {
    outline: 3px solid #10b981;
    outline-offset: -3px;
    border-radius: 16px;
}

.store-filter-wrap {
    margin-bottom: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.store-filter-wrap::-webkit-scrollbar { display: none; }

.store-filter {
    display: flex;
    gap: 6px;
    padding: 2px 0;
    min-width: min-content;
}

.store-chip {
    padding: 6px 14px;
    border: 1px solid var(--slate-100);
    border-radius: 12px;
    background: white;
    color: var(--slate-400);
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}
.store-chip:active { transform: scale(0.95); }
.store-chip.active {
    background: var(--primary-600);
    border-color: var(--primary-600);
    color: white;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

/* ===== 그룹 필터 + 층 필터 한 줄 ===== */
.filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    flex-wrap: nowrap;
    min-width: 0;
}
.filter-row.hidden { display: none; }
.filter-row .round-tabs { flex: 1; min-width: 0; padding: 0; }

.floor-filter { display: inline-flex; gap: 5px; flex-shrink: 0; }
.floor-filter.hidden { display: none; }
.floor-filter-btn {
    min-width: 44px;
    height: 36px;
    padding: 0 10px;
    border: 2px solid transparent;
    border-radius: 12px;
    background: white;
    color: var(--slate-400);
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.floor-filter-btn:active { transform: scale(0.95); }
.floor-filter-btn.active {
    background: var(--primary-600);
    border-color: var(--primary-500);
    color: white;
    box-shadow: 0 3px 12px rgba(79, 70, 229, 0.35);
}
.floor-filter-btn[data-floor="all"] {
    background: linear-gradient(135deg, rgba(79,70,229,0.08), rgba(16,185,129,0.08));
    border-color: var(--success);
    color: var(--success);
}
.floor-filter-btn[data-floor="all"].active {
    background: linear-gradient(135deg, var(--primary-600), var(--success));
    border-color: var(--success);
    color: white;
}

/* 주문유형 필터 (일반/신규/전체) */
.ordertype-filter { display: inline-flex; gap: 5px; flex-shrink: 0; }
.ordertype-filter-btn {
    min-width: 38px;
    height: 32px;
    padding: 0 8px;
    border: 2px solid transparent;
    border-radius: 10px;
    background: white;
    color: var(--slate-400);
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.ordertype-filter-btn:active { transform: scale(0.95); }
.ordertype-filter-btn.active {
    background: var(--primary-600);
    border-color: var(--primary-500);
    color: white;
    box-shadow: 0 3px 12px rgba(79, 70, 229, 0.35);
}
.ordertype-filter-btn[data-ot="initial"].active {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border-color: #8b5cf6;
    color: white;
}

/* ===== 회전 탭 ===== */
.round-tabs {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 0;
}
.round-tabs::-webkit-scrollbar { display: none; }

.round-tab {
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 2px solid transparent;
    border-radius: 12px;
    background: white;
    color: var(--slate-400);
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.round-tab:active { transform: scale(0.95); }
.round-tab.active {
    background: var(--primary-600);
    border-color: var(--primary-500);
    color: white;
    box-shadow: 0 3px 12px rgba(79, 70, 229, 0.35);
}
.round-tab.all-tab {
    background: linear-gradient(135deg, rgba(79,70,229,0.08), rgba(16,185,129,0.08));
    border-color: var(--success);
    color: var(--success);
}
.round-tab.all-tab.active {
    background: linear-gradient(135deg, var(--primary-600), var(--success));
    border-color: var(--success);
    color: white;
}

/* ===== 요약 바 ===== */
.summary-bar {
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    flex-wrap: wrap;
    background: white;
    border-bottom: 1px solid var(--slate-100);
}

.summary-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    color: var(--slate-600);
}
.summary-chip em {
    font-style: normal;
    font-weight: 900;
    color: var(--primary-600);
}
.summary-chip.route {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.05);
    color: var(--success);
}
.summary-chip.route em { color: var(--success); }

/* ===== 피킹 리스트 ===== */
.picking-list {
    flex: 1;
    padding: 8px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 80px;
}

/* ===== 빈 상태 ===== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 20px;
    color: var(--slate-300);
}
.empty-icon { font-size: 40px; margin-bottom: 16px; }
.empty-state p { font-size: 14px; font-weight: 900; color: var(--slate-400); }

/* ================================================================
   피킹 카드 — OzCenter PickingMobile.jsx 완전 동일
   ================================================================ */
.pick-card {
    display: flex;
    border-radius: 24px;
    overflow: hidden;
    border: 6px solid var(--primary-400);
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    animation: card-in 0.3s ease forwards;
    opacity: 0;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.pick-card.removing {
    animation: card-out 0.5s cubic-bezier(0.1, 0.7, 0.1, 1) forwards;
}

@keyframes card-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes card-out {
    0% { 
        opacity: 1; 
        transform: scale(1); 
        max-height: 400px; 
        margin-bottom: 12px; 
        border-width: 6px; 
    }
    40% { 
        opacity: 0; 
        transform: scale(0.9) translateX(-40px); 
        max-height: 400px; 
        margin-bottom: 12px; 
        border-width: 6px; 
    }
    100% { 
        opacity: 0; 
        transform: scale(0.9) translateX(-40px); 
        max-height: 0; 
        margin-bottom: 0; 
        border-width: 0; 
        padding-top: 0;
        padding-bottom: 0;
    }
}

/* ──── 좌측: 수량 영역 (120px, bg-slate-900) ──── */
.pick-qty {
    width: 120px;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-shrink: 0;
    position: relative;
    background: var(--slate-900);
    cursor: pointer;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}
.pick-qty:active { transform: scale(0.95); }

/* 좌측 수량 영역 이미지 배경 */
.pick-qty .qty-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    /* 장식용 배경 이미지 → 롱프레스 시 브라우저 기본 이미지 메뉴 차단 */
    pointer-events: none;
}
.pick-qty .qty-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.pick-qty .qty-bg .qty-bg-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
}

/* 수량 숫자 — OzCenter text-[72px] font-black */
.pick-qty .qty-num {
    font-size: 72px;
    font-weight: 900;
    color: white;
    line-height: 1;
    z-index: 2;
}

.pick-qty .qty-label {
    display: none; /* OzCenter에서는 "수량" 라벨 없음 */
}

/* 배치번호 (수량 아래) — OzCenter slot_details 스타일 */
.pick-qty .batch-badge {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0 4px;
    z-index: 2;
}

.pick-qty .batch-num {
    background: rgba(255,255,255,0.2);
    color: white;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 36px;
    font-weight: 900;
}

/* ──── 우측: 상품 정보 (이미지 배경) ──── */
.pick-info {
    flex: 1;
    min-width: 0;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* 이미지 배경 + 오버레이 */
.pick-info .info-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    /* 장식용 배경 이미지 → 롱프레스 시 브라우저 기본 이미지 메뉴(공유/다운로드 등) 차단 */
    pointer-events: none;
}
.pick-info .info-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.pick-info .info-bg .bg-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.60);
}

.pick-info .info-content {
    position: relative;
    z-index: 1;
    width: 100%;
}

/* 로케이션 — OzCenter: flex-col, MapPin size=32, text-[32px] */
.pick-loc {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.pick-loc .loc-pin {
    line-height: 1;
    cursor: pointer;
    transition: transform 0.15s ease;
    flex-shrink: 0;
    color: var(--primary-400);
    display: flex;
}
.pick-loc .loc-pin:active { transform: scale(0.85); }

/* OzCenter: text-primary-400 font-black text-[32px] */
.pick-loc .loc-code {
    font-size: 32px;
    font-weight: 900;
    color: var(--primary-400);
    letter-spacing: -1px;
    line-height: 1;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}
.pick-loc .loc-code.expanded {
    white-space: normal;
    word-break: break-all;
    text-overflow: unset;
}

/* ===== 출고(COMPLETE) 카드 ===== */
.complete-card {
    background: white;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.complete-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.complete-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--slate-800);
    display: flex;
    align-items: center;
    gap: 8px;
}
.complete-box-no {
    display: inline-block;
    background: var(--primary-500);
    color: white;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
}
.complete-info {
    font-size: 13px;
    color: var(--slate-500);
}
.complete-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}
.btn-print {
    flex: 1;
    padding: 10px 0;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s ease;
}
.btn-print.barcode {
    background: var(--slate-100);
    color: var(--slate-700);
}
.btn-print.list {
    background: var(--primary-50);
    color: var(--primary-600);
}
.btn-print:active { transform: scale(0.96); }

/* ===== 점포별 그룹 (출고탭) ===== */
.store-group {
    background: #f1f5f9;
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 16px;
    animation: fadeInUp 0.3s ease both;
}
.store-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 4px 12px;
}
.store-group-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.store-group-name {
    font-size: 18px;
    font-weight: 800;
    color: var(--slate-800);
}
.store-group-stats {
    font-size: 13px;
    color: var(--slate-500);
    font-weight: 500;
}
.store-group-boxes {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.store-group-boxes .complete-card {
    margin-bottom: 0;
}
.complete-card.box-shipped {
    opacity: 0.6;
    background: #f0fdf4;
}
.btn-ship {
    padding: 10px 18px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    transition: all 0.15s ease;
}
.btn-ship:active {
    transform: scale(0.95);
    box-shadow: 0 1px 4px rgba(16, 185, 129, 0.2);
}
.store-group-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}
.btn-list-print {
    padding: 10px 12px;
    background: var(--primary-50);
    color: var(--primary-600);
    border: none;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}
.btn-list-print:active { transform: scale(0.95); }

/* 배송완료 매장 그룹 */
.store-group.shipped {
    opacity: 0.7;
    background: #e8f5e9;
}
.btn-ship-done {
    padding: 10px 14px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

/* 전체 배송처리 버튼 */
.all-ship-bar {
    margin-bottom: 16px;
}
.btn-ship-all {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transition: all 0.15s ease;
}
.btn-ship-all:active {
    transform: scale(0.98);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.2);
}

/* 그룹별 배송처리·일괄출력 카드 */
.ship-group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr));
    gap: 10px;
}
.ship-group-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}
.ship-group-head { display: flex; align-items: baseline; gap: 8px; }
.ship-group-name { font-size: 17px; font-weight: 900; color: #1e3a8a; }
.ship-group-count { font-size: 12px; font-weight: 700; color: #64748b; }
.ship-group-stores {
    margin: 4px 0 10px;
    font-size: 12px;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ship-group-actions { display: flex; gap: 6px; }
.sg-btn {
    flex: 1;
    padding: 11px 6px;
    border: none;
    border-radius: 10px;
    color: #fff;
    min-width: 0;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.25;
    cursor: pointer;
    word-break: keep-all;   /* 좁으면 단어 단위로 두 줄 */
    transition: transform 0.1s ease;
}
.sg-btn:active { transform: scale(0.97); }
.sg-ship { flex: 1.15; background: linear-gradient(135deg, #1e40af, #3b82f6); box-shadow: 0 3px 8px rgba(59, 130, 246, 0.3); }
.sg-label { background: #0ea5e9; }
.sg-list { background: #10b981; }
.sg-list small { font-size: 11px; font-weight: 700; opacity: 0.9; }
.sg-list-pm { background: #f59e0b; }   /* 오후 업로드분은 색을 달리해 오전 리스트와 구분 */
/* 배송처리가 끝난 그룹: 보이되 비활성 */
.ship-group-card.done { background: #f8fafc; border-style: dashed; }
.ship-group-card.done .ship-group-name { color: #64748b; }
.ship-group-done {
    margin-left: auto;
    padding: 2px 10px;
    border-radius: 999px;
    background: #dcfce7;
    color: #15803d;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}
.sg-shipped { color: #94a3b8; }
.sg-btn:disabled {
    background: #e2e8f0 !important;
    color: #94a3b8;
    box-shadow: none !important;
    cursor: not-allowed;
}
.sg-btn:disabled:active { transform: none; }

/* 그룹 일괄배송 확인 카드 */
.ship-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.ship-confirm-card {
    width: 100%;
    max-width: 560px;
    background: #fff;
    border-radius: 22px;
    border-top: 8px solid #1d4ed8;
    padding: 26px 26px 22px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.scc-icon { font-size: 46px; line-height: 1; margin-bottom: 8px; }
.scc-msg { font-size: 22px; font-weight: 800; color: #0f172a; line-height: 1.5; word-break: keep-all; }
.scc-group {
    display: inline-block;
    padding: 2px 14px;
    border-radius: 12px;
    background: #1d4ed8;
    color: #fff;
    font-size: 28px;
    font-weight: 900;
    vertical-align: middle;
}
.scc-user { margin-top: 6px; font-size: 22px; color: #0f172a; }
.scc-user b { color: #1d4ed8; font-weight: 900; }
.scc-warn {
    margin: 18px 0 16px;
    padding: 14px 12px;
    border-radius: 14px;
    background: #fef2f2;
    border: 2px solid #fecaca;
    color: #b91c1c;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.45;
    word-break: keep-all;
}
.scc-warn b { font-size: 24px; text-decoration: underline; }
.scc-stores { margin-bottom: 18px; }
.scc-stores-title { font-size: 13px; font-weight: 800; color: #64748b; margin-bottom: 8px; }
.scc-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.scc-chips span {
    padding: 5px 12px;
    border-radius: 999px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
    font-size: 15px;
    font-weight: 800;
}
.scc-actions { display: flex; gap: 10px; }
.scc-btn {
    border: none;
    border-radius: 14px;
    padding: 16px 10px;
    font-size: 18px;
    font-weight: 900;
    cursor: pointer;
}
.scc-cancel { flex: 0.7; background: #e2e8f0; color: #334155; }
.scc-ok { flex: 1.3; background: linear-gradient(135deg, #1e40af, #3b82f6); color: #fff; box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35); }
.scc-btn:active { transform: scale(0.98); }

/* ===== 배송처리 진행 트래커 ===== */
.shipment-tracker {
    position: fixed;
    bottom: 64px;            /* 하단 스캔바(#scan-bar, ~50px) 위로 — 가림 방지 */
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 400px;
    z-index: 10000;          /* 스캔바(9998)보다 위 */
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.shipment-tracker.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    pointer-events: none;
}
.shipment-tracker-content {
    background: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.05);
}
.shipment-tracker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
    font-weight: 700;
    color: var(--slate-800);
    margin-bottom: 10px;
}
.shipment-progress-pct {
    font-size: 14px;
    font-weight: 800;
    color: var(--primary-600);
}
.shipment-progress-bar {
    height: 8px;
    background: var(--slate-100);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}
.shipment-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-500), var(--primary-400));
    border-radius: 4px;
    transition: width 0.5s ease;
}
/* 패킹탭 토글 */
.packing-store-group {
    margin-bottom: 8px;
}
.packing-toggle-header {
    cursor: pointer;
}
.toggle-arrow {
    font-size: 12px;
    color: var(--slate-400);
    transition: transform 0.2s;
    width: 16px;
    display: inline-block;
}
.packing-card-list {
    transition: max-height 0.3s ease;
}
.packing-card-list.hidden {
    display: none;
}

/* 시즌 뱃지 */
.season-badge {
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: #f59e0b;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

/* 합쳐진 카드 매장 태그 */
.merge-stores {
    font-size: 11px;
    color: #fff;
    background: #6366f1;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    margin-left: 4px;
    white-space: nowrap;
}

/* 위치/매장/재고 뱃지 묶음 */
.loc-badges {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

/* 현재재고 뱃지 */
.stock-badge {
    font-size: 11px;
    color: #fff;
    background: #10b981;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    white-space: nowrap;
}

.shipment-tracker-msg {
    font-size: 12px;
    color: var(--slate-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== 보류(HOLD) 카드 ===== */
.hold-section {
    margin-bottom: 16px;
}
.hold-store-header {
    font-size: 16px;
    font-weight: 800;
    color: var(--warning);
    padding: 8px 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.hold-badge {
    font-size: 12px;
    font-weight: 700;
    color: var(--slate-500);
}
.hold-round {
    margin-left: auto;
    font-size: 11px;
    font-weight: 800;
    background: var(--warning);
    color: white;
    padding: 2px 8px;
    border-radius: 6px;
}
.hold-card {
    border-width: 6px !important;
    border-color: var(--warning) !important;
    opacity: 0.8;
}
.hold-qty {
    background: var(--warning) !important;
}

/* 상품명 — OzCenter: font-black, 흰색 배경에서는 어두운 색상 */
.pick-product {
    font-size: 40px;
    font-weight: 900;
    color: var(--slate-800);
    line-height: 1.1;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: -1px;
}

/* 옵션 — OzCenter: font-black text-slate-500 */
.pick-option {
    font-size: 34px;
    font-weight: 900;
    color: var(--slate-500);
    line-height: 1.2;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    letter-spacing: -1px;
}

/* zoom-btn은 이미지가 있는 카드에서만 표시됨 */

/* 이미지 확대 버튼 — 흰색 배경 기준 */
.zoom-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    z-index: 20;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.15s ease;
}
.zoom-btn:active { transform: scale(0.85); }

/* ===== 배치 범례 ===== */
.batch-legend {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 6px 0;
}
.batch-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 800;
    background: var(--slate-50);
    border: 2px solid var(--slate-200);
    color: var(--slate-600);
}
.batch-tag.c-blue { border-color: var(--primary-600); color: var(--primary-600); }
.batch-tag.c-green { border-color: var(--success); color: var(--success); }
.batch-tag.c-amber { border-color: var(--warning); color: var(--warning); }
.batch-tag.c-rose { border-color: var(--danger); color: var(--danger); }

/* ===== 카드 보더 색상 — OzCenter qtyColor 기반 ===== */
.pick-card.c-blue { border-color: var(--primary-400); }
.pick-card.c-green { border-color: var(--success); }
.pick-card.c-amber { border-color: var(--warning); }
.pick-card.c-rose { border-color: var(--danger); }

/* ===== 열 구분선 ===== */
.col-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
}
.col-divider .divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--slate-200), transparent);
}
.col-divider .divider-tag {
    font-size: 12px;
    font-weight: 800;
    color: var(--success);
    background: rgba(16, 185, 129, 0.08);
    padding: 4px 14px;
    border-radius: 10px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    white-space: nowrap;
}

/* ===== 회전 구분 ===== */
.round-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0 4px;
}
.round-divider .divider-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-600), var(--success));
    border-radius: 1px;
}
.round-divider .round-tag {
    font-size: 12px;
    font-weight: 900;
    color: white;
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    padding: 5px 16px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
    white-space: nowrap;
}

/* ===== 스캔 피드백 토스트 ===== */
.scan-toast {
    position: fixed;
    bottom: 64px;            /* 하단 스캔바(#scan-bar, ~50px) 위로 — 가림 방지 */
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;          /* 스캔바(9998)·트래커(10000)보다 위 */
    padding: 12px 24px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 900;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
    white-space: nowrap;
}
.scan-toast.success { background: var(--success); color: white; }
.scan-toast.error { background: var(--danger); color: white; }
.scan-toast.hidden { display: none; }

/* ===== 상세 정보 팝업 — OzCenter zoomedLocation 동일 ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0,0,0,0.90);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: modal-fade 0.2s ease;
}
.modal-overlay.hidden { display: none; }
@keyframes modal-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* OzCenter: bg-white rounded-3xl p-8 w-[90%] max-w-sm */
.detail-popup {
    background: white;
    border-radius: 24px;
    padding: 32px;
    width: 90%;
    max-width: 380px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
    animation: popup-scale 0.25s ease;
}
@keyframes popup-scale {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* OzCenter: w-full h-2 bg-gradient-to-r from-primary-400 to-primary-600 */
.detail-popup-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background: linear-gradient(90deg, var(--primary-400), var(--primary-600));
}

/* OzCenter: flex items-center gap-3 mb-6 text-primary-600 */
.detail-popup-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    color: var(--primary-600);
}
.detail-popup-icon { display: flex; color: var(--primary-600); }
/* OzCenter: text-xl font-black */
.detail-popup-title { font-size: 20px; font-weight: 900; }

.detail-popup-body {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* OzCenter: text-xs font-black text-slate-400 uppercase tracking-widest mb-1 */
.detail-label {
    font-size: 10px;
    font-weight: 900;
    color: var(--slate-400);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 4px;
}

/* OzCenter: text-[44px] font-black text-slate-900 */
.detail-value-lg {
    font-size: 44px;
    font-weight: 900;
    color: var(--slate-900);
    line-height: 1;
    letter-spacing: -1px;
    word-break: break-all;
}

/* OzCenter: text-2xl font-black text-primary-600 */
.detail-value-md {
    font-size: 24px;
    font-weight: 900;
    line-height: 1.1;
    word-break: break-all;
}
.detail-value-md.primary { color: var(--primary-600); }

/* OzCenter: text-4xl font-black text-emerald-600 */
.detail-value-xl {
    font-size: 36px;
    font-weight: 900;
    line-height: 1;
}
.detail-value-xl.success { color: var(--success); }

/* OzCenter: flex gap-4 */
.detail-row {
    display: flex;
    gap: 16px;
}
.flex-1 { flex: 1; }
.text-right { text-align: right; min-width: 100px; }

/* OzCenter: pt-4 border-t border-slate-100 */
.detail-divider {
    height: 1px;
    background: var(--slate-100);
}

/* OzCenter: text-sm font-bold text-slate-800 */
.detail-product {
    font-size: 14px;
    font-weight: 700;
    color: var(--slate-800);
    line-height: 1.3;
    margin-bottom: 4px;
}
/* OzCenter: text-xs font-medium text-slate-500 */
.detail-option {
    font-size: 12px;
    font-weight: 500;
    color: var(--slate-500);
}

/* OzCenter: mt-8 text-center text-slate-300 font-bold text-[10px] */
.detail-popup-footer {
    margin-top: 32px;
    text-align: center;
    color: var(--slate-300);
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 3px;
}

/* ===== 이미지 확대 모달 — OzCenter zoomedImage 동일 ===== */
#image-modal {
    flex-direction: column;
    gap: 16px;
}
.zoomed-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: popup-scale 0.25s ease;
}
.image-modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    padding: 12px 18px;
    color: white;
    font-weight: 900;
    font-size: 14px;
    cursor: pointer;
}

/* ===== 바코드 입력 숨김 ===== */
.barcode-hidden-input {
    position: fixed;
    top: -9999px;
    left: -9999px;
    opacity: 0;
    width: 1px;
    height: 1px;
}

/* ===== 피킹 완료 카드 ===== */
.pick-card.done-card {
    border-color: var(--success) !important;
    opacity: 0.9;
}
.pick-card.done-card .pick-qty {
    background: var(--success);
}

.cancel-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 6px;
    padding: 4px 10px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    background: rgba(255,255,255,0.15);
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
    z-index: 2;
    transition: transform 0.15s ease;
}
.cancel-btn:active { transform: scale(0.9); }

/* ===== 완료 리스트 매장별 헤더 ===== */
.done-store-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    margin: 12px 0 4px;
    background: linear-gradient(135deg, var(--primary-50), var(--indigo-50));
    border-radius: 14px;
    border: 1px solid var(--primary-100);
}
.done-store-name {
    font-weight: 700;
    font-size: 13px;
    color: var(--slate-700);
    flex: 1;
}
.done-store-box {
    font-weight: 600;
    font-size: 12px;
    color: var(--primary-600);
    background: var(--primary-100);
    padding: 3px 10px;
    border-radius: 8px;
}
.box-close-btn {
    padding: 5px 12px;
    border: 1px solid var(--primary-300);
    border-radius: 10px;
    background: white;
    color: var(--primary-600);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}
.box-close-btn:hover { background: var(--primary-500); color: white; }
.box-close-btn:active { transform: scale(0.9); }

/* ===== 업로드 버튼 (헤더) ===== */
.upload-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 10px;
    background: var(--primary-500);
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease;
}
.upload-btn:active { transform: scale(0.9); }

/* ===== empty-state 업로드 버튼 ===== */
.empty-upload-btn {
    margin-top: 12px;
    padding: 12px 28px;
    border: none;
    border-radius: 14px;
    background: var(--primary-500);
    color: white;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

/* ===== 업로드 모달 ===== */
.upload-popup {
    background: white;
    border-radius: 24px;
    padding: 28px 24px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.upload-popup h3 {
    font-size: 20px;
    font-weight: 800;
    margin: 0 0 8px;
}
.upload-desc {
    font-size: 13px;
    color: var(--slate-500);
    margin-bottom: 20px;
}
.upload-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.upload-domain-select {
    padding: 10px 14px;
    border: 2px solid var(--slate-200);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    background: var(--slate-50);
}
.upload-file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    border: 2px dashed var(--primary-300);
    border-radius: 14px;
    color: var(--primary-600);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.upload-file-label:hover {
    background: var(--primary-50);
}
.upload-submit-btn {
    padding: 14px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s;
}
.upload-submit-btn:active { transform: scale(0.95); }
.upload-status {
    font-size: 13px;
    font-weight: 600;
    min-height: 20px;
}
.upload-status.error { color: #ef4444; }
.upload-status.success { color: #22c55e; }
.upload-status.loading { color: var(--primary-500); }
.upload-close-btn {
    margin-top: 12px;
    padding: 10px 24px;
    border: 1px solid var(--slate-200);
    border-radius: 12px;
    background: transparent;
    color: var(--slate-500);
    font-size: 14px;
    cursor: pointer;
}

/* ===== 인쇄 스타일 ===== */
@media print {
    .header { position: static; }
    .round-tabs, .floor-switch, .store-filter-wrap, .view-switch { display: none; }
    .picking-list { padding-bottom: 0; }
    .pick-card { page-break-inside: avoid; box-shadow: none; border: 1px solid #ddd; }
}

/* ===== 상품 이미지 썸네일 (품목정보 영역) ===== */
.pick-image-wrap {
    flex-shrink: 0;
    width: 90px;
    height: 90px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--slate-200);
    background: var(--slate-50);
    cursor: pointer;
}
.pick-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}
.pick-thumb:active {
    transform: scale(0.9);
}

/* pick-info 내부 플렉스 레이아웃 (텍스트 + 이미지) */
.pick-info {
    flex: 1;
    min-width: 0;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

/* ===== 그룹 배치 요약 카드 (모바일) ===== */
#group-summary {
    padding: 4px 0;
    max-height: 200px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
#group-summary .group-card {
    background: white;
    border: 2px solid var(--slate-200);
    border-radius: 14px;
    padding: 10px 14px;
    margin-bottom: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
#group-summary .group-card .group-header {
    font-weight: 900;
    font-size: 13px;
    color: var(--primary-600);
    margin-bottom: 4px;
}
#group-summary .group-card .group-stores {
    font-size: 11px;
    font-weight: 600;
    color: var(--slate-500);
    line-height: 1.4;
}

/* ===== 꽉 차는 배경 모드에서의 글자색 오버라이드 ===== */
.has-image .pick-product { 
    color: white !important; 
}
.has-image .pick-option { 
    color: var(--slate-300) !important; 
}
.has-image .info-bg {
    cursor: pointer;
}

/* ===== 스캔 취소 버튼 (피킹탭) ===== */
.cancel-btn {
    position: relative;
    z-index: 50;
    margin-top: 10px;
    padding: 8px 16px;
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--danger, #ef4444);
    border: 2px solid var(--danger, #ef4444);
    border-radius: 8px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.1s ease;
}
.cancel-btn:active {
    transform: scale(0.92);
    background-color: var(--danger, #ef4444);
    color: white;
}

/* ===== 그룹 진행현황 (점포별 총 피킹량 · 예상박스 · 층별 패킹 잔량) ===== */
/* 모바일: 📊 현황 버튼으로 여는 떠 있는 팝업(이동·크기 조절 가능).
   PC(가로 1024px 이상, 대기·피킹·패킹 탭): 헤더 아래 오른쪽 절반에 고정(이동 불가), 모든 점포가 스크롤 없이 보이게 행 높이를 맞춤. */
.gp-panel {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(62px + env(safe-area-inset-bottom, 0px));   /* 하단 스캔바(약 50px) 위 */
    max-width: 480px;
    margin: 0 auto;
    z-index: 8000;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16), 0 2px 6px rgba(15, 23, 42, 0.06);
    overflow: hidden;
    flex-direction: column;
    font-variant-numeric: tabular-nums;
}
.gp-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px 10px 16px;
    background: linear-gradient(135deg, #1e293b 0%, #312e81 100%);
    color: #fff;
    cursor: grab;
    touch-action: none;   /* 머리줄을 끌 때 페이지가 같이 스크롤되지 않게 */
    user-select: none;
    -webkit-user-select: none;
    flex-shrink: 0;
}
.gp-panel.dragging .gp-head { cursor: grabbing; }
.gp-panel.dragging { box-shadow: 0 18px 44px rgba(15, 23, 42, 0.3), 0 0 0 2px rgba(99, 102, 241, 0.5); }
.gp-head-main { display: flex; flex-direction: column; min-width: 0; }
.gp-title { font-size: 15px; font-weight: 800; letter-spacing: -0.2px; white-space: nowrap; }
.gp-sub { font-size: 11.5px; font-weight: 600; color: #c7d2fe; white-space: nowrap; margin-top: 1px; }
.gp-called {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 800;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.gp-called .gp-called-chip {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 999px;
    background: #fbbf24;
    color: #1e293b;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.35);
}
.gp-head-btn {
    border: none;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    width: 30px;
    height: 28px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    flex-shrink: 0;
}
/* 머리줄 아래 그룹 전체 진행 막대 */
.gp-hbar { height: 4px; background: #e0e7ff; flex-shrink: 0; }
.gp-hbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #6366f1, #8b5cf6); transition: width 0.4s ease; }
.gp-hbar.full i { background: #10b981; }

.gp-panel.minimized .gp-body,
.gp-panel.minimized .gp-hbar { display: none; }
.gp-panel.sized .gp-body { flex: 1; max-height: none; }
body:not(.gp-docked) .gp-panel.minimized { height: auto !important; }
.gp-body {
    max-height: 42vh;
    overflow-y: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
}
.gp-grid {
    display: grid;
    /* 점포명 | 총피킹 | 예상박스 | 1층잔량 | 2층잔량 | 잔량합계 */
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.8fr) minmax(0, 1.45fr) repeat(3, minmax(0, 0.8fr));
    column-gap: 6px;
    align-items: center;
}
.gp-colhead {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 8px 14px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 0.2px;
    flex-shrink: 0;
}
.gp-colhead span:not(:first-child),
.gp-row > span:not(:first-child),
.gp-total > span:not(:first-child) { text-align: right; }
.gp-colhead .gp-boxes-h { text-align: center !important; }

.gp-row {
    position: relative;
    padding: 9px 14px;
    border-bottom: 1px solid #eef2f7;
    background: #fff;
    font-size: 15px;
    font-weight: 600;
    color: #334155;
}
.gp-row.shade { background: #f4f6fb; }   /* 한 줄씩 번갈아 음영 */
.gp-store { display: flex; align-items: center; gap: 8px; min-width: 0; }
.gp-no {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e0e7ff;
    color: #4338ca;
    font-size: 12px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.gp-name { font-weight: 800; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gp-done-pill {
    display: none;
    flex-shrink: 0;
    padding: 1px 7px;
    border-radius: 999px;
    background: #dcfce7;
    color: #15803d;
    font-size: 10.5px;
    font-weight: 800;
}
.gp-row.done .gp-done-pill { display: inline-block; }
.gp-row.done .gp-no { background: #dcfce7; color: #15803d; }
.gp-row.done > span:not(:first-child) { opacity: 0.45; }
.gp-row .gp-remain { font-weight: 800; color: #0f172a; }
.gp-row .gp-zero { color: #cbd5e1; font-weight: 500; }
/* 행 아래 점포별 패킹 진행 막대 */
.gp-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; pointer-events: none; }
.gp-bar i { display: block; height: 100%; width: 0; background: rgba(99, 102, 241, 0.55); transition: width 0.4s ease; }
.gp-row.done .gp-bar i { background: rgba(16, 185, 129, 0.6); }

/* 예상박스: 큰 박스부터 '6호 2개' */
.gp-boxes {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    text-align: center !important;
}
.gp-box {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e2e8f0;
    font-size: 11.5px;
    font-weight: 700;
    color: #475569;
    white-space: nowrap;
}

.gp-total {
    padding: 10px 14px;
    background: #0f172a;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    flex-shrink: 0;
}
.gp-total > span:first-child { color: #cbd5e1; font-weight: 700; }
.gp-empty { padding: 22px; text-align: center; color: #94a3b8; font-size: 13px; line-height: 1.6; }

/* 오른쪽 아래 모서리: 끌어서 크기 조절 (모바일 팝업만) */
.gp-resize {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 22px;
    height: 22px;
    cursor: nwse-resize;
    touch-action: none;
    z-index: 3;
    background: linear-gradient(135deg, transparent 0 50%, #94a3b8 50% 56%, transparent 56% 66%, #94a3b8 66% 72%, transparent 72% 82%, #94a3b8 82% 88%, transparent 88%);
}
.gp-panel.minimized .gp-resize { display: none; }

/* 스캔으로 점포명을 불러준 점포: 다음 스캔 전까지 음영 */
.gp-row.called {
    background: #fde68a !important;
    box-shadow: inset 6px 0 0 #f59e0b;
    z-index: 2;
}
.gp-row.called .gp-name { color: #78350f; }
.gp-row.called .gp-no { background: #f59e0b; color: #fff; }
.gp-row.called > span:not(:first-child) { opacity: 1; }
.gp-row.called .gp-box { background: #fffbeb; border-color: #fcd34d; }

/* ===== PC(넓은 화면) 피킹·패킹 중: 헤더는 전체 폭, 목록은 왼쪽, 현황은 오른쪽에 고정 ===== */
/* --gp-content-w: 현황 창 왼쪽 끝까지의 폭 (JS가 창 위치에 맞춰 갱신) */
body.gp-docked #summary-bar,
body.gp-docked #picking-list { max-width: var(--gp-content-w, 50%); }
body.gp-docked #scan-bar { right: auto !important; width: var(--gp-content-w, 50%); }
body.gp-docked #btn-group-progress { display: none; }
body.gp-docked .gp-panel { z-index: 150; }   /* 헤더(100) 위, 상세보기 등 모달(200) 아래 */
body.gp-docked .gp-head { cursor: default; padding: 14px 14px 14px 20px; }
body.gp-docked .gp-title { font-size: 19px; }
body.gp-docked .gp-sub { font-size: 13px; }
body.gp-docked .gp-called { font-size: 16px; }
body.gp-docked #gp-min,
body.gp-docked #gp-close,
body.gp-docked .gp-resize { display: none; }
body.gp-docked .gp-panel.minimized .gp-body,
body.gp-docked .gp-panel.minimized .gp-hbar { display: flex; }
/* 모든 점포가 스크롤 없이 보이게: 행이 남은 높이를 나눠 가짐 */
body.gp-docked .gp-body { flex: 1; max-height: none; display: flex; flex-direction: column; }
body.gp-docked .gp-colhead { font-size: 13px; padding: 10px 20px; }
body.gp-docked .gp-row { flex: 1 1 0; min-height: 44px; max-height: 96px; font-size: 19px; padding: 8px 20px; }
body.gp-docked .gp-no { width: 30px; height: 30px; font-size: 14px; }
body.gp-docked .gp-done-pill { font-size: 12px; padding: 2px 9px; }
body.gp-docked .gp-total { font-size: 19px; padding: 14px 20px; }
body.gp-docked .gp-box { font-size: 14px; padding: 3px 10px; }
body.gp-docked .gp-bar { height: 4px; }

/* ===== 송장 스캔 창 ===== */
.trk-box {
    width: 90%;
    max-width: 400px;
    background: #fff;
    border-radius: 18px;
    padding: 22px 20px 18px;
    text-align: center;
    color: #0f172a;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}
.trk-icon { font-size: 40px; line-height: 1; margin-bottom: 6px; }
.trk-title { font-size: 20px; font-weight: 900; margin-bottom: 4px; }
.trk-sub { font-size: 13px; color: #64748b; margin-bottom: 14px; }
.trk-sub b { color: #0f766e; }
#trk-input {
    width: 100%;
    box-sizing: border-box;
    padding: 14px;
    border: 2px solid #0f766e;
    border-radius: 12px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 2px;
    text-align: center;
    outline: none;
    font-variant-numeric: tabular-nums;
}
.trk-msg { min-height: 20px; margin: 10px 0 12px; font-size: 14px; font-weight: 800; }
.trk-msg.error { color: #dc2626; }
.trk-msg.ok { color: #0f766e; }
.trk-actions { display: flex; gap: 8px; }
.trk-btn {
    flex: 0.6;
    padding: 13px;
    border: none;
    border-radius: 12px;
    background: #e2e8f0;
    color: #334155;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
}
.trk-btn.primary { flex: 1; background: #0f766e; color: #fff; }
@keyframes trkShake {
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}
.trk-box.shake { animation: trkShake 0.35s ease-in-out; }

/* 출고 탭 박스 카드의 송장 줄 */
.trk-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    padding: 7px 10px;
    border-radius: 10px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 13px;
    font-weight: 700;
}
.trk-line.has { background: #f0fdfa; color: #0f766e; }
.trk-line b { font-size: 14px; letter-spacing: 0.5px; font-variant-numeric: tabular-nums; }
.trk-line .btn-trk {
    flex-shrink: 0;
    padding: 6px 12px;
    border: none;
    border-radius: 8px;
    background: #0f766e;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

/* ===== 송장 조회 화면 ===== */
.trk-screen-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    color: #fff;
    flex-shrink: 0;
}
.trk-back {
    border: none;
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}
.trk-screen-title { font-size: 17px; font-weight: 800; }
.trk-screen-title span { font-size: 12px; font-weight: 600; opacity: 0.85; }
#trk-search {
    margin-left: auto;
    width: 200px;
    max-width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    outline: none;
}
.trk-table-wrap { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; padding-bottom: 8px; }
.trk-table {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    min-width: 100%;
}
.trk-table th, .trk-table td {
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    padding: 6px 8px;
    vertical-align: top;
    white-space: nowrap;
    background: #fff;
}
.trk-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f1f5f9;
    color: #334155;
    font-weight: 800;
    text-align: left;
    min-width: 150px;
}
.trk-table .trk-sticky {
    position: sticky;
    left: 0;
    z-index: 1;
    min-width: 84px;
    font-weight: 800;
}
.trk-table thead th.trk-sticky { z-index: 3; min-width: 84px; }
.trk-table tr.shade td { background: #f1f5f9; }
.trk-table tr.trk-group-row td { background: #ccfbf1; color: #115e59; font-weight: 900; padding: 4px 8px; }
.trk-table .trk-store { color: #0f172a; }
.trk-no {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
    cursor: pointer;
}
.trk-no .trk-boxno {
    min-width: 18px;
    padding: 0 4px;
    border-radius: 4px;
    background: #e2e8f0;
    color: #475569;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
}
.trk-no .trk-num { font-weight: 700; color: #0f172a; letter-spacing: 0.3px; }
.trk-no .trk-del {
    border: none;
    background: none;
    color: #cbd5e1;
    font-size: 12px;
    cursor: pointer;
    padding: 0 2px;
}
.trk-no .trk-del:hover { color: #dc2626; }
.trk-no.hit { background: #fde68a; border-radius: 6px; }
.trk-empty, .trk-foot { padding: 14px; color: #64748b; font-size: 12px; text-align: center; }

/* PC 현황: 화면이 낮아 모든 점포가 안 들어가면 자동으로 촘촘하게 (JS가 .compact 지정) */
body.gp-docked .gp-panel.compact .gp-head { padding: 8px 14px 8px 20px; }
body.gp-docked .gp-panel.compact .gp-title { font-size: 16px; }
body.gp-docked .gp-panel.compact .gp-sub { font-size: 12px; }
body.gp-docked .gp-panel.compact .gp-colhead { padding: 5px 20px; font-size: 12px; }
body.gp-docked .gp-panel.compact .gp-row { min-height: 0; padding: 3px 20px; font-size: 16px; }
body.gp-docked .gp-panel.compact .gp-no { width: 24px; height: 24px; font-size: 12px; }
body.gp-docked .gp-panel.compact .gp-box { font-size: 12px; padding: 1px 7px; }
body.gp-docked .gp-panel.compact .gp-total { padding: 7px 20px; font-size: 17px; }

/* 현황 — 휴대폰 폭: 점포명이 잘리지 않게 이름 칸을 넓히고 '완료' 표시는 초록 번호로 대신 */
@media (max-width: 520px) {
    .gp-grid { grid-template-columns: minmax(0, 1.55fr) minmax(0, 0.7fr) minmax(0, 1.3fr) repeat(3, minmax(0, 0.72fr)); column-gap: 4px; }
    .gp-row, .gp-colhead, .gp-total { padding-left: 10px; padding-right: 10px; }
    .gp-colhead { font-size: 10px; letter-spacing: 0; }
    .gp-store { gap: 5px; }
    .gp-no { width: 20px; height: 20px; font-size: 11px; }
    .gp-done-pill { display: none !important; }
    .gp-box { font-size: 10.5px; padding: 1px 6px; }
}

/* 출고 탭 박스 카드: 박스별 출고명세서 출력 버튼 */
.btn-box-stmt {
    flex-shrink: 0;
    padding: 4px 10px;
    border: 1px solid #c7d2fe;
    border-radius: 10px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}
.btn-box-stmt:active { transform: scale(0.97); }
.complete-title { flex-wrap: wrap; min-width: 0; }   /* 배지가 많으면 줄바꿈 — 명세서 버튼 자리 확보 */

/* 패킹·출고 탭: 박스마감 자동출력 프린터 선택 */
.print-target-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
}
.print-target-bar .pt-title { font-size: 13px; font-weight: 800; color: #334155; margin-right: 4px; }
.print-target-bar .pt-btn {
    padding: 7px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}
.print-target-bar .pt-btn.on { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
