<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 760 420" width="760" height="420">
  <defs>
    <style>text { font-family: 'Noto Sans JP','Hiragino Sans',sans-serif; }</style>
  </defs>
  <rect width="760" height="420" rx="12" fill="#F8FAFC"/>
  <text x="380" y="34" text-anchor="middle" font-size="15" font-weight="700" fill="#1E293B">部門別原価計算——製造間接費の配賦の流れ</text>

  <!-- Top: 製造間接費 pool -->
  <rect x="250" y="52" width="260" height="52" rx="10" fill="#FFF7ED" stroke="#FDB97D" stroke-width="2"/>
  <text x="380" y="72" text-anchor="middle" font-size="12" font-weight="700" fill="#C2410C">製造間接費（全社集計）</text>
  <text x="380" y="90" text-anchor="middle" font-size="11" fill="#92400E">間接材料費・間接労務費・減価償却費 etc.</text>

  <!-- Arrow down to departments -->
  <text x="380" y="118" text-anchor="middle" font-size="10" fill="#64748B">① 部門費の第1次集計（発生部門に集める）</text>
  <line x1="380" y1="104" x2="380" y2="122" stroke="#64748B" stroke-width="1.5" stroke-dasharray="4,3"/>

  <!-- 3 department boxes -->
  <!-- 製造部門A -->
  <rect x="30" y="132" width="190" height="80" rx="10" fill="#EFF6FF" stroke="#93C5FD" stroke-width="2"/>
  <rect x="30" y="132" width="190" height="28" rx="10" fill="#3B82F6"/>
  <rect x="30" y="150" width="190" height="10" fill="#3B82F6"/>
  <text x="125" y="148" text-anchor="middle" font-size="12" font-weight="700" fill="#fff">製造部門 A</text>
  <text x="125" y="178" text-anchor="middle" font-size="11" fill="#1E40AF">切削・旋盤などの加工部門</text>
  <text x="125" y="196" text-anchor="middle" font-size="10" fill="#1E3A8A">製品に直接関わる部門</text>

  <!-- 製造部門B -->
  <rect x="285" y="132" width="190" height="80" rx="10" fill="#EFF6FF" stroke="#93C5FD" stroke-width="2"/>
  <rect x="285" y="132" width="190" height="28" rx="10" fill="#3B82F6"/>
  <rect x="285" y="150" width="190" height="10" fill="#3B82F6"/>
  <text x="380" y="148" text-anchor="middle" font-size="12" font-weight="700" fill="#fff">製造部門 B</text>
  <text x="380" y="178" text-anchor="middle" font-size="11" fill="#1E40AF">組立・仕上げなどの加工部門</text>
  <text x="380" y="196" text-anchor="middle" font-size="10" fill="#1E3A8A">製品に直接関わる部門</text>

  <!-- 補助部門 -->
  <rect x="540" y="132" width="190" height="80" rx="10" fill="#FEF2F2" stroke="#FCA5A5" stroke-width="2"/>
  <rect x="540" y="132" width="190" height="28" rx="10" fill="#EF4444"/>
  <rect x="540" y="150" width="190" height="10" fill="#EF4444"/>
  <text x="635" y="148" text-anchor="middle" font-size="12" font-weight="700" fill="#fff">補助部門</text>
  <text x="635" y="178" text-anchor="middle" font-size="11" fill="#991B1B">動力・修繕・工場管理 etc.</text>
  <text x="635" y="196" text-anchor="middle" font-size="10" fill="#7F1D1D">製造部門を支援する部門</text>

  <!-- Arrow from 補助部門 to 製造部門A and B -->
  <text x="540" y="228" text-anchor="middle" font-size="10" fill="#EF4444">② 補助部門費を製造部門へ配賦</text>
  <!-- arrow to A -->
  <polygon points="220,212 238,206 238,218" fill="#EF4444"/>
  <line x1="540" y1="212" x2="238" y2="212" stroke="#EF4444" stroke-width="1.5"/>
  <!-- arrow to B -->
  <polygon points="375,242 360,236 360,248" fill="#EF4444"/>
  <line x1="540" y1="242" x2="360" y2="242" stroke="#EF4444" stroke-width="1.5" stroke-dasharray="5,4"/>
  <text x="445" y="238" text-anchor="middle" font-size="9" fill="#EF4444">直接配賦法</text>

  <!-- Arrow from 製造部門 down to 製品 -->
  <text x="295" y="280" text-anchor="middle" font-size="10" fill="#3B82F6">③ 製造部門費を製品（仕掛品）へ予定配賦</text>
  <polygon points="125,296 119,284 131,284" fill="#3B82F6"/>
  <line x1="125" y1="212" x2="125" y2="296" stroke="#3B82F6" stroke-width="1.5"/>
  <polygon points="380,296 374,284 386,284" fill="#3B82F6"/>
  <line x1="380" y1="212" x2="380" y2="296" stroke="#3B82F6" stroke-width="1.5"/>

  <!-- 製品（仕掛品） -->
  <rect x="30" y="296" width="580" height="60" rx="10" fill="#F0FDF4" stroke="#86EFAC" stroke-width="2"/>
  <text x="320" y="322" text-anchor="middle" font-size="13" font-weight="700" fill="#166534">仕掛品（製品原価に集積）</text>
  <text x="320" y="342" text-anchor="middle" font-size="11" fill="#15803D">製造部門Aの配賦額＋製造部門Bの配賦額 ＝ 製品1個の間接費</text>

  <!-- Bottom note -->
  <rect x="30" y="370" width="700" height="38" rx="8" fill="#F1F5F9" stroke="#CBD5E1" stroke-width="1"/>
  <text x="380" y="386" text-anchor="middle" font-size="11" fill="#475569">💡 補助部門が互いにサービスを提供し合う場合は「相互配賦法」を使う（直接配賦法より精度が高い）</text>
  <text x="380" y="402" text-anchor="middle" font-size="10.5" fill="#475569">予定配賦率 ＝ 年間予算額 ÷ 年間予定配賦基準（機械時間・直接作業時間 etc.）</text>
</svg>
