/* Dashboard shortcuts */
.service-shortcuts {
  display: grid;
  gap: .9rem;
}
.service-shortcuts > h1 { margin: 0; }
.service-shortcuts-head {
  display: flex;
  gap: .75rem;
  align-items: baseline;
  justify-content: space-between;
}
.service-shortcuts-head h2 { margin: 0; }
.service-shortcut-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
}
.service-shortcut {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  gap: .7rem;
  align-items: center;
  min-height: 4.6rem;
  padding: .8rem;
  border: 1px solid var(--line);
  border-radius: .8rem;
  background: var(--row-stripe);
  color: var(--text);
  text-decoration: none;
}
.service-shortcut:hover,
.service-shortcut:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
}
.service-shortcut-mark {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: .65rem;
  color: #fff;
  font-size: .9rem;
  font-weight: 850;
}
.service-shortcut strong,
.service-shortcut small {
  display: block;
  min-width: 0;
  overflow-wrap: break-word;
}
.service-shortcut strong { line-height: 1.25; }
.service-shortcut small {
  margin-top: .2rem;
  font-size: .9rem;
}
.service-shortcut-files .service-shortcut-mark { background: #087443; }
.service-shortcut-chat .service-shortcut-mark { background: #155eef; }
.service-shortcut-ai-chat .service-shortcut-mark { background: #7f56d9; }
.service-shortcut-ai-bot .service-shortcut-mark { background: #b42318; }

@media (max-width: 980px) {
  .service-shortcut-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .service-shortcuts-head {
    display: grid;
    gap: .2rem;
  }
  .service-shortcut-grid { grid-template-columns: 1fr; }
}

/* Production: pending table + drag affordance */
.call-list {
  display: grid;
  gap: .6rem;
  margin-top: .8rem;
}
.call-alert {
  display: grid;
  gap: .45rem;
}
.call-alert span {
  font-size: .9rem;
}
.call-message {
  margin: 0;
  padding: .55rem .65rem;
  border: 1px solid currentColor;
  border-radius: .65rem;
  background: color-mix(in srgb, var(--card) 70%, transparent);
  color: var(--text);
  font-weight: 650;
  line-height: 1.45;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}
.call-message-dialog-form textarea {
  min-height: 7rem;
}
.call-sound-toggle {
  margin-top: .65rem;
  border-color: var(--danger);
  background: var(--alert-error-bg);
  color: var(--danger);
}
.call-sound-toggle[hidden] { display: none; }
.production-call-panel {
  border: 1px solid var(--line);
}
.production-call-panel.has-calls {
  border-color: var(--danger);
  background: var(--alert-error-bg);
}
.production-call-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-height: var(--touch-target);
  cursor: pointer;
  list-style: none;
}
.production-call-panel > summary::-webkit-details-marker {
  display: none;
}
.production-call-panel > summary span {
  display: grid;
  gap: .15rem;
  min-width: 0;
}
.production-call-panel > summary strong {
  font-size: 1.25rem;
}
.production-call-panel > summary small {
  color: var(--muted);
  font-weight: 800;
}
.production-call-panel > summary::after {
  content: "열기";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.5rem;
  min-height: var(--control-compact);
  padding: .45rem .8rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: var(--card);
  color: var(--primary-strong);
  font-weight: 900;
}
.production-call-panel[open] > summary::after {
  content: "접기";
}
.production-call-panel[open] > summary {
  margin-bottom: .75rem;
}
.global-call-region {
  max-width: 1440px;
  margin: .75rem auto 0;
  padding: 0 1.25rem;
}
.global-call-shell {
  display: grid;
  gap: .55rem;
  padding: .65rem .75rem;
  border: 1px solid var(--danger);
  border-radius: .8rem;
  background: var(--card);
  box-shadow: var(--shadow-soft);
}
.global-call-summary {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem .75rem;
  align-items: center;
  justify-content: space-between;
  min-height: var(--control-compact);
  cursor: pointer;
  list-style: none;
}
.global-call-summary::-webkit-details-marker {
  display: none;
}
.global-call-title {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .65rem;
  align-items: baseline;
  min-width: 0;
}
.global-call-title strong {
  color: var(--danger);
  font-size: 1.05rem;
}
.global-call-summary-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
}
.global-call-open-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-compact);
  padding: .4rem .75rem;
  border: 1px solid var(--line);
  border-radius: .6rem;
  background: var(--card);
  color: var(--primary-strong);
  font-weight: 900;
}
.global-call-shell[open] .global-call-open-label::before {
  content: "접기";
}
.global-call-shell[open] .global-call-open-label {
  font-size: 0;
}
.global-call-shell[open] .global-call-open-label::before {
  font-size: 1rem;
}
.global-call-list {
  display: grid;
  gap: .45rem;
}
.global-call-alert {
  display: grid;
  gap: .35rem;
  margin: 0;
  padding: .65rem .75rem;
  border: 1px solid var(--line);
  border-left-width: .35rem;
  border-radius: .7rem;
  background: var(--row-stripe);
}
.global-call-alert.incoming {
  border-left-color: var(--danger);
}
.global-call-alert.outgoing {
  border-left-color: var(--ok);
}
.global-call-alert strong,
.global-call-alert span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.global-call-alert .call-message {
  border-color: var(--line);
  background: var(--card);
}
.global-call-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
}
.global-call-actions > * {
  min-width: 0;
}
.global-call-actions .call-ack-and-open {
  flex-grow: 1;
}
.global-call-alert[aria-busy="true"] .global-call-actions button {
  cursor: wait;
  opacity: .7;
}
.global-call-error {
  margin: 0;
}
.global-call-sound-toggle {
  margin-top: 0;
  min-height: var(--control-compact);
  padding: .4rem .7rem;
}
.employee-table { table-layout: fixed; }
.employee-table th:first-child { width: 18%; }
.employee-table th:nth-child(2) { width: 52%; }
.employee-table input,
.employee-table select { width: 100%; }
.employee-table .action-cell {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
}
.employee-table .action-cell form { margin: 0; }
.inline-read-value {
  display: block;
  min-width: 0;
  min-height: var(--control-compact);
  padding: .62rem 0;
  overflow-wrap: anywhere;
}
.inline-detail-row td {
  background: var(--row-detail);
}
.employee-mattermost-panel {
  padding: .25rem 0 1rem;
}
.employee-mattermost-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.employee-mattermost-heading > div {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.employee-mattermost-heading h2 { margin: 0; }
.employee-mattermost-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: .6rem 1rem;
  margin: .9rem 0;
}
.employee-mattermost-summary div { min-width: 0; }
.employee-mattermost-summary dt {
  color: var(--muted);
  font-size: .85rem;
}
.employee-mattermost-summary dd {
  margin: .2rem 0 0;
  overflow-wrap: anywhere;
}
.employee-mattermost-form { margin-top: .9rem; }
.employee-mattermost-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}
.employee-mattermost-actions form { margin: 0; }
.inline-danger-zone {
  padding: .85rem 0 0;
  border-top: 1px solid var(--line);
}
.inline-danger-zone form { margin: .5rem 0 0; }
.inline-danger-zone .danger { min-height: var(--control-compact); }

.pending-table th,
.pending-table td { white-space: nowrap; }
.pending-table tr.dragging { opacity: .45; }
.pending-table tr[draggable="true"] { cursor: move; }
.pending-table tr[draggable="true"] td:first-child::before {
  content: "≡ ";
  color: var(--primary);
  font-weight: 700;
  margin-right: .25rem;
}

/* Production: pending queue cards + currently running */
.queue {
  display: grid;
  gap: .6rem;
  padding-left: 1.4rem;
}
.queue li {
  background: var(--row-stripe);
  border: 1px solid var(--line);
  border-radius: .8rem;
  padding: .8rem;
}
.queue li.dragging { opacity: .45; }
.queue span {
  display: block;
  color: var(--muted);
  margin-top: .2rem;
}

.running {
  border: 2px solid var(--primary);
  border-radius: 1rem;
  padding: 1rem;
  background: color-mix(in srgb, var(--primary) 10%, var(--card));
}
.running strong { font-size: 1.3rem; }
.running span { display: block; margin-top: .25rem; }

/* Manufacturing records */
.manufacturing-create textarea,
.manufacturing-step-form textarea {
  min-height: 5rem;
}
.manufacturing-card-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: .75rem;
}
.manufacturing-board .manufacturing-card-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.production-priority-cards {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
}
.production-candidate-list {
  grid-template-columns: 1fr;
}
.production-candidate-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1rem;
}
.production-order-heading {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem 1rem;
  align-items: center;
  justify-content: space-between;
}
.production-reorder-form {
  margin: 0;
}
.production-order-list {
  align-items: stretch;
}
.production-order-item {
  display: grid;
  gap: .45rem;
  min-width: 0;
}
.production-order-item.dragging {
  opacity: .45;
}
.production-order-item.is-reordering .production-work-card {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--primary) 18%, transparent);
}
.production-order-item.is-reordering {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--primary) 14%, transparent);
}
.production-order-controls {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
}
.production-order-controls[hidden] {
  display: none;
}
.production-order-grip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  min-height: var(--control-compact);
  border: 1px dashed var(--primary);
  border-radius: .45rem;
  color: var(--primary-strong);
  font-weight: 900;
  cursor: grab;
}
.production-order-controls button {
  min-height: var(--control-compact);
  padding: .35rem .55rem;
}
.manufacturing-work-card {
  display: grid;
  gap: .45rem;
  min-width: 0;
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: .8rem;
  background: var(--row-stripe);
  color: var(--text);
  text-decoration: none;
}
.manufacturing-work-card:hover,
.manufacturing-work-card:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
}
.manufacturing-work-card small,
.table-subtext {
  display: block;
  color: var(--muted);
  font-size: .9rem;
  margin-top: .2rem;
}
.manufacturing-work-card > strong,
.manufacturing-work-card > span,
.manufacturing-work-card > small {
  min-width: 0;
  max-width: 100%;
}
.manufacturing-work-card-task {
  align-content: start;
  overflow: hidden;
}
.manufacturing-card-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  min-height: var(--control-compact);
  margin-top: .15rem;
  padding: .4rem .7rem;
  border: 1px solid var(--primary);
  border-radius: .6rem;
  background: var(--primary);
  color: white;
  font-weight: 900;
}
.production-work-card {
  align-content: start;
  gap: .55rem;
  overflow: hidden;
}
.production-work-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .5rem;
  align-items: start;
  min-width: 0;
}
.production-work-title,
.production-work-lot,
.production-work-meta,
.production-step-badge {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.production-work-title {
  font-size: 1.12rem;
  line-height: 1.25;
}
.production-work-lot {
  display: block;
  color: var(--text);
  font-weight: 750;
}
.production-work-meta {
  margin-top: 0;
}
.production-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 9rem;
  min-height: 2rem;
  padding: .25rem .55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--primary-strong);
  font-size: .86rem;
  font-weight: 900;
}
.production-work-card .action-cell {
  align-items: stretch;
  margin-top: .1rem;
}
.production-work-card .button-link {
  flex: 1 1 8rem;
  min-width: 0;
}
.manufacturing-my-turn td {
  background: color-mix(in srgb, var(--primary) 9%, var(--card));
}
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-target);
  padding: .65rem 1rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  color: var(--text);
  background: var(--card);
  text-decoration: none;
  font-weight: 700;
}
.button-link:visited {
  color: var(--text);
}
.button-link:hover,
.button-link:focus {
  border-color: var(--primary);
  color: var(--primary);
}
.button-link.primary:visited,
.button-link.primary:hover,
.button-link.primary:focus {
  color: white;
}
.button-link.secondary:visited,
.button-link.secondary:hover,
.button-link.secondary:focus {
  color: var(--primary-strong);
}
.button-link.danger:visited,
.button-link.danger:hover,
.button-link.danger:focus {
  color: white;
}
.button-link.quiet:visited,
.button-link.quiet:hover,
.button-link.quiet:focus {
  color: var(--muted);
}
.manufacturing-create button,
.manufacturing-detail-head button,
.manufacturing-detail-head .button-link,
.manufacturing-step-card button,
.manufacturing-table .button-link {
  min-height: 54px;
  padding: .8rem 1.1rem;
  border-radius: .75rem;
  font-size: 1.02rem;
  font-weight: 850;
}
details.manufacturing-create > summary,
details.product-create > summary,
.raw-material-secondary > summary,
.manufacturing-step-details > summary {
  display: flex;
  gap: .75rem;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
}
details.manufacturing-create > summary::-webkit-details-marker,
details.product-create > summary::-webkit-details-marker,
.raw-material-secondary > summary::-webkit-details-marker,
.manufacturing-step-details > summary::-webkit-details-marker { display: none; }
details.manufacturing-create > summary::after,
details.product-create > summary::after,
.raw-material-secondary > summary::after,
.manufacturing-step-details > summary::after {
  content: "열기";
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-target);
  padding: .45rem .75rem;
  border: 1px solid var(--line);
  border-radius: .7rem;
  color: var(--primary-strong);
  font-weight: 900;
}
details.manufacturing-create[open] > summary::after,
details.product-create[open] > summary::after,
.raw-material-secondary[open] > summary::after,
.manufacturing-step-details[open] > summary::after { content: "접기"; }
details.manufacturing-create > summary h1,
details.product-create > summary h2,
.raw-material-secondary > summary h2 { margin: 0; }
.product-create-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.product-create-header h2 { margin: 0; }
.manufacturing-step-details > summary span:first-child {
  display: grid;
  gap: .15rem;
  min-width: 0;
}
.manufacturing-step-details > summary {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: .75rem;
}
.manufacturing-step-details > summary .badge {
  flex: none;
  margin-top: .1rem;
}
.manufacturing-step-details > summary::after {
  flex: none;
  margin-left: auto;
}
.manufacturing-step-details > summary small { display: block; }
.manufacturing-step-details[open] > .manufacturing-step-card {
  margin-top: .9rem;
  padding-top: .9rem;
  border-top: 1px solid var(--line);
}
.manufacturing-confirm-row .action-cell {
  gap: .6rem;
}
.manufacturing-confirm-row .action-cell button {
  min-width: 8rem;
}
.manufacturing-confirm-row .action-cell button.primary {
  min-width: 12rem;
}
.manufacturing-detail-head,
.manufacturing-step-title,
.manufacturing-head-actions,
.manufacturing-confirm-row {
  display: flex;
  gap: .75rem;
  align-items: center;
  justify-content: space-between;
}
.manufacturing-head-actions,
.manufacturing-confirm-row .action-cell {
  flex-wrap: wrap;
}
.manufacturing-step-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: .6rem;
}
.manufacturing-step-list li {
  min-height: 5rem;
  display: grid;
  gap: .2rem;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: .8rem;
  background: var(--row-stripe);
}
.manufacturing-step-list li.current {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--primary) 18%, transparent);
}
.manufacturing-step-list span,
.manufacturing-step-list small,
.manufacturing-events li span {
  color: var(--muted);
}
.manufacturing-step-card {
  display: grid;
  gap: .9rem;
}
.manufacturing-step-form {
  display: grid;
  gap: .9rem;
}
.manufacturing-document-hero {
  display: grid;
  gap: .4rem;
}
.manufacturing-document-filter {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: end;
  justify-content: flex-end;
}
.manufacturing-document-filter label {
  min-width: 12rem;
}
.manufacturing-completed-filter {
  margin: .35rem 0 1rem;
  justify-content: flex-start;
}
.manufacturing-document-table .action-cell {
  justify-content: flex-end;
}
.manufacturing-draft-row td {
  background: #f9fafb;
}
.manufacturing-memo-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.7rem;
  padding: .2rem .55rem;
  border: 1px solid #fde68a;
  border-radius: 999px;
  background: #fffbeb;
  color: #92400e;
  font-weight: 900;
  white-space: nowrap;
}
.manufacturing-document-manual-create > summary {
  cursor: pointer;
}
.manufacturing-field-memo-alert {
  border-color: #fde68a;
  background: #fffbeb;
}
.manufacturing-field-memo-alert p {
  margin: 0;
}
.manufacturing-document-form {
  display: grid;
  gap: 1rem;
}
.manufacturing-document-save-panel {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
  align-items: center;
  justify-content: space-between;
}
.manufacturing-document-save-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  align-items: center;
  justify-content: flex-end;
}
.manufacturing-document-section {
  scroll-margin-top: 5rem;
}
.manufacturing-document-section .manufacturing-step-title {
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--line);
}
.manufacturing-document-bottom-save {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  justify-content: space-between;
}
.manufacturing-document-bottom-save button,
.manufacturing-document-save-actions button {
  min-height: var(--touch-target);
}
.manufacturing-subsection,
.manufacturing-reference {
  display: grid;
  gap: .75rem;
  padding: .9rem;
  border: 1px solid var(--line);
  border-radius: .85rem;
  background: var(--row-stripe);
}
.manufacturing-subsection h3 {
  margin: 0;
  font-size: 1.12rem;
}
.manufacturing-work-entry {
  display: grid;
  gap: .65rem;
}
.manufacturing-work-entry-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .65rem 1rem;
  padding: .7rem .8rem;
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: var(--card);
}
.manufacturing-work-entry-controls p {
  flex: 1 1 24rem;
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}
.manufacturing-work-entry-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: .5rem;
}
.manufacturing-work-entry-actions button {
  min-height: var(--touch-target);
}
.manufacturing-work-entry-actions strong {
  min-width: 3.5rem;
  text-align: center;
  white-space: nowrap;
}
.manufacturing-reference > summary {
  cursor: pointer;
  font-weight: 900;
}
.manufacturing-standard-note {
  margin: 0;
  padding: .75rem .85rem;
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: var(--row-stripe);
  color: var(--muted);
  font-weight: 800;
}
.manufacturing-check-table,
.manufacturing-material-table,
.manufacturing-table {
  table-layout: fixed;
}
.manufacturing-inspection-table .inspection-col-category { width: 7.5rem; }
.manufacturing-inspection-table .inspection-col-item { width: 11rem; }
.manufacturing-inspection-table .inspection-col-method { width: 11rem; }
.manufacturing-inspection-table .inspection-col-standard { width: 12rem; }
.manufacturing-inspection-table .inspection-col-result { width: 15rem; }
.manufacturing-inspection-table .manufacturing-choice-group {
  min-width: 0;
}
.manufacturing-check-table input,
.manufacturing-check-table select,
.manufacturing-material-table input,
.manufacturing-material-table select {
  width: 100%;
  min-width: 0;
}
.manufacturing-process-table td input + input {
  margin-top: .4rem;
}
.manufacturing-material-summary-note {
  padding: .85rem 1rem;
  border: 1px solid var(--line);
  border-radius: .85rem;
  background: var(--row-stripe);
  color: var(--muted);
  font-weight: 750;
}
.manufacturing-material-list {
  display: grid;
  gap: .9rem;
}
.manufacturing-material-block {
  display: grid;
  gap: .85rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: .9rem;
  background: var(--card);
}
.manufacturing-material-head {
  display: grid;
  grid-template-columns: minmax(12rem, 1.35fr) minmax(24rem, 2fr) auto;
  gap: .85rem;
  align-items: center;
}
.manufacturing-material-head h3 {
  margin: 0;
  font-size: 1.15rem;
}
.manufacturing-material-head p {
  margin: .15rem 0 0;
  color: var(--muted);
  font-weight: 750;
}
.manufacturing-material-counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .55rem;
  margin: 0;
}
.manufacturing-material-counts div {
  display: grid;
  gap: .1rem;
  min-height: 4.4rem;
  padding: .65rem .75rem;
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: var(--row-stripe);
}
.manufacturing-material-counts dt {
  color: var(--muted);
  font-size: .9rem;
  font-weight: 800;
}
.manufacturing-material-counts dd {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 900;
}
.manufacturing-material-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-compact);
  min-width: 6rem;
  padding: .45rem .7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 900;
  white-space: nowrap;
}
.manufacturing-material-status.shortage {
  border-color: #fbbf24;
  background: var(--warning-soft);
  color: var(--warning);
}
.manufacturing-material-status.complete {
  border-color: #abefc6;
  background: var(--ok-soft);
  color: var(--ok);
}
.manufacturing-material-status.overage {
  border-color: #fecdca;
  background: var(--danger-soft);
  color: var(--danger);
}
.manufacturing-material-allocation-list {
  display: grid;
  gap: .55rem;
}
.manufacturing-material-allocation-header,
.manufacturing-material-allocation-row {
  display: grid;
  grid-template-columns: minmax(15rem, 1fr) minmax(10rem, 16rem) auto;
  gap: .65rem;
  align-items: end;
}
.manufacturing-material-allocation-header {
  align-items: center;
  min-height: 2.4rem;
  padding: 0 .1rem;
  color: var(--muted);
  font-size: .95rem;
  font-weight: 850;
}
.manufacturing-material-allocation-row {
  padding: .7rem;
  border: 1px solid var(--line);
  border-radius: .8rem;
  background: var(--row-stripe);
}
.manufacturing-material-allocation-row label {
  gap: .3rem;
}
.manufacturing-material-remove {
  align-self: end;
  min-width: 5.6rem;
}
.manufacturing-material-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
}
.manufacturing-material-empty {
  margin: 0;
  padding: .9rem 1rem;
  border: 1px dashed var(--line);
  border-radius: .8rem;
  background: var(--row-stripe);
  color: var(--muted);
  font-weight: 750;
}
.manufacturing-material-empty.is-warning {
  border-color: #fbbf24;
  background: var(--warning-soft);
  color: var(--warning);
}
.manufacturing-employee-select {
  width: 100%;
  min-width: 0;
}
.manufacturing-choice-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(6.2rem, 1fr));
  gap: .55rem;
  min-width: min(16rem, 100%);
}
.manufacturing-choice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  position: relative;
  min-height: 58px;
  padding: .75rem .8rem;
  border: 2px solid var(--line);
  border-radius: .75rem;
  background: var(--input-bg);
  color: var(--input-text);
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--line) 65%, transparent);
}
.manufacturing-choice input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: inherit;
}
.manufacturing-choice span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-width: 0;
  overflow-wrap: break-word;
}
.manufacturing-choice span::before {
  content: "";
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 1.45rem;
  height: 1.45rem;
  border: 2px solid currentColor;
  border-radius: 999px;
  background: var(--card);
  font-size: 1rem;
  line-height: 1;
}
.manufacturing-choice input:checked + span::before {
  content: "✓";
  background: #fff;
  border-color: #fff;
}
.manufacturing-choice-pass input:checked + span::before {
  color: #087443;
}
.manufacturing-choice-fail input:checked + span::before {
  content: "×";
}
.manufacturing-choice-fail input:checked + span::before {
  color: #b42318;
}
.manufacturing-checkbox span {
  min-width: 0;
  overflow-wrap: break-word;
}
.manufacturing-choice:hover,
.manufacturing-choice:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent);
}
.manufacturing-choice-pass:has(input:checked) {
  border-color: #16a34a;
  background: #16a34a;
  color: #fff;
  box-shadow: 0 0 0 3px color-mix(in srgb, #16a34a 20%, transparent);
}
.manufacturing-choice-fail:has(input:checked) {
  border-color: #dc2626;
  background: #dc2626;
  color: #fff;
  box-shadow: 0 0 0 3px color-mix(in srgb, #dc2626 20%, transparent);
}
.manufacturing-choice.disabled {
  cursor: not-allowed;
  opacity: .72;
}
.manufacturing-choice.disabled:hover,
.manufacturing-choice.disabled:focus-within {
  box-shadow: none;
}
.manufacturing-result-field {
  display: grid;
  gap: .35rem;
  max-width: min(22rem, 100%);
  font-weight: 650;
}
.manufacturing-inventory-preview {
  display: grid;
  gap: .75rem;
  padding: 1rem;
  border: 2px solid var(--primary);
  border-radius: .9rem;
  background: color-mix(in srgb, var(--primary-soft) 72%, var(--card));
}
.manufacturing-inventory-preview h3 {
  margin: 0;
  font-size: 1.25rem;
}
.manufacturing-inventory-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .6rem;
  margin: 0;
}
.manufacturing-inventory-metrics div {
  display: grid;
  gap: .15rem;
  min-height: 4.2rem;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: var(--card);
}
.manufacturing-inventory-metrics dt {
  color: var(--muted);
  font-size: .9rem;
  font-weight: 850;
}
.manufacturing-inventory-metrics dd {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 950;
}
.manufacturing-inventory-warning {
  margin: 0;
  padding: .75rem .85rem;
  border: 1px solid color-mix(in srgb, var(--warning) 45%, var(--line));
  border-radius: .75rem;
  background: var(--warning-soft);
  color: var(--warning);
  font-weight: 850;
}
.manufacturing-inventory-table {
  width: 100%;
  table-layout: fixed;
}
.manufacturing-inventory-table th,
.manufacturing-inventory-table td {
  padding: .7rem .65rem;
  vertical-align: middle;
}
.manufacturing-inventory-table small {
  color: var(--muted);
  font-weight: 800;
}
.manufacturing-checkbox {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  justify-self: start;
  min-height: 58px;
  padding: .8rem 1rem;
  border: 2px solid var(--primary);
  border-radius: .75rem;
  background: color-mix(in srgb, var(--primary) 9%, var(--card));
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
}
.manufacturing-checkbox:hover,
.manufacturing-checkbox:focus-within {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
}
.manufacturing-checkbox input {
  width: 1.75rem;
  height: 1.75rem;
  min-width: 1.75rem;
  margin: 0;
  padding: 0;
  accent-color: var(--primary);
}
.manufacturing-checkbox:has(input:checked) {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}
.manufacturing-part-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(5.6rem, 1fr));
  gap: .45rem;
  min-width: min(40rem, 100%);
}
.manufacturing-part-picker {
  position: relative;
  display: grid;
  gap: .5rem;
  min-width: min(22rem, 100%);
}
.manufacturing-part-summary {
  min-height: 48px;
  margin: 0;
  padding: .75rem .85rem;
  border: 2px solid var(--line);
  border-radius: .7rem;
  background: color-mix(in srgb, var(--primary) 7%, var(--input-bg));
  color: var(--text);
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.manufacturing-part-picker.is-empty .manufacturing-part-summary {
  background: var(--input-bg);
  color: var(--muted);
}
.manufacturing-part-selector {
  position: relative;
  border: 0;
}
.manufacturing-part-selector > summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .55rem .8rem;
  border: 2px solid var(--line);
  border-radius: .7rem;
  background: var(--card);
  color: var(--primary);
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}
.manufacturing-part-selector > summary::-webkit-details-marker {
  display: none;
}
.manufacturing-part-selector > summary::before {
  content: "▸";
  margin-right: .35rem;
  color: var(--muted);
}
.manufacturing-part-selector[open] > summary::before {
  content: "▾";
}
.manufacturing-part-selector[open] .manufacturing-part-grid {
  margin-top: .5rem;
}
@media (min-width: 1081px) {
  .manufacturing-part-selector[open] .manufacturing-part-grid {
    position: absolute;
    left: 0;
    top: calc(100% + .5rem);
    z-index: 60;
    grid-template-columns: repeat(4, minmax(7.5rem, 1fr));
    align-items: stretch;
    width: min(42rem, calc(100vw - 4rem));
    max-height: 24rem;
    margin-top: 0;
    padding: .75rem;
    overflow: auto;
    border: 2px solid var(--line);
    border-radius: .8rem;
    background: var(--card);
    box-shadow: 0 18px 38px color-mix(in srgb, #0f172a 20%, transparent);
  }
  .manufacturing-part-selector[open] > summary {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent);
  }
}
.manufacturing-process-quantity-panel {
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border: 2px solid var(--line);
  border-radius: .75rem;
  background: color-mix(in srgb, var(--primary) 6%, var(--card));
}
.manufacturing-process-quantity-panel h3,
.manufacturing-process-quantity-panel p {
  margin: 0;
}
.manufacturing-process-quantity-panel p {
  margin-top: .25rem;
  color: var(--muted);
  font-weight: 800;
}
.manufacturing-process-quantity-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .5rem;
}
.manufacturing-process-normal-output {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: .55rem .75rem;
  border-radius: .6rem;
  background: color-mix(in srgb, var(--success) 10%, var(--card));
  color: var(--text);
  font-weight: 900;
  white-space: nowrap;
}
.manufacturing-part-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 54px;
  padding: .7rem .75rem;
  border: 2px solid var(--line);
  border-radius: .7rem;
  background: var(--input-bg);
  color: var(--input-text);
  font-weight: 900;
  line-height: 1.15;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--line) 65%, transparent);
}
.manufacturing-part-option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: inherit;
}
.manufacturing-part-option span {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: .45rem;
  width: 100%;
  min-width: 0;
  overflow-wrap: break-word;
}
.manufacturing-part-option span::before {
  content: "";
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 1.3rem;
  height: 1.3rem;
  border: 2px solid currentColor;
  border-radius: .25rem;
  background: var(--card);
  font-size: .9rem;
  line-height: 1;
}
.manufacturing-part-option input:checked + span::before {
  content: "✓";
  background: #fff;
  border-color: #fff;
  color: #1e40af;
}
.manufacturing-part-option:has(input:checked) {
  border-color: #155eef;
  background: #155eef;
  color: #fff;
  box-shadow: 0 0 0 3px color-mix(in srgb, #155eef 20%, transparent);
}
.manufacturing-part-option:hover,
.manufacturing-part-option:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent);
}
.manufacturing-part-option.disabled {
  cursor: not-allowed;
  opacity: .72;
}
.manufacturing-material-table th:nth-child(1) { width: 28%; }
.manufacturing-material-table th:nth-child(2) { width: 14%; }
.manufacturing-material-table th:nth-child(3) { width: 34%; }
.manufacturing-material-table th:nth-child(4) { width: 24%; }
@media (max-width: 1080px) {
  .manufacturing-process-quantity-panel {
    grid-template-columns: 1fr;
  }
  .manufacturing-process-quantity-actions {
    justify-content: flex-start;
  }
  .manufacturing-material-head {
    grid-template-columns: 1fr;
  }
  .manufacturing-material-status {
    justify-self: start;
  }
  .manufacturing-material-allocation-header,
  .manufacturing-material-allocation-row {
    grid-template-columns: minmax(13rem, 1fr) minmax(9rem, 14rem) auto;
  }
}
@media (max-width: 760px) {
  .manufacturing-material-counts,
  .manufacturing-material-allocation-header,
  .manufacturing-material-allocation-row {
    grid-template-columns: 1fr;
  }
  .manufacturing-material-allocation-header {
    display: none;
  }
  .manufacturing-material-remove {
    width: 100%;
  }
}
.manufacturing-reopen-form {
  justify-self: start;
}
.manufacturing-events ol {
  margin: 0;
  padding-left: 1.25rem;
}
.manufacturing-events li {
  margin: .35rem 0;
}
.manufacturing-print-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}
.manufacturing-print {
  display: grid;
  gap: 1.25rem;
  justify-content: center;
}
.manufacturing-print-page {
  position: relative;
  box-sizing: border-box;
  width: 210mm;
  min-height: 297mm;
  padding: 16mm 20mm 18mm;
  background: #fff;
  color: #000;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .16);
  font-family: "Pretendard Variable", Pretendard, "Malgun Gothic", Arial, sans-serif;
  font-size: 9.5px;
  line-height: 1.18;
}
.print-doc-header {
  display: grid;
  grid-template-columns: 40mm minmax(0, 1fr) 56mm;
  min-height: 25mm;
  border: 1.4px solid #111;
  margin-bottom: 11mm;
}
.print-logo-cell,
.print-doc-title,
.print-meta-table th,
.print-meta-table td {
  border-right: 1px solid #333;
}
.print-logo-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}
.print-logo-image {
  display: block;
  width: 31mm;
  max-width: 34mm;
  height: auto;
  object-fit: contain;
}
.print-doc-title {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 950;
  letter-spacing: .36em;
}
.print-meta-table {
  width: 100%;
  height: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.print-meta-table th,
.print-meta-table td {
  border-right: 0;
  border-bottom: 1px solid #333;
  padding: 1.2mm 1.5mm;
  text-align: center;
}
.print-meta-table tr:last-child th,
.print-meta-table tr:last-child td {
  border-bottom: 0;
}
.manufacturing-print h2 {
  margin: 0 0 2.4mm;
  font-size: 12px;
  font-weight: 850;
}
.manufacturing-print h3 {
  margin: 3mm 0 1.5mm;
  font-size: 10.5px;
  font-weight: 850;
}
.print-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin: 0 0 5mm;
  border: 1.2px solid #111;
}
.print-table th,
.print-table td {
  border: 1px solid #555;
  padding: 1.15mm 1.5mm;
  color: #000;
  background: #fff;
  vertical-align: middle;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.print-table th {
  text-align: center;
  font-weight: 850;
}
.print-table td {
  text-align: center;
}
.print-table td:first-child,
.print-table .text-left {
  text-align: left;
}
.print-basic-table .print-basic-label { width: 26mm; }
.print-basic-table .print-basic-main { width: auto; }
.print-basic-table td {
  height: 7.2mm;
}
.print-basic-table .print-basic-memo-row td {
  height: 14mm;
  text-align: left;
  vertical-align: top;
}
.print-standard-cell {
  font-weight: 800;
  text-align: center !important;
}
.print-unit {
  margin-left: 12mm;
}
.print-signature-line {
  margin: 4mm 0 9mm;
  text-align: right;
  font-weight: 850;
  letter-spacing: .35em;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.print-table-caption {
  height: 10mm;
  text-align: left !important;
}
.print-precheck-table th:nth-child(1) { width: 58%; }
.print-precheck-table th:nth-child(2) { width: 17%; }
.print-precheck-table th:nth-child(3),
.print-precheck-table th:nth-child(4) { width: 12.5%; }
.print-material-table {
  font-size: 7.5px;
}
.print-material-table th:nth-child(1),
.print-material-table th:nth-child(4) { width: 22%; }
.print-material-table th:nth-child(2),
.print-material-table th:nth-child(5) { width: 20%; }
.print-material-table th:nth-child(3),
.print-material-table th:nth-child(6) { width: 8%; }
.print-material-table td {
  padding: .45mm .7mm;
}
.print-empty-note {
  display: inline-block;
  margin: 0 0 5mm;
  padding: 2mm 3mm;
  border: 1px solid #555;
  color: #000;
}
.print-note {
  margin: 1mm 0 3mm;
  color: #000;
}
.print-identification-table th:nth-child(1) { width: 13%; }
.print-identification-table th:nth-child(2) { width: 17%; }
.print-identification-table th:nth-child(3) { width: 17%; }
.print-identification-table th:nth-child(4) { width: 19%; }
.print-identification-table th:nth-child(5) { width: 12%; }
.print-identification-table th:nth-child(6) { width: 12%; }
.print-identification-table th:nth-child(7) { width: 10%; }
.print-process-pre-table th:nth-child(1) { width: 20%; }
.print-process-pre-table th:nth-child(3) { width: 24%; }
.print-process-table th:nth-child(1) { width: 12%; }
.print-process-table th:nth-child(2) { width: 32%; }
.print-process-table th:nth-child(3) { width: 16%; }
.print-process-table th:nth-child(4) { width: 14%; }
.print-process-table th:nth-child(5) { width: 12%; }
.print-process-table th:nth-child(6) { width: 14%; }
.print-inspection-head-table th {
  width: 17mm;
}
.print-assembly-table {
  font-size: 8.5px;
}
.print-assembly-table th:nth-child(1) { width: 12%; }
.print-assembly-table th:nth-child(2) { width: 17%; }
.print-assembly-table th:nth-child(3) { width: 18%; }
.print-assembly-table th:nth-child(4) { width: 31%; }
.print-assembly-table th:nth-child(5) { width: 14%; }
.print-assembly-table th:nth-child(6) { width: 8%; }
.print-equipment-table th:nth-child(1) { width: 10%; }
.print-equipment-table th:nth-child(2) { width: 28%; }
.print-equipment-table th:nth-child(3),
.print-equipment-table th:nth-child(4) { width: 18%; }
.print-equipment-table th:nth-child(5) { width: 16%; }
.print-packaging-check-table th:first-child {
  width: 10mm;
}
.print-packaging-check-table th,
.print-packaging-check-table td {
  height: 8.5mm;
}
.print-work-table th:nth-child(1) { width: 17%; }
.print-work-table th:nth-child(2) { width: 25%; }
.print-work-table th:nth-child(3) { width: 17%; }
.print-work-table th:nth-child(4),
.print-work-table th:nth-child(5) { width: 12%; }
.print-parameter-line {
  display: inline-block;
  min-width: 20mm;
  border-bottom: 1px solid #333;
  margin-left: 4mm;
  text-align: center;
}
.print-final-head-table th {
  width: 17mm;
}
.print-final-table {
  font-size: 8.5px;
}
.print-final-table th:nth-child(1) { width: 12%; }
.print-final-table th:nth-child(2) { width: 18%; }
.print-final-table th:nth-child(3) { width: 10%; }
.print-final-table th:nth-child(4) { width: 38%; }
.print-final-table th:nth-child(5) { width: 14%; }
.print-final-table th:nth-child(6) { width: 8%; }
.print-approval-text {
  margin: 6mm 0 4mm;
  font-size: 10px;
  line-height: 1.45;
}
.print-review-head-table th {
  width: 18mm;
}
.print-review-table th:nth-child(1) { width: 9%; }
.print-review-table th:nth-child(3),
.print-review-table th:nth-child(4) { width: 12%; }
.print-choice {
  display: inline-flex;
  align-items: center;
  gap: 1mm;
  white-space: nowrap;
}
.print-checkbox {
  position: relative;
  display: inline-block;
  width: 3.2mm;
  height: 3.2mm;
  border: 1px solid #555;
  background: #fff;
  flex: 0 0 auto;
}
.print-checkbox.is-checked {
  border-color: #111;
  background: #111;
}
.print-page-footer {
  position: absolute;
  left: 20mm;
  right: 20mm;
  bottom: 8mm;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9.5px;
}
.print-footer-logo {
  display: block;
  width: 16mm;
  height: auto;
  object-fit: contain;
}

/* Orders table */
.order-table { table-layout: fixed; }
.order-table th,
.order-table td { padding: .75rem .7rem; }
.order-table input,
.order-table select { width: 100%; min-width: 0; padding: .55rem .5rem; }
.order-table .order-supplier     { width: 18%; }
.order-table .order-line-summary { width: 11%; }
.order-table .order-date         { width: 15%; }
.order-table .order-total        { width: 15%; }
.order-table .order-status       { width: 10%; }
.order-table .order-actions      { width: 31%; }
.order-table .action-cell {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: flex-start;
  white-space: normal;
}
.order-table .action-cell form { margin: 0; }
.order-table .status-cell { white-space: nowrap; }
.order-table .action-cell button { padding: .55rem .75rem; min-height: var(--touch-target); }

.order-details td { background: var(--row-detail); }
.order-details .action-cell {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  white-space: normal;
}
.order-details .action-cell form { margin: 0; }
.order-details .action-cell button {
  max-width: 100%;
  white-space: normal;
}
.order-details td[data-label="작업"] {
  min-width: 10rem;
}

.order-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  align-items: start;
}
.order-detail-grid div { display: grid; gap: .35rem; }
.order-detail-grid strong { font-size: .9rem; color: var(--muted); }
.order-detail-grid > div > span {
  min-height: 2.5rem;
  border: 1px solid var(--line);
  border-radius: .7rem;
  padding: .65rem;
  background: var(--input-bg);
}

.order-audit ol { margin: 0; padding-left: 1.25rem; }
.order-audit li { margin: .35rem 0; }
.order-audit li span {
  display: block;
  min-height: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: .95rem;
}

.order-lines-control {
  display: grid;
  gap: .55rem;
  overflow-x: auto;
  padding-bottom: .15rem;
}
.order-lines-add { justify-self: start; }
.order-lines-edit {
  table-layout: fixed;
  min-width: 50rem;
}
.order-lines-edit th,
.order-lines-edit td {
  min-width: 0;
  vertical-align: middle;
}
.order-lines-edit input,
.order-lines-edit select { width: 100%; min-width: 0; padding: .55rem .5rem; }
.order-lines-edit .line-product { width: 26%; }
.order-lines-edit .line-qty     { width: 18%; }
.order-lines-edit .line-price   { width: 22%; }
.order-lines-edit .line-memo    { width: 25%; }
.order-lines-edit .line-remove  { width: 10%; }
.order-lines-edit th:last-child,
.order-lines-edit .line-action {
  width: 9rem;
  min-width: 9rem;
  white-space: nowrap;
  text-align: center;
}
.order-lines-edit .line-action button {
  width: 100%;
  min-width: 7rem;
  padding: .55rem .75rem;
}
.order-lines-edit [data-order-line-remove]:disabled,
.order-lines-edit [data-inbound-line-remove]:disabled,
.order-lines-edit [data-inbound-receipt-remove]:disabled { visibility: hidden; }
.order-line-price-cell {
  display: grid;
  gap: .35rem;
  text-align: left;
}
.order-line-price-cell label {
  gap: .25rem;
  font-size: .88rem;
}
.order-line-price-cell small {
  min-height: 1.2rem;
  color: var(--muted);
  line-height: 1.25;
}
.quantity-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .4rem;
  align-items: center;
}
.quantity-unit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.6rem;
  min-height: var(--control-compact);
  padding: 0 .65rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: var(--row-stripe);
  color: var(--text);
  font-weight: 850;
  white-space: nowrap;
}
.quantity-unit.is-empty { color: var(--muted); }

@media (max-width: 760px) {
  .manufacturing-detail-head,
  .manufacturing-step-title,
  .manufacturing-confirm-row,
  .manufacturing-print-toolbar {
    display: grid;
    align-items: stretch;
  }
  .manufacturing-table {
    display: block;
    overflow-x: auto;
  }
  .order-detail-grid { grid-template-columns: 1fr; }

  .order-table { display: block; min-width: 0; }
  .order-table colgroup,
  .order-table thead { display: none; }
  .order-table tbody { display: block; }
  .order-table tr.order-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .25rem .75rem;
    border: 1px solid var(--line);
    border-radius: .8rem;
    padding: .75rem .9rem;
    margin-bottom: .75rem;
    background: var(--card);
  }
  .order-table tr.order-main td {
    display: block;
    border: 0;
    padding: .15rem 0;
    text-align: left;
    white-space: normal;
  }
  .order-table tr.order-main td[data-label]::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-weight: 700;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    margin-bottom: .15rem;
  }
  .order-table tr.order-main td[data-label="상태"] { grid-column: 1; }
  .order-table tr.order-main td[data-label="작업"] { grid-column: 1 / -1; }
  .order-table tr.order-main td.num { text-align: left; }
  .order-table tr.order-details {
    display: block;
  }
  .order-table tr.order-details > td {
    display: block;
    padding: .5rem 0 1rem;
    border: 0;
  }
}

@media print {
  @page {
    size: A4;
    margin: 0;
  }
  nav,
  .global-call-region,
  .no-print,
  .manufacturing-head-actions,
  .button-link,
  .manufacturing-reopen-form,
  .manufacturing-events,
  .alert {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
  main {
    max-width: none;
    margin: 0;
    padding: 0;
  }
  .card {
    border: 0;
    box-shadow: none;
    padding: 0;
  }
  .manufacturing-print {
    display: block;
    gap: 0;
  }
  .manufacturing-print-page {
    width: 210mm;
    min-height: 297mm;
    margin: 0;
    box-shadow: none;
    break-after: page;
    page-break-after: always;
  }
  .manufacturing-print-page:last-child {
    break-after: auto;
    page-break-after: auto;
  }
  .manufacturing-print .print-table {
    break-inside: auto;
    page-break-inside: auto;
  }
}

/* Products table */
.product-table { table-layout: fixed; }
.product-table th,
.product-table td { padding: .75rem .7rem; }
.product-table th { white-space: nowrap; }
.product-table input,
.product-table select { width: 100%; min-width: 0; padding: .55rem .5rem; }
.product-table .product-name    { width: 30%; }
.product-table .product-permit-model { width: 20%; }
.product-table .product-stock   { width: 9%; }
.product-table .product-stock-state { width: 12%; }
.product-table .product-production-state { width: 14%; }
.product-table .product-status  { width: 7%; }
.product-table .product-actions { width: 8%; }
.product-main > td[data-label="LOT/작업"] {
  padding-right: 1rem;
  text-align: right;
  vertical-align: middle;
}
.product-table .action-cell {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: flex-start;
  white-space: normal;
}
.product-table .action-cell form { margin: 0; }
.product-table .status-cell { white-space: nowrap; }
.product-table .action-cell button { padding: .65rem .85rem; min-height: var(--touch-target); }
.product-main {
  cursor: pointer;
}
.product-main:hover td,
.product-main:focus-visible td {
  background: var(--row-detail);
}
.product-main:focus { outline: none; }
.product-main:focus-visible {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--primary) 45%, transparent);
}
.product-main[aria-expanded="true"] td {
  background: color-mix(in srgb, var(--primary-soft) 55%, var(--card));
}

.product-dialog-primary-actions {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: .5rem;
}
.product-material-status {
  display: grid;
  gap: .5rem;
}
.product-udi-candidate-panel {
  display: grid;
  gap: .5rem;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: .5rem;
  background: var(--row-stripe);
}
.product-udi-candidate-panel .inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 0;
}
.product-udi-candidate-panel select {
  flex: 1 1 18rem;
  min-width: 0;
}
.product-status-list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: .25rem;
}
.product-details td { background: var(--row-detail); }
.editor-detail-grid,
.product-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  align-items: start;
}
.editor-detail-grid > label {
  align-content: start;
  min-height: 7.25rem;
}
.editor-detail-grid > label > input,
.editor-detail-grid > label > select,
.editor-detail-grid .component-combobox-button {
  min-height: var(--control-large);
}
.editor-detail-grid > label > small {
  min-height: 2.6rem;
}
.product-permit-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: .55rem;
  align-items: start;
}
.product-permit-panel > strong { color: var(--muted); font-size: .95rem; }
.product-requirement-editor {
  border-top: 1px solid var(--line);
  padding-top: .9rem;
  overflow-x: auto;
}
.product-requirement-table { min-width: 38rem; }
.product-requirement-table th:first-child,
.product-requirement-table td:first-child {
  width: 58%;
}
.product-requirement-table th:nth-child(2),
.product-requirement-table td:nth-child(2) {
  width: 24%;
}
.product-requirement-table td {
  vertical-align: top;
}
.product-requirement-table input[type="number"] {
  min-width: 8rem;
}
.product-requirement-table th:last-child,
.product-requirement-table .line-action {
  width: 9rem;
  min-width: 9rem;
  text-align: center;
  white-space: nowrap;
}
.product-requirement-table .line-action button {
  width: 100%;
  min-width: 7rem;
}
.product-requirement-actions {
  display: flex;
  justify-content: flex-start;
}
.warning-text { color: var(--danger); display: block; margin-top: .25rem; }
.entity-label,
.inventory-state {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 1.75rem;
  margin: 0 .35rem .2rem 0;
  padding: .22rem .55rem;
  border: 1px solid var(--line);
  border-radius: .55rem;
  font-size: .86rem;
  font-weight: 850;
  line-height: 1.2;
  white-space: nowrap;
}
a.inventory-state {
  text-decoration: none;
}
.entity-label-material {
  background: #ecfdf3;
  color: var(--material-label);
  border-color: #abefc6;
}
.entity-label-product {
  background: var(--primary-soft);
  color: var(--product-label);
  border-color: #93c5fd;
}
.inventory-state-ok {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: #abefc6;
}
.inventory-state-low,
.inventory-state-late {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: #fde68a;
}
.inventory-state-inbound {
  background: #dbeafe;
  color: #1e40af;
  border-color: #93c5fd;
}
.inventory-state-production {
  background: #fef3c7;
  color: #92400e;
  border-color: #fbbf24;
}
.inventory-state-empty {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: #fecdca;
}
.compact-action {
  min-height: 40px;
  margin-top: .25rem;
  padding: .45rem .7rem;
}
.stock-low {
  color: var(--stock-low);
  background: var(--warning-soft);
  box-shadow: inset 4px 0 0 var(--stock-low);
  font-weight: 850;
}
.stock-low small {
  display: block;
  color: var(--stock-low);
  font-weight: 800;
}
.safety-stock-toggle {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: var(--control-large);
  padding: .55rem .75rem;
  border: 1px solid var(--line);
  border-radius: .7rem;
  background: var(--row-stripe);
}
.editor-safety-stock-group,
.product-safety-stock-group {
  display: grid;
  grid-template-columns: minmax(16rem, 24rem) minmax(0, 1fr);
  gap: .75rem;
  align-items: stretch;
  margin: 0;
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: .85rem;
}
.editor-safety-stock-group legend,
.product-safety-stock-group legend {
  padding: 0 .35rem;
  color: var(--text);
  font-weight: 850;
}
.editor-safety-stock-group label,
.product-safety-stock-group label {
  margin: 0;
  min-height: 0;
}
.editor-safety-stock-group .safety-stock-toggle,
.product-safety-stock-group .safety-stock-toggle,
.editor-safety-stock-group [data-safety-stock-field],
.product-safety-stock-group [data-safety-stock-field] {
  min-height: 7.25rem;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: .7rem;
  background: var(--row-stripe);
}
.editor-safety-stock-group .safety-stock-toggle,
.product-safety-stock-group .safety-stock-toggle {
  width: 100%;
  height: 100%;
}
.editor-safety-stock-group [data-safety-stock-field],
.product-safety-stock-group [data-safety-stock-field] {
  display: grid;
  align-content: start;
  gap: .35rem;
}
.editor-safety-stock-group [data-safety-stock-field][hidden],
.product-safety-stock-group [data-safety-stock-field][hidden] {
  display: none;
}
.editor-safety-stock-group [data-safety-stock-field] input,
.product-safety-stock-group [data-safety-stock-field] input {
  min-height: var(--control-large);
}
.safety-stock-toggle input {
  flex: 0 0 var(--choice-mark-size);
}
.component-check-grid {
  display: grid;
  gap: .5rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}
.component-check-grid label {
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: .35rem;
  grid-template-columns: auto 1fr 5rem;
  padding: .65rem;
}
.component-check-grid small { grid-column: 2 / 4; }
.material-suggestion-panel table { margin-top: .5rem; }


@media (max-width: 1100px) {
  .product-create-header {
    align-items: stretch;
    flex-direction: column;
  }
  .product-dialog-primary-actions {
    width: auto;
  }
  .product-detail-grid,
  .editor-detail-grid { grid-template-columns: 1fr; }
  .product-safety-stock-group,
  .editor-safety-stock-group { grid-template-columns: 1fr; }

  .product-table { display: block; min-width: 0; }
  .product-table colgroup,
  .product-table thead { display: none; }
  .product-table tbody { display: block; }
  .product-table tr.product-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .25rem .75rem;
    border: 1px solid var(--line);
    border-radius: .8rem;
    padding: .75rem .9rem;
    margin-bottom: .75rem;
    background: var(--card);
  }
  .product-table tr.product-main td {
    display: block;
    border: 0;
    padding: .15rem 0;
    white-space: normal;
  }
  .product-table tr.product-main td[data-label]::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-weight: 700;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    margin-bottom: .15rem;
  }
  .product-table tr.product-main td[data-label="LOT/작업"] { grid-column: 1 / -1; }
  .product-table tr.product-main td.num { text-align: left; }
  .product-table tr.product-details { display: block; }
  .product-table tr.product-details > td {
    display: block;
    padding: .5rem 0 1rem;
    border: 0;
  }
}

/* Raw materials */
.card-heading,
.section-heading,
.dialog-header,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.dialog-header {
  justify-content: flex-start;
}
.dialog-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}
.card-heading h1,
.section-heading h3,
.dialog-header h2 {
  margin: 0;
}
.raw-material-table {
  table-layout: fixed;
}
.raw-material-table th { white-space: nowrap; }
.raw-material-filter-form,
.product-filter-form,
.product-history-filter-form,
.production-history-filter-form,
.order-filter-form,
.inbound-request-filter-form {
  margin: .4rem 0 1rem;
  grid-template-columns: minmax(18rem, 1fr) auto auto;
  align-items: end;
}
.product-history-filter-form,
.production-history-filter-form,
.order-filter-form,
.inbound-request-filter-form {
  grid-template-columns: minmax(18rem, 1fr) auto;
}
.raw-material-filter-form input:not([type="checkbox"]):not([type="radio"]),
.raw-material-filter-form .filter-checkbox,
.raw-material-filter-form .toolbar button,
.raw-material-filter-form .toolbar a,
.product-filter-form input:not([type="checkbox"]):not([type="radio"]),
.product-filter-form .filter-checkbox,
.product-filter-form .toolbar button,
.product-filter-form .toolbar a,
.product-history-filter-form input:not([type="checkbox"]):not([type="radio"]),
.product-history-filter-form .toolbar button,
.product-history-filter-form .toolbar a,
.production-history-filter-form input:not([type="checkbox"]):not([type="radio"]),
.production-history-filter-form .toolbar button,
.production-history-filter-form .toolbar a,
.order-filter-form input:not([type="checkbox"]):not([type="radio"]),
.order-filter-form .toolbar button,
.order-filter-form .toolbar a,
.inbound-request-filter-form input:not([type="checkbox"]):not([type="radio"]),
.inbound-request-filter-form .toolbar button,
.inbound-request-filter-form .toolbar a {
  min-height: var(--control-large);
}
.raw-material-filter-form .wide,
.product-filter-form .wide,
.product-history-filter-form .wide,
.production-history-filter-form .wide,
.order-filter-form .wide,
.inbound-request-filter-form .wide {
  grid-column: auto;
}
.raw-material-status-filter,
.product-status-filter {
  align-self: end;
}
.filter-checkbox {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: var(--control-large);
  padding: .55rem .75rem;
  border: 1px solid var(--line);
  border-radius: .7rem;
  background: var(--row-stripe);
  white-space: nowrap;
}
.filter-checkbox input {
  flex: 0 0 var(--choice-mark-size);
  width: var(--choice-mark-size);
  height: var(--choice-mark-size);
  min-width: var(--choice-mark-size);
  min-height: var(--choice-mark-size);
}
.pager {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  align-items: center;
  justify-content: center;
  padding-top: .85rem;
  color: var(--muted);
}
.pager a,
.pager span {
  display: inline-flex;
  align-items: center;
  min-height: 2.35rem;
  padding: .45rem .75rem;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: var(--row-stripe);
  text-decoration: none;
}
.pager span {
  opacity: .55;
}
.pager strong {
  color: var(--text);
}
@media (max-width: 760px) {
  .raw-material-filter-form,
  .product-filter-form,
  .product-history-filter-form,
  .production-history-filter-form,
  .order-filter-form,
  .inbound-request-filter-form {
    grid-template-columns: 1fr;
  }
  .raw-material-filter-form .toolbar,
  .product-filter-form .toolbar,
  .product-history-filter-form .toolbar,
  .production-history-filter-form .toolbar,
  .order-filter-form .toolbar,
  .inbound-request-filter-form .toolbar {
    justify-content: stretch;
  }
  .raw-material-filter-form .toolbar button,
  .raw-material-filter-form .toolbar a,
  .product-filter-form .toolbar button,
  .product-filter-form .toolbar a,
  .product-history-filter-form .toolbar button,
  .product-history-filter-form .toolbar a,
  .production-history-filter-form .toolbar button,
  .production-history-filter-form .toolbar a,
  .order-filter-form .toolbar button,
  .order-filter-form .toolbar a,
  .inbound-request-filter-form .toolbar button,
  .inbound-request-filter-form .toolbar a {
    flex: 1 1 auto;
    justify-content: center;
  }
  .filter-checkbox {
    width: 100%;
  }
}
.raw-material-table .raw-material-name { width: 26%; }
.raw-material-table .raw-material-sku { width: 15%; }
.raw-material-table .raw-material-stock { width: 10%; }
.raw-material-table .raw-material-stock-state { width: 15%; }
.raw-material-table .raw-material-inbound-state { width: 18%; }
.raw-material-table .raw-material-status { width: 7%; }
.raw-material-table .raw-material-actions { width: 9%; }
.raw-material-main > td[data-label="LOT/작업"] {
  padding-right: 1rem;
  text-align: right;
  vertical-align: middle;
}
.sku-text {
  font-weight: 800;
  white-space: nowrap;
}
.raw-material-main {
  cursor: pointer;
}
.raw-material-main:hover td,
.raw-material-main:focus-visible td {
  background: var(--row-detail);
}
.raw-material-main:focus { outline: none; }
.raw-material-main:focus-visible {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--primary) 45%, transparent);
}
.raw-material-main[aria-expanded="true"] td {
  background: color-mix(in srgb, var(--primary-soft) 55%, var(--card));
}
.raw-material-toggle-button[aria-expanded="true"] {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-strong);
}
.raw-material-toggle-button {
  min-width: 6rem;
  min-height: 44px;
  padding: .45rem .8rem;
  border-color: color-mix(in srgb, var(--line) 82%, var(--text));
  border-radius: .65rem;
  background: color-mix(in srgb, var(--card) 88%, var(--row-stripe));
  color: var(--text);
  white-space: nowrap;
}
.raw-material-details td {
  background: var(--row-detail);
}
.raw-material-detail-grid {
  display: grid;
  gap: 1rem;
  align-items: start;
}
.raw-material-detail-grid section {
  min-width: 0;
}
.composition-editor {
  display: grid;
  gap: .75rem;
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: var(--row-stripe);
}
.composition-editor .section-heading {
  align-items: flex-start;
}
.composition-editor .section-heading .hint {
  margin: .25rem 0 0;
}
.composition-list {
  display: grid;
  gap: .55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.composition-row {
  display: grid;
  grid-template-columns: 4.5rem minmax(13rem, 1.4fr) minmax(6rem, .45fr) minmax(11rem, 1fr) auto;
  gap: .55rem;
  align-items: end;
  padding: .65rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: var(--card);
}
.composition-sequence-field,
.composition-step-field {
  display: grid;
  gap: .3rem;
  min-width: 0;
}
.composition-field-label {
  color: var(--text);
  font-weight: 800;
}
.composition-sequence {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-compact);
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: var(--row-detail);
  color: var(--primary-strong);
}
.composition-step-field input {
  min-height: var(--control-compact);
}
.composition-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .35rem;
}
.composition-actions button {
  min-height: var(--control-compact);
  padding: .5rem .65rem;
}
.composition-actions button:disabled {
  cursor: not-allowed;
  opacity: .5;
}
.composition-empty-state {
  margin: 0;
  padding: .85rem;
  border: 1px dashed var(--line);
  border-radius: .55rem;
  background: var(--card);
}
.composition-readonly-table td:first-child {
  font-weight: 850;
}
.raw-material-dialog {
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 0;
  max-width: min(820px, calc(100vw - 2rem));
  width: 100%;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 24px 60px #00000040;
}
.raw-material-editor-dialog {
  max-width: min(1100px, calc(100vw - 2rem));
  max-height: min(900px, calc(100vh - 2rem));
}
.raw-material-dialog::backdrop {
  background: #0007;
  backdrop-filter: blur(2px);
}
.raw-material-dialog-form {
  margin: 0;
  padding: 1.2rem 1.3rem 1rem;
  display: grid;
  gap: 1rem;
}
.product-editor-dialog {
  overflow: auto;
}
.product-editor-dialog .raw-material-dialog-form {
  max-height: none;
  overflow: visible;
  padding-bottom: 1rem;
}
.raw-material-editor-dialog .raw-material-dialog-form {
  min-height: auto;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding: 1.25rem;
  align-content: start;
}
.dialog-header button,
.dialog-actions button {
  min-height: var(--touch-target);
}
.component-editor,
.advanced-editor {
  display: grid;
  gap: .6rem;
}
.advanced-editor > summary {
  display: flex;
  gap: .75rem;
  align-items: center;
  justify-content: space-between;
  min-height: var(--touch-target);
  cursor: pointer;
  list-style: none;
}
.advanced-editor > summary::-webkit-details-marker { display: none; }
.advanced-editor > summary h3 { margin: 0; }
.advanced-editor > summary::after {
  content: "열기";
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-target);
  padding: .45rem .75rem;
  border: 1px solid var(--line);
  border-radius: .7rem;
  color: var(--primary-strong);
  font-weight: 900;
}
.advanced-editor[open] > summary::after { content: "접기"; }
.advanced-editor[open] > .section-heading { margin-top: .8rem; }
.raw-material-editor-dialog .component-editor {
  min-height: 0;
  overflow: visible;
}
.component-editor input,
.component-editor select {
  width: 100%;
  min-width: 0;
}
.component-match-groups {
  display: grid;
  gap: .75rem;
  min-width: min(100%, 46rem);
}
.component-empty-state {
  margin: 0;
  padding: .85rem;
  border: 1px dashed var(--line);
  border-radius: .5rem;
  background: var(--row-stripe);
}
.component-group-card {
  display: grid;
  gap: .75rem;
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: .5rem;
  background: var(--row-stripe);
}
.component-group-card-header {
  display: flex;
  gap: .75rem;
  align-items: start;
  justify-content: space-between;
}
.component-group-card-header h4 {
  margin: 0;
  font-size: 1rem;
}
.component-group-card-header .hint {
  margin: .25rem 0 0;
}
.component-group-card-header button {
  flex: 0 0 auto;
  min-height: var(--control-compact);
}
.component-group-name-field,
.component-candidate-field,
.component-quantity-field {
  display: grid;
  gap: .3rem;
  margin: 0;
  min-width: 0;
  font-weight: 800;
}
.component-group-name-field {
  max-width: 24rem;
}
.component-group-name-field input,
.component-quantity-field input {
  min-height: var(--control-compact);
}
.component-candidate-list {
  display: grid;
  gap: .55rem;
}
.component-candidate-row {
  display: grid;
  grid-template-columns: 3.5rem minmax(14rem, 1fr) minmax(6rem, 8rem) minmax(6rem, 7rem);
  gap: .55rem;
  align-items: end;
  padding: .6rem;
  border: 1px solid var(--line);
  border-radius: .5rem;
  background: var(--card);
}
.component-alternative-marker {
  align-self: center;
  display: inline-flex;
  justify-content: center;
  min-height: var(--control-compact);
  padding: .55rem .45rem;
  border: 1px solid var(--line);
  border-radius: .5rem;
  color: var(--primary-strong);
  background: var(--row-detail);
  font-weight: 900;
}
.component-alternative-marker.is-hidden {
  visibility: hidden;
}
.component-candidate-field .field-label {
  color: var(--text);
  font-weight: 800;
}
.component-remove-button {
  min-height: var(--control-compact);
  white-space: nowrap;
}
.component-alternative-add {
  justify-self: start;
}
.component-combobox {
  position: relative;
  min-width: 0;
}
.component-native-select {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.component-combobox-button {
  width: 100%;
  min-height: var(--touch-target);
  justify-content: space-between;
  text-align: left;
}
.component-combobox-button::after {
  content: "v";
  flex: 0 0 auto;
  color: var(--muted);
  font-size: .9rem;
}
.component-combobox-panel {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + .25rem);
  display: grid;
  gap: .35rem;
  padding: .45rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: var(--card);
  box-shadow: 0 16px 34px #0000002e;
}
.component-combobox-panel[hidden] {
  display: none;
}
.component-combobox-search {
  min-height: var(--touch-target);
}
.component-combobox-options {
  max-height: 16rem;
  overflow: auto;
  display: grid;
  gap: .15rem;
}
.component-combobox-option {
  display: block;
  width: 100%;
  min-height: var(--control-compact);
  padding: .45rem .55rem;
  border: 0;
  border-radius: .45rem;
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
}
.component-combobox-option:hover,
.component-combobox-option:focus,
.component-combobox-option[aria-selected="true"] {
  background: var(--row-detail);
}
.component-combobox-empty {
  padding: .55rem;
  color: var(--muted);
}
.manufacturing-employee-combobox {
  min-width: 10rem;
}
.manufacturing-employee-combobox .component-combobox-panel {
  min-width: min(18rem, calc(100vw - 2rem));
}

@media (max-width: 760px) {
  .component-group-card-header {
    flex-direction: column;
  }
  .component-group-card-header button,
  .component-alternative-add,
  .component-remove-button {
    width: 100%;
    justify-content: center;
  }
  .component-group-name-field {
    max-width: none;
  }
  .component-candidate-row {
    grid-template-columns: 1fr;
  }
  .component-alternative-marker,
  .component-alternative-marker.is-hidden {
    justify-self: start;
    visibility: visible;
  }
  .composition-editor .section-heading {
    flex-direction: column;
    align-items: stretch;
  }
  .composition-editor .section-heading > button {
    width: 100%;
  }
  .composition-row {
    grid-template-columns: 1fr;
  }
  .composition-actions button {
    width: 100%;
  }
}

@media (max-width: 820px) {
  .raw-material-table tr.raw-material-details {
    display: block;
  }
  .raw-material-table tr.raw-material-details > td {
    display: block;
  }
}

/* Permit search */
.permit-table { table-layout: fixed; }
.permit-table caption {
  text-align: left;
  font-weight: 800;
  margin: 1.1rem 0 .45rem;
}
.permit-table th,
.permit-table td { padding: .7rem .6rem; overflow-wrap: break-word; }
.permit-table th:nth-child(1) { width: 34%; }
.permit-table th:nth-child(2) { width: 13%; }
.permit-table th:nth-child(3) { width: 16%; }
.permit-table th:nth-child(4),
.permit-table th:nth-child(5) { width: 14%; }
.permit-table th:nth-child(6) { width: 9%; }
.permit-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
}
.permit-summary-grid div {
  display: grid;
  gap: .35rem;
}
.permit-summary-grid strong {
  color: var(--muted);
  font-size: .9rem;
}
.permit-summary-grid span {
  min-height: 2.4rem;
  border: 1px solid var(--line);
  border-radius: .7rem;
  padding: .6rem;
  background: var(--input-bg);
  overflow-wrap: break-word;
}
.permit-family-list {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.permit-family-list a,
.permit-image-links a {
  display: inline-flex;
  padding: .25rem .5rem;
  border: 1px solid var(--line);
  border-radius: .55rem;
  text-decoration: none;
  background: var(--row-stripe);
}
.permit-evidence-list {
  display: grid;
  gap: .65rem;
}
.permit-primary-evidence {
  display: grid;
  gap: 1rem;
  margin-bottom: .8rem;
}
.permit-evidence-panel {
  display: grid;
  gap: .75rem;
  padding: .85rem 0;
  border-top: 1px solid var(--line);
}
.permit-evidence-panel:first-child {
  border-top: 0;
  padding-top: 0;
}
.permit-evidence-head {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: baseline;
  flex-wrap: wrap;
}
.permit-evidence-head strong {
  font-size: 1.05rem;
}
.permit-evidence-head span {
  color: var(--muted);
}
.permit-image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(24rem, 100%), 1fr));
  gap: .75rem;
}
.permit-image-preview {
  display: grid;
  gap: .45rem;
  text-decoration: none;
  color: inherit;
}
.permit-image-preview img {
  width: 100%;
  max-height: 34rem;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: .7rem;
  background: var(--input-bg);
}
.permit-image-preview span {
  color: var(--muted);
  font-size: .86rem;
  overflow-wrap: break-word;
}
.permit-evidence-panel pre,
.permit-evidence-list details {
  border: 1px solid var(--line);
  border-radius: .75rem;
  padding: .7rem;
  background: var(--row-stripe);
}
.permit-evidence-list summary {
  cursor: pointer;
  font-weight: 800;
}
.permit-evidence-list pre,
.permit-evidence-panel pre {
  max-height: 24rem;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  margin: .7rem 0 0;
  padding: .7rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: var(--input-bg);
  font: .92rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.permit-image-links {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
}
.toolbar a {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-target);
  padding: .45rem .7rem;
  border: 1px solid var(--line);
  border-radius: .45rem;
  background: var(--row-stripe);
  text-decoration: none;
}
.inline-form {
  display: inline-flex;
  margin: .5rem .5rem .5rem 0;
}

@media (max-width: 760px) {
  .permit-summary-grid { grid-template-columns: 1fr; }
  .permit-table { display: block; overflow-x: auto; }
}

/* Suppliers table */
.supplier-table {
  table-layout: fixed;
  width: 100%;
}
.supplier-table th,
.supplier-table td { padding: .75rem .7rem; }
.supplier-table input { width: 100%; min-width: 0; padding: .55rem .5rem; }
.supplier-table .supplier-name     { width: 31%; }
.supplier-table .supplier-email    { width: 27%; }
.supplier-table .supplier-phone    { width: 16%; }
.supplier-table .supplier-actions  { width: 26%; }
.supplier-read-value {
  display: block;
  min-width: 0;
  min-height: var(--control-compact);
  padding: .62rem 0;
  overflow-wrap: anywhere;
}
.supplier-read-muted { color: var(--text); }
.supplier-main.is-editing .supplier-read-value { display: none; }
.supplier-table .action-cell {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  white-space: nowrap;
}
.supplier-table .action-cell form {
  display: inline-flex;
  gap: .35rem;
  margin: 0;
  max-width: 100%;
}
.supplier-table .action-cell button { padding: .65rem .85rem; min-height: var(--control-compact); }

.production-now-board {
  display: grid;
  gap: 1rem;
  border: 2px solid var(--primary);
  background: color-mix(in srgb, var(--primary-soft) 75%, var(--card));
}
#production-order-active {
  scroll-margin-top: 5rem;
}
.production-order-management-list {
  display: grid;
  gap: .6rem;
}
.production-order-management-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: center;
  padding: .8rem;
  border: 1px solid var(--line);
  border-radius: .7rem;
  background: var(--card);
}
.production-order-management-main {
  display: grid;
  grid-template-columns: auto minmax(8rem, 1fr) auto;
  gap: .45rem .65rem;
  align-items: center;
  min-width: 0;
}
.production-order-management-main strong,
.production-order-management-main small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.production-order-management-main small {
  grid-column: 2 / -1;
  color: var(--muted);
}
.production-order-management-step {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
  justify-content: flex-end;
}
.production-order-management-step > span {
  color: var(--muted);
  font-weight: 850;
}
.production-order-managed-item {
  display: grid;
  gap: .65rem;
  min-width: 0;
}
.production-order-hero {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}
.production-order-hero-main {
  display: grid;
  gap: .35rem;
}
.production-order-hero-actions,
.production-order-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  justify-content: flex-end;
}
.production-order-form-actions .primary,
.production-order-hero-actions .primary,
.production-work-card .action-cell .primary,
.manufacturing-card .primary {
  min-height: 3.5rem;
}
.production-order-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(22rem, .8fr);
  gap: 1rem;
  align-items: start;
}
.production-order-create,
.production-order-current,
.production-order-materials,
.production-order-list-section {
  min-width: 0;
}
.production-order-form {
  margin-top: .85rem;
}
.production-order-summary-card {
  display: grid;
  gap: .85rem;
  padding: .95rem;
  border: 1px solid var(--line);
  border-radius: .7rem;
  background: var(--row-stripe);
}
.production-order-label {
  display: block;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 850;
}
.production-order-summary-card strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1.18rem;
}
.production-order-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .55rem;
  margin: 0;
}
.production-order-metrics div {
  display: grid;
  gap: .15rem;
  padding: .65rem;
  border: 1px solid var(--line);
  border-radius: .6rem;
  background: var(--card);
}
.production-order-metrics dt {
  color: var(--muted);
  font-size: .86rem;
  font-weight: 850;
}
.production-order-metrics dd {
  margin: 0;
  font-weight: 950;
  font-size: 1.35rem;
  line-height: 1.15;
}
.production-order-metrics small {
  margin-left: .15rem;
  font-size: .82rem;
}
.production-order-stepper {
  display: grid;
  grid-template-columns: 1fr;
  gap: .45rem;
  margin: .95rem 0;
}
.production-order-step {
  justify-content: flex-start;
  border-color: var(--line);
  background: var(--card);
  color: var(--text);
}
.production-order-step.is-active {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}
.production-order-step.is-done {
  border-color: #abefc6;
  background: #dcfae6;
  color: var(--ok);
}
.production-order-step-log {
  display: grid;
  gap: .45rem;
  margin-top: .9rem;
}
.production-order-step-log p {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  margin: 0;
  padding: .55rem .65rem;
  border: 1px solid var(--line);
  border-radius: .6rem;
  background: var(--row-stripe);
}
.production-order-step-log span {
  color: var(--muted);
  font-weight: 850;
}
.production-order-note-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
  margin-top: .9rem;
}
.production-order-note-card {
  display: grid;
  gap: .5rem;
  min-width: 0;
}
.production-order-save-line {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
  justify-content: space-between;
}
.production-order-stage-save-panel {
  display: grid;
  gap: .55rem;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: .7rem;
  background: var(--card);
}
.production-order-stage-save-heading {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
  justify-content: space-between;
}
.production-order-stage-save-heading > div > span,
.production-order-save-state {
  color: var(--muted);
  font-weight: 850;
}
.production-order-stage-save-grid {
  display: grid;
  grid-template-columns: minmax(8.5rem, auto) minmax(7rem, 1fr);
  gap: .45rem;
  align-items: center;
}
.production-order-stage-save-grid button,
.production-order-save-line button {
  min-height: var(--control-compact);
  padding: .55rem .7rem;
}
.production-order-stage-save-grid button.is-saved,
.production-order-save-line button.is-saved {
  border-color: #abefc6;
  background: #dcfae6;
  color: var(--ok);
}
.production-order-status-field {
  display: grid;
  gap: .4rem;
  font-weight: 750;
}
.production-order-status-label {
  display: block;
}
.production-order-start-panel {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  justify-content: space-between;
  padding: .85rem;
  border: 1px solid #fde68a;
  border-radius: .7rem;
  background: #fffbeb;
}
.production-order-start-panel > div {
  display: grid;
  gap: .15rem;
}
.production-order-start-panel span {
  color: var(--muted);
  font-weight: 800;
}
.production-order-stage-save-heading span.is-saved,
.production-order-save-state.is-saved {
  color: var(--ok);
}
.production-order-material-list {
  display: grid;
  gap: .7rem;
}
.production-order-material-row {
  display: grid;
  grid-template-columns: minmax(13rem, 1fr) minmax(7rem, auto) minmax(19rem, 1.3fr) auto;
  gap: .75rem;
  align-items: start;
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: .7rem;
  background: var(--row-stripe);
}
.production-order-material-name {
  min-width: 0;
}
.production-order-material-name strong,
.production-order-material-name small {
  display: block;
}
.production-order-material-required {
  padding-top: .2rem;
  white-space: nowrap;
  font-weight: 850;
}
.production-order-material-allocation-group {
  display: grid;
  gap: .65rem;
  min-width: 0;
  margin: 0;
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: .7rem;
  background: var(--row-stripe);
}
.production-order-material-allocation-group legend {
  padding: 0 .35rem;
  font-weight: 900;
}
.production-order-material-allocation-group > button {
  justify-self: start;
}
.production-order-lot-stack {
  display: grid;
  gap: .55rem;
  min-width: 0;
}
.production-order-lot-row {
  display: grid;
  grid-template-columns: minmax(9rem, 1fr) minmax(7rem, .55fr);
  gap: .5rem;
  align-items: end;
}
.production-order-material-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-target);
  padding: .45rem .7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-weight: 900;
  white-space: nowrap;
}
.production-order-material-status.is-complete {
  background: #dcfae6;
  color: var(--ok);
  border-color: #abefc6;
}
.production-order-material-status.is-short {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}
.production-order-material-status.is-over {
  background: #fee4e2;
  color: var(--danger);
  border-color: #fecdca;
}
.production-order-empty-materials {
  margin: 0;
  padding: .85rem;
  border: 1px dashed var(--line);
  border-radius: .7rem;
  color: var(--muted);
}
.production-order-table .button-link,
.production-order-table button {
  min-height: var(--control-compact);
  padding: .55rem .75rem;
}
.production-order-table .primary {
  min-height: 3.5rem;
}
.production-order-create-panel summary {
  cursor: pointer;
}
.production-order-create-panel summary span {
  display: grid;
  gap: .2rem;
}
.production-waiting-order-panel {
  display: grid;
  gap: .9rem;
}
.production-waiting-list {
  display: grid;
  gap: .5rem;
}
.production-waiting-item {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: .65rem;
  padding: .7rem .8rem;
  border: 1px solid var(--line);
  border-radius: .6rem;
  background: var(--row-stripe);
}
.production-waiting-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-weight: 950;
}
.production-waiting-main {
  display: grid;
  gap: .12rem;
  min-width: 0;
}
.production-waiting-main strong,
.production-waiting-main span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.production-waiting-main span,
.production-waiting-qty {
  color: var(--muted);
  font-weight: 800;
}
.production-order-main-row.is-open td {
  background: color-mix(in srgb, var(--primary-soft) 45%, var(--card));
}
.production-order-detail-row > td {
  padding: 1rem;
}
.production-order-selected-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .8rem;
  align-items: center;
  margin-bottom: .9rem;
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: .6rem;
  background: var(--card);
}
.production-order-selected-summary strong,
.production-order-selected-summary small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.production-order-selected-summary small {
  color: var(--muted);
  font-weight: 800;
}
.production-order-selected-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  justify-content: flex-end;
}
.production-order-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .65rem;
  margin-bottom: 1rem;
}
.production-order-detail-grid > div {
  display: grid;
  gap: .2rem;
  padding: .65rem;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: var(--card);
}
.production-order-detail-grid .wide {
  grid-column: 1 / -1;
}
.production-order-detail-grid strong {
  color: var(--muted);
  font-size: .86rem;
}
.production-order-detail-grid span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 850;
}
.production-order-detail-block {
  display: grid;
  gap: .55rem;
  margin-top: .9rem;
}
.production-order-detail-block h3 {
  margin: 0;
}
.production-order-lot-chip {
  display: inline-flex;
  margin: .15rem .2rem .15rem 0;
  padding: .25rem .45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-weight: 850;
}
.production-order-stage-list {
  display: grid;
  gap: .45rem;
  padding: 0;
  margin: 0;
  list-style: none;
}
.production-order-stage-list li {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  padding: .65rem .75rem;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: var(--card);
}
.production-order-stage-list li.is-saved {
  border-color: #abefc6;
  background: #ecfdf3;
}
.production-order-stage-list li.is-current {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.production-order-stage-list span {
  color: var(--muted);
  font-weight: 850;
  text-align: right;
}
.manufacturing-board,
.manufacturing-current-action {
  border: 2px solid var(--primary);
  background: color-mix(in srgb, var(--primary-soft) 75%, var(--card));
}
.production-now-group {
  display: grid;
  gap: .65rem;
}

@media (max-width: 1180px) {
  .production-order-workspace {
    grid-template-columns: 1fr;
  }
  .production-order-material-row {
    grid-template-columns: minmax(0, 1fr) minmax(7rem, auto);
  }
  .production-order-lot-stack,
  .production-order-material-status {
    grid-column: 1 / -1;
  }
  .manufacturing-board .manufacturing-card-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .production-order-hero {
    grid-template-columns: 1fr;
  }
  .production-order-hero-actions,
  .production-order-form-actions {
    justify-content: flex-start;
  }
  .production-order-management-row {
    grid-template-columns: 1fr;
  }
  .production-order-management-main {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .production-order-management-main small {
    grid-column: 1 / -1;
  }
  .production-order-management-step {
    justify-content: flex-start;
  }
  .production-waiting-item {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .production-waiting-qty,
  .production-waiting-item > .button-link {
    grid-column: 2;
    justify-self: start;
  }
  .production-order-selected-summary {
    grid-template-columns: 1fr;
  }
  .production-order-selected-actions {
    justify-content: flex-start;
  }
  .production-order-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .production-order-lot-row {
    grid-template-columns: 1fr;
  }
  .production-order-note-grid {
    grid-template-columns: 1fr;
  }
  .manufacturing-board .manufacturing-card-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .global-call-region {
    padding: 0 .75rem;
  }
  .global-call-summary {
    display: grid;
  }
  .global-call-summary-actions {
    justify-content: flex-start;
    margin-left: 0;
  }
  .production-order-metrics {
    grid-template-columns: 1fr;
  }
  .production-order-stage-save-grid {
    grid-template-columns: 1fr;
  }
  .production-order-material-row {
    grid-template-columns: 1fr;
  }
  .production-order-detail-grid {
    grid-template-columns: 1fr;
  }
  .production-order-stage-list li {
    display: grid;
  }
  .production-order-stage-list span {
    text-align: left;
  }
  .manufacturing-board .manufacturing-card-list {
    grid-template-columns: 1fr;
  }
}

.supplier-details td { background: var(--row-detail); }
.supplier-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  align-items: start;
}
.supplier-danger-zone {
  margin-top: 1rem;
  padding-top: .85rem;
  border-top: 1px solid var(--line);
}
.supplier-danger-zone form { margin: .5rem 0 0; }
.supplier-danger-zone .danger { min-height: var(--control-compact); }

@media (max-width: 760px) {
  .supplier-detail-grid { grid-template-columns: 1fr; }

  .supplier-table { display: block; min-width: 0; }
  .supplier-table colgroup,
  .supplier-table thead { display: none; }
  .supplier-table tbody { display: block; }
  .supplier-table tr.supplier-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .25rem .75rem;
    border: 1px solid var(--line);
    border-radius: .8rem;
    padding: .75rem .9rem;
    margin-bottom: .75rem;
    background: var(--card);
  }
  .supplier-table tr.supplier-main td {
    display: block;
    border: 0;
    padding: .15rem 0;
    white-space: normal;
  }
  .supplier-table tr.supplier-main td[data-label]::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-weight: 700;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    margin-bottom: .15rem;
  }
  .supplier-table tr.supplier-main td[data-label="작업"] { grid-column: 1 / -1; }
  .supplier-table tr.supplier-details { display: block; }
  .supplier-table tr.supplier-details > td {
    display: block;
    padding: .5rem 0 1rem;
    border: 0;
  }
}

/* Worker-first internal UI kit */
.data-card-table td[data-label],
.pending-table td[data-label] { overflow-wrap: break-word; }
.status-cell { white-space: nowrap; }
.section-intro { margin-top: -.35rem; }
.split-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  align-items: center;
}
.danger-zone {
  margin-top: 1rem;
  padding: .85rem;
  border: 1px solid var(--danger);
  border-radius: .65rem;
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger-soft) 55%, var(--card));
}
.danger-zone form { margin: .5rem 0 0; }
.order-danger-zone,
.inbound-danger-zone { margin-bottom: 1rem; }
.order-detail-actions { margin: .8rem 0; }
button.danger-subtle {
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 40%, var(--line));
  color: var(--danger);
}
.inbound-receive-panel-row > td {
  padding: .85rem .7rem 1rem;
  background: var(--row-detail);
}
.inbound-receive-panel {
  display: grid;
  gap: .85rem;
  padding: .95rem;
  border: 1px solid var(--line);
  border-radius: .8rem;
  background: color-mix(in srgb, var(--row-detail) 68%, var(--card));
}
.inbound-receive-panel h4 {
  margin: 0;
  font-size: 1rem;
}
.inbound-receive-panel-header {
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) minmax(20rem, 2fr);
  gap: .8rem;
  align-items: start;
}
.inbound-receive-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .5rem;
}
.inbound-receive-stats span,
.inbound-receive-summary span,
.inbound-receive-summary strong {
  min-width: 0;
  padding: .55rem .65rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: var(--input-bg);
  font-weight: 850;
}
.inbound-receipt-control {
  display: grid;
  gap: .55rem;
  overflow-x: auto;
  padding-bottom: .15rem;
}
.inbound-receipt-table {
  min-width: 44rem;
}
.inbound-receipt-table .receipt-lot { width: 30%; }
.inbound-receipt-table .receipt-qty { width: 20%; }
.inbound-receipt-table .receipt-memo { width: 34%; }
.inbound-receipt-table .receipt-remove { width: 10rem; }
.inbound-receive-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
}
.inbound-receive-summary strong {
  grid-column: 1 / -1;
  border-color: color-mix(in srgb, var(--warning) 50%, var(--line));
  background: color-mix(in srgb, var(--warning-soft) 70%, var(--card));
  color: var(--warning);
}
.inbound-receive-actions {
  justify-content: flex-end;
}
.quantity-direction {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
}
.quantity-direction label {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 58px;
  padding: .7rem;
  border: 2px solid var(--line);
  border-radius: .85rem;
  background: var(--input-bg);
  font-weight: 900;
  cursor: pointer;
}
.quantity-direction input {
  position: absolute;
  inset: 0;
  opacity: 0;
}
.quantity-direction label:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-strong);
  box-shadow: inset 0 0 0 1px var(--primary);
}
@media (max-width: 1100px) {
  .data-card-table,
  .pending-table {
    display: block;
    min-width: 0;
    overflow: visible;
    white-space: normal;
  }
  .data-card-table thead,
  .data-card-table colgroup,
  .pending-table thead,
  .pending-table colgroup { display: none; }
  .data-card-table tbody,
  .pending-table tbody { display: block; }
  .data-card-table tr,
  .pending-table tr {
    display: grid;
    gap: .35rem;
    padding: .9rem;
    margin-bottom: .75rem;
    border: 1px solid var(--line);
    border-radius: .9rem;
    background: var(--card);
  }
  .data-card-table td,
  .pending-table td {
    display: block;
    padding: .1rem 0;
    border: 0;
    text-align: left;
    white-space: normal;
  }
  .data-card-table td.num,
  .pending-table td.num { text-align: left; }
  .data-card-table td[data-label]::before,
  .pending-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: .1rem;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 850;
  }
  .data-card-table td[colspan]::before,
  .pending-table td[colspan]::before { content: none; }
  .data-card-table tr.inbound-receive-panel-row {
    display: block;
    padding: 0;
  }
  .inbound-receive-panel-row > td {
    display: block;
    padding: .5rem 0 1rem;
  }
  .inbound-receive-panel-header,
  .inbound-receive-stats,
  .inbound-receive-summary {
    grid-template-columns: 1fr;
  }
}
