/* PackBench kiosk UI — big targets, high contrast, zero decoration. */
:root {
  --ground: #F6F7F5; --surface: #FFFFFF; --ink: #17201C; --sub: #66706B;
  --line: #D9DED9; --accent: #1F6F54; --accent-ink: #fff;
  --warn: #B4762B; --bad: #A3402F; --ok-soft: #E4F0EA; --bad-soft: #F6E5E1;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: "Seravek","Avenir Next","Segoe UI",system-ui,sans-serif; font-size: 16px; }
main { max-width: 1200px; margin: 0 auto; padding: 16px 20px 60px; }
a { color: var(--accent); }

.topnav { display: flex; align-items: center; gap: 22px; background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 20px; position: sticky; top: 0; z-index: 5; }
.topnav a { text-decoration: none; color: var(--ink); font-weight: 600; padding: 8px 4px; }
.topnav .brand { font-size: 1.1rem; }
.scan-status { margin-left: auto; font-size: .75rem; letter-spacing: .1em; color: var(--accent); }

.page-title { font-size: 1.5rem; margin: 8px 0; }
.tabs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 650; min-height: 48px; }
.tab.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tab .count { background: rgba(0,0,0,.12); border-radius: 999px; padding: 1px 9px; font-size: .8rem; }
.tab.active .count { background: rgba(255,255,255,.25); }
.search { margin-left: auto; }
.search input { padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; min-width: 240px; font-size: 1rem; }

.orders { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.orders th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--sub); background: #EDF0EC; padding: 10px 12px; }
.orders td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.orders .empty { text-align: center; color: var(--sub); padding: 40px; }
.order-num a { font-weight: 800; text-decoration: none; font-size: 1.05rem; }
.sub { color: var(--sub); font-size: .82rem; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: .82rem; }
.thumb-cell { white-space: nowrap; width: 1%; }
.thumb { width: 44px; height: 44px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: #fff; margin-right: 2px; }
.express-row { box-shadow: inset 3px 0 0 var(--warn); }

.badge { display: inline-block; font-weight: 800; font-size: .78rem; padding: 4px 10px; border-radius: 6px; }
.badge.express { background: var(--ink); color: #fff; }
.badge.std { border: 1.5px solid var(--ink); }
.badge.xl { font-size: 1rem; padding: 8px 16px; }
.chip { display: inline-block; font-size: .72rem; border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; color: var(--sub); }
.chip.bad { border-color: var(--bad); color: var(--bad); background: var(--bad-soft); }
.chip.ok { border-color: var(--accent); color: var(--accent); background: var(--ok-soft); }
.chip.note { border-color: var(--warn); color: var(--warn); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 1rem; font-weight: 650; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--accent); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.big { font-size: 1.15rem; min-height: 56px; padding: 12px 26px; }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.tiny { min-height: 30px; padding: 2px 8px; font-size: .8rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.inline { display: inline; }

.sku-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.sku-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-align: center; }
.sku-card img { width: 84px; height: 84px; object-fit: contain; }
.sku-card-name { font-size: .82rem; font-weight: 650; line-height: 1.25; margin-top: 6px; }
.sku-card-count { font-size: 1.1rem; font-weight: 800; color: var(--accent); margin-top: 2px; }
.hint { color: var(--sub); font-size: .85rem; margin: 6px 0 16px; }

.pack-head { display: flex; justify-content: space-between; align-items: flex-start; margin: 10px 0 16px; }
.pack-order-num { font-size: 2.2rem; margin: 0; }
.micro { font-size: .7rem; letter-spacing: .14em; color: var(--sub); }
.pack-cols { display: grid; grid-template-columns: 1fr 320px; gap: 18px; }
@media (max-width: 900px) { .pack-cols { grid-template-columns: 1fr; } }
.pack-line { display: flex; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.pack-line.done { border-color: var(--accent); background: var(--ok-soft); }
.pack-img { width: 96px; height: 96px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #fff; flex: 0 0 auto; }
.pack-img.placeholder { background: repeating-conic-gradient(#eee 0% 25%, #f8f8f8 0% 50%) 50%/20px 20px; }
.pack-line-name { font-size: 1.15rem; font-weight: 700; line-height: 1.3; }
.verify-btn { margin-left: auto; min-width: 92px; min-height: 56px; font-size: 1.2rem; font-weight: 800; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.pack-line.done .verify-btn { border-color: var(--accent); color: var(--accent); }
.qty { font-size: 1.5rem; font-weight: 800; min-width: 64px; text-align: center; }
.qty.multi { background: var(--ink); color: #fff; border-radius: 8px; padding: 4px 10px; }
.ship-bar { display: flex; gap: 10px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.ship-ok { margin-top: 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.card.wide { max-width: none; margin: 18px 0; }
.card h3 { margin: 0 0 6px; font-size: .95rem; }
.note-card { border-left: 4px solid var(--warn); }
.problem-form { display: flex; gap: 8px; margin-top: 10px; }
.problem-form select { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }

.rule-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rule-form input, .rule-form select { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: .95rem; }
.rule-form span { font-size: .75rem; font-weight: 800; letter-spacing: .08em; color: var(--sub); }
.disabled-row { opacity: .5; }

.adjust-form { display: flex; gap: 6px; align-items: center; }
.adjust-form input, .adjust-form select { padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.stock-num { font-size: 1.2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stock-num.zero { color: var(--bad); }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 10px; font-weight: 650; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

.label-form fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 12px; padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.label-form legend { font-size: .74rem; font-weight: 800; letter-spacing: .06em; color: var(--sub); text-transform: uppercase; padding: 0 6px; }
.label-form label { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; color: var(--sub); }
.label-form input, .label-form select, .label-form textarea { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: .9rem; }
.label-form textarea { width: 100%; font-family: ui-monospace, Menlo, monospace; }
.label-settings summary { cursor: pointer; }
.line-ov { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.line-ov:last-child { border-bottom: 0; }
.line-ov .sub { width: 100%; }
.tablewrap-x { overflow-x: auto; }
.item-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.item-form input { padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; font-size: .85rem; }

.bulk-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0; padding: 8px 12px; }
.tiny-select { padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; font-size: .8rem; }
.oos-row { box-shadow: inset 3px 0 0 var(--bad); }
.chip.oosflag { background: var(--bad); color: #fff; border-color: var(--bad); font-weight: 800; }
.typeicon { font-size: 1rem; font-weight: 800; color: var(--accent); cursor: help; margin-left: 4px; position: relative; }
.typeicon.dim { color: var(--muted); }
.typeicon.new { color: var(--warn); }
[data-tip] { position: relative; cursor: help; }
[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%); background: var(--ink); color: var(--ground);
  padding: 5px 10px; border-radius: 6px; font-size: .75rem; font-weight: 600;
  white-space: nowrap; z-index: 60; pointer-events: none; box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.tab-urgent.active, .tab-urgent { border-color: var(--warn); }
.statlink { text-decoration: none; color: var(--ink); display: block; }
.statlink:hover { border-color: var(--accent); }
.urgent-stat { border-left: 4px solid var(--warn); }
.oos-stat { border-left: 4px solid var(--bad); }

.period-picker { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0 16px; }
.custom-range { display: flex; align-items: center; gap: 6px; margin-left: 8px; }
.custom-range input { padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 14px 0 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.stat-num { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-label { font-size: .74rem; letter-spacing: .05em; text-transform: uppercase; color: var(--sub); }
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
.bar { height: 12px; background: var(--accent); border-radius: 3px; min-width: 2px; }
.total-row td { border-top: 2px solid var(--ink); font-size: 1.05rem; }
@media print {
  .topnav, .noprint { display: none !important; }
  body { background: #fff; }
  .card, .orders { border-color: #999; box-shadow: none; }
}

.login-body { display: grid; place-items: center; min-height: 100vh; margin: 0; background: var(--ground); font-family: "Seravek","Avenir Next","Segoe UI",system-ui,sans-serif; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 34px; display: flex; flex-direction: column; gap: 14px; width: 320px; }
.login-card input { padding: 14px; border: 1px solid var(--line); border-radius: 10px; font-size: 1.1rem; }
.error { color: var(--bad); margin: 0; }

.ship-progress { display: none; width: 100%; height: 8px; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; margin-top: 8px; }
.ship-progress div { height: 100%; width: 30%; background: var(--accent); animation: shipslide 1.1s linear infinite; }
@keyframes shipslide { from { margin-left: -30%; } to { margin-left: 100%; } }
.htmx-request .ship-progress, .ship-progress.htmx-request { display: block; }

.line-edit { position: relative; }
.line-edit summary { list-style: none; cursor: pointer; }
.line-edit-pop { position: absolute; right: 0; top: 110%; z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.15); display: flex; flex-direction: column; gap: 8px; min-width: 340px; }
