:root {
  --navy: #14284b;
  --navy-2: #1f3a68;
  --accent: #e8792b;
  --accent-dark: #c9611a;
  --green: #1e8e5a;
  --green-bg: #e3f5ec;
  --red: #c0392b;
  --red-bg: #fdecea;
  --amber-bg: #fff4dc;
  --amber: #a46a00;
  --bg: #eef1f6;
  --card: #ffffff;
  --text: #1b2433;
  --muted: #6b7587;
  --line: #dde2ea;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 40, 75, .06), 0 4px 14px rgba(20, 40, 75, .06);
  --tabbar-h: 64px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  color: var(--text);
  background: var(--bg);
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
}
a { color: var(--navy-2); }
small, .en { color: var(--muted); font-size: .78em; font-weight: 400; }
h1 { font-size: 1.45rem; margin: 4px 0 14px; line-height: 1.2; }
h2 { font-size: 1.12rem; margin: 22px 0 10px; }
h3 { font-size: 1rem; margin: 0 0 8px; }
h1 small, h2 small, h3 small { display: block; margin-top: 2px; }
h1 small small, h1 small a { display: inline; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: var(--navy); color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.brand-logo { height: 32px; width: auto; background: #fff; border-radius: 8px; padding: 3px 6px; }
.brand-text { font-weight: 700; font-size: 1.1rem; white-space: nowrap; }
.brand-text small { color: #b9c6dd; margin-left: 4px; }
.topbar-right { display: flex; align-items: center; gap: 10px; font-size: .9rem; }
.whoami { color: #d7e0ef; }
.btn-link { background: none; border: 0; color: #fff; font: inherit; cursor: pointer; padding: 6px 0; }
.btn-link small { color: #b9c6dd; }

/* ---------- layout ---------- */
.app { max-width: 760px; margin: 0 auto; padding: 16px; }
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin-bottom: 14px;
}
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > * { min-width: 0; }
.grow { flex: 1 1 auto; }
.between { justify-content: space-between; }
.muted { color: var(--muted); }
.center { text-align: center; }
.mt { margin-top: 12px; }
.stack > * + * { margin-top: 10px; }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: var(--tabbar-h); text-decoration: none; color: var(--muted); font-size: .72rem; line-height: 1.15;
}
.tabbar a small { font-size: .62rem; }
.tabbar .ti { font-size: 1.25rem; margin-bottom: 2px; filter: grayscale(1); opacity: .7; }
.tabbar a.active { color: var(--navy); font-weight: 600; }
.tabbar a.active .ti { filter: none; opacity: 1; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px; padding: 10px 16px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; color: var(--text);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn small { font-weight: 400; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary small { color: #ffe6d3; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-navy small { color: #c6d2e8; }
.btn-danger { color: var(--red); border-color: #efc4be; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .9rem; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; border-style: dashed; color: var(--navy-2); }

.big-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.big-btn {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 2px;
  min-height: 112px; padding: 16px; border-radius: 18px; text-decoration: none; color: #fff;
  font-weight: 700; font-size: 1.12rem; box-shadow: var(--shadow);
}
.big-btn .bi { font-size: 1.8rem; margin-bottom: auto; }
.big-btn small { color: rgba(255,255,255,.8); }
.big-btn.pickup { background: linear-gradient(135deg, #1f3a68, #14284b); }
.big-btn.deliver { background: linear-gradient(135deg, #f08a3e, #d9661c); }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { background: #fff; border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); text-decoration: none; color: inherit; }
.stat b { display: block; font-size: 1.4rem; color: var(--navy); }
.stat span { font-size: .8rem; line-height: 1.2; display: block; }
.stat.warn b { color: var(--red); }

/* ---------- forms ---------- */
label.field { display: block; margin-bottom: 12px; }
label.field > span, .field-label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 5px; }
input[type=text], input[type=number], input[type=date], input[type=password], input[type=tel], input[type=search], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px;
  border: 1px solid #c9d1dd; border-radius: 10px; background: #fff;
  font: inherit; font-size: 16px; color: var(--text);
  -webkit-appearance: none; appearance: none;
}
input[type=date] { display: block; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7587' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px;
}
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9fb6dd; border-color: var(--navy-2); }
.invalid { border-color: var(--red) !important; background: #fff7f6 !important; }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg button {
  min-height: 52px; border-radius: 12px; border: 2px solid var(--line); background: #fff;
  font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; padding: 6px; color: var(--text);
}
.seg button.on { border-color: var(--navy); background: #e8eef9; color: var(--navy); }

.check {
  display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line);
  border-radius: 12px; margin-bottom: 8px; cursor: pointer; background: #fff;
}
.check input { width: 24px; height: 24px; accent-color: var(--green); flex: none; }
.check.on { border-color: var(--green); background: var(--green-bg); }

.stepper { display: flex; align-items: stretch; }
.stepper button {
  width: 46px; border: 1px solid #c9d1dd; background: #f5f7fa; font-size: 1.3rem; cursor: pointer; color: var(--navy);
}
.stepper button:first-child { border-radius: 10px 0 0 10px; }
.stepper button:last-child { border-radius: 0 10px 10px 0; }
.stepper input { border-radius: 0; text-align: center; border-left: 0; border-right: 0; min-width: 60px; }

/* ---------- carton groups ---------- */
.group { border: 2px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; background: #fafbfd; }
.group-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.group-title { font-weight: 700; color: var(--navy); }
.badge-num {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  border-radius: 50%; background: var(--navy); color: #fff; font-size: .85rem; margin-right: 6px;
}
.item { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: #fff; margin-bottom: 8px; }
.item-row { display: grid; grid-template-columns: 1fr 110px; gap: 8px; }
.item-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.calc-line { background: #eef3fb; color: var(--navy); border-radius: 10px; padding: 8px 10px; font-weight: 600; font-size: .92rem; margin-top: 6px; }
.icon-btn { border: 0; background: none; color: var(--muted); font-size: 1.1rem; cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.icon-btn:hover { background: #eef1f6; color: var(--red); }

/* ---------- photos ---------- */
.photos { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ph {
  position: relative; width: 74px; height: 74px; border-radius: 10px; overflow: hidden; background: #e5e9f0; flex: none;
}
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.ph .ph-x {
  position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: .8rem; cursor: pointer; line-height: 1;
}
.ph.loading::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid #fff; border-top-color: var(--navy); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.ph-add {
  width: 74px; height: 74px; border-radius: 10px; border: 2px dashed #b6c1d2; background: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  font-size: .7rem; color: var(--navy-2); cursor: pointer; line-height: 1.1; text-align: center;
}
.ph-add .pi { font-size: 1.3rem; }
.ph-sm { width: 56px; height: 56px; }

/* ---------- lists ---------- */
.list { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 14px; }
.li {
  display: flex; gap: 12px; align-items: center; padding: 13px 14px; border-bottom: 1px solid var(--line);
  text-decoration: none; color: inherit;
}
.li:last-child { border-bottom: 0; }
.li:active { background: #f4f6fa; }
.li-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex: none; }
.li-icon.p { background: #e6ecf7; }
.li-icon.d { background: #fdeee2; }
.li-icon.c { background: #e9f4ee; }
.li-main { flex: 1; min-width: 0; }
.li-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.li-sub { color: var(--muted); font-size: .86rem; overflow: hidden; text-overflow: ellipsis; }
.li-right { text-align: right; font-size: .86rem; color: var(--muted); flex: none; }
.chev { color: #b0b8c6; }
.empty { padding: 26px 16px; text-align: center; color: var(--muted); }

.pill { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--green-bg); color: var(--green); }
.pill.no { background: #fdecea; color: var(--red); }
.pill.grey { background: #eceff4; color: var(--muted); }
.pill.navy { background: #e6ecf7; color: var(--navy); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.t { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.t th, table.t td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.t th { font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: none; line-height: 1.2; }
table.t th small { display: block; font-size: .9em; }
table.t td:first-child { word-break: break-word; }
@media (max-width: 480px) {
  table.t { font-size: .88rem; }
  table.t th, table.t td { padding: 8px 5px; }
}
.dv-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.dv-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 8px; }
.dv-top span { white-space: nowrap; font-size: .9rem; }
.dv-inputs { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; }
.dv-inputs input { text-align: center; }
.dv-inputs .btn { min-height: 46px; flex-direction: column; gap: 0; line-height: 1.1; }
table.t td.num, table.t th.num { text-align: right; white-space: nowrap; }
table.t tr:last-child td { border-bottom: 0; }
td.rem-pos { color: var(--navy); font-weight: 700; }
td.rem-zero { color: var(--green); font-weight: 600; }
td.rem-neg { color: var(--red); font-weight: 700; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .95rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.toolbar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar > input, .toolbar > select { flex: 1 1 160px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 10px; }
.chips button {
  border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 7px 12px; font: inherit; font-size: .88rem;
  white-space: nowrap; cursor: pointer; color: var(--text);
}
.chips button.on { background: var(--navy); color: #fff; border-color: var(--navy); }

.notice { border-radius: 12px; padding: 10px 12px; font-size: .92rem; margin-bottom: 12px; }
.notice.warn { background: var(--amber-bg); color: #6f4800; }
.notice.err { background: #fdecea; color: var(--red); }
.notice.info { background: #e8eef9; color: var(--navy); }

.sticky-save {
  position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 8px); z-index: 10;
  background: rgba(238, 241, 246, .92); backdrop-filter: blur(6px); padding: 10px 0 2px; margin-top: 8px;
}

.group-view { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-top: 10px; }
.group-view .gv-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 8px; }

/* ---------- login ---------- */
.login-wrap { position: fixed; inset: 0; z-index: 50; overflow-y: auto; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--navy); }
.login-card { width: 100%; max-width: 380px; background: #fff; border-radius: 20px; padding: 26px 22px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.login-card .logo { display: block; max-height: 56px; margin: 0 auto 12px; }
.login-card h1 { text-align: center; }

/* ---------- toast / modal / lightbox ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 100;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px);
  max-width: calc(100% - 32px); background: #1b2433; color: #fff; padding: 12px 16px; border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,.25); font-size: .95rem;
}
.toast.err { background: var(--red); }
.toast.ok { background: var(--green); }
.modal {
  position: fixed; inset: 0; z-index: 80; background: rgba(15, 25, 45, .55);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-box {
  width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; background: #fff;
  border-radius: 20px 20px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
}
@media (min-width: 640px) {
  .modal { align-items: center; }
  .modal-box { border-radius: 20px; }
}
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb-close { position: absolute; top: calc(env(safe-area-inset-top) + 12px); right: 14px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.18); color: #fff; font-size: 1.2rem; cursor: pointer; }

.loading-page { padding: 50px 0; text-align: center; color: var(--muted); }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #d4dbe6; border-top-color: var(--navy); animation: spin .8s linear infinite; margin: 0 auto 10px; }

@media (max-width: 420px) {
  .stats { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .stat { padding: 10px 8px; }
  .stat b { font-size: 1.2rem; }
  .item-row { grid-template-columns: 1fr 92px; }
  .whoami { display: none; }
}
.dv-inputs .field-label small { display: block; }

/* =================== v3 additions =================== */
:root { --teal: #0f8b8d; --teal-dark: #0b6f71; --amber-c: #c27c0e; }
.backlink { display: inline-block; color: var(--muted); text-decoration: none; margin-bottom: 6px; font-size: .95rem; }
.hint { color: var(--muted); font-size: .85rem; margin: 2px 0 10px; }
.amber-text { color: var(--amber-c); }

/* three big action buttons */
.big-actions { grid-template-columns: repeat(3, 1fr); gap: 10px; }
.big-btn { min-height: 104px; padding: 14px 12px; font-size: 1.02rem; }
.big-btn .bi { font-size: 1.6rem; }
.big-btn.unpack { background: linear-gradient(135deg, #14a3a5, #0b6f71); }
.big-btn small { font-size: .72rem; }

.btn-teal { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-teal small { color: #d2f1f1; }
.btn-teal:hover { background: var(--teal-dark); }
.stat.warn-amber b { color: var(--amber-c); }

.pill.amber { background: #fff1d6; color: #8a5a00; }
.notice.ok { background: var(--green-bg); color: var(--green); }

/* progress bar (opened cartons) */
.progress { height: 6px; background: #e4e8ef; border-radius: 99px; overflow: hidden; margin-top: 6px; }
.progress > div { height: 100%; background: linear-gradient(90deg, #14a3a5, #0f8b8d); border-radius: 99px; transition: width .3s; }
.progress.done > div { background: var(--green); }

/* list item photo / icons */
.li-photo { width: 48px; height: 48px; border-radius: 10px; overflow: hidden; flex: none; background: #e5e9f0; }
.li-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.li-icon.u { background: #dff3f3; }
.li-right .btn { pointer-events: none; }

/* avatars */
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #dbe4f3, #c3d0e8); color: var(--navy); font-weight: 700; font-size: .9rem;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.xl { width: 72px; height: 72px; font-size: 1.5rem; box-shadow: var(--shadow); }
.client-head { display: flex; align-items: center; gap: 14px; margin: 6px 0 16px; }

/* pickup page hero */
.hero-num { display: flex; align-items: baseline; gap: 10px; }
.hero-num b { font-size: 2.6rem; line-height: 1; color: var(--navy); }
.hero-num span { font-size: 1.1rem; font-weight: 600; }
.hero-num small { display: block; color: var(--muted); font-weight: 400; font-size: .75rem; }
.action-row { display: flex; gap: 8px; flex-wrap: wrap; }
.action-row .btn { flex: 1 1 auto; }

/* per-warehouse counters */
.wh-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.wh-stat { background: #fff; border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); }
.wh-name { font-weight: 700; font-size: .85rem; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wh-stat b { display: block; font-size: 1.5rem; color: var(--navy); margin-top: 4px; line-height: 1.1; }
.wh-stat span { font-size: .72rem; line-height: 1.2; display: block; }
.wh-all { font-size: .75rem; color: var(--muted); margin-top: 4px; }

/* numbered steps in the pickup form */
.card.step { position: relative; padding-left: 52px; }
.step-n {
  position: absolute; left: 14px; top: 16px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--navy); color: #fff; font-weight: 700; font-size: .85rem; display: flex; align-items: center; justify-content: center;
}
@media (max-width: 420px) {
  .card.step { padding-left: 16px; padding-top: 46px; }
  .step-n { top: 12px; left: 16px; }
}
.big-stepper .stepper input { font-size: 1.6rem; font-weight: 700; min-height: 58px; color: var(--navy); }
.big-stepper .stepper button { width: 58px; font-size: 1.6rem; }

.seg-3 button small, .seg-wrap button small { display: block; font-size: .72rem; font-weight: 400; color: var(--muted); }
.seg-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.seg-wrap button { flex: 1 1 140px; min-height: 52px; border-radius: 12px; border: 2px solid var(--line); background: #fff; font: inherit; font-weight: 600; cursor: pointer; padding: 6px 10px; color: var(--text); }
.seg-wrap button.on { border-color: var(--navy); background: #e8eef9; color: var(--navy); }

/* allocations & unpack blocks */
.alloc { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: #fafbfd; }
.calc-line.bad, .left-bar.bad { background: #fdecea; color: var(--red); }
.block { border-left: 4px solid var(--teal); }
.item-row2 { display: grid; grid-template-columns: 1fr 96px 34px; gap: 8px; margin-bottom: 8px; align-items: center; }
.docs-box { margin-top: 10px; padding: 12px; border-radius: 12px; background: #f6f8fb; }
.alloc-chip {
  display: block; width: 100%; text-align: left; margin-bottom: 8px; padding: 10px 12px; border-radius: 12px;
  border: 1px dashed var(--teal); background: #f2fbfb; font: inherit; color: var(--text); cursor: pointer;
}
.alloc-chip small { color: var(--teal-dark); }
.pickup-ref { display: block; text-decoration: none; color: inherit; border-left: 4px solid var(--navy); }
.ref-sub { color: var(--muted); font-size: .88rem; margin-top: 6px; }
.left-bar { background: #e6f5f5; color: var(--teal-dark); border-radius: 10px; padding: 8px 12px; font-size: .9rem; margin-bottom: 8px; text-align: center; }
.unpack-card { border-left: 4px solid var(--teal); }

.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.mini-stats div { background: #f4f6fa; border-radius: 12px; padding: 10px 6px; }
.mini-stats b { display: block; font-size: 1.3rem; color: var(--navy); }
.mini-stats span { font-size: .75rem; line-height: 1.2; display: block; }

.toolbar .btn { flex: none; }
.chips button small { color: inherit; opacity: .7; }

@media (max-width: 420px) {
  .big-btn { min-height: 96px; font-size: .95rem; padding: 12px 10px; }
  .wh-stat b { font-size: 1.25rem; }
}

/* =================== v4: warehouse by month =================== */
a.wh-stat { display: block; text-decoration: none; color: inherit; }
a.wh-stat:active { transform: translateY(1px); }
.wh-more { color: var(--navy-2); font-weight: 600; }
.bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; align-items: end; height: 150px; margin-top: 8px; }
.bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; text-decoration: none; color: var(--muted); }
.bar-fill { width: 100%; max-width: 26px; min-height: 2px; background: linear-gradient(180deg, #2b4c84, var(--navy)); border-radius: 6px 6px 2px 2px; }
.bar.zero .bar-fill { background: #e1e6ee; }
.bar-n { font-size: .72rem; font-weight: 700; color: var(--navy); margin-bottom: 2px; min-height: 1em; }
.bar-m { font-size: .66rem; margin-top: 4px; white-space: nowrap; }
details.month { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden; }
details.month summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; }
details.month summary::-webkit-details-marker { display: none; }
details.month summary::after { content: '›'; font-size: 1.4rem; color: var(--muted); transition: transform .2s; margin-left: 6px; }
details.month[open] summary::after { transform: rotate(90deg); }
details.month[open] summary { border-bottom: 1px solid var(--line); }
.month-total { margin-left: auto; font-weight: 700; color: var(--navy); background: #e8eef9; padding: 5px 10px; border-radius: 99px; white-space: nowrap; }
.month-pickup { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.month-pickup:last-child { border-bottom: 0; }
.mp-head { text-decoration: none; color: inherit; }

/* =================== v5: scrolling activity box =================== */
.scroll-box { max-height: 352px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; margin-bottom: 6px; }
.scroll-box .li { min-height: 88px; }

/* =================== v6: lists that scroll inside =================== */
.fill-scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; margin-bottom: 0; }

@media (max-width: 480px) {
  .wh-stats { gap: 6px; margin-bottom: 8px; }
  .wh-stat { padding: 8px; }
  .wh-stat b { font-size: 1.15rem; margin-top: 2px; }
  .wh-stat span small, .wh-all small { display: none; }
  .wh-all { margin-top: 2px; }
  .toolbar { margin-bottom: 8px; }
  .chips { margin-bottom: 6px; }
  h1 { margin-bottom: 10px; }
}

/* =================== v7: Itelgi branding =================== */
:root { --navy: #0a1a4f; --navy-2: #1a3a9a; }
.topbar { background: linear-gradient(90deg, #020b3a 0%, #0a1f6b 100%); }
.brand-logo { height: 30px; width: auto; background: none; border-radius: 0; padding: 0; }
.brand-text { padding-left: 10px; border-left: 1px solid rgba(255,255,255,.25); font-size: 1.02rem; }
@media (max-width: 420px) { .brand-text small { display: none; } .brand-logo { height: 26px; } }

.login-wrap {
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 44px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 1px, transparent 1px 44px),
    radial-gradient(ellipse at 50% 110%, #1238c4 0%, #0a2390 30%, #041456 65%, #010839 100%);
}
.login-inner { width: 100%; max-width: 400px; display: flex; flex-direction: column; align-items: center; gap: 26px; }
.login-logo { width: min(300px, 64vw); height: auto; filter: drop-shadow(0 6px 24px rgba(0,0,0,.35)); }
.login-card { max-width: 400px; }
.login-card h1 { margin-top: 0; }

/* =================== v10: extra pieces =================== */
.item-box { border: 1px solid var(--line); border-radius: 12px; padding: 8px; margin-bottom: 8px; background: #fff; }
.item-box .item-row2 { margin-bottom: 0; }
.extra-link { background: none; border: 0; padding: 6px 2px 0; font: inherit; font-size: .84rem; color: var(--amber-c); cursor: pointer; }
.extra-row { display: grid; grid-template-columns: 1fr 96px 34px; gap: 8px; align-items: center; margin-top: 8px;
  background: #fff6e6; border-radius: 10px; padding: 6px 0 6px 10px; font-size: .86rem; color: #7a4f00; }
.extra-row input { min-height: 40px; text-align: center; border-color: #f0c674; }
.extra-txt { color: #a06400; }
.extras-box summary b { color: #8a5a00; }
.extras-box .month-total { background: #fff1d6; color: #8a5a00; }

.li-prod { color: var(--text); font-weight: 600; }

.prod-cell { display: flex; align-items: center; gap: 10px; }
.prod-thumb { width: 44px; height: 44px; border-radius: 9px; object-fit: cover; flex: none; cursor: zoom-in; background: #e5e9f0; }
.prod-thumb.empty { display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; cursor: default; filter: grayscale(.4); opacity: .7; }
.prod-cell > div { min-width: 0; overflow-wrap: normal; word-break: normal; hyphens: auto; }
table.t td:first-child .prod-cell { word-break: normal; }
@media (max-width: 480px) {
  .prod-cell { gap: 8px; }
  .prod-thumb { width: 36px; height: 36px; border-radius: 8px; }
}

/* =================== v14: missing pieces =================== */
.extra-links { display: flex; gap: 16px; }
.miss-link { color: var(--red) !important; }
.miss-row { background: #fdecea; color: #8e2a1f; }
.miss-row input { border-color: #eaa59d; }
.miss-txt { color: var(--red); }
.miss-box summary b { color: var(--red); }
.miss-box .month-total { background: #fdecea; color: var(--red); }

/* =================== v15 =================== */
.month-sel { flex: 0 1 230px !important; min-width: 160px; }
.list-sum { font-size: .88rem; color: var(--muted); margin: -4px 2px 8px; }
.issue-box summary { align-items: flex-start; }
.issue-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.issue-sum { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.order-table th, .order-table td { white-space: normal; }
.miss-th, .owed { color: var(--red) !important; }
.owed { font-size: 1.05rem; }
.dv-owed { grid-template-columns: 1fr 90px auto; padding-right: 8px; margin: 0 0 8px; }
.dv-owed .btn { min-height: 40px; flex-direction: column; gap: 0; line-height: 1.1; }
.year-nav { display: flex; align-items: center; gap: 8px; }
.year-nav .btn { min-height: 32px; padding: 2px 12px; font-size: 1.1rem; }
.bar.now .bar-m { color: var(--navy); font-weight: 700; }
@media (max-width: 480px) {
  .order-table { font-size: .82rem; }
  .order-table th, .order-table td { padding: 7px 3px; }
  .order-table .prod-thumb { width: 30px; height: 30px; }
}

/* order table → stacked cards on phones */
@media (max-width: 600px) {
  .order-table, .order-table tbody { display: block; }
  .order-table tr:first-child { display: none; }
  .order-table tr { display: grid; grid-template-columns: repeat(var(--cols, 4), 1fr); gap: 4px 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .order-table:has(.miss-th) tr { --cols: 5; }
  .order-table td { border: 0 !important; padding: 0 !important; text-align: center !important; font-size: .95rem; }
  .order-table td:first-child { grid-column: 1 / -1; text-align: left !important; margin-bottom: 4px; }
  .order-table td[data-l]::before { content: attr(data-l); display: block; font-size: .64rem; color: var(--muted); font-weight: 600; margin-bottom: 1px; }
  .order-table .total-row { background: #f4f6fa; border-radius: 10px; padding: 8px 4px; border: 0; margin-top: 6px; }
  .order-table .prod-thumb { width: 38px; height: 38px; }
  .order-table .prod-cell > div { font-weight: 600; }
}

/* =================== v17: where products are =================== */
.place-txt { color: var(--navy-2); }
.place-box summary b { font-size: 1.05rem; }
.stock-row { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.stock-main { text-decoration: none; color: inherit; min-width: 0; }
.stock-qty { color: var(--navy); font-size: 1.05rem; white-space: nowrap; }
.stock-extras { padding: 10px 16px; border-top: 1px dashed #f0c674; display: flex; flex-wrap: wrap; gap: 6px; }
.from-field { margin: 0 0 8px; }
.from-field select { min-height: 40px; }
.from-one { font-size: .85rem; color: var(--navy-2); margin: -4px 0 6px; }

.unopened-fold > summary { list-style: none; cursor: pointer; }
.unopened-fold > summary::-webkit-details-marker { display: none; }
.stock-row.sub { padding: 8px 16px 8px 64px; font-size: .9rem; background: #fafbfd; }

/* =================== v19: places =================== */
.place-actions { display: flex; gap: 6px; align-items: center; }
.place-actions .btn { min-height: 36px; padding: 4px 10px; pointer-events: auto; }

/* v20: late arrival of missing pieces (довоз недостачи) */
.late-box { margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: #fff6dc; border: 1px solid #f0c674; color: #6b4e00; font-size: .9rem; }
.late-row { grid-template-columns: 1fr 84px auto; background: transparent; padding: 0; margin-top: 8px; }
.late-row .btn { min-height: 40px; flex-direction: column; gap: 0; line-height: 1.1; }
.late-txt { color: #9a6a00; }

/* v22: pieces without a client */
.check.unk { background: #fff6dc; border-color: #f0c674; }
.unk-note { display: block; text-decoration: none; font-weight: 600; margin-bottom: 12px; }
.as-row { grid-template-columns: 1fr 96px; }

/* v23: main system (hub) */
.hub-back { color: #fff; text-decoration: none; background: rgba(255,255,255,.14); border-radius: 999px; padding: 5px 11px; font-weight: 600; white-space: nowrap; }
.hub-card { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 14px; padding: 14px; margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(20,40,75,.08); text-decoration: none; color: inherit; }
.hub-card b { font-size: 1.05rem; color: var(--navy); }
.hub-card .hint { margin: 2px 0 0; }
.hub-card > div { flex: 1; min-width: 0; }
.hub-card.main { border: 2px solid var(--accent); }
.hub-card.soon { opacity: .6; }
.hub-ic { width: 46px; height: 46px; border-radius: 12px; background: #e8eef9; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; flex: none; }
.hub-go { font-size: 1.8rem; color: var(--accent); flex: none; }
.li-btn { width: 100%; background: none; border: 0; border-bottom: 1px solid #edf0f5; font: inherit; text-align: left; cursor: pointer; color: inherit; }
.li.off { opacity: .55; }
@media (max-width: 420px) { .whoami { display: none; } }
@media (max-width: 440px) {
  .topbar .btn-link small, .topbar .brand-text small { display: none; }
  .topbar-right { gap: 8px; }
}

/* v25: profiles */
.avatar.xs { width: 28px; height: 28px; font-size: .72rem; }
.whoami-link { display: inline-flex; align-items: center; gap: 7px; color: #d7e0ef; text-decoration: none; }
.whoami { display: inline-flex !important; }
.hub-hello { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; margin-bottom: 6px; }
.hub-hello h1 { margin: 0; }
.profile-photo { margin-bottom: 12px; }
@media (max-width: 440px) { .whoami-name { display: none; } }

/* v26: step 2 — local suppliers, defects, categories */
.seg.seg-2x2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg.seg-2x2 button { width: 100%; }
.supplier-pick { margin-top: 12px; padding: 12px; border-radius: 12px; background: #f3f6fb; border: 1px solid #dfe6f1; }
.supplier-pick .field { margin-bottom: 8px; }
.defect-row { background: #f3ecfb; color: #5b2b8a; }
.defect-row input { border-color: #c7a8e6; }
.defect-txt { color: #6b35a0; }
.extra-link.defect-link { color: #6b35a0; border-color: #d9c4ef; }
.cat-card .cat-name { font-size: 1.05rem; color: var(--navy); }
.cat-card.off { opacity: .55; }
.cat-kids { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.cat-chip { border: 1px solid #d5dce8; background: #f6f8fb; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .9rem; cursor: pointer; color: inherit; }
.cat-chip.off { opacity: .5; text-decoration: line-through; }
.cat-chip.add { border-style: dashed; color: var(--navy-2); background: transparent; }
.mb { margin-bottom: 12px; }
.extra-links { flex-wrap: wrap; row-gap: 4px; }
.wh-stats { display: grid !important; grid-template-columns: 1fr 1fr; gap: 10px; overflow: visible !important; }
.wh-stats .wh-stat { min-width: 0 !important; width: auto !important; }

/* v29: orders system */
.hub-search { margin: 4px 0 12px; }
.hub-search input { width: 100%; font-size: 1rem; }
.code-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--navy); color: #fff; border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.code-big { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.25rem; font-weight: 700; letter-spacing: .04em; }
.code-txt { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--navy-2); }
.code-link { display: block; background: #eef3fb; border-radius: 10px; padding: 8px 12px; margin: -4px 0 12px; text-decoration: none; color: var(--navy); font-size: .92rem; }
.wrap-gap { flex-wrap: wrap; gap: 6px; }
.sklad-link { display: block; text-decoration: none; color: inherit; }
.zk-row3 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.zk-item { margin-bottom: 10px; }
.zk-pay { display: grid; grid-template-columns: 1fr 1fr 34px; gap: 8px; align-items: center; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px dashed #dfe4ec; }
.zk-pay .zk-pay-note { grid-column: 1 / -1; }
.zk-sup:empty { display: none; }
.zk-sup { margin: -4px 0 8px; }
.code-big { font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.code-copy { flex: none; width: 44px; height: 44px; border-radius: 12px; border: 0; background: rgba(255,255,255,.15); font-size: 1.3rem; cursor: pointer; }
.money-stats b { font-size: 1.02rem !important; white-space: nowrap; }
#zkList .li-main { min-width: 0; flex: 1; }
#zkList .li-right { flex: none; max-width: 42%; }
#zkList .li-right .pill { white-space: nowrap; font-size: .78rem; }

/* v32: order steps, factory payments, client view */
.client-view { border: 2px solid var(--navy-2); }
.cv-stage { font-size: 1.2rem; font-weight: 700; color: var(--navy); margin: 4px 0; }
.cv-eta { font-size: .95rem; }
.line-card .small, .small { font-size: .85rem; }
.stage-dot { font-size: 1.4rem; flex: none; }
.steps { list-style: none; padding: 0; margin: 12px 0 8px; border-left: 2px solid #dfe4ec; margin-left: 10px; }
.steps li { position: relative; padding-left: 4px; }
.step-btn { display: grid; grid-template-columns: 24px 1fr auto; gap: 8px; align-items: center; width: 100%; background: none; border: 0; font: inherit; color: inherit; text-align: left; padding: 9px 4px; cursor: pointer; }
.steps li.auto .step-btn { cursor: default; }
.step-mark { width: 22px; height: 22px; margin-left: -16px; border-radius: 50%; background: #fff; border: 2px solid #c5cedb; display: flex; align-items: center; justify-content: center; font-size: .75rem; color: #fff; }
.steps li.done .step-mark { background: var(--green); border-color: var(--green); }
.step-name { font-size: .92rem; }
.steps li:not(.done) .step-name { color: var(--muted); }
.step-date { font-size: .85rem; font-weight: 600; white-space: nowrap; }
.step-set { color: var(--navy-2); font-weight: 600; border: 1px dashed #b9c6dd; border-radius: 999px; padding: 3px 10px; }
.step-eta { font-size: .82rem; color: var(--navy-2); margin: -4px 0 6px 36px; font-weight: 600; }
.factory-box { background: #f6f8fb; border-radius: 12px; padding: 10px 12px; }
.factory-box.warn { background: var(--red-bg); }
.fp-row { display: flex; justify-content: space-between; align-items: center; font-size: .88rem; padding: 4px 0; border-bottom: 1px dashed #dfe4ec; }
.icon-btn.sm { width: 26px; height: 26px; font-size: .8rem; }

/* v35 — link for the client (public tracking page) */
.cv-link { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.cv-link .btn { flex: 1 1 auto; text-align: center; }

/* v36 — reports */
.rp-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 4px; }
.rp-dates .btn { grid-column: 1 / -1; }
.rp-dates label { font-size: .8rem; color: var(--muted); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rp-dates label small { display: none; }
.rp-dates input { font-size: 15px; padding: 8px; }
.rp-dates input { width: 100%; min-width: 0; }
.rp-period { margin: 6px 0 10px; }
.rp-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.rp-tiles > div { background: #fff; border-radius: var(--radius); padding: 10px 12px; box-shadow: var(--shadow); min-width: 0; }
.rp-tiles b { display: block; font-size: 1.25rem; color: var(--navy); line-height: 1.15; overflow-wrap: anywhere; }
.rp-tiles b small { font-size: .75rem; font-weight: 500; }
.rp-tiles span { display: block; font-size: .75rem; line-height: 1.25; color: var(--muted); margin-top: 3px; }
.rp-tiles .ok b { color: var(--green); }
.rp-tiles .warn b { color: var(--amber); }
.rp-tiles .bad b { color: var(--red); }
.muted.small { font-size: .8rem; }
.rp-cat { padding: 12px 14px; }
.rp-cat summary { list-style: none; cursor: pointer; }
.rp-cat summary::-webkit-details-marker { display: none; }
.rp-cat summary .row b:first-child::after { content: ' ▾'; color: var(--muted); font-weight: 400; }
.rp-cat:not([open]) summary .row b:first-child::after { content: ' ▸'; }
.rp-facts { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .82rem; color: var(--muted); margin-top: 4px; }
.rp-facts b { color: var(--text); }
.rp-f { white-space: nowrap; }
.rp-warn, .rp-warn b { color: var(--amber) !important; }
.rp-bad, .rp-bad b { color: var(--red) !important; }
.rp-sub { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--navy-2); }
.rp-prod { padding: 8px 0 8px 12px; border-left: 3px solid var(--line); margin-top: 8px; }
.rp-pn { font-weight: 600; overflow-wrap: anywhere; }
.rp-day { padding: 8px 14px 4px; font-size: .8rem; font-weight: 700; color: var(--muted); background: #f4f6fa; }
.rp-line .li-right { text-align: right; white-space: nowrap; }
.rp-money { color: var(--green); }

/* =====================================================================
   v37 — NEW DESIGN (Lovable style): Manrope, navy + orange, left menu
   ===================================================================== */
:root {
  --navy: #14284b; --navy-2: #1f3a68; --accent: #e8792b; --accent-dark: #cf6519; --accent-bg: #fdeee2;
  --green: #1e8e5a; --green-bg: #e3f5ec; --red: #c0392b; --red-bg: #fdecea; --amber: #a46a00; --amber-bg: #fff1d6;
  --bg: #eef1f6; --card: #fff; --text: #17223b; --muted: #6b7587; --line: #e4e8ef;
  --radius: 18px; --shadow: 0 1px 2px rgba(20, 40, 75, .04), 0 4px 14px rgba(20, 40, 75, .04);
  --tabbar-h: 68px; --sidebar-w: 292px;
}
body { font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; font-size: 15px; font-feature-settings: "tnum" 1; color: var(--text); }
h1 { font-size: 1.65rem; font-weight: 800; letter-spacing: -.015em; color: var(--text); }
h1 small { font-size: .55em; font-weight: 500; margin-top: 4px; letter-spacing: 0; }
h2 { font-size: 1.08rem; font-weight: 800; letter-spacing: -.005em; margin: 26px 0 12px; }
h2 small { display: inline; margin-left: 8px; font-size: .74em; font-weight: 500; }
b, strong { font-weight: 700; }
.ico { width: 1.2em; height: 1.2em; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -.24em; }
.app { max-width: 640px; padding: 22px 16px 24px; }

/* ---------- top bar ---------- */
.topbar { background: var(--navy); padding: calc(env(safe-area-inset-top) + 12px) 16px 12px; display: block; }
.topbar-in { max-width: 640px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand-logo { height: 34px; }
.brand-text { border-left: 1px solid rgba(255,255,255,.22); padding-left: 14px; font-size: .95rem; font-weight: 700; line-height: 1.15; }
.brand-text small { display: block; margin: 2px 0 0; font-size: .74rem; color: #b9c6dd; font-weight: 500; }
.topbar-right { gap: 14px; }
.whoami-link .avatar.xs { width: 34px; height: 34px; border: 2px solid rgba(255,255,255,.25); }
.whoami-name { display: none; }
.logout { display: inline-flex !important; align-items: center; gap: 8px; line-height: 1.15; font-weight: 600; font-size: .9rem; text-align: left; }
.logout small { display: block; font-size: .72rem; color: #b9c6dd !important; }
.logout .ico { width: 20px; height: 20px; }
.hub-back { font-size: .85rem; }

/* ---------- left menu (computers, tablets in landscape) ---------- */
.sidebar { display: none; }
@media (min-width: 1100px) {
  body.has-sidebar { padding-left: var(--sidebar-w); padding-bottom: 32px; }
  body.has-sidebar .tabbar { display: none !important; }
  body.has-sidebar .toast { bottom: 28px; }
  body.has-sidebar .sticky-save { bottom: 8px; }
  .app { padding-top: 34px; }
  .sidebar:not([hidden]) { display: flex; }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: var(--sidebar-w); z-index: 25; flex-direction: column;
    background: #fff; border-right: 1px solid var(--line); padding: 26px 18px 20px; overflow-y: auto; }
}
.sb-logo { display: inline-flex; align-self: flex-start; background: var(--navy); border-radius: 14px; padding: 12px 16px; }
.sb-logo img { height: 34px; width: auto; display: block; }
.sb-title { font-size: 1.32rem; font-weight: 800; margin: 22px 4px 4px; letter-spacing: -.01em; }
.sb-title small { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .02em; margin-top: 4px; font-weight: 500; }
.sb-sec { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 22px 6px 8px; }
.sb-sec span { font-weight: 600; opacity: .8; }
.sb-nav a { display: grid; grid-template-columns: 22px 1fr auto; gap: 14px; align-items: center; padding: 10px 14px; border-radius: 14px;
  color: #3a465e; text-decoration: none; margin-bottom: 2px; transition: background .15s; }
.sb-nav a .ico { width: 21px; height: 21px; }
.sb-nav a:hover { background: #f3f5f9; }
.sb-t { font-weight: 600; font-size: .93rem; line-height: 1.2; }
.sb-t small { display: block; font-size: .74rem; font-weight: 500; margin-top: 2px; }
.sb-n { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .72rem; font-weight: 700; color: #9aa3b2; }
svg.sb-n { width: 15px; height: 15px; }
.sb-nav a.active { background: var(--navy); color: #fff; box-shadow: 0 8px 20px rgba(20, 40, 75, .22); }
.sb-nav a.active .ico { color: var(--accent); }
.sb-nav a.active small, .sb-nav a.active .sb-n { color: #b9c6dd; }
.sb-foot { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
.sb-me { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); font-weight: 700; font-size: .92rem; }
.sb-me small { display: block; font-weight: 500; font-size: .74rem; }
.sb-city { font-size: .74rem; color: var(--muted); margin-top: 10px; }
.avatar.sm { width: 38px; height: 38px; font-size: .85rem; }

/* ---------- bottom menu (phones) ---------- */
.tabbar { background: rgba(255,255,255,.97); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
#hubbar { grid-template-columns: repeat(5, 1fr); }
.tabbar a { font-size: .72rem; font-weight: 600; color: #4c566a; gap: 1px; }
.tabbar a small { font-size: .6rem; font-weight: 500; }
.tabbar .ti { filter: none; opacity: 1; width: 46px; height: 30px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 2px; font-size: 1rem; }
.tabbar .ti .ico { width: 22px; height: 22px; stroke-width: 1.8; }
.tabbar a.active { color: var(--navy); font-weight: 800; }
.tabbar a.active .ti { background: var(--accent-bg); color: var(--accent); filter: none; }

/* ---------- cards, lists, buttons, inputs ---------- */
.card, .list, details.month, .stat, .wh-stat, .rp-tiles > div { border: 1px solid #e8ecf2; box-shadow: var(--shadow); border-radius: var(--radius); }
.card { padding: 18px; }
.li { padding: 15px 16px; border-bottom-color: #edf0f5; }
.li-title { font-weight: 700; }
.li-icon { border-radius: 12px; }
.btn { border-radius: 12px; min-height: 48px; font-weight: 700; border-color: #dfe4ec; gap: 8px; }
.btn small { font-weight: 500; opacity: .85; }
.btn .ico { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); border-color: var(--accent); box-shadow: 0 6px 16px rgba(232, 121, 43, .22); }
.btn-primary small { color: #fff; opacity: .78; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-lg { min-height: 58px; border-radius: 14px; font-size: 1.02rem; margin: 4px 0 6px; }
.btn-icon { width: 52px; min-height: 52px; padding: 0; border-radius: 14px; }
.btn-icon .ico { width: 22px; height: 22px; }
.btn-sm { min-height: 38px; }
.btn-danger { color: var(--red); background: #fff; }
input[type=text], input[type=number], input[type=date], input[type=password], input[type=tel], input[type=search], select, textarea {
  border: 1px solid #dce2eb; border-radius: 12px; min-height: 48px; padding: 11px 14px; font-family: inherit; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(31, 58, 104, .14); border-color: var(--navy-2); }
label.field > span, .field-label { font-weight: 700; font-size: .9rem; }
.field-hint { font-size: .78rem; color: var(--muted); margin: 6px 2px 16px; }
.chips button { border-radius: 10px; padding: 8px 13px; font-weight: 600; border-color: #dfe4ec; }
.backlink { font-weight: 600; font-size: .9rem; }
.hint { font-size: .86rem; }

/* status pills */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 8px; font-size: .78rem; font-weight: 700; }
.pill .ico { width: 14px; height: 14px; }
.pill.amber { background: var(--amber-bg); color: var(--amber); }
.pill.navy { background: #e8edf6; color: var(--navy); }
.pill.orange { background: var(--accent-bg); color: var(--accent-dark); }
.pill.green, .pill.ok { background: var(--green-bg); color: var(--green); }
.pill.grey { background: #edf0f4; color: #5b6578; }
.st-pill { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.st-pill small { font-size: .7rem; padding-right: 2px; }
.stage-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 16px; }
.stage-bar i { height: 4px; border-radius: 4px; background: #e3e8f1; }
.stage-bar i.on { background: var(--navy); }

/* ---------- main page ---------- */
.hub-hello { display: flex; align-items: center; gap: 16px; margin: 0 0 22px; }
.hub-hello h1 { margin: 2px 0 0; font-size: 1.85rem; }
.hub-hello h1 small { font-size: .5em; }
.hub-date { font-size: .7rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.role-badge { align-self: flex-start; background: #e6ebf5; color: var(--navy); border-radius: 10px; padding: 8px 12px; font-weight: 800; font-size: .8rem; white-space: nowrap; }
.role-badge small { color: var(--muted); font-weight: 500; margin-left: 3px; }
.hero-card { display: block; background: var(--navy); color: #fff; border-radius: 22px; padding: 24px 22px 16px; text-decoration: none; margin-bottom: 16px;
  box-shadow: 0 12px 30px rgba(20, 40, 75, .22); }
.hero-top { display: flex; gap: 18px; align-items: flex-start; }
.hero-ic { width: 58px; height: 58px; border-radius: 16px; background: rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center; flex: none; }
.hero-ic .ico { width: 28px; height: 28px; }
.hero-top b { font-size: 1.35rem; font-weight: 800; }
.hero-top small { color: #b9c6dd; margin-left: 4px; }
.hero-hint { color: #c9d3e6; font-size: .9rem; margin-top: 4px; }
.hero-stats { display: flex; gap: 30px; margin-top: 16px; flex-wrap: wrap; }
.hero-stats b { display: block; font-size: 2rem; font-weight: 800; line-height: 1.05; }
.hero-stats span { font-size: .8rem; color: #dfe6f2; }
.hero-go { color: var(--accent); align-self: center; }
.hero-go .ico { width: 24px; height: 24px; }
.hero-route { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.12); font-size: .82rem; color: #dfe6f2; }
.hero-route span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.hero-route i { flex: 1; border-top: 1.5px dashed rgba(255,255,255,.28); }
.hero-route .hero-truck { color: var(--accent); width: 22px; height: 22px; }
.hub-search, .search-box { position: relative; margin: 0; }
.hub-search input, .search-box input { min-height: 58px; padding-left: 50px; border-radius: 16px; font-size: 1rem; border-color: #dfe4ec; background: #fff; }
.search-ic { position: absolute; left: 18px; top: 18px; color: var(--muted); pointer-events: none; }
.search-ic .ico { width: 21px; height: 21px; }
.hub-card { padding: 22px 20px; border-radius: var(--radius); border: 1px solid #e8ecf2; box-shadow: var(--shadow); margin-bottom: 14px; gap: 16px; }
.hub-card b { font-size: 1.22rem; font-weight: 800; color: var(--text); }
.hub-card .hint { font-size: .9rem; margin-top: 4px; }
.hub-ic { width: 54px; height: 54px; border-radius: 15px; background: var(--accent-bg); color: var(--accent); }
.hub-ic .ico { width: 26px; height: 26px; }
.hub-go { color: #8a93a3; font-size: 1rem; }
.hub-go .ico { width: 22px; height: 22px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; }
.count-badge { background: var(--amber-bg); color: var(--amber); font-weight: 800; font-size: .78rem; min-width: 26px; height: 26px; border-radius: 99px; display: inline-flex; align-items: center; justify-content: center; padding: 0 8px; }
.li.attn { align-items: flex-start; padding: 18px 18px; }
.attn-ic { margin-top: 1px; }
.attn-ic .ico { width: 22px; height: 22px; }
.attn-ic.bad { color: #b4561c; }
.attn-ic.warn { color: var(--amber); }
.li-sub.strong { color: var(--text); font-weight: 600; margin-top: 2px; }
.chev { color: #8a93a3; align-self: center; }
.chev .ico { width: 20px; height: 20px; }
.two-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
.two-btns .btn { background: #fff; min-height: 54px; }
.uptodate { text-align: center; font-size: .8rem; color: var(--muted); margin: 18px 0 4px; }

/* ---------- orders list ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.seg-tabs { display: flex; gap: 4px; background: #e3e8f1; border-radius: 14px; padding: 5px; overflow-x: auto; margin-bottom: 4px; }
.seg-tabs button { flex: 1 0 auto; border: 0; background: transparent; border-radius: 10px; padding: 8px 10px; font: inherit; font-weight: 700; font-size: .84rem; color: #3b4660; cursor: pointer; white-space: nowrap; line-height: 1.15; }
.seg-tabs button small { display: block; font-size: .64rem; font-weight: 500; margin-top: 2px; }
.seg-tabs button.on { background: var(--navy); color: #fff; box-shadow: 0 4px 10px rgba(20, 40, 75, .2); }
.seg-tabs button.on small { color: #b9c6dd; }
.list-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 2px 12px; font-size: .85rem; color: var(--muted); }
.mini-select { display: inline-flex; align-items: center; gap: 4px; color: var(--text); }
.mini-select select { border: 0; background-color: transparent; min-height: 34px; padding: 4px 26px 4px 4px; font-weight: 700; font-size: .88rem; width: auto; background-position: right 4px center; }
.mini-select select:focus { outline: none; }
.order-card { display: block; background: #fff; border: 1px solid #e8ecf2; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 20px 18px; margin-bottom: 14px; text-decoration: none; color: var(--text); }
.order-card:active { transform: translateY(1px); }
.order-card.closed { opacity: .75; }
.oc-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.oc-client { font-size: 1.1rem; font-weight: 800; min-width: 0; overflow-wrap: anywhere; }
.oc-sum { font-weight: 800; white-space: nowrap; }
.oc-mid { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.oc-items { font-size: .92rem; overflow-wrap: anywhere; }
.oc-code { font-size: .74rem; margin-top: 3px; color: var(--muted); letter-spacing: .03em; }
.oc-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid #edf0f5; margin-top: 14px; padding-top: 14px; }
.oc-man { display: inline-flex; align-items: center; gap: 10px; font-size: .9rem; color: #3b4660; }
.ini { width: 24px; height: 24px; border-radius: 50%; background: #eef1f6; color: var(--muted); font-size: .68rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.oc-warn { margin-top: 10px; font-size: .82rem; font-weight: 700; color: var(--red); display: flex; align-items: center; gap: 6px; }

/* ---------- order page ---------- */
.code-box { border-radius: var(--radius); padding: 16px 18px; box-shadow: 0 10px 24px rgba(20, 40, 75, .18); }
.code-lbl { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: #b9c6dd; margin-bottom: 4px; }
.code-lbl small { color: #8fa0bf; text-transform: none; letter-spacing: 0; font-weight: 500; margin-left: 4px; }
.code-big { font-size: 1.35rem; letter-spacing: .05em; }
.code-copy { color: #fff; display: flex; align-items: center; justify-content: center; }
.code-copy .ico { width: 20px; height: 20px; }
.client-view { border: 1px solid #e8ecf2; border-left: 4px solid var(--navy); }
.cv-stage { margin: 8px 0 0; }
.cv-stage .st-pill { align-items: flex-start; }
.cv-stage .pill { font-size: .92rem; padding: 7px 12px; }
.client-view .stage-bar { margin: 12px 0 14px; }
.cv-eta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mini-stats div { background: #f4f6fa; border-radius: 14px; }
.mini-stats b { font-weight: 800; }

/* ---------- Склад screens ---------- */
.big-btn { border-radius: 18px; box-shadow: 0 10px 22px rgba(20, 40, 75, .16); font-weight: 800; }
.big-btn.pickup { background: var(--navy); }
.big-btn.unpack { background: var(--navy-2); }
.big-btn.deliver { background: var(--accent); }
.stat b, .wh-stat b { font-weight: 800; }
.seg button.on, .seg-wrap button.on { border-color: var(--navy); background: #e8edf6; }
.notice { border-radius: 14px; }

/* ---------- login ---------- */
.login-wrap { background: var(--navy) !important; }
.login-inner { gap: 0; max-width: 420px; }
.login-logo { width: 170px; filter: none; }
.login-sub { color: #fff; font-weight: 700; font-size: 1rem; text-align: center; margin: 22px 0 46px; }
.login-sub small { display: block; color: #9fb0cf; font-size: .78rem; font-weight: 500; margin-top: 3px; }
.login-wrap .login-card { background: transparent; box-shadow: none; padding: 0; width: 100%; }
.login-wrap .login-card h1 { color: #fff; text-align: left; font-size: 1.85rem; margin-bottom: 26px; }
.login-wrap .login-card h1 small { color: #9fb0cf; }
.login-wrap label.field > span { color: #fff; }
.login-wrap label.field > span small { color: #9fb0cf; }
.login-wrap input { background: rgba(255,255,255,.06) !important; border-color: rgba(255,255,255,.14) !important; color: #fff !important; min-height: 54px; }
.login-wrap input::placeholder { color: #8090ad; }
.login-wrap .btn-primary { min-height: 54px; margin-top: 10px; box-shadow: none; }
.pw-wrap { position: relative; display: block; }
.pw-eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: #9fb0cf; padding: 8px; cursor: pointer; }
.login-foot { display: flex; flex-direction: column; align-items: center; gap: 8px; color: #9fb0cf; font-size: .78rem; text-align: center; margin-top: 48px; line-height: 1.5; }
.login-foot small { display: block; color: #7385a6; }

@media (max-width: 480px) {
  h1 { font-size: 1.5rem; }
  .hub-hello { gap: 12px; }
  .hub-hello h1 { font-size: 1.5rem; }
  .avatar.xl { width: 58px; height: 58px; }
  .role-badge { padding: 6px 9px; font-size: .74rem; }
  .role-badge small { display: none; }
  .hero-card { padding: 20px 18px 14px; }
  .hero-ic { width: 48px; height: 48px; }
  .hero-stats { gap: 22px; }
  .hero-stats b { font-size: 1.7rem; }
  .order-card { padding: 16px 16px 14px; }
  .brand-logo { height: 28px; }
  .logout span { display: none; }
}
/* v37 fixes */
:root { --teal: #1f3a68; --teal-dark: #14284b; }
.progress > div { background: var(--navy-2); }
.li-icon.u, .li-icon.p { background: #e8edf6; }
.alloc-chip { border-color: #b9c6dd; background: #f4f7fc; }
.left-bar { background: #e8edf6; color: var(--navy); }
.big-btn .bi { width: 44px; height: 44px; border-radius: 12px; background: rgba(255,255,255,.14); display: flex; align-items: center; justify-content: center; }
.big-btn .bi .ico { width: 24px; height: 24px; }
.pay-ic { color: var(--green); }
@media (min-width: 1100px) { .hub-back { display: none !important; } }

/* =====================================================================
   v38 — Sami's notes: new logo, money on orders, supplier payments, reports scroll
   ===================================================================== */
/* new gift logo: dark-blue card in the left menu, plain on the navy top bar */
.sb-logo { background: radial-gradient(ellipse at 50% 120%, #1238c4 0%, #0a2390 35%, #041456 70%, #020a3c 100%); padding: 16px 20px; border-radius: 16px; box-shadow: 0 8px 20px rgba(10, 30, 110, .25); }
.sb-logo img { height: 36px; }
.brand-logo { height: 32px; }
.sb-ext-ic { width: 15px !important; height: 15px !important; color: #9aa3b2; }
.sb-nav a { grid-template-columns: 22px 1fr auto; }
.login-logo { width: min(240px, 60vw); }

/* pills */
.pill.red { background: var(--red-bg); color: var(--red); }
.pill.violet { background: #efe8fb; color: #6338a8; }
.owe { color: var(--red); }
.ok-txt { color: var(--green); font-weight: 700; }

/* orders list */
.filt-label { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 12px 2px 6px; }
.chips.filt { margin-bottom: 2px; }
.chips.filt button { background: #fff; }
.chips.filt button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.oc-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.oc-money { margin-top: 10px; font-size: .88rem; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.oc-money .ico { width: 16px; height: 16px; color: var(--muted); }
.money-bar { height: 6px; border-radius: 6px; background: #eef1f6; margin-top: 8px; overflow: hidden; }
.money-bar i { display: block; height: 100%; background: var(--green); border-radius: 6px; }

/* order form */
.zk-align { align-items: end; }
.zk-pay { grid-template-columns: 1fr 1fr 34px; }
.zk-pay .zk-pay-kind { grid-column: 1 / 2; }
.zk-pay .zk-pay-note { grid-column: 2 / -1; }
select:disabled { background-color: #f4f6fa; color: var(--muted); }
.seg.seg-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg button small { display: block; font-size: .72rem; font-weight: 500; color: var(--muted); }
.factory-box.warn { background: var(--red-bg); }

/* supplier payments page */
.sp-totals { background: var(--navy); color: #fff; border-radius: 18px; padding: 16px 18px; margin-bottom: 16px; box-shadow: 0 10px 24px rgba(20, 40, 75, .18); }
.sp-tl { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: #b9c6dd; }
.sp-tv { display: flex; flex-wrap: wrap; gap: 8px 26px; margin-top: 6px; }
.sp-tv b { display: block; font-size: 1.5rem; font-weight: 800; }
.sp-tv span { font-size: .75rem; color: #c9d3e6; }
.sp-card { padding-bottom: 14px; }
.sp-link { display: block; text-decoration: none; color: inherit; }
.sp-pays { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sp-pays span { font-size: .78rem; background: #f4f6fa; border-radius: 8px; padding: 4px 8px; }
.sp-actions { margin-top: 12px; }

/* reports: categories and statement scroll inside their white box */
.rp-scroll { max-height: 360px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; margin-top: 4px; padding-right: 4px; }
.rp-statement { max-height: 70vh; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.rp-statement .rp-day { position: sticky; top: 0; z-index: 1; }

/* Склад: pickup photos in issue rows */
.iss-row { display: flex; gap: 12px; align-items: flex-start; }
.issue-box summary .li-photo, .issue-box summary .li-icon { width: 46px; height: 46px; }
.li-icon .ico { width: 22px; height: 22px; color: var(--navy-2); }
/* v38 fixes */
.login-wrap { align-items: flex-start; }
.login-inner { margin: auto; padding: 24px 0; }
@media (max-width: 480px) { .login-logo { width: 170px; } .login-sub { margin: 14px 0 28px; } .login-foot { margin-top: 28px; } }
.brand { min-width: 0; flex: 1 1 auto; }
.brand-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-text small { overflow: hidden; text-overflow: ellipsis; }
.topbar-right { flex: none; }

/* v40 */
.t tr.t-total td{border-top:2px solid var(--line,#d8dee9);border-bottom:0;padding-top:12px;font-size:1.02em}

/* v41: defect among extras */
.check.defect-extra{margin:6px 0 4px;font-size:.92rem;background:#f3effa;border-radius:10px;padding:8px 10px}

/* v43: search fields, country picker, instructions, supplier page, history filters */
select.ss-hidden { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important; overflow: hidden; }
.ss-box { position: relative; }
.ss-box .ss-input { width: 100%; padding-right: 40px; }
.ss-box .ss-caret { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); cursor: pointer; font-size: .9rem; }
.ss-box.invalid .ss-input { border-color: var(--red); background: var(--red-bg); }
.ss-input:disabled { background: #f3f5f9; color: var(--muted); }
.ss-list { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 4px); max-height: 280px; overflow-y: auto; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 12px 28px rgba(20, 40, 75, .16); padding: 4px; -webkit-overflow-scrolling: touch; }
.ss-item { padding: 11px 12px; border-radius: 9px; cursor: pointer; font-size: .97rem; }
.ss-item.hi, .ss-item:hover { background: #eef2fa; }
.ss-item.on { font-weight: 700; color: var(--navy); }
.ss-empty { padding: 11px 12px; color: var(--muted); font-size: .9rem; }
.ss-new { margin-left: 10px; border: 1px dashed var(--navy-2); background: #f4f7fd; color: var(--navy-2); border-radius: 999px; padding: 3px 10px;
  font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; vertical-align: middle; }
.ss-new small { font-weight: 400; opacity: .75; }
.seg.seg-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 560px) { .seg.seg-4 { grid-template-columns: 1fr 1fr; } }
.cc-other { margin-top: 8px; }
.line-total { font-size: .9rem; color: var(--muted); margin: -4px 0 10px; min-height: 2px; }
.line-total b { color: var(--text); }
details.howto { background: #f4f7fd; border: 1px solid #dfe6f3; border-radius: 12px; margin: 6px 0 14px; }
details.howto > summary { cursor: pointer; padding: 11px 14px; font-weight: 700; color: var(--navy-2); list-style: none; }
details.howto > summary::-webkit-details-marker { display: none; }
details.howto[open] > summary { border-bottom: 1px solid #dfe6f3; }
.howto-body { padding: 10px 16px 6px; font-size: .92rem; line-height: 1.5; }
.howto-body ul, .howto-body ol, .howto-card ul, .howto-card ol { margin: 4px 0 10px; padding-left: 20px; }
.howto-body li, .howto-card li { margin: 3px 0; }
.howto-card h3 { margin: 12px 0 4px; font-size: 1rem; }
.howto-card h3:first-child { margin-top: 0; }
.au-filters { display: grid; grid-template-columns: 2fr 1.4fr 1fr; gap: 10px; }
@media (max-width: 560px) { .au-filters { grid-template-columns: 1fr 1fr; } .au-filters .field:first-child { grid-column: 1 / -1; } }
.money-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-bottom: 8px; }
.money-row > div { background: #f6f8fb; border-radius: 10px; padding: 10px; text-align: center; }
.money-row b { display: block; font-size: 1.02rem; }
.money-row span { font-size: .78rem; color: var(--muted); }
.money-row .bad b { color: var(--red); }
.kv { margin: 4px 0; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: .85em; }
.zk-amount-hint { margin-top: -6px; }

/* v44: warehouse table inside the order page, product links */
.wh-table td .small { font-size: .82rem; margin-top: 2px; line-height: 1.35; }
.ok-txt { color: var(--green); }
.link-btn { border: 0; background: none; color: var(--navy-2); text-decoration: underline; font: inherit; font-size: .82rem; cursor: pointer; padding: 0 0 0 4px; }
.notice.unlinked .btn { display: inline-flex; }
.li-btn.on { outline: 2px solid var(--navy); }


/* ===== v46: live location, move history, unassigned row ===== */
.live-loc { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: #eef4ff; border: 1px solid #d6e3fb; font-size: .92rem; line-height: 1.5; }
.live-loc.done { background: #ecf8f0; border-color: #cdebd7; }
.live-dot { flex: none; width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: #2f7cf6; box-shadow: 0 0 0 0 rgba(47,124,246,.5); animation: livePulse 1.8s infinite; }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(47,124,246,.5); } 70% { box-shadow: 0 0 0 8px rgba(47,124,246,0); } 100% { box-shadow: 0 0 0 0 rgba(47,124,246,0); } }
.oc-where { margin-top: 8px; font-size: .88rem; color: var(--navy-2, #1d2b4f); background: #f3f6fb; border-radius: 10px; padding: 6px 10px; display: inline-block; }
.unk-li { margin-bottom: 12px; border: 1px dashed #e0b44a; background: #fffaf0; border-radius: var(--radius); }
.unk-av { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 50%; background: #fdf0d2; font-size: 1.2rem; flex: none; }
.hist-li { align-items: flex-start; }
.hist-li .li-sub a { color: var(--navy-2, #1d2b4f); }
#hiKind { margin: 0; }
.line-desc { color: var(--muted, #6b7280); font-size: .9rem; margin: 2px 0 4px; }
/* v50: categories search & collapse */
.cat-tools { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.cat-tools .search-box { margin: 0; }
.cat-toggle { background: none; border: 0; padding: 4px 0; font: inherit; font-weight: 700; cursor: pointer; text-align: left; color: var(--navy); font-size: 1.05rem; }
.cat-arrow { display: inline-block; transition: transform .15s; color: var(--muted); }
.cat-card.folded .cat-kids { display: none; }
.cat-card.folded .cat-arrow { transform: rotate(-90deg); }
.cat-card.folded { padding-top: 12px; padding-bottom: 12px; }
.cat-chip.hit { background: #fff1c9; border-color: #e0b44a; font-weight: 700; }
