* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:'Malgun Gothic','Apple SD Gothic Neo',sans-serif; background:#f4f6f8; color:#333; }
body.modal-lock { overflow:hidden; }
.header { background:#1a3a5c; color:#fff; padding:14px 0; display:flex; align-items:center; justify-content:center; position:fixed; top:0; left:0; right:0; width:100%; z-index:1500; transition:padding .25s ease; box-shadow:0 1px 6px rgba(0,0,0,.12); }
.header.scrolled { padding:5px 0; }
.header.scrolled h1 { font-size:15px; }
.header.scrolled .sub:not(#loginInfo):not(#clock) { opacity:0; height:0; margin:0; overflow:hidden; }
.header h1 { font-size:20px; font-weight:700; transition:font-size .25s ease; }
.header .sub { font-size:12px; opacity:.8; transition:opacity .2s ease, height .2s ease, margin .2s ease; }
.header-inner { width:100%; max-width:1400px; padding:0 20px; display:flex; align-items:center; justify-content:space-between; }
.header h1 { font-size:20px; font-weight:700; }
.header .sub { font-size:12px; opacity:.8; }
.container { max-width:1400px; margin:20px auto; padding:0 20px; margin-top:74px; transition:margin-top .25s ease; }
.card { background:#fff; border-radius:8px; box-shadow:0 1px 4px rgba(0,0,0,.1); padding:20px; margin-bottom:20px; }
.card h2 { font-size:16px; margin-bottom:14px; color:#1a3a5c; border-bottom:2px solid #eee; padding-bottom:8px; }
.search-row { display:flex; gap:12px; align-items:flex-end; flex-wrap:wrap; }
.field { display:flex; flex-direction:column; gap:4px; }
.field label { font-size:12px; color:#666; font-weight:600; }
.field select, .field input { padding:8px 10px; border:1px solid #ccc; border-radius:6px; font-size:14px; min-width:200px; }
.btn { padding:9px 18px; border:none; border-radius:6px; cursor:pointer; font-size:14px; font-weight:600; transition:.2s; }
.btn-primary { background:#1a3a5c; color:#fff; }
.btn-primary:hover { background:#2a5a8c; }
.btn-success { background:#2e7d32; color:#fff; }
.btn-success:hover { background:#3a9440; }
.btn-warning { background:#ef6c00; color:#fff; }
.btn-warning:hover { background:#f57c00; }
.btn-danger { background:#c62828; color:#fff; }
.btn-danger:hover { background:#e53935; }
.btn-sm { padding:5px 10px; font-size:12px; }
.logout-btn { border:1px solid rgba(255,255,255,.75); color:#fff; background:transparent; white-space:nowrap; }
.logout-btn:hover { background:rgba(255,255,255,.15); }
.tnum-list { display:flex; flex-direction:column; gap:8px; max-height:420px; overflow-y:auto; }
.tnum-item { display:flex; align-items:center; justify-content:space-between; padding:10px 14px; border:1px solid #ddd; border-radius:6px; cursor:pointer; transition:.15s; background:#fafbfc; }
.tnum-item:hover { border-color:#1a3a5c; background:#eef4fa; }
.tnum-item.active { border-color:#1a3a5c; background:#dce8f5; font-weight:600; }
.tnum-item .tn { font-weight:700; font-size:14px; color:#1a3a5c; width:130px; flex-shrink:0; white-space:nowrap; }
.tnum-item .oi { font-size:12px; color:#777; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex:1; min-width:0; }
.empty { color:#999; text-align:center; padding:30px; font-size:14px; }
.table-wrap { overflow-x:auto; }
table.grid { width:100%; border-collapse:collapse; font-size:13px; }
table.grid th, table.grid td { border:1px solid #ddd; padding:8px 10px; text-align:center; }
#itemArea table.grid th, #itemArea table.grid td { padding:3px 10px; }
table.grid th { background:#f0f3f7; font-weight:700; color:#333; white-space:nowrap; }
table.grid tr:nth-child(even) td { background:#fafbfc; }
table.grid td.left { text-align:left; }
.qty-input { width:60px; padding:5px; text-align:center; border:1px solid #ccc; border-radius:4px; }
select.diff-type { padding:5px; border:1px solid #ccc; border-radius:4px; font-size:12px; }
.note-input { width:160px; padding:5px; border:1px solid #ccc; border-radius:4px; font-size:12px; }
.photo-btn { font-size:12px; padding:4px 8px; }
.photo-row { margin-top:2px; white-space:nowrap; }
.photo-name { font-size:11px; color:#1565c0; display:inline-block; cursor:pointer; text-decoration:none; vertical-align:middle; }
.photo-name:hover { text-decoration:underline; }
.photo-del { font-size:11px; padding:1px 6px; margin-left:10px; color:#c62828; vertical-align:middle; }
.diff-badge { display:inline-block; padding:2px 8px; border-radius:10px; font-size:11px; font-weight:700; }
.diff-MISSING { background:#ffebee; color:#c62828; }
.diff-WRONG { background:#fff3e0; color:#ef6c00; }
.diff-DAMAGE { background:#ede7f6; color:#5e35b1; }
.memo-area { display:flex; flex-direction:column; gap:8px; }
.memo-area textarea { width:100%; min-height:80px; padding:10px; border:1px solid #ccc; border-radius:6px; font-size:14px; resize:vertical; }
.memo-info { font-size:12px; color:#888; }
.diff-table td { text-align:left; }
.status-bar { display:flex; gap:16px; margin-top:10px; font-size:13px; color:#555; }
.status-bar b { color:#1a3a5c; }
#loading { display:none; position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(255,255,255,.7); z-index:99999; align-items:center; justify-content:center; font-size:16px; color:#1a3a5c; font-weight:700; }
#loading.show { display:flex; }
.toast-overlay { position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,.2); z-index:99998; opacity:0; visibility:hidden; pointer-events:none; transition:opacity .35s ease, visibility .35s; }
.toast { position:fixed; top:50%; left:50%; transform:translate(-50%,-50%) scale(.92); background:rgba(0,0,0,.88); color:#fff; padding:16px 34px; border-radius:10px; font-size:15px; font-weight:600; z-index:99999; opacity:0; visibility:hidden; pointer-events:none; transition:opacity .35s ease, transform .35s ease, visibility .35s; box-shadow:0 8px 30px rgba(0,0,0,.35); white-space:nowrap; max-width:90vw; }
.toast-overlay.show { opacity:1; visibility:visible; }
.toast.show { opacity:1; visibility:visible; transform:translate(-50%,-50%) scale(1); }
.toast.ok { background:rgba(46,125,50,.95); }
.toast.err { background:rgba(198,40,40,.95); }

/* 로그인 화면 */
.login-wrap { position:fixed; top:0; left:0; right:0; bottom:0; background:#1a3a5c; display:flex; align-items:center; justify-content:center; z-index:100; }
.login-box { background:#fff; border-radius:12px; padding:40px 36px; width:360px; box-shadow:0 10px 40px rgba(0,0,0,.3); margin:auto; }
.login-box h1 { font-size:22px; color:#1a3a5c; text-align:center; margin-bottom:6px; }
.login-box .login-sub { font-size:13px; color:#888; text-align:center; margin-bottom:26px; }
.login-field { display:flex; flex-direction:column; gap:5px; margin-bottom:16px; }
.login-field label { font-size:12px; color:#666; font-weight:600; }
.login-field input { padding:10px 12px; border:1px solid #ccc; border-radius:6px; font-size:15px; letter-spacing:1px; width:100%; }
.login-btn { width:100%; padding:12px; background:#1a3a5c; color:#fff; border:none; border-radius:6px; font-size:15px; font-weight:700; cursor:pointer; margin-top:8px; }
.login-btn:hover { background:#2a5a8c; }
.login-err { color:#c62828; font-size:13px; text-align:center; margin-top:12px; min-height:18px; }
.login-hint { font-size:11px; color:#aaa; text-align:center; margin-top:14px; }
/* 사진 레이어 팝업 */
.photo-modal { display:none; position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,.85); z-index:2000; align-items:center; justify-content:center; }
.photo-modal.show { display:flex; }
.photo-modal img { max-width:92vw; max-height:88vh; border-radius:8px; box-shadow:0 10px 50px rgba(0,0,0,.6); }
.photo-modal .pm-close { position:absolute; top:20px; right:30px; color:#fff; font-size:36px; cursor:pointer; background:none; border:none; line-height:1; }
.photo-modal .pm-close:hover { color:#ff5252; }
.photo-thumb { display:inline-block; padding:4px 10px; background:#e3f2fd; color:#1565c0; border:1px solid #90caf9; border-radius:4px; font-size:12px; cursor:pointer; }
.photo-thumb:hover { background:#bbdefb; }

/* 회원 관리 레이어 팝업 */
.member-modal { display:none; position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,.55); z-index:3000; align-items:center; justify-content:center; }
.member-modal.show { display:flex; }
.member-modal-box { background:#fff; border-radius:12px; width:880px; max-width:94vw; max-height:min(calc(88vh + 400px), calc(100vh - 30px)); display:flex; flex-direction:column; box-shadow:0 10px 50px rgba(0,0,0,.4); }
.member-modal-head { display:flex; align-items:center; justify-content:space-between; padding:16px 20px; border-bottom:1px solid #eee; }
.member-modal-head h3 { font-size:17px; color:#1a3a5c; margin:0; }
.member-modal-close { background:none; border:none; font-size:26px; cursor:pointer; color:#888; line-height:1; }
.member-modal-close:hover { color:#c62828; }
.member-modal-body { padding:18px 20px; flex:1; overflow:hidden; }
.member-form-row { display:flex; gap:10px; flex-wrap:wrap; align-items:flex-end; margin-bottom:14px; padding-bottom:14px; border-bottom:1px dashed #ddd; }
.member-form-row .field label { font-size:12px; color:#666; font-weight:600; }
.member-form-row .field input, .member-form-row .field select { padding:7px 10px; border:1px solid #ccc; border-radius:6px; font-size:13px; min-width:110px; }
.member-form-row .field input#mEcount { min-width:75px; width:75px; }
.member-form-row .field input#mId, .member-form-row .field input#mPw, .member-form-row .field input#mPw2, .member-form-row .field input#mName { min-width:105px; width:105px; }
.member-form-row .field input#mPw, .member-form-row .field input#mPw2 { min-width:115px; width:115px; }
.member-table-wrap { overflow-x:auto; max-height:calc(88vh - 220px); overflow-y:auto; padding-top:1px; padding-bottom:20px; }
table.member-table { width:100%; border-collapse:collapse; font-size:13px; }
table.member-table thead th { position:sticky; top:0; z-index:5; background:#f0f3f7; }
table.member-table th, table.member-table td { border:1px solid #ddd; padding:7px 9px; text-align:center; white-space:nowrap; }
table.member-table th { background:#f0f3f7; font-weight:700; color:#333; }
table.member-table td.left { text-align:left; }
.member-lv-badge { display:inline-block; padding:2px 8px; border-radius:10px; font-size:11px; font-weight:700; }
.member-lv-10 { background:#e8f5e9; color:#2e7d32; }
.member-lv-20 { background:#e3f2fd; color:#1565c0; }
.member-lv-80 { background:#fff3e0; color:#ef6c00; }
.member-lv-90 { background:#fce4ec; color:#c62828; }
.member-btn-sm { padding:4px 10px; font-size:12px; border:none; border-radius:5px; cursor:pointer; font-weight:600; }
.member-btn-edit { background:#e3f2fd; color:#1565c0; }
.member-btn-edit:hover { background:#bbdefb; }
#mSaveBtn.member-btn-edit { background:#e3f2fd; color:#1565c0; border:1px solid #90caf9; }
#mSaveBtn.member-btn-edit:hover { background:#bbdefb; }
.member-btn-del { background:#ffebee; color:#c62828; }
.member-btn-del:hover { background:#ffcdd2; }
.member-id-hover { cursor:help; border-bottom:1px dashed #90a4ae; }
.member-id-hover:hover { color:#1565c0; }
.member-up-hover { cursor:help; border-bottom:1px dashed #90a4ae; }
.member-up-hover:hover { color:#1565c0; }
/* 정렬 헤더 */
.sort-th { cursor:pointer; user-select:none; }
.sort-th:hover { color:#1565c0; }
.sort-arrow { font-size:11px; }
.sort-arrow.on { color:#1a3a5c; font-weight:900; }
.sort-arrow.off { color:#ccc; font-weight:400; }
/* 마우스 따라다니는 툴팁 */
#memberTip { display:none; position:fixed; z-index:9999; background:#1a3a5c; color:#fff; padding:6px 12px; border-radius:6px; font-size:12px; font-weight:600; white-space:nowrap; pointer-events:none; box-shadow:0 4px 16px rgba(0,0,0,.35); }

/* 삭제 확인 레이어 팝업 */
.confirm-modal { display:none; position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,.45); z-index:3500; align-items:center; justify-content:center; }
.confirm-modal.show { display:flex; }
.confirm-modal-box { background:#fff; border-radius:12px; width:380px; max-width:92vw; padding:26px 24px 22px; box-shadow:0 10px 50px rgba(0,0,0,.4); text-align:center; }
.confirm-modal-box h3 { font-size:16px; color:#1a3a5c; margin:0 0 10px; }
.confirm-modal-box p { font-size:14px; color:#555; margin:0 0 22px; line-height:1.5; word-break:break-all; }
.confirm-modal-btns { display:flex; gap:10px; justify-content:center; }
.confirm-modal-btns .btn { min-width:110px; }

/* 통계 레이어 팝업 */
.stats-modal { display:none; position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,.55); z-index:3200; align-items:center; justify-content:center; }
.stats-modal.show { display:flex; }
.stats-modal-box { background:#fff; border-radius:12px; width:calc(100vw - 150px); max-width:calc(100vw - 150px); max-height:min(calc(92vh + 400px), calc(100vh - 30px)); display:flex; flex-direction:column; box-shadow:0 10px 50px rgba(0,0,0,.4); }
.stats-modal-head { display:flex; align-items:center; justify-content:space-between; padding:16px 20px; border-bottom:1px solid #eee; }
.stats-modal-head h3 { font-size:17px; color:#1a3a5c; margin:0; }
.stats-modal-close { background:none; border:none; font-size:26px; cursor:pointer; color:#888; line-height:1; }
.stats-modal-close:hover { color:#c62828; }
.stats-modal-body { padding:16px 20px; flex:1; overflow:hidden; display:flex; flex-direction:column; gap:12px; }
.stats-search-row { display:flex; gap:10px; flex-wrap:wrap; align-items:flex-end; }
.stats-search-row .field label { font-size:12px; color:#666; font-weight:600; }
.stats-search-row .field select, .stats-search-row .field input { padding:7px 10px; border:1px solid #ccc; border-radius:6px; font-size:13px; min-width:110px; }
.stats-search-row .field input[type="date"] { min-width:140px; }
.stats-search-row .field input.stats-sm { min-width:80px; width:90px; }
/* 통계 검색 조건 폭 조정 (2026-09-13) */
.stats-search-row .field select#stPeriod { min-width:70px; }
.stats-search-row .field select#stDateField { min-width:70px; }
.stats-search-row .field input#stStart, .stats-search-row .field input#stEnd { width:110px; min-width:110px; }
.stats-search-row .field input#stItemcd { width:80px; min-width:80px; }
.stats-search-row .field input#stItemnm { width:120px; min-width:120px; }
.stats-search-row .field input#stEaMin { width:65px; min-width:65px; }
/* 통계 검색 버튼: 조회/초기화 동일 크기, 높이는 input 높이에 맞춤 */
.stats-search-row .btn { padding:7px 14px; font-size:13px; }
.stats-sum-row { display:flex; align-items:center; gap:5px; }
.stats-sum { font-size:12px; color:#888; }
.stats-total-row td { position:sticky; bottom:0; z-index:5; background:#e8f0f8 !important; font-weight:700; color:#1a3a5c; box-shadow:0 -2px 4px rgba(0,0,0,.08); }
.stats-tabs { display:flex; gap:8px; align-items:center; }
.stats-tab { padding:4px 14px; border:1px solid #ccc; border-radius:6px; background:#f5f7fa; color:#555; font-size:13px; font-weight:600; cursor:pointer; }
.stats-tab.active { background:#1a3a5c; color:#fff; border-color:#1a3a5c; }
.stats-export-btn { padding:4px 14px; font-size:13px; }
.stats-col-btn { padding:4px 14px; font-size:13px; background:#e3f2fd; color:#1565c0; border:1px solid #90caf9; }
.stats-col-btn:hover { background:#bbdefb; }
.stats-btn-group { display:flex; align-items:center; gap:5px; }
.stats-sum-row > .stats-btn-group { margin-left:auto; }
.stats-sum-row > .stats-btn-group ~ .stats-btn-group { margin-left:0; }
/* 칼럼(위치) 지정 레이어 팝업 */
.col-modal { display:none; position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,.55); z-index:3300; align-items:center; justify-content:center; }
.col-modal.show { display:flex; }
.col-modal-box { background:#fff; border-radius:12px; width:440px; max-width:92vw; max-height:min(calc(88vh + 400px), calc(100vh - 30px)); display:flex; flex-direction:column; box-shadow:0 10px 50px rgba(0,0,0,.4); }
.col-modal-head { display:flex; align-items:center; justify-content:space-between; padding:16px 20px; border-bottom:1px solid #eee; }
.col-modal-head h3 { font-size:17px; color:#1a3a5c; margin:0; }
.col-modal-close { background:none; border:none; font-size:26px; cursor:pointer; color:#888; line-height:1; }
.col-modal-close:hover { color:#c62828; }
.col-modal-body { padding:16px 20px; display:flex; flex-direction:column; gap:12px; }
.col-hint { font-size:12px; color:#888; }
.col-list { display:flex; flex-direction:column; gap:6px; max-height:50vh; overflow-y:auto; border:1px solid #eee; border-radius:6px; padding:10px; }
.col-item { display:flex; align-items:center; gap:10px; padding:8px 10px; border:1px solid #ddd; border-radius:6px; background:#fafbfc; cursor:grab; user-select:none; }
.col-item.dragging { opacity:.5; border-color:#1a3a5c; background:#eef4fa; }
.col-item.drop-target { border-color:#2e7d32; background:#e8f5e9; box-shadow:0 0 0 2px rgba(46,125,50,.25); }
.col-item .col-drag { color:#999; font-size:14px; cursor:grab; }
.col-item .col-check { display:flex; align-items:center; gap:8px; font-size:13px; color:#333; cursor:pointer; }
.col-item .col-check input { cursor:pointer; }
.col-item .col-hint { color:#888; font-size:11px; font-weight:normal; }
.col-modal-btns { display:flex; gap:10px; justify-content:flex-end; }
.stats-table-wrap { overflow:auto; flex:1; min-height:200px; border:1px solid #eee; border-radius:6px; }
table.stats-table { width:100%; border-collapse:collapse; font-size:12px; }
table.stats-table thead th { position:sticky; top:0; z-index:5; background:#f0f3f7; }
table.stats-table th, table.stats-table td { border:1px solid #ddd; padding:6px 8px; text-align:center; white-space:nowrap; }
table.stats-table th { background:#f0f3f7; font-weight:700; color:#333; }
table.stats-table td.left { text-align:left; }
