:root {
  --brand: #155eef;
  --brand-dark: #0b3da8;
  --brand-soft: #eaf1ff;
  --ink: #152033;
  --muted: #64748b;
  --line: #d9e2ee;
  --surface: #ffffff;
  --canvas: #f4f7fb;
  --success: #087a55;
  --success-soft: #e8f7f0;
  --warning: #a15c00;
  --warning-soft: #fff4dd;
  --danger: #c3293a;
  --danger-soft: #ffebee;
  --shadow: 0 8px 28px rgb(25 50 90 / 10%);
  --radius: 16px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--canvas);
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 0 0, rgb(21 94 239 / 8%), transparent 28rem),
    var(--canvas);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select,
textarea,
summary {
  -webkit-tap-highlight-color: transparent;
}

button,
.button {
  min-height: 48px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgb(21 94 239 / 28%);
  outline-offset: 2px;
}

a {
  color: var(--brand-dark);
}

img {
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--brand-dark);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: calc(64px + var(--safe-top));
  padding: calc(8px + var(--safe-top)) 16px 8px;
  border-bottom: 1px solid rgb(217 226 238 / 80%);
  background: rgb(255 255 255 / 94%);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, var(--brand), #5992ff);
  box-shadow: 0 5px 16px rgb(21 94 239 / 24%);
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  line-height: 1.2;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.header-clocks {
  display: none;
}

@media (min-width: 1000px) {
  .header-clocks {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
    margin-right: 24px;
  }

  .header-clock {
    min-width: 112px;
    text-align: right;
    white-space: nowrap;
  }

  .header-clock + .header-clock {
    padding-left: 16px;
    border-left: 1px solid var(--line);
  }

  .header-clock time {
    display: block;
    color: var(--ink);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
  }

  .header-clock small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.3;
  }
}

.user-chip {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #bcd0fa;
  border-radius: 50%;
  color: var(--brand-dark);
  background: var(--brand-soft);
  font-weight: 800;
  text-decoration: none;
}

.network-banner {
  position: sticky;
  z-index: 29;
  top: calc(64px + var(--safe-top));
  padding: 9px 16px;
  color: #6d4200;
  background: #ffeab9;
  text-align: center;
  font-size: 13px;
}

.app-shell {
  width: min(100%, 1080px);
  min-height: calc(100vh - 72px);
  margin: 0 auto;
  padding: 18px 14px calc(96px + var(--safe-bottom));
}

.boot-screen {
  display: grid;
  min-height: 60vh;
  place-content: center;
  justify-items: center;
  color: var(--muted);
}

.spinner {
  display: inline-block;
  width: 34px;
  height: 34px;
  border: 4px solid #d7e3fb;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.page-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.page-header h1,
.page-header p {
  margin: 0;
}

.page-header h1 {
  font-size: clamp(24px, 7vw, 34px);
  letter-spacing: -0.04em;
}

.page-header p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.55;
}

.stack {
  display: grid;
  gap: 14px;
}

.grid-2,
.grid-3,
.stats-grid,
.quick-grid {
  display: grid;
  gap: 12px;
}

.grid-2,
.grid-3 {
  grid-template-columns: 1fr;
}

.stats-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quick-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 2px 12px rgb(25 50 90 / 5%);
}

.card-body {
  padding: 16px;
}

.card h2,
.card h3,
.card p {
  margin-top: 0;
}

.card h2:last-child,
.card h3:last-child,
.card p:last-child {
  margin-bottom: 0;
}

.stat-card {
  min-height: 110px;
  padding: 16px;
  border: 1px solid #d6e3fa;
  border-radius: var(--radius);
  background: linear-gradient(150deg, #fff, #f3f7ff);
}

.stat-card small,
.stat-card strong {
  display: block;
}

.stat-card small {
  color: var(--muted);
}

.stat-card strong {
  margin-top: 8px;
  color: #0f356d;
  font-size: clamp(25px, 8vw, 36px);
  letter-spacing: -0.04em;
}

.quick-action {
  display: flex;
  min-height: 92px;
  padding: 15px;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--surface);
  text-decoration: none;
  font-weight: 750;
}

.quick-action small {
  color: var(--muted);
  font-weight: 500;
}

.quick-action.primary {
  border-color: #abc5ff;
  background: var(--brand-soft);
}

.section-title {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0 12px;
}

.section-title h2 {
  margin: 0;
  font-size: 19px;
}

.button,
button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #fff;
  background: var(--brand);
  box-shadow: none;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button:hover {
  background: var(--brand-dark);
}

button:disabled,
.button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
}

.button.secondary,
button.secondary {
  border-color: #b9c9dd;
  color: #273a53;
  background: #fff;
}

.button.secondary:hover,
button.secondary:hover {
  background: #f3f6fa;
}

.button.danger,
button.danger {
  color: #fff;
  background: var(--danger);
}

.button.warning,
button.warning {
  color: #704000;
  background: #ffdc91;
}

.button.ghost,
button.ghost {
  min-height: 40px;
  padding: 8px 10px;
  color: var(--brand-dark);
  background: transparent;
}

.button.small,
button.small {
  min-height: 40px;
  padding: 8px 12px;
  font-size: 14px;
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.button-row > * {
  flex: 1 1 128px;
}

form {
  margin: 0;
}

.field {
  display: grid;
  gap: 7px;
}

.field + .field {
  margin-top: 13px;
}

.field label,
.field-label {
  color: #33435a;
  font-size: 14px;
  font-weight: 700;
}

.field-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  border: 1px solid #b9c7da;
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
}

textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
}

.check-grid {
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.check-option {
  display: flex;
  min-height: 48px;
  gap: 9px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.check-option input {
  width: 20px;
  min-height: 20px;
  margin: 0;
}

.check-option:has(input:disabled) {
  color: var(--muted);
  background: #f4f6f9;
}

.modal-dialog.account-access-dialog {
  width: min(94vw, 720px);
}

.account-access-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.permission-choice { display: flex; align-items: center; gap: 6px; min-width: 0; }
.permission-choice > .check-option { flex: 1; min-width: 0; }
.permission-help { position: relative; flex: 0 0 auto; }
.permission-help > summary {
  display: grid; place-items: center; width: 24px; height: 24px;
  border: 1px solid #7894b9; border-radius: 50%; color: #416791;
  font-weight: 700; cursor: help; list-style: none;
}
.permission-help > summary::-webkit-details-marker { display: none; }
.permission-help > summary:focus-visible { outline: 2px solid #155dfb; outline-offset: 2px; }
.permission-tooltip {
  display: none; position: absolute; z-index: 100; right: 0; bottom: calc(100% + 6px);
  width: min(280px, 75vw); padding: 12px; background: #143152; color: #fff;
  border-radius: 8px; box-shadow: 0 4px 18px #102d4f30;
  font-size: 13px; font-weight: 400; line-height: 1.6;
}
.permission-help[open] > .permission-tooltip,
.permission-help:hover > .permission-tooltip,
.permission-help:focus-within > .permission-tooltip { display: block; }
/* Chromium's closed-details content container otherwise hides hover/focus help. */
.permission-help:hover::details-content,
.permission-help:focus-within::details-content { content-visibility: visible; }
.check-grid:not(.account-access-grid) > .permission-choice:nth-child(2n+1) .permission-tooltip,
.account-access-grid > .permission-choice:nth-child(3n+1) .permission-tooltip { right: auto; left: 0; }

@media (max-width: 679px) {
  .account-access-grid {
    grid-template-columns: 1fr;
  }
  .check-grid:has(> .permission-choice) { grid-template-columns: 1fr; }
  .check-grid > .permission-choice .permission-tooltip { left: auto; right: 0; }
  .check-grid:not(.account-access-grid) > .permission-choice:nth-child(2n+1) .permission-tooltip,
  .account-access-grid > .permission-choice:nth-child(3n+1) .permission-tooltip { left: auto; right: 0; }
}

.login-page {
  display: grid;
  min-height: calc(100vh - 36px);
  place-items: center;
}

.login-card {
  width: min(100%, 430px);
  overflow: hidden;
  border: 1px solid #d6e1f1;
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
}

.login-hero {
  padding: 27px 22px 21px;
  color: #fff;
  background: linear-gradient(135deg, #0c3e9d, #2771ff);
}

.login-hero .brand-mark {
  margin-bottom: 18px;
  background: rgb(255 255 255 / 18%);
  box-shadow: none;
}

.login-hero h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.login-hero p {
  margin: 8px 0 0;
  color: #dce8ff;
  line-height: 1.6;
}

.login-form {
  padding: 22px;
}

.login-form button[type="submit"] {
  width: 100%;
  margin-top: 18px;
}

.task-card {
  overflow: hidden;
}

.task-main {
  padding: 16px;
}

.task-topline,
.meta-row,
.lot-heading {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.task-topline h2,
.task-topline h3,
.lot-heading h2,
.lot-heading h3 {
  margin: 0;
}

.order-number {
  color: var(--muted);
  font-size: 13px;
  word-break: break-all;
}

.quantity {
  white-space: nowrap;
  color: #0d397c;
  font-size: 22px;
  font-weight: 850;
}

.meta-list {
  display: grid;
  gap: 7px;
  margin: 13px 0;
  color: #46566d;
  font-size: 14px;
}

.meta-list div {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.meta-list dt,
.meta-list dd {
  margin: 0;
}

.meta-list dt {
  color: var(--muted);
}

.meta-list dd {
  max-width: 68%;
  text-align: right;
  word-break: break-word;
}

.production-note {
  margin: 12px 0;
  padding: 11px 12px;
  border-left: 4px solid #84aefc;
  border-radius: 8px;
  background: #f4f7fd;
  color: #334968;
  white-space: pre-wrap;
  word-break: break-word;
}

.preview-image {
  display: block;
  width: 100%;
  max-height: 300px;
  margin: 12px 0;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}

.task-actions {
  padding: 13px 16px 16px;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
}

.status {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  color: #244269;
  background: #e7eef8;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.status.success {
  color: var(--success);
  background: var(--success-soft);
}

.status.warning {
  color: var(--warning);
  background: var(--warning-soft);
}

.status.danger {
  color: var(--danger);
  background: var(--danger-soft);
}

.empty-state,
.error-state {
  padding: 30px 20px;
  border: 1px dashed #bdcada;
  border-radius: var(--radius);
  color: var(--muted);
  background: rgb(255 255 255 / 72%);
  text-align: center;
}

.empty-state h2,
.error-state h2 {
  margin: 0 0 8px;
  color: var(--ink);
}

.error-state {
  border-color: #efb7be;
  color: #8a2531;
  background: #fff8f8;
}

.loading-row {
  display: flex;
  min-height: 140px;
  gap: 11px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.loading-row .spinner {
  width: 25px;
  height: 25px;
  border-width: 3px;
}

.filter-row {
  display: grid;
  gap: 9px;
  margin-bottom: 14px;
  grid-template-columns: 1fr auto;
}

.filter-row button {
  min-width: 52px;
}

.camera-panel {
  position: relative;
  overflow: hidden;
  min-height: 220px;
  border-radius: 15px;
  background: #0a1424;
}

.camera-panel video {
  display: block;
  width: 100%;
  min-height: 220px;
  max-height: 420px;
  object-fit: cover;
}

.camera-guide {
  position: absolute;
  inset: 20% 12%;
  border: 3px solid rgb(255 255 255 / 88%);
  border-radius: 16px;
  box-shadow: 0 0 0 999px rgb(0 0 0 / 24%);
  pointer-events: none;
}

.lot-code {
  display: inline-block;
  margin: 3px 0;
  padding: 7px 10px;
  border-radius: 9px;
  color: #153a75;
  background: var(--brand-soft);
  font: 800 18px ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.05em;
}

.qr-image {
  display: block;
  width: min(230px, 74vw);
  margin: 14px auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.notice {
  padding: 12px 13px;
  border: 1px solid #c6d9fb;
  border-radius: 11px;
  color: #2c4b76;
  background: #eef4ff;
  line-height: 1.55;
}

.notice.warning {
  border-color: #f0d59e;
  color: #6d4706;
  background: #fff8e9;
}

.notice.danger {
  border-color: #f0bcc3;
  color: #8f2935;
  background: #fff3f4;
}

.money {
  color: #08714f;
  font-variant-numeric: tabular-nums;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: #506078;
  background: #f6f8fb;
  font-size: 12px;
  text-transform: none;
}

tr:last-child td {
  border-bottom: 0;
}

details.card > summary {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

details.card > summary::-webkit-details-marker {
  display: none;
}

details.card > summary::after {
  content: "+";
  color: var(--brand);
  font-size: 22px;
}

details.card[open] > summary::after {
  content: "−";
}

details.card[open] > summary {
  border-bottom: 1px solid var(--line);
}

.admin-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.admin-item {
  display: flex;
  min-height: 52px;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
}

.admin-item strong,
.admin-item small {
  display: block;
}

.admin-item small {
  margin-top: 3px;
  color: var(--muted);
}

.work-order-batches,
.work-order-batch {
  display: grid;
  gap: 12px;
}

.work-order-batch + .work-order-batch {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.work-order-batch-heading {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.work-order-batch-heading span,
.work-order-problem small {
  color: var(--muted);
}

.work-order-problem {
  min-width: 220px;
  max-width: 360px;
  white-space: normal;
}

.work-order-problem small {
  display: block;
  margin-top: 5px;
}

.work-order-pagination {
  justify-content: flex-end;
  margin-top: 14px;
}

.work-order-pagination .field-help {
  margin-right: auto;
}

.today-production,
.production-batch-list,
.production-order-details,
.production-order-items {
  display: grid;
  gap: 14px;
}

.production-screen-content,
.production-history-list,
.production-history-detail {
  display: grid;
  gap: 14px;
}

.production-tabs {
  display: flex;
  flex-wrap: wrap;
  width: fit-content;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #e9eef6;
}

@media screen and (min-width: 900px) {
  .production-tabs {
    position: sticky;
    top: calc(64px + var(--safe-top) + 8px);
    z-index: 25;
    align-self: start;
    box-shadow: 0 4px 14px rgb(24 49 83 / 12%);
  }
  .production-order-anchor-target,
  .production-history-detail { scroll-margin-top: calc(132px + var(--safe-top)); }
}

.production-order-claim-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.production-order-filters { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; }
.production-order-filters .field { flex: 1 1 180px; min-width: 0; }
.production-order-filters [hidden] { display: none; }
.production-order-backlog, .production-order-page-info { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; justify-content: space-between; }
.production-claim-batch { margin-bottom: 16px; }

.production-tab {
  min-height: 42px;
  padding: 8px 22px;
  border: 0;
  color: #56657a;
  background: transparent;
  box-shadow: none;
}

.production-tab:hover {
  background: rgb(255 255 255 / 65%);
}

.production-tab.active {
  color: var(--brand-dark);
  background: #fff;
  box-shadow: 0 2px 7px rgb(30 55 90 / 12%);
}

.production-batch-tools,
.production-history-page,
.production-history-card-footer {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.production-batch-tools h2,
.production-batch-tools p {
  margin: 0;
}

.production-batch-tools p {
  margin-top: 4px;
  color: var(--muted);
}

.production-batch-tools button {
  flex: 0 0 auto;
}

.production-order-heading-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.production-review-check {
  display: inline-flex;
  min-height: 38px;
  gap: 7px;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid #c7d6e9;
  border-radius: 9px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.production-review-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--brand);
}

.production-history-controls {
  display: grid;
  gap: 14px;
}

.production-history-filter {
  display: flex;
  gap: 12px;
  align-items: end;
}

.production-history-filter .field {
  width: min(100%, 320px);
}

.production-history-page {
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.shipment-history-controls .production-history-filter { flex-wrap: wrap; }
.shipment-history-actions,
.shipment-history-pagination { display: flex; flex: 0 0 auto; gap: 10px; align-items: center; }
.shipment-history-controls .shipment-history-actions button,
.shipment-history-controls .shipment-history-pagination button { width: auto; min-width: 90px; white-space: nowrap; }
.shipment-history-pagination { margin-left: auto; }
.shipment-history-total { color: var(--text); }
.shipment-history-list-toggle > summary { cursor: pointer; color: var(--muted); padding: 12px 4px; margin-bottom: 8px; }

.production-history-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.production-history-card {
  display: grid;
  gap: 13px;
  padding: 15px;
}

.production-history-card-heading {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.production-history-card-heading h2,
.production-history-card-heading p {
  margin: 0;
}

.production-history-card-heading h2 {
  margin-top: 3px;
  overflow-wrap: anywhere;
  font-size: 18px;
}

.production-history-card-heading p,
.production-history-card-heading small {
  margin-top: 4px;
  color: var(--muted);
}

.production-history-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.production-history-summary div {
  padding: 9px;
  border-radius: 9px;
  background: #f2f6fb;
}

.production-history-summary dt {
  color: var(--muted);
  font-size: 11px;
}

.production-history-summary dd {
  margin: 3px 0 0;
  color: #173963;
  font-size: 19px;
  font-weight: 800;
}

.production-history-detail {
  scroll-margin-top: calc(82px + var(--safe-top));
}

.production-print-sheet {
  display: none;
}

.stats-grid.production-stats {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.production-stats .stat-card {
  min-height: 92px;
  padding: 13px;
}

.production-stats .stat-card strong {
  font-size: clamp(22px, 7vw, 31px);
}

.production-batch-card,
.style-config-card,
.production-order-detail,
.production-order-item {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fbfcfe;
}

.production-batch-card {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.production-batch-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.production-order-summary-panel,
.production-grouped-summary {
  display: grid;
  gap: 11px;
  padding: 13px;
  border: 1px solid #d9e4f0;
  border-radius: 12px;
  background: #fff;
}

.production-summary-section-heading,
.production-summary-group-heading {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.production-summary-section-heading div {
  display: grid;
  gap: 2px;
}

.production-summary-section-heading small {
  color: var(--muted);
}

.production-size-summary,
.production-support-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 9px;
}

.production-support-summary {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  padding-top: 11px;
  border-top: 1px dashed var(--line);
}

.production-summary-group {
  min-width: 0;
  padding: 11px;
  border: 1px solid #dce6e3;
  border-radius: 10px;
  background: #fff;
}

.production-summary-group.support {
  border-color: #d8e1f0;
  background: #fff;
}

.production-summary-group-heading span {
  color: #7a5200;
  font-weight: 800;
}

.production-summary-group > small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.production-summary-group ul {
  display: grid;
  gap: 5px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.production-summary-group li {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 5px 7px;
  border: 1px solid #dce7e3;
  border-radius: 5px;
  background: #eaf1ef;
  font-size: 12px;
}

.production-summary-group.support li {
  border-color: #dce4ef;
  background: #edf2f8;
}

.production-summary-group li > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.production-summary-row-meta {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 5px;
  align-items: center;
  white-space: nowrap;
}

.production-summary-row-quantity {
  color: #775000;
}

.production-summary-group li > strong {
  flex: 0 0 auto;
  color: #775000;
}

.production-summary-group li.empty {
  color: var(--muted);
}

.summary-flag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 850;
  line-height: 1.35;
}

.summary-flag.urgent {
  color: #9e1f30;
  background: var(--danger-soft);
}

.summary-flag.custom {
  display: none;
}

.production-batch-heading,
.production-order-detail-heading,
.production-order-item-heading,
.style-config-heading,
.style-config-footer {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.production-batch-heading h3,
.production-order-detail-heading h3,
.style-config-heading h3 {
  margin: 2px 0 0;
}

.production-batch-heading small,
.production-order-detail-heading small,
.style-config-heading small {
  color: var(--muted);
}

.production-order-chips,
.status-row,
.route-tag-list,
.assignment-summary,
.process-palette {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.production-order-chip {
  display: grid;
  min-width: 82px;
  min-height: 44px;
  gap: 2px;
  padding: 8px 12px;
  border-color: #c8d5e6;
  color: #33435a;
  background: #fff;
  box-shadow: none;
}

.production-order-chip small {
  font-size: 10px;
  font-weight: 800;
}

.production-order-chip:hover {
  background: #eef3f9;
}

.production-order-chip.warning {
  border-color: #edbd69;
  color: #794700;
  background: var(--warning-soft);
}

.production-order-chip.danger {
  border-color: #ef9da7;
  color: #9e1f30;
  background: var(--danger-soft);
}

.production-order-chip.success {
  border-color: #9ed8c2;
  color: #066544;
  background: var(--success-soft);
}

.style-summary-grid,
.style-config-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.style-summary-card {
  display: grid;
  gap: 4px;
  min-height: 62px;
  padding: 10px 11px;
  border: 1px solid #dce6e3;
  border-radius: 10px;
  background: #f2f7f5;
}

.style-summary-card small,
.style-today-summary {
  color: var(--muted);
}

.production-order-details {
  padding-top: 4px;
  border-top: 1px dashed var(--line);
}

.production-order-detail {
  display: grid;
  gap: 12px;
  padding: 13px;
  scroll-margin-top: calc(84px + var(--safe-top));
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.production-order-detail:focus {
  outline: none;
}

.production-order-detail.highlighted {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 4px rgb(21 94 239 / 14%);
}

.production-order-item {
  display: grid;
  gap: 10px;
  padding: 11px;
  background: #fff;
}

.compact-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.compact-meta div {
  min-width: 0;
}

.compact-meta dt {
  color: var(--muted);
  font-size: 12px;
}

.compact-meta dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.production-preview {
  width: min(100%, 260px);
}

.danger-text {
  color: var(--danger);
}

.style-config-card {
  display: grid;
  gap: 12px;
  padding: 13px;
  background: #fff;
}

.sold-products-toolbar {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.sold-products-toolbar h2,
.sold-products-toolbar p {
  margin: 0;
}

.sold-products-toolbar p {
  margin-top: 4px;
}

.sold-products-toolbar > button {
  flex: 0 0 auto;
}

.sold-products-count-note {
  margin: 10px 0;
}

.sold-product-card.archived {
  border-style: dashed;
  background: #f7f8fa;
}

.sold-product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.style-config-heading .status {
  flex: 0 0 auto;
}

.route-tag {
  display: grid;
  min-width: 126px;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid #cbd9ec;
  border-radius: 11px;
  background: #f4f7fc;
}

.route-tag b {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
  font-size: 12px;
}

.route-tag small {
  color: var(--muted);
}

.route-arrow {
  color: #8da0b9;
  font-weight: 900;
}

.style-config-footer {
  align-items: flex-end;
  margin-top: auto;
}

.assignment-summary {
  margin-top: 7px;
}

.assignment-summary span {
  padding: 5px 8px;
  border-radius: 999px;
  color: #25446d;
  background: var(--brand-soft);
  font-size: 12px;
}

.employee-scope-item {
  align-items: stretch;
  flex-direction: column;
}

.wide-dialog {
  width: min(96vw, 880px);
}

.route-editor-list {
  display: grid;
  gap: 9px;
  padding: 0;
  list-style: none;
}

.route-editor-step {
  display: grid;
  grid-template-columns: 28px 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.route-editor-step.dragging {
  opacity: 0.48;
}

.route-drag-handle {
  color: #8495ad;
  cursor: grab;
  font-size: 20px;
  text-align: center;
}

.route-step-number {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
  font-weight: 800;
}

.route-inherit-option,
.route-price-field,
.route-step-actions {
  grid-column: 1 / -1;
}

.route-inherit-option {
  display: flex;
  min-height: 44px;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 9px;
  background: #f5f7fa;
  font-size: 13px;
}

.route-inherit-option input {
  width: 22px;
  min-height: 22px;
  margin: 0;
}

.route-price-field {
  display: flex;
  min-height: 44px;
  gap: 7px;
  align-items: center;
  font-weight: 800;
}

.route-price-field input {
  min-height: 44px;
}

.route-step-actions {
  display: flex;
  gap: 7px;
}

.route-step-action {
  min-width: 44px;
  min-height: 44px;
  padding: 7px 10px;
  flex: 1;
}

.process-palette {
  align-items: stretch;
}

.process-palette-button {
  display: grid;
  min-height: 54px;
  flex: 1 1 190px;
  justify-items: start;
  text-align: left;
}

.process-palette-button small {
  color: var(--muted);
  font-weight: 500;
}

.assignment-check-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.bottom-nav {
  position: fixed;
  z-index: 40;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  overflow-x: auto;
  min-height: calc(64px + var(--safe-bottom));
  padding: 5px max(8px, env(safe-area-inset-left)) var(--safe-bottom) max(8px, env(safe-area-inset-right));
  border-top: 1px solid #cfd9e6;
  background: rgb(255 255 255 / 97%);
  box-shadow: 0 -6px 24px rgb(32 50 80 / 9%);
  scrollbar-width: none;
}

.bottom-nav::-webkit-scrollbar {
  display: none;
}

@media (max-width: 999px) {
  .app-header.is-mobile-page-hidden {
    display: none;
  }

  .app-header {
    transition: transform 180ms ease, opacity 180ms ease;
    will-change: transform;
  }

  .app-header.is-scroll-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(-100% - 8px));
  }

  .bottom-nav {
    transition: transform 180ms ease, opacity 180ms ease;
    will-change: transform;
  }

  .bottom-nav.is-scroll-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(100% + 8px));
  }
}

.nav-item {
  display: grid;
  min-width: 68px;
  min-height: 54px;
  flex: 1 0 68px;
  place-content: center;
  border-radius: 10px;
  color: #66758a;
  text-align: center;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

.nav-item::before {
  content: attr(data-icon);
  display: block;
  margin-bottom: 2px;
  color: currentColor;
  font-size: 17px;
}

.nav-item.active {
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.toast-region {
  position: fixed;
  z-index: 100;
  top: calc(76px + var(--safe-top));
  right: 12px;
  left: 12px;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  width: min(100%, 470px);
  margin: 0 auto;
  padding: 12px 14px;
  border-radius: 11px;
  color: #fff;
  background: #1f314b;
  box-shadow: var(--shadow);
  animation: toast-in 0.18s ease-out;
}

.toast.success { background: #087653; }
.toast.error { background: #b42435; }

.modal-dialog {
  width: min(92vw, 460px);
  max-height: 90vh;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 18px;
  background: transparent;
}

.modal-dialog::backdrop {
  background: rgb(11 23 43 / 62%);
  backdrop-filter: blur(3px);
}

.modal-card {
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 70px rgb(9 24 49 / 36%);
}

.modal-card h2 {
  margin-bottom: 5px;
}

.inventory-item-dialog {
  width: min(94vw, 780px);
}

.inventory-item-form-error {
  margin: 0;
  padding: 11px 13px;
  border: 1px solid #e59aa4;
  border-radius: 10px;
  color: #8f1827;
  background: #fff1f3;
  font-weight: 700;
  line-height: 1.45;
}

.inventory-item-form-error:focus {
  outline: 2px solid #b42435;
  outline-offset: 2px;
}

.materials-tabs {
  display: flex;
  width: fit-content;
  max-width: 100%;
  gap: 5px;
  margin-bottom: 14px;
  padding: 5px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.materials-tab {
  min-height: 42px;
  padding: 9px 14px;
  flex: 0 0 auto;
  border-color: transparent;
  color: #40516a;
  background: transparent;
}

.materials-tab:hover {
  background: #f3f6fa;
}

.materials-tab.active {
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.materials-panel {
  display: grid;
  gap: 14px;
}

.materials-panel .section-title {
  margin-top: 0;
}

.materials-panel .section-title p {
  margin: 5px 0 0;
}

body.admin-layout .page-header > button {
  min-width: 62px;
  flex: 0 0 auto;
  white-space: nowrap;
}

.materials-stats .stat-card {
  min-height: 92px;
}

.materials-stats .stat-card strong {
  font-size: 30px;
}

.inventory-table-wrap,
.material-plan-table-wrap {
  width: 100%;
}

.inventory-table-wrap {
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
}

.inventory-table {
  min-width: 1220px;
  table-layout: fixed;
}

.inventory-col-item { width: 18%; }
.inventory-col-specification { width: 12%; }
.inventory-col-category { width: 10%; }
.inventory-col-source { width: 9%; }
.inventory-col-cost { width: 10%; }
.inventory-col-supplier { width: 17%; }
.inventory-col-stock { width: 7%; }
.inventory-col-unit { width: 6%; }
.inventory-col-action { width: 11%; }

.inventory-purchase-info {
  display: grid;
  min-width: 0;
  gap: 3px;
  justify-items: start;
}

.inventory-purchase-info strong,
.inventory-purchase-info small,
.inventory-purchase-link {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.inventory-purchase-info small {
  color: var(--muted);
}

.inventory-purchase-link {
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.inventory-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.inventory-row-actions button {
  min-width: 0;
  flex: 1 1 0;
  padding-inline: 8px;
}

.inventory-item-name-cell {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.inventory-item-name-cell strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.inventory-drag-handle {
  display: inline-flex;
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid #ccd7e5;
  border-radius: 9px;
  color: #63738a;
  background: #fff;
  box-shadow: none;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.inventory-drag-handle:hover {
  border-color: #9eb1c9;
  background: #f5f8fc;
}

.inventory-drag-handle:active {
  cursor: grabbing;
}

.inventory-order-table.inventory-ordering {
  user-select: none;
}

.inventory-order-table .inventory-row-dragging td {
  background: #edf3f1;
  box-shadow: inset 0 1px 0 #91afa5, inset 0 -1px 0 #91afa5;
}

.inventory-order-table.saving .inventory-drag-handle {
  cursor: wait;
}

.material-plan-table-wrap table {
  min-width: 1120px;
}

.inventory-table td:first-child strong,
.inventory-table td:first-child small,
.inventory-table td:nth-child(2) small,
.inventory-table td:nth-child(3) small,
.material-plan-table-wrap td:first-child strong,
.material-plan-table-wrap td:first-child small {
  display: block;
}

.inventory-table td small,
.material-plan-table-wrap td small {
  margin-top: 4px;
  color: var(--muted);
}

.inventory-table .inventory-stock-fractional,
.inventory-stock-fractional-help,
.inventory-table .inventory-stock-fractional-note {
  color: #a85b00;
}

.inventory-table .inventory-stock-fractional-note {
  display: block;
  white-space: normal;
}

.inventory-number {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.inventory-status-cell {
  text-align: center;
  white-space: nowrap;
}

.inventory-shortage {
  color: var(--danger);
  font-weight: 850;
}

.inventory-row-shortage td {
  background: #fffafb;
}

.inventory-active-option {
  align-self: end;
  min-height: 48px;
}

.staff-management-layout {
  display: grid;
  gap: 16px;
}

.staff-user-item.disabled {
  opacity: 0.72;
}

.staff-user-actions {
  justify-content: flex-end;
}

.staff-account-list-card .admin-list {
  margin-top: 0;
}

.materials-bom-selector,
.material-plan-form {
  display: grid;
  gap: 10px;
  align-items: end;
}

.bom-workspace {
  min-width: 0;
}

.bom-copy-picker {
  display: grid;
  min-width: 0;
  gap: 8px;
  padding: 12px;
  border: 1px solid #cdddf5;
  border-radius: 10px;
  background: #f5f8ff;
}

.bom-copy-controls {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}

.bom-copy-controls > .field {
  flex: 1 1 240px;
  min-width: 0;
  margin: 0;
}

.bom-copy-controls select {
  width: 100%;
}

.bom-copy-controls > button {
  width: auto;
  flex: 0 0 auto;
}

.bom-copy-picker p {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.materials-bom-stats .materials-sync-time {
  font-size: clamp(13px, 1.1vw, 17px);
  line-height: 1.3;
}

.bom-product-browser {
  padding: 12px;
  border: 1px solid #d6e0ec;
  border-radius: 12px;
  background: #f8fafc;
}

.bom-product-options {
  display: grid;
  max-height: 430px;
  gap: 10px;
  overflow-y: auto;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  padding: 2px;
}

.bom-product-option {
  display: grid;
  min-height: 92px;
  min-width: 0;
  align-content: center;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid #ccd9e8;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  text-align: left;
  box-shadow: none;
}

.bom-product-option:hover,
.bom-product-option:focus-visible {
  border-color: #8eafe7;
  background: #f4f8ff;
}

.bom-product-option.active {
  border-color: var(--brand);
  background: #eaf1ff;
  box-shadow: inset 0 0 0 1px var(--brand);
}

.bom-product-option strong {
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal;
}

.bom-product-option span,
.bom-product-option small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.bom-capacity-summary {
  padding: 10px 12px;
  border: 1px solid #cbded8;
  border-radius: 12px;
  background: #eef6f3;
}

.bom-capacity-summary small,
.bom-capacity-summary strong {
  display: block;
}

.bom-capacity-summary small {
  color: var(--muted);
  font-size: 12px;
}

.bom-capacity-summary strong {
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.bom-summary-list,
.bom-component-rows,
.inventory-shortage-list {
  display: grid;
  gap: 9px;
}

.bom-summary-purpose-groups,
.bom-purpose-groups {
  display: grid;
  gap: 12px;
}

.bom-summary-purpose-group,
.bom-purpose-group {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #cbd9e8;
  border-radius: 12px;
  background: #f7faff;
}

.bom-summary-purpose-heading,
.bom-purpose-group-heading {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.bom-summary-purpose-heading h3,
.bom-purpose-group-heading h3,
.bom-purpose-group-heading p {
  margin: 0;
}

.bom-summary-purpose-heading h3,
.bom-purpose-group-heading h3 {
  font-size: 15px;
}

.bom-purpose-group-heading p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.bom-summary-purpose-heading span,
.bom-purpose-group-heading > span {
  flex: 0 0 auto;
  color: #42566e;
  font-size: 12px;
  font-weight: 750;
}

.bom-purpose-group-rows {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.bom-summary-item,
.inventory-shortage-card {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbfcfe;
}

.bom-summary-item strong,
.bom-summary-item small,
.inventory-shortage-card strong,
.inventory-shortage-card small {
  display: block;
}

.bom-summary-item small,
.inventory-shortage-card small {
  margin-top: 3px;
  color: var(--muted);
}

.bom-summary-item > span {
  color: #344963;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.bom-summary-item {
  display: grid;
  grid-template-columns: minmax(300px, 1.6fr) minmax(400px, 2fr) auto;
  gap: 10px;
  padding: 9px 12px;
}

.bom-summary-item.success {
  border-color: #c9ddd6;
  background: #fbfefd;
}

.bom-summary-item.warning {
  border-color: #ecd49f;
  background: #fffbf3;
}

.bom-summary-item.danger {
  border-color: #eeb7be;
  background: #fff8f8;
}

.bom-stock-metrics {
  display: grid;
  min-width: 0;
  margin: 0;
  grid-template-columns: repeat(5, minmax(74px, 1fr));
}

.bom-stock-metrics div {
  min-width: 0;
  padding: 1px 10px;
  border-left: 1px solid #dce5ee;
}

.bom-stock-metrics dt {
  color: var(--muted);
  font-size: 11px;
}

.bom-stock-metrics dd {
  margin: 3px 0 0;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.bom-stock-metrics .bom-makeable dd {
  color: #075f49;
}

.bom-component-row {
  display: grid;
  gap: 8px 12px;
  align-items: center;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 9px 12px;
  border: 1px solid #cdd9e8;
  border-radius: 12px;
  background: #fbfcfe;
}

.bom-component-name {
  grid-column: 1 / -1;
}

.bom-component-row-actions {
  grid-column: 1 / -1;
}

.bom-component-row > * {
  min-width: 0;
}

.bom-component-row > .field {
  gap: 4px;
  margin: 0;
}

.bom-component-row input,
.bom-component-row select {
  height: 40px;
  min-height: 40px;
  padding: 7px 10px;
  font-size: 14px;
}

.bom-component-row.bom-component-invalid {
  border-color: #d84c5b;
  background: #fff7f8;
  box-shadow: 0 0 0 2px rgb(216 76 91 / 10%);
}

.bom-component-row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}

.bom-component-row-actions button {
  min-height: 36px;
  padding: 6px 9px;
}

.bom-component-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 12px;
  overflow-wrap: anywhere;
}

.bom-component-title strong {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.bom-component-title > span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.bom-component-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 14px;
  margin-top: 4px;
}

.bom-component-meta > small {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.bom-component-use-summary b {
  color: #273a53;
}

.bom-line-cost {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 6px;
  color: #42566e;
  font-size: 13px;
  line-height: 1.5;
}

.bom-line-cost b {
  color: #075f49;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.bom-line-cost.incomplete b {
  color: #8a5400;
  font-size: 14px;
}

.bom-cost-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.6fr);
  align-items: center;
  gap: 6px 16px;
  padding: 12px 14px;
  border: 1px solid #c9ddd6;
  border-radius: 12px;
  background: #eef6f3;
  overflow-wrap: anywhere;
}

.bom-cost-summary > div {
  min-width: 0;
}

.bom-cost-summary strong,
.bom-cost-summary small {
  display: block;
}

.bom-cost-summary small {
  margin-top: 3px;
  color: #52677b;
  font-size: 13px;
  line-height: 1.6;
}

.bom-cost-summary > p {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
}

.bom-cost-total {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.bom-cost-total > strong {
  color: #075f49;
  font-size: clamp(20px, 1.8vw, 24px);
  line-height: 1.35;
}

.bom-cost-summary.incomplete {
  border-color: #ecd49f;
  background: #fffbf3;
}

.bom-cost-summary.incomplete .bom-cost-total > strong,
.bom-cost-summary.incomplete > p:not(.field-help) {
  color: #8a5400;
}

.bom-component-live-stock {
  display: flex;
  gap: 6px;
  margin-top: 0;
  flex-wrap: wrap;
}

.bom-component-live-stock span {
  padding: 3px 7px;
  border-radius: 999px;
  background: #edf2f8;
  color: #42566e;
  font-size: 11px;
}

.bom-material-picker {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #cdd9e8;
  border-radius: 12px;
  background: #f8fafc;
}

.bom-material-picker-heading {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.bom-material-picker-heading strong,
.bom-material-picker-heading small {
  display: block;
}

.bom-material-picker-heading small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.bom-material-picker-heading > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.bom-add-purpose-options {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.bom-add-purpose-option {
  display: grid;
  min-width: 0;
  min-height: 62px;
  align-content: center;
  gap: 3px;
  padding: 9px 11px;
  border: 1px solid #b9cbe0;
  border-radius: 10px;
  background: #fff;
  color: #273a53;
  box-shadow: none;
  text-align: left;
}

.bom-add-purpose-option strong,
.bom-add-purpose-option small {
  display: block;
  overflow-wrap: anywhere;
}

.bom-add-purpose-option small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.bom-add-purpose-option.active {
  border-color: var(--brand);
  background: #eaf1ff;
  color: var(--brand-dark);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.bom-material-tags {
  display: flex;
  gap: 8px;
  align-items: stretch;
  flex-wrap: wrap;
}

.bom-material-tag {
  min-height: 40px;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid #b9cbe0;
  border-radius: 999px;
  color: #273a53;
  background: #fff;
  box-shadow: none;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.25;
  overflow-wrap: anywhere;
  text-align: left;
  white-space: normal;
}

.bom-material-tag::before {
  content: "+";
  margin-right: 5px;
  color: var(--brand);
  font-weight: 900;
}

.bom-material-tag:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: #f3f7ff;
}

.bom-material-tag:focus-visible {
  outline: 3px solid rgb(21 94 239 / 24%);
  outline-offset: 2px;
}

.bom-material-tag.selected {
  border-color: #8bcbb5;
  color: #087a55;
  background: #e8f7f0;
  cursor: pointer;
  opacity: 1;
}

.bom-material-tag.selected::before {
  content: "+";
  color: #087a55;
}

.bom-material-tag.selected::after {
  content: "已添加 " attr(data-added-count) " 次";
  margin-left: 7px;
  color: #426b5e;
  font-size: 11px;
  font-weight: 650;
}

@media (min-width: 680px) and (max-width: 1100px) {
  .bom-summary-item {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .bom-stock-metrics {
    grid-column: 1 / -1;
  }
}

.inventory-shortage-list {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.inventory-shortage-card {
  align-items: stretch;
  flex-direction: column;
}

.inventory-shortage-card .inventory-purchase-info {
  margin-top: 8px;
}

.inventory-shortage-card .inventory-purchase-info strong {
  font-size: 13px;
}

.inventory-shortage-card.danger {
  border-color: #efb7be;
  background: #fff8f8;
}

.inventory-shortage-card.warning {
  border-color: #f0d59e;
  background: #fffaf0;
}

.inventory-shortage-card dl {
  display: grid;
  margin: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.inventory-shortage-card dl div {
  padding: 8px 10px;
  border-radius: 9px;
  background: rgb(255 255 255 / 76%);
}

.inventory-shortage-card dt,
.inventory-shortage-card dd {
  margin: 0;
}

.inventory-shortage-card dt {
  color: var(--muted);
  font-size: 12px;
}

.inventory-shortage-card dd {
  margin-top: 4px;
  font-weight: 800;
}

.material-plan-meta {
  margin: 0;
}

.material-plan-result {
  margin-top: 12px;
}

.inventory-movements-title {
  margin-top: 8px !important;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.inventory-movements-table {
  min-width: 1050px;
}

.inventory-movements-table td:nth-child(2) strong,
.inventory-movements-table td:nth-child(2) small {
  display: block;
}

.inventory-movements-table td:nth-child(2) small {
  margin-top: 4px;
  color: var(--muted);
}

.inventory-movement-reason {
  min-width: 220px;
  max-width: 360px;
  white-space: normal;
}

.inventory-positive {
  color: var(--success);
  font-weight: 800;
}

.inventory-negative {
  color: var(--danger);
  font-weight: 800;
}

.inventory-supplier-dialog,
.purchase-invoice-dialog {
  width: min(94vw, 620px);
}

.inventory-purchase-summary {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 0.4fr);
  gap: 14px;
  align-items: end;
}

.inventory-current-stock {
  display: grid;
  min-height: 74px;
  padding: 12px 16px;
  grid-template-columns: 1fr auto;
  align-content: center;
  column-gap: 8px;
  border: 1px solid #cbd9ec;
  border-radius: 12px;
  background: #f5f9ff;
}

.inventory-current-stock small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-weight: 700;
}

.inventory-current-stock strong {
  color: var(--brand-dark);
  font-size: 27px;
  font-variant-numeric: tabular-nums;
}

.inventory-current-stock span {
  align-self: end;
  padding-bottom: 4px;
  color: var(--muted);
}

.inventory-supplier-section {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
}

.inventory-supplier-section h3 {
  margin: 0;
  font-size: 16px;
}

.inventory-supplier-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
}

.inventory-supplier-card {
  display: flex;
  min-width: 0;
  padding: 12px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #cfdbeb;
  border-radius: 11px;
  background: #fff;
}

.inventory-supplier-card > div,
.inventory-supplier-card strong,
.inventory-supplier-card small,
.inventory-supplier-card a {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.inventory-supplier-card small {
  margin-top: 3px;
  color: var(--muted);
}

.inventory-supplier-card a {
  margin-top: 5px;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.inventory-supplier-card button {
  flex: 0 0 auto;
}

.inventory-purchase-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.inventory-invoice-options {
  display: flex;
  margin: 0;
  padding: 12px;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.inventory-invoice-options legend {
  padding: 0 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.inventory-invoice-options label {
  display: flex;
  min-height: 44px;
  padding: 9px 13px;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #cbd8ea;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.inventory-invoice-options label:has(input:checked) {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: var(--brand-soft);
  font-weight: 800;
}

.inventory-invoice-options input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.inventory-purchase-history-wrap {
  width: 100%;
}

.inventory-purchase-history {
  min-width: 1100px;
}

.inventory-purchase-history td:nth-child(2) strong,
.inventory-purchase-history td:nth-child(2) small,
.inventory-purchase-history td:nth-child(3) strong,
.inventory-purchase-history td:nth-child(3) small,
.inventory-invoice-cell small {
  display: block;
}

.inventory-purchase-history td:nth-child(2) small,
.inventory-purchase-history td:nth-child(3) small,
.inventory-invoice-cell small {
  margin-top: 4px;
  color: var(--muted);
}

.inventory-invoice-cell {
  min-width: 80px;
}

.empty-state.compact {
  min-height: 0;
  padding: 16px;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 679px) {
  .inventory-table {
    min-width: 1220px;
  }

  .inventory-drag-handle {
    width: 40px;
    min-width: 40px;
    min-height: 40px;
  }

  .inventory-purchase-summary,
  .inventory-purchase-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .inventory-supplier-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .inventory-supplier-card {
    align-items: stretch;
    flex-direction: column;
  }

  .inventory-supplier-card button {
    width: 100%;
  }

  .inventory-invoice-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 9px;
    gap: 7px;
  }

  .inventory-invoice-options label {
    min-width: 0;
    padding: 8px 5px;
    gap: 5px;
  }

  .button.small,
  button.small {
    min-height: 44px;
  }

  .style-config-heading,
  .style-config-footer,
  .admin-item,
  .production-batch-tools,
  .production-history-page,
  .production-history-card-footer,
  .production-order-detail-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .style-config-footer button,
  .admin-item .button-row,
  .production-batch-tools button,
  .production-history-page .button-row,
  .production-history-card-footer button {
    width: 100%;
  }

  .sold-products-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .sold-products-toolbar > button,
  .sold-product-actions {
    width: 100%;
  }

  .production-tabs {
    width: 100%;
  }

  .production-tab {
    flex: 1 1 90px;
    padding-inline: 10px;
    white-space: nowrap;
  }

  .production-history-filter {
    align-items: stretch;
    flex-direction: column;
  }

  .production-history-filter .field,
  .production-history-filter .button-row,
  .production-history-filter button {
    width: 100%;
  }

  .production-history-list {
    grid-template-columns: 1fr;
  }

  .production-order-heading-actions {
    justify-items: stretch;
  }

  .production-review-check {
    justify-content: center;
  }

  .materials-tabs {
    width: 100%;
  }

  .materials-tab {
    flex: 1 0 auto;
  }

  .materials-panel .section-title,
  .bom-summary-item {
    align-items: stretch;
    flex-direction: column;
  }

  .bom-summary-item {
    grid-template-columns: minmax(0, 1fr);
  }

  .bom-product-options {
    max-height: 360px;
    grid-template-columns: minmax(0, 1fr);
  }

  .bom-stock-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .bom-stock-metrics div {
    padding: 7px 8px;
    border: 0;
    border-radius: 8px;
    background: rgb(255 255 255 / 72%);
  }

  .bom-stock-metrics .bom-makeable {
    grid-column: 1 / -1;
  }

  .materials-panel .section-title button,
  .material-plan-form > button {
    width: 100%;
  }

  .bom-add-purpose-options {
    grid-template-columns: minmax(0, 1fr);
  }

  .bom-component-row-actions {
    justify-content: stretch;
  }

  .bom-component-row-actions button {
    flex: 1 1 0;
  }

  .bom-material-picker-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .bom-material-tag {
    min-height: 44px;
  }

  .bom-cost-summary {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
  }

  .bom-cost-total {
    text-align: left;
  }

  .bom-summary-item > span {
    text-align: left;
  }
}

@media (min-width: 680px) {
  .app-shell {
    padding: 26px 24px calc(100px + var(--safe-bottom));
  }

  .stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .quick-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .style-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .style-config-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .production-order-items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compact-meta {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .employee-scope-item {
    align-items: center;
    flex-direction: row;
  }

  .assignment-check-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .route-editor-step {
    grid-template-columns: 28px 34px minmax(120px, 1fr) minmax(210px, 1.3fr) 132px auto;
  }

  .route-inherit-option {
    grid-column: 4;
  }

  .route-price-field {
    grid-column: 5;
  }

  .route-step-actions {
    grid-column: 6;
  }

  .route-step-action {
    flex: 0 0 44px;
  }

  .materials-bom-selector {
    grid-template-columns: minmax(220px, 1.35fr) minmax(210px, 1fr) auto;
  }

  .material-plan-form {
    grid-template-columns: minmax(240px, 1fr) auto;
  }

  .bom-component-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(100px, 140px) minmax(100px, 140px);
  }

  .bom-component-row-actions {
    grid-column: 1 / -1;
  }

  .toast-region {
    right: 22px;
    left: auto;
  }

  .toast {
    width: 390px;
  }
}

@media (pointer: coarse) {
  .route-drag-handle {
    color: #a5b1c2;
    cursor: default;
  }
}

@media (min-width: 1000px) {
  .bottom-nav {
    right: 22px;
    bottom: 18px;
    left: 22px;
    width: min(760px, calc(100% - 44px));
    min-height: 64px;
    margin: auto;
    padding: 5px;
    border: 1px solid #cfd9e6;
    border-radius: 18px;
  }

  body.admin-layout .bottom-nav {
    top: calc(64px + var(--safe-top));
    right: auto;
    bottom: 0;
    left: 0;
    width: 216px;
    min-height: 0;
    margin: 0;
    padding: 18px 12px calc(18px + var(--safe-bottom));
    overflow-y: auto;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    border: 0;
    border-right: 1px solid #cfd9e6;
    border-radius: 0;
    box-shadow: 8px 0 24px rgb(32 50 80 / 7%);
  }

  body.admin-layout .nav-item {
    width: 100%;
    min-height: 50px;
    height: 50px;
    padding: 10px 12px;
    flex: 0 0 50px;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    justify-content: initial;
    place-content: initial;
    text-align: left;
    font-size: 14px;
  }

  body.admin-layout .nav-item::before {
    margin: 0;
    font-size: 18px;
    text-align: center;
  }

  .app-shell.app-shell-admin {
    width: 100%;
    margin: 0;
    padding-bottom: 48px;
    padding-right: clamp(28px, 3vw, 56px);
    padding-left: calc(216px + clamp(28px, 3vw, 56px));
  }
}

@media (min-width: 1180px) {
  .bom-component-row {
    grid-template-columns: minmax(220px, 1.4fr) minmax(150px, 0.8fr) minmax(180px, 1fr) minmax(96px, 118px) minmax(96px, 118px) auto;
  }

  .bom-component-name,
  .bom-component-row-actions {
    grid-column: auto;
  }
}

@media (min-width: 1280px) {
  .app-shell-admin .style-config-grid,
  .app-shell-admin .production-order-items,
  .app-shell-admin .production-history-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .app-shell-admin .admin-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .staff-management-layout {
    grid-template-columns: minmax(360px, 0.72fr) minmax(640px, 1.55fr);
    align-items: start;
  }

  .app-shell-admin .staff-account-list-card .admin-list {
    grid-template-columns: 1fr;
  }

  .wide-dialog {
    width: min(calc(100vw - 96px), 1280px);
  }
}

@media (min-width: 1600px) {
  .app-shell-admin .style-config-grid,
  .app-shell-admin .production-order-items,
  .app-shell-admin .production-history-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Production batch reading layout: compact order tags, model strip, and preview cards. */
.production-order-chips {
  gap: 6px;
}

.production-order-chip {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 0;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1;
}

.production-order-chip .order-chip-number {
  font-size: 11px;
  font-weight: 850;
}

.production-order-chip .order-chip-flags {
  display: none;
}

.production-order-chip:not(.is-urgent):not(.is-custom) {
  border-color: #d5e0dc;
  color: #385047;
  background: #eef4f2;
}

.production-order-chip.is-custom:not(.is-urgent) {
  border-color: #e7c572;
  color: #805100;
  background: #fff6df;
}

.production-order-chip.is-urgent {
  border-color: #ef9aa5;
  color: #a31f32;
  background: #fff0f1;
}

.production-order-chip:disabled {
  cursor: default;
  opacity: 1;
}

.production-model-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 9px;
  align-items: start;
}

.production-model-pagination {
  display: none;
}

.production-order-details {
  display: block;
  column-width: 320px;
  column-gap: 14px;
}

.production-order-detail {
  display: inline-grid;
  width: 100%;
  margin: 0 0 14px;
  break-inside: avoid;
  vertical-align: top;
}

.production-order-items,
.app-shell-admin .production-order-items {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.production-order-item {
  overflow: hidden;
  break-inside: avoid;
}

.production-order-item[data-production-preview] {
  cursor: zoom-in;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.production-order-item[data-production-preview]:hover,
.production-order-item[data-production-preview]:focus-visible {
  border-color: #9bb7ec;
  box-shadow: 0 8px 22px rgb(25 50 90 / 13%);
  transform: translateY(-1px);
}

.production-preview-media {
  margin: -11px -11px 0;
  overflow: hidden;
  border-bottom: 1px solid #e2e8f0;
  background: #f7f8fa;
}

.production-preview {
  display: block;
  width: 100%;
  max-height: 560px;
  margin: 0 auto;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  object-fit: contain;
  background: #f7f8fa;
}

.production-preview-media .production-preview {
  width: 100%;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
}

.production-order-detail .compact-meta {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.production-custom-fields {
  display: grid;
  gap: 7px;
  margin: 0;
}

.production-custom-fields > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px;
  align-items: start;
  padding: 8px 9px;
  border-left: 3px solid #8eb4ff;
  border-radius: 7px;
  background: #f2f6ff;
}

.production-custom-fields dt {
  color: #53657e;
  font-size: 11px;
  font-weight: 750;
}

.production-custom-fields dd {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.55;
}

.production-custom-waterfall {
  display: block;
  column-width: 282px;
  column-gap: 14px;
}

.production-custom-summary-card {
  display: inline-block;
  width: 100%;
  min-height: 0;
  margin: 0 0 14px;
  padding: 0;
  overflow: hidden;
  break-inside: avoid;
  border: 1px solid #d8e2ee;
  border-radius: 12px;
  color: var(--text);
  background: #fff;
  box-shadow: 0 3px 12px rgb(28 48 75 / 7%);
  text-align: left;
  vertical-align: top;
}

.production-custom-summary-card:hover {
  border-color: #aebed2;
  background: #fff;
  box-shadow: 0 8px 22px rgb(28 48 75 / 12%);
  transform: translateY(-1px);
}

.production-custom-summary-image {
  display: block;
  width: 100%;
  height: auto;
}

.production-custom-summary-card .production-custom-preview-placeholder {
  width: 100%;
  aspect-ratio: 3 / 4;
}

.production-custom-summary-caption {
  display: grid;
  gap: 4px;
  padding: 10px;
}

.production-custom-summary-caption strong {
  color: #8a5a05;
  font-size: 15px;
}

.production-custom-summary-caption span {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.production-custom-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 14px;
  overflow: hidden;
  break-inside: avoid;
  page-break-inside: avoid;
  vertical-align: top;
  border: 1px solid #d8e2ee;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 3px 12px rgb(28 48 75 / 7%);
  scroll-margin-top: calc(84px + var(--safe-top));
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.production-custom-card:hover {
  border-color: #b9c9dd;
  box-shadow: 0 8px 22px rgb(28 48 75 / 11%);
  transform: translateY(-1px);
}

.production-custom-card.highlighted {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgb(21 94 239 / 14%);
}

.production-custom-preview-trigger {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #f6f7f8;
  box-shadow: none;
  cursor: zoom-in;
}

.production-custom-preview-trigger:hover {
  background: #f6f7f8;
  box-shadow: none;
  transform: none;
}

.production-custom-preview-trigger:focus-visible,
.production-custom-original-button:focus-visible {
  outline: 3px solid rgb(21 94 239 / 28%);
  outline-offset: -3px;
}

.production-custom-preview-image {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  background: #f6f7f8;
}

.production-custom-preview-image:not([src]) {
  min-height: 160px;
}

.production-custom-preview-placeholder {
  display: grid;
  min-height: 104px;
  place-items: center;
  padding: 18px;
  color: #7a889b;
  background: #f6f8fb;
  font-size: 12px;
  text-align: center;
}

.production-custom-card-body {
  display: grid;
  gap: 8px;
  padding: 11px 12px 12px;
}

.production-custom-order-number {
  margin: 0;
  color: #8a5a05;
  font-size: 17px;
  font-weight: 850;
  line-height: 1.15;
}

.production-custom-title {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.production-custom-meta {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 7px 12px;
  margin: 0;
  padding: 0 0 8px;
  border-bottom: 1px solid #edf1f5;
}

.production-custom-meta > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.production-custom-meta dt {
  color: #7a8798;
  font-size: 10px;
  line-height: 1.25;
}

.production-custom-meta dd {
  min-width: 0;
  margin: 0;
  color: #4d5d72;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.production-custom-card .production-custom-fields {
  gap: 0;
}

.production-custom-card .production-custom-fields > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px;
  align-items: start;
  padding: 5px 0;
  border: 0;
  border-top: 1px dotted #d9e1ea;
  border-radius: 0;
  background: transparent;
}

.production-custom-card .production-custom-fields dt {
  color: #53657e;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.production-custom-card .production-custom-fields dd {
  color: #45576f;
  font-size: 12px;
  line-height: 1.48;
}

.production-custom-card-footer {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-top: 2px;
}

.production-custom-original-button {
  flex: 1 1 auto;
  min-height: 36px;
}

.production-custom-empty {
  padding: 28px 18px;
  border: 1px dashed #cbd8e7;
  border-radius: 12px;
  color: var(--muted);
  background: #fff;
  text-align: center;
}

.production-artwork-summary-button,
.production-order-artwork-button {
  flex: 0 0 auto;
  min-height: 36px;
  white-space: nowrap;
}

button.secondary.production-artwork-summary-button,
.button.secondary.production-artwork-summary-button {
  border-color: #e7c572;
  color: #805100;
  background: #fff6df;
}

.production-order-artwork-button {
  border-color: #b7c8df;
  color: #214978;
  background: #f7faff;
}

.production-batch-heading-actions {
  display: flex;
  min-width: 0;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-left: auto;
}

.production-batch-heading {
  flex-wrap: wrap;
}

.production-batch-heading > .production-shipping-filters {
  flex: 0 0 auto;
}

.production-batch-heading > .production-shipping-filters button {
  min-height: 36px;
}

button.secondary.production-artwork-summary-button:hover,
.button.secondary.production-artwork-summary-button:hover {
  border-color: #d7ad4d;
  background: #ffefc7;
}

.production-order-artwork-button:hover {
  border-color: #8fa9ca;
  background: #edf4ff;
}

.production-artwork-dialog {
  width: min(96vw, 1760px);
  max-width: none;
  height: min(94vh, 1080px);
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  background: transparent;
}

.production-artwork-dialog::backdrop {
  background: rgb(8 18 34 / 78%);
  backdrop-filter: blur(3px);
}

.production-artwork-dialog-card {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border-radius: 16px;
  background: #f4f7fb;
  box-shadow: 0 24px 80px rgb(0 0 0 / 42%);
}

.production-artwork-dialog-heading {
  position: relative;
  z-index: 2;
  display: flex;
  min-width: 0;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #d7e1ed;
  background: #fff;
  box-shadow: 0 2px 10px rgb(28 48 75 / 6%);
}

.production-artwork-dialog-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.production-artwork-dialog-copy h2,
.production-artwork-dialog-copy p {
  margin: 0;
}

.production-artwork-dialog-copy h2 {
  font-size: 20px;
}

.production-artwork-dialog-copy p {
  color: var(--muted);
  font-size: 12px;
}

.production-artwork-dialog-close {
  flex: 0 0 auto;
  min-width: 72px;
  min-height: 38px;
}

.production-artwork-dialog-body {
  min-height: 0;
  padding: 14px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.production-artwork-dialog-body .production-custom-waterfall {
  column-width: 272px;
  column-gap: 14px;
}

.production-artwork-detail-view {
  display: grid;
  gap: 10px;
}

.production-artwork-back {
  justify-self: start;
}

.production-custom-detail-card {
  display: block;
  width: min(100%, 920px);
  margin: 0 auto;
}

.production-custom-detail-card .production-custom-preview-image {
  max-height: min(60vh, 720px);
}

.production-order-contents {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.production-shipping-filters {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}

.production-shipping-filters button.active {
  border-color: #8eb5a5;
  color: #075b42;
  background: #e8f5ef;
  box-shadow: inset 0 0 0 1px rgb(7 91 66 / 8%);
}

.production-shipping-choice {
  display: inline-flex;
  min-height: 32px;
  gap: 6px;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid #9ab8dd;
  border-radius: 8px;
  color: #214978;
  background: #f3f7fd;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.production-shipping-choice[hidden],
.production-shipping-action-bar[hidden] {
  display: none;
}

.production-shipping-choice input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--primary);
}

.production-shipping-choice:has(input:disabled) {
  opacity: 0.55;
  cursor: not-allowed;
}

.production-shipping-action-bar {
  position: sticky;
  z-index: 4;
  bottom: max(10px, env(safe-area-inset-bottom, 0px));
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid #9ab8dd;
  border-radius: 12px;
  color: #173e70;
  background: rgb(247 250 255 / 96%);
  box-shadow: 0 10px 28px rgb(28 48 75 / 18%);
  backdrop-filter: blur(8px);
}

.production-shipping-selection-summary {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.production-shipping-selection-summary > span {
  font-size: 13px;
  font-weight: 750;
}

.production-shipping-action-bar .button-row {
  margin: 0;
}

.production-shipping-dialog {
  width: min(520px, calc(100vw - 24px));
}

.production-shipping-dialog .modal-card {
  width: 100%;
}

.production-shipment-tracking,
.production-shipment-date {
  min-width: 0;
  color: #53657e;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.35;
}

.production-shipment-tracking {
  max-width: min(260px, 42vw);
  padding: 3px 7px;
  overflow-wrap: anywhere;
  border-radius: 999px;
  background: #f3f6fa;
}

.production-order-contents-heading {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  justify-content: space-between;
}

.production-order-contents-heading h2,
.production-order-contents-heading p {
  margin: 0;
}

.production-order-contents-heading > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.production-order-contents-heading strong {
  font-size: 18px;
}

.production-order-contents-heading p,
.production-order-contents-heading small {
  color: var(--muted);
  font-size: 12px;
}

.production-order-contents-heading > span {
  flex: 0 0 auto;
  color: #4d5d72;
  font-weight: 750;
}

.production-order-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.production-order-content-card {
  display: grid;
  min-width: 0;
  overflow: hidden;
  grid-template-columns: minmax(0, 1fr);
  border: 1px solid #d7e1ed;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 3px 12px rgb(28 48 75 / 6%);
  scroll-margin-top: calc(72px + var(--safe-top));
}

.production-order-content-card.is-urgent {
  border-color: #efadb5;
}

.production-order-content-card.is-custom {
  border-color: #e8ca91;
}

.production-order-content-card-header {
  display: flex;
  min-width: 0;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid #e4eaf1;
  background: #eaf1ef;
}

.production-order-content-header-main {
  display: flex;
  width: 100%;
  min-width: 0;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

.production-order-content-heading-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.production-order-content-header-main > .production-order-content-heading-copy {
  flex: 1 1 auto;
  width: 100%;
}

.production-order-content-title-line {
  display: flex;
  min-width: 0;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.production-order-content-title-line > strong {
  flex: 0 0 auto;
}

.production-order-content-title-line .production-order-content-badges {
  order: 0;
}

.production-order-content-header-main > .production-order-note-edit,
.production-order-content-title-line > .production-order-note-edit {
  flex: 0 0 auto;
  margin-left: auto;
}

.production-order-content-primary-titles {
  display: flex;
  flex: 1 1 220px;
  min-width: 0;
  gap: 4px 10px;
  align-items: baseline;
  flex-wrap: wrap;
  font-weight: 800;
  line-height: 1.35;
}

.production-order-content-primary-titles > span {
  display: block;
  overflow-wrap: anywhere;
}

.production-order-header-artwork-previews {
  display: inline-flex;
  flex: 0 1 auto;
  min-width: 0;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
}

.production-order-header-artwork-thumbnail {
  display: block;
  width: 42px;
  height: 52px;
  min-height: 0;
  flex: 0 0 auto;
  padding: 2px;
  overflow: hidden;
  border: 1px solid #e7c572;
  border-radius: 7px;
  background: #fffdf7;
  box-shadow: none;
  cursor: zoom-in;
}

.production-order-header-artwork-thumbnail:hover {
  border-color: #d7ad4d;
  background: #fff8e8;
  box-shadow: 0 4px 12px rgb(128 81 0 / 12%);
  transform: none;
}

.production-order-header-artwork-thumbnail:focus-visible {
  outline: 3px solid rgb(215 173 77 / 28%);
  outline-offset: 2px;
}

.production-order-header-artwork-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.production-order-content-meta {
  display: flex;
  min-width: 0;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.production-order-content-meta > span + span::before {
  margin-right: 5px;
  content: "·";
}

.production-order-content-time > span {
  color: #53657e;
  font-weight: 700;
}

.production-order-content-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.production-order-content-card-header h3,
.production-order-content-card-header strong,
.production-order-content-card-header small {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.production-order-content-card-header h3,
.production-order-content-card-header strong {
  font-size: 15px;
  line-height: 1.35;
}

.production-order-content-card-header small {
  color: var(--muted);
}

.production-order-content-badges {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.production-order-content-badge,
.production-order-content-kind {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
  line-height: 1.35;
  white-space: nowrap;
}

.production-order-content-badge {
  padding: 4px 9px;
  color: #4d5d72;
  background: #e9eef4;
  font-size: 12px;
}

.production-order-content-card-header .production-order-content-badge {
  padding: 5px 10px;
  font-size: 13px;
}

.production-order-content-badge.urgent {
  color: #9e1f30;
  background: var(--danger-soft);
}

.production-order-content-badge.custom {
  color: #805000;
  background: var(--warning-soft);
}

.production-order-content-items {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  margin: 0;
  padding: 0;
  background: #fff;
  list-style: none;
}

.production-order-content-item {
  display: block;
  min-width: 0;
  padding: 0;
  border-bottom: 1px dotted #d9e1ea;
  background: #fff;
}

.production-order-content-item-main {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  background: #fff;
}

.production-order-content-product-image {
  display: block;
  width: 46px;
  height: 46px;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #d8e1ec;
  border-radius: 7px;
  background: #f6f8fb;
  box-shadow: none;
  cursor: zoom-in;
}

.production-order-content-product-image:hover {
  border-color: #8fa9ca;
  background: #fff;
  box-shadow: 0 4px 12px rgb(28 48 75 / 10%);
  transform: none;
}

.production-order-content-product-image:focus-visible {
  outline: 3px solid rgb(21 94 239 / 24%);
  outline-offset: 2px;
}

.production-order-content-product-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.production-order-content-item-main:has(.production-order-content-product-image) {
  grid-template-columns: 46px auto minmax(0, 1fr) auto;
}

.production-order-content-item:last-child {
  border-bottom: 0;
}

.production-order-content-kind {
  min-width: 42px;
  padding: 2px 6px;
  color: #4c6079;
  background: #edf2f7;
}

.production-order-content-kind.product {
  color: #075b40;
  background: #e7f4ee;
}

.production-order-content-kind.chain {
  color: #24508b;
  background: #e8f0fc;
}

.production-order-content-kind.accessory {
  color: #675129;
  background: #f5efe2;
}

.production-order-content-item-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.production-order-content-name,
.production-order-content-sku {
  min-width: 0;
  overflow-wrap: anywhere;
}

.production-order-content-name {
  font-weight: 750;
}

.production-order-content-sku {
  color: var(--muted);
  font-size: 10px;
}

.production-order-content-quantity {
  color: #775000;
  font-weight: 850;
  white-space: nowrap;
}

.production-order-content-item.is-product-customized {
  background: #fff;
}

.production-order-custom-fields {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  margin: 0;
  padding: 8px 14px 10px;
  border-top: 1px solid #e7edf5;
  background: #fff;
}

.production-order-custom-fields > div {
  display: grid;
  min-width: 0;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.production-order-custom-fields dt {
  color: #53657e;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.production-order-custom-fields dt::after {
  content: "：";
}

.production-order-custom-fields dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  white-space: normal;
  font-size: 13px;
  line-height: 1.5;
}

.production-order-custom-image dd {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
}

.production-order-artwork-thumbnail {
  display: block;
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #b9c9dd;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
  cursor: zoom-in;
}

.production-order-artwork-thumbnail:hover {
  border-color: #6f96cf;
  background: #fff;
  box-shadow: 0 5px 14px rgb(28 48 75 / 14%);
  transform: none;
}

.production-order-artwork-thumbnail:focus-visible {
  outline: 3px solid rgb(21 94 239 / 28%);
  outline-offset: 2px;
}

.production-order-artwork-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.production-order-content-note {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 7px;
  padding: 9px 12px;
  border-top: 1px solid #9f1f2e;
  color: #fff;
  background: var(--danger);
  font-size: 12px;
  line-height: 1.5;
}

.production-order-content-note > span:first-child {
  font-weight: 800;
  white-space: nowrap;
}

.production-order-content-note-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.production-order-note-edit {
  min-height: 34px;
  padding: 6px 10px;
  align-self: center;
  white-space: nowrap;
}

.production-note-dialog {
  width: min(94vw, 620px);
}

.production-note-form textarea {
  min-height: 120px;
}

.production-note-form textarea[name="reason"] {
  min-height: 82px;
}

.production-preview-dialog {
  width: min(94vw, 1120px);
  max-width: none;
  max-height: 94vh;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
}

.production-preview-dialog::backdrop {
  background: rgb(8 18 34 / 82%);
  backdrop-filter: blur(3px);
}

.production-preview-dialog-card {
  position: relative;
  display: grid;
  max-height: 94vh;
  gap: 10px;
  padding: 14px;
  overflow: auto;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 80px rgb(0 0 0 / 42%);
}

.production-preview-dialog-image {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: calc(94vh - 86px);
  margin: auto;
  object-fit: contain;
}

[data-production-preview-close-image] {
  cursor: zoom-out;
}

.production-customer-original-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
  gap: 14px;
  align-items: start;
}

.production-customer-original-gallery figure {
  display: grid;
  gap: 7px;
  margin: 0;
}

.production-customer-original-gallery figcaption {
  color: #53657e;
  font-size: 12px;
  text-align: center;
}

.production-preview-dialog-close {
  position: sticky;
  z-index: 1;
  top: 0;
  justify-self: end;
  min-height: 40px;
}

@media (max-width: 679px) {
  .app-shell {
    padding-right: max(8px, env(safe-area-inset-right, 0px));
    padding-left: max(8px, env(safe-area-inset-left, 0px));
  }

  .production-batch-card {
    gap: 10px;
    padding: 9px;
  }

  .production-batch-heading {
    gap: 8px;
    align-items: stretch;
    flex-direction: column;
  }

  .production-batch-heading-actions {
    align-items: stretch;
    justify-content: space-between;
    margin-left: 0;
  }

  .production-batch-heading > .production-shipping-filters {
    width: 100%;
  }

  .production-batch-heading > .production-shipping-filters button {
    min-width: 0;
    flex: 1 1 0;
  }

  .production-batch-heading-actions .field-help {
    align-self: center;
  }

  .production-artwork-summary-button {
    flex: 1 1 180px;
  }

  .stats-grid.production-stats {
    max-width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-flow: row;
    gap: 6px;
    padding-bottom: 0;
    overflow: visible;
  }

  .production-stats .stat-card {
    min-height: 70px;
    padding: 8px;
  }

  .production-stats .stat-card small {
    font-size: 10px;
    line-height: 1.25;
  }

  .production-stats .stat-card strong {
    font-size: 23px;
  }

  .production-order-summary-panel,
  .production-grouped-summary {
    gap: 9px;
    padding: 10px;
  }

  .production-summary-section-heading {
    gap: 6px;
    align-items: flex-start;
  }

  .production-summary-section-heading small {
    font-size: 11px;
  }

  .production-order-chips {
    display: flex;
    gap: 6px;
    align-items: center;
  }

  .production-order-chip {
    width: auto;
    min-height: 34px;
    padding: 6px 8px;
    font-size: 11px;
  }

  .production-order-chip .order-chip-number {
    font-size: 11px;
  }

  .production-model-strip {
    max-width: 100%;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 100%;
    gap: 8px;
    padding: 1px 2px 9px 0;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline mandatory;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .production-model-strip .production-summary-group {
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .production-summary-row-label {
    white-space: nowrap;
  }

  .production-model-pagination {
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 4px 2px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .production-model-pagination::-webkit-scrollbar {
    display: none;
  }

  .production-model-pagination button {
    min-width: 46px;
    min-height: 30px;
    flex: 0 0 auto;
    padding: 5px 9px;
    border: 1px solid #cad6e6;
    border-radius: 999px;
    color: #607086;
    background: #f4f7fb;
    font-size: 11px;
    font-weight: 700;
    transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
  }

  .production-model-pagination button.active {
    border-color: #75a2f4;
    color: #0d4dae;
    background: #eaf2ff;
    font-size: 13px;
    font-weight: 850;
    transform: scale(1.06);
  }

  .production-order-details {
    column-count: 1;
    column-width: auto;
  }

  .production-order-detail {
    padding: 10px;
  }

  .production-artwork-dialog-body .production-custom-waterfall {
    display: block;
    -webkit-column-count: 2;
    column-count: 2;
    column-width: auto;
    column-gap: 8px;
  }

  .production-custom-summary-card {
    margin-bottom: 8px;
    border-radius: 10px;
  }

  .production-custom-summary-card:hover {
    transform: none;
  }

  .production-custom-summary-caption {
    gap: 3px;
    padding: 8px;
  }

  .production-custom-summary-caption strong {
    font-size: 14px;
  }

  .production-custom-summary-caption span {
    font-size: 12px;
  }

  .production-custom-summary-card.is-preview-load-error::before,
  .production-custom-preview-trigger.is-preview-load-error::before {
    display: grid;
    width: 100%;
    aspect-ratio: 3 / 4;
    place-items: center;
    padding: 12px;
    color: #8f2533;
    background: #fff2f3;
    content: "设计稿图片加载失败\A请刷新后重试";
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
    white-space: pre-line;
  }

  .production-custom-summary-card.is-preview-load-error .production-custom-summary-image,
  .production-custom-preview-trigger.is-preview-load-error .production-custom-preview-image {
    display: none;
  }

  .production-custom-card {
    margin-bottom: 10px;
  }

  .production-custom-card:hover {
    transform: none;
  }

  .production-custom-card-body {
    padding: 10px;
  }

  .production-custom-detail-card .production-custom-preview-image {
    max-height: 48vh;
  }

  .production-custom-order-number {
    font-size: 16px;
  }

  .production-custom-card-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .production-artwork-dialog {
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
    border-radius: 12px;
  }

  .production-artwork-dialog-card {
    border-radius: 12px;
  }

  .production-artwork-dialog-heading {
    gap: 10px;
    padding: 10px;
    align-items: flex-start;
  }

  .production-artwork-dialog-copy h2 {
    font-size: 17px;
  }

  .production-artwork-dialog-copy p {
    font-size: 11px;
  }

  .production-artwork-dialog-close {
    min-width: 64px;
    min-height: 44px;
  }

  .production-artwork-dialog-body {
    padding: 9px;
    scrollbar-gutter: auto;
  }

  .production-order-contents {
    margin-top: 14px;
    padding-top: 14px;
  }

  .production-order-contents-heading {
    gap: 4px;
    align-items: flex-start;
    flex-direction: column;
  }

  .production-shipping-filters {
    gap: 6px;
  }

  .production-shipping-filters button {
    min-height: 40px;
    flex: 1 1 88px;
  }

  .production-shipping-action-bar {
    gap: 8px;
    align-items: stretch;
    flex-direction: column;
    padding: 9px;
  }

  .production-shipping-selection-summary {
    justify-content: space-between;
  }

  .production-shipping-action-bar .button-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .production-shipping-action-bar button,
  .production-shipping-choice {
    min-height: 44px;
  }

  .production-order-content-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .production-order-content-card {
    display: block;
  }

  .production-order-content-card-header {
    padding: 10px;
  }

  .production-order-content-header-main {
    gap: 9px;
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .production-order-content-heading-copy {
    flex: 1 1 230px;
  }

  .production-order-content-title-line {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    gap: 7px;
    align-items: flex-start;
  }

  .production-order-content-title-line > strong {
    grid-column: 1;
    grid-row: 1;
  }

  .production-order-content-title-line > .production-order-content-badges {
    grid-column: 2;
    grid-row: 1;
    justify-self: start;
  }

  .production-order-content-title-line > .production-order-header-artwork-previews {
    grid-column: 3;
    grid-row: 1;
  }

  .production-order-content-title-line > .production-shipping-choice {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: start;
  }

  .production-order-content-primary-titles {
    display: grid;
    width: 100%;
    grid-column: 1 / -1;
    grid-row: 2;
    gap: 2px;
  }

  .production-order-content-header-main > .production-order-note-edit,
  .production-order-content-title-line > .production-order-note-edit {
    width: auto;
    margin-left: auto;
  }

  .production-order-content-title-line > .production-order-note-edit {
    grid-column: 4;
    grid-row: 1;
    align-self: start;
    justify-self: end;
    min-height: 28px;
    padding: 4px 7px;
    font-size: 11px;
    line-height: 1.2;
  }

  .production-order-header-artwork-previews {
    gap: 4px;
  }

  .production-order-header-artwork-thumbnail {
    width: 38px;
    height: 48px;
  }

  .production-order-content-actions {
    width: 100%;
    justify-content: space-between;
  }

  .production-order-artwork-button {
    flex: 1 1 auto;
  }

  .production-order-content-items {
    grid-template-columns: minmax(0, 1fr);
    padding: 0 10px;
  }

  .production-order-content-note {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .production-order-content-note > .production-order-note-edit {
    width: 100%;
    grid-column: 1 / -1;
  }

  .production-order-content-item {
    padding: 0;
  }

  .production-order-content-item-main {
    gap: 7px;
    padding: 9px 10px;
  }

  .production-order-content-product-image {
    width: 42px;
    height: 42px;
  }

  .production-order-content-item-main:has(.production-order-content-product-image) {
    grid-template-columns: 42px auto minmax(0, 1fr) auto;
  }

  .production-order-custom-fields {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    padding: 8px 10px 10px;
  }

  .production-order-custom-fields > div {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 6px;
  }

  .production-order-artwork-thumbnail {
    width: 58px;
    height: 58px;
  }

  .production-order-item-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .production-preview-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .production-preview-dialog-card {
    max-height: calc(100vh - 16px);
    padding: 9px;
    border-radius: 12px;
  }

  .production-preview-dialog-image {
    max-height: calc(100vh - 78px);
  }
}

@page {
  size: A4 portrait;
  margin: 10mm;
}

@page production-summary {
  size: A4 landscape;
  margin: 10mm;
}

@page production-cards {
  size: A4 portrait;
  margin: 10mm;
}

@page production-orders {
  size: A4 portrait;
  margin: 10mm;
}

.piecework-toolbar,
.piecework-panel,
.piecework-content {
  min-width: 0;
}

.piecework-toolbar {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.piecework-toolbar .filter-row {
  margin: 0;
}

.piecework-toolbar .piecework-filter-form {
  grid-template-columns: minmax(210px, 0.8fr) minmax(210px, 0.8fr) minmax(220px, 1fr) auto;
  width: 100%;
  min-width: 0;
  align-items: end;
}

.piecework-filter-form > *,
.piecework-filter-form .field,
.piecework-filter-form select,
.piecework-filter-form input {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.piecework-filter-form .field + .field,
.piecework-form-grid .field + .field,
.piecework-inline-damage-form .field + .field {
  margin-top: 0;
}

.piecework-filter-scope {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.piecework-filter-scope legend {
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.piecework-scope-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f2f5f9;
}

.piecework-scope-toggle button {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 7px 9px;
  box-shadow: none;
}

.piecework-scope-toggle button.active {
  border-color: #b7cdf7;
  color: var(--brand);
  background: #fff;
  box-shadow: 0 3px 9px rgb(34 83 151 / 10%);
}

.earnings-filter-form {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  width: min(100%, 620px);
  max-width: 620px;
  min-width: 0;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
  overflow: hidden;
  box-sizing: border-box;
}

.earnings-filter-form .field,
.earnings-filter-form input,
.earnings-filter-scope {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.earnings-filter-form .field {
  display: grid;
  overflow: hidden;
}

.earnings-filter-form input[type="month"],
.earnings-filter-form input[type="date"] {
  display: block;
  min-inline-size: 0 !important;
  inline-size: 100% !important;
  max-inline-size: 100% !important;
  -webkit-min-logical-width: 0;
}

.earnings-picker-shell {
  position: relative;
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  box-sizing: border-box;
}

.earnings-picker-shell:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.earnings-picker-shell > span {
  padding: 10px 14px;
  font-weight: 650;
  pointer-events: none;
}

.earnings-picker-shell > input[type="month"],
.earnings-picker-shell > input[type="date"] {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100%;
  min-width: 0 !important;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.earnings-picker-shell > input:focus-visible {
  outline: 0;
}

.earnings-filter-scope {
  padding: 0;
  border: 0;
  margin: 0;
}

.earnings-filter-scope legend {
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.earnings-scope-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f2f5f9;
}

.earnings-scope-toggle button {
  width: 100%;
  min-height: 40px;
  padding: 7px 10px;
  box-shadow: none;
}

.earnings-scope-toggle button.active {
  border-color: #b7cdf7;
  color: var(--brand);
  background: #fff;
  box-shadow: 0 3px 9px rgb(34 83 151 / 10%);
}

.earnings-detail-table td:nth-child(3) {
  white-space: normal;
  overflow-wrap: anywhere;
}

.earnings-statistics {
  display: grid;
  gap: 12px;
}

.earnings-statistics-day {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.earnings-statistics-day > header,
.earnings-statistics-subtotal,
.earnings-statistics-total {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.earnings-statistics-day > header {
  padding: 11px 13px;
  color: #38506f;
  background: #f3f7fc;
}

.earnings-statistics-day > header span,
.earnings-statistics-subtotal span,
.earnings-statistics-total span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.earnings-statistics-day ol {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0 12px;
  list-style: none;
}

.earnings-statistics-day li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 11px 0 11px 2px;
}

.earnings-statistics-day li + li {
  border-top: 1px dashed var(--line);
}

.earnings-statistics-index,
.piecework-personal-index {
  color: var(--brand);
  font-weight: 850;
}

.earnings-statistics-label {
  display: grid;
  gap: 3px;
}

.earnings-statistics-day li span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.earnings-statistics-values {
  display: flex;
  gap: 12px;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 0;
}

.earnings-statistics-values strong,
.earnings-statistics-subtotal strong,
.earnings-statistics-total strong {
  color: #08795c;
}

.earnings-statistics-subtotal {
  padding: 10px 13px;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
}

.earnings-statistics-total {
  padding: 13px 14px;
  border: 1px solid #b9d9cd;
  border-radius: 13px;
  background: #eef9f5;
}

.earnings-statistics-total strong {
  font-size: 22px;
}

.piecework-tabs,
.admin-config-tabs {
  display: flex;
  max-width: 100%;
  gap: 8px;
  padding: 4px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f2f5f9;
  scrollbar-width: thin;
}

.piecework-tabs button,
.admin-config-tabs button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 14px;
  box-shadow: none;
}

.piecework-tabs button.active,
.admin-config-tabs button.active {
  border-color: #b7cdf7;
  color: var(--brand);
  background: #fff;
  box-shadow: 0 3px 9px rgb(34 83 151 / 10%);
}

.piecework-content,
.piecework-panel,
.worklog-list {
  display: grid;
  gap: 12px;
}

.piecework-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.piecework-span-full {
  grid-column: 1 / -1;
}

.piecework-rate-preview {
  display: flex;
  min-height: 46px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #cbd9ec;
  border-radius: 10px;
  color: #315479;
  background: #f2f7ff;
  font-size: 13px;
  font-weight: 750;
}

.worklog-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.worklog-card-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #f5f8fb;
}

.worklog-card-header > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.worklog-card-header small,
.worklog-table td small {
  display: block;
  color: var(--muted);
}

.worklog-card-body {
  display: grid;
  gap: 12px;
  padding: 13px 14px;
}

.worklog-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.worklog-facts > div {
  min-width: 0;
  padding: 8px 10px;
  border-radius: 9px;
  background: #f7f9fc;
}

.worklog-facts dt {
  color: var(--muted);
  font-size: 11px;
}

.worklog-facts dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  font-weight: 750;
}

.worklog-review-actions {
  justify-content: flex-end;
}

.piecework-content .worklog-list {
  grid-template-columns: 1fr;
}

.piecework-personal-batches {
  display: grid;
  gap: 12px;
}

.piecework-personal-batch {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.piecework-personal-batch > header,
.piecework-personal-batch > footer {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 13px;
  background: #f3f7fc;
}

.piecework-personal-batch > header > div {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.piecework-personal-batch > header span,
.piecework-personal-batch > footer span,
.piecework-personal-batch li span,
.piecework-personal-batch li small {
  color: var(--muted);
  font-size: 12px;
}

.piecework-personal-batch > ol {
  display: grid;
  margin: 0;
  padding: 0 12px;
  list-style: none;
}

.piecework-personal-batch li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 9px 2px;
}

.piecework-personal-batch li + li {
  border-top: 1px dashed var(--line);
}

.piecework-personal-batch li > div:not(.piecework-personal-values) {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.piecework-personal-batch li strong,
.piecework-personal-batch li span,
.piecework-personal-batch li small {
  overflow-wrap: anywhere;
}

.piecework-personal-values {
  display: grid;
  gap: 3px;
  justify-items: end;
}

.piecework-personal-batch > footer {
  border-top: 1px solid var(--line);
  background: #fbfcfe;
}

.rejected-piecework-section,
.rejected-piecework-panel,
.piecework-resubmission-lines {
  display: grid;
  gap: 12px;
}

.rejected-piecework-alert {
  display: flex;
  width: 100%;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: #8e1c2b;
  text-align: left;
  box-shadow: none;
}

.rejected-piecework-alert > span:first-child {
  display: grid;
  gap: 3px;
}

.rejected-piecework-alert small {
  color: #a53643;
  font-weight: 650;
}

.rejected-piecework-panel[hidden] {
  display: none;
}

.piecework-resubmission-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 180px);
  gap: 8px 14px;
  align-items: end;
  padding: 11px 12px;
  border: 1px solid #efc5ca;
  border-radius: 10px;
  background: #fff8f9;
}

.piecework-resubmission-line > div,
.piecework-resubmission-line > label {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.piecework-resubmission-line small {
  color: var(--muted);
}

.piecework-resubmission-line label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.piecework-resubmission-line input {
  min-width: 0;
}

.piecework-resubmission-line p {
  grid-column: 1 / -1;
  margin: 0;
  color: #9b2634;
  overflow-wrap: anywhere;
}

.piecework-correction-label {
  width: fit-content;
  margin: -3px 0 8px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #315479;
  background: #eaf2ff;
  font-size: 11px;
  font-weight: 750;
}

.piecework-submission-lines {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.piecework-submission-summary {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.piecework-submission-status {
  justify-items: end;
  text-align: right;
}

.piecework-submission-amount-total {
  display: grid;
  gap: 2px;
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.4;
}

.piecework-submission-amount-total strong {
  color: #163f70;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.piecework-review-table {
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.piecework-review-head,
.piecework-review-row {
  display: grid;
  grid-template-columns: minmax(90px, 1.05fr) minmax(92px, .8fr) minmax(120px, 1.2fr) minmax(80px, .8fr) minmax(96px, 1fr) minmax(54px, .5fr) minmax(82px, .7fr) minmax(120px, 1.15fr);
  min-width: 920px;
}

@media (min-width: 680px) {
  .piecework-review-table.is-review-queue .piecework-review-head,
  .piecework-review-table.is-review-queue .piecework-review-row {
    grid-template-columns: minmax(90px, 1fr) minmax(92px, .8fr) minmax(140px, 1.45fr) minmax(90px, .85fr) minmax(110px, 1.1fr) minmax(54px, .5fr);
    min-width: 720px;
  }

  .piecework-review-table.with-review-amounts .piecework-review-head,
  .piecework-review-table.with-review-amounts .piecework-review-row {
    grid-template-columns: minmax(80px, 1fr) minmax(92px, .8fr) minmax(120px, 1.2fr) minmax(70px, .7fr) minmax(96px, 1fr) minmax(54px, .5fr) minmax(95px, .8fr) minmax(82px, .7fr) minmax(120px, 1.15fr);
    min-width: 1010px;
  }

  .piecework-review-table.is-review-queue.with-review-amounts .piecework-review-head,
  .piecework-review-table.is-review-queue.with-review-amounts .piecework-review-row {
    grid-template-columns: minmax(90px, 1fr) minmax(92px, .8fr) minmax(140px, 1.45fr) minmax(90px, .85fr) minmax(110px, 1.1fr) minmax(54px, .5fr) minmax(95px, .8fr);
    min-width: 820px;
  }
}

.piecework-review-head {
  color: var(--muted);
  background: #f3f7fc;
  font-size: 11px;
  font-weight: 800;
}

.piecework-review-head > span,
.piecework-review-cell {
  min-width: 0;
  padding: 8px 9px;
  overflow-wrap: anywhere;
}

.piecework-review-row + .piecework-review-row {
  border-top: 1px solid var(--line);
}

.piecework-review-cell + .piecework-review-cell,
.piecework-review-head > span + span {
  border-left: 1px solid #edf1f6;
}

.piecework-review-cell {
  display: grid;
  gap: 2px;
  align-content: center;
  font-size: 13px;
}

.piecework-review-cell::before {
  display: none;
  content: attr(data-label);
}

.piecework-review-cell small {
  color: var(--muted);
  font-size: 11px;
}

.piecework-review-amount {
  color: #163f70;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

.piecework-review-process strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.piecework-review-meta {
  display: contents;
}

.piecework-submission-line-heading {
  display: flex;
  min-width: 0;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.piecework-submission-line-heading strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.piecework-submission-facts,
.piecework-count-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
}

.piecework-submission-facts.with-compensation {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.piecework-submission-facts > div,
.piecework-count-facts > div {
  min-width: 0;
  padding: 7px 8px;
  border-radius: 8px;
  background: #f7f9fc;
}

.piecework-submission-facts dt,
.piecework-count-facts dt {
  color: var(--muted);
  font-size: 11px;
}

.piecework-submission-facts dd,
.piecework-count-facts dd {
  min-width: 0;
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  font-weight: 750;
}

.piecework-batch-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  gap: 8px;
}

.piecework-batch-actions button {
  width: 100%;
  min-width: 0;
}

.piecework-inline-damage-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid #e5c16c;
  border-radius: 12px;
  background: #fff9e9;
}

.piecework-inline-damage-form[hidden] {
  display: none;
}

.piecework-inline-damage-form > *,
.piecework-inline-damage-form .field,
.piecework-inline-damage-form select,
.piecework-inline-damage-form input,
.piecework-inline-damage-form textarea {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.piecework-count-list {
  display: grid;
  gap: 9px;
}

.piecework-count-card {
  display: grid;
  min-width: 0;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.piecework-count-card > header {
  display: flex;
  min-width: 0;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.piecework-count-card > header span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.piecework-count-wide {
  grid-column: 1 / -1;
}

.damage-reason {
  padding: 10px 12px;
  border-left: 3px solid #d4a02f;
  border-radius: 7px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #fff8e8;
}

.piecework-stats-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.piecework-supervisor-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.worklog-table td,
.worklog-table th {
  vertical-align: top;
}

.admin-config-panel {
  min-width: 0;
}

.sold-products-toolbar-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.combination-model-list {
  display: grid;
  gap: 8px;
}

.combination-model-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.35fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7f9fc;
}

.combination-model-row label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 750;
}

.combination-model-row label input {
  width: 22px;
  min-height: 22px;
  margin: 0;
}

.process-pricing-dialog {
  width: min(calc(100vw - 32px), 1380px);
}

.process-pricing-basics {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(220px, 0.65fr) auto;
  gap: 12px;
  align-items: end;
}

.process-active-option {
  min-height: 46px;
}

.process-pricing-section {
  min-width: 0;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.process-pricing-matrix {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.process-pricing-matrix-head,
.process-pricing-style-row {
  display: grid;
  min-width: 1080px;
  grid-template-columns: minmax(170px, 1.25fr) repeat(6, minmax(140px, 1fr));
}

.process-pricing-matrix-head {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #36506f;
  background: #edf3f9;
}

.process-pricing-matrix-head strong {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-right: 1px solid var(--line);
  font-size: 13px;
}

.process-pricing-matrix-head strong:first-child {
  justify-content: flex-start;
}

.process-pricing-style-row + .process-pricing-style-row {
  border-top: 1px solid var(--line);
}

.process-pricing-style-name,
.process-pricing-cell {
  min-width: 0;
  padding: 9px;
  border-right: 1px solid var(--line);
}

.process-pricing-style-name {
  display: grid;
  align-content: center;
  gap: 7px;
  background: #f8fafc;
}

.process-pricing-style-name label,
.process-pricing-enable {
  display: flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.process-pricing-style-name input,
.process-pricing-enable input {
  width: 20px;
  min-height: 20px;
  margin: 0;
}

.process-pricing-cell {
  display: grid;
  align-content: center;
  gap: 7px;
}

.process-pricing-cell > small {
  color: var(--muted);
  overflow-wrap: anywhere;
  font-size: 10px;
}

.process-pricing-cell > .process-pricing-legacy-hint {
  color: #8b5b00;
  font-weight: 750;
}

.process-pricing-cell.unavailable {
  place-items: center;
  color: #9aa8ba;
  background: #fafbfc;
}

.process-pricing-cell.conflict {
  background: var(--danger-soft);
}

.process-pricing-rate {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px;
  align-items: center;
  font-weight: 800;
}

.process-pricing-rate input {
  min-width: 0;
  min-height: 38px;
  padding: 7px;
}

.process-pricing-mobile-model {
  display: none;
}

.process-settings-list,
.production-config-grid,
.damage-cost-list,
.production-route-summary,
.sku-rate-summary {
  display: grid;
  gap: 9px;
}

.process-settings-row {
  display: grid;
  grid-template-columns: 32px 34px minmax(190px, 1fr) minmax(120px, 0.35fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.process-settings-row.dragging {
  opacity: 0.45;
}

.process-settings-row.disabled {
  border-style: dashed;
  background: #f5f6f8;
}

.process-drag-handle {
  color: #8495ad;
  cursor: grab;
  font-size: 20px;
  text-align: center;
}

.process-order-number {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
  font-size: 12px;
  font-weight: 850;
}

.process-settings-main,
.process-settings-row > div:not(.button-row) {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.process-settings-main small,
.process-settings-row > div > small {
  color: var(--muted);
}

.process-settings-actions {
  flex-wrap: nowrap;
}

.production-config-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.production-config-card {
  display: grid;
  min-width: 0;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.production-route-summary {
  gap: 5px;
}

.production-route-summary > span {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 7px 9px;
  border-radius: 8px;
  background: #edf3f1;
}

.production-route-summary b {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #4b7769;
  font-size: 11px;
}

.production-route-summary small,
.sku-rate-summary small {
  color: var(--muted);
}

.sku-rate-summary {
  padding: 10px;
  border: 1px dashed #bdcce0;
  border-radius: 9px;
  background: #f7f9fc;
}

.sku-rate-summary > span {
  overflow-wrap: anywhere;
  font-size: 12px;
}

.damage-cost-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.damage-cost-row > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.damage-cost-row small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.empty-state.compact {
  min-height: 0;
  padding: 12px;
}

@media (min-width: 1024px) {
  .worklog-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 679px) {
  .earnings-statistics {
    gap: 8px;
  }

  .earnings-statistics-day > header {
    padding: 8px 10px;
  }

  .earnings-statistics-day ol {
    padding: 0 8px;
  }

  .earnings-statistics-day li {
    grid-template-columns: 20px minmax(0, 1fr) auto;
    gap: 6px 10px;
    padding: 8px 2px;
  }

  .earnings-statistics-label {
    gap: 1px;
    align-content: start;
  }

  .earnings-statistics-label strong {
    font-size: 13px;
    line-height: 1.3;
  }

  .earnings-statistics-values {
    display: grid;
    gap: 2px;
    align-content: start;
    justify-items: end;
    margin-top: 0;
  }

  .earnings-statistics-quantity,
  .earnings-statistics-amount {
    white-space: nowrap;
  }

  .earnings-statistics-subtotal {
    padding: 8px 10px;
  }

  .earnings-statistics-total {
    padding: 10px 12px;
  }

  .earnings-statistics-total strong {
    font-size: 20px;
  }

  .earnings-filter-form {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 100%;
    gap: 10px;
    padding: 12px;
    margin-inline: 0;
  }

  .earnings-detail-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .earnings-detail-table,
  .earnings-detail-table tbody {
    display: block;
    width: 100%;
  }

  .earnings-detail-table thead {
    display: none;
  }

  .earnings-detail-table tbody {
    display: grid;
    gap: 10px;
  }

  .earnings-detail-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
  }

  .earnings-detail-table td {
    display: grid;
    min-width: 0;
    gap: 2px;
    padding: 0;
    border: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .earnings-detail-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
  }

  .earnings-detail-table td:nth-child(1),
  .earnings-detail-table td:nth-child(2),
  .earnings-detail-table td:nth-child(3),
  .earnings-detail-table td:nth-child(6) {
    grid-column: 1 / -1;
  }

  .earnings-detail-table td:nth-child(6) {
    padding-top: 7px;
    border-top: 1px dashed var(--line);
    font-size: 18px;
    font-weight: 850;
  }

  .piecework-toolbar {
    gap: 9px;
    padding: 10px;
  }

  .piecework-toolbar .filter-row,
  .piecework-form-grid {
    grid-template-columns: 1fr;
  }

  .piecework-toolbar .piecework-filter-form {
    grid-template-columns: 1fr;
    width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .piecework-filter-form > *,
  .piecework-filter-form .field,
  .piecework-filter-form select,
  .piecework-filter-form input,
  .piecework-form-grid > *,
  .piecework-form-grid .field,
  .piecework-form-grid select,
  .piecework-form-grid input,
  .piecework-form-grid textarea {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .piecework-toolbar .filter-row > *,
  .piecework-form-grid > button,
  .worklog-review-actions button {
    width: 100%;
  }

  .piecework-tabs,
  .admin-config-tabs {
    margin-inline: -2px;
  }

  .piecework-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .piecework-tabs button,
  .admin-config-tabs button {
    min-height: 38px;
    padding: 7px 11px;
    font-size: 13px;
  }

  .piecework-tabs button {
    width: 100%;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .piecework-panel .card-body,
  .worklog-card-body {
    padding: 10px;
  }

  .piecework-record-card .worklog-card-body,
  .piecework-submission-card .worklog-card-body {
    padding: 8px 10px;
    gap: 8px;
  }

  .worklog-card-header {
    padding: 10px;
  }

  .piecework-record-card .worklog-card-header,
  .piecework-submission-card .worklog-card-header {
    align-items: center;
    padding: 8px 10px;
  }

  .worklog-card-header > .worklog-card-identity {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: nowrap;
    gap: 2px 8px;
    align-items: baseline;
  }

  .worklog-card-identity strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .worklog-card-identity small {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .has-review-amounts .worklog-card-header {
    align-items: flex-start;
    gap: 8px;
  }

  .has-review-amounts .worklog-card-header > .worklog-card-identity {
    display: grid;
    gap: 2px;
  }

  .has-review-amounts .worklog-card-identity small {
    white-space: normal;
  }

  .has-review-amounts .piecework-submission-status {
    flex: 0 1 auto;
    max-width: 58%;
  }

  .piecework-submission-amount-total small {
    font-size: 10px;
  }

  .worklog-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .worklog-facts > div {
    padding: 7px;
  }

  .piecework-record-card .worklog-facts > div {
    padding: 5px 7px;
  }

  .piecework-record-card .worklog-facts dd {
    margin-top: 1px;
  }

  .piecework-record-process dd,
  .piecework-submission-line-heading strong {
    font-size: 13px;
    line-height: 1.3;
  }

  .damage-record-card .worklog-facts > div:nth-child(1),
  .damage-record-card .worklog-facts > div:nth-child(2),
  .damage-record-card .worklog-facts > div:nth-child(3) {
    grid-column: 1 / -1;
  }

  .damage-record-card .worklog-facts > div:last-child {
    grid-column: 1 / -1;
  }

  .piecework-review-table {
    overflow: visible;
    border: 0;
  }

  .piecework-review-head {
    display: none;
  }

  .piecework-review-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
  }

  .piecework-review-row + .piecework-review-row {
    margin-top: 8px;
    border-top: 1px solid var(--line);
  }

  .piecework-review-employee,
  .piecework-review-date {
    display: none;
  }

  .piecework-review-cell {
    min-height: 50px;
    padding: 7px 8px;
    border: 0;
  }

  .piecework-review-cell::before {
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
  }

  .piecework-review-process::before {
    display: none;
  }

  .piecework-review-process,
  .piecework-review-style {
    border-right: 1px solid var(--line);
  }

  .piecework-review-process,
  .piecework-review-model {
    border-bottom: 1px solid var(--line);
  }

  .piecework-review-meta {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(88px, auto) minmax(0, 1fr);
    border-top: 1px solid var(--line);
    background: #f8fafc;
  }

  .piecework-review-meta .piecework-review-cell {
    min-height: 0;
  }

  .piecework-review-meta .piecework-review-cell + .piecework-review-cell {
    border-left: 1px solid var(--line);
  }

  .piecework-review-amount {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 0;
    border-top: 1px solid var(--line);
    background: #f3f7fc;
  }

  .piecework-review-amount small {
    grid-column: 2;
    text-align: right;
  }

  .piecework-personal-batch > header,
  .piecework-personal-batch > footer {
    padding: 8px 10px;
  }

  .piecework-personal-batch > ol {
    padding: 0 8px;
  }

  .piecework-personal-batch li {
    grid-template-columns: 20px minmax(0, 1fr) auto;
    gap: 6px 8px;
    padding: 8px 2px;
  }

  .piecework-resubmission-line {
    grid-template-columns: 1fr;
  }

  .piecework-inline-damage-form {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .piecework-inline-damage-form > button {
    width: 100%;
  }

  .piecework-count-detail .piecework-count-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .piecework-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .piecework-supervisor-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .piecework-stats-grid .stat-card {
    min-height: 72px;
    padding: 9px;
  }

  .piecework-stats-grid .stat-card strong {
    font-size: 21px;
  }

  .process-settings-row {
    grid-template-columns: 28px 30px minmax(0, 1fr) auto;
    gap: 7px;
    padding: 9px;
  }

  .process-settings-row > div:not(.process-settings-main):not(.button-row) {
    grid-column: 3;
  }

  .process-settings-row > .status {
    grid-column: 4;
    grid-row: 1;
  }

  .process-settings-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .process-settings-actions button {
    flex: 1 1 0;
  }

  .sold-products-toolbar-actions,
  .sold-products-toolbar-actions button {
    width: 100%;
  }

  .sold-products-toolbar-actions button {
    flex: 1 1 0;
  }

  .combination-model-row,
  .process-pricing-basics {
    grid-template-columns: 1fr;
  }

  .process-pricing-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }

  .process-pricing-form .card-body {
    padding: 10px;
  }

  .process-pricing-matrix {
    display: grid;
    gap: 9px;
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .process-pricing-matrix-head {
    display: none;
  }

  .process-pricing-style-row {
    display: grid;
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
  }

  .process-pricing-style-row + .process-pricing-style-row {
    border-top: 1px solid var(--line);
  }

  .process-pricing-style-name {
    grid-column: 1 / -1;
    padding: 2px 2px 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
  }

  .process-pricing-cell {
    min-height: 116px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 9px;
  }

  .process-pricing-cell.unavailable {
    min-height: 84px;
  }

  .process-pricing-mobile-model {
    display: inline;
    color: var(--text);
  }

  .process-pricing-enable {
    justify-content: space-between;
  }

  .process-pricing-rate input {
    width: 100%;
  }

  .production-config-grid {
    grid-template-columns: 1fr;
  }

  .production-config-card .style-config-heading {
    gap: 8px;
  }

  .production-config-card .button-row,
  .production-config-card .button-row button {
    width: 100%;
  }

  .damage-cost-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .damage-cost-row button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

.compensation-dialog {
  width: min(96vw, 1120px);
  max-width: none;
}

.compensation-editor {
  max-height: min(92vh, 900px);
}

.compensation-month-form {
  grid-template-columns: minmax(220px, 1fr) auto;
}

.compensation-allowance-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.25fr) minmax(130px, 0.75fr) minmax(145px, 0.8fr) minmax(145px, 0.8fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
}

.compensation-allowance-row .check-option {
  min-height: 48px;
  align-self: end;
}

.compensation-allowance-row .button-row,
.compensation-allowance-row > button {
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.compensation-allowance-row.new {
  border-style: dashed;
  background: #f4f8ff;
}

.staff-user-actions {
  flex-wrap: wrap;
}

.personnel-cost-panel,
.payroll-settlement-panel {
  margin-bottom: 16px;
}

.personnel-cost-filter {
  display: grid;
  grid-template-columns: minmax(150px, 0.5fr) minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.personnel-cost-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.personnel-cost-total {
  grid-column: span 2;
  color: #fff;
  background: var(--brand-dark);
}

.personnel-cost-total small,
.personnel-cost-total strong {
  color: inherit;
}

.personnel-cost-table table {
  min-width: 1260px;
}

.personnel-cost-table td:first-child strong,
.personnel-cost-table td:first-child small {
  display: block;
}

.personnel-cost-table td:first-child small {
  margin-top: 3px;
  color: var(--muted);
  white-space: nowrap;
}

.deduction {
  color: var(--danger);
}

.personnel-cost-cards {
  display: none;
}

.personnel-cost-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.personnel-cost-card-heading {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 11px 12px;
  background: #eaf1ef;
}

.personnel-cost-card-heading strong,
.personnel-cost-card-heading small {
  display: block;
}

.personnel-cost-card-heading small {
  margin-top: 2px;
  color: var(--muted);
}

.personnel-cost-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.personnel-cost-card dl > div {
  min-width: 0;
  padding: 9px 11px;
  border-top: 1px solid var(--line);
}

.personnel-cost-card dt {
  color: var(--muted);
  font-size: 12px;
}

.personnel-cost-card dd {
  margin: 3px 0 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.personnel-cost-card .personnel-cost-card-total {
  grid-column: 1 / -1;
  color: #fff;
  background: var(--brand-dark);
}

.personnel-cost-card-total dt {
  color: rgb(255 255 255 / 75%);
}

@media (max-width: 679px) {
  .compensation-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }

  .compensation-editor {
    max-height: calc(100dvh - 16px);
  }

  .compensation-editor .card-body {
    padding: 11px;
  }

  .compensation-month-form,
  .compensation-plan-form .grid-2,
  .compensation-allowance-row,
  .personnel-cost-filter {
    grid-template-columns: 1fr;
  }

  .compensation-month-form button,
  .compensation-plan-form > button,
  .compensation-allowance-row > button,
  .personnel-cost-filter > button {
    width: 100%;
  }

  .compensation-allowance-row .button-row {
    justify-content: stretch;
  }

  .compensation-allowance-row .button-row button {
    flex: 1 1 0;
  }

  .personnel-cost-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .personnel-cost-stats .stat-card {
    min-height: 78px;
    padding: 9px;
  }

  .personnel-cost-stats .stat-card strong {
    font-size: 20px;
  }

  .personnel-cost-stats .personnel-cost-total {
    grid-column: 1 / -1;
  }

  .personnel-cost-table {
    display: none;
  }

  .personnel-cost-cards {
    display: grid;
    gap: 10px;
  }

  .payroll-settlement-panel,
  .personnel-cost-panel {
    padding: 11px;
  }
}

@media print {
  .production-artwork-dialog {
    display: none !important;
  }

  html,
  body {
    min-width: 0;
    min-height: 0;
    color: #000;
    background: #fff;
  }

  body > :not(#app):not(.pricing-matrix-dialog),
  #app > :not(.production-print-sheet):not(.pricing-matrix-dialog) {
    display: none !important;
  }

  #app.app-shell {
    display: block;
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    background: #fff !important;
  }

  .production-print-sheet {
    display: block !important;
    color: #000;
    background: #fff;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    font-size: 9pt;
    line-height: 1.35;
  }

  .production-print-summary-page {
    page: production-summary;
    break-after: page;
  }

  .production-print-card-pages,
  .production-print-card-page {
    page: production-cards;
  }

  .production-print-detail-flow {
    display: block;
    min-height: 0;
    color: #000;
    background: #fff !important;
    font-size: 0;
  }

  .production-print-order-pages,
  .production-print-order-page {
    page: production-cards;
  }

  .production-print-header {
    display: flex;
    gap: 12mm;
    align-items: flex-start;
    justify-content: space-between;
    padding-bottom: 2.5mm;
    border-bottom: 1.2pt solid #111;
  }

  .production-print-header h1,
  .production-print-header small,
  .production-print-header dl,
  .production-print-header dd {
    margin: 0;
  }

  .production-print-header h1 {
    margin-top: 0.6mm;
    font-size: 15pt;
  }

  .production-print-brand {
    align-self: flex-start;
    padding-top: 0.5mm;
    font-size: 9pt;
    white-space: nowrap;
  }

  .production-print-header dl {
    display: grid;
    min-width: 58mm;
    gap: 1.5mm;
  }

  .production-print-header dl div {
    display: grid;
    grid-template-columns: 18mm minmax(0, 1fr);
    gap: 2mm;
  }

  .production-print-header dt {
    color: #444;
  }

  .production-print-header dd {
    overflow-wrap: anywhere;
    font-weight: 700;
  }

  .production-print-order-register {
    margin-top: 2.5mm;
    padding: 2mm 2.5mm;
    border: 0.6pt solid #666;
    break-inside: avoid;
  }

  .production-print-order-register p {
    margin: 0.8mm 0 0;
    font-size: 8pt;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }

  .production-print-overview {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin: 2.5mm 0;
    border: 0.6pt solid #555;
    break-inside: avoid;
  }

  .production-print-overview div {
    padding: 1.5mm 2mm;
    border-right: 0.6pt solid #777;
  }

  .production-print-overview div:last-child {
    border-right: 0;
  }

  .production-print-overview small,
  .production-print-overview strong {
    display: block;
  }

  .production-print-overview strong {
    margin-top: 0.5mm;
    font-size: 12pt;
  }

  .production-print-classification {
    display: grid;
    gap: 1.5mm;
    margin: 4mm 0;
    padding: 3mm;
    border: 0.6pt solid #666;
    break-inside: avoid;
  }

  .production-print-classification > div {
    display: grid;
    grid-template-columns: 22mm minmax(0, 1fr);
    gap: 2mm;
  }

  .production-print-classification p {
    margin: 0;
    overflow-wrap: anywhere;
  }

  .production-print-model-summary {
    margin: 2.5mm 0 0;
    break-inside: avoid;
  }

  .production-print-model-summary > h2 {
    margin: 0 0 1.2mm;
    font-size: 10pt;
  }

  .production-print-model-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1mm;
    align-items: start;
  }

  .production-print-model-group {
    min-width: 0;
    padding: 1.2mm;
    border: 0.6pt solid #8d9d97;
    border-radius: 1.8mm;
    background: #fff !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .production-print-model-group.support {
    border-color: #9aa8bd;
    background: #fff !important;
  }

  .production-print-model-group-heading {
    display: flex;
    gap: 1mm;
    align-items: baseline;
    justify-content: space-between;
    padding-bottom: 0.7mm;
    border-bottom: 0.5pt solid #aebbb6;
  }

  .production-print-model-group-heading strong {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 8pt;
  }

  .production-print-model-group-heading span {
    flex: 0 0 auto;
    color: #704b00;
    font-size: 7.2pt;
    font-weight: 800;
    white-space: nowrap;
  }

  .production-print-model-group > small {
    display: block;
    margin-top: 0.5mm;
    color: #555;
    font-size: 6.4pt;
  }

  .production-print-model-rows {
    display: grid;
    gap: 0.45mm;
    margin: 0.7mm 0 0;
    padding: 0;
    list-style: none;
  }

  .production-print-model-row {
    display: flex;
    min-width: 0;
    gap: 0.6mm;
    align-items: flex-start;
    justify-content: space-between;
    padding: 0.45mm 0.65mm;
    border: 0.45pt solid #c6d1cd;
    border-radius: 1mm;
    background: #fff !important;
    font-size: 6.65pt;
    line-height: 1.12;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .production-print-model-group.support .production-print-model-row {
    border-color: #cbd3df;
    background: #fff !important;
  }

  .production-print-model-row > span:first-child {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .production-print-model-row-meta {
    display: inline-flex;
    flex: 0 0 auto;
    gap: 0.6mm;
    align-items: center;
    white-space: nowrap;
  }

  .production-print-model-row .production-print-urgent {
    padding: 0.1mm 0.45mm;
    font-size: 6.1pt;
    line-height: 1.15;
  }

  .production-print-classification-warning {
    margin: 2mm 0 0;
    padding: 1.8mm 2.2mm;
    border: 0.6pt solid #9a6500;
    background: #fff8e6 !important;
    font-size: 7.5pt;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .production-print-section {
    margin-top: 4mm;
  }

  .production-print-section h2 {
    margin: 0 0 2mm;
    break-after: avoid;
    font-size: 11pt;
  }

  .production-print-custom-waterfall {
    column-count: 2;
    column-gap: 4mm;
  }

  .production-print-custom-card {
    display: inline-block;
    width: 100%;
    margin: 0 0 4mm;
    border: 0.7pt solid #555;
    break-inside: avoid;
    background: #fff;
  }

  .production-print-custom-card > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2.5mm 3mm;
    border-bottom: 0.6pt solid #777;
    background: #f0f0f0 !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .production-print-custom-card > header small,
  .production-print-custom-card > header strong {
    display: block;
  }

  .production-print-custom-card > header strong {
    margin-top: 0.5mm;
    font-size: 13pt;
  }

  .production-print-urgent {
    padding: 1mm 2mm;
    border: 0.6pt solid #9d1e2e;
    color: #9d1e2e;
    font-weight: 800;
  }

  .production-print-custom-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2.5mm;
    padding: 3mm;
  }

  .production-print-custom-body.without-preview {
    grid-template-columns: 1fr;
  }

  .production-print-custom-body figure {
    margin: 0;
  }

  .production-print-custom-body img {
    display: block;
    width: 100%;
    max-height: 58mm;
    border: 0.5pt solid #999;
    object-fit: contain;
  }

  .production-print-custom-body figcaption {
    margin-top: 1mm;
    color: #555;
    text-align: center;
    font-size: 7.5pt;
  }

  .production-print-custom-body dl {
    display: grid;
    align-content: start;
    gap: 1.5mm;
    margin: 0;
  }

  .production-print-custom-body dl div {
    display: grid;
    grid-template-columns: 15mm minmax(0, 1fr);
    gap: 1.5mm;
  }

  .production-print-custom-body dt {
    color: #555;
  }

  .production-print-custom-body dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-weight: 700;
  }

  .production-print-custom-card > section {
    padding: 2.5mm 3mm;
    border-top: 0.5pt solid #aaa;
  }

  .production-print-custom-card > section p {
    margin: 1mm 0 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }

  .production-print-safe-note {
    background: #fafafa !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .production-print-card-page {
    display: block;
    min-height: 0;
    break-after: auto;
  }

  .production-print-card-page:last-child {
    break-after: auto;
  }

  .production-print-card-page-heading {
    display: flex;
    gap: 3mm;
    align-items: baseline;
    justify-content: space-between;
    margin: 0 0 2.5mm;
    padding-bottom: 2mm;
    border-bottom: 0.8pt solid #555;
    font-size: 11pt;
  }

  .production-print-card-page-heading h2 {
    margin: 0;
    font-size: 11pt;
  }

  .production-print-card-page-heading span {
    color: #555;
    font-size: 8pt;
  }

  .production-print-card-grid {
    display: block;
    min-height: 0;
    font-size: 0;
  }

  .production-print-card-grid .production-print-custom-card {
    display: inline-grid;
    width: calc(50% - 2mm);
    min-width: 0;
    min-height: 0;
    margin: 0 0 4mm;
    grid-template-rows: auto auto auto;
    align-self: start;
    overflow: visible;
    vertical-align: top;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .production-print-card-grid .production-print-custom-card:nth-child(odd) {
    margin-right: 4mm;
  }

  .production-print-custom-card-header {
    display: flex;
    min-width: 0;
    gap: 2mm;
    align-items: flex-start;
    justify-content: space-between;
    padding: 2.2mm 2.6mm;
    border-bottom: 0.6pt solid #777;
    background: #f0f0f0 !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .production-print-custom-card-header h3,
  .production-print-custom-card-header strong {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 10.5pt;
    line-height: 1.3;
  }

  .production-print-custom-figure {
    display: grid;
    min-height: 0;
    grid-template-rows: auto auto;
    gap: 1.5mm;
    margin: 0;
    padding: 2.2mm 2.6mm 1.5mm;
  }

  .production-print-custom-figure > strong {
    font-size: 8.5pt;
  }

  .production-print-custom-figure figure {
    display: grid;
    min-height: 0;
    margin: 0;
    place-items: center;
  }

  .production-print-custom-figure img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 58mm;
    border: 0.5pt solid #aaa;
    object-fit: contain;
    object-position: center;
  }

  .production-print-custom-figure .production-print-empty,
  .production-print-custom-figure .production-print-preview-placeholder,
  .production-print-custom-figure > span {
    display: grid;
    min-height: 28mm;
    place-items: center;
    padding: 2mm;
    border: 0.5pt dashed #aaa;
    color: #555;
    text-align: center;
  }

  .production-print-custom-fields {
    display: grid;
    gap: 1mm;
    margin: 0;
    padding: 1.5mm 2.6mm 2.2mm;
    border-top: 0.5pt solid #aaa;
    font-size: 8pt;
    line-height: 1.32;
  }

  .production-print-custom-fields > div {
    display: grid;
    min-width: 0;
    grid-template-columns: 12mm minmax(0, 1fr);
    gap: 1mm;
  }

  .production-print-custom-fields dt {
    font-weight: 800;
    white-space: nowrap;
  }

  .production-print-custom-fields dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
  }

  .production-print-order-pages {
    break-before: auto;
    break-after: auto;
  }

  .production-print-order-page-heading {
    display: flex;
    gap: 3mm;
    align-items: baseline;
    justify-content: space-between;
    margin: 2mm 0 2.5mm;
    padding-bottom: 2mm;
    border-bottom: 0.8pt solid #555;
    background: #fff !important;
  }

  .production-print-order-page-heading h2,
  .production-print-order-page-heading p,
  .production-print-order-page-heading span {
    margin: 0;
  }

  .production-print-order-page-heading > div,
  .production-print-order-card-header > div {
    display: grid;
    min-width: 0;
    gap: 0.5mm;
  }

  .production-print-order-page-heading h2 {
    font-size: 11pt;
  }

  .production-print-order-page-heading p,
  .production-print-order-page-heading small,
  .production-print-order-page-heading span {
    color: #555;
    font-size: 8pt;
  }

  .production-print-order-grid {
    display: block;
  }

  .production-print-order-card {
    min-width: 0;
    margin: 0 0 2.2mm;
    overflow: hidden;
    border: 0.65pt solid #666;
    break-inside: avoid;
    page-break-inside: avoid;
    background: #fff;
  }

  .production-print-order-card.is-urgent {
    border-color: #9d1e2e;
  }

  .production-print-order-card.is-custom {
    border-color: #9a6500;
  }

  .production-print-order-card-header {
    display: flex;
    min-width: 0;
    gap: 2mm;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1.8mm 2.2mm;
    border-bottom: 0.5pt solid #888;
    background: #f1f1f1 !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .production-print-order-card-header h3,
  .production-print-order-card-header strong,
  .production-print-order-card-header small {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
  }

  .production-print-order-card-header h3,
  .production-print-order-card-header strong {
    font-size: 9pt;
    line-height: 1.3;
  }

  .production-print-order-card-header small {
    color: #555;
    font-size: 7pt;
  }

  .production-print-order-card .production-order-content-title-line {
    gap: 2mm;
    line-height: 1.25;
  }

  .production-print-order-card .production-order-content-primary-titles {
    gap: 0.3mm;
    font-size: 8.5pt;
    font-weight: 800;
    line-height: 1.25;
  }

  .production-print-order-card .production-order-content-product-image {
    display: none !important;
  }

  .production-print-order-card .production-order-content-badges {
    gap: 1mm;
  }

  .production-print-order-card .production-order-content-badge {
    padding: 0.4mm 1.2mm;
    border: 0.45pt solid #999;
    color: #333;
    background: #eee !important;
    font-size: 6.5pt;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .production-print-order-card .production-order-content-badge.urgent {
    border-color: #9d1e2e;
    color: #9d1e2e;
    background: #fff0f1 !important;
  }

  .production-print-order-card .production-order-content-badge.custom {
    border-color: #9a6500;
    color: #765000;
    background: #fff6df !important;
  }

  .production-print-order-items {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0 2.2mm;
    list-style: none;
  }

  .production-print-order-item {
    display: grid;
    min-width: 0;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 0.2mm 1.3mm;
    align-items: center;
    padding: 0.9mm 0;
    border-bottom: 0.45pt dotted #aaa;
    font-size: 7.5pt;
    line-height: 1.25;
  }

  .production-print-order-item:last-child {
    border-bottom: 0;
  }

  .production-print-order-item .production-order-content-kind {
    min-width: 10mm;
    grid-column: 1;
    grid-row: 1 / span 2;
    padding: 0.3mm 0.8mm;
    border: 0.4pt solid #9aa6b5;
    border-radius: 99mm;
    color: #333;
    background: #f2f2f2 !important;
    font-size: 6.8pt;
    font-weight: 400;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .production-print-order-item .production-order-content-kind.product {
    border-color: #6f9182;
    background: #edf5f1 !important;
  }

  .production-print-order-item .production-order-content-kind.chain {
    border-color: #7c94b7;
    background: #eef3fa !important;
  }

  .production-print-order-item .production-order-content-kind.accessory {
    border-color: #9d8a67;
    background: #f7f2e9 !important;
  }

  .production-print-order-item .production-order-content-name,
  .production-print-order-item .production-order-content-sku {
    min-width: 0;
    grid-column: 2;
    overflow-wrap: anywhere;
  }

  .production-print-order-item .production-order-content-name {
    grid-row: 1;
    font-weight: 400;
  }

  .production-print-order-item .production-order-content-sku {
    grid-row: 2;
    color: #555;
    font-size: 6.5pt;
  }

  .production-print-order-item .production-order-content-quantity {
    grid-column: 3;
    grid-row: 1 / span 2;
    color: #000;
    font-weight: 850;
    white-space: nowrap;
  }

  .production-print-order-note {
    display: grid;
    grid-template-columns: 10mm minmax(0, 1fr);
    gap: 1mm;
    padding: 1.2mm 2.2mm;
    border-top: 0.5pt solid #aaa;
    font-size: 7pt;
    line-height: 1.3;
  }

  .production-print-order-note > span:first-child {
    font-weight: 800;
    white-space: nowrap;
  }

  .production-print-order-pages > footer {
    display: flex;
    gap: 3mm;
    align-items: center;
    justify-content: space-between;
    margin-top: 2mm;
    padding-top: 1.5mm;
    border-top: 0.5pt solid #888;
    color: #555;
    font-size: 7pt;
  }

  .production-print-text-reminders {
    margin: 4mm 0;
    padding: 3mm;
    border: 0.8pt solid #9a6500;
    break-inside: avoid;
    background: #fff8e6 !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .production-print-text-reminders ul {
    display: grid;
    gap: 1.5mm;
    margin: 2mm 0 0;
    padding-left: 5mm;
  }

  .production-print-text-reminders li span {
    display: block;
    margin-top: 0.5mm;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }

  .production-print-empty {
    padding: 10mm;
    border: 0.6pt dashed #888;
    text-align: center;
  }

  .production-print-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
  }

  .production-print-table thead {
    display: table-header-group;
  }

  .production-print-table tr {
    break-inside: avoid;
  }

  .production-print-table th,
  .production-print-table td {
    padding: 1.6mm 1.4mm;
    border: 0.5pt solid #777;
    overflow-wrap: anywhere;
    white-space: normal;
    word-break: break-word;
    vertical-align: top;
    text-align: left;
  }

  .production-print-table th {
    background: #eee !important;
    font-weight: 800;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .production-print-table td small {
    display: block;
    margin-top: 0.6mm;
  }

  .production-print-style-table th:nth-child(1) { width: 70%; }
  .production-print-style-table th:nth-child(2),
  .production-print-style-table th:nth-child(3) { width: 15%; }
  .production-print-order-table th:nth-child(1) { width: 10%; }
  .production-print-order-table th:nth-child(2) { width: 14%; }
  .production-print-order-table th:nth-child(3) { width: 13%; }
  .production-print-order-table th:nth-child(4) { width: 13%; }
  .production-print-order-table th:nth-child(5) { width: 5%; }
  .production-print-order-table th:nth-child(6) { width: 8%; }
  .production-print-order-table th:nth-child(7) { width: 19%; }
  .production-print-order-table th:nth-child(8) { width: 18%; }

  .print-order-number {
    font-weight: 800;
  }

  .print-number {
    text-align: center !important;
    font-weight: 800;
  }

  .print-pre-wrap {
    white-space: pre-wrap;
  }

  .production-print-sheet footer {
    margin-top: 3mm;
    padding-top: 2mm;
    border-top: 0.5pt solid #999;
    color: #444;
    text-align: right;
    font-size: 7.5pt;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== 工序与计价：常规型号 + 特殊款式 ===== */
.process-edit-grid {
  display: grid;
  gap: 13px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.process-active-option {
  grid-column: 1 / -1;
}

.process-kind-field {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.process-kind-field legend {
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.process-kind-options {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.process-kind-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.process-kind-option.is-selected,
.process-kind-option:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.process-kind-option input {
  flex: none;
  width: 18px;
  min-height: 18px;
  margin: 2px 0 0;
}

.process-kind-option span,
.process-kind-option strong,
.process-kind-option small {
  display: block;
  min-width: 0;
}

.process-kind-option strong {
  color: var(--ink);
  font-size: 15px;
}

.process-kind-option small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.4;
}

/* 出售商品的「打火机／配件」类型选择仍使用两张选择卡。 */
.process-mode-cards {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 8px;
}

.process-mode-card {
  display: grid;
  gap: 4px;
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  background: #fff;
}

.process-mode-card input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

.process-mode-card strong {
  color: #33435a;
  font-size: 15px;
}

.process-mode-card small {
  color: var(--muted);
  line-height: 1.4;
}

.process-mode-card:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.process-pricing-form,
.process-kind-pricing-pane,
.process-pricing-rule-section,
.process-style-override-section {
  min-width: 0;
}

.process-kind-pricing-pane {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8faff;
}

.process-kind-pricing-pane[hidden] {
  display: none;
}

.process-kind-pane-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.process-kind-pane-heading h3,
.process-kind-pane-heading p {
  margin: 0;
}

.process-kind-pane-heading p {
  margin-top: 3px;
}

.process-pricing-dialog .process-pricing-form {
  overflow-x: hidden;
}

.process-pricing-rule-section {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfe;
}

.process-pricing-rule-section .section-title {
  align-items: flex-start;
  margin: 0 0 12px;
}

.process-pricing-rule-section h3 {
  margin: 0;
}

.process-model-rule-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.process-model-rule-grid > * {
  min-width: 0;
}

.process-model-rule {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.process-model-rule-toggle {
  display: flex;
  min-width: 0;
  gap: 7px;
  align-items: center;
}

.process-model-rule-toggle input {
  width: 18px;
  min-width: 18px;
  min-height: 18px;
  margin: 0;
}

.process-model-rule-toggle strong {
  min-width: 0;
  color: #26374f;
  font-size: 14px;
}

.process-model-rule-toggle span {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.process-model-rule-rate {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.process-model-rule-rate input {
  min-width: 0;
  min-height: 42px;
  padding: 8px 9px;
}
.process-model-rule-rate > span {
  flex: 0 0 3em;
  white-space: nowrap;
}

.process-model-rule > small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.process-style-tag-pool {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 42px;
  align-items: center;
}

.process-style-tag {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid #b8c9e6;
  border-radius: 999px;
  color: #204b89;
  background: #f3f7ff;
  cursor: grab;
  font-size: 13px;
}

.process-style-tag:hover {
  color: #fff;
  background: var(--brand);
}

.process-style-tag.is-selected {
  border-color: #9dcdb8;
  color: #087a55;
  background: #e8f7f0;
  cursor: default;
}

.process-style-drop-zone {
  min-width: 0;
  min-height: 118px;
  margin-top: 12px;
  padding: 12px;
  border: 2px dashed #b9c9dd;
  border-radius: 13px;
  background: #fff;
  transition: border-color 120ms ease, background 120ms ease;
}

.process-style-drop-zone.is-drag-target {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.process-style-drop-hint {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.process-selected-style-list {
  display: grid;
  min-width: 0;
  gap: 12px;
}

.process-style-drop-empty {
  padding: 18px 10px;
  color: var(--muted);
  text-align: center;
}

.process-selected-style-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid #cbd8e8;
  border-radius: 12px;
  background: #fff;
}

.process-selected-style-card > header {
  display: flex;
  min-width: 0;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 11px;
}

.process-selected-style-card > header > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.process-selected-style-card > header strong,
.process-selected-style-card > header small {
  overflow-wrap: anywhere;
}

.process-selected-style-card > header small {
  color: var(--muted);
}

.process-selected-style-card.has-mixed-values {
  border-color: #dfbf7d;
}

.process-style-model-rule.is-mixed {
  border-color: #dfbf7d;
  background: #fffaf0;
}

.process-style-model-rule.is-unavailable {
  background: #f5f6f8;
  opacity: 0.72;
}

.process-save-summary:empty {
  display: none;
}

.process-mode-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.7;
}

.process-mode-badge.flat {
  color: #0b6b3a;
  background: #e3f6ea;
}

.process-mode-badge.split {
  color: #155eef;
  background: #eaf1ff;
}

.process-mode-badge.none {
  color: #a15c00;
  background: #fff4dd;
}

.process-kind-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.process-kind-badge.lighter {
  color: #175cd3;
  background: #eaf1ff;
}

.process-kind-badge.accessory {
  color: #6b3fa0;
  background: #f1eafd;
}

.process-kind-badge.both {
  color: #087443;
  background: #e7f8ef;
}

.process-settings-main .process-coverage {
  display: block;
  margin-top: 2px;
}

@media (max-width: 640px) {
  .process-edit-grid {
    grid-template-columns: 1fr;
  }
  .process-kind-options {
    grid-template-columns: 1fr;
  }
  .process-mode-cards {
    grid-template-columns: 1fr;
  }
  .process-model-rule-grid {
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .process-pricing-rule-section {
    padding: 10px;
  }
  .process-selected-style-card {
    padding: 9px;
  }
  .process-selected-style-card > header {
    align-items: flex-start;
  }
  .process-remove-style {
    min-height: 34px !important;
    padding: 6px 8px !important;
    flex: 0 0 auto;
    font-size: 12px !important;
  }
  .process-model-rule {
    padding: 9px;
  }
  .process-model-rule-toggle {
    gap: 5px;
  }
  .process-model-rule-toggle strong {
    font-size: 13px;
  }
  .process-model-rule-toggle span {
    font-size: 10px;
  }
  .process-model-rule-rate input {
    padding-inline: 7px;
    font-size: 13px;
  }
}

/* ===== 出售商品：款式聚合 + 型号小标签 ===== */
.process-model-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}

.process-model-tag {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.7;
  color: #155eef;
  background: #eaf1ff;
}

.process-model-tag.archived {
  color: var(--muted);
  background: #f1f3f7;
  text-decoration: line-through;
}

.style-config-heading > div {
  min-width: 0;
}

/* ===== 管理尺寸弹窗 ===== */
.process-model-manage-list {
  display: grid;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
}

.process-model-manage-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #fff;
}

.process-model-manage-row.archived strong {
  color: var(--muted);
  text-decoration: line-through;
}

.process-model-manage-row .status {
  margin-left: auto;
}

/* ===== 出售商品：打火机 / 配件 分组 ===== */
.sold-products-section + .sold-products-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}

.sold-products-section-title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 800;
  color: var(--brand-dark);
  letter-spacing: 0.5px;
}

/* ===== 工序与计价：重新设计的行 ===== */
.process-settings-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.process-settings-row {
  display: grid;
  grid-template-columns: 22px 30px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  position: relative;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
}

.process-settings-row > .process-settings-side {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-end !important;
  gap: 12px !important;
  min-width: 0;
}

.process-settings-row:hover {
  border-color: #c1d3f3;
  box-shadow: 0 6px 18px rgba(15, 56, 130, 0.06);
}

.process-settings-row.is-disabled {
  background: #fafbfc;
}

.process-settings-row.is-disabled .process-name {
  color: var(--muted);
}

.process-settings-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--brand);
  opacity: 0.55;
  transition: opacity 0.15s;
}

.process-settings-row.is-disabled::before {
  background: #b8c0d0;
  opacity: 0.5;
}

.process-settings-row:hover::before { opacity: 0.95; }

.process-drag-handle {
  color: #9aa7c2;
  cursor: grab;
  font-size: 18px;
  text-align: center;
  user-select: none;
  line-height: 1;
  transition: color 0.15s;
}

.process-drag-handle:hover { color: var(--brand); }

.process-order-number {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #eef2fa;
  color: #4a5d80;
  font-size: 13px;
  font-weight: 800;
}

.process-settings-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.process-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.process-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
}

.process-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.process-code {
  font-family: ui-monospace, SFMono-Regular, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--muted);
  background: #f3f4f8;
  padding: 2px 8px;
  border-radius: 5px;
}

.process-coverage {
  font-size: 12.5px;
  color: var(--muted);
}

.process-coverage.is-missing {
  color: var(--danger);
  font-weight: 700;
}

.process-rate-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 96px;
}

.process-rate-label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.4px;
}

.process-rate-value {
  font-size: 17px;
  font-weight: 850;
  color: var(--ink);
  line-height: 1.2;
}

.process-rate-value.is-missing {
  font-size: 13px;
  color: var(--danger);
  font-weight: 700;
}

.process-status-pill {
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.process-status-pill.is-active {
  background: #e3f6ea;
  color: #0b6b3a;
}

.process-status-pill.is-disabled {
  background: #f1f3f7;
  color: #6b7689;
}

.process-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.process-icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: #4a5d80;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.process-icon-btn:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

.process-icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: #fafbfc;
}

.process-icon-btn.process-delete {
  color: var(--danger);
  font-size: 18px;
  font-weight: 600;
}

.process-icon-btn.process-delete:hover:not(:disabled) {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

.process-edit-btn {
  height: 34px;
  padding: 0 14px;
  border: none;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s;
}

.process-edit-btn:hover { background: var(--brand-dark); }

@media (max-width: 760px) {
  .process-settings-row {
    grid-template-columns: 22px 1fr auto;
    gap: 10px;
    padding: 12px 14px;
  }
  .process-order-number { display: none; }
  .process-rate-block { display: none; }
  .process-status-pill { grid-row: 1; grid-column: 3; }
  .process-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .process-icon-btn { width: 30px; height: 30px; }
  .process-edit-btn { height: 30px; padding: 0 12px; }
}

/* ===== PR-1:工序概览条 + 工具栏 ===== */
.process-summary-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 6px;
}
.kpi-card {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}
.kpi-card small { font-size: 12px; color: var(--muted); }
.kpi-card .kpi-num { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.kpi-card.kpi-warning { background: var(--warning-soft); border-color: #f0d59e; }
.kpi-card.kpi-warning .kpi-num { color: var(--warning); }
.kpi-card.kpi-danger { background: var(--danger-soft); border-color: #f0bcc3; }
.kpi-card.kpi-danger .kpi-num { color: var(--danger); }

.process-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.process-search { position: relative; flex: 1 1 220px; min-width: 0; }
.process-search::before {
  content: "";
  position: absolute; left: 13px; top: 50%;
  width: 13px; height: 13px; margin-top: -9px;
  border: 2px solid var(--muted); border-radius: 50%;
  opacity: 0.55; pointer-events: none;
}
.process-search::after {
  content: ""; position: absolute; left: 25px; top: calc(50% + 4px);
  width: 6px; height: 2px; background: var(--muted);
  transform: rotate(45deg); opacity: 0.55; pointer-events: none;
}
.process-search input {
  width: 100%; height: 40px; padding: 0 14px 0 38px;
  border: 1px solid var(--line); border-radius: 999px;
  background: #fff; color: var(--ink); font: inherit;
}
.process-search input:focus { border-color: var(--brand); }

.process-filter-group { display: flex; gap: 6px; flex-wrap: wrap; }
.process-filter-group button {
  min-height: 40px; padding: 0 14px; margin: 0;
  border: 1px solid var(--line); border-radius: 999px;
  background: #fff; color: var(--ink); font-weight: 650;
  display: inline-flex; align-items: center; gap: 6px;
}
.process-filter-group button:hover { border-color: var(--brand); color: var(--brand); }
.process-filter-group button[aria-selected="true"] {
  background: var(--brand); border-color: var(--brand); color: #fff;
}
.process-filter-group .chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px;
  background: #eef2fa; color: #4a5d80;
  font-size: 12px; font-variant-numeric: tabular-nums;
}
.process-filter-group button[aria-selected="true"] .chip {
  background: rgb(255 255 255 / 25%); color: #fff;
}

.process-sort {
  height: 40px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: 999px; background: #fff; color: var(--ink); font: inherit;
}

.process-filter-empty {
  padding: 28px 16px; text-align: center; color: var(--muted);
  border: 2px dashed var(--line); border-radius: 13px; font-size: 14px;
}

/* —— 紧凑化:仅作用于工序与计价区域 —— */
.admin-config-panel .section-title { margin: 2px 0; }
.admin-config-panel .notice { margin: 0; padding: 10px 13px; }
.admin-config-panel .process-settings-row { min-height: 0; }

/* v5-tighten: 强制文件内容变化,etag 重置 */

@media (max-width: 760px) {
  .process-summary-bar { grid-template-columns: repeat(2, 1fr); }
  .process-toolbar { align-items: stretch; }
  .process-search { flex-basis: 100%; }
  .process-sort { flex: 1; }
}

.process-pricing-scope-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.process-by-model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.process-by-model-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.process-by-model-row .process-model-name {
  min-width: 56px;
  font-weight: 700;
  color: #33435a;
}

.process-by-model-row input {
  flex: 1;
  min-width: 0;
}

/* ===== 移动端步骤式报工（员工报工页） ===== */
.pw-steps {
  display: grid;
  gap: 16px;
}

.pw-step {
  display: grid;
  gap: 10px;
}

.pw-step-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}

.pw-step-label small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.pw-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: var(--brand);
  flex-shrink: 0;
}

.pw-process-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 2px;
}

.pw-process-card {
  min-width: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 9px 12px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.pw-process-card:active { background: #f0f4fc; }
.pw-process-card.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 4px 14px rgb(21 94 239 / 12%);
}
.pw-process-name { overflow-wrap: anywhere; font-size: 14px; font-weight: 800; color: var(--ink); }
.pw-process-card.active .pw-process-name { color: var(--brand-dark); }

.pw-style-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.pw-chain-step {
  padding: 10px;
  border: 1px solid #dbe6fa;
  border-radius: 13px;
  background: #f7f9fd;
}

.pw-style-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 13px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.pw-style-card:active { background: #f0f4fc; }
.pw-style-card.active {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.pw-style-name { min-width: 0; overflow-wrap: anywhere; font-size: 14.5px; font-weight: 800; color: var(--ink); }
.pw-style-card.active .pw-style-name { color: var(--brand-dark); }
.pw-style-meta { font-size: 12px; color: var(--muted); flex-shrink: 0; }

.pw-size-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pw-size-pill {
  display: grid;
  justify-items: center;
  align-items: center;
  min-height: 54px;
  padding: 10px 6px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.pw-size-pill:active { background: #f0f4fc; }
.pw-size-pill.active {
  border-color: var(--brand);
  background: var(--brand-soft);
}

@media (hover: none), (pointer: coarse) {
  .pw-process-card:hover:not(.active):not(:active),
  .pw-size-pill:hover:not(.active):not(:active),
  .pw-style-card:hover:not(.active):not(:active) {
    background: #fff;
  }

  .pw-qty-btn:hover:not(:active) {
    background: #fff;
    color: var(--ink);
  }

  .pw-process-card.active:hover,
  .pw-size-pill.active:hover,
  .pw-style-card.active:hover {
    background: var(--brand-soft);
  }
}

.pw-size-name { overflow-wrap: anywhere; font-size: 14px; font-weight: 800; color: var(--ink); text-align: center; }
.pw-size-pill.active .pw-size-name { color: var(--brand-dark); }

.pw-qty-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pw-qty-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: #fff;
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
}
.pw-qty-btn:active { background: var(--brand-soft); color: var(--brand); }

.pw-qty-input {
  flex: 1;
  min-width: 0;
  height: 52px;
  text-align: center;
  font-size: 24px;
  font-weight: 800;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: #fff;
}
.pw-qty-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.pw-selected-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.pw-selection-card {
  display: grid;
  gap: 10px;
  padding: 11px;
  border: 1px solid #b9ccea;
  border-radius: 13px;
  background: #f8fbff;
}

.pw-selection-heading,
.pw-selection-total {
  display: flex;
  min-width: 0;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.pw-selection-heading > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.pw-selection-heading strong,
.pw-selection-heading span {
  overflow-wrap: anywhere;
}

.pw-selection-heading span,
.pw-selection-total span {
  color: var(--muted);
  font-size: 12px;
}

.pw-selection-quantity {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  gap: 8px;
}

.pw-selection-card .pw-qty-btn,
.pw-selection-card .pw-qty-input {
  width: 100%;
  height: 48px;
}

.pw-selection-total {
  padding-top: 8px;
  border-top: 1px dashed #c1d3f3;
}

.pw-selection-total strong {
  color: #08795c;
  font-size: 18px;
}

.pw-date-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pw-date-field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.pw-date-field input {
  height: 46px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 0 12px;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
}

.pw-summary {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid #c1d3f3;
  border-radius: 13px;
  background: linear-gradient(135deg, #eaf1ff 0%, #f7faff 100%);
}
.pw-summary-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}
.pw-summary-line strong { min-width: 0; overflow-wrap: anywhere; color: var(--ink); font-weight: 700; text-align: right; }
.pw-summary-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px dashed #c1d3f3;
  font-size: 13px;
  color: var(--muted);
}
.pw-summary-total strong { font-size: 22px; font-weight: 900; color: var(--brand-dark); }

.pw-add-entry {
  width: 100%;
  min-height: 48px;
  border-color: #9bb7e8;
  color: var(--brand-dark);
  background: #fff;
  font-size: 15px;
  font-weight: 850;
}

.pw-add-entry:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.pw-cart {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #bfd0e9;
  border-radius: 14px;
  background: #f8fbff;
}

.pw-cart[hidden] {
  display: none;
}

.pw-cart .section-title {
  margin: 0;
}

.pw-cart .section-title h3 {
  margin: 0;
}

.pw-cart-list {
  display: grid;
  gap: 8px;
}

.pw-cart-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.pw-cart-item-copy,
.pw-cart-item-actions {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.pw-cart-item-copy strong,
.pw-cart-item-copy span,
.pw-cart-item-copy small {
  overflow-wrap: anywhere;
}

.pw-cart-item-copy span,
.pw-cart-item-copy small {
  color: var(--muted);
}

.pw-cart-item-copy small {
  font-size: 11px;
}

.pw-cart-item-actions {
  justify-items: end;
}

.pw-cart-item-actions > strong {
  color: #08795c;
}

.pw-cart-total {
  display: flex;
  gap: 12px;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 9px;
  border-top: 1px dashed #b7c9e2;
  color: var(--muted);
  font-size: 13px;
}

.pw-cart-total strong {
  color: #08795c;
  font-size: 20px;
}

.pw-submit-form {
  display: grid;
}
.pw-submit-form button {
  height: 52px;
  border-radius: 14px;
  border: none;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  background: var(--brand);
  cursor: pointer;
}
.pw-submit-form button:active { background: var(--brand-dark); }
.pw-submit-form button:disabled {
  background: #b9c4d6;
  cursor: not-allowed;
  opacity: 0.7;
}

@media (min-width: 680px) {
  .pw-process-list { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .pw-style-list { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .pw-size-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

@media (max-width: 679px) {
  .pw-selected-list {
    grid-template-columns: 1fr;
  }
}

/* ===== 工序 × 款式 价格总表（打印） ===== */
.section-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.pricing-matrix-dialog {
  max-width: none;
  max-height: none;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  padding: 16px;
  margin: 0;
  background: rgba(20, 24, 32, 0.55);
  border: none;
  align-items: stretch;
  justify-content: stretch;
  box-sizing: border-box;
  overflow: hidden;
}

.pricing-matrix-dialog[open] {
  display: flex;
}

.pricing-matrix-dialog::backdrop {
  background: transparent;
}

.pricing-matrix-card {
  width: 100%;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  max-width: 1180px;
  margin: 0 auto;
  background: #fff;
  color: #18191c;
  border-radius: 12px;
  box-shadow: 0 16px 60px rgba(0, 0, 0, 0.45);
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pricing-matrix-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 12px;
}

.pricing-matrix-toolbar h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.pricing-matrix-toolbar .field-help {
  margin: 0;
}

.pricing-matrix-meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  color: #5b6473;
  font-size: 13px;
  padding: 6px 0 10px;
}

.pricing-matrix-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.pricing-matrix-page {
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid #d8dde6;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(24, 32, 48, 0.05);
}

.pricing-matrix-sheet {
  page: pricing-matrix;
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid #d8dde6;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(24, 32, 48, 0.05);
}

.pricing-matrix-page .pricing-matrix-sheet {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.pricing-matrix-page .pricing-matrix-sheet + .pricing-matrix-sheet {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 2px dashed #cbd2dc;
}

.pricing-matrix-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 0 0 10px;
  border-bottom: 2px solid #334155;
}

.pricing-matrix-sheet-header h3 {
  margin: 0 0 3px;
  color: #111827;
  font-size: 17px;
}

.pricing-matrix-sheet-header p {
  margin: 0;
  color: #64748b;
  font-size: 12px;
}

.pricing-matrix-sheet-header > strong {
  flex: none;
  color: #334155;
  font-size: 13px;
  white-space: nowrap;
}

.pricing-matrix-sheet-scroll {
  max-width: 100%;
  overflow-x: auto;
  padding-top: 10px;
}

.pricing-matrix-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: fixed;
}

.pricing-matrix-table col.process-col {
  width: 220px;
}

.pricing-matrix-table th,
.pricing-matrix-table td {
  border: 1px solid #cbd2dc;
  padding: 7px 8px;
  vertical-align: middle;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pricing-matrix-table thead th {
  background: #eef2f6;
  color: #1f2937;
  text-align: left;
}

.pricing-matrix-table thead .sku-heading {
  text-align: center;
}

.pricing-matrix-table .process-heading {
  font-size: 13px;
}

.pricing-matrix-product-name {
  color: #111827;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
}

.pricing-matrix-table .sku-code {
  display: block;
  margin-top: 4px;
  color: #526174;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.25;
}

.pricing-matrix-table .sku-code {
  color: #7b8797;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 400;
}

.pricing-matrix-table .process-cell {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #f8fafc;
  text-align: left;
}

.pricing-matrix-table .process-cell strong,
.pricing-matrix-table .process-cell small {
  display: block;
}

.pricing-matrix-table .process-cell strong {
  color: #111827;
  font-size: 12px;
  line-height: 1.3;
}

.pricing-matrix-table .process-cell small {
  margin-top: 2px;
  color: #718096;
  font-size: 9px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 400;
}

.process-sequence {
  display: inline-grid;
  flex: none;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: #e2e8f0;
  color: #334155;
  font-size: 10px;
}

.pricing-matrix-table .rate-cell {
  text-align: center;
}

.pricing-matrix-table .rate-yuan {
  display: block;
  font-weight: 700;
  font-size: 14px;
  color: #18191c;
  letter-spacing: 0.2px;
}

.pricing-matrix-table .rate-empty {
  color: #b91c1c;
  font-weight: 600;
}

.pricing-matrix-table .rate-not-applicable {
  color: #7b8797;
  background: #fafafa;
  font-size: 11px;
}

.pricing-matrix-table .rate-missing {
  background: #fff7f7;
}

.pricing-matrix-table .rate-source {
  display: inline-block;
  margin-top: 2px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}

.rate-source-muted {
  background: #eef0f3;
  color: #5b6473;
}

.rate-source-warning {
  background: #fff3d6;
  color: #8a5a00;
}

.rate-source-danger {
  background: #fde0e0;
  color: #b91c1c;
}

.rate-source-total {
  background: #e1f3eb;
  color: #176b50;
}

.pricing-matrix-total-row th,
.pricing-matrix-total-row td {
  border-top: 2px solid #526174;
  background: #eaf1ef;
}

.pricing-matrix-total-row .process-cell {
  background: #eaf1ef;
}

.pricing-matrix-total-row .rate-yuan {
  color: #0c5c43;
  font-size: 15px;
}

.pricing-matrix-sheet-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  padding-top: 9px;
  color: #5b6473;
  font-size: 10px;
}

.pricing-matrix-sheet-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.legend-mark {
  width: 9px;
  height: 9px;
  border: 1px solid #8a94a4;
  border-radius: 2px;
  background: #eef0f3;
}

.legend-style { background: #fff3d6; }
.legend-sku,
.legend-missing { background: #fde0e0; }
.legend-missing { border-style: dashed; }

@media (max-width: 720px) {
  .pricing-matrix-dialog { padding: 8px; }
  .pricing-matrix-card { padding: 12px; }
  .pricing-matrix-toolbar { display: block; }
  .pricing-matrix-toolbar .button-row { margin-top: 10px; }
  .pricing-matrix-page { padding: 10px; }
  .pricing-matrix-sheet { padding: 10px; }
  .pricing-matrix-sheet-header { display: block; }
  .pricing-matrix-sheet-header > strong { display: block; margin-top: 5px; }
}

@page pricing-matrix {
  size: A4 landscape;
  margin: 8mm;
}

@media print {
  body.pricing-matrix-printing > *:not(.pricing-matrix-dialog) {
    display: none !important;
  }
  body.pricing-matrix-printing .pricing-matrix-dialog {
    position: static !important;
    inset: auto !important;
    display: block !important;
    background: #fff !important;
    padding: 0 !important;
    width: auto !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    overflow: visible !important;
    page: pricing-matrix;
  }
  body.pricing-matrix-printing .pricing-matrix-dialog::backdrop {
    display: none !important;
  }
  body.pricing-matrix-printing .pricing-matrix-card {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    color: #000 !important;
    max-width: none !important;
    max-height: none !important;
    overflow: visible !important;
  }
  body.pricing-matrix-printing .no-print,
  body.pricing-matrix-printing .no-print * {
    display: none !important;
  }
  body.pricing-matrix-printing .pricing-matrix-body {
    display: block !important;
    overflow: visible !important;
    padding: 0 !important;
  }
  body.pricing-matrix-printing .pricing-matrix-page {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    break-after: page;
    page-break-after: always;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  body.pricing-matrix-printing .pricing-matrix-page:last-child {
    break-after: auto;
    page-break-after: auto;
  }
  body.pricing-matrix-printing .pricing-matrix-sheet {
    margin: 0 0 4mm !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    break-after: auto;
    page-break-after: auto;
    break-inside: avoid;
    page-break-inside: avoid;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  body.pricing-matrix-printing .pricing-matrix-sheet + .pricing-matrix-sheet {
    margin-top: 4mm !important;
    padding-top: 4mm !important;
    border-top: 0.45mm dashed #777 !important;
  }
  body.pricing-matrix-printing .pricing-matrix-sheet:last-child {
    margin-bottom: 0 !important;
  }
  body.pricing-matrix-printing .pricing-matrix-sheet-header {
    padding: 0 0 2.2mm !important;
    border-bottom: 0.45mm solid #333 !important;
  }
  body.pricing-matrix-printing .pricing-matrix-sheet-header h3 {
    font-size: 12pt !important;
  }
  body.pricing-matrix-printing .pricing-matrix-sheet-header p,
  body.pricing-matrix-printing .pricing-matrix-sheet-header > strong {
    font-size: 7.5pt !important;
  }
  body.pricing-matrix-printing .pricing-matrix-sheet-scroll {
    overflow: visible !important;
    padding-top: 2.2mm !important;
  }
  body.pricing-matrix-printing .pricing-matrix-table {
    min-width: 0 !important;
    table-layout: fixed !important;
    font-size: 8pt !important;
    width: 100% !important;
  }
  body.pricing-matrix-printing .pricing-matrix-table col.process-col {
    width: 46mm !important;
  }
  body.pricing-matrix-printing .pricing-matrix-table thead {
    display: table-header-group;
  }
  body.pricing-matrix-printing .pricing-matrix-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  body.pricing-matrix-printing .pricing-matrix-table th,
  body.pricing-matrix-printing .pricing-matrix-table td {
    border-color: #8b8b8b !important;
    padding: 0.85mm 1.4mm !important;
    background: #fff !important;
    color: #000 !important;
    overflow: visible !important;
    white-space: normal !important;
  }
  body.pricing-matrix-printing .pricing-matrix-table thead th {
    background: #eee !important;
    color: #000 !important;
  }
  body.pricing-matrix-printing .pricing-matrix-table .process-cell {
    display: table-cell !important;
    background: #f3f3f3 !important;
  }
  body.pricing-matrix-printing .process-sequence {
    display: inline-block !important;
    width: auto !important;
    height: auto !important;
    margin-right: 1.5mm !important;
    border-radius: 0 !important;
    background: transparent !important;
    font-size: 6.5pt !important;
    vertical-align: top;
  }
  body.pricing-matrix-printing .pricing-matrix-table .process-cell > div {
    display: inline-block !important;
    max-width: 37mm;
  }
  body.pricing-matrix-printing .pricing-matrix-table .process-cell strong {
    font-size: 7.5pt !important;
  }
  body.pricing-matrix-printing .pricing-matrix-product-name {
    font-size: 9pt !important;
    text-align: center !important;
  }
  body.pricing-matrix-printing .pricing-matrix-table .process-cell small,
  body.pricing-matrix-printing .pricing-matrix-table .sku-code {
    font-size: 6.3pt !important;
  }
  body.pricing-matrix-printing .rate-yuan {
    display: block !important;
    font-size: 8.5pt !important;
    color: #000 !important;
  }
  body.pricing-matrix-printing .rate-empty {
    color: #000 !important;
  }
  body.pricing-matrix-printing .pricing-matrix-table .rate-source {
    margin-top: 0.25mm !important;
    padding: 0 0.9mm !important;
    border: 0.2mm solid #999 !important;
    border-radius: 2mm !important;
    background: #fff !important;
    color: #222 !important;
    font-size: 6.3pt !important;
  }
  body.pricing-matrix-printing .pricing-matrix-table .rate-not-applicable {
    background: #fafafa !important;
    color: #555 !important;
  }
  body.pricing-matrix-printing .pricing-matrix-table .rate-missing {
    background: #f7f7f7 !important;
  }
  body.pricing-matrix-printing .pricing-matrix-total-row th,
  body.pricing-matrix-printing .pricing-matrix-total-row td,
  body.pricing-matrix-printing .pricing-matrix-total-row .process-cell {
    border-top: 0.55mm solid #333 !important;
    background: #eee !important;
    font-weight: 700 !important;
  }
  body.pricing-matrix-printing .pricing-matrix-sheet-legend {
    gap: 3mm !important;
    padding-top: 1.4mm !important;
    color: #333 !important;
    font-size: 6.5pt !important;
  }
}

/* 系统配置手机布局：信息与操作分行，覆盖旧工序表格的列定位。 */
@media screen and (max-width: 760px) {
  .admin-config-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    margin-inline: 0;
  }
  .admin-config-tabs button {
    min-width: 0;
    min-height: 44px;
    padding-inline: 6px;
    white-space: nowrap;
  }
  .admin-config-panel > .section-title {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .admin-config-panel > .section-title > div { min-width: 0; }
  .admin-config-panel .section-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
  .admin-config-panel .section-actions button {
    min-width: 0;
    min-height: 44px;
    padding-inline: 8px;
    font-size: 14px;
    white-space: nowrap;
  }
  .admin-config-panel .process-filter-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
  .admin-config-panel .process-filter-group button {
    min-width: 0;
    min-height: 44px;
    white-space: nowrap;
  }
  .admin-config-panel .process-sort { min-width: 0; width: 100%; }
  .admin-config-panel .process-settings-list { gap: 10px; }
  .admin-config-panel .process-settings-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
  }
  .admin-config-panel .process-drag-handle,
  .admin-config-panel .process-order-number { display: none; }
  .admin-config-panel .process-settings-row > .process-settings-main {
    display: flex;
    grid-column: 1 / -1;
    gap: 6px;
  }
  .admin-config-panel .process-title-row { gap: 6px; }
  .admin-config-panel .process-name {
    flex-basis: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.45;
  }
  .admin-config-panel .process-mode-badge { margin-top: 0; }
  .admin-config-panel .process-meta-row { gap: 4px 8px; }
  .admin-config-panel .process-code { max-width: 100%; overflow-wrap: anywhere; }
  .admin-config-panel .process-coverage { flex-basis: 100%; }
  .admin-config-panel .process-settings-row > div.process-settings-side {
    grid-column: 1 / -1;
    flex-wrap: wrap;
    align-items: center !important;
    gap: 8px !important;
    border-top: 1px solid var(--line);
    padding-top: 10px;
  }
  .admin-config-panel .process-status-pill { flex: 0 0 auto; }
  .admin-config-panel .process-actions {
    display: grid;
    flex: 1 1 228px;
    min-width: 0;
    grid-template-columns: 44px 44px minmax(0, 1fr) 44px;
    gap: 6px;
  }
  .admin-config-panel .process-actions button {
    width: 100%;
    height: 44px;
    min-width: 0;
    padding: 0 6px;
    white-space: nowrap;
  }
  .sold-products-toolbar { flex-direction: column; align-items: stretch; }
  .sold-products-toolbar-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }
  .sold-products-toolbar-actions button { min-width: 0; min-height: 44px; white-space: nowrap; }
  .admin-config-panel #damage-policy-form { display: grid; grid-template-columns: minmax(0, 1fr); }
  .process-pricing-form .process-kind-pricing-pane { padding: 9px; }
  .process-pricing-form [data-process-kind-pane="accessory"] .process-model-rule-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .process-pricing-form .process-kind-pane-heading,
  .process-pricing-form .process-pricing-rule-section > .section-title {
    flex-wrap: wrap;
  }
  .process-pricing-form .button-row button,
  .product-combination-form .button-row button { min-height: 44px; white-space: nowrap; }
  .process-pricing-form input:not([type="checkbox"]),
  .product-combination-form input:not([type="checkbox"]):not([type="radio"]),
  .product-combination-form select { font-size: 16px; }
}
@media screen and (max-width: 380px) {
  .process-pricing-form .process-model-rule-grid { grid-template-columns: minmax(0, 1fr); }
}
.after-sales-dialog { width: min(960px, 96vw); max-height: 90dvh; overflow-y: auto; }
.after-sales-item .filter-row { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.after-sales-item .field:first-child { flex: 1 1 250px; min-width: 0; }
.after-sales-item .filter-row .field:nth-child(2) { flex: 0 0 85px; }
.after-sales-item select { width: 100%; max-width: 100%; }
.after-sales-item textarea { min-height: 70px; }
.after-sales-dialog [data-reship-error] { color: #b42318; }
@media (max-width: 600px) {
  .after-sales-dialog { padding: 14px; }
  .after-sales-item .field:first-child { flex-basis: 100%; }
  .after-sales-dialog input, .after-sales-dialog select, .after-sales-dialog textarea { font-size: 16px; }
}
