.mat {
  --mat-label: 248px;
  --mat-col: 96px;
  --mat-rem: 96px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.mat-print-head { display: none; }
.mat-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.mat-hint { color: var(--muted); font-size: 12px; line-height: 1.35; max-width: 640px; }
.mat-tools .spacer { flex: 1; }
.mat-edit {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px 10px;
  align-items: end;
  padding: 12px 14px 14px;
  background: #f7f7f9;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.mat-edit[hidden] { display: none; }
.mat-edit label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  flex: 0 0 auto;
}
.mat-edit .title-field { flex: 0 0 220px; width: 220px; }
.mat-edit .note-field { flex: 0 0 180px; width: 180px; }
.mat-edit input,
.mat-edit select {
  width: 120px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 8px 10px;
  min-width: 0;
}
.mat-edit .title-field input,
.mat-edit .note-field input { width: 100%; }
.mat-edit input[name="qty"],
.mat-edit input[name="move_qty"] { width: 72px; }
.mat-edit select { width: 150px; }
.mat-edit-actions { display: flex; gap: 6px; align-items: center; flex: none; padding-bottom: 1px; }
.mat-move { position: relative; flex: none; padding-bottom: 1px; }
.mat-move-pop {
  position: fixed;
  z-index: 40;
  display: flex;
  gap: 8px;
  align-items: end;
  width: max-content;
  max-width: calc(100vw - 16px);
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.mat-move-pop[hidden] { display: none; }
.mat-fit { min-width: 0; }
.mat-body { display: flex; align-items: flex-start; min-width: 0; }
.mat-names { flex: 0 0 var(--mat-label); width: var(--mat-label); background: #fff; }
.mat-names .mat-label { position: static; width: 100%; height: 100%; }
.mat-scroll { flex: 1; min-width: 0; overflow-x: auto; overflow-y: hidden; }
.mat-sheet { position: relative; min-height: 92px; }
.mat-head, .mat-row { display: flex; position: relative; }
.mat-row.is-head { height: 52px; }
.mat-head { height: 52px; background: transparent; z-index: auto; }
.mat-row { height: 40px; }
.mat-row.is-group { height: 36px; }
.mat-row.is-total { height: 36px; }
.mat-label {
  position: sticky;
  left: 0;
  z-index: 9;
  width: var(--mat-label);
  flex: 0 0 var(--mat-label);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 28px 0 10px;
  background: #fff;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid #f0f0f2;
  min-width: 0;
  cursor: pointer;
}
.mat-label-head { cursor: default; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.mat-label-head b { font-size: 11px; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.mat-row.is-group .mat-label,
.mat-row.is-total .mat-label { background: #fbfbfd; font-weight: 700; }
.mat-label.is-off b { color: #9a6700; }
.mat-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  min-width: 0;
}
.mat-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  min-width: 0;
}
.mat-label b {
  margin-left: auto;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  flex: none;
}
.mat-mini {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--line);
}
.mat-track { position: relative; display: flex; height: 100%; z-index: 1; overflow: hidden; }
.mat-track-head { display: block; background: #fff; }
.mat-groups, .mat-units { display: flex; height: 26px; }
.mat-group, .mat-unit {
  flex: 0 0 var(--mat-col);
  width: var(--mat-col);
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
  cursor: pointer;
  box-sizing: border-box;
}
.mat-group { font-size: 10px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink); justify-content: center; text-align: center; padding: 0 6px; }
.mat-group.is-band { cursor: default; }
.mat-group.is-po, .mat-unit.is-po, .mat-cell.is-po { background: #f6f3ff; }
.mat-group.is-need, .mat-unit.is-need, .mat-cell.is-need { background: #fff6ee; }
.mat-group.is-where { background: #f3faf4; }
.mat-group.is-order, .mat-unit.is-order, .mat-cell.is-order { background: #fff8eb; }
.mat-unit.is-recv, .mat-cell.is-recv { background: #eef6ff; }
.mat-group.is-hold, .mat-unit.is-hold, .mat-cell.is-hold { background: #f3faf4; }
.mat-group.is-rma, .mat-unit.is-rma, .mat-cell.is-rma { background: #f3f6ff; }
.mat-unit.is-calc { cursor: default; font-weight: 700; }
.mat-cell.is-calc { font-weight: 700; }
.mat-cell.is-zero { color: #1f7a3a; }
.mat-cell.is-left { color: #8a5a00; }
.mat-cell.is-over { color: #b42318; }
.mat-cell {
  flex: 0 0 var(--mat-col);
  width: var(--mat-col);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid #ececf1;
  border-bottom: 1px solid #f0f0f2;
  box-sizing: border-box;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}
.mat-num {
  all: unset;
  width: 100% !important;
  height: 100%;
  text-align: center;
  font: inherit;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  box-sizing: border-box;
}
.mat-num:focus { background: #fff !important; box-shadow: inset 0 0 0 2px var(--blue) !important; }
.mat-rem {
  position: sticky;
  right: 0;
  z-index: 8;
  width: var(--mat-rem);
  flex: 0 0 var(--mat-rem);
  display: flex;
  align-items: center;
  justify-content: center;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid #f0f0f2;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.mat-rem-head {
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
  padding: 0 6px;
}
.mat-rem.is-zero { color: #1f7a3a; background: #eefbf2; }
.mat-rem.is-left { color: #8a5a00; background: #fff8eb; }
.mat-rem.is-over { color: #b42318; background: #fff1f0; }
.mat-row.is-group .mat-cell,
.mat-row.is-total .mat-cell { font-weight: 700; }
.mat-row.is-empty .mat-label { cursor: default; }

@media print {
  @page { size: A3 landscape; margin: 8mm; }
}
body.is-mat-printing { background: #fff !important; }
body.is-mat-printing .shell { display: block; }
body.is-mat-printing .nav,
body.is-mat-printing .topbar,
body.is-mat-printing .bottom-nav,
body.is-mat-printing .proj-rail,
body.is-mat-printing .tabs,
body.is-mat-printing .phero,
body.is-mat-printing .mat-tools,
body.is-mat-printing .mat-edit { display: none !important; }
body.is-mat-printing .view { max-width: none !important; width: auto !important; padding: 0 !important; }
body.is-mat-printing .proj-page { display: block; }
body.is-mat-printing .mat { box-shadow: none; border-radius: 0; overflow: visible; }
body.is-mat-printing .mat-scroll { overflow: visible; }
body.is-mat-printing .mat-fit { position: relative; overflow: hidden; }
body.is-mat-printing .mat-sheet { position: relative; }
body.is-mat-printing .mat-print-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 8px;
}
body.is-mat-printing .mat-print-head strong { font-size: 18px; }
body.is-mat-printing .mat-print-head span { color: #666; font-size: 12px; }
body.is-mat-printing .mat-group,
body.is-mat-printing .mat-unit,
body.is-mat-printing .mat-cell,
body.is-mat-printing .mat-rem {
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
