* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100vh; overflow: hidden; }
body { font-family: "Microsoft JhengHei", "Noto Sans TC", sans-serif; background: #F5F6FA; color: #2D3436; }

/* ========== Login ========== */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #2D3436 0%, #6C5CE7 100%); }
.login-box { background: #fff; border-radius: 16px; padding: 48px 40px; width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); text-align: center; }
.login-box h1 { font-size: 28px; color: #6C5CE7; margin-bottom: 4px; }
.login-subtitle { font-size: 14px; color: #b2bec3; margin-bottom: 32px; }
.login-box input { width: 100%; padding: 12px 16px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; margin-bottom: 16px; outline: none; }
.login-box input:focus { border-color: #6C5CE7; }
.btn-login { width: 100%; padding: 12px; background: #6C5CE7; color: #fff; border: none; border-radius: 8px; font-size: 16px; cursor: pointer; }
.btn-login:hover { background: #5A4BD1; }
.login-error { color: #D63031; font-size: 13px; margin-top: 12px; min-height: 20px; }

/* ========== Navbar ========== */
.navbar { background: #2D3436; color: #fff; height: 50px; display: flex; align-items: center; padding: 0 24px; position: sticky; top: 0; z-index: 100; }
.navbar .logo { font-size: 18px; font-weight: bold; color: #6C5CE7; }
.navbar .nav-items { display: flex; gap: 28px; margin-left: 40px; }
.navbar .nav-items a { color: #b2bec3; text-decoration: none; font-size: 14px; padding: 14px 0; }
.navbar .nav-items a.active { color: #fff; border-bottom: 2px solid #6C5CE7; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.last-update { font-size: 12px; color: #636e72; }
.refresh-btn { background: none; border: none; color: #6C5CE7; font-size: 16px; cursor: pointer; padding: 4px; }
.refresh-btn:hover { opacity: 0.7; }
.user-info { font-size: 13px; color: #b2bec3; }
.btn-logout { background: none; border: 1px solid #636e72; color: #b2bec3; padding: 4px 12px; border-radius: 4px; font-size: 12px; cursor: pointer; }
.btn-logout:hover { border-color: #6C5CE7; color: #6C5CE7; }

/* ========== Layout ========== */
.main { display: flex; height: calc(100vh - 50px); }

/* ========== Sidebar ========== */
.sidebar { width: 200px; background: #fff; border-right: 1px solid #E8E8E8; padding: 16px 0; flex-shrink: 0; position: sticky; top: 50px; height: calc(100vh - 50px); overflow-y: auto; display: flex; flex-direction: column; }
.sidebar .section-title { font-size: 13px; color: #636e72; padding: 8px 20px; font-weight: bold; }
.sidebar .menu-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 20px; cursor: pointer; font-size: 14px; color: #2D3436; transition: all 0.15s; }
.sidebar .menu-item:hover { background: #F0EDFF; }
.sidebar .menu-item.active { background: #F0EDFF; color: #6C5CE7; font-weight: bold; border-left: 3px solid #6C5CE7; }
.sidebar .badge { background: #E8E8E8; color: #636e72; border-radius: 10px; padding: 2px 8px; font-size: 12px; min-width: 32px; text-align: center; }
.sidebar .menu-item.active .badge { background: #6C5CE7; color: #fff; }
.sidebar-bottom { margin-top: auto; padding: 10px 16px; position: sticky; bottom: 0; background: #fff; border-top: 1px solid #f0f0f0; z-index: 1; }
.sidebar-bottom .btn-add-order { width: 100%; padding: 10px; background: #6C5CE7; color: #fff; border: none; border-radius: 6px; font-size: 13px; cursor: pointer; font-weight: bold; }
.sidebar-bottom .btn-add-order:hover { background: #5A4BD1; }
.btn-add-order { width: 100%; padding: 10px; background: #6C5CE7; color: #fff; border: none; border-radius: 6px; font-size: 13px; cursor: pointer; font-weight: bold; }
.btn-add-order:hover { background: #5A4BD1; }

/* ========== Content ========== */
.content { flex: 1; padding: 20px 24px; overflow: hidden; min-width: 0; display: flex; flex-direction: column; }

/* ========== Filters ========== */
.filters { background: #fff; border-radius: 8px; padding: 16px 20px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); flex-shrink: 0; }
.filter-row { display: flex; align-items: center; margin-bottom: 10px; gap: 12px; }
.filter-row:last-child { margin-bottom: 0; }
.filter-label { font-size: 13px; color: #636e72; min-width: 80px; text-align: right; }
.filter-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-tag { padding: 4px 14px; border-radius: 4px; font-size: 13px; cursor: pointer; border: 1px solid #ddd; background: #fff; color: #636e72; transition: all 0.15s; }
.filter-tag.active { background: #6C5CE7; color: #fff; border-color: #6C5CE7; }
.filter-tag:hover { border-color: #6C5CE7; color: #6C5CE7; }
.filter-tag.active:hover { color: #fff; }

/* ========== Search ========== */
.search-bar { display: flex; align-items: flex-start; gap: 0; margin-bottom: 16px; flex-shrink: 0; }
.search-bar select { padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px 0 0 4px; font-size: 13px; border-right: none; height: 36px; outline: none; background: #fff; }
.search-bar textarea { flex: 1; padding: 8px 14px; border: 1px solid #ddd; font-size: 13px; min-height: 36px; max-height: 100px; outline: none; resize: vertical; font-family: inherit; line-height: 1.5; }
.search-bar textarea:focus { border-color: #6C5CE7; }
.search-bar textarea.expanded { min-height: 72px; }
.search-mode { padding: 8px 12px; border: 1px solid #ddd; border-left: none; font-size: 12px; color: #636e72; height: 36px; background: #fafafa; cursor: pointer; white-space: nowrap; display: flex; align-items: center; }
.search-mode:hover { color: #6C5CE7; }
.btn-search { background: #6C5CE7; color: #fff; border: none; padding: 0 20px; height: 36px; border-radius: 0 4px 4px 0; cursor: pointer; font-size: 16px; }
.btn-search:hover { background: #5A4BD1; }

/* ========== Toolbar ========== */
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }
.toolbar .actions { display: flex; gap: 8px; align-items: center; }
.btn { padding: 6px 16px; border-radius: 4px; font-size: 13px; cursor: pointer; border: 1px solid #ddd; background: #fff; }
.btn-primary { background: #6C5CE7; color: #fff; border-color: #6C5CE7; }
.btn-primary:hover { background: #5A4BD1; }
.btn-print { background: #6C5CE7; color: #fff; border-color: #6C5CE7; display: flex; align-items: center; gap: 6px; }
.btn-print:hover { background: #5A4BD1; }
.btn-print .count { background: rgba(255,255,255,0.3); padding: 1px 8px; border-radius: 10px; font-size: 12px; }
.btn-confirm-arrival { background: #00B894; color: #fff; border-color: #00B894; }
.btn-confirm-arrival:hover { background: #00A381; }
.selected-info { font-size: 13px; color: #6C5CE7; font-weight: 500; }
.pagination { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #636e72; }
.pagination .page-info { margin-right: 8px; }
.pagination button { background: #fff; border: 1px solid #ddd; padding: 4px 10px; border-radius: 4px; cursor: pointer; font-size: 12px; }
.pagination button:hover { border-color: #6C5CE7; color: #6C5CE7; }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination select { padding: 4px 8px; border: 1px solid #ddd; border-radius: 4px; font-size: 12px; }

/* ========== Table ========== */
.table-wrap { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); overflow: auto; flex: 1; min-height: 0; }
table { width: 100%; border-collapse: collapse; min-width: 1300px; }
thead th { background: #FAFAFA; padding: 12px 14px; text-align: left; font-size: 13px; color: #636e72; font-weight: 600; border-bottom: 1px solid #E8E8E8; white-space: nowrap; position: sticky; top: 0; z-index: 10; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: #6C5CE7; }
tbody td { padding: 14px; border-bottom: 1px solid #F0F0F0; font-size: 13px; vertical-align: middle; }
tbody tr:hover { background: #FAFBFF; }
tbody tr.selected { background: #F0EDFF; }

.purchase-group-row td {
  padding: 7px 12px !important;
  background: #eaf4f7;
  border-top: 3px solid #8bbdca;
  border-bottom: 1px solid #c9dfe5;
}
.purchase-group-row:hover td { background: #eaf4f7; }
.purchase-group-row.selected td { background: #dcf3eb; border-top-color: #078260; }
.purchase-group-summary { display: flex; align-items: center; gap: 10px; min-height: 28px; white-space: nowrap; }
.purchase-group-select { display: inline-flex; align-items: center; gap: 8px; color: #073f5c; font-size: 15px; cursor: pointer; }
.purchase-group-select strong { font-weight: 800; letter-spacing: .1px; }
.purchase-group-select input { width: 17px; height: 17px; accent-color: #087f63; cursor: pointer; }
.po-group-count, .po-group-qty, .po-group-filter-note {
  display: inline-flex; align-items: center; min-height: 24px; padding: 2px 9px;
  border-radius: 12px; background: #fff; color: #294b59; font-size: 13px; font-weight: 700;
}
.po-group-filter-note { color: #8a5a00; background: #fff3cf; }
.po-group-status { margin-left: auto; padding: 3px 10px; border-radius: 12px; font-size: 13px; font-weight: 800; }
.po-group-status--ready { color: #006d54; background: #d8f5ea; }
.po-group-status--done { color: #fff; background: #087f63; }
.po-group-status--warning { color: #8a4f00; background: #ffedc2; }
.purchase-child-row td:first-child { border-left: 3px solid #c9dfe5; }
.purchase-child-row.selected td:first-child { border-left-color: #078260; }
.po-sku-position { display: block; margin-top: 3px; color: #697b86; font-size: 11px; font-weight: 700; }

.shelf-cell { text-align: center; }
.shelf-locked { display: inline-flex; align-items: center; justify-content: center; gap: 6px; max-width: 100%; }
.shelf-locked strong { color: #0b5b70; font-size: 13px; white-space: nowrap; }
.shelf-locked button, .shelf-cancel {
  border: 0; background: transparent; color: #087f63; font-size: 11px; font-weight: 800;
  padding: 2px 3px; cursor: pointer; white-space: nowrap;
}
.shelf-locked button:hover, .shelf-cancel:hover { text-decoration: underline; }
.shelf-picker { display: flex; align-items: center; justify-content: center; gap: 4px; }
.shelf-picker input {
  width: 112px; min-width: 0; border: 0; border-bottom: 1px solid #9cb6c1;
  border-radius: 0; background: #f7fafb; color: #263b46; font-size: 13px;
  font-weight: 700; text-align: center; padding: 6px 3px; outline: none;
}
.shelf-picker input:focus { border-bottom: 2px solid #087f63; background: #fff; }
.shelf-picker input:disabled { color: #8a989f; cursor: wait; }
.shelf-login { border: 0; background: transparent; color: #087f63; font-size: 12px; font-weight: 800; cursor: pointer; }

.manual-status-button { padding: 8px 12px; font-size: 13px; font-weight: 800; white-space: nowrap; }
.manual-status-button--failed { color: #9b2c2c; border-color: #e6a6a6; background: #fff6f6; }
.manual-status-button--abnormal { color: #9a5a00; border-color: #e7be72; background: #fff9eb; }
.manual-status-button:hover:not(:disabled) { filter: brightness(.97); }
.manual-status-button:disabled { opacity: .45; cursor: not-allowed; }

/* Checkbox */
.cb-col { width: 40px; text-align: center; }
input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: #6C5CE7; }

/* Product info */
.product-info { display: flex; gap: 12px; align-items: center; min-width: 260px; }
.product-img-button { display: block; flex: 0 0 auto; padding: 0; border: 0; border-radius: 6px; background: transparent; cursor: zoom-in; }
.product-img-button:focus-visible { outline: 3px solid rgba(0,95,153,.28); outline-offset: 2px; }
.product-img { display: block; width: 56px; height: 56px; border-radius: 6px; object-fit: cover; border: 1px solid #eee; background: #f5f5f5; cursor: zoom-in; }
.product-img-placeholder { width: 56px; height: 56px; border-radius: 6px; background: #f0f0f0; display: flex; align-items: center; justify-content: center; color: #ccc; font-size: 10px; flex-shrink: 0; }
.product-detail { flex: 1; min-width: 0; }
.product-sku { font-size: 13px; font-weight: bold; color: #2D3436; margin-bottom: 2px; }
/* 名稱全部展開：拿掉 ellipsis/nowrap/max-width，太長往下換行不截斷 */
.product-name { font-size: 12px; color: #636e72; margin-bottom: 2px; white-space: normal; word-break: break-word; }
.product-spec { font-size: 11px; color: #b2bec3; }
.product-qty { font-size: 11px; color: #6C5CE7; margin-top: 2px; }

/* Tags */
.tag { display: inline-block; padding: 2px 10px; border-radius: 3px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.tag-arrived { background: #E8F8F0; color: #00B894; }
.tag-failed { background: #FFE8E8; color: #D63031; }
.tag-pending { background: #F0F0F0; color: #999; }
.tag-inspect { background: #FFF3E0; color: #E17055; }
.tag-ok { background: #E8F8F0; color: #00B894; }
.tag-abnormal { background: #FFE8E8; color: #D63031; cursor: help; }
.tag-label { background: #E8F0FF; color: #0984E3; }
.tag-shipping { background: #FFF3CD; color: #856404; }
.tag-receiving { background: #D1ECF1; color: #0C5460; }
.tag-payment { background: #FFE0B2; color: #E65100; }

/* Copyable */
.copyable { cursor: pointer; color: #0984E3; }
.copyable:hover { text-decoration: underline; }

/* Tracking number - truncated */
.tracking-cell { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Remark */
.remark-cell { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: #636e72; }
.remark-cell-full { font-size: 12px; color: #636e72; white-space: normal; word-break: break-word; max-width: 360px; min-width: 200px; line-height: 1.4; }
.remark-editable { cursor: text; border-radius: 4px; transition: background .15s ease, box-shadow .15s ease; }
.remark-editable:hover { background: #F7F5FF; box-shadow: inset 0 0 0 1px #D8D2FF; }
.remark-editing { background: #fff; box-shadow: inset 0 0 0 1px #6C5CE7; }
.remark-saving { opacity: .7; }
.remark-edit-input {
  width: 100%;
  min-height: 72px;
  padding: 6px 8px;
  border: 0;
  border-radius: 4px;
  background: #fff;
  color: #2d3436;
  font-size: 12px;
  line-height: 1.45;
  resize: vertical;
  outline: none;
}
.muted-text { color: #b2bec3; }
.tag-measure { background: #FFEAA7; color: #856404; border: 1px solid #F9CA24; }

/* Time */
.time-cell { font-size: 12px; color: #999; white-space: nowrap; }

/* Editable box qty */
.box-qty-input { width: 60px; padding: 2px 6px; border: 1px solid #ddd; border-radius: 4px; font-size: 13px; text-align: center; outline: none; }
.box-qty-input:focus { border-color: #6C5CE7; }
.box-qty-input:hover { border-color: #b2bec3; }
/* 2026-05-25: 拿掉數量欄(實際到貨/箱裝數)的上下調整三角,直接填數字 */
.box-qty-input::-webkit-inner-spin-button,
.box-qty-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.box-qty-input { -moz-appearance: textfield; appearance: textfield; }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; color: #b2bec3; font-size: 14px; }

/* ========== Modals ========== */
.modal-overlay { display: none; position: fixed; inset: 0; width: 100%; height: 100%; background: rgba(12,18,28,.72); z-index: 1000; align-items: center; justify-content: center; }
.modal-overlay.show { display: flex; }
.image-preview-overlay { padding: 24px; z-index: 1400; box-sizing: border-box; cursor: zoom-out; }
.image-modal { position: relative; display: grid; max-width: 92vw; max-height: 90vh; place-items: center; cursor: default; }
.image-modal img { display: block; max-width: 88vw; max-height: 84vh; border-radius: 10px; background: #fff; object-fit: contain; box-shadow: 0 18px 60px rgba(0,0,0,.42); }
.image-modal-close { position: absolute; top: -15px; right: -15px; z-index: 1; display: grid; width: 36px; height: 36px; place-items: center; padding: 0; border-radius: 50%; color: #172033; background: #fff; border: none; font-size: 24px; font-weight: 800; line-height: 1; cursor: pointer; box-shadow: 0 3px 12px rgba(0,0,0,.28); }
.image-modal-close:hover { color: #fff; background: var(--sj-blue); }
body.image-preview-open { overflow: hidden; }

.tracking-status-overlay { padding: 20px; z-index: 1450; box-sizing: border-box; }
.tracking-status-card {
  position: relative;
  width: min(520px, calc(100vw - 40px));
  padding: 24px;
  border-radius: 14px;
  color: var(--sj-ink);
  background: #fff;
  box-shadow: 0 20px 70px rgba(0,0,0,.38);
}
.tracking-status-close {
  position: absolute;
  top: -14px;
  right: -14px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #172033;
  background: #fff;
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0,0,0,.28);
}
.tracking-status-kicker { color: var(--sj-orange); font-size: 11px; font-weight: 900; letter-spacing: .12em; }
.tracking-status-card h2 { margin: 4px 0 12px; color: var(--sj-blue-deep); font-size: 22px; }
.tracking-status-number { padding: 0; border: 0; color: var(--sj-blue); background: transparent; font: inherit; font-size: 18px; font-weight: 850; cursor: copy; }
.tracking-status-value { display: block; margin: 18px 0 8px; color: #08775f; font-size: 20px; }
.tracking-status-remark { min-height: 48px; margin: 0; padding: 12px 14px; border-radius: 9px; color: #33485e; background: #f3f7fa; font-size: 14px; line-height: 1.7; }
.tracking-status-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0 0; }
.tracking-status-meta div { padding: 9px 11px; border-radius: 8px; background: #f8fafb; }
.tracking-status-meta dt { color: #728093; font-size: 11px; }
.tracking-status-meta dd { margin: 3px 0 0; color: #2b3d52; font-size: 13px; font-weight: 700; word-break: break-all; }
body.tracking-status-open { overflow: hidden; }

@media (max-width: 520px) {
  .tracking-status-meta { grid-template-columns: 1fr; }
}

.modal { background: #fff; border-radius: 12px; padding: 24px; width: 480px; max-height: 80vh; overflow-y: auto; box-shadow: 0 8px 30px rgba(0,0,0,0.15); }
.modal-lg { width: 600px; }
.modal h3 { font-size: 16px; margin-bottom: 16px; color: #2D3436; }
.modal .file-list { background: #F5F6FA; border-radius: 6px; padding: 12px 16px; margin-bottom: 20px; max-height: 300px; overflow-y: auto; }
.modal .file-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; color: #2D3436; border-bottom: 1px solid #E8E8E8; }
.modal .file-item:last-child { border-bottom: none; }
.modal .file-item .check { color: #6C5CE7; }
.modal .modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.modal .btn-cancel { padding: 8px 24px; border: 1px solid #ddd; background: #fff; border-radius: 6px; cursor: pointer; font-size: 14px; }
.modal .btn-confirm { padding: 8px 24px; background: #6C5CE7; color: #fff; border: none; border-radius: 6px; cursor: pointer; font-size: 14px; }
.modal .btn-confirm:hover { background: #5A4BD1; }

/* Form */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group.full-width { grid-column: 1 / -1; }
.form-group label { font-size: 12px; color: #636e72; font-weight: 600; }
.form-group input, .form-group select, .form-group textarea { padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; outline: none; font-family: inherit; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: #6C5CE7; }

/* ========== Toast ========== */
.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: #2D3436; color: #fff; padding: 10px 24px; border-radius: 8px; font-size: 13px; opacity: 0; transition: opacity 0.3s; pointer-events: none; z-index: 2000; }
.toast.show { opacity: 1; }

/* Sync Status */
.sync-status {
  margin-top: 10px;
  border-radius: 5px;
  font-size: 10px;
  line-height: 1.4;
  overflow: hidden;
}
.sync-status .sync-title {
  font-weight: 600;
  font-size: 10px;
  padding: 5px 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  border-radius: 5px;
}
.sync-status.has-error .sync-title {
  background: #fff5f5;
  color: #c62828;
  border: 1px solid #ffcdd2;
}
.sync-status.all-ok .sync-title {
  background: #f1f8e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}
.sync-status .sync-detail {
  padding: 4px 8px 6px;
  border: 1px solid #eee;
  border-top: none;
  border-radius: 0 0 5px 5px;
  background: #fafafa;
}
.sync-status .sync-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 0;
}
.sync-status .sync-name { color: #666; }
.sync-status .sync-badge {
  font-size: 9px;
  padding: 0 4px;
  border-radius: 2px;
  white-space: nowrap;
}
.sync-status .sync-badge.ok { background: #e8f5e9; color: #2e7d32; }
.sync-status .sync-badge.warn { background: #fff3e0; color: #e65100; }
.sync-status .sync-badge.error { background: #ffebee; color: #c62828; }
.sync-status .sync-badge.idle { background: #f5f5f5; color: #aaa; }
.sync-status .sync-errs {
  display: none;
  padding: 2px 0 2px 8px;
}
.sync-status .sync-errs.open { display: block; }
.sync-status .sync-err {
  font-size: 9px;
  color: #b71c1c;
  line-height: 1.3;
  word-break: break-all;
  padding: 1px 0;
}
.sync-status .sync-row.clickable { cursor: pointer; }
.sync-status .sync-row.clickable:hover .sync-name { color: #333; }
.sync-status .sync-hint {
  font-size: 9px;
  padding: 2px 5px;
  margin: 2px 0;
  border-radius: 2px;
  line-height: 1.4;
  word-break: break-all;
  color: #1565c0;
  background: #e3f2fd;
}
.sync-status .sync-hint.recovered {
  color: #2e7d32;
  background: #e8f5e9;
}
.sync-status .sync-hint.retry {
  color: #e65100;
  background: #fff3e0;
}
.sync-status .sync-sep {
  border-top: 1px solid #f0f0f0;
  margin: 2px 0;
}
.sync-status .sync-time {
  font-size: 9px;
  color: #bbb;
  text-align: right;
  padding-top: 3px;
}

/* PO Match */
.btn-match { padding: 6px 12px; background: #6C5CE7; color: #fff; border: none; border-radius: 4px; cursor: pointer; font-size: 12px; white-space: nowrap; }
.btn-match:hover { background: #5A4BD1; }
.btn-match:disabled { background: #ccc; cursor: not-allowed; }
#matchResult { margin-top: 6px; font-size: 12px; }
#matchResult .match-info { color: #2e7d32; padding: 4px 0; }
#matchResult .match-err { color: #c62828; padding: 4px 0; }
#matchResult .match-list { max-height: 200px; overflow-y: auto; }
#matchResult .match-item { display: flex; justify-content: space-between; align-items: center; padding: 5px 8px; border: 1px solid #eee; border-radius: 4px; margin: 3px 0; cursor: pointer; font-size: 11px; }
#matchResult .match-item:hover { background: #F0EDFF; border-color: #6C5CE7; }
#matchResult .match-item .sku-code { font-weight: 600; color: #333; }
#matchResult .match-item .sku-name { color: #666; flex: 1; margin: 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#matchResult .match-item .sku-qty { color: #6C5CE7; white-space: nowrap; }

/* ========== Task 3.7: Inspection 三態 tag ==========*/
.tag-new-product { background:#F3E8FF; color:#7C3AED; border:1px solid #DDD6FE; }
.tag-inspect-urgent { background:#FEE2E2; color:#DC2626; border:1px solid #FECACA; font-weight:600; }
tr.needs-report { background:#FFF5F5 !important; }
tr.needs-report:hover { background:#FEE2E2 !important; }
.report-icon { cursor:pointer; margin-left:4px; font-size:14px; }

/* ========== Task 4.2: PO 彈窗 + 多物流單號 Modal ==========*/
/* Note: .modal-overlay base styles already defined above; new modals use inline style for display */
.modal-content { background:#fff; border-radius:8px; max-height:80vh; overflow-y:auto; box-shadow:0 4px 24px rgba(0,0,0,0.15); }
.modal-wide { width:90vw; max-width:1200px; }
.modal-small { width:400px; max-width:90vw; }
.modal-header { display:flex; justify-content:space-between; align-items:center; padding:16px 20px; border-bottom:1px solid #eee; }
.modal-header h3 { margin:0; font-size:16px; }
.modal-close { font-size:24px; cursor:pointer; color:#999; }
.modal-close:hover { color:#333; }
.modal-body { padding:16px 20px; }
.po-link { color:#6C5CE7; cursor:pointer; text-decoration:underline; }
.po-link:hover { color:#5A4BD1; }
.po-detail-table { width:100%; border-collapse:collapse; font-size:13px; }
.po-detail-table th, .po-detail-table td { padding:8px; border-bottom:1px solid #eee; text-align:left; }
.po-detail-table th { background:#F8F9FA; font-weight:600; }
.add-tracking-btn { display:inline-block; width:20px; height:20px; line-height:20px; text-align:center; background:#F0EDFF; color:#6C5CE7; border-radius:4px; cursor:pointer; font-weight:bold; margin-left:4px; }
.add-tracking-btn:hover { background:#6C5CE7; color:#fff; }
/* 編輯版單號：覆蓋 .tracking-cell 的 ellipsis/overflow/max-width，每個單號整條不換行、❌ 永遠明顯固定可見，欄位自動加寬容納整條+❌ */
.tracking-cell-editable { display:flex; align-items:center; gap:4px; max-width:none; overflow:visible; white-space:nowrap; }
.tracking-cell-editable .copyable { overflow:visible; text-overflow:clip; white-space:nowrap; }
.remove-tracking-btn { flex:0 0 auto; display:inline-block; width:16px; height:16px; line-height:14px; text-align:center; background:#FFF0F0; color:#E53935; border-radius:50%; cursor:pointer; font-size:12px; font-weight:bold; opacity:1; }
.tracking-cell-editable:hover .remove-tracking-btn { opacity:1; }
.remove-tracking-btn:hover { background:#E53935; color:#fff; }
.manual-sync-badge { display:inline-block; margin-top:6px; padding:2px 6px; border-radius:4px; background:#FFF4D6; color:#8A5A00; font-size:11px; line-height:1.4; white-space:nowrap; }
.manual-sync-unlock { display:inline-block; margin-top:4px; padding:2px 6px; border:1px solid #0984E3; border-radius:4px; background:#fff; color:#0984E3; font-size:11px; line-height:1.4; cursor:pointer; white-space:nowrap; }
.manual-sync-unlock:hover { background:#EBF5FB; }

/* ========== Task 6.2: 驗貨回報 Modal ==========*/
.report-modal { width:500px; max-width:95vw; }
.report-info { background:#F8F9FA; padding:12px; border-radius:6px; margin-bottom:16px; font-size:13px; }
.report-info strong { display:block; font-size:15px; margin-bottom:4px; }
.report-section { margin-bottom:16px; }
.report-section label { display:block; font-weight:600; margin-bottom:6px; font-size:13px; color:#555; }
.report-photos { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-bottom:8px; }
.report-photo-item { position:relative; aspect-ratio:1; border-radius:6px; overflow:hidden; border:1px solid #eee; }
.report-photo-item img { width:100%; height:100%; object-fit:cover; }
.report-photo-item .remove-photo { position:absolute; top:2px; right:2px; background:rgba(0,0,0,0.5); color:#fff; width:20px; height:20px; border-radius:50%; text-align:center; line-height:20px; cursor:pointer; font-size:12px; }
.report-add-photo { display:block; padding:12px; text-align:center; border:2px dashed #DDD; border-radius:6px; cursor:pointer; color:#6C5CE7; font-weight:600; }
.report-add-photo:hover { border-color:#6C5CE7; background:#F8F7FF; }
.report-textarea { width:100%; padding:10px; border:1px solid #DDD; border-radius:6px; font-size:14px; resize:vertical; font-family:inherit; box-sizing:border-box; }
.report-error { color:#DC2626; font-size:13px; margin-bottom:12px; }
.report-submit { width:100%; padding:12px; font-size:15px; font-weight:600; background:#6C5CE7; color:#fff; border:none; border-radius:6px; cursor:pointer; }
.report-submit:hover { background:#5A4BD1; }
.report-submit:disabled { background:#CCC; cursor:not-allowed; }
@media (max-width:768px) {
  .report-modal { width:95vw; }
  .report-photos { grid-template-columns:repeat(2,1fr); }
  .report-textarea { font-size:16px; }
  .report-submit { height:48px; font-size:16px; }
  .report-add-photo { padding:16px; font-size:16px; }
}
/* v6.0: Report toggle */
.toggle-label { font-size:12px; color:#666; margin-right:4px; }
.toggle-btn { display:inline-block; padding:2px 10px; border-radius:12px; font-size:12px; font-weight:600; cursor:pointer; user-select:none; }
.toggle-on { background:#10B981; color:#fff; }
.toggle-off { background:#EF4444; color:#fff; }
.toggle-btn:hover { opacity:0.85; }

/* ===== Shipping Report + Manual Tracking (2026-04-24) ===== */
th.extra-col { text-align: right; font-size: 13px; }
#sr_summary b { color: #0984E3; font-size: 14px; }
#manualTrackingModal.show { display: flex !important; }
#manualTrackingModal .form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
}
#manualTrackingModal .btn-confirm:hover { background: #00a383 !important; }
#shippingReportContent thead th {
  background: #f1f3f5;
  font-weight: 600;
  font-size: 13px;
}
#shippingReportContent tbody tr:hover { background: #f8f9fa; }

.tag-sea { background: #E0F4FF; color: #0277BD; }
.tag-container { background: #FFF3E0; color: #E65100; }
.tag-express { background: #E8F8F0; color: #00B894; }
.tag-bs { background: #F0F0F0; color: #636e72; }
.tag-manual { background: #FFE0B2; color: #E65100; }

#shippingReportContent table {
  table-layout: fixed;
  width: 100%;
  min-width: unset !important;
}
#shippingReportContent th, #shippingReportContent td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 14 欄：華通月/採購月/物流/新竹/採購單/負責/運送/來源/重量/運費/狀態/地址/品名/數量 */
#shippingReportContent th:nth-child(1), #shippingReportContent td:nth-child(1)  { width: 100px; }
#shippingReportContent th:nth-child(2), #shippingReportContent td:nth-child(2)  { width: 100px; }
#shippingReportContent th:nth-child(3), #shippingReportContent td:nth-child(3)  { width: 150px; white-space: normal; word-break: break-all; }
#shippingReportContent th:nth-child(4), #shippingReportContent td:nth-child(4)  { width: 120px; white-space: normal; word-break: break-all; }
#shippingReportContent th:nth-child(5), #shippingReportContent td:nth-child(5)  { width: 130px; }
#shippingReportContent th:nth-child(6), #shippingReportContent td:nth-child(6)  { width: 70px; }
#shippingReportContent th:nth-child(7), #shippingReportContent td:nth-child(7)  { width: 75px; }
#shippingReportContent th:nth-child(8), #shippingReportContent td:nth-child(8)  { width: 60px; }
#shippingReportContent th:nth-child(9), #shippingReportContent td:nth-child(9)  { width: 75px; }
#shippingReportContent th:nth-child(10), #shippingReportContent td:nth-child(10) { width: 85px; }
#shippingReportContent th:nth-child(11), #shippingReportContent td:nth-child(11) { width: 170px; white-space: normal; word-break: break-all; }
#shippingReportContent th:nth-child(12), #shippingReportContent td:nth-child(12) { width: 200px; white-space: normal; word-break: break-all; }
#shippingReportContent th:nth-child(13), #shippingReportContent td:nth-child(13) { width: 130px; }
#shippingReportContent th:nth-child(14), #shippingReportContent td:nth-child(14) { width: 55px; }
#shippingReportContent tbody td { padding: 10px 8px; }
#shippingReportContent thead th { padding: 10px 8px; }

/* ===== Shipping Report 15 欄寬 v3 (加 SKU 欄, 2026-04-25) ===== */
/* 華通月/採購月/物流/新竹/採購單/負責/運送/來源/重量/運費/狀態/地址/SKU/品名/數量 */
#shippingReportContent th:nth-child(13), #shippingReportContent td:nth-child(13) { width: 110px; white-space: nowrap; font-weight: 600; }
#shippingReportContent th:nth-child(14), #shippingReportContent td:nth-child(14) { width: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#shippingReportContent th:nth-child(15), #shippingReportContent td:nth-child(15) { width: 55px; }
.time-cell { font-size: 12px; max-width: 90px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #636e72; }

/* ===== 聖捷｜海門倉唯讀版 2026-08-31 ===== */
:root {
  --sj-ink: #14213d;
  --sj-blue: #005f99;
  --sj-blue-deep: #003f68;
  --sj-cyan: #d8f3f6;
  --sj-orange: #f4a261;
  --sj-paper: #f4f1ea;
  --sj-line: #d7dde3;
}

body[data-mode="guarded"] {
  background:
    linear-gradient(rgba(20, 33, 61, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 33, 61, .035) 1px, transparent 1px),
    var(--sj-paper);
  background-size: 26px 26px;
  color: var(--sj-ink);
  font-family: "Avenir Next", "PingFang TC", "Noto Sans TC", sans-serif;
}

.shengjie-navbar {
  background: var(--sj-ink);
  border-bottom: 4px solid var(--sj-orange);
  box-shadow: 0 8px 28px rgba(20, 33, 61, .2);
}

.shengjie-logo {
  min-width: 92px;
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .18em;
}

.shengjie-navbar .nav-items a { color: rgba(255, 255, 255, .68); }
.shengjie-navbar .nav-items a:hover,
.shengjie-navbar .nav-items a.active {
  color: #fff;
  background: rgba(216, 243, 246, .12);
  box-shadow: inset 0 -3px 0 var(--sj-orange);
}

.warehouse-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(216, 243, 246, .45);
  border-radius: 999px;
  color: var(--sj-cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
}

.shengjie-navbar .last-update,
.shengjie-navbar .user-info { color: rgba(255, 255, 255, .72); }

.shengjie-intro__eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--sj-orange);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.section-title--spaced { margin-top: 14px; }

body[data-mode="guarded"] .sidebar .menu-item {
  width: 100%;
  border: 0;
  font: inherit;
  text-align: left;
}

body[data-mode="guarded"] .sidebar .menu-item.active {
  color: var(--sj-blue-deep);
  background: var(--sj-cyan);
  border-left-color: var(--sj-orange);
}

.shengjie-content { padding-top: 20px; }
.shengjie-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
  padding: 22px 24px;
  background: #fff;
  border: 1px solid var(--sj-line);
  border-left: 8px solid var(--sj-blue);
  border-radius: 4px 16px 4px 4px;
  box-shadow: 0 12px 32px rgba(20, 33, 61, .08);
}

.shengjie-intro h1 { margin: 0; font-size: clamp(24px, 3vw, 38px); letter-spacing: .06em; }
.shengjie-intro p { margin: 7px 0 0; color: #5c677d; }
.readonly-seal {
  width: 104px;
  height: 76px;
  flex: 0 0 auto;
  display: grid;
  place-content: center;
  text-align: center;
  border: 2px solid var(--sj-orange);
  color: var(--sj-blue-deep);
  transform: rotate(-2deg);
  background: #fffaf2;
}
.readonly-seal span { font-size: 9px; font-weight: 900; letter-spacing: .18em; }
.readonly-seal strong { display: block; margin-top: 3px; font-size: 18px; }

.shengjie-filters,
.shengjie-search,
.shengjie-toolbar { border-color: var(--sj-line); box-shadow: none; }

.shengjie-search input[type="search"] {
  flex: 1;
  min-width: 220px;
  padding: 10px 12px;
  border: 1px solid var(--sj-line);
  border-radius: 5px;
  color: var(--sj-ink);
  background: #fff;
  font: inherit;
}

body[data-mode="guarded"] .filter-tag {
  border: 1px solid var(--sj-line);
  background: #fff;
  font: inherit;
}
body[data-mode="guarded"] .filter-tag.active {
  color: #fff;
  background: var(--sj-blue);
  border-color: var(--sj-blue);
}

body[data-mode="guarded"] .btn-primary,
body[data-mode="guarded"] .btn-search { background: var(--sj-blue); border-color: var(--sj-blue); }

body[data-mode="guarded"] .table-wrap {
  border: 1px solid var(--sj-line);
  border-radius: 4px 12px 4px 4px;
  box-shadow: 0 12px 30px rgba(20, 33, 61, .07);
}
body[data-mode="guarded"] thead th { background: #eaf2f6; color: var(--sj-blue-deep); }
body[data-mode="guarded"] tbody tr:hover { background: #f3fbfc; }

.number-cell { text-align: right; font-variant-numeric: tabular-nums; }
.po-number { font-weight: 800; color: var(--sj-blue-deep); white-space: nowrap; }
.tracking-copy {
  display: block;
  max-width: 155px;
  margin: 2px 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  color: var(--sj-blue);
  background: transparent;
  font: inherit;
  font-size: 12px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.tracking-status-trigger:hover { color: var(--sj-blue-deep); text-decoration: underline; text-underline-offset: 3px; }
.remark-readonly { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logistics-readonly { min-width: 150px; }
.logistics-readonly strong { display: block; font-size: 12px; }
.logistics-readonly small { display: block; margin-top: 4px; color: #7c8798; }
.muted { color: #a3acb8; }
.load-error {
  margin-top: 14px;
  padding: 14px 16px;
  border-left: 4px solid #d62828;
  background: #fff1f0;
  color: #9d1717;
  font-weight: 700;
}

@media (max-width: 980px) {
  .warehouse-chip { display: none; }
  .shengjie-intro { align-items: flex-start; }
}

@media (max-width: 720px) {
  .shengjie-navbar { flex-wrap: wrap; height: auto; }
  .shengjie-navbar .nav-right { width: 100%; justify-content: flex-end; }
  .shengjie-intro { padding: 18px; }
  .readonly-seal { display: none; }
}

/* ===== List-first operations layout 2026-09-01 ===== */
.shengjie-navbar {
  height: 50px;
  padding: 0 16px;
  border-bottom-width: 3px;
  box-shadow: 0 4px 16px rgba(20, 33, 61, .18);
  box-sizing: border-box;
}

.shengjie-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #fff;
  white-space: nowrap;
}

.shengjie-brand__mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px 3px 8px 3px;
  color: var(--sj-ink);
  background: var(--sj-orange);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .08em;
}

.shengjie-brand__name { font-size: 16px; font-weight: 900; letter-spacing: .12em; }
.shengjie-brand__divider { width: 1px; height: 18px; background: rgba(255,255,255,.24); }
.shengjie-brand strong { color: var(--sj-cyan); font-size: 13px; letter-spacing: .05em; }

.shengjie-navbar .nav-right { gap: 8px; }
.shengjie-navbar .refresh-btn {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  border-radius: 7px;
  color: #fff;
  background: rgba(255,255,255,.08);
}
.shengjie-navbar .user-info {
  padding: 4px 8px;
  border-radius: 999px;
  color: rgba(255,255,255,.72);
  background: rgba(255,255,255,.07);
  font-size: 11px;
}

body[data-mode="guarded"] .sidebar {
  width: 168px;
  padding: 8px 0;
}

body[data-mode="guarded"] .sidebar .section-title { padding: 6px 14px; font-size: 13px; }
body[data-mode="guarded"] .sidebar .menu-item { padding: 8px 14px; font-size: 15px; }
body[data-mode="guarded"] .sidebar .badge { min-width: 28px; padding: 2px 7px; font-size: 13px; }

.shengjie-content { padding: 8px 10px 10px; }

.ops-row {
  position: relative;
  z-index: 10;
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  padding: 6px 8px;
  border: 1px solid var(--sj-line);
  border-radius: 9px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 3px 12px rgba(20,33,61,.06);
  box-sizing: border-box;
}

.status-segments {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 2px;
  padding: 3px;
  border-radius: 8px;
  background: #edf2f5;
}
.status-segments button {
  height: 30px;
  padding: 0 11px;
  border: 0;
  border-radius: 6px;
  color: #647184;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.status-segments button:hover { color: var(--sj-blue-deep); }
.status-segments button.active {
  color: #fff;
  background: var(--sj-blue);
  box-shadow: 0 2px 7px rgba(0,95,153,.2);
}
.inbound-main-button {
  min-width: 96px;
  height: 36px;
  border: 1px solid #08775f;
  border-radius: 7px;
  color: #fff;
  background: #08775f;
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
}
.inbound-main-button:hover:not(:disabled) { background: #05634f; }
.inbound-main-button:disabled { border-color: #cbd5df; color: #8a96a6; background: #eef2f5; cursor: not-allowed; }

.compact-search {
  display: flex;
  height: 36px;
  min-width: 180px;
  flex: 1 1 380px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--sj-line);
  border-radius: 7px;
  background: #fff;
}
.compact-search > span { color: #8a96a6; font-size: 18px; line-height: 1; }
.compact-search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--sj-ink);
  background: transparent;
  font: inherit;
  font-size: 13px;
}

.compact-filter-panel { position: relative; flex: 0 0 auto; }
.compact-filter-panel summary {
  display: grid;
  height: 34px;
  padding: 0 12px;
  place-items: center;
  border: 1px solid var(--sj-line);
  border-radius: 7px;
  color: var(--sj-blue-deep);
  background: #fff;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  list-style: none;
}
.compact-filter-panel summary::-webkit-details-marker { display: none; }
.compact-filter-panel[open] summary { color: #fff; background: var(--sj-blue); border-color: var(--sj-blue); }
.filter-popover.filters {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(720px, calc(100vw - 210px));
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--sj-line);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(20,33,61,.18);
}
.filter-popover .filter-row { margin-bottom: 7px; gap: 8px; }
.filter-popover .filter-label { min-width: 64px; font-size: 11px; }
.filter-popover .filter-tag { padding: 4px 9px; font-size: 11px; }

.ops-row > .btn-primary {
  height: 34px;
  padding: 0 12px;
  white-space: nowrap;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 750;
}
.ops-row .selected-info { min-width: 42px; color: #5d6a7a; font-size: 12px; white-space: nowrap; }
.ops-row .pagination { margin-left: 0; white-space: nowrap; }
.ops-row .pagination button { width: 28px; height: 28px; }

body[data-mode="guarded"] .table-wrap {
  flex: 1;
  border-radius: 9px 9px 4px 4px;
  box-shadow: 0 5px 18px rgba(20,33,61,.06);
}
body[data-mode="guarded"] thead th { padding-top: 8px; padding-bottom: 8px; }
body[data-mode="guarded"] tbody td { padding-top: 7px; padding-bottom: 7px; }
body[data-mode="guarded"] th[data-column-header="product"] { font-size: 15px; }
body[data-mode="guarded"] .product-sku { font-size: 15px; }
body[data-mode="guarded"] .product-name { font-size: 14px; line-height: 1.45; }
body[data-mode="guarded"] .product-qty { font-size: 13px; }

.direct-source-badge {
  display: inline-flex;
  margin-left: 5px;
  padding: 1px 5px;
  border: 1px solid #f3b36d;
  border-radius: 999px;
  color: #a94f00;
  background: #fff3df;
  font-size: 11px;
  font-weight: 850;
  vertical-align: 1px;
}

@media (max-width: 900px) {
  .shengjie-navbar .last-update { display: none; }
  .ops-row { flex-wrap: wrap; height: auto; }
  .compact-search { order: 5; flex-basis: 100%; }
  .filter-popover.filters { right: -90px; width: min(640px, calc(100vw - 24px)); }
}

@media (max-width: 640px) {
  body[data-mode="guarded"] .sidebar { display: none; }
  .shengjie-brand__divider, .shengjie-brand strong { display: none; }
  .shengjie-content { padding: 6px; }
  .status-segments button { padding: 0 8px; }
}

/* ===== Row selection, manual arrival and BigSeller receipt 2026-09-01 ===== */
.select-col {
  width: 38px;
  min-width: 38px;
  padding-left: 9px !important;
  padding-right: 9px !important;
  text-align: center;
}
.select-col input[type="checkbox"] {
  display: block;
  width: 17px;
  height: 17px;
  margin: 0 auto;
  border: 1px solid #aeb9c6;
  border-radius: 3px;
  background: #fff;
  accent-color: var(--sj-blue);
}

.actual-qty-input {
  width: 62px;
  height: 30px;
  padding: 3px 6px;
  border: 1px solid #cbd5df;
  border-radius: 6px;
  color: var(--sj-ink);
  background: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  text-align: center;
  outline: none;
  appearance: textfield;
}
.actual-qty-input::-webkit-inner-spin-button,
.actual-qty-input::-webkit-outer-spin-button { margin: 0; appearance: none; }
.actual-qty-input:hover { border-color: #91a4b7; }
.actual-qty-input:focus {
  border-color: var(--sj-blue);
  box-shadow: 0 0 0 3px rgba(0, 95, 153, .12);
}
.arrival-inline-input {
  width: 118px;
  height: 30px;
  padding: 3px 2px;
  border: 0;
  border-radius: 0;
  color: #203247;
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 22px;
  outline: none;
  resize: none;
  overflow: hidden;
  vertical-align: middle;
}
.arrival-inline-input::placeholder {
  color: #526170;
  font-size: 13px;
  font-weight: 700;
  opacity: 1;
}
.arrival-inline-input--weight {
  width: 72px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  appearance: textfield;
  -moz-appearance: textfield;
}
.arrival-inline-input--freight {
  width: 78px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  appearance: textfield;
  -moz-appearance: textfield;
}
.arrival-inline-input--freight::-webkit-inner-spin-button,
.arrival-inline-input--freight::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
.unit-cost-value { color: #08775f; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.unit-cost-missing { color: #9aa5b2; font-size: 14px; }
.arrival-inline-input--weight::-webkit-inner-spin-button,
.arrival-inline-input--weight::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
th[data-column-header="manual_note"],
.manual-note-cell { text-align: center; }
.manual-note-cell .arrival-inline-wrap { display: flex; justify-content: center; }
.manual-note-cell .arrival-inline-input--manual_note { display: block; margin: 0 auto; text-align: center; }
.manual-note-cell .manual-note-readonly { text-align: center; }
.arrival-inline-input--locked {
  border: 0;
  color: #33485e;
  background: transparent;
  cursor: pointer;
}
.arrival-inline-input--locked:hover,
.arrival-inline-input--locked:focus {
  color: var(--sj-blue-deep);
  background: transparent;
}
.arrival-inline-input:hover { color: var(--sj-blue-deep); background: transparent; }
.arrival-inline-input:focus {
  border-bottom: 2px solid var(--sj-blue);
  background: transparent;
  box-shadow: none;
}
.arrival-inline-input.saving { color: #536579; background: transparent; cursor: wait; }

.receipt-cell { min-width: 108px; }
.inbound-status { display: inline-flex; min-width: 76px; justify-content: center; padding: 5px 8px; border-radius: 999px; font-size: 11px; font-weight: 850; white-space: nowrap; }
.inbound-status--success { color: #06644f; background: #dff7ef; }
.inbound-status--failed { color: #a51d1d; background: #ffe5e5; }
.inbound-status--uncertain { color: #8a5900; background: #fff0c9; }
.inbound-status--working { color: #075f91; background: #dff2ff; }
.inbound-status--idle { color: #6f7d8c; background: #eef2f5; }
.receipt-action {
  min-width: 82px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid #d5dde5;
  border-radius: 6px;
  color: #84909d;
  background: #f5f7f9;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.receipt-action--ready {
  border-color: #008765;
  color: #fff;
  background: #008765;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 135, 101, .2);
}
.receipt-action--ready:hover { background: #006f54; }
.receipt-action--ready:disabled { cursor: wait; opacity: .72; }
.receipt-action--done {
  border-color: #a6e0c5;
  color: #087a58;
  background: #e8f8f1;
}
.receipt-action--pending {
  border-color: #f0c98e;
  color: #8c5706;
  background: #fff6e7;
}

.column-filter-trigger {
  display: inline-grid;
  width: 18px;
  height: 18px;
  margin-left: 2px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 4px;
  color: #698093;
  background: transparent;
  font: inherit;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  vertical-align: -2px;
}
.column-filter-trigger:hover { color: var(--sj-blue); background: rgba(0, 95, 153, .1); }
.column-filter-trigger.active {
  color: #fff;
  background: var(--sj-orange);
}

.column-filter-menu {
  position: fixed;
  z-index: 500;
  width: 220px;
  padding: 10px;
  border: 1px solid #cbd5df;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(20, 33, 61, .2);
}
.column-filter-menu[hidden] { display: none; }
.column-filter-menu strong {
  display: block;
  margin-bottom: 7px;
  color: var(--sj-blue-deep);
  font-size: 12px;
}
.column-filter-menu input {
  width: 100%;
  height: 32px;
  padding: 0 9px;
  border: 1px solid #cbd5df;
  border-radius: 6px;
  outline: none;
  font: inherit;
  font-size: 12px;
}
.column-filter-menu input:focus { border-color: var(--sj-blue); }
.column-filter-menu button {
  width: 100%;
  margin-top: 7px;
  padding: 6px 8px;
  border: 0;
  border-radius: 5px;
  color: #5f6f7f;
  background: #edf2f5;
  font: inherit;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

#arrivalTable { table-layout: fixed; }
#arrivalTable thead th { overflow: visible; }
.column-resizer {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 15;
  width: 10px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  touch-action: none;
}
.column-resizer::after {
  content: '';
  position: absolute;
  top: 22%;
  bottom: 22%;
  right: 0;
  width: 1px;
  background: transparent;
}
.column-resizer:hover::after { background: var(--sj-orange); }
.arrival-inline-wrap,
.tracking-display-wrap { display: flex; min-width: 0; align-items: center; gap: 4px; }
.arrival-inline-wrap .arrival-inline-input { min-width: 0; flex: 1; }
.tracking-source-badge {
  flex: 0 0 auto;
  padding: 1px 4px;
  border-radius: 999px;
  color: #526477;
  background: #e8eef3;
  font-size: 8px;
  font-weight: 900;
  line-height: 15px;
}
.tracking-source-badge--1688 { color: #a14b00; background: #fff0d8; }
.tracking-source-badge--manual { color: #087a58; background: #e3f7ee; }
.manual-note-readonly {
  overflow: hidden;
  color: #526174;
  font-size: 11px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.manual-note-cell .arrival-inline-input--manual_note {
  height: auto;
  min-height: 64px;
  max-height: 220px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  resize: vertical;
  overflow: auto;
  line-height: 1.5;
}

/* ===== DevLog receipt authentication 2026-09-01 ===== */
.auth-user-button {
  border: 0;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.auth-user-button:hover { color: #fff; background: rgba(255,255,255,.14); }
.auth-logout-button {
  height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  color: rgba(255,255,255,.68);
  background: transparent;
  font: inherit;
  font-size: 10px;
  font-weight: 750;
  cursor: pointer;
}
.auth-logout-button:hover { color: #fff; border-color: var(--sj-orange); }
.receipt-login-required {
  border-color: #afbed0;
  color: var(--sj-blue-deep);
  background: #eef4f8;
  cursor: pointer;
}
.receipt-login-required:hover { border-color: var(--sj-blue); background: #e2f2f7; }

.devlog-login-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(7, 20, 43, .66);
  backdrop-filter: blur(5px);
}
.devlog-login-modal[hidden] { display: none; }
.devlog-login-card {
  position: relative;
  width: min(380px, calc(100vw - 28px));
  padding: 25px 26px 24px;
  border: 1px solid rgba(255,255,255,.5);
  border-top: 4px solid var(--sj-orange);
  border-radius: 4px 16px 4px 4px;
  background:
    linear-gradient(135deg, rgba(0,95,153,.055), transparent 42%),
    #fff;
  box-shadow: 0 24px 70px rgba(7,20,43,.38);
}
.devlog-login-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  color: #758395;
  background: #edf2f5;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.devlog-login-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.devlog-login-brand span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px 3px 9px 3px;
  color: var(--sj-ink);
  background: var(--sj-orange);
  font-size: 11px;
  font-weight: 950;
}
.devlog-login-brand small {
  color: var(--sj-blue);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .17em;
}
.devlog-login-card h2 { margin: 0 0 7px; color: var(--sj-ink); font-size: 21px; }
.devlog-login-card > p { margin: 0 0 18px; color: #657486; font-size: 12px; line-height: 1.6; }
.devlog-login-card form { display: grid; gap: 7px; }
.devlog-login-card label { margin-top: 4px; color: #435368; font-size: 11px; font-weight: 800; }
.devlog-login-card input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #cbd5df;
  border-radius: 7px;
  color: var(--sj-ink);
  background: #f9fbfc;
  font: inherit;
  font-size: 14px;
  outline: none;
}
.devlog-login-card input:focus { border-color: var(--sj-blue); box-shadow: 0 0 0 3px rgba(0,95,153,.12); }
.devlog-login-error {
  margin-top: 4px;
  padding: 8px 10px;
  border-left: 3px solid #d83a34;
  color: #9d211d;
  background: #fff0ef;
  font-size: 11px;
}
.devlog-login-submit {
  height: 42px;
  margin-top: 8px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: var(--sj-blue);
  box-shadow: 0 5px 14px rgba(0,95,153,.22);
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}
.devlog-login-submit:hover { background: var(--sj-blue-deep); }
.devlog-login-submit:disabled { cursor: wait; opacity: .65; }
