:root {
  --bg: #0a0d12;
  --card: rgba(17, 23, 34, 0.72);
  --ink: #e8eef8;
  --muted: #8b9bb4;
  --line: rgba(70, 90, 120, 0.35);
  --accent: #3b82f6;
  --danger: #ef4444;
  --ok: #22c55e;
  --exact: rgba(59, 130, 246, 0.22);
  --orange: #f59e0b;
  --gradient-primary: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  --gradient-accent: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  --gradient-success: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
  --glow-blue: 0 0 20px rgba(59, 130, 246, 0.35);
  --glow-orange: 0 0 20px rgba(245, 158, 11, 0.35);
  --glow-green: 0 0 16px rgba(34, 197, 94, 0.3);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --glass: rgba(17, 23, 34, 0.65);
  --glass-strong: rgba(17, 23, 34, 0.82);
  --on-accent: #ffffff;
  --shadow-focus: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background-color: #0a0d12;
  background-image:
    linear-gradient(rgba(59, 130, 246, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px),
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(59, 130, 246, 0.12), transparent 55%),
    radial-gradient(ellipse 45% 40% at 95% 95%, rgba(245, 158, 11, 0.06), transparent 50%),
    linear-gradient(165deg, #0a0d12 0%, #0d1118 48%, #0a0d12 100%);
  background-size: 40px 40px, 40px 40px, 100% 100%, 100% 100%, 100% 100%;
  background-attachment: fixed, fixed, fixed, fixed, fixed;
}
button, input, select, textarea { font: inherit; }
.hidden { display: none !important; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulseDot {
  0%, 100% { opacity: 0.45; box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.35); }
  50% { opacity: 1; box-shadow: 0 0 8px 2px rgba(59, 130, 246, 0.45); }
}
@keyframes pulseOrange {
  0%, 100% { box-shadow: 0 0 8px rgba(245, 158, 11, 0.25); }
  50% { box-shadow: 0 0 18px rgba(245, 158, 11, 0.55); }
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(420px, 100%);
  position: relative;
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  animation: fadeUp 0.35s var(--ease) both;
  overflow: hidden;
}
.login-card::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.55), transparent);
  pointer-events: none;
}
.login-card h1 {
  margin: 0 0 8px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sub, .hint, .muted { color: var(--muted); font-size: 14px; }
.login-error {
  margin: 10px 0 0;
  color: #f87171;
  font-size: 13px;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.35);
}
.pwd-field {
  position: relative;
  display: flex;
  align-items: center;
}
.pwd-field input {
  width: 100%;
  padding-right: 44px;
}
.pwd-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: var(--muted);
  box-shadow: none !important;
}
.pwd-toggle:hover { background: rgba(59, 130, 246, 0.12) !important; border-radius: 8px; color: #93c5fd; }

label { display: block; margin: 12px 0 6px; font-size: 14px; color: #b6c3d9; }
input, select, textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(10, 14, 22, 0.72);
  color: var(--ink);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.75);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2), var(--glow-blue);
  background: rgba(12, 18, 28, 0.9);
}
input::placeholder, textarea::placeholder { color: #667693; }

button {
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(40, 52, 72, 0.85);
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.25s var(--ease), filter 0.2s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease);
}
button:hover { transform: translateY(-2px); filter: brightness(1.06); }
button:active { transform: translateY(0) scale(0.97); box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.35); }
button.primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: var(--glow-blue);
}
button.primary:hover { box-shadow: 0 0 28px rgba(59, 130, 246, 0.5); }
button.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: #c5d0e2;
}
button.ghost:hover { border-color: rgba(59, 130, 246, 0.55); background: rgba(59, 130, 246, 0.08); }
button.danger {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: #fff;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.35);
}
button.ok {
  background: var(--gradient-success);
  color: #fff;
  box-shadow: var(--glow-green);
}
button.accent {
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: var(--glow-orange);
}

.sheet-page {
  min-height: 100vh;
  padding: 10px 12px 16px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.stats-compact .stat {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.18), rgba(124, 58, 237, 0.1) 50%, rgba(17, 23, 34, 0.75));
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(99, 130, 246, 0.35);
  border-radius: 12px;
  padding: 8px 10px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05), var(--glow-blue);
  animation: fadeUp 0.4s var(--ease) both;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}
.stats-compact .stat::before {
  content: "";
  position: absolute;
  left: 8%; right: 8%; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(147, 197, 253, 0.7), transparent);
  pointer-events: none;
}
.stats-compact .stat:nth-child(1) { animation-delay: 0.02s; }
.stats-compact .stat:nth-child(2) { animation-delay: 0.05s; }
.stats-compact .stat:nth-child(3) { animation-delay: 0.08s; }
.stats-compact .stat:nth-child(4) { animation-delay: 0.11s; }
.stats-compact .stat:nth-child(5) { animation-delay: 0.14s; }
.stats-compact .stat:nth-child(6) { animation-delay: 0.17s; }
.stats-compact .stat:nth-child(7) { animation-delay: 0.2s; }
.stats-compact .stat:nth-child(8) { animation-delay: 0.23s; }
.stats-compact .stat:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4), var(--glow-blue);
}
.stats-compact .stat .n {
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(135deg, #93c5fd, #60a5fa 40%, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 18px rgba(59, 130, 246, 0.25);
}
.stats-compact .stat.stat-sum {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.1);
}
.stats-compact .stat.stat-sum .n {
  background: linear-gradient(135deg, #86efac, #4ade80 40%, #22c55e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 20px;
  text-shadow: 0 0 18px rgba(34, 197, 94, 0.25);
}
.stats-compact .stat.stat-sum .l {
  font-weight: 700;
  color: #bbf7d0;
}
.stats-compact .stat .l { color: var(--muted); font-size: 12px; }
.stats-compact .stat .s { color: #7c8eab; font-size: 11px; margin-top: 2px; }

.sheet-card {
  position: relative;
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  animation: fadeUp 0.4s var(--ease) 0.08s both;
}
.sheet-card::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.5), transparent);
  pointer-events: none;
  z-index: 3;
}
.sheet-card.fill { height: 100%; }
.sheet-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: rgba(17, 23, 34, 0.6);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(70, 90, 120, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.sheet-title {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: #e8eef8;
}
.sheet-title #sheet-title-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.user-chip {
  font-weight: 500;
  font-size: 12px;
  color: #9eb0cc;
  background: rgba(17, 23, 34, 0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  box-shadow: var(--glow-blue);
}
.sheet-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.sheet-actions button, .sheet-btn { padding: 8px 10px; border-radius: 8px; }
.sheet-wrap {
  overflow: auto;
  background: rgba(10, 14, 22, 0.35);
  flex: 1;
  min-height: 0;
}
.sheet-wrap.tall { max-height: none; }
.sheet {
  width: 100%;
  border-collapse: collapse;
  min-width: 1080px;
  font-size: 13px;
  table-layout: fixed;
  color: var(--ink);
}
.compact-sheet .col-check { width: 28px; max-width: 28px; min-width: 28px; padding-left: 2px; padding-right: 2px; text-align: center; }
.compact-sheet .col-seq { width: 48px; }
.compact-sheet .col-cat { width: 56px; }
.compact-sheet .col-sup { width: 110px; }
.compact-sheet .col-model { width: 150px; }
.compact-sheet .col-qpc { width: 72px; }
.compact-sheet .col-qty { width: 88px; }
.compact-sheet .col-boxes { width: 88px; }
.compact-sheet .col-loc { width: auto; min-width: 220px; }
#dash-sheet col.dash-col-check { width: 28px; }
#dash-sheet .col-check input[type="checkbox"] { width: 15px; height: 15px; margin: 0; }
.compact-sheet td.col-sup,
.compact-sheet th.col-sup,
.compact-sheet td.col-model,
.compact-sheet th.col-model {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 6px;
  padding-right: 6px;
}
.compact-sheet .col-qpc,
.compact-sheet .col-qty,
.compact-sheet .col-boxes {
  padding-left: 6px;
  padding-right: 6px;
  white-space: nowrap;
  overflow: visible;
}
.compact-sheet .loc-cell { max-width: none; }

.settings-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.stab {
  background: rgba(40, 52, 72, 0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  color: #9eb0cc;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease), text-shadow 0.25s var(--ease);
}
.stab:hover { color: #e8eef8; background: rgba(59, 130, 246, 0.12); }
.stab.active {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border-bottom-color: var(--orange);
  text-shadow: 0 0 12px rgba(245, 158, 11, 0.45);
  box-shadow: var(--glow-orange);
}
.stab-panel h4 { margin: 0 0 8px; color: #d7e3f7; }
.sheet th, .sheet td {
  border: 1px solid rgba(70, 90, 120, 0.28);
  padding: 8px 10px;
  vertical-align: middle;
}
.center-sheet th, .center-sheet td { text-align: center; }
.sheet thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(17, 23, 34, 0.88);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-weight: 700;
  color: #c5d4ec;
  box-shadow: inset 0 -1px 0 rgba(70, 90, 120, 0.4);
}
.sheet thead tr.filter-row th {
  top: 37px;
  background: rgba(13, 18, 28, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  z-index: 2;
}
.sheet .filter-row input,
.sheet .filter-row select {
  padding: 7px 8px;
  border-radius: 6px;
  font-size: 12px;
  text-align: center;
}
.sheet tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.02); }
.sheet tbody tr:hover { background: rgba(59, 130, 246, 0.12); }
.sheet-footer {
  padding: 8px 12px;
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid rgba(70, 90, 120, 0.3);
  background: rgba(17, 23, 34, 0.55);
  text-align: center;
}
.sheet.mini { min-width: 0; margin-top: 12px; }
.sheet.mini thead th { position: static; }

.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(34, 197, 94, 0.45);
  border-radius: 12px;
  padding: 10px 14px;
  max-width: 90vw;
  color: var(--ink);
  box-shadow: var(--glow-green), 0 10px 30px rgba(0, 0, 0, 0.45);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(6, 10, 16, 0.62);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 12px;
}
.modal-panel {
  width: min(560px, 100%);
  max-height: 92vh;
  overflow: auto;
  position: relative;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.04), var(--glow-blue);
  animation: modalIn 0.28s var(--ease) both;
}
.modal-panel::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.55), transparent);
  pointer-events: none;
}
.modal-panel.wide { width: min(980px, 100%); }
.modal-head, .modal-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(70, 90, 120, 0.3);
}
.modal-foot { border-bottom: 0; border-top: 1px solid rgba(70, 90, 120, 0.3); justify-content: flex-end; }
.modal-head h3 { margin: 0; color: #e8eef8; }
.out-batch-banner {
  border: 1px solid var(--line, #ccc);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(245, 158, 11, 0.08);
  font-size: 13px;
  max-height: 160px;
  overflow: auto;
}
.out-batch-banner.hidden { display: none !important; }
.modal-body { padding: 12px 14px 18px; }
.grid-2, .grid-3 { display: grid; gap: 10px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1.4fr 1fr 1fr; }
.card-lite {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: rgba(17, 23, 34, 0.6);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  margin: 12px 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.card-lite::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(147, 197, 253, 0.45), transparent);
  pointer-events: none;
}
.card-lite:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.38), var(--glow-blue);
}
.loc-box {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}
.loc-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: rgba(17, 23, 34, 0.55);
  text-align: center;
}
.loc-item.suggested {
  border-color: rgba(59, 130, 246, 0.65);
  background: rgba(37, 99, 235, 0.15);
  font-weight: 650;
  box-shadow: var(--glow-blue);
}
.loc-pick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.loc-pick-col {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: rgba(17, 23, 34, 0.55);
  min-height: 72px;
  text-align: left;
}
.loc-pick-title {
  font-size: 12px;
  font-weight: 700;
  color: #8b9bb4;
  margin-bottom: 6px;
}
.loc-pick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.loc-pick-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 6px 10px !important;
  border: 1px solid var(--line) !important;
  background: rgba(30, 41, 59, 0.85) !important;
  border-radius: 8px !important;
  cursor: pointer;
  min-width: 72px;
  color: var(--ink) !important;
}
.loc-pick-chip .code { font-weight: 700; color: #dbe7fb; }
.loc-pick-chip .qty { font-size: 11px; color: #8b9bb4; }
.loc-pick-chip.selected {
  background: var(--gradient-primary) !important;
  border-color: rgba(59, 130, 246, 0.9) !important;
  color: #fff !important;
  box-shadow: var(--glow-blue);
}
.loc-pick-chip.selected .code,
.loc-pick-chip.selected .qty { color: #fff; }
.loc-pick-chip.is-suggest { border-color: rgba(59, 130, 246, 0.65) !important; }
.picked-loc { color: #60a5fa; text-shadow: 0 0 10px rgba(59, 130, 246, 0.4); }
@media (max-width: 720px) {
  .loc-pick-grid { grid-template-columns: 1fr; }
}
.list { display: grid; gap: 8px; }
.item {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: rgba(17, 23, 34, 0.6);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  text-align: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
  animation: fadeUp 0.35s var(--ease) both;
}
.item::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.4), transparent);
  pointer-events: none;
}
.item:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.36), var(--glow-blue);
}
.mono {
  white-space: pre-wrap;
  font-size: 12px;
  background: rgba(10, 14, 22, 0.75);
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: #b6c3d9;
}
.suggest-wrap { position: relative; }
.suggest {
  position: absolute;
  z-index: 30;
  left: 0; right: 0;
  top: calc(100% + 4px);
  background: rgba(17, 23, 34, 0.95);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: 10px;
  max-height: 240px;
  overflow: auto;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}
.suggest button {
  width: 100%;
  text-align: center;
  border-radius: 0;
  background: transparent;
  border-bottom: 1px solid rgba(70, 90, 120, 0.28);
  color: var(--ink);
}
.suggest button:hover { background: rgba(59, 130, 246, 0.12); }
.suggest button.exact {
  background: var(--exact);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.25);
}

.print-doc { text-align: center; color: #111; }
.print-doc h2 { margin: 0 0 8px; }
.print-doc .meta { margin: 4px 0; color: #333; }
.print-doc table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.print-doc th, .print-doc td {
  border: 1px solid #333;
  padding: 8px;
  text-align: center;
}

@media (min-width: 900px) {
  .stats-compact { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

@media print {
  html, body {
    height: auto !important;
    overflow: visible !important;
    background: #fff !important;
  }
  body > *:not(#modal-print) {
    display: none !important;
  }
  #modal-print {
    display: block !important;
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    height: auto !important;
    background: #fff !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
  #modal-print .modal-panel {
    border: 0 !important;
    box-shadow: none !important;
    width: 100% !important;
    max-width: none !important;
    max-height: none !important;
    overflow: visible !important;
    margin: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: #111 !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
  #modal-print .modal-body {
    max-height: none !important;
    overflow: visible !important;
    padding: 12px !important;
  }
  .no-print { display: none !important; }
  .print-doc {
    page-break-inside: avoid;
    color: #111 !important;
  }
  .print-doc table {
    page-break-inside: auto;
  }
  .print-doc tr {
    page-break-inside: avoid;
  }
}

.th-filterable { cursor: context-menu; user-select: none; }
.th-filterable:hover { background: rgba(59, 130, 246, 0.18) !important; }
.mf-tools { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.mf-tools .mf-filter.active {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: var(--glow-blue);
}
.mf-list {
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(17, 23, 34, 0.7);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.mf-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(70, 90, 120, 0.28);
  text-align: left;
}
.mf-item input { width: auto; }
.mf-item.mf-zero {
  background: rgba(239, 68, 68, 0.08);
}
.mf-tools .mf-compat-btn.active {
  border-color: #f59e0b;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
}
.mf-compat-group {
  border-bottom: 1px solid rgba(70, 90, 120, 0.4);
  padding-bottom: 4px;
  margin-bottom: 2px;
}
.mf-compat-group.mf-compat-format {
  background: rgba(56, 189, 248, 0.06);
}
.mf-compat-group.mf-compat-near {
  background: rgba(245, 158, 11, 0.08);
}
.mf-compat-group.mf-compat-mixed {
  background: rgba(167, 139, 250, 0.1);
}
.mf-compat-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px 10px 4px;
  font-size: 12px;
}
.mf-compat-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  background: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
}
.mf-compat-format .mf-compat-tag {
  background: rgba(56, 189, 248, 0.25);
  color: #7dd3fc;
}
.mf-compat-mixed .mf-compat-tag {
  background: rgba(167, 139, 250, 0.3);
  color: #c4b5fd;
}
.mf-compat-dismiss {
  margin-left: auto;
  font-size: 12px;
  padding: 2px 8px;
  border: 1px solid rgba(34, 197, 94, 0.45);
  color: #86efac;
  border-radius: 8px;
  white-space: nowrap;
}
.mf-compat-dismiss:hover {
  background: rgba(34, 197, 94, 0.15);
}
.zero-badge {
  color: #fff;
  background: linear-gradient(135deg, #dc2626, #ef4444);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.35);
}
.mf-model { font-weight: 650; min-width: 120px; }
.loc-manage-item {
  justify-content: space-between;
}
.loc-manage-item .loc-check {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  margin: 0;
  cursor: pointer;
}
.loc-code-text { font-weight: 700; min-width: 56px; }
.status-pill,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(17, 23, 34, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
}
.status-pill::before,
.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulseDot 1.8s ease-in-out infinite;
}
.pill-empty { background: rgba(148, 163, 184, 0.15); color: #94a3b8; box-shadow: 0 0 10px rgba(148, 163, 184, 0.2); }
.pill-disabled { background: rgba(100, 116, 139, 0.2); color: #94a3b8; }
.pill-ok,
.pill.ok { background: rgba(34, 197, 94, 0.15); color: #4ade80; box-shadow: var(--glow-green); }
.pill.warn { background: rgba(245, 158, 11, 0.15); color: #fbbf24; box-shadow: var(--glow-orange); }
.pill.danger,
.pill-danger { background: rgba(239, 68, 68, 0.15); color: #f87171; box-shadow: 0 0 12px rgba(239, 68, 68, 0.3); }
.engine-running,
.pill.running {
  box-shadow: var(--glow-orange);
  animation: pulseOrange 2s ease-in-out infinite;
  color: #fbbf24;
}
.loc-empty-item { background: rgba(148, 163, 184, 0.06); }
.loc-disabled-item { background: rgba(71, 85, 105, 0.2); opacity: 0.92; }
.loc-toggle-btn { flex-shrink: 0; padding: 6px 10px !important; }
.label-edit-row {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(70, 90, 120, 0.35);
}
.label-current {
  margin-bottom: 4px;
  font-size: 13px;
}
.label-current b { color: #60a5fa; }
.loc-cell {
  text-align: left !important;
  white-space: normal;
  line-height: 1.45;
  max-width: 460px;
}
.loc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 2px 4px;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(17, 23, 34, 0.75);
  border: 1px solid var(--line);
  font-size: 12px;
}
.loc-code {
  color: #fff;
  background: linear-gradient(135deg, #dc2626, #f97316);
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.25);
}
.loc-qty {
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.2);
  font-weight: 650;
  padding: 1px 7px;
  border-radius: 6px;
}
.loc-chip.loc-empty .loc-qty {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.15);
}
.loc-chip.loc-disabled .loc-code {
  background: #64748b;
  box-shadow: none;
}
.loc-chip.loc-disabled .loc-qty {
  color: #94a3b8;
  background: rgba(100, 116, 139, 0.25);
}
.loc-chip.loc-staging {
  border-color: rgba(245, 158, 11, 0.55);
  background: rgba(245, 158, 11, 0.1);
  box-shadow: var(--glow-orange);
}
.loc-chip.loc-staging .loc-code {
  background: var(--gradient-accent);
}
.loc-chip.loc-staging .loc-qty {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.18);
}
.loc-chip.loc-pick-pending {
  border-color: rgba(245, 158, 11, 0.55);
  background: rgba(245, 158, 11, 0.1);
  box-shadow: var(--glow-orange);
}
.loc-chip.loc-pick-pending .loc-code {
  background: linear-gradient(135deg, #d97706, #f59e0b);
}
.loc-chip.loc-pick-pending .loc-qty {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.18);
}
.loc-status-row td {
  background: rgba(148, 163, 184, 0.06);
}
.cat-tag,
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 12px;
}
.cat-goods {
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.18);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}
.cat-gift {
  color: #fdba74;
  background: rgba(249, 115, 22, 0.16);
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.2);
}

.pick-progress-bar {
  text-align: center;
  font-weight: 650;
  margin-bottom: 8px;
  color: #c5d4ec;
}
.pick-progress-list {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}
.pick-progress-list.compact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.pick-chip {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(40, 52, 72, 0.85);
  font-size: 12px;
  border: 1px solid var(--line);
}
.pick-chip.done {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  font-weight: 700;
  box-shadow: var(--glow-green);
}
.pick-chip.current {
  background: var(--gradient-primary);
  color: #fff;
  font-weight: 700;
  box-shadow: var(--glow-blue);
}
.pick-prog-item.done { color: #4ade80; }
.pick-done-banner {
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: #4ade80;
  padding: 10px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 8px;
  margin: 10px 0 0;
  box-shadow: var(--glow-green);
  text-shadow: 0 0 12px rgba(34, 197, 94, 0.35);
}
.ok-text { color: #4ade80; font-weight: 700; text-shadow: 0 0 10px rgba(34, 197, 94, 0.3); }

.pick-work-summary {
  margin-bottom: 10px;
  font-size: 14px;
  color: #c5d4ec;
}
.pick-work-table-wrap {
  overflow: auto;
  max-height: min(62vh, 560px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 14, 22, 0.45);
}
.pick-work-table {
  min-width: 780px;
  margin: 0;
}
.pick-work-table th,
.pick-work-table td {
  padding: 8px 10px;
  vertical-align: middle;
  font-size: 13px;
}
.pick-work-table .pw-model b { font-size: 14px; color: #e8eef8; }
.pick-work-table .tiny { font-size: 11px; margin-top: 2px; }
.pick-work-table td.remain { color: #f87171; font-weight: 700; text-shadow: 0 0 10px rgba(239, 68, 68, 0.3); }
.pick-work-table tr.is-done { opacity: 0.72; background: rgba(34, 197, 94, 0.06); }
.pick-work-table .pw-loc,
.pick-work-table .pw-qty,
.pick-work-table .pw-boxes {
  width: 88px;
  padding: 6px 8px;
  margin: 0;
}
.pick-work-table .pw-qty,
.pick-work-table .pw-boxes { width: 76px; }
.pw-sugs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 320px;
}
.pw-sug {
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: rgba(37, 99, 235, 0.12);
  color: #93c5fd;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 12px;
  cursor: pointer;
  line-height: 1.4;
}
.pw-sug.is-sug {
  border-color: rgba(59, 130, 246, 0.75);
  background: rgba(37, 99, 235, 0.22);
  font-weight: 700;
  box-shadow: var(--glow-blue);
}
.pw-avail { white-space: nowrap; }
.pw-sug span {
  margin-left: 4px;
  color: #8b9bb4;
  font-weight: 500;
}
.pw-sug:disabled {
  opacity: 0.5;
  cursor: default;
}
.pw-actions { white-space: nowrap; }
.pw-actions button {
  padding: 6px 8px;
  margin: 0 2px 2px 0;
  font-size: 12px;
}
.pick-work-footer {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  justify-content: flex-start;
}

.orders-section { margin-bottom: 18px; }
.orders-section-title {
  font-weight: 700;
  margin: 0 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(70, 90, 120, 0.35);
  color: #d7e3f7;
}
.orders-card-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
}
.order-view-head { margin-bottom: 6px; }
.order-view-title { font-size: 18px; margin-bottom: 4px; }
#modal-orders.order-detail-mode .modal-panel { width: min(1100px, 100%); }
.order-detail-view { min-height: 420px; }
.order-detail-toolbar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.st-color-swatch {
  display: inline-block; width: 14px; height: 14px; border-radius: 3px;
  outline: 1px solid rgba(0,0,0,.2); vertical-align: middle; flex-shrink: 0;
}
.st-period { font-weight: 700; }
.st-history-list {
  max-height: 180px; overflow: auto; border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 8px; margin-top: 4px;
}
.st-history-item {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 6px 2px; border-bottom: 1px solid var(--line); font-size: 13px;
}
.st-history-item:last-child { border-bottom: 0; }
td.col-sup[data-product-id], td.col-model[data-product-id],
td.dash-qe[data-qe-field],
.qe-loc-chip .loc-code[data-qe],
.qe-loc-chip .loc-qty[data-qe] {
  cursor: text;
}
#dash-sheet input.inline-edit,
#dash-sheet select.inline-edit,
td.col-sup input.inline-edit,
.loc-chip input.inline-edit,
.qe-loc-chip input.inline-edit {
  width: 100%;
  min-width: 52px;
  max-width: 120px;
  margin: 0;
  padding: 2px 4px;
  font: inherit;
  box-sizing: border-box;
  border: 1px solid #2563eb;
  background: #fff;
  color: #0f172a;
}
.qe-loc-chip .loc-code input.inline-edit,
.qe-loc-chip .loc-qty input.inline-edit {
  max-width: 72px;
  font-size: 12px;
}

.qi-unbound-item { display: flex; align-items: center; flex-wrap: wrap; cursor: pointer; }

.pw-slots-cell { min-width: 200px; }
.pw-slots { display: grid; gap: 6px; }
.pw-slot {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pw-slot .pw-loc { width: 72px; padding: 6px 8px; margin: 0; }
.pw-slot .pw-qty { width: 72px; padding: 6px 8px; margin: 0; }
.pw-slot .pw-boxes { width: 72px; padding: 6px 8px; margin: 0; }
.pw-slot-del {
  padding: 2px 8px !important;
  min-width: 28px;
  font-size: 16px;
  line-height: 1;
}
.pw-slot-spacer { width: 28px; display: inline-block; }
.pw-add-slot {
  margin-top: 6px;
  padding: 2px 8px !important;
  font-size: 12px;
}

/* 库位平面图 */
.loc-map-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.loc-map-legend { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; }
.loc-leg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(17, 23, 34, 0.65);
  color: #b6c3d9;
}
.loc-leg::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid #475569;
}
.loc-leg.empty::before { background: rgba(34, 197, 94, 0.2); border-color: rgba(34, 197, 94, 0.55); }
.loc-leg.stocked::before { background: #2563eb; border-color: #3b82f6; box-shadow: var(--glow-blue); }
.loc-leg.disabled::before { background: #475569; border-color: #64748b; }
.loc-map-add {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.loc-map-add input {
  width: 64px;
  margin: 0;
  padding: 6px 8px;
}
.loc-zone-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
  max-height: 72px;
  overflow: auto;
}
.loc-zone-chip {
  padding: 4px 8px !important;
  font-size: 12px;
  min-width: 36px;
}
.loc-map {
  max-height: min(58vh, 620px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(10, 14, 22, 0.55);
  padding: 10px;
  box-shadow: inset 0 0 40px rgba(59, 130, 246, 0.05);
}
.loc-zone-block {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 8px;
  align-items: start;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(70, 90, 120, 0.35);
}
.loc-zone-label {
  font-weight: 800;
  font-size: 14px;
  color: #93c5fd;
  padding-top: 4px;
  text-align: center;
  text-shadow: 0 0 12px rgba(59, 130, 246, 0.35);
}
.loc-zone-grid {
  display: grid;
  grid-template-columns: repeat(20, minmax(22px, 1fr));
  gap: 3px;
}
@media (min-width: 1100px) {
  .loc-zone-grid { grid-template-columns: repeat(40, minmax(18px, 1fr)); }
}
.loc-map-cell {
  aspect-ratio: 1;
  min-height: 22px;
  min-width: 0;
  margin: 0;
  padding: 0 !important;
  border-radius: 4px;
  border: 1px solid rgba(59, 130, 246, 0.28);
  background: rgba(34, 197, 94, 0.12);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  line-height: 1;
  color: #86efac;
  box-shadow: none;
  transition: transform 0.2s var(--ease), box-shadow 0.25s var(--ease), filter 0.2s var(--ease);
}
.loc-map-cell .n { font-weight: 650; }
.loc-map-cell.stocked {
  background: var(--gradient-primary);
  border-color: rgba(59, 130, 246, 0.75);
  color: #fff;
  box-shadow: var(--glow-blue);
}
.loc-map-cell.disabled {
  background: rgba(71, 85, 105, 0.55);
  border-color: #64748b;
  color: #94a3b8;
  text-decoration: line-through;
}
.loc-map-cell.missing {
  background: transparent;
  border-style: dashed;
  color: #475569;
  cursor: default;
}
.loc-map-cell:hover:not(.missing) {
  outline: 2px solid rgba(245, 158, 11, 0.75);
  outline-offset: 1px;
  transform: translateY(-1px);
}

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(10, 14, 22, 0.55); }
::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.55);
  border-radius: 8px;
  border: 1px solid rgba(70, 90, 120, 0.35);
}
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.75); }

/* 兼容命名：量化平台常见类（若页面存在则套用同风格） */
.top {
  background: rgba(17, 23, 34, 0.6);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(70, 90, 120, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.top .en {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.account-summary-bar,
.panel, .source-card, .module-card, .stat-card {
  position: relative;
  background: rgba(17, 23, 34, 0.65);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(70, 90, 120, 0.35);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.account-summary-bar {
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.22), rgba(124, 58, 237, 0.12), rgba(17, 23, 34, 0.7));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05), var(--glow-blue);
}
.position-stat-value {
  background: linear-gradient(135deg, #93c5fd, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 16px rgba(59, 130, 246, 0.3);
}
.tabs {
  background: rgba(17, 23, 34, 0.55);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.tab.active {
  border-bottom: 2px solid var(--orange);
  color: #fbbf24;
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}
.signal-table thead th {
  position: sticky;
  top: 0;
  background: rgba(17, 23, 34, 0.88);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.signal-table tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.015); }
.signal-table tbody tr:hover { background: rgba(59, 130, 246, 0.12); }
.bottom-nav {
  background: rgba(17, 23, 34, 0.72);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border-top: 1px solid rgba(70, 90, 120, 0.3);
}


/* ===== theme picker (settings) ===== */
.theme-picker { display: grid; gap: 10px; }
.theme-option {
  display: flex; align-items: center; gap: 12px; width: 100%;
  text-align: left; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); color: var(--ink); cursor: pointer;
  box-shadow: none; transform: none;
}
.theme-option:hover { transform: translateY(-1px); border-color: var(--accent); filter: none; }
.theme-option.active { border-color: var(--accent); box-shadow: var(--shadow-focus); }
.theme-swatch {
  width: 48px; height: 36px; border-radius: 8px;
  border: 1px solid var(--line); flex-shrink: 0;
}
.theme-swatch-glass {
  background: linear-gradient(135deg, #0a0d12 0%, #1a2336 50%, #3b82f6 100%);
}
.theme-swatch-classic {
  background: linear-gradient(135deg, #efebe3 0%, #fffdf8 55%, #0f6b5c 100%);
}
.theme-swatch-chrome-dark {
  background: linear-gradient(135deg, #202124 0%, #303134 55%, #8ab4f8 100%);
}
.theme-swatch-chrome-pink {
  background: linear-gradient(135deg, #fce8ef 0%, #fff 50%, #d9307a 100%);
}
.theme-meta { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.theme-meta strong { font-size: 15px; }
.theme-check {
  font-size: 12px; color: var(--muted); padding: 4px 8px;
  border-radius: 999px; border: 1px solid var(--line); flex-shrink: 0;
}
.theme-option.active .theme-check {
  color: var(--on-accent); background: var(--accent); border-color: transparent;
}

/* ===== stocktake + op log ===== */
.stocktake-banner {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 12px; border-bottom: 1px solid var(--line);
  background: var(--exact, rgba(59,130,246,.12));
}
.stocktake-banner-main { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stocktake-banner-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
button.loc-chip.st-clickable {
  cursor: pointer; vertical-align: middle; font: inherit; color: inherit;
}
.loc-st-pending { outline: 1px dashed var(--muted); opacity: 0.95; }
.loc-st-match { outline: 2px solid var(--ok); background: rgba(34, 197, 94, 0.12); }
.loc-st-changed { outline: 2px solid var(--orange); background: rgba(245, 158, 11, 0.14); }
.st-flag {
  display: inline-block; margin-left: 4px; font-size: 10px; padding: 0 4px;
  border-radius: 4px; background: rgba(0,0,0,.08);
}
.loc-st-match .st-flag { color: var(--ok); }
.loc-st-changed .st-flag { color: var(--orange); }
.loc-st-pending .st-flag { color: var(--muted); }
.oplog-list { max-height: 520px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.oplog-item { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.oplog-item:last-child { border-bottom: 0; }
.oplog-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.oplog-detail { white-space: pre-wrap; word-break: break-word; font-size: 13px; }
.tiny { font-size: 12px; }

.theme-swatch-neon-emerald {
  background: radial-gradient(circle at 50% 42%, rgba(0, 255, 65, 0.85) 0%, rgba(0, 200, 83, 0.45) 38%, #050505 72%);
  box-shadow: inset 0 0 14px rgba(0, 255, 65, 0.65), 0 0 8px rgba(0, 255, 65, 0.35);
}
.theme-swatch-excel {
  background: linear-gradient(135deg, #ffffff 0%, #f2f2f2 40%, #217346 100%);
  border: 1px solid #b4b4b4;
}

/* column visibility */
[data-col].col-hidden { display: none !important; }
.col-vis-list { display: grid; gap: 8px; }
.col-vis-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card);
}
.col-vis-toggle.on { background: var(--ok); color: #fff; border: 0; }
.col-vis-toggle.off { background: var(--btn); color: var(--muted); border: 1px solid var(--line); }
.compact-sheet .col-name { width: 88px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-sheet .col-unit { width: 52px; }
.compact-sheet .col-carton { width: 108px; }
.compact-sheet .col-nw,
.compact-sheet .col-gw,
.compact-sheet .col-cbm { width: 72px; }
.grid-3.even { grid-template-columns: 1fr 1fr 1fr; }

/* --- free create-pick modal + pick-loc drag --- */
.modal.modal-free {
  background: transparent !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  pointer-events: none;
  display: block;
  padding: 0;
  place-items: unset;
}
.modal.modal-free .modal-panel {
  pointer-events: auto;
  position: fixed;
  left: max(12px, calc(50% - 490px));
  top: 6vh;
  margin: 0;
  max-height: 88vh;
  z-index: 130;
  animation: none;
}
.modal.modal-free .modal-head {
  cursor: move;
  user-select: none;
}
.loc-pick-grid.loc-pick-3 {
  grid-template-columns: 1fr 1fr 1fr;
}
.loc-pick-col.pick-drop {
  border-style: dashed;
  min-height: 96px;
  background: rgba(34, 197, 94, 0.08);
}
.loc-pick-col.pick-drop.drag-over {
  border-color: rgba(34, 197, 94, 0.85);
  background: rgba(34, 197, 94, 0.18);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.35);
}
.loc-pick-chip[draggable="true"] { cursor: grab; }
.loc-pick-chip.pick-confirmed {
  background: linear-gradient(135deg, #15803d, #22c55e) !important;
  border-color: rgba(34, 197, 94, 0.9) !important;
  color: #fff !important;
}
.loc-pick-chip.pick-confirmed .code,
.loc-pick-chip.pick-confirmed .qty { color: #fff; }
@media (max-width: 900px) {
  .loc-pick-grid.loc-pick-3 { grid-template-columns: 1fr; }
}
.pw-side-st {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(34, 197, 94, 0.45);
  border-radius: 10px;
  background: rgba(34, 197, 94, 0.1);
}
.pw-side-st .st-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 6px 0;
}

/* print preview header + bold locs */
.print-doc { text-align: left; color: #111; }
.print-doc h2 { text-align: center; margin: 0 0 10px; letter-spacing: 0.15em; }
.print-doc .print-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 14px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,0.25);
  border-radius: 8px;
  background: rgba(255,255,255,0.92);
}
.print-doc .print-meta-item { display: flex; gap: 6px; align-items: baseline; min-width: 0; font-size: 13px; color: #222; }
.print-doc .print-meta-item .k { color: #666; white-space: nowrap; }
.print-doc .print-meta-item .k::after { content: "："; }
.print-doc .print-meta-item .v { font-weight: 650; word-break: break-all; }
.print-doc .print-meta-item .v.strong { font-size: 15px; font-weight: 800; }
.print-doc .print-sign { margin-top: 16px; font-size: 14px; }
.print-doc .loc-cell { text-align: left !important; }
.loc-print { display: inline-block; margin: 2px 8px 2px 0; vertical-align: top; text-align: left; }
.loc-print .loc-code { display: block; font-size: 16px; font-weight: 800; line-height: 1.15; color: #0f172a; }
.loc-print .loc-qty { display: block; font-size: 11px; color: #475569; font-weight: 500; }
#modal-out .loc-cell .loc-print .loc-code { font-size: 15px; }
.loc-pick-chip .code { font-size: 15px !important; font-weight: 800 !important; }
@media (max-width: 720px) {
  .print-doc .print-meta-grid { grid-template-columns: 1fr 1fr; }
}

/* create-pick lines: compact one-row layout */
#modal-out table.out-lines-sheet {
  table-layout: fixed;
  width: 100%;
}
#modal-out table.out-lines-sheet th,
#modal-out table.out-lines-sheet td {
  padding: 6px 8px;
  vertical-align: top;
}
#modal-out table.out-lines-sheet .col-seq {
  width: 36px !important;
  max-width: 40px !important;
  min-width: 32px !important;
  text-align: center;
  padding-left: 4px !important;
  padding-right: 4px !important;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: #64748b;
}
#modal-out table.out-lines-sheet .col-model { width: 12%; text-align: left; font-weight: 700; }
#modal-out table.out-lines-sheet .col-qty,
#modal-out table.out-lines-sheet .col-boxes {
  width: 56px;
  white-space: nowrap;
  text-align: center;
}
#modal-out table.out-lines-sheet .col-pick { width: 28%; }
#modal-out table.out-lines-sheet .col-other { width: auto; }
#modal-out table.out-lines-sheet .col-del { width: 32px; padding: 2px; }

/* 全屏创建拣货单页 */
#modal-out.pick-create-page {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  padding: 0;
  margin: 0;
  background: var(--bg, #0b1220);
  align-items: stretch;
  justify-content: stretch;
}
#modal-out.pick-create-page:not(.hidden) {
  display: flex !important;
}
body.pick-create-open {
  overflow: hidden;
}
#modal-out.pick-create-page .pick-create-panel {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  border-radius: 0;
  border: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  background: var(--glass-strong, #111827);
}
#modal-out.pick-create-page .pick-create-head {
  flex: 0 0 auto;
  cursor: default;
  padding: 10px 16px;
  gap: 12px;
  border-bottom: 1px solid var(--line, #334155);
}
.pick-create-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.pick-create-title-wrap h3 { margin: 0; font-size: 18px; }
.modal-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}
#modal-out.pick-create-page .pick-create-body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 12px 16px 24px;
  max-height: none;
}
.pick-create-fields {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px 12px;
  margin-bottom: 12px;
}
@media (max-width: 1100px) {
  .pick-create-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .pick-create-fields { grid-template-columns: 1fr 1fr; }
}
.pick-create-manual {
  margin-bottom: 12px;
}
.pick-create-manual summary {
  cursor: pointer;
  font-weight: 650;
  padding: 8px 10px;
}
.pick-create-manual .line-editor { padding: 8px 10px 12px; }
.pick-create-table-wrap {
  border: 1px solid var(--line, #334155);
  border-radius: 8px;
  overflow: auto;
  max-height: calc(100vh - 220px);
  background: rgba(255,255,255,0.02);
}
.pick-create-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #0f766e;
  color: #fff;
  font-weight: 700;
}
.out-line-drop {
  min-height: 44px;
  border: 1px dashed #94a3b8;
  border-radius: 6px;
  padding: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  background: rgba(15, 118, 110, 0.08);
}
.out-line-drop.drag-over {
  border-color: #0f766e;
  background: rgba(15, 118, 110, 0.18);
}
.out-drop-hint {
  color: #94a3b8;
  font-size: 12px;
}
.out-lines-sheet .out-line-chip {
  font-size: 12px;
  padding: 2px 6px;
  cursor: grab;
  border-radius: 4px;
}
.out-lines-sheet .out-line-chip.is-suggest {
  outline: 1px solid #f59e0b;
}
.out-lines-sheet .out-line-chip.pick-confirmed {
  cursor: pointer;
  background: rgba(15, 118, 110, 0.25);
}
.out-batch-banner {
  margin-bottom: 10px;
}
#modal-out table.out-lines-sheet .loc-cell {
  text-align: left !important;
  white-space: normal;
  line-height: 1.35;
}
#modal-out .loc-print.loc-inline {
  display: inline-flex;
  flex-direction: row;
  align-items: baseline;
  gap: 3px;
  margin: 0 8px 0 0;
  white-space: nowrap;
  vertical-align: middle;
}
#modal-out .loc-print.loc-inline .loc-code {
  display: inline;
  font-size: 14px;
  font-weight: 800;
}
#modal-out .loc-print.loc-inline .loc-qty {
  display: inline;
  font-size: 11px;
  font-weight: 500;
  opacity: 0.85;
}
#modal-out .out-del-btn {
  min-width: 28px !important;
  width: 28px;
  padding: 2px 0 !important;
  font-size: 16px;
  line-height: 1;
}
#modal-out .out-qty-input {
  width: 6em;
  min-width: 96px;
  box-sizing: border-box;
  text-align: center;
  padding: 2px 8px;
  font-variant-numeric: tabular-nums;
  appearance: textfield;
  -moz-appearance: textfield;
}
#modal-out .out-qty-input::-webkit-outer-spin-button,
#modal-out .out-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.print-doc .loc-print.loc-inline,
.print-doc .loc-print {
  display: inline-flex;
  flex-direction: row;
  align-items: baseline;
  gap: 3px;
  margin: 0 10px 2px 0;
  white-space: nowrap;
}
.print-doc .loc-print .loc-code { display: inline; font-size: 15px; font-weight: 800; }
.print-doc .loc-print .loc-qty { display: inline; font-size: 11px; }

/* ===== pick-work responsive board (desktop row / mobile cards) ===== */
.pick-work-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: baseline;
  margin-bottom: 10px;
  font-size: 14px;
}
.pw-board {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(68vh, 640px);
  overflow: auto;
  padding: 2px;
}
.pw-card {
  display: grid;
  grid-template-columns: minmax(120px, 160px) minmax(168px, 200px) minmax(0, 1fr) minmax(200px, 240px);
  gap: 8px 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(17, 23, 34, 0.55);
}
.pw-card.is-done { opacity: 0.72; }
.pw-card-model b { font-size: 14px; font-weight: 800; word-break: break-all; }
.pw-card-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}
.pw-stat {
  text-align: center;
  padding: 4px 2px;
  border-radius: 6px;
  background: rgba(0,0,0,0.18);
}
.pw-stat .k { display: block; font-size: 10px; color: #8b9bb4; line-height: 1.2; }
.pw-stat .v { display: block; font-size: 14px; font-weight: 800; line-height: 1.2; }
.pw-stat .v small { display: block; font-size: 10px; font-weight: 500; opacity: 0.8; }
.pw-stat.is-remain .v { color: #f87171; }
.pw-card-locs { min-width: 0; }
.pw-locs-label { font-size: 11px; color: #8b9bb4; margin-bottom: 4px; }
.pw-sugs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-content: flex-start;
  max-height: 3.6em; /* ~2 lines */
  overflow: auto;
}
.pw-sug {
  display: inline-flex;
  flex-direction: row;
  align-items: baseline;
  gap: 3px;
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: rgba(37, 99, 235, 0.12);
  color: #93c5fd;
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 12px;
  cursor: pointer;
  line-height: 1.25;
  white-space: nowrap;
}
.pw-sug b { font-weight: 800; }
.pw-sug span { color: #8b9bb4; font-weight: 500; font-size: 11px; }
.pw-sug.is-sug {
  border-color: rgba(59, 130, 246, 0.8);
  background: rgba(37, 99, 235, 0.24);
  box-shadow: 0 0 0 1px rgba(59,130,246,0.2);
}
.pw-sug:disabled { opacity: 0.45; cursor: default; }
.pw-card-ops {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
  min-width: 0;
}
.pw-slots { display: flex; flex-direction: column; gap: 4px; }
.pw-slot {
  display: grid;
  grid-template-columns: minmax(56px, 1fr) 56px 56px 28px;
  gap: 4px;
  align-items: center;
}
.pw-slot .pw-loc,
.pw-slot .pw-qty,
.pw-slot .pw-boxes {
  width: 100%;
  margin: 0;
  padding: 6px 8px;
  font-size: 13px;
}
.pw-slot-spacer { width: 28px; }
.pw-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.pw-actions button,
.pw-add-slot {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
}
.pick-work-footer {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.pick-work-footer button { min-height: 36px; }

/* mobile: full-screen pick, vertical cards, big tap targets */
@media (max-width: 860px) {
  .desk-only { display: none !important; }
  #modal-pick-work.modal-pick-work {
    padding: 0;
    display: block;
  }
  #modal-pick-work .pick-work-panel {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    display: flex;
    flex-direction: column;
  }
  #modal-pick-work .modal-body {
    flex: 1;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 24px;
  }
  .pw-board { max-height: none; gap: 10px; }
  .pw-card {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }
  .pw-card-model b { font-size: 17px; }
  .pw-card-stats { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .pw-stat { padding: 8px 4px; }
  .pw-stat .k { font-size: 11px; }
  .pw-stat .v { font-size: 16px; }
  .pw-sugs {
    max-height: none;
    gap: 8px;
  }
  .pw-sug {
    min-height: 44px;
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 10px;
  }
  .pw-sug span { font-size: 12px; }
  .pw-slot { grid-template-columns: minmax(64px, 1fr) 64px 64px 36px; gap: 6px; }
  .pw-slot .pw-loc,
  .pw-slot .pw-qty {
    min-height: 44px;
    font-size: 16px;
  }
  .pw-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .pw-actions button,
  .pw-add-slot {
    min-height: 46px;
    font-size: 15px;
    width: 100%;
  }
  .pick-work-footer {
    position: sticky;
    bottom: 0;
    background: rgba(10,14,22,0.92);
    padding: 10px 0 4px;
    backdrop-filter: blur(8px);
  }
  .pick-work-footer button {
    flex: 1;
    min-height: 46px;
    font-size: 15px;
  }

  /* light global mobile polish */
  .sheet-toolbar { gap: 6px; }
  .sheet-toolbar .primary,
  .sheet-toolbar button { min-height: 40px; }
  .modal-panel.wide { width: min(100%, 100vw); }
  .modal { padding: 0; align-items: stretch; }
  .modal .modal-panel {
    width: 100%;
    max-width: 100%;
    max-height: 100%;
    height: 100%;
    border-radius: 0;
  }
  .orders-card-actions button { min-height: 40px; }
}

@media (min-width: 861px) and (max-width: 1100px) {
  .pw-card {
    grid-template-columns: minmax(110px, 140px) minmax(150px, 180px) minmax(0, 1fr) minmax(180px, 210px);
  }
}

/* ===== pick-work Excel-clean table (overrides card UI) ===== */
.pw-board { display: none !important; }
.pick-work-summary {
  display: block;
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted, #666);
  background: none;
  border: 0;
  padding: 0;
}
.pick-work-table-wrap {
  overflow: auto;
  max-height: min(70vh, 680px);
  border: 1px solid var(--line, #bbb);
  border-radius: 0;
  background: transparent;
}
.pick-work-table {
  width: 100%;
  min-width: 1200px;
  margin: 0;
  table-layout: fixed;
  border-collapse: collapse;
}
.pick-work-table th,
.pick-work-table td {
  border: 1px solid var(--line, #c5c5c5);
  padding: 4px 6px;
  vertical-align: middle;
  font-size: 13px;
  background: transparent;
  box-shadow: none !important;
}
.pick-work-table thead th {
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}
.pick-work-table .col-m { width: 15%; }
.pick-work-table .col-n { width: 100px; min-width: 92px; }
.pick-work-table .col-loc { width: 28%; }
.pick-work-table .col-in { width: 220px; min-width: 200px; }
.pick-work-table .col-act { width: 108px; }
.pick-work-table .pw-model { text-align: left; }
.pick-work-table .pw-model b { font-size: 13px; font-weight: 700; color: inherit; }
.pick-work-table .pw-num { text-align: center; white-space: nowrap; }
.pick-work-table td.remain { color: #c00; font-weight: 700; text-shadow: none; }
.pick-work-table tr.is-done { opacity: 0.65; background: transparent; }
.pick-work-table .tiny { font-size: 11px; margin-top: 0; opacity: 0.75; }
.pw-locs-cell { text-align: left !important; }
.pw-sugs {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  max-width: none;
  max-height: 3.2em;
  overflow: auto;
  align-content: flex-start;
}
.pw-sug,
button.pw-sug {
  display: inline-block;
  border: 1px solid var(--line, #999) !important;
  background: transparent !important;
  color: inherit !important;
  border-radius: 0 !important;
  padding: 1px 5px !important;
  font-size: 12px !important;
  line-height: 1.35;
  white-space: nowrap;
  box-shadow: none !important;
  min-width: 0;
  min-height: 0;
}
.pw-sug.is-sug,
button.pw-sug.is-sug {
  font-weight: 700 !important;
  border-color: #333 !important;
  background: rgba(0,0,0,0.04) !important;
}
.pw-sug span,
.pw-sug b { color: inherit !important; margin: 0; font-size: inherit; }
.pw-sug:disabled { opacity: 0.4; }
.pw-slots-cell { text-align: left !important; }
.pw-slots { display: flex; flex-direction: column; gap: 3px; }
.pw-slot {
  display: grid;
  grid-template-columns: minmax(52px, 1fr) 52px 52px 22px;
  gap: 3px;
  align-items: center;
}
.pick-work-table .pw-loc,
.pick-work-table .pw-qty,
.pick-work-table .pw-boxes {
  width: 100%;
  margin: 0;
  padding: 3px 5px;
  border: 1px solid var(--line, #bbb);
  border-radius: 0;
  font-size: 13px;
  background: transparent;
}
.pw-add-slot {
  padding: 2px 6px !important;
  font-size: 12px !important;
  min-height: 0 !important;
  border-radius: 0 !important;
  margin-top: 2px;
}
.pw-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  white-space: normal;
}
.pw-actions button {
  margin: 0 !important;
  padding: 4px 6px !important;
  font-size: 12px !important;
  border-radius: 0 !important;
  min-height: 0 !important;
  width: 100%;
  box-shadow: none !important;
}
.pick-work-footer {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  position: static;
  background: none;
  padding: 0;
  backdrop-filter: none;
}
.pick-work-footer button {
  min-height: 32px;
  border-radius: 0;
}
.pick-done-banner {
  border-radius: 0;
  margin-top: 8px;
}

/* hide leftover card UI if any */
.pw-card, .pw-card-stats, .pw-stat, .pw-locs-label { display: none !important; }

@media (max-width: 860px) {
  #modal-pick-work.modal-pick-work { padding: 0; }
  #modal-pick-work .pick-work-panel {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }
  .pick-work-table { min-width: 0; table-layout: auto; }
  .pick-work-table thead { display: none; }
  .pick-work-table,
  .pick-work-table tbody,
  .pick-work-table tr,
  .pick-work-table td {
    display: block;
    width: 100%;
  }
  .pick-work-table tr {
    border: 1px solid var(--line, #bbb);
    margin-bottom: 10px;
    padding: 0;
  }
  .pick-work-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    border: 0;
    border-bottom: 1px solid var(--line, #ddd);
    padding: 8px 10px;
    text-align: left !important;
  }
  .pick-work-table td::before {
    content: attr(data-label);
    font-weight: 700;
    flex: 0 0 64px;
    color: var(--muted, #666);
    font-size: 12px;
  }
  .pick-work-table td.pw-locs-cell,
  .pick-work-table td.pw-slots-cell,
  .pick-work-table td.pw-actions {
    display: block;
  }
  .pick-work-table td.pw-locs-cell::before,
  .pick-work-table td.pw-slots-cell::before,
  .pick-work-table td.pw-actions::before {
    display: block;
    margin-bottom: 6px;
  }
  .pw-sugs { max-height: none; }
  .pw-sug, button.pw-sug {
    min-height: 40px !important;
    padding: 8px 10px !important;
    font-size: 14px !important;
  }
  .pick-work-table .pw-loc,
  .pick-work-table .pw-qty,
.pick-work-table .pw-boxes {
    min-height: 40px;
    font-size: 16px;
  }
  .pw-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .pw-actions button {
    min-height: 44px !important;
    font-size: 15px !important;
  }
  .pick-work-footer {
    position: sticky;
    bottom: 0;
    padding: 8px 0;
    background: var(--glass-strong, #fff);
    border-top: 1px solid var(--line, #ccc);
  }
  .pick-work-footer button {
    flex: 1;
    min-height: 44px;
  }
}

/* pick-work contrast + pick path trace */
#modal-pick-work .pick-work-summary {
  color: var(--ink, #111);
  font-weight: 600;
}
#modal-pick-work .pick-work-summary .muted { color: var(--muted, #555); font-weight: 500; }
#modal-pick-work .pick-work-table th {
  background: #1f4e79 !important;
  color: #fff !important;
  border-color: #163a5a !important;
}
#modal-pick-work .pick-work-table td {
  color: var(--ink, #111);
  border-color: #9aa5b1 !important;
  background: #fff;
}
html[data-theme="glass"] #modal-pick-work .pick-work-table td,
html[data-theme="chrome-dark"] #modal-pick-work .pick-work-table td {
  background: rgba(255,255,255,0.04);
  color: #e8eef8;
  border-color: rgba(148,163,184,0.45) !important;
}
#modal-pick-work .pick-work-table tr.is-done { opacity: 1; }
#modal-pick-work .pick-work-table tr.is-done td { background: #eaf7ea; }
html[data-theme="glass"] #modal-pick-work .pick-work-table tr.is-done td,
html[data-theme="chrome-dark"] #modal-pick-work .pick-work-table tr.is-done td {
  background: rgba(34, 197, 94, 0.12);
}
#modal-pick-work .pw-sug,
#modal-pick-work button.pw-sug {
  border: 1px solid #334155 !important;
  background: #f8fafc !important;
  color: #0f172a !important;
  font-weight: 600 !important;
}
#modal-pick-work .pw-sug.is-sug,
#modal-pick-work button.pw-sug.is-sug {
  border: 2px solid #0f172a !important;
  background: #fff7cc !important;
  color: #0f172a !important;
}
html[data-theme="glass"] #modal-pick-work .pw-sug,
html[data-theme="chrome-dark"] #modal-pick-work .pw-sug,
html[data-theme="glass"] #modal-pick-work button.pw-sug,
html[data-theme="chrome-dark"] #modal-pick-work button.pw-sug {
  background: rgba(255,255,255,0.1) !important;
  color: #f1f5f9 !important;
  border-color: #94a3b8 !important;
}
html[data-theme="glass"] #modal-pick-work .pw-sug.is-sug,
html[data-theme="chrome-dark"] #modal-pick-work .pw-sug.is-sug {
  background: rgba(250, 204, 21, 0.25) !important;
  border-color: #facc15 !important;
  color: #fff !important;
}
.pw-path-item {
  display: inline-block;
  margin: 0 6px 3px 0;
  padding: 2px 8px;
  border: 1px solid #0f172a;
  background: #fff;
  color: #0f172a;
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
}
html[data-theme="glass"] .pw-path-item,
html[data-theme="chrome-dark"] .pw-path-item {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-color: #e2e8f0;
}
.pw-pick-trace { text-align: left; }
.pw-pick-trace .ok-text {
  display: inline-block;
  margin-top: 4px;
  color: #15803d !important;
  font-weight: 800;
  text-shadow: none;
}
.pick-trace-panel {
  margin-top: 12px;
  border: 1px solid #9aa5b1;
  background: #fff;
}
html[data-theme="glass"] .pick-trace-panel,
html[data-theme="chrome-dark"] .pick-trace-panel {
  background: rgba(255,255,255,0.04);
  border-color: rgba(148,163,184,0.45);
}
.pick-trace-title {
  padding: 8px 10px;
  font-weight: 800;
  border-bottom: 1px solid #9aa5b1;
  background: #f3f4f6;
  color: #0f172a;
}
html[data-theme="glass"] .pick-trace-title,
html[data-theme="chrome-dark"] .pick-trace-title {
  background: rgba(255,255,255,0.08);
  color: #f8fafc;
  border-bottom-color: rgba(148,163,184,0.45);
}
.pick-trace-table { margin: 0; width: 100%; }
.pick-trace-table th {
  background: #e5e7eb !important;
  color: #111 !important;
  font-weight: 700;
}
.pick-trace-table td { font-weight: 600; }
.pick-trace-table td b { font-size: 14px; }
.pick-done-banner {
  background: #dcfce7 !important;
  color: #14532d !important;
  border: 1px solid #86efac !important;
  font-weight: 800;
}

/* source column in pick table */
.pick-work-table .col-src { width: 16%; }
.pw-source-cell { text-align: left !important; font-weight: 700; }
.pick-trace-panel { display: none !important; }
