:root {
  --bg: #f6f1ea;
  --ink: #2b2118;
  --muted: #7a6b5d;
  --card: #fffaf4;
  --line: #e6d9cc;
  --accent: #8b4a2b;
  --ok: #3d6b4f;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 64px;
  --sidebar-w: 200px;
  --sidebar-collapsed-w: 72px;

  /* форма / карточка — одна точка смены вида по всей PWA */
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --field-h: 40px;
  --field-h-sm: 36px;
  --field-pad-x: 12px;
  --field-pad-y: 8px;
  --field-bg: #fff;
  --field-border: var(--line);
  --field-radius: var(--radius-md);
  --field-focus: #c4a882;
  --field-focus-ring: rgba(139, 74, 43, 0.18);
  --field-w-num: 4.75rem;
  --field-w-num-lg: 6.25rem;
  --block-pad: 16px;
  --block-radius: var(--radius-lg);
  --block-gap: 14px;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  min-height: 100%;
}
.hidden { display: none !important; }
.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.app-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  padding-top: calc(10px + var(--safe-top));
  background: var(--ink); color: #f6f1ea; position: sticky; top: 0; z-index: 30;
  flex: 0 0 auto;
}
.brand { font-weight: 700; letter-spacing: .04em; flex: 0 0 auto; }
.who-name {
  opacity: .85; font-size: 14px; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right;
}
main#main {
  flex: 1 1 auto;
  padding: 14px;
  padding-bottom: calc(18px + var(--tabbar-h) + var(--safe-bottom));
  max-width: none;
  margin: 0 auto;
  width: 100%;
  overflow-x: hidden;
}
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  background: #2b2118;
  color: #f6f1ea;
  border-top: 1px solid #4a372b;
  padding: 6px 4px calc(6px + var(--safe-bottom));
  min-height: calc(var(--tabbar-h) + var(--safe-bottom));
  scrollbar-width: none;
}
.tabbar::-webkit-scrollbar { display: none; }
.tabbar .nav-links {
  display: contents;
}
.tabbar a {
  flex: 0 0 auto;
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 68px;
  max-width: none;
  padding: 6px 8px;
  text-decoration: none;
  color: #cbb8a8;
  border-radius: 12px;
  font-size: 10px;
  line-height: 1.15;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.nav-prompt {
  margin: 0 0 12px;
  padding: 12px 14px;
  background: #f3ead8;
  border: 1px solid #e2d3bc;
  border-radius: 12px;
}
.nav-prompt b { display: block; font-size: 15px; }
.nav-prompt p { margin: 6px 0 10px; font-size: 13px; line-height: 1.35; color: #4a3f35; }
.nav-prompt-actions { display: flex; gap: 8px; }
.nav-prompt-actions button { width: auto; flex: 1 1 auto; min-height: 40px; }
.sheet-dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(42, 28, 18, 0.46);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
}
.sheet-card {
  width: min(460px, 100%);
  max-height: min(78vh, 640px);
  overflow: auto;
  background: #fffaf3;
  color: #2c241c;
  border-radius: 16px;
  padding: 16px 16px 14px;
  box-shadow: 0 12px 40px rgba(42, 28, 18, 0.28);
}
.sheet-card h2 { margin: 0 0 8px; font-size: 18px; }
.sheet-card p { margin: 0 0 10px; font-size: 14px; line-height: 1.4; }
.sheet-list { list-style: none; margin: 0 0 12px; padding: 0; }
.sheet-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid #eadfce;
  font-size: 14px;
}
.sheet-actions { display: flex; gap: 8px; }
.sheet-actions button { flex: 1 1 auto; width: auto; min-height: 42px; }
@media (min-width: 720px) {
  .sheet-dialog { align-items: center; }
}
.nav-pref-list {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
}
.nav-pref-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  touch-action: manipulation;
}
.nav-pref-row:last-child { border-bottom: 0; }
.nav-pref-row.is-hidden { color: var(--muted); }
.nav-pref-row.is-dragging { opacity: 0.85; background: #f3ead8; }
.nav-pref-drag {
  color: #b7a898;
  cursor: grab;
  user-select: none;
  touch-action: none;
  font-size: 18px;
  line-height: 1;
  padding: 4px 2px;
}
.nav-pref-label { flex: 1 1 auto; font-size: 15px; min-width: 0; }
.nav-pref-vis {
  width: auto;
  min-width: 44px;
  min-height: 40px;
  padding: 4px 8px;
  font-size: 18px;
}
.tabbar a svg {
  width: 22px;
  height: 22px;
  display: block;
  flex: 0 0 auto;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tabbar a.active {
  color: #fffaf4;
  background: #4a372b;
}
.tabbar a span {
  display: block;
  white-space: nowrap;
}
.tabbar a .nav-label-full { display: none; }
.tabbar a .nav-label-short { display: block; }
.nav-toggle {
  display: none;
}

@media (min-width: 960px) {
  .app-shell {
    flex-direction: row;
    align-items: stretch;
  }
  .app-shell.nav-collapsed {
    --sidebar-w: var(--sidebar-collapsed-w);
  }
  .tabbar {
    position: sticky;
    top: 0;
    left: auto;
    right: auto;
    bottom: auto;
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    max-width: var(--sidebar-w);
    height: 100dvh;
    min-height: 100dvh;
    flex: 0 0 var(--sidebar-w);
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-snap-type: none;
    border-top: none;
    border-right: 1px solid #4a372b;
    padding: 12px 10px;
    transition: width .2s ease, min-width .2s ease, max-width .2s ease;
  }
  .tabbar .nav-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 auto;
    min-height: 0;
  }
  .tabbar a {
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    min-width: 0;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 14px;
    text-align: left;
    border-radius: 12px;
  }
  .tabbar a .nav-label-full { display: block; overflow: hidden; text-overflow: ellipsis; }
  .tabbar a .nav-label-short { display: none; }
  .app-shell.nav-collapsed .tabbar a {
    justify-content: center;
    padding: 12px 8px;
    gap: 0;
  }
  .app-shell.nav-collapsed .tabbar a .nav-label-full,
  .app-shell.nav-collapsed .tabbar a .nav-label-short {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    margin-top: auto;
    padding: 10px 12px;
    border: 1px solid #5a4638;
    border-radius: 12px;
    background: transparent;
    color: #cbb8a8;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
  }
  .nav-toggle:hover {
    color: #fffaf4;
    background: #3a2c22;
  }
  .nav-toggle svg {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .2s ease;
  }
  .app-shell.nav-collapsed .nav-toggle {
    padding: 12px 8px;
  }
  .app-shell.nav-collapsed .nav-toggle .nav-toggle-label {
    display: none;
  }
  .app-shell.nav-collapsed .nav-toggle svg {
    transform: rotate(180deg);
  }
  .app-body {
    flex: 1 1 auto;
    min-width: 0;
    height: 100dvh;
    overflow: auto;
  }
  main#main {
    padding-bottom: 24px;
    max-width: 1400px;
  }
}
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--block-radius); padding: var(--block-pad); margin-bottom: var(--block-gap);
}
.block {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--block-radius); padding: var(--block-pad); margin-bottom: var(--block-gap);
}
.block h2 { margin: 0 0 6px; font-size: 18px; }
.block h3 { margin: 12px 0 4px; font-size: 15px; }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 12px; line-height: 1.4; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpis.pulse-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi-pulse { padding: 10px 8px; }
.kpi-pulse b { font-size: 16px; }
.kpi-pulse em { display: block; margin-top: 4px; font-style: normal; font-weight: 700; font-size: 13px; }
.kpi-pulse.kpi-good em { color: #1b7a3a; }
.kpi-pulse.kpi-bad em { color: #a33; }
.kpi-pulse.kpi-flat em { color: var(--muted); }
.pulse-hint { margin: -6px 0 14px; }
@media (max-width: 720px) {
  .kpis.pulse-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi-pulse { padding: 10px 8px; }
  .kpi-pulse b { font-size: 18px; }
  .kpi-pulse span { font-size: 12px; line-height: 1.25; }
  .kpi-pulse em { font-size: 13px; }
}
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.kpi b { display: block; font-size: 22px; }
.muted, .kpi span { color: var(--muted); font-size: 12px; }
.chips {
  display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  min-height: 40px;
  width: auto;
  font-size: 13px;
}
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.day-strip {
  display: flex; gap: 8px; justify-content: space-between;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  margin: 0 0 14px; padding: 4px 0; scrollbar-width: none;
  touch-action: pan-y;
}
.day-strip::-webkit-scrollbar { display: none; }
.day-chip {
  flex: 1 1 0; min-width: 56px; max-width: 72px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 12px; padding: 10px 6px; min-height: 56px; width: auto;
  font-size: 12px;
}
.day-chip .dw { color: var(--muted); text-transform: uppercase; font-size: 11px; }
.day-chip .dd { font-weight: 700; font-size: 15px; }
.day-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.day-chip.active .dw { color: rgba(255,255,255,.85); }
.day-chip.has:not(.active) { border-color: #c4a882; }
.settings-list { display: flex; flex-direction: column; gap: 8px; }
.settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
  row-gap: 4px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
.settings-row .meta { min-width: 0; }
.settings-row b { display: block; font-size: 15px; line-height: 1.25; }
.settings-row .muted { margin: 4px 0 0; font-size: 12px; line-height: 1.35; }
.settings-row .muted.err { color: #a33; }
.settings-row .settings-action {
  width: auto;
  min-width: 92px;
  max-width: 112px;
  padding: var(--field-pad-y) var(--field-pad-x);
  text-decoration: none;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.2;
}
.settings-row select.settings-action {
  width: auto;
  min-width: 92px;
  max-width: 10.5rem;
}
.settings-row input.settings-action[type="number"] {
  width: var(--field-w-num-lg);
  max-width: 100%;
  min-width: 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.settings-fields {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  min-width: 0;
  max-width: none;
  width: auto;
  flex: 0 1 auto;
}
.settings-row .settings-action.is-on {
  border-color: #8a9a6a;
  color: #3d4f2a;
  background: #eef3e4;
}
a.btn {
  background: var(--accent); color: #fff; border-radius: 10px; font-size: 14px;
}
a.btn.ghost, button.ghost.inline {
  background: transparent; border: 1px solid #cbb; color: var(--ink);
}
@media (max-width: 420px) {
  .settings-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }
  .settings-row .settings-action {
    margin-top: 2px;
  }
}
.table-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  max-height: calc(100dvh - 200px - var(--tabbar-h));
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.table-wrap table {
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}
.table-wrap th, .table-wrap td {
  text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line);
  vertical-align: middle; background: #fffaf4;
}
.table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #efe4d8;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.table-wrap thead tr:nth-child(2) th { top: 28px; z-index: 3; }
.table-wrap td.num, .table-wrap th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-wrap tbody tr:hover:not(.row-l1):not(.row-l2) td { filter: brightness(0.97); }
.row-l1 td { font-weight: 700; background: #e8d9c8 !important; }
.row-l2 td { font-weight: 600; background: #f3ebe3 !important; }
.row-total td {
  font-weight: 800; background: #3d2a1f !important; color: #fff8f0 !important;
  position: sticky; bottom: 0; z-index: 3;
}
.row-total td.sticky-col { z-index: 4; }
.table-wrap tbody tr.row-total:hover td { filter: none; }
.row-l2 td { font-weight: 600; background: #f3ebe2 !important; }
.pin-col {
  background: #efe4d8 !important;
  white-space: nowrap;
  max-width: 14em;
  overflow: hidden;
  text-overflow: ellipsis;
}
thead .pin-col { background: #e8d9c8 !important; }
.row-sku td[data-col="name"] { max-width: 16em; white-space: normal; }
.row-l2 td[data-col="qtyRec"], .row-sku td[data-col="qtyRec"] {
  font-weight: 800; font-size: 1.05em;
}
.row-openable { cursor: pointer; }
.row-openable:active td { background: #e8d9c8 !important; }
.doc-bar {
  display: flex; align-items: flex-start; gap: 12px;
  margin: 0 0 12px; padding: 4px 0;
}
.doc-bar .doc-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.doc-bar .doc-title b { font-size: 16px; }
.doc-bar button.inline { width: auto; min-width: 88px; flex: 0 0 auto; }
.save-pill {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; border: 2px solid transparent;
}
.save-idle { background: #ece6de; color: #8a7b6c; border-color: #d8c8b0; }
.save-ok { background: #e6f4ea; color: #1e7e34; border-color: #8fd19e; }
.save-err { background: #fdecea; color: #c5221f; border-color: #f5a8a5; }
.save-pending { background: #fff8e6; color: #b06000; border-color: #f0d080; }
.save-dry { background: #eef3fb; color: #3b5bdb; border-color: #a5b4fc; }
.ica-legend {
  display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 0 0 10px; font-size: 12px; line-height: 1.35;
}
.ica-leg { padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line); }
.ica-leg-model-only { background: #fff3cd; }
.ica-leg-diff { border-left: 4px solid #c45c26; background: #fffaf4; }
.ica-leg-warn { background: #fdecea; }
.ica-compare-host { margin: 0; }
.ica-compare-host .table-wrap {
  max-height: min(62dvh, 520px);
}
.ica-compare-host .table-wrap td[data-col="pick"] {
  text-align: center; width: 3em; min-width: 3em;
}
.ica-pick-fixed { color: #8a7b6c; font-size: 11px; }
.ica-pick-na { color: #c5221f; }
.ica-qty-locked { color: #8a7b6c; font-style: italic; }
.ica-qty-off { color: var(--muted); }
.row-model-skip td { opacity: 0.45; }
.row-model-skip td[data-col="pick"] { opacity: 1; }
.ica-edit-toolbar {
  display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center;
  margin: 0 0 10px; padding: 10px; background: #f7f2ec; border-radius: 10px;
}
.ica-check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.ica-edit-sums { display: flex; flex-wrap: wrap; gap: 10px 16px; font-size: 14px; }
.ica-edit-sums b { font-size: 16px; }
.ica-edit-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.ica-edit-actions button { width: auto; min-width: 0; flex: 0 0 auto; }
.ica-save-msg { width: 100%; font-size: 13px; line-height: 1.35; }
.ica-sync-msg { width: 100%; font-size: 12px; line-height: 1.35; color: var(--muted); }
.sync-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  margin: 0.35rem 0 0.65rem;
}
.sync-bar.compact { margin: 0; }
.ica-section-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 0 0 0.65rem;
}
.ica-section-bar .chips { flex: 1 1 auto; margin: 0; min-width: 0; }

.ica-accept-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-top: 12px;
}
.ica-accept-bar .field-inline {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
}
.ica-accept-bar .field-inline input {
  min-width: 148px;
  padding: 8px 10px;
}
.sync-btn {
  width: auto !important;
  min-width: 0;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  min-height: 36px;
}
.sync-btn .ico-sync {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.sync-msg-inline {
  flex: 1 1 100%;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}
.sync-msg {
  flex: 1 1 10rem;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}
.ica-pick-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.ica-pick-all input { width: auto; min-height: 0; margin: 0; }
button.confirm-ready {
  box-shadow: 0 0 0 2px #c45c26, 0 0 12px rgba(196, 92, 38, 0.35);
  animation: pulse-save 1.2s ease-in-out infinite;
}
@keyframes pulse-save {
  0%, 100% { box-shadow: 0 0 0 2px #c45c26, 0 0 8px rgba(196, 92, 38, 0.25); }
  50% { box-shadow: 0 0 0 3px #e07030, 0 0 16px rgba(196, 92, 38, 0.45); }
}
.toast-host {
  position: fixed;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 24px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: #fffdf9;
  border: 1px solid #d4c4b0;
  border-radius: 12px;
  padding: 12px 36px 12px 14px;
  box-shadow: 0 8px 28px rgba(43, 33, 24, 0.18);
  position: relative;
  animation: toast-in 0.25s ease-out;
}
.toast b { display: block; font-size: 14px; margin-bottom: 4px; }
.toast p { margin: 0; font-size: 13px; line-height: 1.4; color: #4a3f35; }
.toast-warn { border-color: #e0a030; background: #fff9ed; }
.toast-ok { border-color: #5a9e6f; background: #f3fbf5; }
.toast-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  color: #8a7a6a;
  cursor: pointer;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.ica-msg-ok { color: #1e7e34; }
.ica-msg-error { color: #c5221f; }
.ica-msg-pending { color: #b06000; }
.ica-msg-info { color: #5c4f42; }
.ica-details { margin-top: 12px; font-size: 14px; }
.ica-qty-inp {
  width: 4.2em; max-width: 100%; padding: 4px 6px; border: 1px solid #c4a882;
  border-radius: 6px; font: inherit; text-align: right;
}
.row-model-only td { background: #fff3cd !important; }
.row-model-diff td { box-shadow: inset 3px 0 0 #c45c26; }
.row-model-warn td { background: #fdecea !important; }
.ica-compare-wrap .row-model-only td[data-col="name"] { font-weight: 600; }
.toggle {
  background: none; border: 0; padding: 0; margin: 0; width: auto; min-height: 0;
  color: inherit; font: inherit; font-weight: 700; cursor: pointer; text-align: left;
}
.freeze-1 td:nth-child(1), .freeze-1 thead th:nth-child(1),
.freeze-5 tbody td:nth-child(1), .freeze-5 thead tr:first-child th:nth-child(1) {
  position: sticky; left: 0; z-index: 2; min-width: 8.5em; max-width: 14em;
  box-shadow: 4px 0 6px -4px rgba(43,33,24,.35);
}
.freeze-5 tbody td:nth-child(2), .freeze-5 thead tr:first-child th:nth-child(2) {
  position: sticky; left: 8.5em; z-index: 2; min-width: 7em;
}
.freeze-5 tbody td:nth-child(3), .freeze-5 thead tr:first-child th:nth-child(3) {
  position: sticky; left: 15.5em; z-index: 2; min-width: 5.5em;
}
.freeze-5 tbody td:nth-child(4), .freeze-5 thead tr:first-child th:nth-child(4) {
  position: sticky; left: 21em; z-index: 2; min-width: 6em;
}
.freeze-5 tbody td:nth-child(5), .freeze-5 thead tr:first-child th:nth-child(5) {
  position: sticky; left: 27em; z-index: 2; min-width: 12em; max-width: 18em;
  box-shadow: 6px 0 8px -6px rgba(43,33,24,.35);
}
.freeze-5 thead tr:first-child th:nth-child(-n+5) { z-index: 6; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-bottom: 12px; }
.chart-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.chart-card h3 { margin: 0 0 4px; font-size: 15px; }
.chart-card svg {
  width: 100%;
  height: auto;
  aspect-ratio: 640 / 200;
  display: block;
  touch-action: none;
}
.ch-line, .ch-cross, .ch-dot { vector-effect: non-scaling-stroke; }
.ch-axis, .ch-tick {
  stroke: #8a7a6c;
  stroke-width: 1.2;
  fill: none;
  vector-effect: non-scaling-stroke;
}
.ch-grid {
  stroke: #e8dfd6;
  stroke-width: 1;
  fill: none;
  vector-effect: non-scaling-stroke;
}
.chart-card .tick { font-size: 10px; fill: #7a6b5d; }
.chart-stage { position: relative; }
.chart-tip {
  min-height: 2.6em; margin: 8px 0 0; padding: 8px 10px;
  background: #f7f2ec; border-radius: 8px; font-size: 13px; line-height: 1.35;
  display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center;
}
.chart-tip.is-empty { color: var(--muted); background: transparent; padding-left: 0; }
.chart-tip .tip-row { display: inline-flex; align-items: center; gap: 6px; }
.chart-tip .tip-row i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.chart-card.is-active { border-color: #c4a882; box-shadow: 0 0 0 1px rgba(139,74,43,.12); }
.ch-line.is-dim { opacity: 0.28; }
.ch-line.is-focus { stroke-width: 3.2; }
.ch-hit { cursor: crosshair; }
.leg-row { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; margin-bottom: 4px; }
.leg { display: flex; align-items: center; gap: 6px; }
.leg i { width: 14px; height: 3px; display: inline-block; border-radius: 2px; }
.ser-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 12px; }
.chk { flex-direction: row; align-items: center; gap: 6px; margin: 0; font-size: 13px; }
.chk input { width: auto; min-height: 0; }
.toolbar { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-3); align-items: end; }
.toolbar label { flex-direction: row; align-items: center; gap: 6px; margin: 0; font-size: 13px; color: var(--muted); }
.toolbar input, .toolbar select {
  padding: var(--field-pad-y) var(--field-pad-x); border: 1px solid var(--field-border); border-radius: var(--field-radius);
  background: var(--field-bg); min-height: var(--field-h); font-size: 16px; flex: 1;
  min-width: 0; max-width: 100%;
}
.toolbar button { width: auto; padding: var(--field-pad-y) var(--field-pad-x); }
.shelf-photo-qty {
  width: 3.2rem;
  padding: 4px 6px;
  font: inherit;
  text-align: right;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.inv-fact-qty {
  width: 4rem;
  padding: 5px 7px;
  font: inherit;
  font-weight: 700;
  text-align: right;
  border: 1px solid #9f7a4d;
  border-radius: 7px;
  background: #fffaf1;
}
.shelf-audit-bar { align-items: center; }
input, select, textarea, button { font: inherit; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="range"]),
select,
textarea {
  max-width: 100%;
  min-width: 0;
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  border-radius: var(--field-radius);
  color: var(--ink);
}
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="range"]):focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--field-focus);
  outline-offset: 0;
  box-shadow: 0 0 0 3px var(--field-focus-ring);
}
label { display: flex; flex-direction: column; gap: var(--space-1); margin: 8px 0; min-width: 0; }
label > input:not([type="checkbox"]):not([type="radio"]):not(.field-num) {
  width: 100%;
  min-height: var(--field-h);
  padding: var(--field-pad-y) var(--field-pad-x);
  font-size: 16px;
}
.field { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; margin: 0; }
.field-inline {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  min-width: 0;
}
.field-num {
  width: var(--field-w-num);
  max-width: 100%;
  min-width: 0;
  min-height: var(--field-h-sm);
  padding: var(--field-pad-y) var(--field-pad-x);
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  appearance: textfield;
  -moz-appearance: textfield;
}
.field-num::-webkit-outer-spin-button,
.field-num::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.field-num-lg { width: var(--field-w-num-lg); }
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  min-width: 0;
  margin-bottom: var(--space-3);
}
.form-row button { width: auto; min-width: 0; flex: 0 0 auto; }
.table-form { width: 100%; }
.table-form th.col-n,
.table-form td.col-n {
  text-align: center;
  font-variant-numeric: tabular-nums;
  width: 3rem;
  min-width: 3rem;
  padding: 6px 4px;
  vertical-align: middle;
}
.table-form td.col-n:has(.field-num) {
  width: auto;
  min-width: var(--field-w-num);
}
.table-form td.col-n .field-num {
  width: 100%;
  max-width: none;
  min-width: var(--field-w-num);
  display: block;
  margin-inline: auto;
}
.vs-group {
  border: 1px solid var(--line);
  border-radius: var(--block-radius);
  background: var(--card);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
}
.vs-group + .vs-group { margin-top: 0; }
.vs-group summary {
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
  list-style: none;
}
.vs-group summary::-webkit-details-marker { display: none; }
.vs-group-bar { margin: var(--space-2) 0; }
.table-form th.col-idx,
.table-form td.col-idx {
  width: 1.8rem;
  min-width: 1.8rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-weight: 700;
}
.table-form th.col-m,
.table-form td.col-m {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 4.6rem;
  padding-left: 6px;
  padding-right: 6px;
}
.vs-total td {
  font-weight: 700;
  background: #efe4d8;
  border-top: 2px solid #d8c4a8;
}
.vs-sum-pair {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  line-height: 1.25;
  font-size: 11px;
  font-weight: 700;
}
.vs-new input { flex: 1 1 160px; min-width: 0; min-height: var(--field-h); }
.vs-group-bar input:not([type="checkbox"]),
.vs-group-bar select,
.vs-new input {
  padding: var(--field-pad-y) var(--field-pad-x);
}
.vs-g-name { flex: 1 1 140px; min-width: 0; width: auto; min-height: var(--field-h); }
.vs-g-flow, .vs-g-mode { flex: 0 1 auto; width: auto; max-width: 10.5rem; min-height: var(--field-h); }
.vs-g-drop { width: auto; min-width: 0; flex: 0 0 auto; min-height: var(--field-h); padding: var(--field-pad-y) var(--field-pad-x); }
.vs-g-drag {
  cursor: grab;
  touch-action: none;
  user-select: none;
  color: #b7a898;
  font-size: 16px;
  line-height: 1;
  padding: 2px 6px 2px 0;
}
.vs-group.is-dragging { opacity: 0.72; }
.vs-g-rate { font-variant-numeric: tabular-nums; }
.vs-sort { width: auto; max-width: 13.5rem; min-height: var(--field-h); }
.vs-pack { font-size: 12px; white-space: nowrap; }
.vs-table th.col-wx, .vs-table td.col-wx { width: 2.8rem; padding-left: 2px; padding-right: 2px; font-size: 11px; }
.vs-wx-mark { display: block; font-size: 11px; line-height: 1.1; min-height: 11px; }
.ica-head { grid-template-columns: 1fr 1fr; }
.ica-head .kpi b { font-size: 18px; font-weight: 700; }
.vs-head { margin: 0 0 var(--space-3); }
.vs-head .kpi b { font-size: 15px; font-weight: 700; }
.vs-head .vs-sum-pair { align-items: flex-start; font-size: 14px; }
.vs-head .vs-sum-pair .muted { font-weight: 600; font-size: 12px; }
.table-form th.col-act,
.table-form td.col-act {
  width: 2.2rem;
  min-width: 2.2rem;
  padding: 4px 2px;
  text-align: center;
}
.vs-del {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
}
.vs-add { position: relative; margin-top: var(--space-2); min-width: 0; }
.vs-add-q {
  width: 100%;
  min-height: var(--field-h);
  padding: var(--field-pad-y) var(--field-pad-x);
}
.vs-add-hits {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 8;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  border-radius: var(--field-radius);
  max-height: 360px;
  overflow: auto;
  box-shadow: 0 8px 24px rgba(43, 33, 24, 0.12);
}
.vs-hit-caption {
  margin: 0;
  padding: 8px 10px 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.vs-hit-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.vs-hit-table th,
.vs-hit-table td {
  padding: 4px 6px;
  text-align: right;
  white-space: nowrap;
  font-weight: 500;
  vertical-align: top;
}
.vs-hit-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: 11px;
  color: var(--muted);
  background: var(--field-bg);
}
.vs-hit-table th:first-child,
.vs-hit-table td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  z-index: 1;
  max-width: 12rem;
  white-space: normal;
  background: var(--field-bg);
}
.vs-hit-table th:first-child { z-index: 2; }
tr.vs-hit {
  background: var(--field-bg);
  color: var(--ink);
  cursor: pointer;
}
tr.vs-hit td { border-top: 1px solid var(--line); }
tr.vs-hit.is-suggest,
tr.vs-hit.is-suggest td:first-child { background: #f3ead8; }
tr.vs-hit.is-on-shelf,
tr.vs-hit.is-on-shelf td:first-child {
  background: #efe6d6;
  color: var(--muted);
  cursor: default;
}
button {
  background: var(--accent); color: #fff; border: 0; border-radius: var(--field-radius);
  padding: 12px 14px; cursor: pointer; min-height: 44px; width: 100%;
}
button.ghost { background: transparent; border: 1px solid #cbb; color: inherit; }
.login {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center;
  padding: 16px; padding-bottom: calc(16px + var(--safe-bottom));
}
.login-card { width: min(360px, 100%); }
.login-card button { margin-top: 8px; }
.err { color: #a33; min-height: 1.2em; }
@media (max-width: 720px) {
  main#main { padding: 10px; padding-bottom: calc(14px + var(--tabbar-h) + var(--safe-bottom)); }
}
@media (min-width: 900px) {
  .tabbar a { min-width: 72px; font-size: 11px; }
  .tabbar a svg { width: 24px; height: 24px; }
}

.wx-toolbar {
  display: flex; align-items: center; gap: 10px; margin: 8px 0 12px; flex-wrap: wrap;
}
.wx-toolbar b { flex: 1; text-align: center; font-size: 1.05rem; }
.wx-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
  font-size: 11px; color: var(--muted); text-align: center; margin-bottom: 4px;
}
.wx-cal {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 14px;
}
.wx-cell {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-height: 72px; padding: 6px 2px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); cursor: pointer; position: relative;
}
.wx-cell.empty { border: none; background: transparent; cursor: default; min-height: 0; }
.wx-cell.has { background: #fffdf8; }
.wx-cell.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(125, 78, 36, .15); }
.wx-cell.today .wx-cell-d { color: var(--accent); font-weight: 700; }
.wx-cell-d { font-size: 12px; color: var(--muted); }
.wx-cell-t { font-size: 12px; font-weight: 600; }
.wx-ico { display: block; }
.wx-ico.sun { color: #e6a817; }
.wx-ico.cloud { color: #8a9aaa; }
.wx-ico.rain { color: #5a8fc4; }
.wx-ico.snow { color: #7ab0c8; }
.wx-ico.wind { color: #6a8a7a; }
.wx-plus {
  position: absolute; top: 4px; right: 4px; font-size: 9px; font-weight: 700;
  background: #c45a2c; color: #fff; border-radius: 6px; padding: 1px 4px;
}
.wx-chart-wrap { margin: 12px 0; padding: 8px; background: var(--card); border-radius: 10px; border: 1px solid var(--line); }
.wx-chart-label { font-size: 9px; fill: var(--muted); }
.wx-dot { fill: var(--accent); opacity: .55; }
.wx-dot-focus { fill: var(--accent); }
.wx-detail { margin-top: 12px; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.wx-detail-head { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 10px; }
.wx-temps { margin-left: auto; text-align: right; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.wx-norm { font-size: 12px; padding: 2px 6px; border-radius: 6px; display: inline-block; }
.wx-norm.cold { background: #e8f2fa; color: #2a5a8a; }
.wx-norm.warm { background: #fff0e0; color: #a55a20; }
.wx-advice { padding: 8px 10px; border-radius: 8px; margin: 8px 0; font-size: 14px; }
.wx-advice.plus { background: #fff3e8; border: 1px solid #e8c4a8; color: #7a4020; }
.wx-advice.norm { background: #f4f8f4; border: 1px solid #d0ddd0; color: #3a5a3a; }
.wx-reasons { margin: 6px 0 10px 18px; font-size: 13px; color: var(--muted); }
.wx-reasons.compact { margin: 4px 0 8px 16px; font-size: 12px; }
.wx-parts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.wx-part { border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #fff; }
.wx-part-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 13px; }
.wx-part-body { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.wx-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 2px 6px; border-radius: 6px; width: fit-content; }
.wx-tag.rain { background: #e8f0fa; color: #2a5080; }
.wx-tag.wind { background: #eef5ee; color: #3a6040; }
.wx-cond { font-size: 11px; line-height: 1.3; }
.wx-snippet-wrap { margin-top: 12px; }
.wx-snippet { padding: 12px; }
.wx-snippet-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wx-link { display: inline-block; margin-top: 8px; font-size: 13px; color: var(--accent); }

.bdr-toolbar {
  display: flex; flex-wrap: nowrap; gap: 8px; align-items: center;
  margin-bottom: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.bdr-month { display: flex; margin: 0; flex: 0 0 auto; }
.bdr-month select {
  min-width: 150px; max-width: 220px; width: auto; padding: 6px 8px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; font-size: 13px;
}
.bdr-toolbar > .pill { flex: 0 0 auto; font-size: 11px; padding: 4px 8px; }
.bdr-actions {
  display: flex; flex-wrap: nowrap; gap: 6px; margin-left: auto;
  align-items: center; flex: 0 0 auto;
}
.bdr-actions button {
  width: auto; min-width: 0; flex: 0 0 auto;
  padding: 6px 10px; min-height: 32px; font-size: 13px; border-radius: 8px;
}
.bdr-actions button.icon-btn {
  padding: 6px; width: 32px; height: 32px; min-height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
}
.bdr-actions button.icon-btn .ico-sync { width: 15px; height: 15px; }
@media (max-width: 560px) {
  /* узкий экран: месяц и статус сверху, кнопки одной строкой под ними */
  .bdr-toolbar { flex-wrap: wrap; overflow-x: visible; }
  .bdr-actions { margin-left: 0; width: 100%; }
}
.bar-supply-banner {
  margin: 0 0 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #faf7f2; display: flex; flex-direction: column; gap: 10px;
}
.bar-supply-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.bar-supply-task {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between;
  padding-top: 8px; border-top: 1px solid var(--line);
}
.bar-supply-task:first-of-type { border-top: 0; padding-top: 0; }
.bar-supply-task p { margin: 4px 0 0; font-size: 13px; line-height: 1.35; }
.bar-supply-actions {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.bar-supply-actions input {
  width: 88px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line);
  font-size: 13px;
}
.bar-supply-actions button {
  width: auto; padding: 6px 10px; min-height: 32px; font-size: 13px; border-radius: 8px;
}
.sum-toolbar { margin-bottom: 10px; }

.bdr-callout {
  margin: 0 0 14px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid #e8d4b8; background: #fff8ef;
}
.bdr-callout.ok { border-color: #c8dcc8; background: #f4faf4; }
.bdr-callout.bad { border-color: #e8c4c4; background: #fff5f5; }
.bdr-callout b { display: block; margin-bottom: 4px; font-size: 14px; }
.bdr-callout p { margin: 4px 0 0; font-size: 13px; line-height: 1.35; }
.compact-list > div {
  display: grid; grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 12px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line);
}
.compact-list > div:last-child { border-bottom: 0; }
.compact-list small { color: var(--muted); }
.bdr-rec {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.bdr-rec:last-child { border-bottom: 0; }
.bdr-rec b { font-size: 13px; }
#bdr-table tr.bdr-section-row td {
  background: #f6efe6; font-weight: 600; color: #8b4a2b; font-size: 12px;
}
#bdr-table tr.bdr-strong td { font-weight: 600; }
#bdr-table tr.bdr-pending td { color: #9a7a5a; }
#bdr-table td[data-col="amount"], #bdr-table td[data-col="compare"] { text-align: right; }
#bdr-table input.bdr-inp {
  width: 96px; padding: 4px 6px; text-align: right; font-size: 13px;
  border: 1px solid #d8c4a8; border-radius: 6px; background: #fffdf9;
}
#bdr-table input.bdr-inp:focus { outline: 2px solid #c4a882; outline-offset: 0; }
#bdr-table input.bdr-inp:disabled { opacity: .5; }
.integration-alert {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #e8c4c4;
  background: #fff5f5;
}
.integration-alert b { display: block; margin-bottom: 4px; color: #a22; font-size: 14px; }
.integration-alert p { margin: 4px 0 0; font-size: 13px; line-height: 1.35; }
.mon-alert-warn {
  border-color: #e6d0a8;
  background: #fff8ee;
}
.mon-alert-warn b { color: #8b5a12; }

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.pill-ok { background: #e6f4ea; color: #137333; }
.pill-err { background: #fce8e6; color: #c5221f; }
.pill-muted { background: #f1f3f4; color: #666; }

.nav-links a { position: relative; }
.nav-links a.nav-warn::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c33;
  box-shadow: 0 0 0 2px #fff;
}
.model-view-chips { margin: 8px 0 4px; }
.row-flow td, .row-flow .cell-l2 { font-weight: 600; }
.inv-confirm { background: #3d6b4f; color: #fff; }
.inv-reject { background: #f1e6dc; }
.settings-row-head { border-color: #d8c8b0; }
.queue-live {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.45;
  color: #5a4638;
}
.queue-live code { font-size: 11px; }

.wo-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 10px;
}
.wo-date-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
}
.wo-date-row input[type="date"] {
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 16px;
}
.wo-toolbar input[type="text"] {
  flex: 1 1 160px;
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 16px;
}
.wo-photo-btn {
  position: relative;
  overflow: hidden;
  width: auto;
  min-width: 0;
  cursor: pointer;
}
.wo-draft-list { display: flex; flex-direction: column; gap: 8px; }
.wo-draft-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #f7f2ec;
  border-radius: 10px;
}
.wo-draft-row b { display: block; font-size: 14px; }
.wo-qty {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
.wo-qty input {
  width: 3.2em;
  text-align: center;
  font-size: 16px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.wo-qty button {
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
}
.wo-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}
.wo-footer button { width: auto; min-width: 0; }
#wo-scan-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(20, 14, 10, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.wo-scan-card {
  position: relative;
  width: min(100%, 420px);
  background: #1a120c;
  color: #fff;
  border-radius: 16px;
  overflow: hidden;
  padding: 12px 12px 16px;
}
.wo-scan-hint { margin: 0 0 8px; font-size: 14px; }
#wo-scan-video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 62dvh;
  background: #000;
  border-radius: 10px;
  object-fit: cover;
}
.wo-scan-frame {
  position: absolute;
  left: 18%;
  right: 18%;
  top: 28%;
  height: 28%;
  border: 2px solid rgba(255, 220, 170, 0.85);
  border-radius: 10px;
  pointer-events: none;
}
.wo-scan-actions { margin-top: 10px; }
.wo-scan-actions button { width: 100%; }
.partner-banner {
  margin: 8px 12px 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff6e8;
  color: #3d2a1f;
  font-size: 14px;
  line-height: 1.35;
}
.partner-setup label { display: block; margin: 10px 0; }
.partner-setup input { width: 100%; }
