:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --line: #d9e0e7;
  --text: #1f2933;
  --muted: #667085;
  --primary: #1f7a5f;
  --primary-dark: #145843;
  --accent: #2f6fed;
  --warn: #b7791f;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 18px 40px rgba(31, 41, 51, 0.08);
}

.brand,
.side-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  margin-bottom: 28px;
}

.brand h1,
.topbar h2,
.panel h3 {
  margin: 0;
}

.brand p,
.topbar p,
.side-brand span {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(47, 111, 237, 0.18);
  border-color: var(--accent);
}

form button,
.secondary-btn,
.secondary-link-btn,
.ghost-btn {
  min-height: 40px;
  border-radius: 6px;
  padding: 0 14px;
  font-weight: 600;
}

form button {
  width: 100%;
  background: var(--primary);
  color: #fff;
  margin-top: 12px;
}

form button:hover {
  background: var(--primary-dark);
}

.secondary-btn {
  background: #e8f0ff;
  color: #1d4ed8;
}

.secondary-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e8f0ff;
  color: #1d4ed8;
  text-decoration: none;
}

.ghost-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.form-message {
  min-height: 20px;
  color: var(--danger);
  margin: 12px 0 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #16212b;
  color: #fff;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.side-brand span {
  display: block;
  color: #aab4bf;
}

.nav-list {
  display: grid;
  gap: 16px;
  align-content: start;
  overflow: auto;
  padding-right: 4px;
}

.nav-group {
  display: grid;
  gap: 6px;
}

.nav-group-label {
  padding: 0 10px;
  color: #8fa0b3;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.nav-item {
  min-height: 42px;
  background: transparent;
  color: #c7d0da;
  border-radius: 6px;
  text-align: left;
  padding: 0 12px;
}

.nav-item.active,
.nav-item:hover {
  background: #243342;
  color: #fff;
}

.sidebar .ghost-btn {
  margin-top: auto;
  color: #c7d0da;
  border-color: #344556;
}

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

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

.top-actions,
.filters {
  display: flex;
  gap: 10px;
  align-items: center;
}

.production-filter-stack {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.production-filters {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.segmented-filter {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: #eef2f6;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.segmented-btn {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.segmented-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 14px rgba(47, 111, 237, 0.18);
}

.filter-field {
  gap: 4px;
  font-size: 12px;
}

.filter-field span {
  color: var(--muted);
}

.production-filters .filter-field input,
.production-filters .filter-field select {
  height: 36px;
  padding: 7px 10px;
}

.production-filters .keyword-field input {
  width: 240px;
}

.filter-hint {
  color: var(--muted);
  font-size: 13px;
}

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

.production-focus-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.production-focus-card span,
.production-focus-card small {
  color: var(--muted);
}

.production-focus-card strong {
  font-size: 18px;
  line-height: 1.3;
}

.production-focus-card button {
  justify-self: start;
  margin-top: 2px;
}

.inline-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.inline-control .secondary-btn {
  width: auto;
  margin-top: 0;
  background: #e8f0ff;
  color: #1d4ed8;
  white-space: nowrap;
}

.top-actions input,
.filters input,
.filters select {
  width: 180px;
}

.view {
  display: none;
}

.active-view {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric-card {
  padding: 18px;
}

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

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

.workbench-panel {
  margin-bottom: 18px;
}

.process-ribbon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.process-ribbon i {
  width: 14px;
  height: 1px;
  background: var(--line);
}

.workbench-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.workbench-card {
  min-height: 116px;
  border: 1px solid var(--line);
  border-left: 4px solid #93c5fd;
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  display: grid;
  gap: 6px;
  text-align: left;
  font: inherit;
  color: var(--text);
  cursor: pointer;
}

.workbench-card.info {
  border-left-color: #3b82f6;
}

.workbench-card.success {
  border-left-color: #16a34a;
}

.workbench-card.warning {
  border-left-color: #d97706;
}

.workbench-card.danger {
  border-left-color: #dc2626;
}

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

.workbench-card span,
.workbench-card small {
  color: var(--muted);
}

.workbench-card span {
  font-size: 12px;
}

.workbench-card strong {
  font-size: 28px;
}

.workbench-card small {
  font-size: 12px;
  line-height: 1.5;
}

.workbench-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.9fr);
  gap: 16px;
}

.workbench-block {
  min-width: 0;
}

.workbench-focus-list {
  display: grid;
  gap: 10px;
}

.workbench-focus-item {
  width: 100%;
  border: 1px solid var(--line);
  border-left: 4px solid #d97706;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  text-align: left;
  font: inherit;
  color: var(--text);
  cursor: pointer;
}

.workbench-focus-item.danger {
  border-left-color: #dc2626;
}

.workbench-focus-item.warning {
  border-left-color: #d97706;
}

.workbench-focus-item.info {
  border-left-color: #3b82f6;
}

.workbench-focus-item span,
.workbench-focus-item strong,
.workbench-focus-item small {
  display: block;
}

.workbench-focus-item span,
.workbench-focus-item small {
  color: var(--muted);
}

.workbench-focus-item span {
  font-size: 12px;
}

.workbench-focus-item strong {
  margin: 4px 0;
  font-size: 15px;
}

.workbench-focus-item small {
  font-size: 12px;
  line-height: 1.5;
}

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

.workbench-actions .secondary-btn {
  width: 100%;
  margin-top: 0;
}

.split-grid,
.order-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

.task-top-grid {
  grid-template-columns: minmax(0, 1fr) 320px;
  margin-bottom: 16px;
}

.production-summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 16px;
}

.purchase-entry-layout {
  display: grid;
  grid-template-columns: minmax(720px, 1fr) 340px;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.purchase-side-stack {
  display: grid;
  gap: 16px;
  align-content: start;
  position: sticky;
  top: 24px;
}

.purchase-order-panel {
  min-height: 438px;
}

.purchase-form {
  display: grid;
  gap: 14px;
}

.purchase-meta-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) minmax(150px, 0.8fr) minmax(150px, 0.8fr);
  gap: 12px;
  align-items: end;
}

.purchase-meta-grid .wide-field {
  grid-column: 1 / -1;
}

.purchase-buyer-block {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #fbfcfd;
}

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

.section-inline-head span {
  color: var(--muted);
  font-size: 12px;
}

.purchase-buyer-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(120px, 0.7fr) minmax(140px, 0.7fr);
  gap: 12px;
}

.purchase-buyer-grid .wide-field {
  grid-column: 1 / -1;
}

.seal-upload-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px;
  gap: 12px;
  align-items: end;
  margin-top: 10px;
}

.seal-upload-row input[type="file"] {
  padding: 7px 8px;
}

.seal-preview-box {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  align-items: center;
}

.seal-preview-box img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: #fff;
}

.seal-preview-box img.is-empty {
  display: none;
}

.seal-preview-box .ghost-btn {
  min-height: 34px;
  padding: 0 10px;
}

.purchase-items-wrap {
  max-height: 330px;
}

.purchase-item-table {
  min-width: 1080px;
}

.purchase-item-table th:first-child,
.purchase-item-table td:first-child {
  min-width: 180px;
}

.purchase-item-table th:nth-child(3),
.purchase-item-table td:nth-child(3),
.purchase-item-table th:nth-child(5),
.purchase-item-table td:nth-child(5),
.purchase-item-table th:nth-child(6),
.purchase-item-table td:nth-child(6) {
  width: 96px;
}

.purchase-draft-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

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

.purchase-ledger-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  width: fit-content;
  padding: 4px;
  background: #eef2f6;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.purchase-ledger-tabs .segmented-btn {
  min-width: 92px;
}

.supplier-quick-panel {
  padding: 14px;
}

.supplier-quick-panel .panel-head,
.supplier-list-panel .panel-head {
  margin-bottom: 10px;
}

.compact-form {
  gap: 10px;
}

.compact-form label {
  gap: 5px;
}

.compact-form input,
.compact-form textarea,
.compact-form select {
  padding: 8px 10px;
}

.compact-form button {
  min-height: 36px;
}

.two-col-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.supplier-list-panel {
  padding: 14px;
}

.supplier-mini-table {
  max-height: 260px;
}

.supplier-mini-table table {
  min-width: 460px;
}

.supplier-mini-table th,
.supplier-mini-table td {
  padding: 8px;
  font-size: 13px;
}

.shipping-template-designer-panel {
  margin-bottom: 16px;
}

.shipping-template-form {
  display: grid;
  gap: 14px;
}

.shipping-template-top {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(180px, 1fr) repeat(3, minmax(92px, 0.5fr));
  gap: 12px;
  align-items: end;
}

.shipping-template-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
  align-items: start;
}

.shipping-template-editor,
.shipping-template-preview {
  min-width: 0;
}

.label-template-table-wrap {
  max-height: 360px;
}

.label-template-table {
  min-width: 940px;
}

.label-template-table th,
.label-template-table td {
  padding: 7px;
  font-size: 12px;
}

.label-template-table input,
.label-template-table select {
  min-height: 32px;
  padding: 6px 8px;
  font-size: 12px;
}

.label-template-table .ghost-btn {
  min-height: 30px;
  padding: 0 8px;
}

.tight-actions {
  gap: 4px;
  flex-wrap: nowrap;
}

.designer-preview {
  min-height: 220px;
  justify-content: center;
  align-content: flex-start;
}

.designer-preview .shipment-label {
  transform: scale(0.92);
  transform-origin: top center;
}

.side-stack {
  display: grid;
  gap: 16px;
  align-content: start;
}

.code-pill {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border-radius: 6px;
  background: #ecfdf3;
  color: #146c43;
  border: 1px solid #b7e4c7;
  padding: 0 10px;
  font-weight: 700;
  font-size: 13px;
}

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

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

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

.panel-actions select {
  min-height: 40px;
  width: auto;
}

.inline-print-control {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.inline-print-control input {
  width: 74px;
  min-height: 40px;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.compact-table-wrap {
  max-height: 280px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

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

th {
  background: #f8fafc;
  color: #475467;
  font-weight: 600;
}

td input,
td select {
  min-width: 92px;
  padding: 7px 8px;
}

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

.compact-actions {
  gap: 6px;
}

.compact-actions .secondary-btn {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.wide-table {
  min-width: 1500px;
}

.medium-wide-table {
  min-width: 1120px;
}

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

.order-records-panel .panel-head {
  align-items: flex-start;
}

.order-records-panel .panel-actions input {
  width: 260px;
  min-height: 40px;
}

.order-records-grid-wrap {
  max-height: 620px;
  background: #fff;
}

.order-records-grid-wrap.is-existing {
  max-height: 420px;
}

.order-records-grid-wrap.is-entry {
  max-height: 320px;
}

.order-records-grid {
  min-width: 1860px;
  table-layout: fixed;
}

.order-records-grid th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.order-records-grid th:nth-child(1),
.order-records-grid td:nth-child(1) {
  width: 112px;
  text-align: center;
}

.order-records-grid th:nth-child(2),
.order-records-grid td:nth-child(2),
.order-records-grid th:nth-child(3),
.order-records-grid td:nth-child(3),
.order-records-grid th:nth-child(4),
.order-records-grid td:nth-child(4) {
  width: 160px;
}

.order-records-grid th:nth-child(5),
.order-records-grid td:nth-child(5),
.order-records-grid th:nth-child(6),
.order-records-grid td:nth-child(6) {
  width: 126px;
}

.order-records-grid th:nth-child(7),
.order-records-grid td:nth-child(7),
.order-records-grid th:nth-child(8),
.order-records-grid td:nth-child(8) {
  width: 104px;
}

.order-records-grid th:nth-child(9),
.order-records-grid td:nth-child(9) {
  width: 190px;
}

.order-records-grid th:nth-child(10),
.order-records-grid td:nth-child(10) {
  width: 120px;
}

.order-records-grid th:nth-child(11),
.order-records-grid td:nth-child(11),
.order-records-grid th:nth-child(13),
.order-records-grid td:nth-child(13),
.order-records-grid th:nth-child(14),
.order-records-grid td:nth-child(14),
.order-records-grid th:nth-child(15),
.order-records-grid td:nth-child(15) {
  width: 96px;
}

.order-records-grid th:nth-child(12),
.order-records-grid td:nth-child(12) {
  width: 140px;
}

.order-records-grid td {
  padding: 6px;
  background: #fff;
}

.order-record-row td {
  height: 42px;
}

.order-record-row.is-dirty td {
  background: #fffbeb;
}

.order-entry-row:focus-within td {
  background: #f4f8ff;
}

.order-entry-generated-code {
  display: grid;
  grid-template-columns: 1fr 24px;
  gap: 4px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.order-entry-generated-code button {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: #fff1f0;
  color: var(--danger);
  font-weight: 700;
}

.order-records-grid input,
.order-records-grid select {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 13px;
}

.readonly-number {
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.link-code {
  background: transparent;
  color: #1d4ed8;
  font-weight: 700;
  padding: 0;
  min-height: 0;
}

.record-code-cell {
  display: grid;
  gap: 4px;
}

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

.record-row-actions button {
  min-height: 24px;
  border-radius: 4px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 700;
}

.save-order-record-btn {
  background: #ecfdf3;
  color: #146c43;
}

.delete-order-record-btn {
  background: #fff1f0;
  color: var(--danger);
}

.order-entry-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.order-entry-footer-meta {
  display: grid;
  gap: 4px;
}

.order-entry-status {
  color: #1d4ed8;
}

.order-entry-actions {
  display: flex;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.order-entry-actions button,
.order-entry-actions .secondary-btn {
  width: auto;
  min-width: 120px;
  margin-top: 0;
}

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

.unified-order-grid-wrap {
  max-height: 720px;
}

.order-entry-row td {
  background: #f8fbff;
}

.order-record-row.context-target td,
.order-entry-row.context-target td {
  background: #e8f0ff;
}

.order-entry-generated-code {
  grid-template-columns: 1fr;
  justify-items: center;
}

.order-entry-generated-code button {
  display: none;
}

.order-grid-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.grid-add-btn {
  width: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 24px;
  line-height: 1;
  font-weight: 700;
}

.row-context-menu {
  position: fixed;
  z-index: 1200;
  min-width: 142px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
}

.row-context-menu button {
  width: 100%;
  min-height: 36px;
  border-radius: 6px;
  background: #fff1f0;
  color: var(--danger);
  font-weight: 700;
  text-align: left;
  padding: 0 12px;
}

.modal-open {
  overflow: hidden;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: min(720px, calc(100vh - 40px));
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 22px 52px rgba(15, 23, 42, 0.22);
  padding: 18px;
}

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

.modal-head h3 {
  margin: 0;
}

.subtle-text,
.subline {
  color: var(--muted);
  font-size: 12px;
}

.subline {
  display: block;
  margin-top: 4px;
  white-space: nowrap;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.button-row .secondary-btn {
  width: 100%;
  margin-top: 0;
}

.mini-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.mini-summary span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 6px;
  padding: 0 8px;
  background: #f8fafc;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.machine-load-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.machine-load-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fbfcfd;
}

.machine-load-item strong,
.machine-load-item span,
.machine-load-item small {
  display: block;
}

.machine-load-item span,
.machine-load-item small {
  color: var(--muted);
  font-size: 12px;
}

.machine-load-item b {
  color: var(--primary);
}

.machine-load-item .bar {
  grid-column: 1 / -1;
  height: 7px;
}

.machine-load-item small {
  grid-column: 1 / -1;
}

.machine-load-item.is-muted {
  opacity: 0.58;
}

.cnc-gantt {
  display: grid;
  gap: 8px;
  overflow-x: auto;
}

.cnc-gantt-row {
  display: grid;
  grid-template-columns: 132px minmax(620px, 1fr);
  gap: 10px;
  align-items: center;
}

.cnc-gantt-label {
  display: grid;
  gap: 2px;
  min-height: 44px;
  align-content: center;
}

.cnc-gantt-label span {
  color: var(--muted);
  font-size: 12px;
}

.cnc-gantt-track {
  position: relative;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: repeating-linear-gradient(
    90deg,
    #f8fafc 0,
    #f8fafc 90px,
    #eef2f6 91px
  );
  overflow: hidden;
}

.cnc-gantt-bar {
  position: absolute;
  top: 7px;
  height: 30px;
  min-width: 42px;
  border-radius: 5px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  color: #fff;
  background: var(--accent);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cnc-gantt-bar.risk-urgent {
  background: #b7791f;
}

.cnc-gantt-bar.risk-delayed,
.cnc-gantt-bar.risk-capacity_overdue {
  background: var(--danger);
}

.cnc-gantt-bar.risk-done {
  background: var(--primary);
}

.progress-cell {
  display: grid;
  grid-template-columns: 90px 48px;
  gap: 8px;
  align-items: center;
}

.progress-cell .bar {
  height: 8px;
}

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

.risk-pill.urgent {
  background: #fffbeb;
  color: #92400e;
}

.risk-pill.delayed,
.risk-pill.capacity_overdue {
  background: #fef3f2;
  color: #b42318;
}

.risk-pill.done {
  background: #ecfdf3;
  color: #146c43;
}

.risk-row.risk-capacity_overdue td,
.risk-row.risk-delayed td {
  background: #fff8f7;
}

.status-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 8px;
  background: #eef2f6;
  color: #475467;
  font-size: 12px;
  font-weight: 600;
}

.status-badge.sent {
  background: #ecfdf3;
  color: #146c43;
}

.status-badge.queued {
  background: #fffbeb;
  color: #92400e;
}

.status-badge.ordered,
.status-badge.partial_received,
.status-badge.pending,
.status-badge.confirmed {
  background: #eff6ff;
  color: #1d4ed8;
}

.status-badge.received,
.status-badge.arrived {
  background: #ecfdf3;
  color: #146c43;
}

.status-badge.failed {
  background: #fef3f2;
  color: #b42318;
}

.status-badge.voided {
  background: #f2f4f7;
  color: #667085;
  text-decoration: line-through;
}

.step-list,
.alert-list {
  display: grid;
  gap: 10px;
}

.step-row {
  display: grid;
  grid-template-columns: 88px 1fr 80px;
  gap: 10px;
  align-items: center;
}

.bar {
  height: 10px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  background: var(--accent);
}

.alert-item {
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #f1d6a8;
  background: #fffbeb;
  color: #7a4d0b;
}

.empty {
  color: var(--muted);
  padding: 14px;
}

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

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-line input {
  width: auto;
}

.print-sheet {
  background: #fff;
  color: #111;
  padding: 18px;
  border: 1px solid #111;
  overflow: auto;
}

.delivery-note {
  width: 100%;
  min-width: 980px;
  font-family: "Microsoft YaHei", SimSun, sans-serif;
  color: #111;
}

.delivery-note.is-voided {
  opacity: 0.72;
}

.delivery-note .company {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
}

.delivery-note .title {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  margin: 4px 0 10px;
}

.note-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px 16px;
  font-size: 13px;
  margin-bottom: 8px;
}

.delivery-note table {
  border: 1px solid #111;
}

.delivery-note th,
.delivery-note td {
  border: 1px solid #111;
  padding: 7px;
  color: #111;
  font-size: 13px;
}

.note-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 12px;
  font-size: 13px;
}

.sign-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 18px;
  font-size: 14px;
}

.statement-summary {
  display: grid;
  gap: 10px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.progress-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.progress-card,
.progress-wide {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #f8fafc;
}

.progress-card span,
.progress-wide span,
.progress-wide small {
  display: block;
}

.progress-card span,
.progress-wide small {
  color: var(--muted);
  font-size: 13px;
}

.progress-card strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
}

.progress-wide {
  grid-column: 1 / -1;
}

.progress-wide span {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.progress-steps {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.progress-step {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
}

.progress-step-head,
.progress-step-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.progress-step-meta {
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
}

.progress-bar {
  margin-top: 10px;
}

.progress-records {
  margin-top: 8px;
}

.board-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.board-summary-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #f8fafc;
}

.board-summary-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.board-summary-item strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

.focus-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
}

.quick-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.quick-filter-btn {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-weight: 600;
}

.quick-filter-btn.active {
  border-color: #1d4ed8;
  background: #eff6ff;
  color: #1d4ed8;
}

.focus-card {
  min-width: 180px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--warn);
  border-radius: 6px;
  background: #fffdf7;
  padding: 10px 12px;
}

.focus-card.is-critical {
  border-left-color: var(--danger);
  background: #fff7f7;
}

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

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

.focus-card strong {
  margin: 4px 0;
  font-size: 16px;
}

.focus-card small {
  color: var(--muted);
  font-size: 12px;
}

.progress-board-stack {
  display: grid;
  gap: 14px;
}

.progress-board-table-wrap {
  background: #fff;
}

.progress-board-table {
  min-width: 1480px;
  table-layout: fixed;
}

.progress-board-table th:nth-child(1),
.progress-board-table td:nth-child(1) {
  width: 88px;
}

.progress-board-table th:nth-child(2),
.progress-board-table td:nth-child(2),
.progress-board-table th:nth-child(3),
.progress-board-table td:nth-child(3),
.progress-board-table th:nth-child(4),
.progress-board-table td:nth-child(4) {
  width: 150px;
}

.progress-board-table th:nth-child(5),
.progress-board-table td:nth-child(5) {
  width: 110px;
}

.progress-board-table th:nth-child(6),
.progress-board-table td:nth-child(6) {
  width: 96px;
}

.progress-board-table th:nth-child(7),
.progress-board-table td:nth-child(7),
.progress-board-table th:nth-child(8),
.progress-board-table td:nth-child(8),
.progress-board-table th:nth-child(9),
.progress-board-table td:nth-child(9) {
  width: 88px;
}

.progress-board-table th:nth-child(10),
.progress-board-table td:nth-child(10) {
  width: 138px;
}

.progress-board-table th:nth-child(11),
.progress-board-table td:nth-child(11) {
  width: 170px;
}

.progress-board-table th:nth-child(12),
.progress-board-table td:nth-child(12) {
  width: 124px;
}

.progress-board-table td {
  padding: 8px 10px;
  background: #fff;
  vertical-align: middle;
}

.progress-due-meta,
.progress-recent-meta {
  display: grid;
  gap: 4px;
}

.progress-due-meta strong,
.progress-recent-meta strong {
  font-size: 13px;
}

.progress-recent-meta small {
  color: var(--muted);
  line-height: 1.4;
}

.due-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
}

.due-pill.overdue {
  background: #fff1f0;
  color: #b42318;
}

.due-pill.warning,
.due-pill.today {
  background: #fff7e6;
  color: #b26a00;
}

.due-pill.completed {
  background: #ecfdf3;
  color: #146c43;
}

.progress-board-table .secondary-btn,
.progress-board-table .ghost-btn {
  min-height: 30px;
  padding: 0 10px;
  margin-top: 0;
}

.board-card-section-head {
  margin-top: 2px;
}

.progress-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 14px;
}

.board-card {
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.board-card.risk-not-started {
  border-left-color: #98a2b3;
}

.board-card.risk-warning {
  border-left-color: #b7791f;
}

.board-card.risk-stalled {
  border-left-color: #d97706;
}

.board-card.risk-overdue {
  border-left-color: var(--danger);
}

.board-card.risk-completed {
  border-left-color: #16a34a;
}

.board-card-head,
.board-title,
.board-progress-line,
.board-meta,
.board-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.board-card-head {
  justify-content: space-between;
}

.board-card-head div,
.board-title {
  min-width: 0;
}

.board-card-head span,
.board-title small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-code {
  display: block;
  font-size: 20px;
}

.board-card-head em {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #eef2f6;
  color: #344054;
  padding: 5px 9px;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.board-title {
  display: block;
}

.board-title span {
  display: block;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-progress-line .bar {
  flex: 1;
}

.board-progress-line strong {
  width: 58px;
  text-align: right;
}

.step-chip-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(74px, 1fr));
  gap: 8px;
}

.step-chip {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  background: #f8fafc;
  min-width: 0;
}

.step-chip span,
.step-chip strong {
  display: block;
  text-align: center;
}

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

.step-chip strong {
  margin-top: 3px;
  font-size: 14px;
}

.step-chip.done {
  border-color: #b7e4c7;
  background: #ecfdf3;
}

.step-chip.active {
  border-color: #93c5fd;
  background: #eff6ff;
}

.board-meta,
.board-notes {
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.board-meta span {
  border-right: 1px solid var(--line);
  padding-right: 10px;
}

.board-meta span:last-child {
  border-right: 0;
}

.board-notes {
  display: flex;
  gap: 8px;
}

.board-notes span {
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid var(--line);
  padding: 4px 8px;
}

.board-actions {
  justify-content: flex-end;
}

#supplierPurchaseView.active-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#supplierPurchaseView > .purchase-list-panel {
  order: 1;
}

#supplierPurchaseView > .purchase-entry-layout {
  order: 2;
}

#supplierPurchaseView > #purchaseDetailPanel,
#supplierPurchaseView > #purchaseReceivePanel {
  order: 3;
}

.label-sheet {
  display: grid;
  place-items: center;
  min-height: 420px;
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 6px;
}

.qr-label {
  width: 320px;
  min-height: 440px;
  border: 1px solid #111;
  border-radius: 6px;
  padding: 16px;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 10px;
  color: #111;
  background: #fff;
}

.qr-title {
  font-size: 18px;
  font-weight: 700;
}

.qr-label img {
  width: 220px;
  height: 220px;
}

.qr-code {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 2px;
}

.qr-meta {
  width: 100%;
  display: grid;
  gap: 5px;
  font-size: 13px;
}

.shipping-label-sheet {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10mm;
  min-height: 220px;
  padding: 12px;
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 6px;
}

.shipment-label {
  width: var(--label-width, 70mm);
  height: var(--label-height, 45mm);
  padding: 2mm;
  border-radius: 3mm;
  background: #fff;
  color: #000;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.18);
  break-inside: avoid;
}

.shipment-label table {
  width: 100%;
  height: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  border: 2px solid #000;
}

.shipment-label th,
.shipment-label td {
  border: 2px solid #000;
  padding: 0 3mm;
  color: #000;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  line-height: 1;
  vertical-align: middle;
  white-space: nowrap;
}

.shipment-label th {
  width: 34%;
  text-align: center;
  font-size: 4.2mm;
  font-weight: 800;
}

.shipment-label td {
  text-align: center;
  font-size: 5.2mm;
  font-weight: 900;
}

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

.warn-text {
  color: var(--warn);
  font-weight: 700;
}

.alert-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 12px;
}

.smart-alert {
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  display: grid;
  gap: 8px;
}

.smart-alert.critical {
  border-left-color: var(--danger);
}

.smart-alert.high {
  border-left-color: #d97706;
}

.smart-alert.medium {
  border-left-color: var(--warn);
}

.smart-alert strong {
  font-size: 16px;
}

.smart-alert span {
  width: fit-content;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid var(--line);
  padding: 3px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.smart-alert p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.production-insight-list {
  display: grid;
  gap: 10px;
}

.production-insight {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.production-insight.ok {
  border-left-color: var(--primary);
  background: #f6fef9;
}

.production-insight.warn {
  border-left-color: var(--warn);
  background: #fffbeb;
}

.production-insight.danger {
  border-left-color: var(--danger);
  background: #fff8f7;
}

.production-insight strong {
  color: var(--text);
}

.production-insight span {
  color: var(--muted);
  line-height: 1.45;
  font-size: 13px;
}

.production-link-btn {
  min-height: 0;
  padding: 0;
  background: transparent;
  color: #1d4ed8;
  font-weight: 700;
}

.intelligence-panel {
  margin-bottom: 18px;
}

.health-label,
.wechat-status-box em {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  background: #eef2f6;
  color: #475467;
}

.health-label.score-good,
.wechat-status-box em.ok {
  background: #ecfdf3;
  color: #146c43;
}

.health-label.score-warn,
.wechat-status-box em.warn {
  background: #fffbeb;
  color: #92400e;
}

.health-label.score-danger {
  background: #fef3f2;
  color: var(--danger);
}

.intelligence-grid {
  display: grid;
  grid-template-columns: 240px minmax(280px, 1fr) minmax(300px, 1fr);
  gap: 14px;
  align-items: stretch;
}

.health-score-card {
  min-height: 172px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #f8fafc;
  display: grid;
  align-content: center;
  gap: 8px;
}

.health-score-card span,
.health-score-card small {
  color: var(--muted);
}

.health-score-card strong {
  font-size: 48px;
  line-height: 1;
  color: var(--primary);
}

.readiness-panel {
  margin-bottom: 18px;
}

.readiness-summary {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.readiness-score,
.readiness-next,
.readiness-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.readiness-score {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
}

.readiness-score span,
.readiness-score em,
.readiness-next span,
.readiness-item span {
  color: var(--muted);
}

.readiness-score strong {
  font-size: 34px;
  line-height: 1;
}

.readiness-score em {
  font-style: normal;
  font-weight: 700;
}

.readiness-score.score-good strong {
  color: #15803d;
}

.readiness-score.score-warn strong {
  color: #b45309;
}

.readiness-score.score-danger strong {
  color: var(--danger);
}

.readiness-next {
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 14px 16px;
}

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

.readiness-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  align-items: start;
}

.readiness-item em {
  min-width: 52px;
  border-radius: 999px;
  padding: 3px 8px;
  text-align: center;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.readiness-item.ok em {
  background: #ecfdf3;
  color: #146c43;
}

.readiness-item.warn em {
  background: #fffbeb;
  color: #92400e;
}

.readiness-item.danger em {
  background: #fef3f2;
  color: var(--danger);
}

.readiness-item strong,
.readiness-item span {
  display: block;
}

.risk-mini-grid,
.action-list {
  display: grid;
  gap: 8px;
}

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

.risk-mini-card,
.action-item {
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.risk-mini-card.critical,
.action-item.critical {
  border-left-color: var(--danger);
}

.risk-mini-card.high,
.action-item.high {
  border-left-color: #d97706;
}

.risk-mini-card.medium,
.action-item.medium {
  border-left-color: var(--warn);
}

.risk-mini-card span,
.risk-mini-card small,
.action-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.risk-mini-card strong {
  display: block;
  margin: 4px 0;
}

.intelligence-grid h4 {
  margin: 0 0 10px;
}

.action-item {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  align-items: start;
}

.action-item b {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e8f0ff;
  color: #1d4ed8;
  display: grid;
  place-items: center;
  font-size: 12px;
}

.wechat-status-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
  margin-bottom: 14px;
  display: grid;
  gap: 10px;
}

.wechat-status-box > div:first-child {
  display: grid;
  gap: 8px;
}

.wechat-status-box span {
  color: var(--muted);
}

#wechatPushStatus,
.wechat-push-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wechat-push-stats span {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 7px 9px;
}

.empty.compact {
  min-height: 80px;
  display: grid;
  place-items: center;
}

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 12px;
  }

  .nav-list {
    grid-template-columns: repeat(6, minmax(72px, 1fr));
    overflow-x: auto;
  }

  .side-brand,
  .sidebar .ghost-btn {
    display: none;
  }

  .main {
    padding: 14px;
  }

  .topbar,
  .panel-head,
  .top-actions,
  .filters {
    align-items: stretch;
    flex-direction: column;
  }

  .production-filter-stack,
  .segmented-filter,
  .filter-field,
  .filter-hint {
    width: 100%;
  }

  .top-actions input,
  .filters input,
  .filters select,
  .production-filters .keyword-field input {
    width: 100%;
  }

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

  .metric-grid,
  .workbench-grid,
  .workbench-columns,
  .workbench-actions,
  .production-focus-grid,
  .split-grid,
  .purchase-entry-layout,
  .purchase-meta-grid,
  .purchase-buyer-grid,
  .intelligence-grid,
  .readiness-summary,
  .readiness-list,
  .risk-mini-grid,
  .seal-upload-row,
  .shipping-template-top,
  .shipping-template-workspace,
  .order-layout,
  .progress-summary,
  .board-summary,
  .progress-board,
  .alert-grid {
    grid-template-columns: 1fr;
  }

  .process-ribbon {
    justify-content: flex-start;
  }

  .purchase-order-panel {
    min-height: auto;
  }

  .purchase-meta-grid .wide-field {
    grid-column: auto;
  }

  .purchase-buyer-grid .wide-field {
    grid-column: auto;
  }

  .order-records-panel .panel-head,
  .order-entry-footer,
  .order-grid-toolbar,
  .order-entry-actions,
  .purchase-ledger-tabs,
  .purchase-draft-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .progress-board-table {
    min-width: 1160px;
  }

  .order-entry-actions button,
  .order-entry-actions .secondary-btn,
  .purchase-ledger-tabs .segmented-btn {
    width: 100%;
  }

  .step-chip-grid {
    grid-template-columns: repeat(2, minmax(74px, 1fr));
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 10mm;
  }

  body {
    background: #fff;
  }

  .sidebar,
  .topbar,
  .panel-head,
  .metric-grid,
  .view:not(.print-target),
  .panel:not(.print-panel) {
    display: none !important;
  }

  .app-shell,
  .main,
  .active-view,
  .print-panel {
    display: block !important;
    padding: 0;
  }

  .print-sheet {
    border: 0;
    padding: 0;
  }

  .shipping-label-sheet {
    border: 0;
    padding: 0;
    gap: 4mm;
  }

  .shipment-label {
    box-shadow: none;
  }
}
