:root {
  --bg: #fafaf8;
  --fg: #1a1a1a;
  --muted: #6b6b6b;
  --accent: #7a1f2b;
  --accent-bg: #fbe8eb;
  --ok: #2d7a3d;
  --ok-bg: #e6f4ea;
  --err: #b91c1c;
  --err-bg: #fbe6e6;
  --border: #e5e3df;
  --radius: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 16px; line-height: 1.45; overflow-x: hidden; max-width: 100%; }
code, pre { word-break: break-all; overflow-wrap: anywhere; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
code { background: #f1efeb; padding: 1px 6px; border-radius: 4px; font-size: 0.92em; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 12px 18px; background: #fff; border-bottom: 1px solid var(--border); }
.topbar .brand { font-weight: 600; color: var(--fg); }
.topbar .nav { margin-left: auto; display: flex; gap: 16px; flex-wrap: wrap; }
.page { max-width: 1080px; margin: 18px auto; padding: 0 16px; }
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 16px; max-width: 100%; overflow-wrap: anywhere; }
.card > table, .card .table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; display: block; }
.footer { padding: 18px; text-align: center; font-size: 0.9em; }
button, .btn { font: inherit; padding: 10px 18px; border-radius: var(--radius); border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; }
button.secondary, .btn.secondary { background: #fff; color: var(--accent); }
button:disabled { opacity: 0.55; cursor: not-allowed; }
input, select, textarea { font: inherit; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--border); width: 100%; max-width: 480px; }
label { display: block; margin: 10px 0 4px; font-weight: 500; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: #f5f4f0; font-weight: 600; }
.status-paid { color: var(--accent); }
.status-assembling { color: #8a5d00; }
.status-shipped { color: var(--ok); }
.status-failed { color: var(--err); }
@media (max-width: 640px) {
  .topbar { padding: 10px 12px; gap: 10px; flex-wrap: wrap; }
  .topbar .nav { width: 100%; gap: 10px; row-gap: 6px; font-size: 0.92em; }
  .page { margin: 12px auto; padding: 0 10px; }
  .card { padding: 14px 12px; }
  table { font-size: 0.85em; }
  th, td { padding: 8px 6px; }
  .item { grid-template-columns: 1fr auto; }
  .item__select { grid-row: span 1; }
  .item__codes li { font-size: 0.78em; padding: 3px 6px; }
}

/* === Picker queue === */
.picker-queue { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 14px; }
.picker-card { display: block; padding: 16px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); color: var(--fg); }
.picker-card:hover { text-decoration: none; border-color: var(--accent); }
.picker-card__head { display: flex; justify-content: space-between; font-weight: 600; }
.picker-card__body { margin-top: 8px; font-size: 0.95em; }

/* === Picker order screen (mobile-first) === */
.picker-order__head { margin-bottom: 18px; }
.picker-order__head h1 { margin: 0 0 4px; font-size: 1.4em; }

.scan-feedback { position: sticky; top: 8px; z-index: 5; padding: 12px 16px; border-radius: 8px; font-weight: 600; font-size: 1.05em; text-align: center; margin-bottom: 12px; white-space: pre-line; word-break: break-all; }
.scan-feedback.ok { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok); }
.scan-feedback.err { background: var(--err-bg); color: var(--err); border: 1px solid var(--err); }
.hidden { display: none !important; }

.scan-controls { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.btn-big { padding: 16px 24px; font-size: 1.05em; flex: 1; min-width: 200px; }
.btn-sm { padding: 6px 12px; font-size: 0.9em; }

.scanner { position: relative; margin: 14px 0; border-radius: var(--radius); overflow: hidden; background: #000; }
.scanner video { width: 100%; max-height: 60vh; object-fit: cover; display: block; }
.scanner__overlay { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 3px rgba(122,31,43,0.6); border-radius: var(--radius); }
.scanner__controls { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; }
.scanner__hint { position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; color: #fff; text-shadow: 0 1px 3px #000; font-size: 0.85em; padding: 0 12px; }

.manual-input { margin: 14px 0; }
.manual-input input { font-size: 1em; }

.items-list { list-style: none; padding: 0; margin: 0; }
.item { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.item__name { font-weight: 600; }
.item__sku { font-size: 0.85em; margin-top: 2px; }
.item__count { font-size: 1.1em; }
.item__select .radio { display: inline-block; }
.item__select input[type="radio"] { width: 28px; height: 28px; cursor: pointer; }

.ship-row { margin-top: 22px; }
.ship-row .btn { width: 100%; }

.item__codes { grid-column: 1 / -1; list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 4px; }
.item__codes li { display: flex; align-items: center; gap: 8px; font-size: 0.85em; background: #f5f4f0; border-radius: 6px; padding: 4px 8px; }
.item__codes code { background: transparent; padding: 0; }
.item__codes .del-code { margin-left: auto; padding: 2px 8px; background: transparent; color: var(--err); border: 1px solid var(--err); border-radius: 6px; font-size: 1em; cursor: pointer; }

