/* ── 상단 헤더 ── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem; height: 56px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.topbar-logo { font-family: var(--mono); font-size: 1rem; font-weight: 500; letter-spacing: 0.08em; color: var(--accent); }
.topbar-logo span { color: var(--text2); }
.topbar-right { display: flex; align-items: center; gap: 0.75rem; }
.sync-status { display: flex; align-items: center; gap: 0.5rem; font-size: 0.78rem; color: var(--text2); }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text3); transition: background 0.4s; }
.sync-dot.syncing { background: var(--warn); animation: pulse 1s infinite; }
.sync-dot.ok    { background: var(--accent2); }
.sync-dot.error { background: var(--danger); }
.topbar-btn {
  display: flex; align-items: center; gap: 0.4rem;
  background: transparent; border: 1px solid var(--border);
  color: var(--text2); font-family: var(--sans); font-size: 0.78rem;
  padding: 0.35rem 0.8rem; border-radius: 6px; cursor: pointer; transition: all 0.2s;
}
.topbar-btn:hover { border-color: var(--accent); color: var(--accent); }
.topbar-btn.primary { background: var(--accent); border-color: var(--accent); color: white; font-weight: 600; }
.topbar-btn.primary:hover { opacity: 0.85; }

/* ── 레이아웃 ── */
.layout { display: flex; height: calc(100vh - 56px); }

/* ── 사이드바 ── */
.sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 1.25rem 0; overflow-y: auto;
}
.sidebar-section { padding: 0 1rem 1rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.sidebar-section:last-child { border-bottom: none; margin-bottom: 0; }
.sidebar-label { font-size: 0.63rem; font-weight: 600; letter-spacing: 0.12em; color: var(--text3); text-transform: uppercase; margin-bottom: 0.6rem; }
.nav-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.45rem 0.7rem; border-radius: 8px; font-size: 0.83rem;
  color: var(--text2); cursor: pointer; transition: all 0.15s; margin-bottom: 0.1rem;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: rgba(79,142,247,0.15); color: var(--accent); font-weight: 500; }
.nav-badge {
  font-family: var(--mono); font-size: 0.68rem;
  background: var(--surface2); color: var(--text3);
  padding: 0.1rem 0.45rem; border-radius: 99px; border: 1px solid var(--border);
}
.nav-item.active .nav-badge { background: rgba(79,142,247,0.2); color: var(--accent); }

/* ── 메인 콘텐츠 ── */
.main { flex: 1; overflow: hidden; display: flex; flex-direction: column; }

/* ── 통계 카드 ── */
.stats-row { display: flex; gap: 1rem; padding: 1.25rem 1.5rem 0; }
.stat-card { flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 0.9rem 1rem; min-width: 0; }
.stat-card.blue   { border-color: rgba(79,142,247,0.35); }
.stat-card.green  { border-color: rgba(52,211,153,0.35); }
.stat-card.yellow { border-color: rgba(245,158,11,0.35); }
.stat-card.red    { border-color: rgba(248,113,113,0.35); }
.stat-label { font-size: 0.68rem; color: var(--text3); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.35rem; }
.stat-value { font-family: var(--mono); font-size: 1.6rem; font-weight: 500; color: var(--text); line-height: 1; margin-bottom: 0.2rem; }
.stat-card.blue   .stat-value { color: var(--accent); }
.stat-card.green  .stat-value { color: var(--accent2); }
.stat-card.yellow .stat-value { color: var(--warn); }
.stat-card.red    .stat-value { color: var(--danger); }
.stat-sub { font-size: 0.7rem; color: var(--text3); }

/* ── KPI 롤배너 ── */
.kpi-banner {
  position: relative;
  overflow: hidden;
  padding: 0.5rem 1.5rem 0;
  flex-shrink: 0;
}
.kpi-track {
  display: flex;
  transition: transform 0.45s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}
.kpi-slide {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border-left: 3px solid transparent;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.2s;
  min-height: 0;
}
.kpi-slide:hover { opacity: 0.85; }
.kpi-slide.blue   { border-left-color: var(--accent); }
.kpi-slide.green  { border-left-color: var(--accent2); }
.kpi-slide.yellow { border-left-color: var(--warn); }
.kpi-slide.red    { border-left-color: var(--danger); }
.kpi-slide-label {
  font-size: 0.68rem; color: var(--text3);
  text-transform: uppercase; letter-spacing: 0.08em;
  white-space: nowrap; flex-shrink: 0; min-width: 90px;
}
.kpi-slide-value {
  font-family: var(--mono); font-size: 1.4rem; font-weight: 700;
  line-height: 1; flex-shrink: 0;
}
.kpi-slide.blue   .kpi-slide-value { color: var(--accent); }
.kpi-slide.green  .kpi-slide-value { color: var(--accent2); }
.kpi-slide.yellow .kpi-slide-value { color: var(--warn); }
.kpi-slide.red    .kpi-slide-value { color: var(--danger); }
.kpi-slide-sub {
  font-size: 0.72rem; color: var(--text3); flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kpi-slide-sub span { font-size: 0.65rem; }
.kpi-dots {
  display: flex; justify-content: center; gap: 0.35rem;
  padding: 0.3rem 0 0;
}
.kpi-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--border); cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.kpi-dot.active { background: var(--accent); transform: scale(1.3); }

/* 라이트모드 KPI 롤배너 */
body.light-mode .kpi-slide {
  background: #faf7f2;
  border-color: #c8bfae;
}
body.light-mode .kpi-slide.blue   { border-left-color: #1a5c8a; }
body.light-mode .kpi-slide.green  { border-left-color: #1a6b4a; }
body.light-mode .kpi-slide.yellow { border-left-color: #8a5200; }
body.light-mode .kpi-slide-label  { color: #7a7060; }
body.light-mode .kpi-slide-sub    { color: #7a7060; }
body.light-mode .kpi-slide.blue   .kpi-slide-value { color: #1a5c8a; }
body.light-mode .kpi-slide.green  .kpi-slide-value { color: #1a6b4a; }
body.light-mode .kpi-slide.yellow .kpi-slide-value { color: #8a5200; }
body.light-mode .kpi-dot { background: #c8bfae; }
body.light-mode .kpi-dot.active { background: #1a5c8a; }

/* ── 테이블 ── */
.table-toolbar { display: flex; align-items: center; gap: 0.75rem; padding: 1rem 1.5rem 0.75rem; flex-wrap: wrap; }
.table-title { font-size: 0.9rem; font-weight: 600; color: var(--text); margin-right: auto; }
.search-box {
  display: flex; align-items: center; gap: 0.5rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 7px; padding: 0.35rem 0.75rem; transition: border-color 0.2s;
}
.search-box:focus-within { border-color: var(--accent); }
.search-box input { background: none; border: none; color: var(--text); font-family: var(--sans); font-size: 0.8rem; outline: none; width: 200px; }
.search-box input::placeholder { color: var(--text3); }
.filter-select {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text2); font-family: var(--sans); font-size: 0.78rem;
  padding: 0.35rem 0.65rem; border-radius: 7px; cursor: pointer; outline: none; transition: border-color 0.2s;
}
.filter-select:focus { border-color: var(--accent); }
.table-wrap { flex: 1; overflow: auto; padding: 0 1.5rem 1.5rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.8rem; table-layout: fixed; }
thead th { min-width: 0; overflow: hidden; }
tbody td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
thead th.col-sale    { width: 100px; }
thead th.col-grade   { display: none; }
thead th.col-mgmt    { width: 100px; }
thead th.col-mfr     { width: 90px; }
thead th.col-cat     { width: 90px; }
thead th.col-model   { width: 316px; }
thead th.col-buyprice{ width: 90px; }
thead th.col-adjprice { width: 90px; }
thead th.col-estprice { width: 100px; }
thead th.col-price   { width: 100px; }
thead th.col-indate  { width: 80px; }
thead th.col-outdate { width: 60px; }
thead th.col-elapsed { width: 75px; }
tbody td.col-elapsed { white-space: normal; overflow: visible; text-overflow: clip; word-break: keep-all; }
thead th.col-vendor  { width: 75px; }
thead th.col-status  { width: 72px; }
thead th.col-note    { width: 170px; }
thead th {
  background: var(--surface); color: var(--text3);
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase;
  padding: 0.6rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 2; white-space: nowrap; user-select: none;
}
body.light-mode thead th {
  color: var(--text2);
  font-weight: 700;
}
thead th .resizer {
  position: absolute; right: 0; top: 0; height: 100%; width: 5px;
  cursor: col-resize; background: transparent; transition: background 0.15s;
}
thead th:hover .resizer { background: var(--accent); opacity: 0.5; }
thead th .resizer.dragging { background: var(--accent); opacity: 1; }
tbody tr { border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.12s; }
tbody tr:hover { background: rgba(79,142,247,0.22); }

/* ── 상태별 행 배경색 (다크모드) ── */
tbody tr[style*="rgba(99,179,237"]   { background: rgba(99,179,237,0.08) !important; }
tbody tr[style*="rgba(246,173,85"]   { background: rgba(246,173,85,0.09) !important; }
tbody tr[style*="rgba(154,105,250"]  { background: rgba(154,105,250,0.09) !important; }
tbody tr[style*="rgba(245,101,101"]  { background: rgba(245,101,101,0.08) !important; }
tbody tr[style*="rgba(220,53,69,0.13"] { background: rgba(220,53,69,0.13) !important; }
tbody tr[style*="rgba(99,179,237"]:hover   { background: rgba(99,179,237,0.24) !important; }
tbody tr[style*="rgba(246,173,85"]:hover   { background: rgba(246,173,85,0.26) !important; }
tbody tr[style*="rgba(154,105,250"]:hover  { background: rgba(154,105,250,0.26) !important; }
tbody tr[style*="rgba(245,101,101"]:hover  { background: rgba(245,101,101,0.15) !important; }
tbody tr[style*="rgba(220,53,69,0.13"]:hover { background: rgba(220,53,69,0.2) !important; }
tbody td { padding: 0.6rem 0.75rem; vertical-align: middle; }
.mgmt-num { font-family: inherit; font-size: 0.74rem; color: var(--text); font-weight: 400; }
.empty-row td { text-align: center; padding: 3rem; color: var(--text3); }
.state-box { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }

/* ── 팝업 모달 ── */
/* 영업문의 모달(sales.css .modal-overlay)과 동일한 효과로 통일: 스케일/이동 없이 배경+박스가
   한 덩어리로 opacity만 페이드(0.18s) — 예전엔 박스에 scale(0.96→1)+translateY 애니메이션이
   같이 있었는데, 큰 box-shadow(0 32px 80px)와 함께 스케일이 움직이면서 프레임이 뚝뚝 끊기는
   느낌(저사양 화면에서 더 두드러짐)이 있어서 제거함 */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.72); display: flex; align-items: center; justify-content: center; z-index: 9100; opacity: 0; pointer-events: none; transition: opacity 0.18s; padding: 1.5rem; }
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; width: 100%; max-width: 640px; max-height: 88vh; overflow-y: auto; position: relative; transition: max-width 0.25s ease; box-shadow: 0 32px 80px rgba(0,0,0,0.7); }
.modal-box.model-info-open { max-width: 1200px; }

/* 메인재고리스트 디테일 모달(#modalBox)만 별도 처리 — 브라우저를 확대(125% 등)해서 쓰면 내용이
   viewport보다 길어지는데 스크롤이 안 먹혀서 아래를 볼 수 없다는 문제가 있었음. 박스 자체에
   overflow-y:auto를 걸어둔 방식은 안의 #modalBodyRow(flex row, 높이 고정 없음) 콘텐츠가 늘어날 때
   확대 배율에 따라 스크롤이 잘 안 잡히는 경우가 있어서, 헤더는 고정하고 바디만 별도로 스크롤되는
   flex 구조로 바꿔서 항상 확실하게 스크롤되게 함(다른 페이지의 .modal-box는 기존 방식 그대로 둠) */
#modalOverlay #modalBox { display: flex; flex-direction: column; overflow: hidden; }
#modalOverlay #modalBox .modal-header { flex-shrink: 0; }
#modalOverlay #modalBodyRow { flex: 1; min-height: 0; overflow-y: auto; }

/* 디테일모달(메인재고리스트 상세)만 별도 처리 — 모델명이 있는 재고는 열릴 때 모델정보 패널이
   자동으로 같이 열리며 폭이 640→1200으로 즉시 바뀌는데(_renderModal), 이게 opacity 페이드와
   같은 프레임에서 겹치면서 "위로 올라갔다가 가로로 펼쳐지는" 것처럼 보였음(모델명 없는 재고는
   폭이 안 바뀌어서 안 그랬음 — 그래서 "몇몇 재고만" 이상하게 보인 것). 폭 전환은 즉시로 바꿔서
   보이기 전에 이미 최종 크기로 확정되게 하고, 대신 박스 전체를 윈도우 복원 애니메이션처럼
   가운데 기준으로 살짝 작았다가 커지는 스케일+페이드로 열리게 해서 폭이 640이든 1200이든
   항상 똑같은 느낌으로 열리게 함 */
#modalOverlay #modalBox {
  transition: transform 0.2s cubic-bezier(.16,1,.3,1), opacity 0.2s ease, max-width 0s;
  transform: scale(0.92);
  opacity: 0;
}
#modalOverlay.open #modalBox {
  transform: scale(1);
  opacity: 1;
}

/* 마우스오버 썸네일 툴팁 — display:none/block 토글은 트랜지션이 안 먹어서(display는 애니메이션
   불가 속성) 뚝뚝 끊겨 보였음. opacity로만 여닫아서 짧게 페이드되게 함 */
#imgTooltip { opacity: 0; transition: opacity 0.12s ease-out; }
#imgTooltip.itp-show { opacity: 1; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.35rem 1.5rem 0.9rem; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; border-radius: 16px 16px 0 0; }
.modal-header-left { flex: 1; min-width: 0; }
.modal-mgmt { font-family: var(--mono); font-size: 0.72rem; color: var(--text3); margin-bottom: 0.2rem; }
.modal-title { font-size: 1.05rem; font-weight: 700; color: var(--text); line-height: 1.35; }
/* ── 모델 정보 패널 ── */
/* 요청사항: 디테일모달에 스크롤이 (전체모달/우측패널/거래이력 등) 여러 개 겹쳐서 헷갈리던 문제 —
   우측 패널은 더이상 자체 스크롤을 갖지 않고, #modalBodyRow(inventory.css 위쪽) 하나의 스크롤로
   좌우 컬럼이 항상 같이 움직이게 통일함 */
.model-info-panel { display:none; width:540px; min-width:540px; border-left:2px solid var(--border); background:var(--surface2); font-size:0.78rem; }
.model-info-panel.visible { display:block; }
.mi-header { padding:12px 14px 10px; background:linear-gradient(135deg,#1a3a6e,#2d5fa0); color:#fff; font-size:0.8rem; font-weight:700; display:flex; align-items:center; justify-content:space-between; position:sticky; top:0; z-index:1; }
.mi-close { background:rgba(255,255,255,0.2); border:none; color:#fff; font-size:0.9rem; width:24px; height:24px; border-radius:6px; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.mi-close:hover { background:rgba(255,255,255,0.35); }
.mi-body { padding:12px 14px; }
.mi-section { margin-bottom:14px; }
.mi-section-title { font-size:0.67rem; font-weight:700; color:#2d5fa0; text-transform:uppercase; letter-spacing:0.08em; margin-bottom:6px; padding-bottom:3px; border-bottom:1px solid rgba(45,95,160,0.2); }
.mi-text { color:var(--text); line-height:1.6; white-space:pre-wrap; }
.mi-progress-hl { background:rgba(239,68,68,0.16); color:#b91c1c; font-weight:700; padding:0 2px; border-radius:3px; }
.mi-tags { display:flex; flex-wrap:wrap; gap:4px; }
.mi-tag { background:rgba(45,95,160,0.12); color:#2d5fa0; border:1px solid rgba(45,95,160,0.25); border-radius:10px; padding:2px 9px; font-size:0.7rem; font-weight:500; }
.mi-issue { display:flex; align-items:flex-start; gap:6px; padding:5px 8px; background:rgba(239,68,68,0.06); border-radius:6px; margin-bottom:4px; font-size:0.75rem; color:var(--text); border-left:3px solid #ef4444; }
.mi-part { display:flex; align-items:flex-start; gap:6px; padding:5px 8px; background:rgba(16,185,129,0.06); border-radius:6px; margin-bottom:4px; font-size:0.75rem; color:var(--text); border-left:3px solid #10b981; }
.mi-year-badge { display:inline-block; background:rgba(45,95,160,0.12); border:1px solid rgba(45,95,160,0.3); border-radius:6px; padding:3px 10px; font-size:0.72rem; font-weight:600; color:#1a3a6e; margin-right:4px; }
.mi-loading { padding:40px 20px; text-align:center; color:var(--text3); font-size:0.8rem; }
.mi-cache-note { font-size:0.62rem; color:var(--text3); text-align:right; margin-top:10px; padding-top:8px; border-top:1px solid var(--border); }
/* 계보 타임라인 */
.mi-lineage { display:flex; flex-direction:column; gap:0; padding:2px 0; }
.mi-lineage-item { display:flex; align-items:flex-start; gap:8px; position:relative; }
.mi-lineage-dot { width:10px; height:10px; border-radius:50%; background:var(--border); border:2px solid var(--text3); flex-shrink:0; margin-top:3px; z-index:1; }
.mi-lineage-dot.current { background:#2d5fa0; border-color:#2d5fa0; box-shadow:0 0 0 3px rgba(45,95,160,0.2); }
.mi-lineage-line { position:absolute; left:4px; top:13px; width:2px; height:calc(100% + 2px); background:var(--border); }
.mi-lineage-info { display:flex; flex-wrap:wrap; align-items:center; gap:4px; padding-bottom:10px; flex:1; }
.mi-lineage-model { font-size:0.76rem; font-weight:600; color:var(--text); }
.mi-lineage-item.current .mi-lineage-model { color:#2d5fa0; }
.mi-lineage-year { font-size:0.67rem; color:var(--text3); background:var(--surface2); border:1px solid var(--border); border-radius:4px; padding:0 5px; }
.mi-lineage-note { font-size:0.67rem; color:var(--text2); width:100%; padding-left:0; margin-top:-4px; }
.mi-lineage-item.current .mi-lineage-note { color:#2d5fa0; }
/* 라이트모드 */
body.light-mode .model-info-panel { background:#f4f7fc; border-left-color:#c8d4e8; }
body.light-mode .mi-tag { background:rgba(45,95,160,0.08); }
body.light-mode .mi-section-title { color:#1a3a6e; }
.modal-header-right { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.modal-link-btn { display: flex; align-items: center; gap: 0.35rem; padding: 0.32rem 0.75rem; border-radius: 6px; border: 1px solid var(--border); background: var(--surface2); color: var(--text2); font-family: var(--sans); font-size: 0.75rem; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.modal-link-btn:hover { border-color: var(--accent); color: var(--accent); }
.modal-link-btn.copied { border-color: var(--accent2); color: var(--accent2); background: rgba(52,211,153,0.08); }
.modal-close { background: none; border: none; color: var(--text3); font-size: 1.1rem; cursor: pointer; padding: 0.3rem 0.4rem; border-radius: 6px; transition: all 0.2s; line-height: 1; }
.modal-close:hover { background: var(--surface2); color: var(--text); }
.modal-body { padding: 1.1rem 1.5rem 1.5rem; }
.detail-edit-btn { width: 100%; padding: 0.6rem; background: var(--surface2); border: 1px solid var(--border); color: var(--text2); font-family: var(--sans); font-size: 0.82rem; border-radius: 8px; cursor: pointer; transition: all 0.2s; margin-bottom: 0.7rem; }
.detail-edit-btn:hover { border-color: var(--accent); color: var(--accent); }
/* 재고 상세모달 인라인(더블클릭) 수정 — 뭔가 고친 게 있어야만 스카이블루로 활성화됨(요청사항) */
.detail-edit-btn:disabled { opacity: 0.45; color: var(--text3); cursor: not-allowed; }
.detail-edit-btn:disabled:hover { border-color: var(--border); color: var(--text3); }
.detail-edit-btn.dirty { background: #38bdf8; border-color: #38bdf8; color: #06283a; font-weight: 700; opacity: 1; }
.detail-edit-btn.dirty:hover { background: #0ea5e9; border-color: #0ea5e9; color: #06283a; }
.edit-form { display: none; }
.edit-form.open { display: block; }
.edit-field { margin-bottom: 0.7rem; }
.edit-label { display: block; font-size: 0.65rem; color: var(--text3); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.3rem; }
.edit-input, .edit-select, .edit-textarea { width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text); font-family: var(--sans); font-size: 0.82rem; padding: 0.48rem 0.72rem; border-radius: 7px; outline: none; transition: border-color 0.2s; }
.edit-input:focus, .edit-select:focus, .edit-textarea:focus { border-color: var(--accent); }
.edit-textarea { min-height: 76px; resize: vertical; }
.edit-actions { display: flex; gap: 0.5rem; margin-top: 0.9rem; }
.btn-save { flex: 1; padding: 0.58rem; background: var(--accent); color: white; border: none; font-family: var(--sans); font-size: 0.82rem; font-weight: 600; border-radius: 8px; cursor: pointer; transition: opacity 0.2s; }
.btn-save:hover { opacity: 0.85; }
.btn-save:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-cancel { padding: 0.58rem 1rem; background: var(--surface2); color: var(--text2); border: 1px solid var(--border); font-family: var(--sans); font-size: 0.82rem; border-radius: 8px; cursor: pointer; }
.save-notice { margin-top: 0.7rem; padding: 0.6rem 0.8rem; background: rgba(52,211,153,0.08); border: 1px solid rgba(52,211,153,0.2); border-radius: 8px; font-size: 0.7rem; color: var(--accent2); line-height: 1.6; }

/* ── 업로드 진행 ── */
.upload-progress {
  position: fixed; bottom: 5rem; left: 50%; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--accent); border-radius: 10px;
  padding: 1rem 1.5rem; font-size: 0.83rem; color: var(--accent); z-index: 998;
  display: none; align-items: center; gap: 0.75rem;
}
.upload-progress.show { display: flex; }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(79,142,247,0.3); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }

/* ── 컬럼 정렬 ── */
thead th.sortable { cursor: pointer; }
thead th.sortable:hover { color: var(--text2); }
thead th.sortable .sort-icon { font-size: 0.65rem; color: var(--text3); margin-left: 0.2rem; }
thead th.sortable.asc .sort-icon::after  { content: '▲'; color: var(--accent); }
thead th.sortable.desc .sort-icon::after { content: '▼'; color: var(--accent); }
thead th.sortable.asc  .sort-icon,
thead th.sortable.desc .sort-icon { font-size: 0; }

.cloud-item:hover { z-index: 10; }
#sidebarCloud { width: 100%; border-radius: 6px; display: block; }

#totalPanel { padding-bottom: 1.5rem; }
.total-row { display: flex; justify-content: space-between; align-items: baseline; padding: 0.3rem 0; border-bottom: 1px solid var(--border); }
.total-row:last-child { border-bottom: none; border-top: 1px solid var(--border); margin-top: 0.3rem; padding-top: 0.5rem; }
.total-row-label { font-size: 0.7rem; color: var(--text3); }
.total-row-value { font-family: var(--mono); font-size: 0.75rem; color: var(--text2); }
.total-row.grand .total-row-label { color: var(--text2); font-weight: 600; }
.total-row.grand .total-row-value { color: var(--accent2); font-weight: 600; }
/* 재고 금액 현황 숫자 롤링(오도미터) 효과 — 요청사항: "조정가 수정하면 숫자가 아래로 롤링되면서
   돌아가는 룰렛 느낌으로... 갑자기 바뀌니까 반영이 된건지 안된건지 모르겠다". 자리별로 0~9가
   세로로 쌓인 띠(.odo-strip)를 만들어두고 translateY로 목표 숫자 위치까지 움직여서 실제로
   숫자판이 굴러가는 것처럼 보이게 함 */
.odo-digit { display: inline-block; height: 1em; width: 0.62em; overflow: hidden; vertical-align: bottom; position: relative; text-align: center; }
.odo-strip { display: flex; flex-direction: column; transition: transform 0.7s cubic-bezier(.22,1,.36,1); }
.odo-strip > span { height: 1em; line-height: 1em; display: block; }
.odo-static { display: inline-block; }

/* 요청사항: "롤링될때 재고리스트 메인에 가운데쯤 변동이있는 금액이 거기서 롤링되어 변경되게...
   롤링끝나면 사라지고" — 사이드바 롤링과 별개로, 화면 가운데에 잠깐 떴다가 스스로 사라지는
   큰 숫자 카드. pointer-events:none이라 클릭/조작을 가로막지 않음 */
#centerOdoOverlay {
  position: fixed; top: 38%; left: 50%; transform: translate(-50%,-50%) scale(0.92);
  z-index: 9500; pointer-events: none; opacity: 0; transition: opacity 0.25s ease, transform 0.25s ease;
  background: rgba(20,30,48,0.92); border: 1px solid rgba(255,255,255,0.12); border-radius: 14px;
  padding: 1rem 1.6rem; box-shadow: 0 20px 60px rgba(0,0,0,0.45); backdrop-filter: blur(6px);
  display: flex; flex-direction: column; gap: 0.5rem;
}
#centerOdoOverlay.show { opacity: 1; transform: translate(-50%,-50%) scale(1); }
.center-odo-row { display: flex; align-items: baseline; gap: 0.7rem; justify-content: center; white-space: nowrap; }
.center-odo-label { font-size: 0.78rem; color: rgba(255,255,255,0.6); font-weight: 600; letter-spacing: 0.03em; }
.center-odo-val { font-family: var(--mono); font-size: 1.5rem; font-weight: 700; color: #fff; }

@keyframes approvalBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.75; transform: scale(0.97); }
}

/* ── 전역 로딩 바 ── */
#globalLoadingBar {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  z-index: 9999; pointer-events: none;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.3s ease, opacity 0.4s;
  opacity: 0;
}
#globalLoadingBar.loading { opacity: 1; }
#globalLoadingBar.done { transform: scaleX(1); opacity: 0; transition: transform 0.2s ease, opacity 0.5s 0.1s; }

/* ════════════════════════════════
   라이트모드 — Windows 11 Fluent Design
   ════════════════════════════════ */

/* ── 전체 ── */
body.light-mode {
  background: #f3f3f3;
  font-family: 'Segoe UI Variable', 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
}

/* ── 상단 헤더 ── */
body.light-mode .topbar {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  height: 48px;
}
body.light-mode .topbar-logo {
  color: #0078d4;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0;
  font-family: 'Segoe UI Variable', 'Segoe UI', sans-serif;
}
body.light-mode .topbar-logo span { color: #8a8a8a; font-weight: 400; }
body.light-mode .topbar-btn {
  height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.7);
  color: #1a1a1a;
  font-size: 12px;
  font-family: 'Segoe UI Variable', 'Segoe UI', sans-serif;
  border-radius: 6px;
  font-weight: 400;
  transition: background 0.15s, border-color 0.15s;
}
body.light-mode .topbar-btn:hover {
  background: rgba(0,120,212,0.08);
  border-color: rgba(0,120,212,0.3);
  color: #0078d4;
}
body.light-mode .topbar-btn.primary {
  background: #0078d4;
  border-color: #0078d4;
  color: white;
  font-weight: 500;
}
body.light-mode .topbar-btn.primary:hover { background: #006cbe; }
body.light-mode .sync-status { color: #8a8a8a; font-size: 11px; }
body.light-mode .sync-dot { border-radius: 50%; }

/* ── 사이드바 ── */
body.light-mode .sidebar {
  background: #ffffff;
  border-right: 1px solid rgba(0,0,0,0.08);
  width: 220px;
  padding: 8px 4px;
  font-family: 'Segoe UI Variable', 'Segoe UI', sans-serif;
}
body.light-mode .sidebar-section {
  border-bottom: 1px solid rgba(0,0,0,0.06);
  margin-bottom: 4px;
  padding: 0 4px 4px;
}
body.light-mode .sidebar-label {
  color: #8a8a8a;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 8px 2px;
}
body.light-mode .nav-item {
  height: auto;
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #1a1a1a;
  font-size: 13px;
  font-weight: 400;
  margin-bottom: 1px;
  transition: background 0.1s;
}
body.light-mode .nav-item:hover { background: rgba(0,0,0,0.05); color: #1a1a1a; }
body.light-mode .nav-item:active { background: rgba(0,0,0,0.08); }
body.light-mode .nav-item.active {
  background: rgba(0,120,212,0.1);
  color: #0078d4;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  border-left: 3px solid #0078d4;
  padding-left: 7px;
}
body.light-mode .nav-badge {
  background: rgba(0,0,0,0.06);
  color: #4a4a4a;
  border: none;
  border-radius: 99px;
  font-family: 'Cascadia Code', 'Consolas', monospace;
  font-size: 11px;
  padding: 1px 6px;
}
body.light-mode .nav-item.active .nav-badge {
  background: rgba(0,120,212,0.15);
  color: #0078d4;
}

/* ── KPI 카드 ── */
body.light-mode .stat-card {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
body.light-mode .stat-card::before { display: none; }
body.light-mode .stat-card.blue   { border-top: 3px solid #0078d4; }
body.light-mode .stat-card.green  { border-top: 3px solid #107c10; }
body.light-mode .stat-card.yellow { border-top: 3px solid #ca5010; }
body.light-mode .stat-card.red    { border-top: 3px solid #c42b1c; }
body.light-mode .stat-label { color: #8a8a8a; font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; }
body.light-mode .stat-value { font-size: 1.6rem; font-weight: 600; font-family: 'Segoe UI Variable', sans-serif; }
body.light-mode .stat-card.blue   .stat-value { color: #0078d4; }
body.light-mode .stat-card.green  .stat-value { color: #107c10; }
body.light-mode .stat-card.yellow .stat-value { color: #ca5010; }
body.light-mode .stat-card.red    .stat-value { color: #c42b1c; }
body.light-mode .stat-sub { color: #8a8a8a; font-size: 11px; }

/* ── KPI 롤배너 ── */
body.light-mode .kpi-slide {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
body.light-mode .kpi-slide.blue   { border-left: 3px solid #0078d4; }
body.light-mode .kpi-slide.green  { border-left: 3px solid #107c10; }
body.light-mode .kpi-slide.yellow { border-left: 3px solid #ca5010; }
body.light-mode .kpi-slide-label  { color: #8a8a8a; text-transform: uppercase; letter-spacing: 0.06em; font-size: 10px; font-weight: 600; }
body.light-mode .kpi-slide-sub    { color: #8a8a8a; font-size: 11px; }
body.light-mode .kpi-slide.blue   .kpi-slide-value { color: #0078d4; }
body.light-mode .kpi-slide.green  .kpi-slide-value { color: #107c10; }
body.light-mode .kpi-slide.yellow .kpi-slide-value { color: #ca5010; }
body.light-mode .kpi-dot { background: rgba(0,0,0,0.15); border-radius: 50%; }
body.light-mode .kpi-dot.active { background: #0078d4; }

/* ── 테이블 툴바 ── */
body.light-mode .table-toolbar {
  background: #ffffff;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  padding: 8px 12px;
  gap: 8px;
}
body.light-mode .table-title { color: #1a1a1a; font-size: 13px; font-weight: 600; font-family: 'Segoe UI Variable', 'Segoe UI', sans-serif; }
body.light-mode .search-box {
  background: #f5f5f5;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 6px;
  height: 28px;
  padding: 0 10px;
}
body.light-mode .search-box:focus-within {
  border-color: #0078d4;
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(0,120,212,0.15);
}
body.light-mode .search-box input {
  color: #1a1a1a;
  font-size: 12px;
  font-family: 'Segoe UI Variable', 'Segoe UI', sans-serif;
  width: 200px;
}
body.light-mode .filter-select {
  background: #f5f5f5;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 6px;
  color: #1a1a1a;
  font-size: 12px;
  height: 28px;
  padding: 0 8px;
  font-family: 'Segoe UI Variable', 'Segoe UI', sans-serif;
  font-weight: 400;
  cursor: pointer;
}
body.light-mode .filter-select:focus {
  border-color: #0078d4;
  box-shadow: 0 0 0 2px rgba(0,120,212,0.15);
}

/* ── 테이블 ── */
body.light-mode .table-wrap {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 8px;
  margin: 8px;
}
body.light-mode thead th {
  background: #ffffff;
  color: #4a4a4a;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: none;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  padding: 8px 10px;
  font-family: 'Segoe UI Variable', 'Segoe UI', sans-serif;
}
body.light-mode tbody tr { border-bottom: 1px solid rgba(0,0,0,0.05); }
body.light-mode tbody tr:nth-child(even) { background: #fafafa; }
body.light-mode tbody tr:hover { background: rgba(0,120,212,0.16); }
body.light-mode tbody tr.row-selected,
body.light-mode tbody tr.selected { background: rgba(0,120,212,0.12) !important; }
body.light-mode tbody tr.row-selected td,
body.light-mode tbody tr.selected td { color: #0078d4 !important; }

/* ── 라이트모드 상태별 행 배경색 ── */
body.light-mode tbody tr[style*="rgba(66,153,225"]   { background: rgba(66,153,225,0.13) !important; }
body.light-mode tbody tr[style*="rgba(221,130,38"]   { background: rgba(221,130,38,0.14) !important; }
body.light-mode tbody tr[style*="rgba(128,90,213"]   { background: rgba(128,90,213,0.13) !important; }
body.light-mode tbody tr[style*="rgba(220,53,69,0.07"] { background: rgba(220,53,69,0.07) !important; }
body.light-mode tbody tr[style*="rgba(220,53,69,0.13"] { background: rgba(220,53,69,0.13) !important; }
body.light-mode tbody tr[style*="rgba(66,153,225"]:hover   { background: rgba(66,153,225,0.22) !important; }
body.light-mode tbody tr[style*="rgba(221,130,38"]:hover   { background: rgba(221,130,38,0.24) !important; }
body.light-mode tbody tr[style*="rgba(128,90,213"]:hover   { background: rgba(128,90,213,0.22) !important; }
body.light-mode tbody tr[style*="rgba(220,53,69,0.07"]:hover { background: rgba(220,53,69,0.13) !important; }
body.light-mode tbody tr[style*="rgba(220,53,69,0.13"]:hover { background: rgba(220,53,69,0.2) !important; }
body.light-mode tbody td {
  color: #1a1a1a !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  padding: 10px 10px;
  border: none;
  font-family: 'Segoe UI Variable', 'Segoe UI', sans-serif;
}
body.light-mode .mgmt-num {
  color: #1a1a1a !important;
  font-family: inherit !important;
  font-weight: 400 !important;
}
body.light-mode .model-name {
  font-weight: 500 !important;
}

/* ── 모달 ── */
body.light-mode .modal-overlay { background: rgba(0,0,0,0.35); }
body.light-mode .modal-box {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.15);
}
body.light-mode .modal-header {
  background: rgba(245,245,245,0.9);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px 12px 0 0;
}
body.light-mode .modal-title { color: #1a1a1a; font-size: 14px; font-weight: 600; }
body.light-mode .modal-mgmt { color: #8a8a8a; font-size: 11px; }
body.light-mode .modal-close {
  background: #e8e8e8 !important;
  border: 1px solid #bbb !important;
  border-radius: 0 !important;
  color: #555 !important;
  width: 26px !important; height: 26px !important;
  font-size: 13px !important;
  display: flex !important; align-items: center !important; justify-content: center !important;
}
body.light-mode .modal-close:hover { background: #c42b1c !important; border-color: #a02020 !important; color: #fff !important; }
/* 점검 진행 */
.modal-btn-insp { background: #dce6f5 !important; border-color: #a8c0e8 !important; color: #1a3a6e !important; }
.modal-btn-insp:hover { background: #c4d4ee !important; }
/* 점검 완료 */
.modal-btn-complete { background: #d4edda !important; border-color: #a8d5b0 !important; color: #155a1a !important; }
.modal-btn-complete:hover { background: #bcd8c4 !important; }
/* 재점검 */
.modal-btn-recheck { background: #fff3cd !important; border-color: #f0d080 !important; color: #7a4f00 !important; }
.modal-btn-recheck:hover { background: #f0e0a0 !important; }
/* 점검예외 */
.modal-btn-exclude { background: #f0f0f0 !important; border-color: #ccc !important; color: #666 !important; }
.modal-btn-exclude:hover { background: #e0e0e0 !important; }
/* 점검예외 해제 */
.modal-btn-excluded { background: #f8d7da !important; border-color: #e0a0a8 !important; color: #a01a1a !important; }
.modal-btn-excluded:hover { background: #f0b8c0 !important; }
body.light-mode .modal-body { font-family: 'Segoe UI Variable', 'Segoe UI', sans-serif; }
body.light-mode .detail-field {
  background: #f5f5f5;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 6px;
}
body.light-mode .detail-field-label { color: #8a8a8a; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
body.light-mode .detail-field-value { color: #1a1a1a; font-size: 13px; font-weight: 400; }
body.light-mode .detail-notes { color: #4a4a4a; line-height: 1.6; }

/* ── 수정 폼 ── */
body.light-mode .detail-edit-btn {
  background: #f5f5f5;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 6px;
  color: #1a1a1a;
  font-size: 12px;
}
body.light-mode .detail-edit-btn:hover { background: rgba(0,120,212,0.08); border-color: #0078d4; color: #0078d4; }
body.light-mode .detail-edit-btn:disabled { opacity: 0.45; color: #999; cursor: not-allowed; }
body.light-mode .detail-edit-btn:disabled:hover { background: #f5f5f5; border-color: rgba(0,0,0,0.1); color: #999; }
body.light-mode .detail-edit-btn.dirty { background: #38bdf8; border-color: #38bdf8; color: #06283a; opacity: 1; }
body.light-mode .detail-edit-btn.dirty:hover { background: #0ea5e9; border-color: #0ea5e9; color: #06283a; }
body.light-mode .edit-input, body.light-mode .edit-select, body.light-mode .edit-textarea {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 6px;
  color: #1a1a1a;
  font-family: 'Segoe UI Variable', 'Segoe UI', sans-serif;
  font-size: 13px;
}
body.light-mode .edit-input:focus, body.light-mode .edit-select:focus, body.light-mode .edit-textarea:focus {
  border-color: #0078d4;
  box-shadow: 0 0 0 2px rgba(0,120,212,0.15);
}
body.light-mode .edit-label { color: #8a8a8a; text-transform: uppercase; letter-spacing: 0.06em; font-size: 10px; font-weight: 600; }
body.light-mode .btn-save {
  background: #0078d4;
  border-radius: 6px;
  font-family: 'Segoe UI Variable', 'Segoe UI', sans-serif;
  font-weight: 500;
}
body.light-mode .btn-save:hover { background: #006cbe; }
body.light-mode .btn-cancel {
  background: #f5f5f5;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 6px;
  color: #1a1a1a;
}
body.light-mode .save-notice {
  background: rgba(16,124,16,0.06);
  border: 1px solid rgba(16,124,16,0.2);
  border-radius: 6px;
  color: #107c10;
}

/* ── 배지 ── */
body.light-mode .badge { border-radius: 99px; font-size: 11px; }
body.light-mode .badge.in     { background: rgba(16,124,16,0.1);  color: #107c10; border-color: rgba(16,124,16,0.2); }
body.light-mode .badge.wait   { background: rgba(202,80,16,0.1);  color: #ca5010; border-color: rgba(202,80,16,0.2); }
body.light-mode .badge.done   { background: rgba(0,120,212,0.1);  color: #0078d4; border-color: rgba(0,120,212,0.2); }
body.light-mode .badge.coming { background: rgba(196,43,28,0.1);  color: #c42b1c; border-color: rgba(196,43,28,0.2); }
body.light-mode .badge.part   { background: rgba(0,0,0,0.05);     color: #4a4a4a; border-color: rgba(0,0,0,0.1); }
body.light-mode .grade-A { background: rgba(16,124,16,0.1);  color: #107c10; border-radius: 4px; font-weight: 600; }
body.light-mode .grade-B { background: rgba(0,120,212,0.1);  color: #0078d4; border-radius: 4px; font-weight: 600; }
body.light-mode .grade-C { background: rgba(202,80,16,0.1);  color: #ca5010; border-radius: 4px; font-weight: 600; }
body.light-mode .grade-D { background: rgba(196,43,28,0.1);  color: #c42b1c; border-radius: 4px; font-weight: 600; }

/* ── 사이드바 총액 패널 ── */
body.light-mode #totalPanel {
  background: #ffffff;
  border-radius: 0;
  padding: 8px 4px;
}
body.light-mode .total-row { border-bottom: 1px solid rgba(0,0,0,0.06); font-family: 'Segoe UI Variable', 'Segoe UI', sans-serif; padding: 4px 8px; }
body.light-mode .total-row-label { color: #8a8a8a; font-size: 12px; font-weight: 400; }
body.light-mode .total-row-value { color: #0078d4; font-size: 12px; font-weight: 600; font-family: 'Cascadia Code', 'Consolas', monospace; }
body.light-mode .total-row.grand {
  background: rgba(0,120,212,0.08);
  border-radius: 6px;
  padding: 5px 8px;
  margin: 4px 0;
  border-bottom: none;
}
body.light-mode .total-row.grand .total-row-label { color: #0078d4; font-weight: 600; }
body.light-mode .total-row.grand .total-row-value { color: #0078d4; font-weight: 700; }

/* ── 모드 토글 버튼 ── */
body.light-mode .mode-toggle-btn {
  height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.7);
  color: #1a1a1a;
  font-size: 12px;
  font-family: 'Segoe UI Variable', 'Segoe UI', sans-serif;
  border-radius: 6px;
  font-weight: 400;
}
body.light-mode .mode-toggle-btn:hover { background: rgba(0,120,212,0.08); border-color: rgba(0,120,212,0.3); color: #0078d4; }

/* ── 매입처 메모 팝업 ── */
body.light-mode #mfr-memo-popup {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
body.light-mode #mfr-memo-popup .memo-header {
  background: rgba(245,245,245,0.8);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  border-radius: 10px 10px 0 0;
}
body.light-mode #mfr-memo-popup .memo-title { color: #1a1a1a; font-weight: 600; font-family: 'Segoe UI Variable', 'Segoe UI', sans-serif; }
body.light-mode #mfr-memo-popup .memo-mgmt { color: #0078d4; font-family: 'Cascadia Code', monospace; }
body.light-mode #mfr-memo-popup .memo-close { color: #8a8a8a; }
body.light-mode #mfr-memo-popup .memo-close:hover { color: #1a1a1a; }
body.light-mode #mfr-memo-popup .memo-vendor { color: #8a8a8a; }
body.light-mode #mfr-memo-popup textarea {
  background: #f5f5f5;
  color: #1a1a1a;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 6px;
  font-family: 'Segoe UI Variable', 'Segoe UI', sans-serif;
}
body.light-mode #mfr-memo-popup textarea:focus { border-color: #0078d4; box-shadow: 0 0 0 2px rgba(0,120,212,0.15); }
body.light-mode #mfr-memo-popup .btn-memo-cancel {
  background: #f5f5f5;
  color: #1a1a1a;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 6px;
}
body.light-mode #mfr-memo-popup .btn-memo-cancel:hover { background: rgba(0,0,0,0.06); }
body.light-mode #mfr-memo-popup .btn-memo-save { background: #0078d4; color: #fff; border-radius: 6px; }
.col-vendor { display: none; }
.tab-렌탈진행 thead th.col-vendor,
.tab-렌탈진행 tbody td.col-vendor { display: table-cell; }

/* ===== 날짜 팝업 ===== */

.day-popup-overlay{position:fixed;inset:0;background:rgba(0,0,0,0.6);z-index:500;display:flex;align-items:center;justify-content:center;opacity:0;pointer-events:none;transition:opacity 0.2s}
.day-popup-overlay.open{opacity:1;pointer-events:all}
.day-popup{background:var(--surface);border:1px solid var(--border);border-radius:14px;width:420px;max-height:80vh;overflow-y:auto;transform:scale(0.95);transition:transform 0.2s;box-shadow:0 10px 40px rgba(0,0,0,0.3);font-family:'Noto Sans KR', 'Malgun Gothic','맑은 고딕',sans-serif;font-size:12px}
.day-popup-overlay.open .day-popup{transform:scale(1)}
.day-popup-header{padding:12px 16px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;background:var(--surface);border-radius:14px 14px 0 0}
.day-popup-date{font-size:1.05rem;font-weight:700;color:#0078d4}
.day-popup-close{background:none;border:none;color:var(--text3);cursor:pointer;font-size:14px;padding:2px 4px}
.day-popup-body{padding:8px 12px}
.day-popup-section{margin-bottom:8px}
.day-popup-section-title{font-size:11px;font-weight:bold;text-transform:uppercase;letter-spacing:0.08em;margin-bottom:4px;padding:2px 4px;border-radius:2px;display:inline-block}
.day-popup-item{display:flex;align-items:center;gap:6px;padding:4px 6px;border-radius:3px;cursor:pointer;transition:background 0.1s;margin-bottom:2px;border:1px solid transparent}
.day-popup-item:hover{background:var(--surface2);border-color:var(--border)}
.day-popup-item-info{flex:1;min-width:0}
.day-popup-item-mgmt{font-family:var(--mono);font-size:11px;color:var(--text3)}
.day-popup-item-name{font-size:12px;font-weight:600;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.day-popup-item-sub{font-size:11px;color:var(--text3);margin-top:1px}


/* ===== inventory.html 인라인 스타일 복구 ===== */
/* ===== ERP1 이카운트 클래식 테마 ===== */


* { box-sizing: border-box; }

body {
  font-family: 'Noto Sans KR', 'Malgun Gothic', '맑은 고딕', sans-serif !important;
  font-size: 12px !important;
  background: #e0e4ec !important;
  color: #222 !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100vh !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* 기존 topbar/layout 무력화 */
.topbar { display: none !important; }

/* ── 최상단 헤더 ── */
.top-header {
  height: 40px;
  max-height: 40px;
  background: #1a3a6e;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  flex-shrink: 0;
  border-bottom: 1px solid #0f2550;
  z-index: 100;
  overflow: hidden;
  transition: max-height 0.2s ease, opacity 0.15s ease, border-color 0.2s ease;
}
.top-header .erp-logo {
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 0.5px;
  color: #fff;
  cursor: pointer;
  user-select: none;
}
.top-header .erp-logo span {
  font-size: 10px;
  font-weight: normal;
  color: #aac4ee;
  margin-left: 8px;
}
.top-header .erp-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── 메뉴바 ── */
.erp-menu-bar {
  height: 34px;
  max-height: 34px;
  background: #2d5fa0;
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid #1a4a80;
  overflow: hidden;
  transition: max-height 0.2s ease, opacity 0.15s ease, border-color 0.2s ease;
}

/* 화면을 확대(125% 등)해서 쓰면 위 상단바+메뉴바가 차지하는 비중이 커져서 재고 리스트가
   한 화면에 몇 줄밖에 안 보인다는 요청으로 추가 — 표 영역(.table-wrap)을 아래로 스크롤하면
   이 둘을 접어서 표 공간을 넓히고, 위로 스크롤하거나 맨 위 근처로 가면 다시 펼쳐짐
   (.table-wrap이 flex:1이라 접힌 만큼 자동으로 표 쪽에 공간이 넘어감) */
/* 테마모드(theme-skylab-modern.css)가 .erp-menu-bar에 min-height:48px!important를 걸어둬서
   (동적으로 나중에 로드되는 스타일이라 소스 순서상 유리함) 일반 명시도로는 못 이겨서 0으로
   안 접히던 문제 — .chrome-collapsed를 두 번 반복해서 명시도를 확실히 더 높여 이김.
   테마모드는 .erp-func-bar에 상하 padding(7px!important)도 걸어놔서, border-box라도
   padding만큼(14px)은 height:0이어도 안 줄어들고 남아있던 문제 — padding도 같이 0으로 */
/* .erp-func-bar는 기본 상태에선 overflow:hidden을 안 둠 — "⚙ 관리" 드롭다운(#adminMenuBox)이
   버튼 바로 아래로 튀어나오는 구조라, 부모에 overflow:hidden이 있으면 그 드롭다운이 통째로
   잘려서 안 보이는 버그가 있었음. 접힐 때만(어차피 그때는 드롭다운도 안 열려있음) 따로 줌 */
body.chrome-collapsed.chrome-collapsed .erp-func-bar {
  overflow: hidden !important;
}
body.chrome-collapsed.chrome-collapsed .top-header,
body.chrome-collapsed.chrome-collapsed .erp-menu-bar,
body.chrome-collapsed.chrome-collapsed .erp-func-bar {
  max-height: 0 !important;
  min-height: 0 !important;
  height: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  opacity: 0 !important;
  border-bottom-color: transparent !important;
}
/* 오늘 일정 뱃지(관리번호별 출장/입고 등 알림줄)도 F4로 접을 때 같이 숨김 */
body.chrome-collapsed #todayScheduleBadge {
  display: none !important;
}
.erp-menu-bar .erp-menu-item {
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: #ddeeff;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  border-right: 1px solid #3a6ab0;
  transition: background 0.1s;
  font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
}
.erp-menu-bar .erp-menu-item:hover { background: #3a72ba; color: #fff; }
.erp-menu-bar .erp-menu-item.active { background: #1a3a6e; color: #fff; font-weight: bold; }

/* ── 본체 ── */
.erp-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── 사이드바 오버라이드 ── */
.sidebar {
  width: 180px !important;
  min-width: 180px !important;
  max-width: 180px !important;
  background: #f0f2f5 !important;
  border-right: 1px solid #c5ccd8 !important;
  flex-shrink: 0 !important;
  overflow-y: auto !important;
  padding: 4px 0 0 0 !important;
  display: block !important;
  position: static !important;
  height: auto !important;
}
.sidebar-section {
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}
.sidebar-label {
  font-size: 10px !important;
  color: #6a7a90 !important;
  font-weight: bold !important;
  padding: 6px 8px 3px 8px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  border-bottom: 1px solid #d0d5de !important;
  display: block !important;
  background: transparent !important;
}
.nav-item {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 5px 8px 5px 12px !important;
  cursor: pointer !important;
  font-size: 12px !important;
  color: #334455 !important;
  border-bottom: none !important;
  transition: background 0.1s !important;
  background: transparent !important;
  border-radius: 0 !important;
  font-weight: normal !important;
  height: auto !important;
  min-height: 26px !important;
  border-left: 2px solid transparent !important;
}
.nav-item:hover { background: #e4e8f0 !important; }
.nav-item.active {
  background: #dce6f5 !important;
  border-left-color: #1a3a6e !important;
  color: #1a3a6e !important;
  font-weight: bold !important;
}
.nav-badge {
  font-size: 11px !important;
  color: #556677 !important;
  background: #dde3ec !important;
  border-radius: 8px !important;
  padding: 0 5px !important;
  line-height: 16px !important;
  min-width: 20px !important;
  text-align: center !important;
  display: inline-block !important;
}
.nav-item.active .nav-badge {
  background: #b8ccec !important;
  color: #1a3a6e !important;
}
/* 사이드바 아래쪽(일정)은 내부 스크롤, 위 요약(#totalFixedBottom: 이달현황/재고금액현황/가동일수)은
   항상 하단에 고정되게 세로 flex로 분리 — #totalPanel이 사이드바 전체 높이를 차지하고,
   그 안에서 #totalRows(일정)만 남는 공간을 먹으며 스크롤되고 #totalFixedBottom은 내용 높이만큼만
   차지하며 항상 아래에 붙어있음 */
.sidebar { display: flex !important; flex-direction: column !important; overflow: hidden !important; }
/* 검수관리 화면은 사이드바가 필요 없어서 숨김(요청사항) — 위 .sidebar가 display:flex!important라
   인라인 style.display='none'으로는 못 이겨서, 클래스 토글 방식으로 명시도를 더 높여 이김.
   body 쪽에 클래스를 둬서, .sidebar가 아직 DOM에 없는 시점(페이지 맨 위, <body> 열리자마자)에도
   미리 걸어둘 수 있게 함 — 새로고침할 때 사이드바가 잠깐 보였다 사라지는 깜빡임 방지용 */
body.insp-view .sidebar { display: none !important; }
#totalPanel {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  padding: 4px 6px 6px 6px !important;
  border-top: 1px solid #d0d5de !important;
  margin-top: 4px !important;
  overflow: hidden !important;
}
#totalRows {
  color: #445 !important;
  line-height: 1.5 !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
}
#totalFixedBottom {
  flex: 0 0 auto !important;
  color: #445 !important;
  line-height: 1.5 !important;
}
/* total-row: 레이블 위, 금액 아래 세로 배치 */
#totalFixedBottom .total-row {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  margin-bottom: 0.3rem !important;
}
#totalFixedBottom .total-row-label {
  font-size: 0.62rem !important;
  color: #6a7a90 !important;
  white-space: nowrap !important;
  font-weight: normal !important;
}
#totalFixedBottom .total-row-value {
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  color: #1a3a6e !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 144px !important;
}
#totalFixedBottom .total-row.grand .total-row-label {
  font-size: 0.65rem !important;
  color: #445 !important;
}
#totalFixedBottom .total-row.grand .total-row-value {
  font-size: 0.78rem !important;
  color: #0078d4 !important;
}

/* ── 콘텐츠 영역 ── */
.erp-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  min-width: 0;
}

/* ── 기능버튼바 ── */
.erp-func-bar {
  height: 34px;
  max-height: 34px;
  background: #f0f0f0;
  border-bottom: 1px solid #ccc;
  display: flex;
  align-items: center;
  padding: 0 6px;
  gap: 2px;
  flex-shrink: 0;
  transition: max-height 0.2s ease, opacity 0.15s ease, border-color 0.2s ease;
}
.erp-sep {
  width: 1px;
  height: 18px;
  background: #bbb;
  margin: 0 4px;
  flex-shrink: 0;
}

/* 관리자 전용 버튼 — .topbar-btn의 display:!important보다 우선하도록 클래스 특정도를 높임 */
.admin-only-btn.role-hidden { display: none !important; }
/* 조정가/예판가 버튼 — 관리자 또는 "조정가 수정권한" 보유자 전용(admin-only-btn과 조건이
   달라서 별도 클래스로 둠) */
.adjprice-only-btn.role-hidden { display: none !important; }
/* 회원 전용 버튼(비로그인 숨김) — 인라인 style만으로는 .topbar-btn의 !important를 못 이겨서 동일한 방식으로 처리 */
.member-only.role-hidden-guest { display: none !important; }
/* 월별 재고실사 버튼(특정 인원+기간 지정) — 위와 같은 이유로 인라인 style="display:none"이
   .topbar-btn의 !important에 밀려 전 직원에게 보이던 버그가 있었음(#stockAuditBtn은 ID라
   .topbar-btn보다 이미 특정도가 높지만, 명확성을 위해 여기도 !important로 명시) */
#stockAuditBtn.gate-hidden, #stockAuditHistBtn.gate-hidden { display: none !important; }

/* 개인 메모장 스타일은 public/js/admin-memo.js(모든 페이지 공통 위젯)가 스스로 주입함 */

/* topbar-btn 오버라이드 (auth.js가 생성하는 버튼 포함) */
.topbar-btn, .erp-btn {
  padding: 2px 10px !important;
  background: #e8e8e8 !important;
  border: 1px solid #bbb !important;
  border-radius: 0 !important;
  font-size: 12px !important;
  font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif !important;
  cursor: pointer !important;
  color: #333 !important;
  transition: background 0.1s !important;
  height: 24px !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  white-space: nowrap !important;
  text-decoration: none !important;
  vertical-align: middle !important;
}
.topbar-btn:hover, .erp-btn:hover {
  background: #d8d8d8 !important;
  border-color: #999 !important;
}
/* display:inline-flex !important 위 규칙 때문에 인라인 style="display:none"이 안 먹혀서
   (상세모달 동영상/파일 버튼이 내용 없이 빈 네모로 보이던 버그) 클래스로 강제 숨김 */
.topbar-btn.tb-hidden {
  display: none !important;
}
.topbar-btn.primary, .erp-btn.primary {
  background: #c8d8f0 !important;
  border-color: #6a9ad0 !important;
  color: #1a3a6e !important;
  font-weight: bold !important;
}
.topbar-btn.primary:hover { background: #b5c8e4 !important; }

/* 헤더 안 버튼 (어두운 배경) */
.top-header .topbar-btn,
#authBar .topbar-btn {
  color: #ddeeff !important;
  border-color: #4a7abf !important;
  background: rgba(255,255,255,0.1) !important;
}
.top-header .topbar-btn:hover,
#authBar .topbar-btn:hover {
  background: rgba(255,255,255,0.2) !important;
}

/* 댓글 버튼 스타일은 erp-theme.css로 이동함 (모든 페이지에서 로드되어야 하므로) */

#authBar {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
}

.sync-status {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  font-size: 11px !important;
  color: #aac4ee !important;
}
.sync-dot {
  width: 6px !important;
  height: 6px !important;
  border-radius: 50% !important;
}

/* 관리 드롭다운 */
#adminMenuBox {
  border-radius: 0 !important;
  border: 1px solid #bbb !important;
  box-shadow: 2px 2px 8px rgba(0,0,0,0.18) !important;
  background: #fff !important;
  padding: 2px 0 !important;
}
#adminMenuBox .topbar-btn {
  display: block !important;
  width: 100% !important;
  text-align: left !important;
  padding: 4px 12px !important;
  background: transparent !important;
  border: none !important;
  height: auto !important;
  color: #333 !important;
  border-radius: 0 !important;
}
#adminMenuBox .topbar-btn:hover { background: #e8eef8 !important; }
#adminMenuBox hr { border: none !important; border-top: 1px solid #ddd !important; margin: 2px 0 !important; }

/* ── 검색 조건 ── */
.erp-search-bar {
  background: #f5f7fa;
  border-bottom: 1px solid #d0d5de;
  padding: 5px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.erp-search-label {
  font-size: 12px;
  color: #445;
  white-space: nowrap;
}
.erp-search-input {
  border: 1px solid #bbb;
  padding: 2px 5px;
  font-size: 12px;
  font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  background: #fff;
  color: #333;
  height: 22px;
  border-radius: 0;
  outline: none;
}
.erp-search-input:focus { border-color: #2d5fa0; }
.erp-search-select {
  border: 1px solid #bbb;
  padding: 1px 4px;
  font-size: 12px;
  font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  background: #fff;
  color: #333;
  height: 22px;
  border-radius: 0;
  /* 탭(전체재고/통합검색/입고완료 등)마다 제조사·제품군 옵션 목록이 달라서 선택된 값의 글자수에
     따라 select 박스 너비가 매번 바뀌던 문제 — 폭을 고정하고 긴 이름은 말줄임으로 처리함 */
  width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.erp-search-select:focus { border-color: #2d5fa0; outline: none; }

/* ── 결과 카운트바 ── */
.erp-result-bar {
  padding: 3px 10px;
  font-size: 12px;
  color: #445;
  background: #fafbfc;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  min-height: 22px;
}
.erp-result-bar strong { color: #1a3a6e; }

/* ── 테이블 오버라이드 ── */
.table-wrap {
  flex: 1 !important;
  overflow: auto !important;
  border: none !important;
  border-radius: 0 !important;
}
.table-wrap table {
  border-collapse: collapse !important;
  font-size: 12px !important;
  font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif !important;
}
.table-wrap thead th {
  background: #d0d9e8 !important;
  color: #222 !important;
  font-weight: bold !important;
  border: 1px solid #aab !important;
  padding: 3px 6px !important;
  white-space: nowrap !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 2 !important;
  text-align: center !important;
  font-size: 12px !important;
  height: auto !important;
  line-height: 1.3 !important;
}
.table-wrap tbody tr { cursor: pointer !important; }
.table-wrap tbody tr:nth-child(even) { background: #f4f7fc !important; }
.table-wrap tbody tr:nth-child(odd)  { background: #ffffff !important; }
.table-wrap tbody tr:hover           { background: #e4edf8 !important; }
/* 상태색이 있는 행은 호버 시 그 색이 밋밋한 파란색(#e4edf8)으로 완전히 덮여서
   무슨 상태였는지 구분이 안 되던 문제 — 상태별 색을 유지한 채 살짝 더 진하게만 변경.
   속성 선택자를 추가해 위 일반 규칙보다 명시도를 높여 항상 이 규칙이 이기도록 함 */
.table-wrap tbody tr[style*="rgba(66,153,225"]:hover   { background: rgba(66,153,225,0.28) !important; }
.table-wrap tbody tr[style*="rgba(221,130,38"]:hover   { background: rgba(221,130,38,0.3) !important; }
.table-wrap tbody tr[style*="rgba(128,90,213"]:hover   { background: rgba(128,90,213,0.28) !important; }
.table-wrap tbody tr[style*="rgba(220,53,69,0.07"]:hover { background: rgba(220,53,69,0.16) !important; }
.table-wrap tbody tr[style*="rgba(220,53,69,0.13"]:hover { background: rgba(220,53,69,0.24) !important; }
/* 배경색만으로는 "지금 이 행을 보고 있다"는 게 옅어서 헷갈리므로, 상태색과 무관하게
   항상 같은 방식으로 눈에 띄는 강조 표시(굵은 파란 선)를 모델명 셀 왼쪽에 표시 —
   탭마다 모델명 셀 위치/클래스가 달라서 항상 붙는 onclick="modelNameClick(...)" 속성으로 잡음 */
.table-wrap tbody tr:hover td[onclick*="modelNameClick"] {
  box-shadow: inset 4px 0 0 0 #0078d4 !important;
}
.table-wrap tbody tr.row-selected,
.table-wrap tbody tr.selected        { background: #c8d8f0 !important; }
/* 셀 마우스 오버 시 살짝 확대 — 마우스가 있는 그 셀만 커지고 나머지 컬럼은 그대로 유지됨.
   왼쪽을 기준으로 커지게 해서 앞 컬럼 쪽으로는 밀고 들어가지 않음 */
.table-wrap tbody td {
  transition: transform 0.15s ease;
  transform-origin: left center;
}
.table-wrap tbody td:hover {
  transform: scale(1.08);
  position: relative;
  z-index: 3;
}
.table-wrap tbody td {
  border: 1px solid #c8cdd5 !important;
  padding: 2px 6px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-size: 12px !important;
  height: 24px !important;
  line-height: 20px !important;
  vertical-align: middle !important;
}
/* 모델명 뒤에 붙는 출고예정/출고일 지정 아이콘이 긴 모델명에 밀려 셀 밖(overflow:hidden)으로
   나가면서 클릭이 옆 컬럼(매입가 등)으로 새던 문제 — 이 셀만 줄바꿈 허용해서 항상 셀 안에 담기게 함 */
.table-wrap tbody td.model-cell-wrap {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  height: auto !important;
  min-height: 24px !important;
  line-height: 1.5 !important;
}

/* 제조사 컬럼 — 이름이 길면 잘리는(ellipsis) 대신 줄바꿈되게 함 */
.table-wrap tbody td.mfr-cell-wrap {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  height: auto !important;
  min-height: 24px !important;
  line-height: 1.4 !important;
  word-break: break-word;
}

/* 제품군 컬럼 — 이름이 길면 잘리는(ellipsis) 대신 줄바꿈되게 함 */
.table-wrap tbody td.cat-cell-wrap {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  height: auto !important;
  min-height: 24px !important;
  line-height: 1.4 !important;
  word-break: break-word;
}

/* 매입처 컬럼 — 이름이 길면 잘리는(ellipsis) 대신 줄바꿈되게 함 */
.table-wrap tbody td.buyfrom-cell-wrap {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  height: auto !important;
  min-height: 24px !important;
  line-height: 1.4 !important;
  word-break: break-word;
}

/* 판매확정 컬럼 — 업체명/견적서 제출 문구가 길면 잘리는(ellipsis) 대신 줄바꿈되게 함 */
.table-wrap tbody td.sale-cell-wrap {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  height: auto !important;
  min-height: 24px !important;
  line-height: 1.4 !important;
  word-break: break-word;
}

/* 경과 컬럼 — 글자가 셀 너비보다 길면 잘리는(ellipsis) 대신 줄바꿈되게 함.
   값(뱃지)을 인라인블록으로 만들어 컬럼 기준 가운데 배치하되, 줄바꿈된 두 줄끼리는 왼쪽으로 줄맞춤 */
.table-wrap tbody td.col-elapsed {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  height: auto !important;
  min-height: 24px !important;
  line-height: 1.4 !important;
  word-break: keep-all;
}
.table-wrap tbody td.col-elapsed span { display: inline-block; text-align: right; }

/* 상태 박스 */
.state-box {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 40px !important;
  color: #667 !important;
  gap: 8px !important;
  min-height: 200px !important;
}

/* ── 하단 상태바 ── */
.erp-status-bar {
  height: 24px;
  background: #e8ecf2;
  border-top: 1px solid #bbc;
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 0;
  font-size: 11px;
  color: #445;
  flex-shrink: 0;
}
.erp-status-bar .erp-status-cell {
  padding-right: 12px;
  margin-right: 12px;
  border-right: 1px solid #bbb;
}
.erp-status-bar .erp-status-cell:last-child {
  border-right: none;
  margin-right: 0;
}

/* 라이트모드에서도 erp1 유지 */
body.light-mode { background: #e0e4ec !important; }
body.light-mode .top-header { background: #1a3a6e !important; }
body.light-mode .erp-menu-bar { background: #2d5fa0 !important; }

/* 퀵필터 버튼 활성 */
.topbar-btn.quick-filter-btn.active {
  background: #1a3a6e !important;
  color: #fff !important;
  border-color: #1a3a6e !important;
}
/* 견적중인재고 — 다른 퀵필터 버튼과 확실히 구분되도록 눈에 띄는 보라색(매출문의 재고연결 배지와 동일 색) */
#nav-견적중 { background: #7c5cff !important; color: #fff !important; border-color: #7c5cff !important; font-weight: 700; }
#nav-견적중:hover { background: #6a48e8 !important; border-color: #6a48e8 !important; }
#nav-견적중.active { background: #5b34d6 !important; border-color: #5b34d6 !important; color: #fff !important; }

.topbar-btn.quick-filter-btn.active .nav-badge {
  background: rgba(255,255,255,0.2) !important;
  color: #ddeeff !important;
}

/* ── 우클릭 컨텍스트 메뉴 ── */
/* 요청사항: "마우스 우클릭시 나오는 메뉴 페이드효과 적용" — display:none/block 대신
   opacity+visibility 트랜지션으로 바꿔서 스르륵 나타나고 사라지게 함(visibility의 트랜지션
   지연은 사라질 때만 걸어서, 나타날 땐 바로 클릭 가능하고 사라질 땐 페이드가 끝난 뒤에야
   완전히 숨겨짐) */
.ctx-menu {
  position: fixed; z-index: 10000;
  background: #fff; border: 1px solid #c0c0c0;
  box-shadow: 2px 4px 16px rgba(0,0,0,0.22);
  min-width: 155px; padding: 2px 0;
  font-family: 'Noto Sans KR', 'Malgun Gothic','맑은 고딕',sans-serif; font-size: 12px;
  visibility: hidden; opacity: 0; transform: translateY(-3px);
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0s linear 0.14s;
}
.ctx-menu.show {
  visibility: visible; opacity: 1; transform: translateY(0);
  transition: opacity 0.14s ease, transform 0.14s ease;
}
.ctx-item {
  padding: 5px 14px; cursor: pointer; position: relative;
  white-space: nowrap; color: #1a1a2e; user-select: none;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.ctx-item:hover { background: #1a3a6e; color: #fff; }
.ctx-item:hover .ctx-arrow { color: #adc8f5; }
.ctx-arrow { font-size: 7px; color: #999; flex-shrink: 0; }
.ctx-sep { border-top: 1px solid #ddd; margin: 2px 0; }
.ctx-sub {
  display: none; position: absolute; left: 100%; top: -3px;
  background: #fff; border: 1px solid #c0c0c0;
  box-shadow: 2px 4px 14px rgba(0,0,0,0.18);
  min-width: 130px; padding: 2px 0; z-index: 10001;
}
.ctx-item:hover > .ctx-sub { display: block; }
body:not(.light-mode) .ctx-menu,
body:not(.light-mode) .ctx-sub { background: #1e2435; border-color: #3a4060; }
body:not(.light-mode) .ctx-item { color: #d8e0f0; }
body:not(.light-mode) .ctx-item:hover { background: #2d5fa0; color: #fff; }
body:not(.light-mode) .ctx-sep { border-color: #3a4060; }

/* ── 페이지네이션 ── */
.pg-info { font-size:0.73rem; color:var(--text3); }
.pg-btns { display:flex; gap:0.2rem; align-items:center; }
.pg-btn {
  min-width:28px; height:26px; padding:0 0.45rem;
  border:1px solid var(--border); background:var(--surface);
  color:var(--text2); border-radius:6px; cursor:pointer;
  font-size:0.78rem; font-family:var(--sans); transition:background 0.12s;
}
.pg-btn:hover:not(:disabled) { background:var(--surface2); }
.pg-btn.pg-active { background:var(--accent); color:#fff; border-color:var(--accent); font-weight:600; }
.pg-btn:disabled { opacity:0.3; cursor:default; }
.pg-ellipsis { font-size:0.78rem; color:var(--text3); padding:0 0.15rem; }

/* 견적서 제출 팝업의 문의 타임라인 — sales.css의 진행사항 타임라인과 동일한 규칙(날짜가 앞에
   붙은 줄은 파란 점+날짜, 없는 줄은 회색 점만) */
.progress-timeline { position: relative; padding-left: 12px; }
.pt-item { position: relative; padding-bottom: 5px; line-height: 1.4; }
.pt-item:last-child { padding-bottom: 0; }
.pt-item:not(:last-child)::before { content: ''; position: absolute; left: -8px; top: 11px; bottom: -5px; width: 1px; background: var(--border); }
.pt-dot { position: absolute; left: -12px; top: 4px; width: 6px; height: 6px; border-radius: 50%; background: #94a3b8; }
.pt-item.pt-dated .pt-dot { background: var(--accent); }
.pt-date { font-weight: 700; font-size: inherit; color: var(--accent); margin-right: 4px; }
.pt-text { }

/* ── 판매예약중/할당:국내영업팀 표시된 행 배경색 — 위쪽의 상태별(입고예정/출고대기 등) 행
   배경 규칙과 마찬가지로 tbody tr:nth-child(even/odd)의 !important 얼룩말 줄무늬가 인라인
   background를 그냥 덮어써버리므로, 클래스+!important로 그보다 나중에(=이 파일 맨 아래) 선언해서
   확실히 이기게 함. 구글시트에는 반영 안 되는 웹 화면 전용 표시(요청사항) */
.table-wrap tbody tr.sale-marker-reserved,
.table-wrap.wip-skin tbody tr.sale-marker-reserved { background: rgba(13,148,136,0.16) !important; }
.table-wrap tbody tr.sale-marker-assigned,
.table-wrap.wip-skin tbody tr.sale-marker-assigned { background: rgba(13,148,136,0.16) !important; }
.table-wrap tbody tr.sale-marker-reserved:hover,
.table-wrap.wip-skin tbody tr.sale-marker-reserved:hover { background: rgba(13,148,136,0.28) !important; }
.table-wrap tbody tr.sale-marker-assigned:hover,
.table-wrap.wip-skin tbody tr.sale-marker-assigned:hover { background: rgba(13,148,136,0.28) !important; }

/* 메인 재고리스트 카드뷰 — 대표사진과 함께 바둑판식으로 보기(요청사항: "메인재고리스트도
   대표이미지와함께 카드뷰 형태로 보이게해보자") */
#cardViewWrap { flex: 1; overflow: auto; padding: 0.75rem 1.5rem 1.5rem; }
/* 요청사항: "한줄에 1개씩... 썸네일은 지금크기의 4분의1... 썸네일 우측으로 2~3줄 정보" —
   바둑판식 그리드에서 세로로 쌓이는 리스트형 행으로 전면 개편.
   이후 "재고1개의 크기를 2배 늘려줘" 요청으로 아래 치수 전체를 2배로 확대함 */
.inv-card-grid { display: flex; flex-direction: column; gap: 12px; }
.inv-card { display: flex; align-items: flex-start; gap: 24px; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 16px 24px; cursor: pointer; transition: box-shadow .12s, border-color .12s; }
.inv-card:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(0,0,0,0.08); }
.inv-card-photo { position: relative; width: 136px; height: 136px; flex-shrink: 0; border-radius: 12px; overflow: hidden; background: #eef1f5; }
.inv-card-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.inv-card-img-empty { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 40px; color: #c3cbd6; }
/* 썸네일이 작아져서 대각선 리본 대신 사진 전체를 살짝 덮는 작은 오버레이 라벨로 */
.inv-card-soldout {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(185,28,28,0.6);
  color: #fff; font-weight: 800; font-size: 30px; letter-spacing: 0.02em; line-height: 1.2;
  text-align: center;
}
/* 입고예정 뱃지(요청사항: "입고예정인데, 출고업체가 있는 재고는 입고예정, sold out 둘다
   썸네일에 표시해줘") — SOLD OUT은 전체를 덮는 오버레이라, 같이 뜰 때도 겹쳐 가려지지 않도록
   작은 모서리 태그로 그 위에 얹음(DOM상 뒤에 두면 기본적으로 위에 그려짐) */
.inv-card-incoming {
  position: absolute; top: 5px; left: 5px; z-index: 2;
  background: #2563eb; color: #fff; font-weight: 700; font-size: 11px;
  padding: 2px 7px; border-radius: 5px; letter-spacing: 0.01em;
  box-shadow: 0 1px 5px rgba(0,0,0,0.35);
}
.inv-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.inv-card-line1 { display: flex; align-items: center; gap: 12px; min-width: 0; }
.inv-card-mgmt-inline { font-family: var(--mono); font-size: 14px; color: var(--text3); flex-shrink: 0; }
.inv-card-cat { font-size: 13px; font-weight: 500; color: var(--text3); background: rgba(0,0,0,0.05); padding: 2px 8px; border-radius: 6px; white-space: nowrap; flex-shrink: 0; }
.inv-card-model { font-size: 18px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
/* 요청사항: "모델명 우측에 제조국가 국기만 표시... 국가표시를 모델명끝에 바짝 붙이고" —
   별도 flex 아이템이 아니라 모델명 span 안에 텍스트처럼 붙여서 실제 글자 끝에 딱 붙게 함 */
.inv-card-flag { height: 14px; width: auto; border-radius: 2px; vertical-align: middle; margin-left: 4px; }
.inv-card-line2 { display: flex; align-items: center; gap: 16px; font-size: 16px; font-weight: 700; color: var(--accent2); }
.inv-card-insp { font-size: 14px; font-weight: 700; padding: 2px 0px; border-radius: 99px; white-space: nowrap; }
.inv-card-line3 { display: flex; align-items: center; gap: 16px; font-size: 14px; color: var(--text3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 요청사항: "경과일수, 판매예약 이런거 우측정렬로 하고 위아래 가운데정렬" — 카드 맨
   오른쪽에 경과일수/입출고 상태/판매예약중 등 마커를 세로로 쌓아서 배치, 가로는 우측
   정렬(align-items:flex-end), 세로(행 높이 기준 위아래)는 가운데 정렬(justify-content:center) */
.inv-card-right-col { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; text-align: right; justify-content: center; gap: 8px; margin-left: 12px; }
/* _fmtElapsed()가 만드는 배지 자체에 font-size가 인라인으로 박혀있어 !important로 덮어씀 */
.inv-card-elapsed-slot span { font-size: 16px !important; }
.inv-card-status-inline { font-size: 16px; font-weight: 700; color: var(--text); white-space: nowrap; }
.inv-card-marker-inline { font-size: 16px; white-space: nowrap; }
/* 카드뷰 AI요약 툴팁 페이드인/아웃(요청사항: "다른재고로 이동할때마다 툴팁이너무 부자연스러워..
   페이드인 페이드아웃으로") — display는 JS가 토글하고, 실제 보임/숨김은 이 클래스의 opacity로 */
/* 인라인 style="opacity:0"이 처음부터 박혀있어서(HTML 자체 속성) 일반 클래스 규칙보다
   우선순위가 높음 — !important로 덮어써야 실제로 페이드인됨(안 그러면 툴팁이 계속 투명한
   채로 안 보이는 버그가 생김) */
#cardSummaryTooltip.cs-visible { opacity: 1 !important; }
/* 요청사항: "마우스 포인트를 엄청 빨리 움직이면 툴팁위로 마우스가 올라가는 경우가 생기는데
   그때 I 타이핑 표시가 생기네" — 툴팁이 마우스 근처를 따라다니다보니 빠르게 움직이면 마우스가
   그 위로 올라타는 순간이 생기고, 그 안의 텍스트가 기본적으로 선택 가능해서(cursor:text) I-beam
   커서로 바뀌며 버벅이는 느낌을 줬음 — pointer-events:none을 항상 켜둬서(inventory.html의
   인라인 style) 마우스가 이 상자를 아예 못 밟게(완전히 통과) 만들어 근본 원인을 제거함 */

/* 검색어 하이라이트 — AI채팅(ai-chat.js .ai-hl)과 동일한 스타일. 관리번호/제조사/제품군/모델명/매입처
   칸에서 검색어와 일치하는 부분에 노란 배경+굵게 표시(요청사항) */
.search-hl { background: rgba(250,204,21,0.5); color: inherit; font-weight: 700; border-radius: 3px; padding: 0 1px; }
/* 위탁자보유(위탁판매 재고) 상태 배지 — 테마(theme-skylab-modern.css)는 JS로 로드돼 캐시버전이 안 붙으므로 여기에도 둠 */
.det-badge.s-consign,body[data-theme-demo="skylab-modern"] .det-badge.s-consign{color:#0f5e57!important;background:#e3f6f3!important;border-color:#a9dcd4!important}
