:root {
  color-scheme: light;
  --bg: #f4f7f8;
  --surface: #ffffff;
  --surface-soft: #eef4f3;
  --ink: #17212b;
  --muted: #61707c;
  --line: #d9e2e4;
  --accent: #0f766e;
  --accent-strong: #0b5e57;
  --blue: #2563eb;
  --amber: #b7791f;
  --red: #c2413d;
  --green: #15803d;
  --shadow: 0 16px 36px rgba(30, 50, 60, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui,
    -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 8px;
  background: #18252a;
  color: #e7f0ee;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.brand-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 6px;
  background: #f6c453;
  color: #18252a;
  font-weight: 800;
}

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

.brand strong {
  font-size: 12px;
}

.brand span,
.sidebar-footer span {
  color: #b9c9c7;
  font-size: 11px;
}

.nav-list {
  display: grid;
  gap: 2px;
}

.nav-section-label {
  margin: 4px 6px 0;
  min-height: 17px;
  color: #9fb2b0;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.nav-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 2px;
  align-items: center;
  width: 100%;
  min-height: 36px;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #dce8e6;
  text-align: left;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  white-space: normal;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.14);
}

.nav-item.active {
  color: #ffffff;
}

.nav-icon {
  font-size: 17px;
  line-height: 1;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
}

.sidebar-footer strong {
  color: #9be7d8;
  font-size: 12px;
}

.main-panel {
  min-width: 0;
  padding: 10px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.topbar h1,
.panel h2 {
  margin: 0;
  color: var(--ink);
  letter-spacing: 0;
}

.topbar h1 {
  font-size: 22px;
  line-height: 1.2;
}

.panel h2 {
  font-size: 17px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: min(100%, 600px);
  justify-content: flex-end;
}

.search-box,
.select-box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.search-box {
  min-width: 260px;
}

.select-box {
  min-width: 176px;
}

.select-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.select-box select {
  min-width: 96px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 13px;
  white-space: nowrap;
  line-height: 1.2;
  text-decoration: none;
}

.primary-button {
  background: var(--accent);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.ghost-button {
  background: transparent;
  border-color: var(--line);
  color: var(--accent-strong);
}

.danger-button {
  background: #fff5f4;
  border-color: rgba(194, 65, 61, 0.28);
  color: var(--red);
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 10px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.metric-card {
  display: grid;
  gap: 10px;
  min-height: 124px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric-card strong {
  font-size: 30px;
  line-height: 1;
}

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

.content-grid {
  display: grid;
  gap: 16px;
}

.two-columns {
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
}

.panel {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.record-count {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 6px;
  background: #eef3f0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.order-progress-list {
  display: grid;
  gap: 12px;
}

.progress-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(160px, 0.8fr) 70px;
  align-items: center;
  gap: 12px;
}

.progress-row strong,
.task-card strong,
.equipment-card strong {
  display: block;
  margin-bottom: 3px;
}

.progress-row span,
.task-card span,
.equipment-card span,
.report-tile span {
  color: var(--muted);
  font-size: 12px;
}

.equipment-card span {
  display: block;
  line-height: 1.45;
}

.progress-track {
  height: 9px;
  overflow-x: auto;
  overflow-y: auto;
  border-radius: 999px;
  background: #e6ecee;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.plant-panel {
  overflow-x: auto;
  overflow-y: auto;
}

.plant-map {
  display: grid;
  grid-template-columns: 1fr 42px 1fr 42px 1fr 42px 1fr;
  align-items: center;
  min-height: 150px;
  padding: 16px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.07), transparent 38%),
    repeating-linear-gradient(
      0deg,
      rgba(23, 33, 43, 0.05) 0,
      rgba(23, 33, 43, 0.05) 1px,
      transparent 1px,
      transparent 18px
    ),
    #f8fbfb;
}

.line-node {
  display: grid;
  place-items: center;
  min-height: 86px;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  text-align: center;
}

.line-node span {
  color: var(--muted);
  font-size: 12px;
}

.node-ok {
  border-color: rgba(21, 128, 61, 0.42);
}

.node-warning {
  border-color: rgba(183, 121, 31, 0.5);
}

.node-idle {
  border-color: rgba(37, 99, 235, 0.36);
}

.line-rail {
  height: 4px;
  background: var(--accent);
}

.rail-warning {
  background: var(--amber);
}

.alert-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.alert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff7e8;
  color: #6d470d;
}

.task-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.task-card,
.equipment-card,
.report-tile {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.task-card {
  min-height: 110px;
  padding: 14px;
}

.task-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 16px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-running,
.status-good,
.status-done {
  background: #def7ec;
  color: #0b6b35;
}

.status-waiting,
.status-warning {
  background: #fff1d6;
  color: #8a570e;
}

.status-danger,
.status-stop {
  background: #fde2e2;
  color: #9f2924;
}

.status-info {
  background: #dfeafe;
  color: #1e4fa7;
}

.permission-check-panel {
  display: grid;
  gap: 8px;
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.permission-check-panel > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.permission-check-panel label {
  display: flex;
  min-height: 28px;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
}

.permission-check-panel input {
  width: 16px;
  height: 16px;
}

.workspace-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  min-height: 0;
  height: calc(100vh - 100px);
}

.workspace-layout.compact-left {
  grid-template-columns: 300px minmax(0, 1fr);
}

#moldingWorkbench .workspace-layout {
  grid-template-columns: minmax(0, 1fr);
  height: auto;
  min-height: calc(100vh - 100px);
}

#moldingWorkbench .workspace-layout > .panel {
  width: 100%;
}

/* ═══════════════════════════════════════
   FORM LIBRARY — THREE-COLUMN LAYOUT
   ═══════════════════════════════════════ */
.form-library-layout {
  display: grid;
  grid-template-columns: 260px 1fr 1.15fr;
  gap: 12px;
  align-items: stretch;
  min-height: 0;
  height: calc(100vh - 100px);
}

.form-library-column {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
  min-height: 0;
}

.form-library-column .panel-header {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line, #e0e0e0);
  background: #f7faf9;
  border-radius: 8px 8px 0 0;
}

.form-library-column .panel-header h2 {
  font-size: 13px;
  margin: 0;
}

.form-library-column .panel-header p.eyebrow {
  font-size: 10px;
  margin: 0 0 1px;
}

.form-library-column .panel-header .secondary-button {
  min-height: 26px;
  padding: 0 8px;
  font-size: 11px;
}

/* Left: list column */
.form-library-list {
  border: 1px solid var(--line, #e0e0e0);
  border-radius: 8px;
  background: #ffffff;
  overflow-x: auto;
  overflow-y: auto;
  max-height: 100%;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.form-library-list .filter-row {
  display: flex;
  gap: 6px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line, #e0e0e0);
  flex-wrap: wrap;
  align-items: end;
}

.form-library-list .filter-row label {
  display: grid;
  gap: 2px;
  flex: 1;
  min-width: 80px;
}

.form-library-list .filter-row label span {
  font-size: 10px;
  color: var(--text-secondary, #666);
}

.form-library-list .filter-row input,
.form-library-list .filter-row select {
  width: 100%;
  min-height: 28px;
  padding: 0 6px;
  font-size: 12px;
  border: 1px solid var(--line, #e0e0e0);
  border-radius: 6px;
  box-sizing: border-box;
}

.form-library-list .filter-row .secondary-button {
  min-height: 28px;
  padding: 0 6px;
  font-size: 10px;
  white-space: nowrap;
  line-height: 1.2;
}

.form-library-list .table-wrap {
  overflow-y: auto;
  min-height: 0;
}

.form-library-list table {
  width: 100%;
  border-collapse: collapse;
}

.form-library-list th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7faf9;
  padding: 6px 6px;
  font-size: 10px;
  font-weight: 900;
  text-align: left;
  color: var(--muted, #666);
  border-bottom: 1px solid var(--line, #e0e0e0);
  white-space: nowrap;
  line-height: 1.2;
}

.form-library-list td {
  padding: 6px 6px;
  font-size: 12px;
  border-bottom: 1px solid var(--line, #e0e0e0);
  vertical-align: middle;
}

.form-library-list tr {
  cursor: pointer;
  transition: background 0.12s;
}

.form-library-list tr:hover {
  background: #f0f6f5;
}

.form-library-list tr.selected {
  background: #e1f0ed;
}

.form-library-list tr.selected td:first-child {
  border-left: 3px solid var(--accent, #0f766e);
  padding-left: 3px;
}

.form-library-list .row-actions {
  display: flex;
  gap: 2px;
}

.form-library-list .row-actions .ghost-button {
  min-height: 20px;
  padding: 0 3px;
  font-size: 9px;
}

/* Middle: photo column */
.form-library-photo {
  border: 1px solid var(--line, #e0e0e0);
  border-radius: 8px;
  background: #ffffff;
  overflow-x: auto;
  overflow-y: auto;
  max-height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.form-library-photo-frame {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: auto;
  background: #f1f5f5;
}

.form-library-photo-empty {
  color: var(--muted, #999);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  line-height: 1.5;
}

.form-library-photo-stage {
  display: none;
  width: 100%;
  height: 100%;
  place-items: center;
}

.form-library-photo-frame.has-photo .form-library-photo-stage {
  display: grid;
}

.form-library-photo-frame.has-photo .form-library-photo-empty {
  display: none;
}

.form-library-photo-stage img {
  display: none;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
}

.form-library-photo-stage img.show {
  display: block;
}

.form-library-photo-upload {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 6px 10px;
  border-top: 1px solid var(--line, #e0e0e0);
}

.form-library-photo-upload .primary-button,
.form-library-photo-upload .ghost-button {
  min-height: 28px;
  padding: 0 10px;
  font-size: 11px;
}

/* Right: editor column */
.form-library-editor {
  border: 1px solid var(--line, #e0e0e0);
  border-radius: 8px;
  background: #ffffff;
  overflow-x: auto;
  overflow-y: auto;
  max-height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.form-library-editor .template-editor {
  padding: 10px;
  overflow-y: auto;
  margin: 0;
  border: none;
}

.form-library-editor .form-designer {
  margin-top: 4px;
}

.form-library-editor .form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 8px;
  border-top: 1px solid var(--line, #e0e0e0);
}

.form-library-editor .form-actions .primary-button {
  width: 100%;
}

/* Responsive: collapse to single column on narrow screens */
.form-library-preview {
  overflow: auto;
  padding: 8px;
  min-height: 0;
}
.form-library-preview-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: #999;
  font-size: 13px;
  text-align: center;
  line-height: 1.6;
}
.form-library-preview .process-card-paper {
  gap: 6px;
  overflow-x: visible;
  font-size: 11px;
  min-width: 0;
  max-width: 100%;
  margin: 0 auto;
}
.form-library-preview .paper-title {
  font-size: 1.05em;
}
.form-library-preview .paper-row input,
.form-library-preview .paper-left-panel input {
  font-size: 10px;
}
.form-library-editor-panel {
  border-top: 1px solid var(--line, #e0e0e0);
  overflow-y: auto;
  max-height: 50%;
}
.form-library-editor-panel .template-editor {
  padding: 8px 10px;
}
.form-library-editor-panel .template-editor label > span {
  font-size: 11px;
}
.form-library-editor-panel .template-editor input,
.form-library-editor-panel .template-editor select,
.form-library-editor-panel .template-editor textarea {
  font-size: 11px;
  padding: 4px 6px;
}
.form-library-editor-panel .form-designer-head {
  font-size: 11px;
  padding: 4px 0;
}
.form-library-editor-panel .layout-designer-row {
  font-size: 10px;
}
.form-library-editor-panel .layout-designer-row input,
.form-library-editor-panel .layout-designer-row select {
  font-size: 10px;
  padding: 2px 4px;
}
.form-library-editor-panel .form-actions {
  padding: 6px 0;
}
.form-library-editor-panel .form-actions .primary-button {
  font-size: 11px;
  padding: 4px 12px;
}

@media (max-width: 900px) {
  .form-library-layout {
    grid-template-columns: 1fr;
  }

  .form-library-column {
    max-height: none;
  }

  .form-library-photo-frame {
    min-height: 240px;
  }
}

.process-card-workspace {
  display: grid;
  gap: 10px;
}

.process-card-workspace #processCardUploadForm {
  grid-template-columns: minmax(260px, 1fr) 180px 150px minmax(180px, 260px);
  align-items: end;
}

.process-card-workspace #processCardUploadForm .panel-header {
  grid-column: 1 / -1;
}

.process-card-workspace #processCardUploadForm .photo-preview {
  max-height: 96px;
}

.form-panel {
  display: grid;
  gap: 12px;
}

.template-editor {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.form-grid {
  display: grid;
  gap: 10px;
}

.form-panel label,
.template-editor label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.form-panel input,
.form-panel select,
.form-panel textarea,
.template-editor input,
.template-editor select,
.template-editor textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #ffffff;
  color: var(--ink);
}

.form-panel textarea,
.template-editor textarea {
  min-height: 76px;
  padding: 9px 10px;
  resize: vertical;
  line-height: 1.5;
}

.form-panel input[type="range"] {
  padding: 0;
  accent-color: var(--accent);
}

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

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.form-designer {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.form-designer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.layout-designer {
  display: grid;
  gap: 6px;
  overflow-x: auto;
}

.layout-designer-head,
.layout-designer-row {
  display: grid;
  grid-template-columns: 48px 112px 150px 110px 118px 70px;
  gap: 6px;
  align-items: center;
  min-width: 650px;
}

.layout-designer-head {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.layout-designer-row {
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
}

.layout-designer-row input,
.layout-designer-row select {
  min-height: 30px;
  border-radius: 6px;
  padding: 0 6px;
  font-size: 12px;
}

.layout-designer-row input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  justify-self: center;
}

.photo-preview {
  display: none;
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.photo-preview.show {
  display: block;
}

.process-card-fields {
  display: grid;
  gap: 8px;
}

.process-card-desktop-workbench {
  display: grid;
  grid-template-columns: 250px minmax(430px, 1.15fr) minmax(360px, 0.85fr);
  gap: 10px;
  align-items: stretch;
}

.process-card-card-column,
.process-card-photo-column,
.process-card-electronic-column {
  min-width: 0;
  max-height: calc(100vh - 98px);
  overflow-x: auto;
  overflow-y: auto;
}

.process-card-card-column {
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
  gap: 8px;
}

.process-card-upload-compact {
  display: grid;
  gap: 7px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.process-card-upload-compact label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.process-card-upload-compact input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 7px;
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
}

.process-card-upload-compact .primary-button {
  min-height: 34px;
}

.process-card-upload-compact .photo-preview {
  max-height: 90px;
}

.process-card-upload-compact .upload-result {
  min-height: 34px;
  padding: 8px;
  font-size: 12px;
}

.process-card-list-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.process-card-list-actions .ghost-button,
.process-card-list-actions .secondary-button {
  min-height: 30px;
  padding: 0 5px;
  font-size: 11px;
}

.process-card-filter-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.process-card-filter-details summary {
  min-height: 30px;
  padding: 7px 8px;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.process-card-filters.compact {
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 0;
  padding: 0 8px 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.process-card-filters.compact label {
  gap: 3px;
  font-size: 11px;
}

.process-card-filters.compact input,
.process-card-filters.compact select {
  min-height: 30px;
  border-radius: 6px;
  padding: 0 6px;
  font-size: 12px;
}

.process-card-filters.compact button {
  grid-column: 1 / -1;
  min-height: 30px;
}

.process-card-batch-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 0 8px 8px;
}

.process-card-batch-status {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.process-card-batch-tools .ghost-button,
.process-card-batch-tools .secondary-button {
  min-height: 28px;
  padding: 0 5px;
  font-size: 11px;
}

.process-card-batch-tools .secondary-button {
  grid-column: 1 / -1;
}

.manufacturing-card-filters.compact {
  grid-template-columns: 120px 116px 120px 130px 130px 124px 124px 112px auto;
  gap: 6px;
  align-items: end;
  padding: 8px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.manufacturing-card-filters.compact label {
  min-width: 0;
}

.manufacturing-card-filters.compact input,
.manufacturing-card-filters.compact select {
  min-height: 28px;
  padding: 0 6px;
  font-size: 12px;
}

.manufacturing-card-filters.compact button {
  grid-column: auto;
  min-height: 28px;
  padding: 0 10px;
  white-space: nowrap;
  line-height: 1.2;
}

.process-card-card-column .process-card-record-list {
  min-height: 0;
  overflow: auto;
  gap: 2px;
  padding-right: 2px;
}

.process-card-list-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  column-gap: 4px;
  gap: 0;
  min-height: 22px;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: 6px;
  background: #ffffff;
}

.process-card-list-item.confirmed {
  border-left-color: var(--green);
}

.process-card-list-item.pending {
  border-left-color: var(--blue);
}

.process-card-list-item.needs-review {
  border-left-color: var(--amber);
}

.process-card-list-item.selected {
  border-color: var(--accent);
  background: #eefbf7;
  box-shadow: inset 3px 0 0 var(--accent);
}

.process-card-list-item.batch-selected:not(.selected) {
  border-color: #93c9ba;
  background: #f2fbf8;
}

.process-card-list-check {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
}

.process-card-list-check input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  cursor: pointer;
}

.process-card-list-select {
  display: grid;
  align-items: center;
  width: 100%;
  min-height: 18px;
  gap: 0px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.process-card-list-select strong {
  min-width: 0;
  overflow-x: auto;
  overflow-y: auto;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

.process-card-list-select span,
.process-card-list-select small {
  min-width: 0;
  overflow-x: auto;
  overflow-y: auto;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

.process-card-list-select small {
  color: #66736d;
}

.card-list-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.card-list-topline strong {
  min-width: 0;
  overflow-x: auto;
  overflow-y: auto;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

.card-list-topline .status-pill {
  min-height: 20px;
  padding: 0 6px;
  font-size: 10px;
}

.card-list-subline,
.card-list-warning {
  min-width: 0;
  overflow-x: auto;
  overflow-y: auto;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

.card-list-warning {
  color: var(--red);
  font-weight: 800;
}

.card-list-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}

.process-card-list-item:not(.selected) .card-list-actions {
  display: none;
}

.card-list-actions .ghost-button {
  min-height: 24px;
  padding: 0 4px;
  font-size: 10px;
}

.ghost-button.disabled {
  color: #9aa7ad;
  background: #f4f7f8;
  pointer-events: none;
}

.process-card-photo-column {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.process-card-photo-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  justify-content: flex-end;
}

.process-card-photo-tools .ghost-button {
  min-height: 26px;
  padding: 0 6px;
  font-size: 11px;
}

.process-card-photo-tools span {
  min-width: 44px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: right;
}

.process-card-photo-column .process-card-photo-frame {
  position: static;
  min-height: 0;
  height: 100%;
  max-height: none;
}

.process-card-electronic-column {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.process-card-electronic-column .process-card-fields {
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.process-card-electronic-column .process-card-paper {
  gap: 6px;
  overflow-x: visible;
}

.process-card-electronic-column .paper-title {
  min-width: 0;
  padding: 6px 8px;
  font-size: 14px;
}

.process-card-electronic-column .paper-field {
  grid-template-columns: 62px minmax(0, 1fr);
  min-height: 30px;
}

.process-card-electronic-column .paper-field.date-compact {
  grid-template-columns: 42px minmax(0, 1fr);
}

.process-card-electronic-column .paper-field.label-compact {
  grid-template-columns: 40px minmax(0, 1fr);
}

.process-card-electronic-column .paper-field.unit-field {
  grid-template-columns: 62px minmax(0, 1fr) 30px;
}

.process-card-electronic-column .paper-field.label-compact.unit-field {
  grid-template-columns: 40px minmax(0, 1fr) 28px;
}

.process-card-electronic-column .paper-field span,
.process-card-electronic-column .paper-special > span,
.process-card-electronic-column .paper-cell span,
.process-card-electronic-column .paper-unit {
  padding: 0 5px;
  font-size: 11px;
}

.process-card-electronic-column .paper-field input,
.process-card-electronic-column .paper-special input,
.process-card-electronic-column .paper-cell input {
  min-height: 30px;
  padding: 0 5px;
  font-size: 12px;
}

.process-card-electronic-column .paper-qr {
  min-height: 88px;
  font-size: 11px;
}

.process-card-electronic-column .paper-special {
  grid-template-columns: 62px minmax(0, 1fr);
  min-height: 46px;
}

.process-card-electronic-column .paper-extra-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.process-card-electronic-column .process-signature-editor {
  gap: 5px;
}

.process-card-electronic-column .process-signature-head,
.process-card-electronic-column .process-signature-row {
  grid-template-columns: 34px 62px 80px minmax(90px, 1fr) 68px 38px;
  gap: 4px;
  min-width: 0;
}

.process-card-electronic-column .process-signature-head {
  font-size: 11px;
}

.process-card-electronic-column .process-signature-row + .process-signature-row {
  margin-top: 5px;
}

.process-card-electronic-column .process-signature-row input {
  min-height: 28px;
  padding: 0 4px;
  font-size: 11px;
}

.process-card-electronic-column .process-signature-row .ghost-button {
  min-height: 28px;
  padding: 0 4px;
  font-size: 11px;
}

.process-card-review-workbench {
  display: grid;
  grid-template-columns: minmax(420px, 0.95fr) minmax(520px, 1.05fr);
  gap: 10px;
  align-items: start;
}

.process-card-review-pane {
  min-width: 0;
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.review-pane-title {
  min-height: 32px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
  background: #f7faf9;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.process-card-photo-frame {
  position: sticky;
  top: 10px;
  display: grid;
  min-height: 620px;
  max-height: 72vh;
  place-items: start;
  overflow: auto;
  background: #f1f5f5;
}

.process-card-photo-frame.fit-photo {
  place-items: center;
}

.process-card-photo-stage {
  display: none;
  width: 100%;
  height: 100%;
  min-height: 0;
  place-items: center;
}

.process-card-photo-frame.has-photo .process-card-photo-stage {
  display: grid;
}

.process-card-photo-frame img {
  display: none;
  width: auto;
  max-width: none;
  height: auto;
  object-fit: contain;
}

.process-card-photo-frame img.show {
  display: block;
}

.process-card-photo-empty {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.process-card-review-pane .process-card-fields {
  max-height: 72vh;
  overflow: auto;
  padding: 8px;
}

.process-card-review-workbench .process-card-paper {
  gap: 6px;
  overflow-x: visible;
}

.process-card-review-workbench .paper-title {
  min-width: 0;
  padding: 6px 8px;
  font-size: 14px;
}

.process-card-review-workbench .paper-field {
  grid-template-columns: 62px minmax(0, 1fr);
  min-height: 30px;
}

.process-card-review-workbench .paper-field.date-compact {
  grid-template-columns: 42px minmax(0, 1fr);
}

.process-card-review-workbench .paper-field.label-compact {
  grid-template-columns: 40px minmax(0, 1fr);
}

.process-card-review-workbench .paper-field.unit-field {
  grid-template-columns: 62px minmax(0, 1fr) 30px;
}

.process-card-review-workbench .paper-field.label-compact.unit-field {
  grid-template-columns: 40px minmax(0, 1fr) 28px;
}

.process-card-review-workbench .paper-field span,
.process-card-review-workbench .paper-special > span,
.process-card-review-workbench .paper-cell span,
.process-card-review-workbench .paper-unit {
  padding: 0 5px;
  font-size: 11px;
}

.process-card-review-workbench .paper-field input,
.process-card-review-workbench .paper-special input,
.process-card-review-workbench .paper-cell input {
  min-height: 30px;
  padding: 0 5px;
  font-size: 12px;
}

.process-card-review-workbench .paper-qr {
  min-height: 88px;
  font-size: 11px;
}

.process-card-review-workbench .paper-special {
  grid-template-columns: 62px minmax(0, 1fr);
  min-height: 46px;
}

.process-card-review-workbench .paper-extra-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.process-card-review-workbench .process-signature-editor {
  gap: 5px;
}

.process-card-review-workbench .process-signature-head,
.process-card-review-workbench .process-signature-row {
  grid-template-columns: 34px 62px minmax(76px, 1fr) 70px 68px 42px;
  gap: 4px;
  min-width: 0;
}

.process-card-review-workbench .process-signature-head {
  font-size: 11px;
}

.process-card-review-workbench .process-signature-row + .process-signature-row {
  margin-top: 5px;
}

.process-card-review-workbench .process-signature-row input {
  min-height: 28px;
  padding: 0 4px;
  font-size: 11px;
}

.process-card-review-workbench .process-signature-row .ghost-button {
  min-height: 28px;
  padding: 0 4px;
  font-size: 11px;
}

.process-card-paper {
  display: grid;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.paper-title {
  min-width: 620px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-bottom: 0;
  background: #f7faf9;
  color: var(--ink);
  text-align: center;
  font-weight: 900;
}

.paper-grid {
  display: grid;
  min-width: 620px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.paper-layout {
  display: grid;
  grid-template-columns: 36% 64%;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.paper-left-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-right: 1px solid var(--line);
}

.paper-main-panel {
  display: grid;
}

.paper-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.paper-row.top-row {
  grid-template-columns: 1.5fr 0.9fr;
}

.paper-row.one-row {
  grid-template-columns: 1fr;
}

.paper-field {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  min-height: 34px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.paper-field.full {
  grid-column: 1 / -1;
}

.paper-field.stacked {
  grid-template-columns: 1fr;
  grid-template-rows: 18px minmax(30px, auto);
}

.paper-field.date-compact {
  grid-template-columns: 56px minmax(0, 1fr);
}

.paper-field.label-compact {
  grid-template-columns: 48px minmax(0, 1fr);
}

.paper-field.unit-field {
  grid-template-columns: 88px minmax(0, 1fr) 34px;
}

.paper-field.label-compact.unit-field {
  grid-template-columns: 48px minmax(0, 1fr) 34px;
}

.paper-field span,
.paper-special > span,
.paper-unit {
  display: flex;
  align-items: center;
  padding: 0 8px;
  background: #f7faf9;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.paper-unit {
  justify-content: center;
  border-left: 1px solid var(--line);
  font-style: normal;
}

.paper-field.stacked span {
  justify-content: center;
  border-bottom: 1px solid var(--line);
}

.paper-field.date-compact span {
  justify-content: center;
  line-height: 1.05;
  text-align: center;
}

.paper-field input,
.paper-special input {
  min-width: 0;
  min-height: 34px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  padding: 0 8px;
}

.paper-field.stacked input {
  min-height: 30px;
  border-left: 0;
  text-align: center;
}

.paper-field input.fit-small,
.paper-special input.fit-small,
.process-signature-row input.fit-small {
  font-size: 11px;
}

.paper-field input.fit-tiny,
.paper-special input.fit-tiny,
.process-signature-row input.fit-tiny {
  font-size: 10px;
}

.paper-qr {
  display: flex;
  min-height: 110px;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.paper-special {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 88px minmax(0, 1fr);
  min-height: 56px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.paper-extra-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.paper-cell {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  min-height: 38px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.paper-cell.wide {
  grid-column: span 2;
}

.paper-cell span {
  display: flex;
  align-items: center;
  padding: 0 8px;
  background: #f7faf9;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.paper-cell input {
  min-width: 0;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
}

.zhx-production-card {
  gap: 4px;
  min-width: 0;
  overflow-x: visible;
}

.zhx-card-heading {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 8px;
  color: var(--ink);
}

.zhx-card-heading strong {
  grid-column: 2;
  text-align: center;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0;
}

.zhx-card-heading span {
  grid-column: 3;
  justify-self: center;
  padding-bottom: 3px;
  font-size: 12px;
  font-weight: 800;
}

.zhx-production-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
  color: var(--ink);
  font-size: 11px;
}

.zhx-production-table td {
  height: 30px;
  min-width: 0;
  border: 1px solid var(--line);
  padding: 0;
  vertical-align: middle;
}

.zhx-a6-card {
  width: min(100%, 390px);
  min-width: 0;
  gap: 5px;
  align-content: start;
  overflow-x: visible;
  padding: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.zhx-a6-heading-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 4px;
  min-height: 36px;
}

.zhx-a6-qr-block {
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 4px;
  min-width: 118px;
  height: 36px;
  position: relative;
  z-index: 1;
}

.zhx-a6-qr-block .mfg-qr {
  display: block;
  width: 33px;
  height: 33px;
}

.zhx-a6-qr-placeholder {
  width: 33px;
  height: 33px;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
  color: #9ca3af;
  text-align: center;
  line-height: 1.2;
}

.zhx-a6-order-text {
  font-size: 8px;
  color: #374151;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1;
  min-width: 78px;
  max-width: 82px;
  min-height: 8px;
  padding-bottom: 0;
}

.zhx-a6-heading-center {
  position: absolute;
  left: 64px;
  right: 0;
  top: 8px;
  bottom: 0;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  min-height: 36px;
  min-width: 0;
  pointer-events: none;
}

.zhx-a6-heading-center strong {
  font-size: 18px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0;
  white-space: nowrap;
}

.zhx-a6-table,
.zhx-a6-process-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
  background: #fff;
}

.zhx-a6-table td,
.zhx-a6-process-table td,
.zhx-a6-process-table th {
  height: 28px;
  border: 1px solid var(--line);
  padding: 0;
  vertical-align: middle;
}

.zhx-a6-label,
.zhx-a6-process-table th {
  background: #f7faf9;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}
/* A6工序表 */
.zhx-a6-process-table th:nth-child(1) { width: 28%; }
.zhx-a6-process-table th:nth-child(2) { width: 45%; }
.zhx-a6-process-table th:nth-child(3) { width: 27%; }

.zhx-a6-process-table td {
  font-size: 11px;
  padding: 0 4px;
  white-space: nowrap;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zhx-a6-process-name {
  font-weight: 700;
}


.zhx-a6-paper-input {
  display: grid;
  min-width: 0;
}
.zhx-a6-process-table td {
  min-width: 0;
}

.zhx-a6-paper-input.has-unit {
  grid-template-columns: minmax(0, 1fr) 26px;
}

.zhx-a6-paper-input input,
.zhx-a6-process-table input {
  min-width: 0;
  min-height: 27px;
  border: 0;
  border-radius: 0;
  padding: 0 5px;
  background: #fff;
  font-size: 12px;
}

.zhx-a6-process-table input[readonly] {
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

.zhx-a6-paper-input em {
  display: flex;
  align-items: center;
  justify-content: center;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

#formLibraryPreview .zhx-a6-card {
  gap: 2px;
  font-size: 12px;
}

#formLibraryPreview .zhx-a6-heading-row {
  margin-bottom: 1px;
  min-height: 48px;
}

#formLibraryPreview .zhx-a6-qr-block {
  gap: 6px;
  height: 48px;
  min-width: 146px;
}

#formLibraryPreview .zhx-a6-qr-block .mfg-qr,
#formLibraryPreview .zhx-a6-qr-placeholder {
  width: 48px;
  height: 48px;
}

#formLibraryPreview .zhx-a6-qr-placeholder {
  font-size: 8px;
}

#formLibraryPreview .zhx-a6-order-text {
  font-size: 10px;
  min-width: 92px;
  max-width: 96px;
  min-height: 10px;
}

#formLibraryPreview .zhx-a6-heading-center {
  top: 10px;
  left: 72px;
  min-height: 48px;
}

#formLibraryPreview .zhx-a6-heading-center strong {
  font-size: 19px;
}

#formLibraryPreview .zhx-a6-table td,
#formLibraryPreview .zhx-a6-process-table td,
#formLibraryPreview .zhx-a6-process-table th {
  height: 27px;
}

#formLibraryPreview .zhx-a6-label,
#formLibraryPreview .zhx-a6-process-table th,
#formLibraryPreview .zhx-a6-process-table td {
  font-size: 12px;
}

#formLibraryPreview .zhx-a6-paper-input input,
#formLibraryPreview .zhx-a6-process-table input {
  min-height: 26px;
  font-size: 13px;
}

#formLibraryPreview .zhx-a6-paper-input em {
  font-size: 11px;
}

.manufacturing-card-layout {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

#manufacturingCardForm {
  gap: 9px;
  padding: 10px;
  min-width: 0;
}

#manufacturingCardForm .panel-header {
  margin-bottom: 4px;
}

#manufacturingCardForm label {
  gap: 4px;
  min-width: 0;
}

#manufacturingCardForm label span {
  min-width: 0;
}

#manufacturingCardForm input,
#manufacturingCardForm select {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  border-radius: 6px;
  padding: 0 8px;
}

#manufacturingCardForm .form-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

#manufacturingCardForm .manufacturing-card-number-row {
  grid-template-columns: minmax(0, 1fr) 72px;
}

.manufacturing-card-order-field {
  min-width: 0;
}

.manufacturing-card-no-field input {
  font-weight: 900;
  letter-spacing: 0;
}

.manufacturing-card-count-field input {
  text-align: center;
  font-weight: 900;
}

#manufacturingCardForm .form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
}

#manufacturingCardForm .form-actions button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 8px;
}

#manufacturingCardForm .form-actions .primary-button {
  margin-left: auto;
}

.manufacturing-card-preview-panel {
  min-width: 0;
  overflow-x: auto;
  overflow-y: auto;
}

.manufacturing-card-preview {
  overflow: auto;
  display: grid;
  justify-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  background: #dfe8e6;
}

.manufacturing-card-preview .a4-mfg-sheet {
  position: relative;
  width: 680px;
  max-width: none;
  aspect-ratio: 210 / 297;
  border: 1px solid #a7b5b4;
  background: #fff;
  box-shadow: 0 14px 38px rgb(15 23 42 / 0.14);
  overflow: hidden;
}

.manufacturing-card-preview .a4-mfg-slot {
  position: absolute;
  left: 0;
  top: 0;
  width: 50%;
  height: 50%;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  border-right: 1px dashed #cbd5d1;
  border-bottom: 1px dashed #cbd5d1;
}

.manufacturing-card-preview .a4-mfg-slot:nth-child(1) {
  transform: translate(0, 0);
}

.manufacturing-card-preview .a4-mfg-slot:nth-child(2) {
  transform: translate(100%, 0);
}

.manufacturing-card-preview .a4-mfg-slot:nth-child(3) {
  transform: translate(0, 100%);
}

.manufacturing-card-preview .a4-mfg-slot:nth-child(4) {
  transform: translate(100%, 100%);
}

.manufacturing-card-preview .a4-mfg-slot:nth-child(2n) {
  border-right: 0;
}

.manufacturing-card-preview .a4-mfg-slot:nth-child(n + 3) {
  border-bottom: 0;
}

.manufacturing-card-preview .process-card-paper.zhx-a6-card {
  width: 89.5238%;
  height: 94%;
  min-width: 0;
  padding: 0;
  border: 0;
  gap: 3px;
  overflow: hidden;
  background: #fff;
  color: var(--ink);
  box-shadow: none;
  font-family: "Songti SC", "SimSun", "Microsoft YaHei", sans-serif;
  font-size: 9px;
}

.manufacturing-card-preview .zhx-a6-heading-row {
  gap: 4px;
  margin-bottom: 0;
  min-height: 67px;
}

.manufacturing-card-preview .zhx-a6-qr-block {
  gap: 7px;
  height: 67px;
  min-width: 185px;
}

.manufacturing-card-preview .zhx-a6-qr-block .mfg-qr,
.manufacturing-card-preview .zhx-a6-qr-placeholder {
  width: 67px;
  height: 67px;
}

.manufacturing-card-preview .zhx-a6-order-text {
  flex: 0 0 auto;
  min-width: 126px;
  max-width: 150px;
  overflow: hidden;
  overflow-wrap: normal;
  word-break: normal;
  white-space: nowrap;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-overflow: clip;
  margin-bottom: 3px;
}

.manufacturing-card-preview .zhx-a6-heading-center {
  align-items: flex-start;
  min-height: 67px;
  left: 98px;
  top: 22px;
}

.manufacturing-card-preview .zhx-a6-heading-center strong {
  font-size: 18px;
  line-height: 1.05;
  white-space: nowrap;
}

.manufacturing-card-preview .zhx-a6-table td,
.manufacturing-card-preview .zhx-a6-process-table td,
.manufacturing-card-preview .zhx-a6-process-table th {
  height: 22px;
}

.manufacturing-card-preview .zhx-a6-label,
.manufacturing-card-preview .zhx-a6-process-table th,
.manufacturing-card-preview .zhx-a6-process-table td,
.manufacturing-card-preview .zhx-a6-paper-input input,
.manufacturing-card-preview .zhx-a6-paper-input em {
  font-size: 10px;
}

.manufacturing-card-preview .zhx-a6-paper-input input {
  min-height: 0;
  height: 100%;
  padding: 0 2px;
}

.manufacturing-card-preview .zhx-a6-paper-input.has-unit {
  grid-template-columns: minmax(0, 1fr) 22px;
}

.zhx-label,
.zhx-subhead,
.zhx-section-label,
.zhx-footer-note {
  background: #f7faf9;
  color: var(--muted);
  font-weight: 900;
  text-align: center;
  line-height: 1.15;
}

.zhx-section-label {
  font-size: 12px;
}

.zhx-footer-note {
  height: 30px;
  padding: 0 8px !important;
  text-align: left;
  font-size: 12px;
}

.zhx-input-cell {
  overflow-x: auto;
  overflow-y: auto;
}

.zhx-paper-input,
.zhx-dual-input {
  display: grid;
  width: 100%;
  height: 100%;
  min-width: 0;
  align-items: center;
}

.zhx-paper-input.has-unit {
  grid-template-columns: minmax(0, 1fr) auto;
}

.zhx-paper-input input,
.zhx-dual-input input,
.zhx-note-cell textarea {
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 28px;
  border: 0;
  border-radius: 0;
  padding: 0 4px;
  background: #fff;
  color: var(--ink);
  font-size: 11px;
}

.zhx-paper-input em,
.zhx-dual-input em {
  padding: 0 3px;
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
  line-height: 1.2;
}

.zhx-dual-input {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
}

.zhx-metric-cell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.zhx-metric-cell > span {
  padding: 0 3px;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
  line-height: 1.2;
}

.zhx-note-cell {
  padding: 5px !important;
  vertical-align: top !important;
}

.zhx-note-cell span {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.zhx-note-cell textarea {
  display: block;
  min-height: 58px;
  margin-bottom: 8px;
  padding: 3px;
  border: 1px solid var(--line);
  resize: vertical;
}

.manual-review-input {
  color: #b42318 !important;
  background: #fff1f0 !important;
  font-weight: 900 !important;
}

.process-card-fields .field-row {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.process-card-fields .field-row > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.process-card-fields .field-row input,
.process-card-fields .field-row textarea {
  width: 100%;
}

.process-signature-field {
  align-items: start;
}

.process-signature-editor {
  display: grid;
  gap: 8px;
  overflow-x: auto;
}

.process-signature-head,
.process-signature-row {
  display: grid;
  grid-template-columns: 52px 86px minmax(130px, 1fr) 110px 96px 64px;
  gap: 8px;
  align-items: center;
  min-width: 620px;
}

.process-signature-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.process-signature-row + .process-signature-row {
  margin-top: 8px;
}

.upload-result {
  min-height: 38px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
  color: var(--muted);
  line-height: 1.5;
}

.upload-result.success {
  border-color: rgba(21, 128, 61, 0.28);
  background: #eefaf3;
  color: #0b6b35;
}

.upload-result.error {
  border-color: rgba(194, 65, 61, 0.28);
  background: #fff0f0;
  color: #9f2924;
}

.table-panel {
  overflow-x: auto;
  overflow-y: auto;
}

.process-card-filters {
  display: grid;
  grid-template-columns: repeat(7, minmax(110px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
}

.process-card-filters label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.process-card-filters input,
.process-card-filters select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 9px;
  background: #ffffff;
  color: var(--ink);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.molding-overview-stack {
  display: grid;
  gap: 14px;
}

.molding-overview-panel {
  margin: 0;
}

.molding-machine-table {
  overflow-x: auto;
}

.molding-machine-table table {
  width: 100%;
  table-layout: fixed;
}

.molding-machine-table th,
.molding-machine-table td {
  padding: 7px 6px;
  white-space: normal;
  word-break: break-word;
}

.molding-machine-table th:nth-child(1),
.molding-machine-table td:nth-child(1),
.molding-machine-table th:nth-child(2),
.molding-machine-table td:nth-child(2),
.molding-machine-table th:nth-child(8),
.molding-machine-table td:nth-child(8),
.molding-machine-table th:nth-child(9),
.molding-machine-table td:nth-child(9),
.molding-machine-table th:nth-child(10),
.molding-machine-table td:nth-child(10) {
  text-align: center;
}

.molding-machine-table th:nth-child(1),
.molding-machine-table td:nth-child(1) {
  width: 56px;
}

.molding-machine-table th:nth-child(2),
.molding-machine-table td:nth-child(2) {
  width: 56px;
}

.molding-machine-table th:nth-child(8),
.molding-machine-table td:nth-child(8),
.molding-machine-table th:nth-child(9),
.molding-machine-table td:nth-child(9) {
  width: 68px;
}

.molding-machine-table th:nth-child(10),
.molding-machine-table td:nth-child(10) {
  width: 66px;
}

.molding-tool-panel {
  display: grid;
  gap: 8px;
  padding: 8px 10px;
}

.molding-mold-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8faf9;
  color: var(--muted);
  font-size: 12px;
}

.molding-mold-summary strong {
  color: var(--ink);
}

.molding-tool-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.molding-tool-strip .secondary-button {
  min-height: 30px;
  padding: 0 10px;
}

.molding-tool-strip .secondary-button.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

#moldingWorkbench.inspection-clean > .workspace-layout > .panel > .panel-header,
#moldingWorkbench.inspection-clean #moldingWorkbenchInspection > .panel-header {
  display: none;
}

#moldingWorkbench.inspection-clean > .workspace-layout > .panel {
  padding-top: 0;
}

.inspect-layout {
  display: grid;
  gap: 12px;
  width: 100%;
  padding: 4px 0;
}

.inspect-top-grid {
  display: grid;
  grid-template-columns: repeat(11, minmax(86px, 1fr));
  gap: 6px;
  width: 100%;
  overflow-x: auto;
  padding-bottom: 2px;
}

.inspect-shift-cell,
.inspect-machine-cell {
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.inspect-shift-cell {
  display: grid;
  gap: 3px;
  align-content: center;
  padding: 8px;
}

.inspect-shift-cell span,
.inspect-shift-cell small,
.inspect-machine-detail-head span,
.inspect-detail-field span,
.inspect-defect-entry span,
.inspect-dim-toolbar span,
.inspect-standard-toolbar span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.inspect-shift-cell strong {
  color: var(--blue);
  font-size: 20px;
  line-height: 1.1;
}

.inspect-shift-cell .primary-button {
  min-height: 26px;
  padding: 0 8px;
  font-size: 11px;
}

.inspect-machine-cell {
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 4px;
  padding: 7px;
}

.inspect-machine-cell.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px rgba(15, 118, 110, 0.14);
}

.inspect-machine-number {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: #eef4f3;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.inspect-machine-cell.active .inspect-machine-number {
  background: var(--accent);
  color: #ffffff;
}

.inspect-machine-status {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-align: center;
}

.inspect-power-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.inspect-power-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8faf9;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.inspect-power-action.is-active {
  border-color: rgba(15, 118, 110, 0.28);
  background: #e7f5f1;
  color: var(--accent-strong);
}

.inspect-power-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(23, 33, 43, 0.42);
}

.inspect-power-dialog {
  width: min(720px, 100%);
  max-height: min(680px, calc(100vh - 36px));
  overflow: auto;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 20px 48px rgba(23, 33, 43, 0.2);
}

.inspect-power-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.inspect-power-head strong {
  font-size: 16px;
}

.inspect-power-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.inspect-power-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px;
}

.inspect-power-form label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.inspect-power-form span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.inspect-power-form input,
.inspect-power-form textarea {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 8px;
  color: var(--ink);
  font: inherit;
}

.inspect-power-form textarea {
  min-height: 68px;
  resize: vertical;
}

.inspect-power-wide {
  grid-column: span 3;
}

.inspect-power-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
}

.inspect-machine-panel,
.inspect-defect-panel,
.inspect-dimension-panel,
.inspect-standard-panel {
  width: 100%;
  box-shadow: none;
}

.inspect-defect-panel {
  padding: 4px 10px 6px;
}

.inspect-dimension-panel {
  padding-top: 4px;
}

.inspect-defect-panel .inspect-defect-title,
.inspect-dimension-panel .inspect-dimension-title {
  display: flex;
  align-items: center;
  height: 14px;
  min-height: 14px;
  padding: 0;
  margin: 0 0 3px;
  overflow: hidden;
}

.inspect-defect-panel .inspect-defect-title h3,
.inspect-dimension-panel .inspect-dimension-title h3 {
  margin: 0;
  font-size: 13px;
  line-height: 14px;
}

.inspect-machine-detail-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.inspect-machine-detail-head strong {
  font-size: 16px;
}

.inspect-detail-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 8px;
}

.inspect-detail-field,
.inspect-defect-entry label,
.inspect-dim-toolbar label,
.inspect-standard-toolbar label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.inspect-detail-field input,
.inspect-defect-entry input,
.inspect-dim-toolbar input,
.inspect-dim-toolbar select,
.inspect-standard-toolbar input {
  width: 100%;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 8px;
  background: #ffffff;
  color: var(--ink);
}

.inspect-detail-remark {
  grid-column: span 2;
}

.inspect-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.inspect-defect-workspace {
  display: grid;
  grid-template-columns: minmax(460px, 520px) minmax(560px, 700px);
  align-items: start;
  justify-content: start;
  gap: 8px;
  width: 100%;
}

.inspect-defect-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 6px 6px;
  background: #f8faf9;
}

.inspect-defect-picker legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.inspect-defect-picker label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 21px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 5px;
  background: #ffffff;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.inspect-defect-picker label:has(input:checked) {
  border-color: var(--accent);
  background: #e7f5f1;
  color: var(--accent-strong);
}

.inspect-defect-entry {
  display: grid;
  grid-template-columns: repeat(4, minmax(80px, 1fr)) minmax(172px, auto);
  gap: 6px;
  align-content: start;
  width: min(100%, 700px);
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.inspect-defect-entry input {
  min-height: 28px;
  padding: 0 6px;
}

.inspect-defect-entry output {
  display: grid;
  place-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8faf9;
  color: var(--red);
  font-weight: 900;
}

.inspect-defect-entry-actions {
  display: flex;
  align-self: end;
  justify-content: flex-end;
  gap: 6px;
  min-width: 172px;
}

.inspect-defect-entry-actions .primary-button,
.inspect-defect-entry-actions .secondary-button {
  min-height: 28px;
  padding: 0 10px;
  white-space: nowrap;
}

.inspect-dim-toolbar,
.inspect-standard-toolbar {
  display: grid;
  grid-template-columns: minmax(170px, 220px) minmax(160px, 220px) auto auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 10px;
}

.inspect-standard-toolbar {
  grid-template-columns: minmax(220px, 320px) auto;
}

.inspect-dim-hint {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.inspect-dimension-scroll {
  width: 100%;
  overflow-x: auto;
}

.inspect-dimension-table {
  width: max(100%, 1060px);
  border-collapse: collapse;
}

.inspect-dimension-table th,
.inspect-dimension-table td,
.inspect-standard-panel th,
.inspect-standard-panel td {
  border: 1px solid var(--line);
  padding: 4px;
  text-align: center;
}

.inspect-dimension-table th {
  background: #eef4f3;
  color: var(--ink);
  font-size: 12px;
}

.inspect-dimension-table tbody th {
  position: sticky;
  left: 0;
  min-width: 82px;
  background: #f8faf9;
  z-index: 1;
}

.inspect-dimension-table td {
  min-width: 46px;
}

.inspect-dimension-table input {
  width: 100%;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 4px;
  text-align: center;
}

.molding-tool-content {
  min-width: 0;
}

.molding-tool-section {
  display: grid;
  gap: 6px;
}

.molding-tool-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}

.molding-query-row {
  display: grid;
  grid-template-columns: minmax(200px, 300px) auto;
  gap: 8px;
  align-items: end;
}

.molding-query-row label,
.molding-report-filters label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.molding-query-row input,
.molding-report-filters input,
.molding-report-filters select {
  width: 100%;
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
}

.molding-query-result {
  display: grid;
  gap: 4px;
}

.molding-query-result th,
.molding-query-result td {
  padding: 6px 8px;
}

.molding-daily-panel {
  display: grid;
  gap: 12px;
}

.molding-report-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr)) auto auto auto;
  gap: 10px;
  align-items: end;
}

.molding-daily-table {
  overflow-x: auto;
}

.molding-daily-table table {
  width: 100%;
  table-layout: fixed;
}

.molding-daily-table th,
.molding-daily-table td {
  padding: 7px 6px;
  white-space: normal;
  word-break: break-word;
}

.desktop-driver-form {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfb;
}

.desktop-driver-route,
.desktop-driver-scan,
.desktop-driver-meta {
  display: grid;
  gap: 10px;
  align-items: end;
}

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

.desktop-driver-scan {
  grid-template-columns: minmax(240px, 1fr) auto auto auto;
}

.desktop-driver-meta {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.desktop-driver-route label,
.desktop-driver-scan label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.desktop-driver-route select,
.desktop-driver-scan input,
.desktop-driver-meta input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #ffffff;
  color: var(--ink);
  font-size: 14px;
}

.desktop-driver-meta strong {
  min-width: 88px;
  color: var(--accent-strong);
  font-size: 14px;
}

.desktop-driver-scan-list {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  max-height: 132px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

.process-row-details {
  min-width: 320px;
}

.process-row-details summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 900;
}

.process-row-details table {
  width: 100%;
  min-width: 0;
  margin-top: 6px;
  border-collapse: collapse;
  font-size: 12px;
}

.process-row-details th,
.process-row-details td {
  padding: 4px 5px;
  white-space: nowrap;
  line-height: 1.2;
}

.process-card-record-table {
  width: auto;
  min-width: 0;
  table-layout: auto;
  font-size: 12px;
}

.process-card-record-table th,
.process-card-record-table td {
  padding: 3px 3px;
  line-height: 1.15;
  vertical-align: top;
  word-break: break-word;
}

.process-card-record-table th:nth-child(1),
.process-card-record-table td:nth-child(1) {
  width: 56px;
  white-space: nowrap;
  line-height: 1.2;
}

.process-card-record-table th:nth-child(2),
.process-card-record-table td:nth-child(2) {
  width: 68px;
}

.process-card-record-table th:nth-child(3),
.process-card-record-table td:nth-child(3) {
  width: 116px;
  white-space: nowrap;
  line-height: 1.2;
}

.process-card-record-table th:nth-child(4),
.process-card-record-table td:nth-child(4),
.process-card-record-table th:nth-child(5),
.process-card-record-table td:nth-child(5) {
  width: 48px;
}

.process-card-record-table th:nth-child(6),
.process-card-record-table td:nth-child(6) {
  width: 142px;
}

.process-card-record-table th:nth-child(7),
.process-card-record-table td:nth-child(7) {
  width: 46px;
}

.process-card-record-table th:nth-child(8),
.process-card-record-table td:nth-child(8),
.process-card-record-table th:nth-child(9),
.process-card-record-table td:nth-child(9),
.process-card-record-table th:nth-child(10),
.process-card-record-table td:nth-child(10) {
  width: 48px;
}

.process-card-record-table th:nth-child(11),
.process-card-record-table td:nth-child(11) {
  width: 250px;
}

.process-card-record-table th:nth-child(12),
.process-card-record-table td:nth-child(12) {
  width: 58px;
}

.process-card-record-table th:nth-child(13),
.process-card-record-table td:nth-child(13) {
  width: 94px;
}

.process-card-record-table .row-actions {
  gap: 4px;
  flex-wrap: wrap;
}

.process-card-record-table .ghost-button {
  min-height: 24px;
  padding: 0 4px;
  font-size: 11px;
}

.process-card-record-table .process-row-details {
  min-width: 0;
}

.process-card-record-list {
  display: grid;
  gap: 4px;
}

.process-card-record-item {
  display: grid;
  gap: 3px;
  padding: 5px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.process-card-record-item.selected {
  border-color: var(--accent);
  background: #f1fbf8;
  box-shadow: inset 3px 0 0 var(--accent);
}

.process-card-record-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  min-width: 0;
  white-space: nowrap;
  line-height: 1.2;
}

.record-main-fields {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow-x: auto;
}

.record-mini-field {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.15;
}

.record-mini-field b {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.record-mini-field.strong {
  font-weight: 900;
}

.record-mini-field.wide {
  max-width: 190px;
  overflow-x: auto;
  overflow-y: auto;
  text-overflow: ellipsis;
}

.status-field {
  flex: 0 0 auto;
}

.record-actions {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
}

.record-actions .ghost-button {
  min-height: 22px;
  padding: 0 4px;
  font-size: 11px;
}

.process-card-record-processes {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 1px;
}

.process-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  min-height: 21px;
  padding: 1px 4px;
  border: 1px solid #e1e9e6;
  border-radius: 5px;
  background: #f8faf9;
  font-size: 11px;
  line-height: 1.1;
}

.manual-review-input,
.process-signature-row.manual-review-row input.manual-review-input,
.process-row-edit-table input.manual-review-input {
  border-color: #f0a6a6 !important;
  background: #fff1f1 !important;
  color: var(--red) !important;
  font-weight: 900;
}

.process-card-employee-suggest {
  position: fixed;
  z-index: 10020;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 36px rgba(23, 33, 43, 0.18);
  padding: 4px;
}

.process-card-employee-suggest[hidden] {
  display: none;
}

.process-card-employee-suggest button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  padding: 0 8px;
  text-align: left;
}

.process-card-employee-suggest button:hover {
  background: #e7f5f1;
}

.process-card-employee-suggest strong {
  min-width: 34px;
  color: var(--accent-strong);
  font-size: 12px;
}

.process-card-employee-suggest span,
.process-card-employee-empty {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.process-card-employee-empty {
  padding: 8px;
  color: var(--muted);
}

.manual-review-row {
  background: #fff8f8;
}

.process-step-pill.manual-review {
  border-color: #f0a6a6;
  background: #fff1f1;
  color: var(--red);
}

.process-step-pill.manual-review em,
.process-step-pill.manual-review strong,
.process-step-pill.manual-review span,
.process-step-pill.manual-review time {
  color: var(--red);
}

.process-card-record-item:not(.inline-edit-row) {
  grid-template-columns: minmax(0, 1fr) 142px;
  align-items: center;
  column-gap: 8px;
}

.process-card-record-item:not(.inline-edit-row) .process-card-record-main {
  display: contents;
}

.process-card-record-item:not(.inline-edit-row) .record-main-fields {
  grid-column: 1;
  grid-row: 1;
  gap: 7px;
  overflow-x: auto;
  overflow-y: auto;
}

.process-card-record-item:not(.inline-edit-row) .record-mini-field {
  font-size: 13px;
}

.process-card-record-item:not(.inline-edit-row) .record-mini-field b {
  font-size: 12px;
}

.process-card-record-item:not(.inline-edit-row) .record-mini-field.wide {
  max-width: 320px;
}

.process-card-record-item:not(.inline-edit-row) .record-actions {
  display: grid;
  grid-column: 2;
  grid-row: 1 / span 2;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  width: 142px;
  align-self: center;
}

.process-card-record-item:not(.inline-edit-row) .record-actions .ghost-button {
  min-height: 26px;
  padding: 0 5px;
  font-size: 11px;
}

.process-card-record-item:not(.inline-edit-row) .process-card-record-processes {
  display: grid;
  grid-column: 1;
  grid-row: 2;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 4px;
  overflow: visible;
}

.process-card-record-item:not(.inline-edit-row) .process-step-pill {
  min-width: 0;
  min-height: 24px;
  justify-content: flex-start;
  padding: 2px 6px;
  font-size: 12px;
}

.process-step-pill b {
  color: var(--accent-strong);
}

.process-step-pill strong {
  font-size: 11px;
}

.process-step-pill em,
.process-step-pill time {
  color: var(--muted);
  font-style: normal;
}

.process-card-record-list input,
.process-card-record-table input {
  width: 100%;
  min-height: 22px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 3px;
  background: #ffffff;
  color: var(--ink);
  font-size: 11px;
}

.inline-edit-row {
  background: #fbf8ee;
}

.inline-edit-row .record-main-fields {
  flex-wrap: wrap;
  overflow: visible;
}

.inline-edit-row .record-mini-field {
  width: auto;
}

.inline-edit-row .record-mini-field input {
  width: 84px;
}

.inline-edit-row .record-mini-field.unit-field input {
  width: 52px;
}

.field-unit {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.inline-edit-row .record-mini-field.wide input {
  width: 150px;
}

.process-row-inline-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  font-size: 11px;
}

.process-row-inline-table th,
.process-row-inline-table td {
  padding: 2px 3px;
  border-bottom: 1px solid #e7eeeb;
  white-space: nowrap;
  line-height: 1.2;
}

.process-row-inline-table th {
  color: var(--muted);
  background: #f8faf9;
  font-weight: 800;
}

.process-row-edit-table input {
  min-width: 0;
  min-height: 20px;
  padding: 1px 2px;
  font-size: 11px;
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  background: #f7faf9;
}

td {
  color: var(--ink);
}

.table-subtext {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.select-column {
  width: 42px;
  min-width: 42px;
  text-align: center;
}

.select-column input {
  width: 16px;
  height: 16px;
}

.row-actions {
  display: flex;
  gap: 6px;
}

.icon-button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
}

.icon-button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.mini-progress {
  display: grid;
  grid-template-columns: minmax(70px, 1fr) 44px;
  align-items: center;
  gap: 8px;
}

.segmented-control {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf9;
}

.segmented-control button {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  padding: 0 9px;
  background: transparent;
  color: var(--muted);
}

.segmented-control button.active {
  background: #ffffff;
  color: var(--accent-strong);
  box-shadow: 0 2px 8px rgba(30, 50, 60, 0.08);
}

.schedule-board {
  display: grid;
  grid-template-columns: 160px repeat(5, minmax(150px, 1fr));
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.schedule-cell,
.schedule-head,
.workcenter-head {
  min-height: 82px;
  padding: 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.schedule-head,
.workcenter-head {
  min-height: 48px;
  background: #f7faf9;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.workcenter-head {
  display: flex;
  align-items: center;
  color: var(--ink);
}

.schedule-job {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 8px;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: #eef8f6;
}

.schedule-job strong {
  font-size: 13px;
}

.schedule-job span {
  color: var(--muted);
  font-size: 12px;
}

.equipment-grid,
.report-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.equipment-card {
  display: grid;
  gap: 12px;
  min-height: 158px;
  padding: 14px;
  background: #ffffff;
}

.gauge {
  --value: 70;
  width: 100%;
  height: 10px;
  overflow-x: auto;
  overflow-y: auto;
  border-radius: 999px;
  background: #e6ecee;
}

.gauge::before {
  content: "";
  display: block;
  width: calc(var(--value) * 1%);
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.equipment-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.report-tile {
  display: grid;
  gap: 8px;
  min-height: 126px;
  padding: 16px;
  text-align: left;
  color: var(--ink);
}

.report-tile:hover {
  border-color: var(--accent);
  background: #f7fbfa;
}

.finance-note {
  display: grid;
  gap: 8px;
  min-height: 126px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.finance-note span {
  color: var(--muted);
  line-height: 1.6;
}

.review-target {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfb;
  color: var(--muted);
  font-weight: 700;
}

.master-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.master-card {
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.master-card strong {
  font-size: 15px;
}

.master-card span,
.master-card li {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.master-card ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 16px;
}


.table-avatar {
  display: block;
  width: 44px;
  height: 58px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #f7faf9;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.login-panel {
  width: min(100%, 420px);
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-brand {
  color: var(--ink);
  border-bottom-color: var(--line);
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.login-form input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
}

.login-helper {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.login-helper a {
  color: var(--accent-strong);
  font-weight: 800;
}

.login-register-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfb;
  color: var(--muted);
  font-size: 13px;
}

.login-register-entry .secondary-button {
  min-height: 34px;
  flex: 0 0 auto;
}

.login-result {
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8fbfb;
  color: var(--muted);
}

.login-result.success {
  color: var(--accent-strong);
  background: #e8f7f3;
}

.login-result.error {
  color: var(--red);
  background: #fdeeee;
}

.login-plant-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfb;
}

.login-plant-panel[hidden] {
  display: none;
}

.login-plant-panel h2,
.login-plant-panel p {
  margin: 0;
}

.login-plant-panel h2 {
  font-size: 17px;
}

.login-plant-panel p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.login-plant-grid {
  display: grid;
  gap: 8px;
}

.login-plant-button {
  display: grid;
  gap: 4px;
  min-height: 68px;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 8px;
  padding: 11px;
  background: #eef8f5;
  color: var(--accent-strong);
  text-align: left;
}

.login-plant-button strong {
  font-size: 17px;
}

.login-plant-button span {
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 40px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #17212b;
  color: #ffffff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.empty-state {
  display: grid;
  min-height: 72px;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f8fbfb;
}

@media (max-width: 1180px) {
  .metric-grid,
  .task-strip,
  .equipment-grid,
  .report-grid,
  .master-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-columns,
  .workspace-layout,
  .manufacturing-card-layout,
  .workspace-layout.compact-left {
    grid-template-columns: 1fr;
  }

  .process-card-review-workbench {
    grid-template-columns: 1fr;
  }

  .process-card-desktop-workbench {
    grid-template-columns: 1fr;
  }

  .process-card-card-column,
  .process-card-photo-column,
  .process-card-electronic-column {
    max-height: none;
  }

  .process-card-photo-column .process-card-photo-frame {
    min-height: 420px;
  }

  .process-card-workspace #processCardUploadForm {
    grid-template-columns: 1fr;
  }

  .process-card-photo-frame {
    position: static;
    min-height: 420px;
  }
}

@media (max-width: 780px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 14px;
  }

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

  .nav-section-label {
    grid-column: 1 / -1;
    margin: 8px 4px 0;
  }

  .nav-item {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 3px;
    min-height: 58px;
    padding: 6px;
    text-align: center;
  }

  .nav-icon {
    font-size: 15px;
  }

  .main-panel {
    padding: 16px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    align-items: stretch;
    flex-wrap: wrap;
    min-width: 0;
    justify-content: flex-start;
  }

  .search-box {
    flex: 1 1 100%;
    min-width: 0;
  }

  .metric-grid,
  .task-strip,
  .equipment-grid,
  .report-grid,
  .master-grid {
    grid-template-columns: 1fr;
  }

  .progress-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .plant-map {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .line-rail {
    width: 4px;
    height: 20px;
    justify-self: center;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-actions {
    width: 100%;
    justify-content: flex-start;
  }

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

  .segmented-control {
    width: 100%;
    overflow-x: auto;
  }

  .segmented-control button {
    flex: 1 0 auto;
  }
}

@media (max-width: 520px) {
  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar-actions .primary-button,
  .topbar-actions .secondary-button {
    flex: 1 1 150px;
  }
}

.search-input {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  outline: 0;
}
.search-input:focus {
  border-color: var(--primary);
}

/* 导航子项 */
.nav-subitem {
  display: block;
  width: 100%;
  min-height: 32px;
  padding: 4px 10px 4px 18px;
  font-size: 15px;
  font-weight: 700;
  color: #dce8e6;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  line-height: 1.25;
  transition: color 0.15s;
  white-space: normal;
}
.nav-subitem:hover {
  color: var(--primary, #2563eb);
}
.nav-subitem.active {
  color: var(--primary, #2563eb);
  font-weight: 600;
}

/* 产品/模具档案：左列表右表单布局 */
.reversed-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 16px;
  align-items: stretch;
  min-height: 0;
  height: calc(100vh - 100px);
}
.reversed-layout .list-panel {
  min-width: 0;
  overflow-x: auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
.reversed-layout .form-detail {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow-y: auto;
}
.reversed-layout .list-panel .table-wrap {
  max-height: 100%;
  overflow-y: auto;
}

/* ── 成型工作台增强样式 ── */
.info-value {
  font-weight: 600;
}
.mold-loc-section,
.mold-hist-section {
  margin-bottom: 12px;
  padding: 12px;
  background: #f9fafb;
  border-radius: 6px;
}
.info-remark-row {
  padding: 6px 12px;
  background: #fef3c7;
  border-radius: 4px;
  font-size: 0.9em;
  display: none;
}

.form-detail .form-row label.compact {
  font-size: 11px;
}
.form-detail .form-row label.compact > span {
  font-size: 10px;
  margin-bottom: 1px;
}
.form-detail .form-row label.compact input,
.form-detail .form-row label.compact select {
  font-size: 11px;
  padding: 3px 5px;
  height: 26px;
}
/* Product form: constrain height to avoid scrolling */

.form-detail#productForm .form-row {
  margin-bottom: 4px;
}
.form-detail#productForm .form-row label {
  flex: 1;
  min-width: 0;
}
.form-detail#productForm .form-actions {
  padding-top: 4px;
  margin-top: auto;
  border-top: none;
}
.form-detail#productForm .panel-header {
  padding-bottom: 4px;
}

/* Product form: compact layout */
.form-detail#productForm .form-row {
  margin-bottom: 3px;
  gap: 4px;
}
.form-detail#productForm .form-row label.compact {
  font-size: 11px;
  flex: 1;
  min-width: 0;
}
.form-detail#productForm .form-row label.compact > span {
  font-size: 10px;
  margin-bottom: 1px;
  white-space: nowrap;
  line-height: 1.2;
}
.form-detail#productForm .form-row label.compact input,
.form-detail#productForm .form-row label.compact select {
  font-size: 11px;
  padding: 2px 5px;
  height: 24px;
  box-sizing: border-box;
  width: 100%;
}
.form-detail#productForm .form-actions {
  padding: 4px 0 0;
  margin-top: 2px;
  border-top: none;
}
.form-detail#productForm .panel-header {
  padding-bottom: 2px;
  margin-bottom: 2px;
}
.form-detail#productForm {
  display: flex;
  flex-direction: column;
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 110px);
}

/* 出货登记电子版：缩小以完整显示表格 */
.process-card-correction-fields .process-card-paper {
  font-size: 10px;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}
.process-card-correction-fields .paper-title {
  min-width: 0;
  padding: 4px 6px;
  font-size: 12px;
}
.process-card-correction-fields .paper-layout {
  min-width: 0;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 4px;
}
.process-card-correction-fields .paper-left-panel {
  min-width: 0;
}
.process-card-correction-fields .paper-main-panel {
  min-width: 0;
}
.process-card-correction-fields .paper-field {
  grid-template-columns: 48px minmax(0, 1fr);
  min-height: 22px;
  gap: 2px;
}
.process-card-correction-fields .paper-field span,
.process-card-correction-fields .paper-special > span,
.process-card-correction-fields .paper-cell span {
  font-size: 9px;
  padding: 0 3px;
}
.process-card-correction-fields .paper-field input,
.process-card-correction-fields .paper-special input,
.process-card-correction-fields .paper-cell input {
  min-height: 20px;
  font-size: 9px;
  padding: 0 3px;
}
.process-card-correction-fields .paper-row {
  gap: 2px;
  margin: 0;
}
.process-card-correction-fields .paper-extra-grid {
  min-width: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
}
.process-card-correction-fields .paper-special {
  grid-template-columns: 50px minmax(0, 1fr);
  min-height: 24px;
}
.process-card-correction-fields .paper-qr {
  min-height: 36px;
  font-size: 8px;
}
.process-card-correction-fields .process-signature-editor {
  gap: 3px;
}
.process-card-correction-fields .process-signature-head,
.process-card-correction-fields .process-signature-row {
  font-size: 9px;
  min-height: 22px;
}
.process-card-correction-fields .process-signature-row input {
  font-size: 9px;
  padding: 0 3px;
  min-height: 20px;
}

/* ===== A6 批量打印（A4 4-up） ===== */

/* Screen preview wrapper */
.batch-print-wrapper {
  max-width: 210mm;
  margin: 0 auto;
  padding: 20px 10px;
  background: #f3f4f6;
  min-height: 100vh;
}

.batch-print-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  margin-bottom: 16px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.batch-print-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.batch-print-actions {
  display: flex;
  gap: 8px;
}

/* A4 sheet — single sheet containing 4 A6 cards in 2×2 grid */
.batch-print-sheet {
  width: 210mm;
  height: 297mm;
  margin: 20px auto;
  background: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  page-break-after: always;
}

/* 2×2 grid filling the A4 sheet exactly */
.batch-print-grid {
  display: grid;
  grid-template-columns: 105mm 105mm;
  grid-template-rows: 148mm 148mm;
  width: 210mm;
  height: 297mm;
}

/* Each A6 card slot with crop marks */
.batch-print-cell {
  position: relative;
  width: 105mm;
  height: 148mm;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Crop marks — 2.5mm lines at each corner */
.batch-print-cell::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 10;
}

/* Top-left crop mark */
.batch-print-cell .crop-tl {
  position: absolute;
  top: -0.5mm;
  left: -0.5mm;
  width: 3mm;
  height: 1px;
  background: #999;
}
.batch-print-cell .crop-tl2 {
  position: absolute;
  top: -0.5mm;
  left: -0.5mm;
  width: 1px;
  height: 3mm;
  background: #999;
}

/* Top-right crop mark */
.batch-print-cell .crop-tr {
  position: absolute;
  top: -0.5mm;
  right: -0.5mm;
  width: 3mm;
  height: 1px;
  background: #999;
}
.batch-print-cell .crop-tr2 {
  position: absolute;
  top: -0.5mm;
  right: -0.5mm;
  width: 1px;
  height: 3mm;
  background: #999;
}

/* Bottom-left crop mark */
.batch-print-cell .crop-bl {
  position: absolute;
  bottom: -0.5mm;
  left: -0.5mm;
  width: 3mm;
  height: 1px;
  background: #999;
}
.batch-print-cell .crop-bl2 {
  position: absolute;
  bottom: -0.5mm;
  left: -0.5mm;
  width: 1px;
  height: 3mm;
  background: #999;
}

/* Bottom-right crop mark */
.batch-print-cell .crop-br {
  position: absolute;
  bottom: -0.5mm;
  right: -0.5mm;
  width: 3mm;
  height: 1px;
  background: #999;
}
.batch-print-cell .crop-br2 {
  position: absolute;
  bottom: -0.5mm;
  right: -0.5mm;
  width: 1px;
  height: 3mm;
  background: #999;
}

/* Center cut guides (hairline crosses at sheet midpoints) */
.batch-print-sheet .cut-h {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  background: #ccc;
  opacity: 0.5;
  pointer-events: none;
  z-index: 10;
}
.batch-print-sheet .cut-v {
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 100%;
  background: #ccc;
  opacity: 0.5;
  pointer-events: none;
  z-index: 10;
}

/* Scaled-down A6 card inside each cell */
.batch-print-cell .process-card-paper.zhx-a6-card {
  width: 100mm;
  height: 143mm;
  padding: 3mm;
  border: 1px solid #ccc;
  gap: 4px;
  font-size: 11px;
  overflow: hidden;
  box-sizing: border-box;
}

.batch-print-cell .zhx-a6-heading-center strong {
  font-size: 17px;
}

.batch-print-cell .zhx-a6-heading-row {
  min-height: 55px;
}

.batch-print-cell .zhx-a6-qr-block {
  gap: 6px;
  min-width: 0;
  height: 55px;
}

.batch-print-cell .zhx-a6-heading-center {
  min-height: 55px;
  left: 83px;
  top: 17px;
}

.batch-print-cell .zhx-a6-qr-block .mfg-qr {
  width: 55px;
  height: 55px;
}

.batch-print-cell .zhx-a6-qr-placeholder {
  width: 55px;
  height: 55px;
  font-size: 8px;
}

.batch-print-cell .zhx-a6-order-text {
  font-size: 9px;
  max-width: 120px;
  min-width: 110px;
}

.batch-print-cell .zhx-a6-table td,
.batch-print-cell .zhx-a6-process-table td,
.batch-print-cell .zhx-a6-process-table th {
  height: 27px;
  font-size: 11px;
  padding: 0 2px;
}

.batch-print-cell .zhx-a6-label,
.batch-print-cell .zhx-a6-process-table th {
  font-size: 11px;
}

.batch-print-cell .zhx-a6-paper-input input,
.batch-print-cell .zhx-a6-paper-input em {
  font-size: 11px;
}

/* ===== Print-only styles ===== */
@media print {
  @page {
    size: A4;
    margin: 0;
  }
  body * {
    visibility: hidden;
  }
  .batch-print-sheet,
  .batch-print-sheet * {
    visibility: visible;
  }
  .batch-print-sheet {
    position: absolute;
    top: 0;
    left: 0;
    width: 210mm;
    height: 297mm;
    margin: 0;
    box-shadow: none;
  }
  .batch-print-wrapper,
  .batch-print-header {
    display: none;
  }
  .batch-print-cell .process-card-paper.zhx-a6-card {
    border: none;
  }
  .cut-h, .cut-v {
    display: block !important;
  }
}
