/* ===== 동하메디칼 DPL 스타일 ERP ===== */
@import url('https://fonts.googleapis.com/css2?family=Nanum+Gothic:wght@400;700;800&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'Nanum Gothic', '나눔고딕', '맑은 고딕', 'Malgun Gothic', Dotum, Arial, sans-serif;
  font-size: 12px; color: #1a1a1a; background: #fff;
  cursor: default;
  letter-spacing: -0.1px;
  font-weight: 700;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
input[type="text"], input[type="number"], input[type="date"], input[type="password"], input[type="email"], input[type="search"], textarea { cursor: text; }
a { color: #1a0dab; text-decoration: none; }
input, select, button, textarea { font-family: inherit; font-size: 12px; }

/* ===== LOGIN ===== */
.login-bg {
  height: 100vh; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(43,87,154,0.12) 0%, transparent 45%),
    radial-gradient(ellipse at 80% 80%, rgba(120,180,220,0.18) 0%, transparent 50%),
    linear-gradient(135deg, #eaf1fb 0%, #f6f9fc 60%, #eef5ff 100%);
}
.login-card {
  background: #fff; width: 420px; padding: 36px 36px 24px; border-radius: 1px;
  box-shadow: 0 16px 48px rgba(0, 51, 102, 0.14), 0 2px 6px rgba(0,0,0,.04);
  border: 1px solid #e6ecf5;
}
.login-logo-wrap {
  display: flex; align-items: center; justify-content: center;
  margin: 4px auto 14px; width: 150px; height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #ffffff 0%, #eaf4ff 70%, #d6e7fb 100%);
  box-shadow: 0 8px 22px rgba(43, 87, 154, 0.18), inset 0 0 0 1px rgba(43,87,154,0.08);
}
.login-logo { display: block; width: 130px; height: 130px; object-fit: contain; }
.login-card .brand-title {
  text-align: center; font-size: 19px; font-weight: 800; color: #003366;
  letter-spacing: 1.2px; margin-bottom: 2px;
}
.login-card .sub {
  font-size: 11px; color: #6b7a90; margin-bottom: 26px; text-align: center;
  letter-spacing: 1.5px; text-transform: uppercase;
}
.login-card label { display: block; font-size: 12px; color: #555; margin-bottom: 4px; font-weight: 500; }
.login-card input {
  width: 100%; padding: 9px 10px; border: 1px solid #d3dae5; border-radius: 1px;
  margin-bottom: 14px; font-size: 13px; background: #fafbfd;
  transition: border-color .15s, background .15s;
}
.login-card input:focus { border-color: #2b579a; outline: none; background: #fff; }
.login-card .btn-login {
  width: 100%; padding: 11px; background: linear-gradient(180deg, #2b579a, #1e3f73);
  color: #fff; border: none; border-radius: 1px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  box-shadow: 0 2px 6px rgba(43, 87, 154, 0.25);
  transition: transform .08s, box-shadow .15s;
}
.login-card .btn-login:hover { box-shadow: 0 4px 10px rgba(43, 87, 154, 0.32); }
.login-card .btn-login:active { transform: translateY(1px); }
.login-card .err { color: #d32f2f; font-size: 11px; margin-top: 8px; display: none; text-align: center; }
.login-footer {
  margin-top: 20px; padding-top: 14px; border-top: 1px solid #eef1f6;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 10px; color: #8795a9; letter-spacing: 0.6px;
}

/* ===== APP WRAPPER ===== */
.app { display: flex; flex-direction: column; height: 100vh; }
.hidden { display: none !important; }

/* ===== TOP HEADER BAR (네비게이션 메뉴) ===== */
.top-header {
  background: linear-gradient(180deg, #ffffff 0%, #f6f9fd 100%);
  border-bottom: 2px solid #003366;
  box-shadow: 0 2px 6px rgba(0, 51, 102, 0.07);
  display: flex; align-items: center;
  padding: 0 14px; height: 72px; min-height: 72px;
}
.top-logo {
  display: flex; align-items: center; gap: 14px;
  margin-right: 14px; cursor: pointer; white-space: nowrap;
  padding: 4px 0; flex-shrink: 0;
}
.top-logo-img { height: 52px; display: block; filter: drop-shadow(0 1px 2px rgba(0,51,102,0.12)); }
.top-logo-sep { width: 1px; height: 32px; background: linear-gradient(180deg, transparent, #c7d2e0 30%, #c7d2e0 70%, transparent); }
.top-logo-text {
  font-size: 15px; font-weight: 700; color: #003366; letter-spacing: 0.5px;
  display: flex; flex-direction: column; line-height: 1.2;
}
.top-logo-text small {
  font-size: 10px; font-weight: 500; color: #6b7a90; letter-spacing: 1.2px;
  text-transform: uppercase; margin-top: 2px;
}
.top-nav { display: flex; height: 100%; flex: 1; align-items: stretch; }
.top-nav-item {
  padding: 0 14px; height: 100%; display: flex; align-items: center;
  font-size: 12.5px; font-weight: 600; color: #2d3a50; cursor: pointer; white-space: nowrap;
  border-bottom: 3px solid transparent; margin-bottom: -2px;
  transition: all .15s ease;
  letter-spacing: 0.2px; position: relative;
}
.top-nav-item:hover { color: #003366; background: rgba(43, 87, 154, 0.06); }
.top-nav-item.active {
  color: #003366; font-weight: 700; border-bottom-color: #2b579a;
  background: linear-gradient(180deg, rgba(43,87,154,0.05), rgba(43,87,154,0.10));
}
.nav-badge {
  display: inline-block; background: #e74c3c; color: #fff;
  font-size: 10px; font-weight: 800; line-height: 1;
  border-radius: 2px; padding: 3px 7px; margin-left: 6px;
  min-width: 18px; text-align: center; letter-spacing: 0;
  box-shadow: 0 1px 3px rgba(231,76,60,0.35);
  animation: nav-badge-pulse 1.6s ease-in-out infinite;
}
@keyframes nav-badge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* ===== 대분류(모듈) 탭 ===== */
.module-nav {
  display: flex; align-items: stretch; height: 100%; gap: 2px;
  margin-left: 8px; flex: 1;
  min-width: 0; overflow-x: auto; overflow-y: hidden;
}
.module-item {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 0 11px; height: 100%; flex-shrink: 0;
  font-size: 12.5px; font-weight: 700; color: #5b6a85;
  cursor: pointer; white-space: nowrap; letter-spacing: 0.2px;
  position: relative;
  transition: all .12s ease;
}
.module-item:hover { color: #003366; background: rgba(43, 87, 154, 0.05); }
.module-item.active {
  color: #fff; background: linear-gradient(180deg, #2b579a 0%, #1e3f73 100%);
  box-shadow: inset 0 -3px 0 #003366;
}
.module-item.active::after {
  content: '▾'; font-size: 9px; margin-left: 2px;
}

/* ===== 서브 헤더(하위 페이지 탭) ===== */
.sub-header {
  background: #f5f8fc;
  border-bottom: 1px solid #d0dbe9;
  height: 40px; min-height: 40px;
  padding: 0 22px;
  display: flex; align-items: stretch;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,0.02);
}
.sub-header .top-nav { height: 100%; }
.sub-header .top-nav-item {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  border-bottom: 2px solid transparent;
}
.sub-header .top-nav-item.active {
  background: #fff;
  color: #003366;
  border-bottom-color: #2b579a;
  box-shadow: 0 -1px 0 #d0dbe9 inset;
}
.top-user {
  margin-left: auto; display: flex; align-items: center; gap: 10px;
  font-size: 11px; color: #555; flex-shrink: 0;
}
.top-user strong { color: #003366; }
.btn-logout-top {
  padding: 4px 10px; border: 1px solid #aab; border-radius: 1px;
  background: #f5f5f5; font-size: 11px; cursor: pointer; color: #555;
}
.btn-logout-top:hover { background: #e0e0e0; }

/* ===== 작은 화면(노트북) 헤더 자동 압축 =====
   모듈 탭이 많아 폭을 넘칠 때 로고/탭을 단계적으로 줄여 화면에 맞춤.
   그래도 넘치면 .module-nav 가 가로 스크롤되어 로그아웃/로고는 항상 보임. */
@media (max-width: 1600px) {
  .top-header { padding: 0 10px; }
  .top-logo-text small { display: none; }
  .top-logo-img { height: 42px; }
  .top-logo-text { font-size: 14px; }
  .module-item { font-size: 12px; padding: 0 9px; }
}
@media (max-width: 1300px) {
  .top-logo-text { display: none; }
  .top-logo-img { height: 38px; }
  .module-item { font-size: 11.5px; padding: 0 8px; }
}

/* ===== PAGE CONTENT ===== */
.page-wrap { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* Page Title Bar (like 정규출고현황 ★) */
.page-title-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid #d9e2ec;
  background: linear-gradient(180deg, #f3f7fc 0%, #eaf1fb 100%);
  min-height: 38px;
}
.page-title {
  font-size: 14px; font-weight: 700; color: #003366;
  border-bottom: 2px solid #2b579a; padding-bottom: 3px;
  letter-spacing: 0.3px;
}
.page-title-actions { display: flex; gap: 4px; }

/* ===== FILTER AREA ===== */
.filter-area {
  padding: 8px 14px; background: #fff; border-bottom: 1px solid #e0e0e0;
}
.filter-row {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-bottom: 4px;
}
.filter-row:last-child { margin-bottom: 0; }
.f-label {
  font-size: 12px; color: #333; font-weight: 500; min-width: 48px;
  white-space: nowrap;
}
.f-input {
  height: 26px; padding: 0 6px; border: 1px solid #bbb; border-radius: 1px;
  font-size: 12px; background: #fff;
}
.f-input:focus { border-color: #3b7ddd; outline: none; }
select.f-input { min-width: 70px; padding-right: 18px; }
input[type="date"].f-input { width: 120px; }
input[type="text"].f-input { width: 120px; }
.f-sep { color: #999; margin: 0 2px; }
.f-gap { width: 12px; }

/* ===== BUTTONS (동하메디칼 스타일 - 테두리 사각) ===== */
.btn {
  height: 26px; padding: 0 12px; border: 1px solid #888; border-radius: 1px;
  background: #f8f8f8; color: #333; font-size: 12px; cursor: pointer;
  white-space: nowrap; display: inline-flex; align-items: center; gap: 3px;
  transition: background .1s;
}
.btn:hover { background: #e8e8e8; }
.btn-blue { background: #2b579a; color: #fff; border-color: #2b579a; }
.btn-blue:hover { background: #1e3f73; }
.btn-search {
  background: #2b579a; color: #fff; border-color: #2b579a;
  padding: 0 18px; font-weight: 500;
}
.btn-search:hover { background: #1e3f73; }
.btn-red { background: #c0392b; color: #fff; border-color: #c0392b; }
.btn-red:hover { background: #a93226; }
.btn-green { background: #27ae60; color: #fff; border-color: #27ae60; }
.btn-green:hover { background: #1e8449; }
.btn-orange { background: #e67e22; color: #fff; border-color: #e67e22; }
.btn-orange:hover { background: #c45d10; }
.rc-drop { border:2px dashed #2b579a; border-radius:2px; padding:18px 12px; text-align:center; background:#f2f7ff; cursor:pointer; transition:background .15s; }
.rc-drop:hover { background:#e4eeff; }
.rc-drop.on { background:#d9e8ff; border-color:#1e3f73; }
.sp-ac { position:absolute; top:28px; left:0; right:36px; background:#fff; border:1px solid #c8c8c8; border-top:2px solid #2b579a; max-height:240px; overflow:auto; z-index:500; box-shadow:0 4px 10px rgba(0,0,0,0.08); }
.sp-ac-item { padding:5px 8px; font-size:12px; cursor:pointer; border-bottom:1px solid #eee; }
.sp-ac-item:hover { background:#e4eeff; }
.sp-ac-item:last-child { border-bottom:0; }
.btn-sm { height: 22px; padding: 0 8px; font-size: 11px; }

/* ===== FOOTER ===== */
.app-footer {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; background: #f7fafd; border-top: 1px solid #e6ecf3;
  font-size: 11px; color: #6c7a90;
}
.footer-badge { height: 22px; width: 22px; opacity: 0.85; }
.footer-text { letter-spacing: 0.3px; }
.footer-year { margin-left: auto; color: #98a3b5; }

/* ===== SLIGHT POLISH ===== */
.sec { border-radius: 2px; box-shadow: 0 1px 2px rgba(0,0,0,0.02); }
.filter-area { box-shadow: inset 0 -1px 0 rgba(0,0,0,0.02); }
.f-input { border-radius: 1px; transition: border-color .12s; }
.btn { border-radius: 1px; transition: background .12s, box-shadow .12s; }
.btn:not(.btn-sm):hover { box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

/* 입력칸의 깜빡이는 글자 커서(캐럿 │) 숨김 — 사용자 요청.
   장문 입력용 textarea 는 어디 쓰는지 보이도록 커서 유지(:not(textarea)). */
input:not([type="checkbox"]):not([type="radio"]) { caret-color: transparent; }

/* ===== CONTENT AREA ===== */
.content-body { flex: 1; overflow: auto; padding: 0; display: flex; flex-direction: column; }
.content-inner { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ===== DATA TABLE (동하메디칼 테이블 정확 복제) ===== */
.tbl-wrap {
  flex: 1; overflow: auto; border: 1px solid #c8c8c8; border-top: 2px solid #4472c4;
  margin: 6px 14px; background: #fff;
}
.tbl {
  width: 100%; border-collapse: collapse; font-size: 12px; table-layout: auto;
}
.tbl thead { position: sticky; top: 0; z-index: 2; }
.tbl thead th {
  background: #dce6f1; color: #222; font-weight: 600; padding: 6px 8px;
  border: 1px solid #b4c6e0; text-align: center; font-size: 11px;
  white-space: nowrap;
}
.tbl tbody td {
  padding: 4px 7px; border: 1px solid #ddd; white-space: nowrap;
  font-size: 12px; color: #333;
}
.tbl tbody tr:hover { background: #e8f0fe; }
.tbl tbody tr.sel { background: #cde0ff; }
.tbl .tc { text-align: center; }
.tbl .tr { text-align: right; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .rn { text-align: center; color: #666; background: #f5f7fa; width: 32px; }
.tbl .ck { text-align: center; width: 28px; }
.tbl input[type="checkbox"] { cursor: pointer; width: 14px; height: 14px; }

/* 상태 표시 */
.st { padding: 1px 6px; border-radius: 1px; font-size: 11px; font-weight: 600; }
.st-red { color: #c0392b; }
.st-blue { color: #2b579a; }
.st-green { color: #27ae60; }
.st-orange { color: #e67e22; }
.st-gray { color: #888; }

/* ===== TAB BAR (하단 탭 - 동하메디칼) ===== */
.tab-bar {
  display: flex; margin: 0 14px; border-bottom: 1px solid #ccc;
}
.tab-item {
  padding: 6px 16px; font-size: 12px; font-weight: 500; color: #555;
  cursor: pointer; border: 1px solid transparent; border-bottom: none;
  background: #f0f0f0; margin-bottom: -1px; border-radius: 0;
  margin-right: 2px;
}
.tab-item:hover { color: #003366; }
.tab-item.active {
  background: #fff; color: #003366; font-weight: 700;
  border-color: #ccc; border-bottom-color: #fff;
}

/* ===== SECTION PANEL ===== */
.sec {
  margin: 6px 14px; border: 1px solid #c8c8c8; background: #fff;
}
.sec-head {
  padding: 6px 10px; background: #f5f7fa; border-bottom: 1px solid #ddd;
  font-size: 12px; font-weight: 600; color: #003366;
  display: flex; align-items: center; justify-content: space-between;
}
.sec-body { padding: 10px; }
.sec-info { font-weight: 400; font-size: 11px; color: #666; }

/* ===== FORM ===== */
.frm-grid {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.frm-group { display: flex; flex-direction: column; gap: 3px; }
.frm-group label { font-size: 12px; font-weight: 500; color: #333; }
.frm-group input, .frm-group select, .frm-group textarea {
  height: 26px; padding: 0 7px; border: 1px solid #bbb; border-radius: 1px; font-size: 12px;
}
.frm-group input:focus, .frm-group select:focus { border-color: #3b7ddd; outline: none; }
.frm-group textarea { height: auto; min-height: 50px; padding: 5px 7px; resize: vertical; }

/* ===== CELL EDIT INPUT ===== */
.cell-edit {
  width: 60px; height: 22px; padding: 0 4px; border: 1px solid #bbb;
  border-radius: 1px; text-align: right; font-size: 12px;
}
.cell-edit:focus { border-color: #3b7ddd; outline: none; }
.cell-flat {
  width: 100%; height: 22px; padding: 0 4px; border: 0;
  background: transparent; font-size: 12px;
}
.cell-flat:hover { background: #f2f7ff; }
.cell-flat:focus { background: #fff; border-bottom: 1px solid #3b7ddd; outline: none; }

/* ===== PAGINATION ===== */
.pag-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 14px; font-size: 11px; color: #555; border-top: 1px solid #ddd;
  background: #fafafa;
}
.pag-info span { font-weight: 600; color: #003366; }
.pag-btns { display: flex; gap: 2px; }
.pag-btns button {
  height: 22px; min-width: 24px; padding: 0 6px; border: 1px solid #ccc;
  background: #fff; font-size: 11px; cursor: pointer; border-radius: 1px;
}
.pag-btns button:hover { background: #e8f0fe; }
.pag-btns button.on { background: #2b579a; color: #fff; border-color: #2b579a; }
.pag-btns button:disabled { color: #ccc; cursor: default; background: #fafafa; }

/* ===== MODAL (품목선택 팝업) ===== */
.modal-bg {
  display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,.35); z-index: 1000; align-items: center; justify-content: center;
}
.modal-bg.show { display: flex; }
.modal-box {
  background: #fff; display: flex; flex-direction: column; max-height: 82vh;
  border: 1px solid #888; box-shadow: 0 4px 20px rgba(0,0,0,.25);
}
.modal-box.lg { width: 960px; }
.modal-box.md { width: 560px; }
.modal-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; background: #003366; color: #fff; font-size: 13px; font-weight: 600;
}
.modal-close {
  background: none; border: none; color: #fff; font-size: 18px; cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: #ffd; }
.modal-bd { padding: 10px 12px; overflow-y: auto; flex: 1; }
.modal-ft {
  padding: 8px 12px; border-top: 1px solid #ddd; display: flex;
  align-items: center; justify-content: space-between; background: #f8f8f8;
}

/* ===== STATS ROW (숨김) ===== */
.stats-row { display: none !important; }

/* ===== SUB TABS (불출관리 내부 탭) ===== */
.sub-tabs {
  display: flex; gap: 0; margin: 0 14px; margin-top: 6px; border-bottom: 2px solid #003366;
}
.sub-tab {
  padding: 7px 22px; font-size: 12px; font-weight: 500; color: #555;
  cursor: pointer; border: 1px solid #ccc; border-bottom: none;
  background: #f0f0f0; border-radius: 0; margin-right: 2px;
  margin-bottom: -2px; transition: all .12s;
}
.sub-tab:hover { color: #003366; background: #e8eef6; }
.sub-tab.active {
  background: #fff; color: #003366; font-weight: 700;
  border-color: #003366; border-bottom: 2px solid #fff;
}
.undo-fab {
  display: none;
  margin-left: auto; align-self: center;
  padding: 6px 14px; font-size: 12px; font-weight: 700; color: #fff;
  background: #2b579a; border: 1px solid #1e3f6e; border-radius: 2px;
  cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  align-items: center; gap: 6px; line-height: 1;
  transition: all .12s; white-space: nowrap;
}
.undo-fab:hover:not(:disabled) { background: #1e3f6e; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.undo-fab:disabled { background: #cfd6e0; border-color: #b7c0cc; color: #8894a6; cursor: not-allowed; box-shadow: none; }
.undo-fab .undo-badge {
  display: inline-block; min-width: 16px; padding: 1px 6px;
  background: rgba(255,255,255,0.25); border-radius: 2px;
  font-size: 10px; font-weight: 700; text-align: center;
}
.undo-item {
  padding: 8px 12px; border-bottom: 1px solid #eef1f5; cursor: pointer;
  transition: background .1s;
}
.undo-item:hover { background: #f5f8fc; }
.undo-item.active { background: #e9f1fb; border-left: 3px solid #2b579a; padding-left: 9px; }

/* 발주번호 select 와 option 폰트 통일 — 전체/한글과 PO-숫자 모두 동일 폰트로 */
select#osOrdNo, select#osOrdNo option {
  font-family: inherit !important;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
}

/* 발주번호 강조 — 어디서나 눈에 띄게 · 클릭 복사 */
.po-no {
  display: inline-block; padding: 2px 8px;
  background: #fff4d6; color: #a65c0a;
  border: 1px solid #e8b565; border-radius: 1px;
  font-family: 'Consolas','Monaco',monospace; font-weight: 700; font-size: 11px;
  letter-spacing: 0.3px; line-height: 1.4;
  cursor: pointer;
  transition: background .12s;
}
.po-no:hover { background: #ffe8ad; }
.po-no-em { font-size: 13px; padding: 3px 10px; }

/* ===== 불출완료현황 부서탭 ===== */
.dd-dept-tabs {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px;
}
.dd-dept-btn {
  padding: 6px 14px; border: 1px solid #ccc; border-radius: 2px;
  background: #f5f5f5; font-size: 12px; font-weight: 500; color: #555;
  cursor: pointer; transition: all .15s; display: inline-flex; align-items: center; gap: 6px;
}
.dd-dept-btn:hover { background: #e8f5e9; border-color: #27ae60; color: #1e8449; }
.dd-dept-btn.active {
  background: #27ae60; color: #fff; border-color: #27ae60; font-weight: 700;
}
.dd-dept-badge {
  display: inline-block; min-width: 18px; padding: 1px 5px; border-radius: 2px;
  background: rgba(0,0,0,.12); font-size: 10px; font-weight: 700; text-align: center;
}
.dd-dept-btn.active .dd-dept-badge { background: rgba(255,255,255,.3); }

/* ===== 불출취소 액션바 ===== */
.dc-action-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-top: 1px solid #ddd; background: #f8f9fb;
}
.dc-action-info {
  display: flex; align-items: center; gap: 12px; font-size: 12px; color: #333;
}
.dc-action-info b { color: #c0392b; }
.dc-sel-badge {
  display: inline-block; padding: 2px 10px; border-radius: 2px;
  background: #2b579a; color: #fff; font-size: 11px; font-weight: 600;
}

/* ===== PRODUCT SEARCH BAR (in modal) ===== */
.prod-search { display: flex; gap: 6px; margin-bottom: 8px; align-items: center; flex-wrap: wrap; }
.prod-search input, .prod-search select { height: 26px; padding: 0 6px; border: 1px solid #bbb; border-radius: 1px; font-size: 12px; }
.prod-search input[type="text"] { flex: 1; min-width: 140px; }

/* 품목선택 모달 테이블:
   - 품명 열은 내용 크기에 맞게 자연 산출 (table-layout:auto)
   - 나머지 열은 colgroup 폭을 힌트로 고정 폭 유지
   - 테이블은 내용 폭으로 자동 조정 → 남는 공간 없이 실제 컨텐츠만큼만 차지 */
.prod-modal-tbl { table-layout: auto; width: auto; }
.prod-modal-tbl .c-ck    { width: 34px; }
.prod-modal-tbl .c-no    { width: 40px; }
.prod-modal-tbl .c-code  { width: 92px; }
.prod-modal-tbl .c-name  { width: auto; }
.prod-modal-tbl .c-spec  { width: 180px; }
.prod-modal-tbl .c-cat   { width: 74px; }
.prod-modal-tbl .c-sup   { width: 130px; }
.prod-modal-tbl .c-unit  { width: 56px; }
.prod-modal-tbl .c-price { width: 72px; }
.prod-modal-tbl .c-lim   { width: 78px; }
.prod-modal-tbl .c-qty   { width: 76px; }

/* 참조 패널이 열린 상태에서는 품목선택 모달을 오른쪽에 정렬 */
body.ref-open #productModal.modal-bg { justify-content: flex-end; padding-right: 20px; }

/* ===== 비품신청서 샘플 참조 패널 ===== */
.ref-panel {
  display: none; position: fixed; top: 96px; left: 14px;
  width: 540px; max-height: 78vh; z-index: 1100;
  background: #fff; border: 1px solid #2b579a; border-radius: 2px;
  box-shadow: 0 10px 32px rgba(0, 51, 102, 0.28);
  flex-direction: column; overflow: hidden;
}
.ref-panel.show { display: flex; }
.ref-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; background: linear-gradient(180deg,#2b579a,#1e3f73);
  color: #fff; font-size: 13px; font-weight: 700;
}
.ref-bd {
  flex: 1; overflow: auto; padding: 0;
  border-top: 1px solid #1e3f73;
}
.ref-tbl { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.ref-tbl thead th {
  background: #dbe5f1; color: #003366; border: 1px solid #b4c6e0;
  padding: 4px 6px; font-weight: 700; position: sticky; top: 0; z-index: 1;
}
.ref-tbl tbody td { border: 1px solid #d7dde5; padding: 3px 6px; }
.ref-tbl tbody tr { cursor: pointer; transition: background .1s; }
.ref-tbl tbody tr:hover { background: #eef5ff; }
.ref-tbl .sep, .ref-tbl tbody td.sep { background:#2b579a; width:4px; padding:0; border-color:#1e3f73; cursor:default; }
.ref-tbl .tc { text-align: center; }

/* ===== 단위 메모 표식 (엑셀식 빨간 삼각형) ===== */
.unit-note { cursor: pointer; position: relative; }
.unit-note:hover { background: #fff8dc; }
.unit-note.has-note::after {
  content: ''; position: absolute; top: 0; right: 0;
  width: 0; height: 0;
  border-top: 7px solid #c0392b;
  border-left: 7px solid transparent;
  pointer-events: none;
}

/* ===== TOAST ===== */
.toast {
  position: fixed; top: 16px; right: 16px; z-index: 2000;
  padding: 10px 18px; border-radius: 1px; font-size: 12px; font-weight: 500;
  box-shadow: 0 3px 10px rgba(0,0,0,.2); transform: translateX(120%);
  transition: transform .25s ease;
}
.toast.show { transform: translateX(0); }
.toast-ok { background: #27ae60; color: #fff; }
.toast-err { background: #c0392b; color: #fff; }
.toast-info { background: #2b579a; color: #fff; }

/* ===== EMPTY ===== */
.empty { text-align: center; padding: 30px; color: #aaa; font-size: 12px; }

/* ===== 물품코드 뱃지 ===== */
.pcode {
  display: inline-block;
  padding: 1px 7px;
  margin-right: 4px;
  background: #eef3fb;
  color: #1d3b6a;
  border: 1px solid #c2d0e8;
  border-radius: 3px;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1.1px;
  vertical-align: 1px;
  line-height: 1.35;
  white-space: nowrap;
}
tr:hover .pcode { background: #dde8f7; }

/* ===== PRINT ===== */
@media print {
  .top-header, .filter-area, .page-title-actions, .pag-bar { display: none !important; }
  .tbl-wrap { border: 1px solid #333; margin: 0; overflow: visible; }
  .tbl thead th { background: #ddd !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { font-size: 10px; }
}

/* ===== 복사 아이콘 (품번 셀 hover 시 표시) ===== */
.copy-ico { opacity: 0; transition: opacity 0.12s ease; }
td:hover > .copy-ico,
td:hover .copy-ico { opacity: 0.75; }

/* ===== 메모 모달 헤더 · 품번 복사 칩 =====
   클릭 시 copyCodeCell 이 클립보드에 복사 · 호버 시 배경 강조 */
.copy-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 10px;
  background: #eaf1fb;
  border: 1px solid #c7d5ea;
  font-size: 11px;
  color: #2b579a;
  font-weight: 600;
  letter-spacing: 0.2px;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.08s ease;
  user-select: none;
}
.copy-chip:hover {
  background: #d8e4f5;
  border-color: #8faedc;
}
.copy-chip:active { transform: scale(0.97); }
.copy-chip::before {
  content: '📋';
  font-size: 10px;
  margin-right: 3px;
  opacity: 0.55;
}
.copy-chip:hover::before { opacity: 0.9; }


/* ===== COLUMN RESIZE HANDLE (all .tbl tables) =====
   기본은 완전 투명 · th 혹은 핸들 자체에 커서를 올리면 파란 세로 띠 노출
   모든 컬럼에서 동작하도록 th 전체 높이 · 우측 10px 영역을 히트박스로 설정 */
table.tbl thead > tr > th { position: relative; }
table.tbl thead > tr > th .col-resizer {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 10px;
  cursor: col-resize;
  background: transparent;
  opacity: 0;
  transition: opacity 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
  z-index: 5;
  user-select: none;
}
table.tbl thead > tr > th:hover .col-resizer,
table.tbl thead > tr > th .col-resizer:hover,
table.tbl thead > tr > th .col-resizer:active {
  opacity: 1;
  background: rgba(43, 87, 154, 0.14);
  box-shadow: inset -2px 0 0 #2b579a;
}

/* ===== FREEZE PANE (sticky thead) 강화 =====
   엑셀 "틀고정"처럼 스크롤해도 헤더행이 항상 보이도록:
   1) thead 에 position:sticky 적용 (기본 규칙과 병합)
   2) flex:none 로 .tbl-wrap 이 자체 스크롤이 아닐 때는 overflow:visible 로 전환해,
      sticky 앵커가 상위 스크롤러(.content-body)로 bubble 되도록 함
      (max-height 가 inline 으로 지정된 경우는 그대로 내부 스크롤 유지) */
.tbl thead {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 4;
}
.tbl thead th {
  /* sticky 상태에서 아래쪽 셀이 비쳐 보이지 않도록 배경 고정 + 구분선 */
  background-clip: padding-box;
  box-shadow: inset 0 -1px 0 #8fa6c9;
}
.tbl-wrap[style*="flex:none"]:not([style*="max-height"]):not([style*="overflow"]) {
  overflow: visible;
}


/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: #f0f0f0; }
::-webkit-scrollbar-thumb { background: #b0b0b0; border-radius: 1px; }
::-webkit-scrollbar-thumb:hover { background: #888; }
