/**
 * 공통 스타일 - 물류 소팅 시스템
 * 모든 페이지에서 공유하는 기본 스타일
 */

/* 기본 리셋 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #2d3748;
    line-height: 1.5;
}

/* 헤더 */
.header {
    background-color: #2d3748;
    color: #ffffff;
    border-bottom: 1px solid #4a5568;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.header-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.header h1 { font-size: 18px; font-weight: 600; color: #ffffff; }
.header-info { font-size: 13px; color: #e2e8f0; margin-top: 2px; }
.header-right { display: flex; gap: 12px; align-items: center; }
.header-nav a {
    color: #e2e8f0;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 3px;
    font-size: 13px;
    transition: all 0.2s ease;
}
.header-nav a:hover { background-color: #4a5568; color: #ffffff; }
.logout-btn {
    background-color: #4a5568;
    color: #e2e8f0;
    border: none;
    padding: 8px 16px;
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
}
.logout-btn:hover { background-color: #718096; color: #ffffff; }

/* 메인 컨테이너 */
.main-container { padding: 24px; max-width: 900px; margin: 0 auto; }

/* 페이지 헤더 */
.page-header { margin-bottom: 24px; }
.page-title { font-size: 24px; font-weight: 600; color: #1a202c; margin-bottom: 6px; }
.page-subtitle { font-size: 14px; color: #718096; }

/* 통계 카드 */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 20px;
    text-align: center;
    transition: all 0.2s ease;
}
.stat-card:hover { border-color: #cbd5e0; }
.stat-card.clickable { cursor: pointer; }
.stat-card.clickable:hover {
    border-color: #3182ce;
    background: #f7fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}.stat-card.clickable:hover{
    border-color: #FFC21A;
    background: #f7fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.stat-value { font-size: 28px; font-weight: 700; color: #1a202c; }
.stat-value.primary { color: #3182ce; }.stat-value.primary{ color: #946200; }
.stat-value.warning { color: #dd6b20; }
.stat-value.success { color: #38a169; }
.stat-label { font-size: 12px; color: #718096; margin-top: 6px; font-weight: 500; }

/* 스캔 섹션 */
.scan-section {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 24px;
    margin-bottom: 16px;
}
.scan-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 8px;
}
.scan-input-wrap {
    display: flex;
    gap: 12px;
}
.scan-input {
    flex: 1;
    padding: 14px 16px;
    font-size: 16px;
    border: 1px solid #cbd5e0;
    border-radius: 3px;
    outline: none;
    font-family: 'Courier New', monospace;
    background-color: #ffffff;
    color: #2d3748;
}
.scan-input:focus {
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}.scan-input:focus{
    border-color: #FFC21A;
    box-shadow: 0 0 0 3px rgba(255,194,26,0.1);
}
.scan-btn {
    padding: 14px 28px;
    background-color: #3182ce;
    color: #ffffff;
    border: none;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}.scan-btn{
    padding: 14px 28px;
    background-color: #FFC21A;
    color:#2B1D00;
    border: none;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.scan-btn:hover { background-color: #2c5282; }.scan-btn:hover{ background-color: #FFC21A; ;color:#2B1D00}

/* 메시지 */
.message {
    padding: 14px 18px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}
.message.show { display: block; }
.message.error { background-color: #fed7d7; color: #742a2a; border: 1px solid #feb2b2; }
.message.success { background-color: #c6f6d5; color: #22543d; border: 1px solid #9ae6b4; }

/* 버튼 공통 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
}
.btn-primary { background-color: #3182ce; color: #ffffff; }.btn-primary{ background-color: #FFC21A; color:#2B1D00; }
.btn-primary:hover { background-color: #2c5282; }.btn-primary:hover{ background-color: #FFC21A; ;color:#2B1D00}
.btn-secondary { background-color: #e2e8f0; color: #4a5568; }
.btn-secondary:hover { background-color: #cbd5e0; }
.btn-success { background-color: #38a169; color: #ffffff; }
.btn-success:hover { background-color: #2f855a; }
.btn-confirm { background-color: #3182ce; color: #ffffff; }.btn-confirm{ background-color: #FFC21A; color:#2B1D00; }
.btn-confirm:hover { background-color: #2c5282; }.btn-confirm:hover{ background-color: #FFC21A; ;color:#2B1D00}
.btn-cancel { background-color: #e2e8f0; color: #4a5568; }
.btn-cancel:hover { background-color: #cbd5e0; }

/* 배지 */
.badge { padding: 3px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.badge-slot { background: #3182ce; color: #fff; }.badge-slot{ background: #FFC21A; color:#2B1D00; }
.badge-basket { background: #38a169; color: #fff; }
.badge-packing { background: #bee3f8; color: #2a4365; }.badge-packing{ background: #FFF4D1; color: #946200; }
.badge-hold { background: #feebc8; color: #744210; }
.badge-completed { background: #c6f6d5; color: #22543d; }

/* 목록 테이블 */
.list-section {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    margin-bottom: 16px;
    overflow: hidden;
}
.list-header {
    padding: 12px 16px;
    background: #f7fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: background-color 0.2s ease;
}
.list-header:hover {
    background: #edf2f7;
}.list-header:hover{
    background: #FFF4D1;
}
.list-header::after {
    content: '▼';
    font-size: 10px;
    color: #718096;
    transition: transform 0.2s ease;
}
.list-section.collapsed .list-header {
    border-bottom: none;
}
.list-section.collapsed .list-header::after {
    transform: rotate(-90deg);
}
.list-section .list-content {
    transition: max-height 0.3s ease;
    overflow: hidden;
}
.list-section.collapsed .list-content {
    max-height: 0 !important;
}
.list-section.collapsed table,
.list-section.collapsed .list-table {
    display: none;
}
.list-table { width: 100%; border-collapse: collapse; }
.list-table th, .list-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    font-size: 13px;
}
.list-table th {
    background: #f7fafc;
    color: #4a5568;
    font-weight: 600;
    position: sticky;
    top: 0;
}
.list-table tbody tr:hover { background: #f7fafc; }
.list-table tbody tr { cursor: pointer; }
.empty-state {
    text-align: center;
    padding: 24px;
    color: #a0aec0;
    font-size: 14px;
}
.list-empty { text-align: center; padding: 40px; color: #a0aec0; }

/* 정보 그리드 */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.info-item {
    background: #f7fafc;
    padding: 16px;
    border-radius: 4px;
    border-left: 3px solid #3182ce;
}.info-item{
    background: #f7fafc;
    padding: 16px;
    border-radius: 4px;
    border-left: 3px solid #FFC21A;
}
.info-label {
    font-size: 11px;
    color: #718096;
    margin-bottom: 6px;
    text-transform: uppercase;
    font-weight: 600;
}
.info-value { font-size: 14px; font-weight: 600; color: #2d3748; }
.info-item.full { grid-column: 1 / -1; }
.info-grid-row { display: contents; }

/* 아이템 섹션 */
.item-section {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 24px;
}
.item-title {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}
.item-list {}
.item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #ffffff;
    border-radius: 3px;
    margin-bottom: 8px;
    border: 1px solid #e2e8f0;
}
.item-row:last-child { margin-bottom: 0; }
.item-row.clickable {
    cursor: pointer;
    transition: all 0.15s ease;
}
.item-row.clickable:hover {
    background: #ebf8ff;
    border-color: #3182ce;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(49, 130, 206, 0.15);
}.item-row.clickable:hover{
    background: #FFF4D1;
    border-color: #FFC21A;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(255,194,26,0.15);
}
.item-name { font-size: 14px; color: #2d3748; flex: 1; }
.item-sku { font-size: 12px; color: #718096; font-family: 'Courier New', monospace; margin-left: 12px; }
.item-qty {
    font-weight: 700;
    color: #3182ce;
    font-size: 14px;
    min-width: 60px;
    text-align: right;
}.item-qty{
    font-weight: 700;
    color: #946200;
    font-size: 14px;
    min-width: 60px;
    text-align: right;
}

/* 모달 공통 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 100vh;
    height: 100dvh;  /* 모바일 브라우저 하단 툴바 제외한 실제 높이 */
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding-bottom: env(safe-area-inset-bottom, 0px);  /* 하단 네비게이션 안전영역 */
}
.modal-overlay.show { display: flex; }

/* 결과 섹션 */
.result-section {
    display: none;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 16px;
}
.result-section.show { display: block; }
.result-section.error { border-color: #fc8181; background-color: #fff5f5; }
.result-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.result-icon {
    font-size: 28px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #c6f6d5;
    border-radius: 50%;
    color: #22543d;
}
.result-section.error .result-icon { background: #fed7d7; color: #c53030; }
.result-message { font-size: 16px; font-weight: 600; color: #2d3748; }

/* 해제 버튼 */
.unlink-btn {
    padding: 4px 10px;
    background: #e53e3e;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background 0.2s ease;
}
.unlink-btn:hover { background: #c53030; }
.unlink-btn.invoice-unlink { background: #dd6b20; }
.unlink-btn.invoice-unlink:hover { background: #c05621; }

/* 작업 내역 배지 */
.action-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}
.action-badge.action-link {
    background: #c6f6d5;
    color: #22543d;
}
.action-badge.action-unlink {
    background: #fed7d7;
    color: #742a2a;
}

/* ============================================
   새 작업자 헤더 (햄버거 메뉴 방식)
   ============================================ */
.worker-header {
    background: linear-gradient(135deg, #2d3748 0%, #1a365d 100%);
    color: #ffffff;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}.worker-header{
    background: linear-gradient(135deg, #2d3748 0%, #FFC21A 100%);
    color:#2B1D00;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.worker-header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    max-width: 900px;
    margin: 0 auto;
}

/* 햄버거 메뉴 버튼 */
.header-menu-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.header-menu-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.header-menu-btn.active {
    background-color: rgba(255, 255, 255, 0.15);
}

.menu-icon-bar {
    display: block;
    width: 22px;
    height: 2px;
    background-color: #ffffff;
    border-radius: 1px;
    transition: all 0.3s ease;
}

.header-menu-btn.active .menu-icon-bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.header-menu-btn.active .menu-icon-bar:nth-child(2) {
    opacity: 0;
}

.header-menu-btn.active .menu-icon-bar:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* 페이지 제목 */
.header-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    text-align: center;
    flex: 1;
}

/* 홈 버튼 */
.header-home-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    color: #ffffff;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.header-home-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.header-home-btn svg {
    width: 24px;
    height: 24px;
}

/* 슬라이드 메뉴 */
.header-slide-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s linear 0.3s, opacity 0.3s ease;
}

.header-slide-menu.open {
    visibility: visible;
    opacity: 1;
    transition: visibility 0s linear 0s, opacity 0.3s ease;
}

.slide-menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
}

.slide-menu-content {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 85%;
    background: #ffffff;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.header-slide-menu.open .slide-menu-content {
    transform: translateX(0);
}

/* 메뉴 헤더 */
.slide-menu-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    background: linear-gradient(135deg, #2d3748 0%, #1a365d 100%);
    color: #ffffff;
}.slide-menu-header{
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    background: linear-gradient(135deg, #2d3748 0%, #FFC21A 100%);
    color:#2B1D00;
}

.worker-avatar {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.worker-avatar svg {
    width: 28px;
    height: 28px;
}

.worker-info {
    flex: 1;
}

.worker-name {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

.worker-role {
    font-size: 13px;
    color: #a0aec0;
    margin-top: 2px;
}

.slide-menu-close {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #ffffff;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.slide-menu-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 메뉴 네비게이션 */
.slide-menu-nav {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
}

.slide-menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    text-decoration: none;
    color: #2d3748;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.slide-menu-item:hover {
    background-color: #f7fafc;
    border-left-color: #3182ce;
}.slide-menu-item:hover{
    background-color: #f7fafc;
    border-left-color: #FFC21A;
}

.slide-menu-item.active {
    background-color: #ebf8ff;
    border-left-color: #3182ce;
    color: #2b6cb0;
    font-weight: 600;
}.slide-menu-item.active{
    background-color: #FFF4D1;
    border-left-color: #FFC21A;
    color: #946200;
    font-weight: 600;
}

.menu-item-icon {
    font-size: 20px;
    width: 28px;
    text-align: center;
}

.menu-item-text {
    font-size: 15px;
}

/* 메뉴 내 통계 */
.slide-menu-stats {
    background: #f7fafc;
    margin: 8px 12px;
    padding: 10px 14px;
    border-radius: 8px;
    border-left: 3px solid #3182ce;
}.slide-menu-stats{
    background: #f7fafc;
    margin: 8px 12px;
    padding: 10px 14px;
    border-radius: 8px;
    border-left: 3px solid #FFC21A;
}
.menu-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 13px;
}
.menu-stat-row.clickable {
    cursor: pointer;
    padding: 6px 4px;
    border-radius: 4px;
}
.menu-stat-row.clickable:hover {
    background: rgba(0,0,0,0.05);
}
.menu-stat-label {
    color: #718096;
}
.menu-stat-value {
    font-weight: 600;
    color: #2d3748;
}
.menu-stat-value.warehouse {
    color: #3182ce;
}.menu-stat-value.warehouse{
    color: #946200;
}
.menu-stat-value.outgoing {
    color: #38a169;
}

/* 메뉴 푸터 (로그아웃) */
.slide-menu-footer {
    padding: 16px;
    border-top: 1px solid #e2e8f0;
}

.logout-btn-full {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    background-color: #4a5568;
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.logout-btn-full:hover {
    background-color: #2d3748;
}

.logout-btn-full svg {
    width: 20px;
    height: 20px;
}

/* 모바일 공통 반응형 */
@media (max-width: 768px) {
    .header-container { flex-direction: column; gap: 12px; align-items: flex-start; }
    .stats-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card { padding: 14px 10px; }
    .stat-value { font-size: 22px; }
    .stat-label { font-size: 11px; }
    .info-grid { grid-template-columns: 1fr; gap: 10px; }
    .info-item { padding: 12px; }
    .info-grid-row {
        display: flex;
        gap: 10px;
    }
    .info-grid-row .info-item { flex: 1; }
    .scan-input-wrap { flex-direction: column; }
    .main-container { padding: 12px; }
    .page-header { margin-bottom: 16px; }
    .page-title { font-size: 20px; }
    .list-table th, .list-table td { padding: 10px 8px; font-size: 12px; }

    /* 새 헤더 모바일 조정 */
    .worker-header-container {
        padding: 10px 12px;
    }

    .header-title {
        font-size: 16px;
    }

    .slide-menu-content {
        width: 260px;
    }
}
