:root {
  color-scheme: light;
  --ink: #22343d;
  --soft: #52616a;
  --muted: #637178;
  --nav: #202e38;
  --accent: #ac4f25;
  --amber: #f3b579;
  --base: #f5f5ef;
  --paper: #fffefa;
  --line: #d8dbd1;
  --teal: #237268;
  --blue: #426676;
  --label: 12px;
  --rad: 9px;
  font-family:
    'Avenir Next',
    -apple-system,
    BlinkMacSystemFont,
    'PingFang SC',
    'Microsoft YaHei',
    sans-serif;
  font-size: 14px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--base);
  line-height: 1.55;
}
a {
  color: inherit;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
}
button:disabled {
  cursor: wait;
  opacity: 0.64;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  line-height: 1.28;
  letter-spacing: -0.035em;
}
h1 {
  font-size: clamp(28px, 3vw, 43px);
  font-weight: 650;
}
h2 {
  font-size: 20px;
  font-weight: 650;
}
h3 {
  font-size: 16px;
}
small {
  font-size: 12px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #b6794d;
  outline-offset: 2px;
}
button {
  border: 0;
  background: none;
}
.skip {
  position: absolute;
  left: 12px;
  top: -70px;
  background: white;
  padding: 12px;
  z-index: 10;
}
.skip:focus {
  top: 12px;
}
.loading {
  padding: 40px;
}
.button,
.plain,
.tab,
.navigation button,
.input,
.action-link,
.role-opt {
  min-height: 41px;
}
.button,
.plain {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 5px;
  padding: 8px 16px;
  font-weight: 650;
  text-decoration: none;
}
.button {
  background: var(--ink);
  color: #fff;
  border: 1px solid var(--ink);
}
.button:hover {
  background: #354a53;
}
.button.warm {
  background: var(--amber);
  color: #322b23;
  border-color: var(--amber);
}
.plain {
  background: var(--paper);
  border: 1px solid var(--line);
}
.plain:hover,
.role-opt:hover {
  border-color: var(--soft);
}
.link,
.action-link {
  color: var(--accent);
  font-weight: 650;
  text-underline-offset: 3px;
}
.action-link {
  display: inline-flex;
  align-items: center;
  padding: 3px 0;
}
.mono,
.n,
.code,
.qty,
.kpi strong,
.case-code {
  font-family: ui-monospace, 'SFMono-Regular', 'Menlo', monospace;
  font-variant-numeric: tabular-nums;
}
.dim {
  color: var(--muted);
}
.symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--amber);
  border-radius: 7px;
  width: 34px;
  height: 34px;
  color: var(--nav);
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.065em;
}
.brand div {
  display: grid;
  gap: 1px;
  line-height: 1.3;
}
.brand small {
  font-weight: 550;
  letter-spacing: 0.02em;
  font-size: 11px;
  color: #afc0c6;
}
.login {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1.06fr 1fr;
}
.login-story {
  background: var(--nav);
  color: #f5f6ee;
  padding: clamp(32px, 6vw, 100px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 50px;
  position: relative;
  overflow: hidden;
}
.login-story .brand {
  position: relative;
}
.login-story h1 {
  font-size: clamp(38px, 4.7vw, 76px);
  line-height: 1.17;
  letter-spacing: -0.06em;
  margin-bottom: 22px;
}
.login-story > div > p {
  color: #ccdad8;
  max-width: 390px;
  font-size: 16px;
  line-height: 1.85;
}
.route {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  border-top: 1px solid #51616b;
  padding-top: 24px;
}
.route b,
.route small {
  display: block;
}
.route small {
  color: #bfc8c7;
  margin-top: 4px;
}
.route > span {
  color: var(--amber);
}
.login-side {
  padding: clamp(26px, 6vw, 88px);
  align-self: center;
}
.login-side h2 {
  font-size: 30px;
}
.login-side .dim {
  margin: 7px 0 20px;
}
.role-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.role-opt {
  padding: 9px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
  font-weight: 650;
}
.role-opt[aria-pressed='true'] {
  border-color: var(--accent);
  color: var(--accent);
  background: #fff0df;
}
.login-side label,
.form-grid label,
.line-editor label {
  display: grid;
  gap: 6px;
  color: var(--soft);
  font-size: 13px;
  font-weight: 600;
}
.login-side label {
  margin: 15px 0;
}
.input,
input:not([type='checkbox']),
select,
textarea {
  width: 100%;
  min-height: 41px;
  border: 1px solid #bac3ba;
  background: #fffefa;
  padding: 8px 10px;
  border-radius: 5px;
  color: var(--ink);
}
.login-side [type='submit'] {
  width: 100%;
  margin-top: 4px;
}
.login-note {
  color: var(--soft);
  font-size: 13px;
  margin-top: 12px;
}
.login-side > a {
  display: inline-flex;
  margin-top: 20px;
  align-items: center;
  min-height: 44px;
}
.error {
  color: #a02e24;
  font-weight: 600;
  font-size: 13px;
  white-space: pre-line;
}
.error:not(:empty) {
  padding: 10px 0;
}
.shell {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  min-height: 100dvh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: 29px 16px 19px;
  background: var(--nav);
  color: #e7eeed;
  display: flex;
  flex-direction: column;
  gap: 30px;
}
.sidebar .brand {
  padding-left: 8px;
}
.navigation {
  display: grid;
  gap: 5px;
}
.navigation button {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  color: #d7dfdf;
  padding: 11px 13px;
  border-radius: 5px;
  font-weight: 550;
}
.navigation button svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.navigation button[aria-current='page'] {
  background: #374851;
  color: #ffcd9f;
  box-shadow: inset 3px 0 var(--amber);
}
.navigation button:hover {
  background: #334550;
}
.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid #465861;
  padding: 17px 8px 0;
  color: #c5d1d1;
  font-size: 13px;
}
.sidebar-bottom a {
  text-decoration: none;
  display: flex;
  align-items: center;
  min-height: 44px;
}
.workspace {
  min-width: 0;
  padding: 0 clamp(20px, 3.5vw, 55px) 40px;
}
.topbar {
  min-height: 67px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--soft);
  font-size: 12px;
}
.topbar strong {
  font-weight: 650;
  color: var(--ink);
}
.identity {
  display: flex;
  gap: 10px;
  align-items: center;
}
.identity button {
  min-height: 40px;
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--soft);
}
.identity .avatar {
  width: 26px;
  height: 26px;
  background: #e9c9aa;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 700;
  color: #753f23;
}
.page-head,
.panel-head,
.card-foot,
.detail-head,
.toolrow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.page-head {
  margin: 29px 0 21px;
}
.page-head p,
.panel-head p {
  color: var(--soft);
  margin-top: 5px;
}
.panel-head {
  align-items: flex-start;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.panel-head .action-link {
  min-height: 30px;
  white-space: nowrap;
}
.topline {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  color: #d4dfdc;
}
.topline b {
  color: #ffcc9b;
  letter-spacing: 0.035em;
}
.brief {
  background: #2e444b;
  color: #fff;
  border-radius: var(--rad);
  padding: 22px 25px;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(150px, 0.85fr);
  gap: 28px;
  align-items: center;
}
.brief h2 {
  margin: 9px 0 5px;
  font-size: clamp(21px, 2.1vw, 30px);
}
.brief p {
  color: #dde6df;
  font-size: 14px;
}
.brief .action-link {
  color: #ffd1a4;
  min-height: 30px;
}
.brief-track {
  border-left: 1px solid #718387;
  padding-left: 22px;
  display: grid;
  gap: 10px;
}
.brief-track > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #dce5e4;
}
.brief-track b {
  font-weight: 600;
  color: #fff;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--rad);
  overflow: hidden;
  background: var(--paper);
  margin: 17px 0;
}
.kpi {
  padding: 17px 20px;
}
.kpi + .kpi {
  border-left: 1px solid var(--line);
}
.kpi label {
  display: block;
  color: var(--soft);
  font-size: 13px;
}
.kpi strong {
  display: inline-block;
  line-height: 1.1;
  font-size: clamp(26px, 3vw, 38px);
  letter-spacing: -0.08em;
  margin-top: 7px;
}
.kpi small {
  color: var(--muted);
  margin-left: 5px;
}
.kpi.key strong {
  color: var(--accent);
}
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--rad);
  min-width: 0;
  overflow: hidden;
}
.pair {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(265px, 0.9fr);
  gap: 17px;
  margin-bottom: 17px;
}
.queue,
.low-list,
.stages,
.audit {
  list-style: none;
  margin: 0;
  padding: 0;
}
.queue > li,
.low-list > li {
  padding: 11px 18px;
  border-bottom: 1px solid #e3e5dd;
}
.queue > li:last-child,
.low-list > li:last-child {
  border-bottom: 0;
}
.queue button,
.low-row {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}
.queue button {
  padding: 0;
}
.queue button span:first-child,
.low-row > div {
  min-width: 0;
}
.queue b,
.queue small,
.low-row strong,
.low-row small {
  display: block;
}
.queue small,
.low-row small {
  color: var(--muted);
  font-size: 12px;
}
.low-row strong {
  font-size: 14px;
  font-weight: 650;
}
.badge {
  white-space: nowrap;
  font-size: 12px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 4px;
}
.pending {
  color: #865615;
  background: #f9eac8;
}
.returned {
  color: #9a3b32;
  background: #f7e3de;
}
.approved {
  color: #405e80;
  background: #e6edf6;
}
.shipped {
  color: #17685f;
  background: #dceee8;
}
.received {
  color: #536453;
  background: #e7ebdf;
}
.small-button {
  padding: 6px 10px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
}
.empty {
  padding: 20px;
  color: var(--muted);
}
.toolrow {
  flex-wrap: wrap;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
.toolrow .search {
  flex: 1 1 200px;
  max-width: 370px;
}
.filters {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.filters label {
  font-size: 12px;
  color: var(--soft);
}
.filters select {
  width: auto;
  max-width: 195px;
}
.table-wrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
  text-align: left;
}
th {
  color: #5f6e74;
  font-weight: 550;
  font-size: 12px;
  background: #f2f3eb;
}
td,
th {
  padding: 11px 16px;
  border-bottom: 1px solid #e4e7dc;
}
tbody tr:last-child td {
  border-bottom: 0;
}
td .case-code {
  font-size: 12px;
}
td small.block {
  display: block;
  color: var(--muted);
}
.row-link {
  color: #82502f;
  font-weight: 650;
  text-align: left;
  padding: 5px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.toolbar-count {
  background: #f0f0e6;
  border-radius: 99px;
  padding: 2px 8px;
  color: var(--soft);
  font-size: 12px;
}
.mini-count {
  display: flex;
  gap: 8px;
  align-items: center;
}
.state-bars {
  display: flex;
  height: 12px;
  overflow: hidden;
  background: #eee;
  border-radius: 3px;
}
.state-bars span {
  display: block;
  min-width: 0;
}
.legend {
  display: flex;
  gap: 8px 18px;
  flex-wrap: wrap;
  margin-top: 14px;
  font-size: 12px;
}
.legend b {
  font-family: monospace;
  color: var(--ink);
  margin-left: 3px;
}
.legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 5px;
  border-radius: 2px;
}
.distribution {
  padding: 18px 20px;
}
.delta.in {
  color: #1c6a58;
}
.delta.out {
  color: #b45c2f;
}
dialog {
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--base);
  border-radius: 10px;
  width: min(790px, calc(100% - 24px));
  max-height: 92dvh;
  padding: 0;
  box-shadow: 0 16px 100px #1023283b;
}
dialog::backdrop {
  background: #14232e99;
}
.dialog-head {
  position: sticky;
  top: 0;
  background: var(--base);
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  z-index: 1;
  padding: 18px 22px 13px;
  border-bottom: 1px solid var(--line);
}
.dialog-head small {
  color: var(--muted);
}
.dialog-head h2 {
  margin: 4px 0;
}
.close {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  font-size: 24px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
}
.dialog-body {
  padding: 19px 22px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}
.form-grid .full {
  grid-column: 1/-1;
}
textarea {
  resize: vertical;
  min-height: 76px;
}
.line-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px auto;
  align-items: end;
  gap: 9px;
  margin: 8px 0;
}
.line-editor .remove-line {
  font-size: 16px;
}
.form-foot,
.dialog-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.form-foot {
  justify-content: space-between;
  margin-top: 18px;
}
.detail-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  padding: 12px 0;
}
.detail-meta span,
.detail-meta strong {
  display: block;
}
.detail-meta span {
  color: var(--muted);
  font-size: 12px;
}
.detail-meta strong {
  font-size: 14px;
}
.detail-box {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  overflow: hidden;
}
.detail-box > h3 {
  padding: 12px 15px;
  border-bottom: 1px solid var(--line);
}
.detail-box .audit {
  padding: 5px 15px;
}
.audit li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
}
.audit li:last-child {
  border: 0;
}
.audit span {
  font-size: 12px;
  color: var(--muted);
  display: block;
}
.op-form {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}
.op-form label {
  font-size: 13px;
  font-weight: 600;
}
.op-form select,
.op-form input {
  margin-top: 4px;
}
.scope-note {
  padding: 10px 14px;
  color: var(--soft);
  border: 1px dashed #a6b5ac;
  border-radius: 5px;
  margin-top: 17px;
  font-size: 13px;
}
.guide {
  margin-top: 12px;
  font-size: 13px;
  color: var(--soft);
}
#toast:not(:empty) {
  position: fixed;
  z-index: 8;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 17px;
  border-radius: 5px;
  background: #203039;
  color: white;
  box-shadow: 0 2px 18px #20303932;
  max-width: 95vw;
}
.inline-msg {
  color: var(--teal);
  font-weight: 600;
}
.stock-list strong {
  font-weight: 600;
}
@media (max-width: 1060px) {
  .shell {
    grid-template-columns: 174px minmax(0, 1fr);
  }
  .workspace {
    padding-inline: 21px;
  }
  .pair {
    grid-template-columns: 1.15fr 1fr;
  }
  .kpi {
    padding: 13px;
  }
  .sidebar {
    padding-inline: 12px;
  }
  .panel-head {
    padding: 15px;
  }
  .queue > li,
  .low-list > li {
    padding-inline: 14px;
  }
}
@media (max-width: 760px) {
  .login {
    display: block;
  }
  .login-story {
    padding: 23px 20px;
    gap: 17px;
  }
  .login-story h1 {
    font-size: 35px;
    margin-bottom: 9px;
  }
  .login-story > div > p {
    font-size: 14px;
  }
  .login-story .route {
    display: none;
  }
  .login-side {
    padding: 20px;
  }
  .login-side h2 {
    font-size: 24px;
  }
  .shell {
    display: block;
  }
  .sidebar {
    position: static;
    height: auto;
    display: block;
    padding: 13px 14px 0;
  }
  .sidebar .brand {
    padding-left: 2px;
  }
  .sidebar .brand div {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .sidebar .symbol {
    height: 30px;
    width: 30px;
    font-size: 21px;
  }
  .sidebar-bottom {
    position: absolute;
    top: 8px;
    right: 15px;
    margin: 0;
    border: 0;
    padding: 0;
  }
  .sidebar-bottom a {
    font-size: 12px;
  }
  .navigation {
    display: flex;
    gap: 2px;
    margin-top: 10px;
  }
  .navigation button {
    flex: 1 1 0;
    justify-content: center;
    padding: 9px 3px;
    gap: 5px;
    min-height: 42px;
    font-size: 13px;
    border-radius: 4px 4px 0 0;
    white-space: nowrap;
  }
  .navigation button[aria-current='page'] {
    box-shadow: inset 0 -3px var(--amber);
  }
  .navigation button svg {
    width: 15px;
    height: 15px;
  }
  .workspace {
    padding: 0 15px 25px;
  }
  .topbar {
    min-height: 44px;
  }
  .page-head {
    margin: 18px 0 13px;
  }
  .page-head p {
    font-size: 12px;
  }
  .brief {
    padding: 16px;
    grid-template-columns: 1fr;
    gap: 9px;
  }
  .brief-track {
    display: none;
  }
  .metrics {
    margin: 12px 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .kpi {
    padding: 10px 12px;
  }
  .kpi:nth-child(3) {
    border-left: 0;
  }
  .kpi:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
  .kpi strong {
    font-size: 27px;
  }
  .pair {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .panel-head {
    padding: 13px;
  }
  .panel-head h2 {
    font-size: 18px;
  }
  .panel-head p {
    font-size: 12px;
  }
  .toolrow {
    padding: 11px;
    gap: 8px;
  }
  .toolrow .search {
    flex: 1 1 100%;
    max-width: none;
  }
  .filters {
    gap: 6px;
  }
  .filters select {
    max-width: 145px;
  }
  .topbar .crumb {
    font-size: 11px;
  }
  .identity {
    gap: 6px;
  }
  .identity .avatar {
    display: none;
  }
  .button,
  .plain {
    padding-inline: 12px;
    min-height: 44px;
  }
  input:not([type='checkbox']),
  select,
  textarea {
    font-size: 16px;
  }
  .table-wrap.mobile-cards {
    overflow: visible;
  }
  .mobile-cards table,
  .mobile-cards tbody,
  .mobile-cards tr {
    display: block;
    width: 100%;
  }
  .mobile-cards thead {
    display: none;
  }
  .mobile-cards tr {
    border-bottom: 1px solid var(--line);
    padding: 10px 13px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 10px;
  }
  .mobile-cards tr:last-child {
    border-bottom: 0;
  }
  .mobile-cards td {
    border: 0;
    display: block;
    padding: 0;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .mobile-cards td:before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 11px;
  }
  .mobile-cards td.wide {
    grid-column: 1/-1;
  }
  .mobile-cards td .row-link {
    min-height: 33px;
  }
  .dialog-head,
  .dialog-body {
    padding: 14px;
  }
  .detail-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .detail-box td,
  .detail-box th {
    padding: 8px 6px;
  }
  .line-editor {
    grid-template-columns: minmax(0, 1fr) 60px 36px;
    gap: 5px;
  }
  .form-grid {
    gap: 9px;
  }
  .audit li {
    grid-template-columns: 92px 1fr;
  }
  .scope-note {
    font-size: 12px;
  }
  .legend {
    gap: 5px 12px;
  }
}
@media (max-width: 380px) {
  .navigation button svg {
    display: none;
  }
  .workspace {
    padding-inline: 10px;
  }
  .topbar .crumb b {
    display: none;
  }
  .identity {
    font-size: 11px;
  }
  .panel-head {
    gap: 5px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .line-editor select {
    padding-inline: 3px;
  }
  .login-side {
    padding: 16px;
  }
  .role-opt {
    font-size: 13px;
  }
  .login-story h1 {
    font-size: 30px;
  }
}
