.finished-product-ready-section,
.finished-product-history,
.finished-product-lines,
.finished-product-materials { display:grid; gap:12px; }
.finished-product-history { margin-top:22px; }
.finished-product-section-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.finished-product-section-head > div { display:grid; gap:2px; }
.finished-product-section-head small { color:#6b7280; font-size:12px; }
.finished-product-batch-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:10px; }
.finished-product-batch-card { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:14px; border:1px solid rgba(74,53,37,.13); border-radius:16px; background:rgba(255,255,255,.72); }
.finished-product-batch-card > div { min-width:0; display:grid; gap:5px; }
.finished-product-batch-card strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.finished-product-batch-card small { color:#6b7280; }
.finished-product-modal { width:min(760px,calc(100vw - 24px)); max-height:min(900px,calc(100dvh - 24px)); }
.finished-product-modal .admin-modal-close { min-height:44px; }
.finished-product-modal-body { display:grid; grid-template-columns:minmax(0,1fr); min-width:0; gap:18px; overflow:auto; }
.finished-product-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.finished-product-form-grid label,
.finished-product-line label { display:grid; gap:6px; color:#4b5563; font-size:12px; font-weight:800; }
.finished-product-form-grid .full { grid-column:1/-1; }
.finished-product-form-grid input,
.finished-product-form-grid select,
.finished-product-line input,
.finished-product-line select { min-height:44px; width:100%; border:1px solid rgba(74,53,37,.16); border-radius:12px; background:#fff; padding:9px 11px; color:#111827; }
.finished-product-create-product { width:max-content; max-width:100%; min-height:44px; border:0; background:transparent; color:#9b5e00; text-decoration:underline; padding:8px 0; font-weight:800; cursor:pointer; }
.finished-product-reservation { display:grid; grid-template-columns:minmax(0,1fr) repeat(2,minmax(130px,.7fr)); gap:10px; align-items:center; padding:10px 12px; border:1px solid rgba(22,163,74,.2); border-radius:13px; background:#f0fdf4; }
.finished-product-reservation > div { min-width:0; display:grid; gap:1px; }
.finished-product-reservation span,
.finished-product-reservation small { color:#64748b; font-size:10px; }
.finished-product-reservation b { overflow:hidden; font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
.finished-product-reservation.is-missing { display:grid; grid-template-columns:1fr; border-color:rgba(217,119,6,.25); background:#fff7e8; color:#854d0e; }
.finished-product-comparison { display:grid; gap:0; padding:10px; border:1px solid rgba(74,53,37,.11); border-radius:15px; background:rgba(250,248,244,.72); }
.finished-product-comparison-title { display:flex; align-items:baseline; gap:8px; padding:0 3px 7px; }
.finished-product-comparison-title small { color:#6b7280; font-size:10px; }
.finished-product-comparison-head,
.finished-product-comparison-row { display:grid; grid-template-columns:100px minmax(0,1fr) minmax(0,1fr) 112px; align-items:center; gap:8px; }
.finished-product-comparison-head { padding:0 9px 4px 12px; color:#6b7280; font-size:9px; font-weight:800; text-transform:uppercase; letter-spacing:.04em; }
.finished-product-comparison-head span:last-child { text-align:right; }
.finished-product-comparison-row { min-height:46px; padding:6px 9px; background:#fff; border-top:1px solid rgba(74,53,37,.08); border-left:3px solid #9ca3af; }
.finished-product-comparison-head + .finished-product-comparison-row { border-radius:10px 10px 0 0; }
.finished-product-comparison-row:last-child { border-radius:0 0 10px 10px; }
.finished-product-comparison-row > div { min-width:0; display:grid; gap:0; }
.finished-product-comparison-row small { overflow:hidden; color:#6b7280; font-size:9px; line-height:1.2; text-overflow:ellipsis; white-space:nowrap; }
.finished-product-comparison-row span { font-size:13px; font-weight:900; line-height:1.2; }
.finished-product-comparison-row b { text-align:right; font-size:10px; line-height:1.2; }
.finished-product-comparison-row.is-match { border-left-color:#16a34a; }
.finished-product-comparison-row.is-match b { color:#15803d; }
.finished-product-comparison-row.is-warning { border-left-color:#d97706; }
.finished-product-comparison-row.is-warning b { color:#a34800; }
.finished-product-comparison-row.is-danger { border-left-color:#dc2626; }
.finished-product-comparison-row.is-danger b { color:#b91c1c; }
.finished-product-comparison-row.is-missing b { color:#6b7280; }
.finished-product-line { display:grid; grid-template-columns:minmax(0,1fr) 110px auto; gap:10px; align-items:end; padding:12px; border:1px solid rgba(74,53,37,.11); border-radius:14px; background:rgba(250,248,244,.82); }
.finished-product-line-reservation { grid-column:1/-1; color:#15803d; font-size:10px; font-weight:800; }
.finished-product-material { display:grid; grid-template-columns:minmax(0,.8fr) minmax(240px,1.2fr); gap:12px; align-items:end; padding:10px 12px; border:1px solid rgba(74,53,37,.11); border-radius:13px; background:rgba(250,248,244,.82); }
.finished-product-material > div { min-width:0; display:grid; gap:2px; }
.finished-product-material > div small { color:#6b7280; font-size:10px; }
.finished-product-material label { display:grid; gap:5px; color:#4b5563; font-size:10px; font-weight:800; }
.finished-product-material select { width:100%; min-height:44px; border:1px solid rgba(74,53,37,.16); border-radius:11px; background:#fff; padding:8px 10px; color:#111827; }
.finished-product-material-warning { color:#a34800; font-weight:800; }
.finished-product-volume-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.finished-product-volume-summary > div { display:grid; gap:4px; padding:11px 12px; border-radius:13px; background:#f6f3ee; }
.finished-product-volume-summary span { color:#6b7280; font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.04em; }
.finished-product-volume-summary .is-warning { background:#fff4df; color:#9a4d00; }
.finished-product-volume-confirm { display:flex; align-items:flex-start; gap:10px; padding:12px; border-radius:13px; background:#fff4df; color:#7c3f00; font-weight:800; }
.finished-product-volume-confirm input { width:20px; height:20px; flex:0 0 auto; }
.finished-product-actions { justify-content:flex-end; }
.finished-product-actions .finished-product-delete { margin-right:auto; }
.finished-product-synced-summary { display:grid; gap:7px; padding:18px; border-radius:16px; background:#ecfdf3; }
.finished-product-synced-summary .goods-receipt-status { width:max-content; }

body[data-member-theme="dark"] .finished-product-modal-body { color:#f5f7fb; }
body[data-member-theme="dark"] .finished-product-form-grid label,
body[data-member-theme="dark"] .finished-product-line label,
body[data-member-theme="dark"] .finished-product-material label { color:#d8dde6; }
body[data-member-theme="dark"] .finished-product-form-grid input,
body[data-member-theme="dark"] .finished-product-form-grid select,
body[data-member-theme="dark"] .finished-product-line input,
body[data-member-theme="dark"] .finished-product-line select,
body[data-member-theme="dark"] .finished-product-material select {
  color-scheme:dark;
  background:#101319;
  border-color:rgba(255,255,255,.18);
  color:#f5f7fb;
}
body[data-member-theme="dark"] .finished-product-form-grid input:focus,
body[data-member-theme="dark"] .finished-product-form-grid select:focus,
body[data-member-theme="dark"] .finished-product-line input:focus,
body[data-member-theme="dark"] .finished-product-line select:focus,
body[data-member-theme="dark"] .finished-product-material select:focus {
  border-color:#ffad66;
  box-shadow:0 0 0 3px rgba(255,106,0,.16);
  outline:0;
}
body[data-member-theme="dark"] .finished-product-form-grid input:disabled,
body[data-member-theme="dark"] .finished-product-form-grid select:disabled,
body[data-member-theme="dark"] .finished-product-line input:disabled,
body[data-member-theme="dark"] .finished-product-line select:disabled,
body[data-member-theme="dark"] .finished-product-material select:disabled {
  background:#15181e;
  border-color:rgba(255,255,255,.1);
  color:#8f98a6;
  opacity:1;
}
body[data-member-theme="dark"] .finished-product-section-head small,
body[data-member-theme="dark"] .finished-product-material>div small,
body[data-member-theme="dark"] .finished-product-comparison-title small,
body[data-member-theme="dark"] .finished-product-comparison-head,
body[data-member-theme="dark"] .finished-product-comparison-row small,
body[data-member-theme="dark"] .finished-product-volume-summary span { color:#b0b7c3; }
body[data-member-theme="dark"] .finished-product-create-product { color:#ffad66; }
body[data-member-theme="dark"] .finished-product-reservation {
  background:#163426;
  border-color:rgba(134,239,172,.24);
}
body[data-member-theme="dark"] .finished-product-reservation span,
body[data-member-theme="dark"] .finished-product-reservation small { color:#bbd7c3; }
body[data-member-theme="dark"] .finished-product-reservation.is-missing {
  background:#3a2a16;
  border-color:rgba(251,191,36,.3);
  color:#fdba74;
}
body[data-member-theme="dark"] .finished-product-reservation.is-missing small { color:#f4c995; }
body[data-member-theme="dark"] .finished-product-comparison {
  background:#1f232b;
  border-color:rgba(255,255,255,.14);
}
body[data-member-theme="dark"] .finished-product-comparison-row {
  background:#171a20;
  border-top-color:rgba(255,255,255,.1);
}
body[data-member-theme="dark"] .finished-product-comparison-row.is-match b { color:#86efac; }
body[data-member-theme="dark"] .finished-product-comparison-row.is-warning b { color:#fdba74; }
body[data-member-theme="dark"] .finished-product-comparison-row.is-danger b { color:#fda4af; }
body[data-member-theme="dark"] .finished-product-comparison-row.is-missing b { color:#b0b7c3; }
body[data-member-theme="dark"] .finished-product-line,
body[data-member-theme="dark"] .finished-product-material {
  background:#1f232b;
  border-color:rgba(255,255,255,.14);
}
body[data-member-theme="dark"] .finished-product-line-reservation { color:#86efac; }
body[data-member-theme="dark"] .finished-product-material-warning { color:#fdba74; }
body[data-member-theme="dark"] .finished-product-volume-summary>div {
  background:#1f232b;
  border:1px solid rgba(255,255,255,.12);
}
body[data-member-theme="dark"] .finished-product-volume-summary .is-warning,
body[data-member-theme="dark"] .finished-product-volume-confirm {
  background:#3a2a16;
  color:#fdba74;
  border-color:rgba(251,191,36,.3);
}
body[data-member-theme="dark"] .finished-product-synced-summary {
  background:#163426;
  border:1px solid rgba(134,239,172,.24);
}
body[data-member-theme="dark"] .finished-product-synced-summary small { color:#bbd7c3; }

@media (max-width:640px) {
  .finished-product-modal { width:calc(100vw - 12px); max-height:calc(100dvh - 12px); }
  .finished-product-form-grid { grid-template-columns:1fr; }
  .finished-product-form-grid .full { grid-column:auto; }
  .finished-product-batch-card { align-items:stretch; flex-direction:column; }
  .finished-product-batch-card .btn { width:100%; min-height:44px; }
  .finished-product-line { grid-template-columns:minmax(0,1fr) 92px; }
  .finished-product-material { grid-template-columns:1fr; }
  .finished-product-reservation { grid-template-columns:1fr 1fr; }
  .finished-product-reservation > div:first-child { grid-column:1/-1; }
  .finished-product-reservation.is-missing { grid-template-columns:1fr; }
  .finished-product-line .btn { grid-column:1/-1; min-height:44px; }
  .finished-product-volume-summary { grid-template-columns:1fr; }
  .finished-product-comparison { padding:8px; }
  .finished-product-comparison-head,
  .finished-product-comparison-row { grid-template-columns:76px minmax(0,1fr) minmax(0,1fr); gap:6px; }
  .finished-product-comparison-head { padding-left:9px; padding-right:6px; }
  .finished-product-comparison-head span:last-child { display:none; }
  .finished-product-comparison-row { grid-template-rows:auto auto; min-height:48px; padding:6px; }
  .finished-product-comparison-row > strong { grid-column:1; grid-row:1; font-size:12px; }
  .finished-product-comparison-row > div { grid-row:1/3; }
  .finished-product-comparison-row > b { grid-column:1; grid-row:2; max-width:none; text-align:left; font-size:9px; }
  .finished-product-actions { display:grid; grid-template-columns:1fr; }
  .finished-product-actions .btn { width:100%; min-height:44px; }
  .finished-product-actions .finished-product-delete { margin-right:0; }
}
