:root {
  --bg: #f4f6f3;
  --panel: #fff;
  --line: #dce4dc;
  --text: #17211b;
  --muted: #66736b;
  --green: #2e6b4f;
  --green-dark: #24563f;
  --red: #b42318;
  --amber: #9a5b00;
  --soft-green: #edf5ef;
}

.pre-drawing-panel {
  width: 100%;
  min-width: 0;
  padding: 10px 12px 12px;
}

.pre-drawing-head {
  margin-bottom: 8px;
}

.pre-drawing-head h2 {
  margin-bottom: 1px;
}

.pre-drawing-head p {
  margin: 0;
  font-size: 12px;
}

.pre-drawing-entry-bar {
  display: flex;
  align-items: center;
  min-height: 42px;
  margin-bottom: 7px;
}

.pre-drawing-entry-bar button {
  min-width: 150px;
}

.pre-drawing-record-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-bottom: 0;
  background: #f6f9f6;
}

.pre-drawing-record-head strong {
  font-size: 14px;
}

.pre-drawing-record-head span {
  color: var(--muted);
  font-size: 12px;
}

.warehouse-route-dialog.pre-drawing-create-dialog {
  width: min(820px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.pre-drawing-create-dialog .pre-drawing-create-form {
  margin: 0;
  padding: 10px;
  border: 0;
  background: #fff;
}

.pre-drawing-create-dialog-head {
  margin-bottom: 9px;
}

.pre-drawing-create-form {
  display: block;
  min-width: 0;
  margin-bottom: 8px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  background: #f7faf8;
}

.pre-drawing-create-fields {
  display: grid;
  grid-template-columns: 100px 315px 180px minmax(0, 1fr);
  gap: 10px;
  align-items: end;
}

.pre-drawing-target-input {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.pre-drawing-target-input legend {
  margin-bottom: 2px;
  padding: 0;
  font-size: 12px;
  font-weight: 700;
}

.pre-drawing-target-options {
  box-sizing: border-box;
  display: flex;
  height: 42px;
  align-items: center;
  gap: 10px;
  padding: 5px 8px;
  border: 1px solid #cfd8d1;
  border-radius: 4px;
  background: #fff;
}

.pre-drawing-target-options label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.pre-drawing-create-form .pre-drawing-target-options input {
  width: 15px;
  height: 15px;
  min-height: 15px;
  margin: 0;
  padding: 0;
}

.pre-drawing-note-input {
  grid-column: 1 / -1;
}

.pre-drawing-note-input textarea {
  min-height: 72px;
  padding: 8px 9px;
  line-height: 1.45;
  resize: vertical;
}

.pre-drawing-create-form label {
  gap: 2px;
  margin: 0;
  font-size: 12px;
}

.pre-drawing-create-form input {
  height: 42px;
  padding: 6px 9px;
}

.pre-drawing-create-form button {
  height: 34px;
}

.pre-drawing-reference-bar {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 100px;
  grid-template-rows: minmax(106px, 1fr) 42px;
  align-items: stretch;
  gap: 8px 12px;
  min-height: 172px;
  margin-top: 12px;
  padding: 16px;
  border: 1px dashed #a9bdb0;
  background: #fff;
  transition: border-color .15s ease, background .15s ease;
}

.pre-drawing-reference-bar.is-dragging {
  border-color: var(--green);
  background: #eaf5ed;
}

.pre-drawing-reference-drop-label {
  display: flex;
  grid-column: 1;
  grid-row: 1 / 3;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  min-height: 96px;
  border-right: 1px solid #dce6df;
  color: #516158;
  font-size: 20px;
  font-weight: 700;
}

.pre-drawing-reference-button,
.pre-drawing-reference-bar > button {
  height: 42px;
  min-height: 42px;
  padding: 0 16px;
}

.pre-drawing-reference-button {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  min-width: 96px;
}

.pre-drawing-reference-summary {
  display: block;
  grid-column: 2 / 4;
  grid-row: 1;
  min-width: 0;
  padding: 7px 9px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid #dce6df;
  background: #f8faf8;
  color: var(--muted);
  font-size: 13px;
}

.pre-drawing-reference-count {
  display: block;
  margin-bottom: 3px;
  color: var(--green-dark);
  font-weight: 800;
}

.pre-drawing-reference-file-name {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  line-height: 22px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pre-drawing-reference-file-item {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.pre-drawing-create-form .pre-drawing-reference-remove {
  flex: 0 0 20px;
  width: 20px;
  height: 20px !important;
  min-height: 20px !important;
  padding: 0;
  border: 1px solid #d7a09b;
  border-radius: 50%;
  background: #fff;
  color: #b42318;
  font-size: 16px;
  font-weight: 800;
  line-height: 16px;
}

.pre-drawing-create-form .pre-drawing-reference-remove:hover,
.pre-drawing-create-form .pre-drawing-reference-remove:focus-visible {
  border-color: #b42318;
  background: #fff0ee;
  color: #8f1d14;
}

.pre-drawing-reference-bar .pre-drawing-submit-button {
  grid-column: 3;
  grid-row: 2;
  min-width: 96px;
}

.pre-drawing-table-scroll {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--line);
}

.pre-drawing-table {
  width: 100%;
  min-width: 1000px;
  table-layout: fixed;
}

.pre-drawing-table th,
.pre-drawing-table td {
  height: 29px;
  padding: 1px 4px;
  border-right: 1px solid #dfe5e1;
  border-bottom: 1px solid #dfe5e1;
  vertical-align: middle;
  font-size: 13px;
}

.pre-drawing-table th {
  height: 29px;
  background: #eef3ef;
  white-space: nowrap;
}

.pre-drawing-table td {
  overflow: hidden;
  background: #fff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pre-drawing-record-row.pre-drawing-record-tone-0 td {
  background: #fff;
}

.pre-drawing-record-row.pre-drawing-record-tone-1 td {
  background: #edf5ef;
}

.pre-drawing-id-col { width: 40px; }
.pre-drawing-date-col { width: 82px; }
.pre-drawing-customer-col { width: 60px; }
.pre-drawing-sales-col { width: 40px; }
.pre-drawing-target-col { width: 116px; text-align: center; }

.pre-drawing-target-col span + span::before {
  content: " / ";
  color: #8a968e;
}
.pre-drawing-status-col {
  position: sticky;
  right: 76px;
  z-index: 2;
  width: 78px;
  text-align: center;
  box-shadow: -1px 0 #cfd8d1;
}
.pre-drawing-action-col {
  position: sticky;
  right: 0;
  z-index: 2;
  width: 76px;
  text-align: center;
}

.pre-drawing-files-col { width: 100px; }

.pre-drawing-table th.pre-drawing-id-col,
.pre-drawing-table td.pre-drawing-id-col,
.pre-drawing-table th.pre-drawing-date-col,
.pre-drawing-table td.pre-drawing-date-col,
.pre-drawing-table th.pre-drawing-customer-col,
.pre-drawing-table td.pre-drawing-customer-col,
.pre-drawing-table th.pre-drawing-sales-col,
.pre-drawing-table td.pre-drawing-sales-col {
  padding-right: 2px;
  padding-left: 2px;
  font-size: 12px;
}

.pre-drawing-table th.pre-drawing-status-col,
.pre-drawing-table th.pre-drawing-action-col {
  z-index: 3;
  background: #eef3ef;
}

.pre-drawing-table .mini-link {
  min-height: 23px;
  padding: 0 8px;
  font-size: 12px;
}

.pre-drawing-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  min-height: 23px;
  border: 1px solid #d8b76c;
  border-radius: 999px;
  background: #fff8e5;
  color: #7a4d00;
  font-size: 12px;
  font-weight: 700;
}

.pre-drawing-status.is-completed {
  border-color: #9fc2ac;
  background: #eaf5ed;
  color: var(--green-dark);
}

.pre-drawing-action-col .danger-link {
  border-color: #d7aaa5;
  background: #fff;
  color: var(--red);
}

.pre-drawing-confirmed-name {
  color: #173f2a;
  font-weight: 700;
}

.pre-drawing-confirmed-name-box {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
}

.pre-drawing-confirmed-name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pre-drawing-copy-button {
  flex: 0 0 52px;
  width: 52px;
  min-height: 23px !important;
  height: 23px;
  padding: 0 4px !important;
  border-radius: 4px;
  font-size: 12px;
}

.pre-drawing-note-cell span {
  margin-left: 6px;
  color: #53635a;
}

.pre-drawing-file-list {
  display: inline-flex;
  gap: 4px;
  overflow: hidden;
}

.pre-drawing-result-file {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
}

.pre-drawing-file-list a {
  flex: 0 0 auto;
  color: var(--green);
  font-weight: 700;
}

.pre-drawing-table .pre-drawing-withdraw-button {
  width: auto;
  min-height: 20px;
  padding: 0 3px;
  border: 0;
  background: transparent;
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
}

.pre-drawing-table .pre-drawing-withdraw-button:hover {
  background: #fee4e2;
  color: var(--red);
}

.pre-drawing-process-dialog {
  width: min(720px, calc(100vw - 24px));
}

.pre-drawing-screenshot-dialog {
  width: min(460px, calc(100vw - 24px));
}

.pre-drawing-screenshot-dialog .warehouse-route-dialog-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pre-drawing-screenshot-dialog .warehouse-route-dialog-head,
.pre-drawing-paste-zone {
  grid-column: 1 / -1;
}

.pre-drawing-paste-zone {
  min-height: 120px;
  border: 1px dashed #9cb6a5;
  background: #f5faf6;
  color: var(--green-dark);
  font-size: 17px;
  font-weight: 800;
}

.pre-drawing-screenshot-picker {
  width: 100%;
}

.pre-drawing-process-dialog .warehouse-route-dialog-form {
  display: grid;
  gap: 9px;
}

.pre-drawing-process-dialog label {
  gap: 3px;
  margin: 0;
}

.pre-drawing-dialog-meta {
  overflow: hidden;
  padding: 5px 8px;
  border-left: 3px solid var(--green);
  background: #f2f7f3;
  color: #405148;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .pre-drawing-entry-bar button {
    width: 100%;
  }

  .warehouse-route-dialog.pre-drawing-create-dialog {
    width: calc(100vw - 14px);
  }

  .pre-drawing-create-fields {
    grid-template-columns: 1fr;
  }

  .pre-drawing-reference-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
    width: 100%;
    min-width: 0;
    min-height: 230px;
  }

  .pre-drawing-reference-button {
    grid-column: 1;
    grid-row: 3;
  }

  .pre-drawing-reference-drop-label {
    grid-column: 1 / -1;
    grid-row: 1;
    width: 100%;
  }

  .pre-drawing-reference-summary {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    min-height: 100px;
    max-height: 160px;
  }

  .pre-drawing-reference-drop-label {
    min-height: 100px;
    border-right: 0;
    border-bottom: 1px solid #dce6df;
  }

  .pre-drawing-reference-button {
    width: 100%;
  }

  .pre-drawing-reference-bar .pre-drawing-submit-button {
    grid-column: 2;
    grid-row: 3;
    width: 100%;
  }
}

* { box-sizing: border-box; }

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
}

h1, h2, p { margin-top: 0; letter-spacing: 0; }

.eyebrow {
  font-size: 13px;
  color: var(--green);
  font-weight: 800;
}

.sub {
  color: var(--muted);
  margin-bottom: 20px;
}

input, select, textarea, button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font: inherit;
  font-size: 14px;
}

input, select, textarea {
  width: 100%;
  padding: 0 10px;
  background: #fbfcfb;
  color: var(--text);
}

textarea {
  min-height: 78px;
  padding-top: 9px;
  resize: vertical;
}

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  background: var(--green);
  color: #fff;
  border: 1px solid var(--green);
  border-radius: 7px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

button:hover, .button:hover { background: var(--green-dark); border-color: var(--green-dark); }

.secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--line);
}

.secondary:hover {
  background: #f6f8f6;
  color: var(--text);
  border-color: var(--line);
}

.small-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.user-admin-panel,
.user-list-panel {
  padding: 12px;
}

.user-admin-head,
.user-list-head {
  align-items: center;
  margin-bottom: 8px;
}

.user-account-summary {
  display: inline-flex;
  gap: 8px;
}

.user-account-summary span {
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7faf7;
  color: var(--muted);
  font-size: 12px;
}

.user-account-summary strong {
  margin-left: 4px;
  color: var(--text);
  font-size: 14px;
}

.user-register-title {
  margin-bottom: 5px;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 900;
}

.user-create-form {
  display: grid;
  grid-template-columns: 150px 170px 150px 150px auto;
  gap: 7px;
  align-items: end;
}

.user-create-form label {
  gap: 3px;
  margin: 0;
}

.user-create-form input,
.user-create-form select,
.user-create-form button {
  min-height: 34px;
}

.user-create-action {
  margin: 0;
}

.user-filter-form {
  display: grid;
  grid-template-columns: 220px 150px auto auto;
  gap: 6px;
}

.user-filter-form input,
.user-filter-form select,
.user-filter-form button,
.user-filter-form .button {
  min-height: 32px;
}

.user-table-scroll {
  border: 1px solid var(--line);
}

.user-permission-table {
  width: 100%;
  min-width: 900px;
  table-layout: fixed;
}

.user-permission-table th,
.user-permission-table td {
  height: 38px;
  padding: 3px 6px;
  border-right: 1px solid #e1e6e2;
  border-bottom: 1px solid #e1e6e2;
  vertical-align: middle;
}

.user-permission-table th:nth-child(1) { width: 150px; }
.user-permission-table th:nth-child(2) { width: 150px; }
.user-permission-table th:nth-child(3) { width: 145px; }
.user-permission-table th:nth-child(4) { width: 100px; }
.user-permission-table th:nth-child(5) { width: 88px; }
.user-permission-table th:nth-child(6) { width: 160px; }
.user-permission-table th:nth-child(7) { width: 68px; }

.user-permission-table input,
.user-permission-table select,
.user-permission-table button {
  min-height: 29px;
  font-size: 13px;
}

.user-login-cell strong,
.user-login-cell small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-login-cell small {
  color: var(--muted);
  font-size: 10px;
}

.user-active-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  white-space: nowrap;
}

.user-active-toggle input {
  width: 16px;
  min-height: 16px;
}

.user-password-state {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 7px;
  border: 1px solid #bdd0c2;
  border-radius: 999px;
  background: #eef7f0;
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 800;
}

.user-password-state.is-pending {
  border-color: #dec17e;
  background: #fff8e5;
  color: #7a4d00;
}

.user-disabled-row td {
  background: #f1f3f1;
  color: #7d867f;
}

.admin-module-panel,
.planner-operator-admin-panel,
.planner-operator-list-panel {
  padding: 12px;
}

.admin-module-head,
.planner-operator-admin-head {
  align-items: center;
  margin-bottom: 8px;
}

.admin-module-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-module-button {
  width: 230px;
  min-height: 48px;
  justify-content: space-between;
  padding: 0 14px;
  font-size: 15px;
}

.admin-module-button strong {
  display: inline-flex;
  min-width: 28px;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #fff;
  color: var(--green-dark);
  font-size: 12px;
}

.planner-operator-create-form {
  display: grid;
  grid-template-columns: 220px auto;
  gap: 7px;
  align-items: end;
}

.planner-operator-create-form label {
  gap: 3px;
  margin: 0;
}

.planner-operator-create-form input {
  min-height: 34px;
}

.planner-operator-create-form button {
  width: 112px;
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

.planner-operator-table-scroll {
  max-width: 640px;
  border: 1px solid var(--line);
}

.planner-operator-table {
  width: 100%;
  table-layout: fixed;
}

.planner-operator-table th,
.planner-operator-table td {
  height: 38px;
  padding: 3px 6px;
  border-right: 1px solid #e1e6e2;
  border-bottom: 1px solid #e1e6e2;
  vertical-align: middle;
}

.planner-operator-table th:nth-child(1) { width: 360px; }
.planner-operator-table th:nth-child(2) { width: 140px; }
.planner-operator-table th:nth-child(3) { width: 90px; }

.planner-operator-table input,
.planner-operator-table button {
  min-height: 29px;
  font-size: 13px;
}

.planner-operator-select-grid {
  grid-template-columns: repeat(3, minmax(130px, 1fr));
}

.route-operation-record-panel {
  padding: 12px;
}

.route-operation-record-head {
  align-items: center;
  margin-bottom: 8px;
}

.route-operation-filter {
  display: grid;
  grid-template-columns: minmax(280px, 460px) 150px auto auto;
  gap: 6px;
  margin-bottom: 8px;
}

.route-operation-filter input,
.route-operation-filter select,
.route-operation-filter button,
.route-operation-filter .button {
  min-height: 32px;
}

.route-operation-record-scroll {
  border: 1px solid var(--line);
}

.route-operation-record-table {
  width: 100%;
  min-width: 1810px;
  table-layout: fixed;
}

.route-operation-record-table th,
.route-operation-record-table td {
  height: 34px;
  padding: 2px 5px;
  overflow: hidden;
  border-right: 1px solid #dfe5e1;
  border-bottom: 1px solid #dfe5e1;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-operation-record-table th:nth-child(1) { width: 140px; }
.route-operation-record-table th:nth-child(2) { width: 62px; }
.route-operation-record-table th:nth-child(3) { width: 72px; }
.route-operation-record-table th:nth-child(4),
.route-operation-record-table th:nth-child(5) { width: 72px; }
.route-operation-record-table th:nth-child(6) { width: 120px; }
.route-operation-record-table th:nth-child(7) { width: 110px; }
.route-operation-record-table th:nth-child(8) { width: 400px; }
.route-operation-record-table th:nth-child(9),
.route-operation-record-table th:nth-child(10),
.route-operation-record-table th:nth-child(11) { width: 78px; }
.route-operation-record-table th:nth-child(12) { width: 130px; }
.route-operation-record-table th:nth-child(13) { width: 100px; }
.route-operation-record-table th:nth-child(14) { width: 120px; }

.route-record-type {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border: 1px solid #afcdb8;
  border-radius: 999px;
  background: #edf7f0;
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 800;
}

.route-record-status {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border: 1px solid #b9c8bf;
  border-radius: 4px;
  background: #f5f8f6;
  color: #425148;
  font-size: 11px;
  font-weight: 800;
}

.route-record-status.is-modified {
  border-color: #d4a93c;
  background: #fff7dc;
  color: #785b0b;
}

.route-record-status.is-voided {
  border-color: #d4a8a4;
  background: #fff1ef;
  color: #9a322b;
}

.route-operation-record-table tr.is-voided td {
  color: #8a918d;
  background: #fafafa;
}

.route-record-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.route-record-actions form {
  margin: 0;
}

.route-operation-edit-dialog {
  width: min(520px, calc(100vw - 24px));
}

.route-operation-edit-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.route-operation-edit-fields label {
  margin: 0;
}

.desktop-device-panel,
.desktop-device-list-panel {
  padding: 12px;
}

.desktop-device-head {
  align-items: center;
  margin-bottom: 8px;
}

.desktop-device-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.desktop-device-summary span {
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f7faf7;
  color: var(--muted);
  font-size: 12px;
}

.desktop-device-summary span.is-pending {
  border-color: #e1bd66;
  background: #fff8e4;
  color: #7c5500;
}

.desktop-device-summary strong {
  margin-left: 3px;
  color: var(--text);
  font-size: 14px;
}

.desktop-device-filter {
  display: grid;
  grid-template-columns: 260px 130px auto auto auto;
  gap: 6px;
  align-items: center;
  justify-content: start;
}

.desktop-device-filter input,
.desktop-device-filter select,
.desktop-device-filter button,
.desktop-device-filter .button {
  min-height: 32px;
}

.desktop-device-table-scroll {
  border: 1px solid var(--line);
}

.desktop-device-table {
  width: 100%;
  min-width: 1460px;
  table-layout: fixed;
}

.desktop-device-table th,
.desktop-device-table td {
  height: 38px;
  padding: 3px 6px;
  border-right: 1px solid #e1e6e2;
  border-bottom: 1px solid #e1e6e2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.desktop-device-table th:nth-child(1) { width: 110px; }
.desktop-device-table th:nth-child(2) { width: 190px; }
.desktop-device-table th:nth-child(3) { width: 150px; }
.desktop-device-table th:nth-child(4) { width: 70px; }
.desktop-device-table th:nth-child(5) { width: 78px; }
.desktop-device-table th:nth-child(6) { width: 150px; }
.desktop-device-table th:nth-child(7) { width: 100px; }
.desktop-device-table th:nth-child(8) { width: 150px; }
.desktop-device-table th:nth-child(9) { width: 150px; }
.desktop-device-table th:nth-child(10) { width: 150px; }

.desktop-device-row.status-pending td {
  background: #fffdf5;
}

.desktop-device-row.status-revoked td {
  background: #f3f4f3;
  color: #7b847e;
}

.desktop-machine-code {
  color: var(--green-dark);
  font-family: Consolas, monospace;
  font-size: 13px;
  font-weight: 900;
}

.desktop-device-status {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border: 1px solid #bdd0c2;
  border-radius: 999px;
  background: #eef7f0;
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 900;
}

.desktop-device-status.status-pending {
  border-color: #e1bd66;
  background: #fff8e4;
  color: #7c5500;
}

.desktop-device-status.status-revoked {
  border-color: #cdd1ce;
  background: #ecefed;
  color: #68716b;
}

.desktop-device-actions {
  display: flex;
  gap: 4px;
}

.desktop-device-actions form {
  margin: 0;
}

.desktop-device-actions .small-button {
  min-height: 28px;
  padding: 0 8px;
  font-size: 12px;
}

.desktop-device-reset-button {
  border-color: #b53f3f;
  background: #b53f3f;
  color: #fff;
}

.desktop-device-reset-button:hover {
  border-color: #8d2d2d;
  background: #8d2d2d;
}

.web-activation-layout {
  min-height: calc(100vh - 88px);
  display: grid;
  place-items: start center;
  padding-top: 58px;
}

.web-activation-card {
  width: min(520px, calc(100vw - 28px));
  padding: 24px;
}

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

.web-activation-title h2 {
  margin: 0;
  font-size: 21px;
}

.web-activation-title span {
  color: var(--muted);
  font-size: 13px;
}

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

.web-activation-form label {
  gap: 5px;
  margin: 0;
}

.web-activation-form input,
.web-activation-form button {
  min-height: 40px;
  font-size: 15px;
}

.web-activation-form input[name="activation_code"] {
  font-family: Consolas, monospace;
  font-weight: 800;
  text-transform: uppercase;
}

.web-auth-admin-panel,
.web-auth-list-panel {
  padding: 12px;
}

.web-auth-admin-head {
  align-items: center;
  margin-bottom: 8px;
}

.web-auth-admin-head > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.web-auth-switch-state {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid #cfd5d1;
  border-radius: 999px;
  background: #f0f2f1;
  color: #68716b;
  font-size: 11px;
  font-weight: 900;
}

.web-auth-switch-state.is-enabled {
  border-color: #92b99f;
  background: #edf7ef;
  color: var(--green-dark);
}

.web-auth-setting-actions,
.web-auth-row-actions {
  display: flex;
  gap: 5px;
}

.web-auth-setting-actions form,
.web-auth-row-actions form {
  margin: 0;
}

.web-auth-setting-actions button,
.web-auth-setting-actions .button {
  min-height: 32px;
}

.web-auth-new-code {
  display: grid;
  grid-template-columns: 180px 230px 110px;
  gap: 7px;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 10px;
  padding: 8px;
  border: 1px solid #70a181;
  border-radius: 6px;
  background: #eef8f0;
}

.web-auth-new-code > div {
  min-width: 0;
}

.web-auth-new-code strong,
.web-auth-new-code span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.web-auth-new-code span {
  color: var(--muted);
  font-size: 11px;
}

.web-auth-new-code input,
.web-auth-new-code button {
  min-height: 34px;
}

.web-auth-new-code input {
  font-family: Consolas, monospace;
  font-size: 16px;
  font-weight: 900;
  text-align: center;
}

.web-auth-code-create-form {
  display: grid;
  grid-template-columns: 180px 300px auto;
  gap: 7px;
  align-items: end;
  width: fit-content;
  max-width: 100%;
}

.web-auth-code-create-form label {
  gap: 3px;
  margin: 0;
}

.web-auth-code-create-form input,
.web-auth-code-create-form select,
.web-auth-code-create-form button {
  min-height: 34px;
}

.web-auth-list-panel .section-head {
  margin-bottom: 7px;
}

.web-auth-table-scroll {
  border: 1px solid var(--line);
}

.web-auth-code-table,
.web-auth-device-table {
  width: 100%;
  table-layout: fixed;
}

.web-auth-code-table { min-width: 1220px; }
.web-auth-device-table { min-width: 1040px; }

.web-auth-code-table th,
.web-auth-code-table td,
.web-auth-device-table th,
.web-auth-device-table td {
  height: 36px;
  padding: 3px 6px;
  overflow: hidden;
  border-right: 1px solid #e1e6e2;
  border-bottom: 1px solid #e1e6e2;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.web-auth-code-table th:nth-child(1) { width: 130px; }
.web-auth-code-table th:nth-child(2) { width: 100px; }
.web-auth-code-table th:nth-child(3) { width: 120px; }
.web-auth-code-table th:nth-child(4) { width: 76px; }
.web-auth-code-table th:nth-child(5),
.web-auth-code-table th:nth-child(6),
.web-auth-code-table th:nth-child(8) { width: 145px; }
.web-auth-code-table th:nth-child(7) { width: 120px; }
.web-auth-code-table th:nth-child(9) { width: 65px; }

.web-auth-device-table th:nth-child(1) { width: 110px; }
.web-auth-device-table th:nth-child(2) { width: 120px; }
.web-auth-device-table th:nth-child(3) { width: 120px; }
.web-auth-device-table th:nth-child(4) { width: 125px; }
.web-auth-device-table th:nth-child(5) { width: 75px; }
.web-auth-device-table th:nth-child(6),
.web-auth-device-table th:nth-child(7) { width: 145px; }
.web-auth-device-table th:nth-child(8) { width: 140px; }

.web-auth-code-hint {
  color: var(--green-dark);
  font-family: Consolas, monospace;
  font-weight: 900;
}

.web-auth-code-status,
.web-auth-device-status {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border: 1px solid #cfd5d1;
  border-radius: 999px;
  background: #f0f2f1;
  color: #68716b;
  font-size: 11px;
  font-weight: 900;
}

.web-auth-code-status.status-unused {
  border-color: #dec17e;
  background: #fff8e5;
  color: #7a4d00;
}

.web-auth-code-status.status-used,
.web-auth-device-status.is-active {
  border-color: #9dc0a7;
  background: #eef7f0;
  color: var(--green-dark);
}

.web-auth-code-status.status-expired,
.web-auth-code-status.status-revoked,
.web-auth-device-status.is-disabled {
  border-color: #cfd5d1;
  background: #ecefed;
  color: #68716b;
}

.web-auth-device-disabled td {
  background: #f2f4f2;
  color: #7b847e;
}

.web-auth-row-actions .small-button {
  min-height: 28px;
  padding: 0 8px;
  font-size: 12px;
}

.web-auth-reset-button {
  border-color: #b53f3f;
  background: #b53f3f;
  color: #fff;
}

.web-auth-reset-button:hover {
  border-color: #8d2d2d;
  background: #8d2d2d;
}

@media (max-width: 720px) {
  .web-activation-layout {
    min-height: auto;
    padding-top: 24px;
  }

  .web-activation-card {
    padding: 18px;
  }

  .web-activation-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .web-auth-admin-head,
  .web-auth-setting-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .web-auth-setting-actions button,
  .web-auth-setting-actions .button {
    width: 100%;
  }

  .web-auth-new-code,
  .web-auth-code-create-form {
    grid-template-columns: 1fr;
    width: 100%;
  }
}

.user-handover-panel,
.user-handover-record-panel {
  padding: 12px;
}

.user-handover-head {
  align-items: center;
  margin-bottom: 8px;
}

.user-handover-form {
  display: grid;
  grid-template-columns: minmax(250px, 360px) 28px minmax(250px, 360px) 110px;
  gap: 8px;
  align-items: end;
}

.user-handover-form label {
  gap: 3px;
  margin: 0;
}

.user-handover-form select,
.user-handover-form button {
  min-height: 36px;
}

.user-handover-arrow {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  color: var(--green-dark);
  font-size: 22px;
  font-weight: 900;
}

.user-handover-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.user-handover-table-scroll {
  border: 1px solid var(--line);
}

.user-handover-table {
  width: 100%;
  min-width: 760px;
  table-layout: fixed;
}

.user-handover-table th,
.user-handover-table td {
  height: 36px;
  padding: 3px 7px;
  border-right: 1px solid #e1e6e2;
  border-bottom: 1px solid #e1e6e2;
  vertical-align: middle;
}

.user-handover-table th:nth-child(1) { width: 170px; }
.user-handover-table th:nth-child(2),
.user-handover-table th:nth-child(3) { width: 210px; }
.user-handover-table th:nth-child(4) { width: 110px; }
.user-handover-table th:nth-child(5) { width: 140px; }

.user-handover-table strong,
.user-handover-table small {
  display: inline;
}

.user-handover-table small {
  margin-left: 6px;
  color: var(--muted);
  font-size: 11px;
}

.route-record-type.is-replacement {
  border-color: #aebfda;
  background: #eef4fc;
  color: #285b91;
}

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

.danger-button:hover {
  background: #b42318;
  color: #fff;
  border-color: #b42318;
}

.danger-mini-link {
  border-color: #f1b8b4;
  color: var(--red);
}

.danger-mini-link:hover {
  background: #fee4e2;
  border-color: #e89a94;
  color: var(--red);
}

.mini-link {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid #c9d7c4;
  border-radius: 999px;
  background: #fff;
  color: var(--green);
  font-weight: 700;
  text-decoration: none;
}

.mini-link:hover {
  background: #f6fbf4;
  color: var(--green);
}

.uploaded-link {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.uploaded-link:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
  color: #fff;
}

.proceed-link {
  border-color: #b9d0c3;
}

.disabled-mini-link, .disabled-mini-link:hover {
  background: #f1f3f0;
  border-color: #d9ded6;
  color: #9aa39d;
  cursor: not-allowed;
}

.drawing-name-link {
  display: inline-block;
  max-width: 220px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  vertical-align: middle;
  white-space: nowrap;
}

.drawing-name-link:hover {
  text-decoration: underline;
}

.order-action-col {
  white-space: nowrap;
}

.order-select-col {
  width: 42px;
  max-width: 42px;
  text-align: center;
}

.order-select-col input[type="checkbox"], .order-group-check input[type="checkbox"] {
  width: auto;
  min-height: auto;
  margin: 0;
}

.order-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.inline-action-form {
  margin: 0;
}

.inline-action-form .mini-link {
  min-height: 26px;
  padding: 0 9px;
  font-size: 13px;
}

.order-main-header td {
  padding: 7px 9px;
  border-top: 1px solid #cbd8c8;
  border-bottom: 1px solid #cbd8c8;
}

.order-main-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.order-main-head strong {
  font-size: 14px;
  margin-right: 6px;
}

.order-group-check {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 5px;
  margin: 0;
  color: var(--text);
  font-size: 13px;
}

.js-order-item-row.is-collapsed {
  display: none;
}

.shared-drawing-row.is-hidden {
  display: none;
}

.shared-drawing-row td {
  padding: 10px 12px;
  background: #fbfcfb;
}

.shared-drawing-form {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr auto;
  align-items: end;
  gap: 10px;
  margin: 0;
}

.shared-drawing-form label {
  margin: 0;
}

.shared-seq-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 38px;
}

.shared-seq-list label {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid #d6dfd2;
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
}

.shared-seq-list input[type="checkbox"] {
  width: auto;
  min-height: auto;
  margin: 0;
}

.batch-action-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 10px;
}

.batch-action-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  padding: 10px;
  margin: 0;
}

.batch-action-box h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.batch-action-box .form-actions {
  margin-top: 8px;
}

.tech-batch-panel {
  padding-bottom: 12px;
}

.batch-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.batch-toolbar button,
.batch-toolbar .button {
  min-height: 34px;
  padding: 0 12px;
}

.inline-toolbar-form {
  margin: 0;
}

.batch-select-all {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid #d6dfd2;
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.batch-select-all input,
.js-batch-select {
  width: auto;
  min-height: auto;
  margin: 0;
}

.batch-upload-panel {
  display: grid;
  grid-template-columns: minmax(420px, 650px) auto;
  justify-content: start;
  align-items: end;
  gap: 10px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf8;
}

.batch-upload-panel.is-hidden {
  display: none;
}

.batch-upload-panel label {
  margin: 0;
}

.batch-selected-summary {
  min-width: 138px;
  min-height: 30px;
  display: flex;
  align-items: center;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-upload-actions {
  display: grid;
  grid-template-columns: auto auto;
  align-self: start;
  align-items: start;
  gap: 8px;
  margin-top: 34px;
}

.batch-upload-button-stack {
  display: grid;
  gap: 6px;
}

.batch-upload-button-stack button {
  width: 92px;
  min-width: 92px;
  height: 36px;
  min-height: 36px;
  padding-left: 0;
  padding-right: 0;
}

.tech-batch-table {
  min-width: 1400px;
}

.drawing-status-col {
  width: 9em;
  max-width: 9em;
  white-space: nowrap;
}

.drawing-ready {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.drawing-empty {
  color: var(--muted);
  border-color: #d6dfd2;
}

.tech-processing-record-table .status-pill.drawing-empty {
  border-color: #c8322b;
  background: #d64038;
  color: #fff;
}

.tech-processing-record-table .status-pill.status-waiting_supplementary_drawing {
  border-color: #d6a54d;
  background: #d6a54d;
  color: #fff;
}

.tech-processing-record-table .status-pill.channel-library-match {
  border-color: #6ca7d8;
  background: #e8f3ff;
  color: #1f5f9f;
}

.tech-processing-record-table .status-pill.channel-multi-upload {
  border-color: #79b697;
  background: #eaf6ef;
  color: #256849;
}

.tech-processing-record-table .status-pill.channel-manual-upload {
  border-color: #aebbc8;
  background: #f7f9fb;
  color: #46596b;
}

.tech-processing-record-table .status-pill.channel-no-drawing {
  border-color: #c8322b;
  background: #d64038;
  color: #fff;
}

.tech-processing-record-table .tech-record-action-col {
  width: 150px;
  min-width: 150px;
  text-align: center;
}

.tech-record-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.tech-record-actions .mini-link {
  min-width: 64px;
  padding-right: 5px;
  padding-left: 5px;
}

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

.login-card {
  width: min(430px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 16px 36px rgba(23, 33, 27, .08);
}

.login-card h1 { margin-bottom: 6px; }

label {
  display: grid;
  gap: 6px;
  margin: 10px 0;
  color: var(--muted);
  font-size: 13px;
}

.login-card button {
  width: 100%;
  margin-top: 6px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 5px 12px;
  background: #edf1eb;
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.topbar nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}

.topbar form { margin: 0; }

.topbar nav .button,
.topbar nav button {
  min-height: 28px;
  padding: 0 9px;
  border-radius: 4px;
  font-size: 13px;
}

.topbar nav .topbar-refresh-button {
  width: auto;
  min-width: 0;
  height: auto;
  min-height: 28px;
  padding: 0 9px;
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  font-size: 13px;
  font-weight: 400;
  line-height: normal;
}

.topbar nav .topbar-refresh-button:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
  color: #fff;
}

.layout {
  width: calc(100vw - 28px);
  max-width: none;
  margin: 8px auto 30px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 10px 28px rgba(23, 33, 27, .05);
}

.dashboard-summary-panel {
  padding: 9px 12px;
  margin-bottom: 8px;
}

.dashboard-summary-panel .section-head {
  align-items: center;
  margin-bottom: 0;
}

.dashboard-summary-panel .section-head p {
  font-size: 12px;
  line-height: 1.2;
}

.dashboard-summary-panel .action-button-row {
  gap: 6px;
}

.dashboard-summary-panel .action-button-row .button {
  min-height: 31px;
  font-size: 13px;
}

.sales-dashboard-summary-panel .section-head {
  display: grid;
  gap: 0 8px;
  margin-bottom: 0;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto;
}

.sales-dashboard-summary-panel {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  box-shadow: none;
}

.sales-dashboard-summary-panel + .order-list-panel {
  padding-top: 1px;
  border-top: 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.sales-dashboard-summary-panel .section-head > div {
  width: 100%;
}

.sales-dashboard-summary-panel .section-head > div:first-child,
.sales-dashboard-summary-panel .sales-dashboard-title-line {
  display: contents;
}

.sales-dashboard-summary-panel .action-button-row {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  align-items: center;
  justify-content: flex-end;
}

.sales-dashboard-action-buttons {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}

.sales-order-create-menu {
  position: relative;
  z-index: 30;
  display: flex;
  flex: 0 0 85px;
  width: 85px;
  height: 29px;
  align-items: center;
}

.sales-order-create-menu > .button {
  width: 100%;
  height: 29px;
}

.sales-order-create-options {
  position: absolute;
  z-index: 120;
  top: calc(100% + 4px);
  right: -5px;
  display: grid;
  width: 95px;
  gap: 3px;
  padding: 4px;
  border: 1px solid #c9d4cc;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(25, 52, 36, .18);
}

.sales-order-create-options .button {
  width: 100%;
  min-height: 29px;
  height: 29px;
  padding: 0;
  justify-content: center;
}

.sales-summary-priority-tools {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-left: 0;
}

.sales-summary-priority-tools .priority-filter-list {
  flex: 0 0 auto;
}

.sales-summary-priority-tools .dashboard-search-bar {
  flex: 0 1 250px;
  width: 250px;
  max-width: 250px;
  grid-template-columns: minmax(90px, 1fr) auto auto;
}

.sales-dashboard-summary-panel .sales-summary-priority-tools .dashboard-search-bar .button {
  width: auto;
  padding: 0 10px;
}

.sales-dashboard-summary-panel .action-button-row .button {
  position: relative;
  width: 85px;
  min-height: 29px;
  padding: 0;
  font-size: 13px;
}

.sales-dashboard-summary-panel .action-button-row .button-count {
  box-sizing: border-box;
  position: absolute;
  top: -6px;
  right: -4px;
  min-width: 17px;
  height: 17px;
  margin-left: 0;
  padding: 0 4px;
  font-size: 11px;
}

.dashboard-summary-panel .stats-grid {
  gap: 6px;
  margin-top: 7px;
}

.sales-status-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
}

.sales-dashboard-title-line {
  width: 100%;
}

.dashboard-summary-panel .sales-dashboard-title-line h2 {
  display: inline-flex;
  grid-column: 1;
  grid-row: 1;
  align-items: center;
  min-height: 34px;
  margin-bottom: 0;
}

.sales-status-grid {
  display: grid;
  grid-column: 1 / -1;
  grid-row: 2;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  align-items: center;
  width: 100%;
  margin-left: 0;
}

.dashboard-summary-panel .sales-status-pill {
  margin-bottom: 0;
}

.sales-status-grid .sales-status-pill {
  width: 100%;
  background: #f7fbf8;
  border-color: #b9d0c3;
  box-shadow: none;
  color: #254735;
}

.sales-status-grid .pending-label {
  color: var(--green-dark);
}

.sales-status-grid .pending-number {
  color: #526158;
}

.sales-status-grid .pending-number strong {
  color: var(--green);
}

.sales-status-grid .sales-fraction-count strong span + span::before {
  color: #74857b;
}

.sales-completed-view-button {
  min-width: 86px;
  text-decoration: none;
}

.sales-completed-view-button.is-active {
  background: var(--green-dark);
  border-color: var(--green-dark);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35);
}

.sales-completed-action-button {
  justify-content: center;
}

.button-count {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 5px;
  padding: 0 4px;
  border-radius: 9px;
  border: 1px solid #fff;
  background: #e60012;
  color: #fff;
  box-shadow: 0 0 0 1px rgba(150, 0, 12, .18);
  font-size: 11px;
  line-height: 1;
}

.sales-fraction-count {
  align-items: center;
  gap: 3px;
}

.dashboard-summary-panel .sales-fraction-count strong {
  display: inline-flex;
  align-items: baseline;
  min-width: auto;
  font-size: 15px;
  line-height: 1;
  text-align: center;
}

.sales-fraction-count strong span + span {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  font-size: 14px;
}

.sales-fraction-count strong span + span::before {
  content: "/";
  margin: 0 2px;
  color: rgba(255, 255, 255, .72);
  font-size: 13px;
  font-weight: 700;
}

.sales-secondary-stat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 3px 10px;
  border-radius: 999px;
}

.completed-view-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 2px 10px;
  border: 1px solid #b9d0c3;
  border-radius: 999px;
  background: #edf5ef;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.completed-view-summary strong {
  font-size: 16px;
}

.dashboard-summary-panel .stat-box {
  padding: 6px 9px;
}

.dashboard-summary-panel .stat-box strong {
  display: inline-block;
  margin: 0 0 0 7px;
  font-size: 19px;
}

.dashboard-summary-panel .stat-box span {
  display: inline-block;
}

.narrow-panel {
  max-width: none;
  margin-left: auto;
  margin-right: auto;
}

.import-panel {
  width: 100%;
}

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

.section-head h2 {
  margin-bottom: 4px;
  font-size: 20px;
}

.section-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.order-context-head {
  min-width: 0;
  flex: 1;
}

.product-focus {
  display: grid;
  gap: 3px;
  max-width: 100%;
  padding: 10px 13px;
  border-left: 5px solid var(--green);
  border-radius: 8px;
  background: var(--soft-green);
}

.product-focus span {
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.product-focus strong {
  color: var(--text);
  font-size: 26px;
  font-weight: 900;
  line-height: 1.22;
  word-break: break-word;
}

.product-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

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

.action-button-row .button {
  width: 120px;
}

.dashboard-title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 22px;
}

.dashboard-summary-panel .dashboard-title-line {
  gap: 12px;
}

.dashboard-title-line h2 {
  margin-bottom: 4px;
  font-size: 28px;
  font-weight: 900;
}

.dashboard-summary-panel .dashboard-title-line h2 {
  margin-bottom: 2px;
  font-size: 22px;
}

.pending-inline {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 4px;
  min-height: 48px;
  padding: 7px 20px;
  border: 1px solid var(--green);
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 8px 18px rgba(46, 107, 79, .16);
  color: #fff;
  white-space: nowrap;
}

.dashboard-summary-panel .pending-inline {
  gap: 10px;
  min-height: 34px;
  margin-bottom: 2px;
  padding: 3px 12px;
  box-shadow: none;
}

.sales-dashboard-summary-panel .sales-status-pill {
  min-height: 29px;
  margin-bottom: 0;
  padding: 0 10px;
}

.dashboard-summary-panel .pending-label {
  font-size: 15px;
}

.dashboard-summary-panel .pending-number {
  font-size: 12px;
}

.dashboard-summary-panel .pending-number strong {
  font-size: 20px;
}

.dashboard-summary-panel .pending-number.sales-fraction-count strong {
  display: inline-flex;
  align-items: baseline;
  min-width: auto;
  font-size: 15px;
  line-height: 1;
  text-align: center;
}

.dashboard-summary-panel .pending-number.sales-fraction-count strong span + span {
  font-size: 14px;
}

.pending-label {
  font-size: 19px;
  font-weight: 900;
}

.pending-number {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-size: 15px;
  font-weight: 800;
}

.pending-number strong {
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
}

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

.stat-box {
  border: 1px solid var(--line);
  background: var(--soft-green);
  border-radius: 8px;
  padding: 12px;
}

.stat-box span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.stat-box strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}

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

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

.manual-order-panel {
  max-width: none;
}

.manual-order-form {
  display: grid;
  grid-template-columns: 120px minmax(280px, 1fr) 70px 130px 170px 90px minmax(180px, 0.8fr) auto;
  gap: 8px;
  align-items: end;
}

.manual-order-form label {
  margin: 0;
}

.manual-order-form input {
  min-height: 34px;
}

.multi-manual-order-form {
  display: block;
}

.manual-order-lines {
  display: grid;
  gap: 8px;
}

.manual-order-line {
  display: grid;
  grid-template-columns: 120px minmax(280px, 1fr) 70px 130px 170px 90px minmax(180px, 0.8fr) 62px;
  gap: 8px;
  align-items: end;
}

.manual-order-line + .manual-order-line {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.manual-order-line-action {
  display: grid;
  min-height: 54px;
  align-content: end;
  justify-items: center;
  gap: 3px;
}

.manual-order-line-action span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.manual-order-line-action button {
  width: 58px;
  min-height: 34px;
}

.manual-order-errors {
  margin-bottom: 8px;
}

.sales-drawing-choice {
  width: 100%;
  min-width: 0;
  max-width: 300px;
  margin: 0;
  padding: 0;
  border: 0;
}

.sales-drawing-choice legend {
  display: block;
  width: 100%;
  margin-bottom: 4px;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.sales-drawing-choice-options {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 34px;
  overflow: hidden;
  border: 1px solid #cfd8d1;
  border-radius: 4px;
  background: #fff;
}

.sales-drawing-choice-options label {
  display: flex;
  min-width: 0;
  margin: 0;
  padding: 5px 8px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
}

.sales-drawing-choice-options label + label {
  border-left: 1px solid #d8e0da;
}

.sales-drawing-choice-options label:has(input:checked) {
  background: #e9f4ec;
  color: #1f6739;
  font-weight: 700;
}

.sales-drawing-choice-options input,
.manual-order-form .sales-drawing-choice-options input {
  width: 14px;
  min-width: 14px;
  height: 14px;
  min-height: 14px;
  margin: 0;
  padding: 0;
  accent-color: var(--green);
}

.sales-drawing-choice.is-disabled {
  opacity: 0.62;
}

.sales-outsourced-choice {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.sales-outsourced-choice legend {
  display: block;
  width: 100%;
  margin-bottom: 4px;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.sales-outsourced-choice label {
  box-sizing: border-box;
  display: flex;
  min-height: 34px;
  margin: 0;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #cfd8d1;
  border-radius: 4px;
  background: #fff;
  font-size: 13px;
  white-space: nowrap;
}

.sales-outsourced-choice label:has(input:checked) {
  border-color: #d0a437;
  background: #fff3c8;
  color: #6b4f00;
  font-weight: 800;
}

.sales-outsourced-choice input,
.manual-order-form .sales-outsourced-choice input {
  width: 15px;
  min-width: 15px;
  height: 15px;
  min-height: 15px;
  margin: 0;
  padding: 0;
  accent-color: #c38b11;
}

.manual-order-actions {
  margin-top: 10px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.manual-order-actions button,
.manual-order-actions .button {
  flex: 0 0 auto;
  width: 108px;
  min-height: 34px;
  justify-content: center;
  white-space: nowrap;
}

.stock-production-form {
  grid-template-columns: 145px minmax(280px, 1fr) 80px 110px 145px minmax(180px, 0.75fr) auto;
}

.stock-production-confirm {
  width: min(420px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(20, 37, 29, 0.22);
}

.stock-production-confirm::backdrop {
  background: rgba(20, 31, 26, 0.38);
}

.stock-production-confirm-content {
  padding: 22px;
}

.stock-production-confirm-content h2 {
  margin: 0 0 18px;
  text-align: center;
  font-size: 20px;
}

.stock-repeat-warning-dialog p {
  margin: 0 0 18px;
  color: #3f4f46;
  font-size: 15px;
  line-height: 1.6;
  text-align: center;
}

.stock-production-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stock-production-confirm-actions .secondary {
  grid-column: 1 / -1;
}

.stock-repeat-warning-actions .secondary {
  grid-column: auto;
}

.role-select-layout {
  min-height: calc(100vh - 58px);
  display: grid;
  place-items: start center;
  padding-top: 72px;
}

.role-select-panel {
  width: min(760px, 100%);
  padding: 24px;
}

.role-select-panel h2 {
  margin: 0 0 18px;
  text-align: center;
}

.role-select-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 10px;
}

.role-select-grid form,
.role-select-grid button {
  width: 100%;
}

.role-select-grid button {
  min-height: 48px;
  font-size: 16px;
}

.account-simulation-grid button {
  min-height: 62px;
  align-items: flex-start;
  flex-direction: column;
  gap: 3px;
  padding: 8px 12px;
  text-align: left;
}

.account-simulation-grid button strong,
.account-simulation-grid button small {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-simulation-grid button small {
  color: rgba(255, 255, 255, .82);
  font-size: 11px;
}

.role-select-switch-account {
  display: flex;
  width: 100%;
  margin-top: 12px;
}

.full-row { grid-column: 1 / -1; }

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  margin-top: 28px;
}

.check-row input {
  width: auto;
  min-height: auto;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 180px 180px auto auto;
  gap: 8px;
  margin-bottom: 12px;
}

.tech-filter-bar {
  grid-template-columns: minmax(260px, 1fr) auto auto;
}

.table-scroll {
  overflow-x: auto;
}

.topbar-column-edit[hidden] {
  display: none;
}

[data-planner-action-id] {
  touch-action: none;
}

.planner-action-empty-slot {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 29px;
  border: 0;
  border-radius: 5px;
  opacity: 0;
}

body.is-planner-action-dragging,
body.is-planner-action-dragging * {
  cursor: grabbing;
  user-select: none;
}

body.is-planner-action-dragging [data-planner-action-id].is-planner-action-dragging {
  opacity: .3;
  pointer-events: none;
}

body.is-planner-action-dragging .planner-action-empty-slot {
  border: 1px dashed #d39b1e;
  background: #fffaf0;
  opacity: .72;
}

body.is-planner-action-dragging [data-planner-action-id].is-planner-action-drop-target {
  outline: 3px solid #d39b1e;
  outline-offset: -3px;
  background: #fff4cf;
  color: #3f3005;
}

body.is-planner-action-dragging .planner-action-empty-slot.is-planner-action-drop-target {
  border: 2px dashed #d39b1e;
  opacity: 1;
}

.planner-action-drag-ghost {
  position: fixed !important;
  z-index: 10000 !important;
  margin: 0 !important;
  opacity: .94;
  pointer-events: none !important;
  transform: scale(1.04);
  box-shadow: 0 8px 20px rgba(31, 64, 45, .28);
}

.column-resize-handle {
  position: absolute;
  z-index: 8;
  top: 0;
  right: 0;
  display: block;
  width: 10px;
  height: 100%;
  min-height: 24px;
  opacity: 0;
  pointer-events: none;
  touch-action: none;
  cursor: col-resize;
}

body.is-column-width-editing .column-resize-handle {
  opacity: 1;
  pointer-events: auto;
}

.column-resize-handle::after {
  position: absolute;
  top: 18%;
  bottom: 18%;
  left: 4px;
  width: 2px;
  border-radius: 1px;
  background: transparent;
  content: "";
}

.column-resize-header:hover > .column-resize-handle::after,
.column-resize-handle:focus-visible::after,
.column-resize-handle.is-active::after {
  background: #2f7d4a;
}

body.is-column-width-editing .column-resize-handle::after {
  background: #91a89a;
}

body.is-column-width-editing .column-resize-header:hover > .column-resize-handle::after,
body.is-column-width-editing .column-resize-handle:focus-visible::after,
body.is-column-width-editing .column-resize-handle.is-active::after {
  background: #18743e;
}

body.is-resizing-table-column,
body.is-resizing-table-column * {
  cursor: col-resize !important;
  user-select: none !important;
}

table.has-custom-column-widths th,
table.has-custom-column-widths td {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  overflow: hidden !important;
  text-overflow: ellipsis;
  white-space: nowrap !important;
}

table.has-custom-column-widths .product-table-cell,
table.has-custom-column-widths .order-customer-col,
table.has-custom-column-widths .order-remark-col {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
}

@media (max-width: 760px) {
  .column-resize-handle {
    display: none;
  }
}

.order-list-panel {
  padding: 5px 12px 4px;
}

.order-list-panel .section-head {
  align-items: center;
  margin-bottom: 2px;
}

.order-list-panel .section-head h2 {
  font-size: 18px;
}

.order-list-panel .section-head p {
  line-height: 1.25;
}

.order-list-title-line {
  gap: 10px;
}

.order-list-panel .order-list-title-line h2 {
  margin-bottom: 0;
  font-size: 20px;
}

.order-list-panel .pending-inline {
  gap: 9px;
  min-height: 30px;
  margin-bottom: 0;
  padding: 2px 10px;
  box-shadow: none;
}

.order-list-panel .pending-label {
  font-size: 13px;
}

.order-list-panel .pending-number {
  font-size: 12px;
}

.order-list-panel .pending-number strong {
  font-size: 18px;
}

.dashboard-right-tools {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.dashboard-right-tools .priority-filter-list {
  flex: 0 0 auto;
}

.priority-search-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  margin-left: auto;
}

.notification-nav-button {
  position: relative;
  min-height: 29px;
  padding: 0 10px;
  overflow: visible;
  font-size: 13px;
}

.notification-nav-button strong {
  box-sizing: border-box;
  position: absolute;
  z-index: 2;
  top: -6px;
  right: -4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  margin-left: 0;
  padding: 0 4px;
  border-radius: 999px;
  border: 1px solid #fff;
  background: #e60012;
  color: #fff;
  box-shadow: 0 0 0 1px rgba(150, 0, 12, .18);
  font-size: 11px;
  line-height: 1;
}

.planner-action-grid {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(3, 85px);
  gap: 3px 4px;
}

.planner-action-grid .notification-nav-button {
  position: relative;
  width: 100%;
  min-width: 0;
  padding: 0 4px;
  justify-content: center;
  white-space: nowrap;
}

.planner-dashboard-tools {
  gap: 4px;
}

.planner-dashboard-tools .priority-search-tools {
  display: grid;
  flex: 1 1 520px;
  grid-template-columns: 204px minmax(280px, 1fr);
  align-items: start;
  gap: 4px;
  margin-left: 0;
}

.planner-dashboard-tools .priority-filter-list {
  display: grid;
  width: 204px;
  grid-template-columns: repeat(2, 100px);
  grid-template-rows: repeat(2, 29px);
  grid-column: 1;
  grid-row: 1 / 3;
  gap: 3px 4px;
  align-self: start;
}

.planner-dashboard-tools .priority-filter-box {
  flex: 0 0 100px;
  width: 100px;
}

.planner-workload-summary {
  display: flex;
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  max-width: 320px;
  min-width: 0;
  height: 29px;
  align-items: center;
  justify-content: space-between;
  justify-self: end;
  gap: 1px;
  padding: 0 2px;
  overflow: hidden;
  color: #58665d;
  font-size: 13px;
  white-space: nowrap;
}

.planner-workload-summary span {
  display: inline-flex;
  min-width: 0;
  align-items: baseline;
}

.planner-workload-summary strong {
  display: inline-block;
  min-width: 5ch;
  color: #1f6f43;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.planner-workload-summary .planner-workload-quantity {
  min-width: 6ch;
}

.planner-workload-summary i {
  color: #aab5ad;
  font-style: normal;
}

.planner-dashboard-tools .dashboard-search-bar {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  grid-template-columns: minmax(160px, 1fr) auto auto;
}

.planner-ticket-entry {
  width: 100%;
  justify-content: center;
}

.planner-primary-actions {
  display: grid;
  flex: 0 0 263px;
  width: 263px;
  grid-template-columns: repeat(3, 85px);
  gap: 3px;
  align-self: flex-start;
}

.planner-primary-actions .notification-nav-button {
  position: relative;
  width: 100%;
  min-width: 0;
  padding: 0 4px;
  justify-content: center;
}

.planner-primary-actions.is-followup {
  flex-basis: 263px;
  width: 263px;
  grid-template-columns: repeat(3, 85px);
}

.shortage-alert-button.is-alerting {
  border-color: #b42318;
  background: #b42318;
  color: #fff;
}

.shortage-alert-button.is-alerting:hover,
.shortage-alert-button.is-alerting:focus-visible {
  border-color: #8f1c13;
  background: #8f1c13;
  color: #fff;
}

.shortage-alert-panel {
  padding: 10px 12px;
}

.shortage-alert-head {
  align-items: center;
  margin-bottom: 8px;
}

.shortage-alert-title-line,
.shortage-alert-summary {
  display: flex;
  align-items: center;
}

.shortage-alert-title-line {
  gap: 12px;
}

.shortage-alert-title-line h2 {
  margin: 0;
}

.shortage-alert-summary {
  min-height: 30px;
  padding: 2px 10px;
  border: 1px solid #efb0aa;
  border-radius: 4px;
  background: #fff1f0;
  color: #8f1c13;
  font-size: 13px;
  font-weight: 700;
}

.shortage-alert-summary strong {
  margin-left: 6px;
  font-size: 18px;
}

.shortage-alert-sync-error {
  margin-bottom: 8px;
  padding: 7px 10px;
  border: 1px solid #efb0aa;
  background: #fff1f0;
  color: #8f1c13;
}

.shortage-alert-table-scroll {
  border: 1px solid #bcc8bd;
}

.shortage-alert-table {
  width: 100%;
  min-width: 1320px;
  table-layout: fixed;
}

.shortage-alert-table th,
.shortage-alert-table td {
  height: 31px;
  padding: 2px 5px;
  overflow: hidden;
  border-right: 1px solid #dfe5e1;
  border-bottom: 1px solid #dfe5e1;
  background: #fff;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
  font-size: 12px;
}

.shortage-alert-table th {
  background: #eef3ef;
  font-weight: 800;
}

.shortage-alert-table .shortage-main-col { width: 112px; }
.shortage-alert-table .shortage-seq-col { width: 44px; text-align: center; }
.shortage-alert-table .shortage-customer-col { width: 92px; }
.shortage-alert-table .shortage-product-col { width: 300px; }
.shortage-alert-table .shortage-number-col { width: 62px; text-align: center; }
.shortage-alert-table .shortage-route-col { width: 240px; }
.shortage-alert-table .shortage-date-col { width: 78px; text-align: center; }
.shortage-alert-table .shortage-status-col { width: 72px; text-align: center; }
.shortage-alert-table .shortage-sales-col { width: 72px; }
.shortage-alert-table .shortage-action-col { width: 86px; text-align: center; }

.shortage-alert-table .shortage-product-col {
  color: #173f2a;
  font-weight: 700;
}

.shortage-alert-table .shortage-value {
  color: #b42318;
  font-size: 14px;
  font-weight: 900;
}

.shortage-alert-table td.shortage-route-col {
  overflow: visible;
  white-space: normal;
}

.shortage-route-balance-list {
  display: grid;
  gap: 2px;
}

.shortage-route-balance-line {
  display: grid;
  grid-template-columns: 6ch repeat(3, minmax(3.5ch, auto));
  gap: 5px;
  align-items: center;
  min-height: 19px;
  white-space: nowrap;
}

.shortage-route-balance-line strong {
  color: #244b31;
}

.shortage-route-scrap {
  color: #a43327;
}

.shortage-route-remaining {
  color: #19633a;
  font-weight: 800;
}

.shortage-route-dialog {
  width: min(620px, calc(100vw - 24px));
}

.shortage-route-balance-button {
  min-width: 92px;
}

.shortage-route-total-shortage {
  margin-top: 8px;
  padding: 6px 9px;
  border: 1px solid #e2aaa5;
  background: #fff5f3;
  color: #9b2c22;
  font-weight: 800;
}

.shortage-route-total-shortage strong {
  font-size: 16px;
}

.shortage-route-balance-panel {
  margin-top: 8px;
  border: 1px solid #d7e0d9;
  background: #fff;
}

.shortage-route-balance-head,
.shortage-route-dialog-line {
  display: grid;
  grid-template-columns: minmax(94px, 1fr) repeat(5, 68px);
  gap: 6px;
  align-items: center;
  padding: 5px 8px;
}

.shortage-route-balance-head {
  background: #eef3ef;
  color: #53635a;
  font-size: 12px;
  font-weight: 800;
}

.shortage-route-dialog-list {
  display: grid;
  max-height: 190px;
  overflow-y: auto;
}

.shortage-route-dialog-line {
  min-height: 29px;
  border-top: 1px solid #edf1ee;
  font-size: 13px;
  text-align: center;
}

.shortage-route-dialog-line strong {
  text-align: left;
}

.shortage-route-own-reuse {
  color: #87651b;
}

.shortage-route-other-reuse {
  color: #9b4b20;
  font-weight: 800;
}

.shortage-route-add-title {
  margin-top: 10px;
  color: #315b40;
  font-size: 13px;
  font-weight: 800;
}

.shortage-route-fields {
  display: grid;
  grid-template-columns: 92px minmax(150px, 1fr) 110px;
  gap: 8px;
  margin-top: 8px;
}

.shortage-route-fields label {
  margin: 0;
}

.shortage-route-fields input,
.shortage-route-fields select {
  width: 100%;
}

@media (max-width: 560px) {
  .shortage-route-fields,
  .shortage-route-balance-head,
  .shortage-route-dialog-line {
    grid-template-columns: 1fr;
  }

  .shortage-route-balance-head {
    display: none;
  }

  .shortage-route-dialog-line {
    gap: 3px;
    grid-template-columns: 1fr 1fr;
  }
}

.dashboard-search-bar {
  display: grid;
  grid-template-columns: minmax(200px, 260px) auto auto;
  align-items: center;
  gap: 5px;
  min-width: 0;
  margin: 0;
}

.dashboard-search-bar input,
.dashboard-search-bar button,
.dashboard-search-bar .button {
  min-height: 29px;
  font-size: 13px;
}

.dashboard-search-bar button,
.dashboard-search-bar .button {
  padding: 0 10px;
}

.order-list-scroll {
  border: 1px solid #bcc8bd;
  background: #fff;
}

.virtual-order-list {
  height: calc(100vh - 160px);
  min-height: 360px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.virtual-order-spacer td {
  height: auto !important;
  padding: 0 !important;
  border: 0 !important;
  background: #fff !important;
}

.virtual-order-spacer div {
  width: 1px;
  min-height: 0;
  pointer-events: none;
}

.virtual-order-loading-row td {
  height: 72px;
}

html.has-open-dialog,
body.has-open-dialog {
  overflow: hidden;
  overscroll-behavior: none;
}

body.has-open-dialog .virtual-order-list {
  overflow: hidden;
}

dialog[open] {
  overscroll-behavior: contain;
}

.order-grid-table {
  border-collapse: separate;
  border-spacing: 0;
}

.order-grid-table th,
.order-grid-table td {
  height: 25px;
  padding: 3px 6px;
  border-right: 1px solid #cbd4cb;
  border-bottom: 1px solid #cbd4cb;
  font-size: 13px;
  line-height: 1.15;
  white-space: nowrap;
}

.order-product-head {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.order-time-sort-button {
  min-height: 23px;
  height: 23px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.order-time-sort-button.is-active {
  border-color: #1769aa;
  background: #1769aa;
  color: #fff;
}

.order-grid-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 29px;
  background: #e9eee9;
  color: #344139;
  font-weight: 900;
}

.order-grid-table th:last-child,
.order-grid-table td:last-child {
  border-right: 0;
}

.order-grid-table tbody tr:last-child td {
  border-bottom: 0;
}

.order-grid-table .product-table-cell {
  width: 34%;
  min-width: 400px;
  max-width: 520px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
  line-height: 1.15;
}

.order-copy-cell {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
}

.order-copy-cell-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-cell-copy-button {
  flex: 0 0 42px;
  width: 42px;
  min-height: 22px !important;
  height: 22px;
  padding: 0 3px !important;
  border-color: #c8d0ca !important;
  border-radius: 4px;
  background: #fff !important;
  color: #536159 !important;
  box-shadow: none;
  font-size: 11px;
  line-height: 1;
}

.table-cell-copy-button:hover,
.table-cell-copy-button:focus-visible {
  border-color: #9eaaa2 !important;
  background: #f4f7f5 !important;
  color: #334239 !important;
}

.order-grid-table .order-main-header td {
  height: 20px;
  padding: 0 6px;
  border-top: 1px solid #aebcaf;
  border-bottom-color: #aebcaf;
}

.order-grid-table .order-main-header:first-child td {
  border-top: 0;
}

.order-grid-table .order-main-head {
  display: grid;
  grid-template-columns: 26px 156px 8px 110px 8px 90px 8px 50px auto;
  gap: 3px;
  align-items: center;
  overflow: hidden;
}

.order-grid-table .order-main-head strong {
  min-width: 0;
  margin-right: 0;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Keep compact order rows from being expanded by their inline controls. */
.order-grid-table tbody th,
.order-grid-table tbody td {
  padding-top: 0;
  padding-bottom: 0;
}

.order-grid-table tbody .mini-link,
.order-grid-table tbody .planner-lock-pill,
.order-grid-table tbody .status-pill {
  min-height: 18px;
  line-height: 16px;
}

.order-grid-table .table-cell-copy-button {
  min-height: 18px !important;
  height: 18px;
}

.order-grid-table .order-main-header .mini-link,
.order-grid-table .order-main-header .tech-batch-link {
  min-height: 18px;
  line-height: 16px;
}

.order-grid-table .priority-mark-control {
  width: 20px;
  height: 20px;
}

.order-list-panel .order-grid-table button.priority-mark-trigger:not(:disabled) {
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
}

.order-grid-table .priority-mark-circle {
  width: 14px;
  height: 14px;
}

.order-grid-table .order-main-customer {
  width: 110px;
  max-width: 110px;
}

.order-grid-table .order-main-sales {
  width: 90px;
  max-width: 90px;
}

.order-grid-table .order-main-divider {
  text-align: center;
}

.order-grid-table .js-order-group-toggle {
  width: 50px;
  padding-left: 5px;
  padding-right: 5px;
}

.order-grid-table .tech-batch-link {
  width: max-content;
  justify-self: start;
  padding-left: 6px;
  padding-right: 6px;
}

.warehouse-batch-actions {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.order-grid-table .warehouse-batch-actions .tech-batch-link {
  padding-left: 5px;
  padding-right: 5px;
}

.order-main-summary {
  min-width: 0;
  overflow: hidden;
  color: #46544b;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-main-divider {
  color: #8d9990;
  font-size: 13px;
  font-weight: 700;
}

.order-main-customer {
  max-width: 180px;
}

.order-main-sales {
  max-width: 130px;
}

.order-grid-table .order-actions {
  gap: 4px;
  flex-wrap: nowrap;
}

.order-grid-table .order-actions > .js-open-tech-upload,
.order-grid-table .order-actions > .js-open-tech-drawing {
  order: 1;
}

.order-grid-table .order-actions > .tech-flow-action {
  order: 2;
}

.order-grid-table .mini-link,
.order-grid-table .planner-lock-pill,
.order-grid-table .status-pill {
  min-height: 21px;
  padding: 0 7px;
  border-radius: 4px;
  font-size: 13px;
  line-height: 19px;
}

.order-grid-table .inline-action-form .mini-link {
  min-height: 21px;
  padding: 0 7px;
  font-size: 13px;
}

.order-grid-table .sales-main-edit-link {
  width: 56px;
  min-width: 56px;
  padding: 0 2px;
  font-size: 12px;
}

.order-grid-table .order-main-sales-tools {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  white-space: nowrap;
}

.order-grid-table .order-inbound-time {
  flex: 0 0 auto;
  justify-self: start;
  color: #355b45;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.order-grid-table .drawing-name-link {
  max-width: 150px;
  font-size: 13px;
}

.order-grid-table .route-action-wrap {
  gap: 4px;
}

.order-grid-table .empty-cell {
  height: 44px;
  padding: 8px;
}

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

th, td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid #e3e8df;
  padding: 8px 9px;
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

th:last-child, td:last-child {
  border-right: 0;
}

th {
  color: var(--muted);
  background: #f8faf8;
  font-weight: 800;
}

.order-main-no-col {
  width: 14ch;
  white-space: nowrap;
}

.order-no-heading {
  display: flex;
  align-items: center;
  gap: 2px;
}

.table-head-toggle {
  min-height: 20px;
  padding: 0 2px;
  border: 1px solid #b8c6b9;
  border-radius: 3px;
  background: #fff;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  line-height: 18px;
}

.table-head-toggle:hover {
  border-color: var(--green);
  background: #f5faf6;
  color: var(--green-dark);
}

.order-sub-no-col {
  width: 4ch;
  white-space: nowrap;
  text-align: center;
}

.order-global-toggle-col {
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  padding-left: 4px !important;
  padding-right: 4px !important;
  text-align: center;
}

.order-global-toggle-col .table-head-toggle {
  width: 100%;
  min-height: 20px;
  padding: 0 2px;
  line-height: 18px;
  white-space: nowrap;
  word-break: normal;
}

.order-customer-col {
  width: 10ch;
  max-width: 10ch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-quantity-col {
  width: 4ch;
  max-width: 4ch;
  white-space: nowrap;
  text-align: right;
}

.order-stock-remaining-col {
  width: 72px;
  min-width: 72px;
  max-width: 72px;
  overflow: visible !important;
  text-align: center;
  white-space: nowrap;
}

.stock-remaining-button {
  position: relative;
  min-width: 42px;
  min-height: 22px;
  padding: 0 6px;
  border: 1px solid #7da88b;
  border-radius: 3px;
  background: #f2f8f4;
  color: #205d39;
  font-size: 14px;
  font-weight: 900;
  line-height: 20px;
}

.stock-remaining-button:hover,
.stock-remaining-button:focus-visible,
.stock-remaining-button.is-open {
  border-color: #3f7e56;
  background: #e6f2e9;
}

.stock-remaining-tooltip {
  position: absolute;
  z-index: 60;
  top: calc(100% + 5px);
  left: 50%;
  display: none;
  width: 220px;
  padding: 7px 9px;
  border: 1px solid #b9cbbd;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(31, 57, 39, .16);
  color: #2e3d33;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
  transform: translateX(-50%);
  white-space: normal;
}

.stock-remaining-button:hover .stock-remaining-tooltip,
.stock-remaining-button:focus-visible .stock-remaining-tooltip,
.stock-remaining-button.is-open .stock-remaining-tooltip {
  display: grid;
  gap: 2px;
}

.stock-remaining-tooltip span {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px auto;
  gap: 5px;
  align-items: center;
}

.stock-remaining-tooltip b {
  color: #173f2a;
  font-size: 13px;
  text-align: right;
}

.stock-remaining-tooltip small,
.stock-remaining-tooltip em {
  color: #6b776f;
  font-size: 11px;
  font-style: normal;
}

.stock-remaining-tooltip .stock-remaining-total {
  margin-top: 3px;
  padding-top: 4px;
  border-top: 1px solid #dce5de;
  color: #1e633b;
  font-weight: 900;
}

@media (min-width: 1201px) {
  .order-grid-table.planner-production-order-grid .order-quantity-col {
    font-size: 16px;
    font-weight: 900;
    text-align: center;
  }
}

.order-remark-col {
  width: 220px;
  min-width: 220px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-remark-col .order-copy-cell {
  width: 100%;
}

.order-status-col {
  width: 6.5em;
  min-width: 76px;
  max-width: 6.5em;
  text-align: center;
  white-space: nowrap;
}

.order-grid-table .order-status-col .status-pill {
  box-sizing: border-box;
  min-width: 66px;
  max-width: 100%;
  justify-content: center;
  padding-right: 5px;
  padding-left: 5px;
}

.status-filter-form {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.order-grid-table thead .order-status-col:has(.status-filter-form) {
  padding-right: 2px;
  padding-left: 2px;
}

.status-filter-select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 24px;
  min-height: 24px;
  margin: 0;
  padding: 0 14px 0 3px;
  border: 1px solid #bdc9c0;
  border-radius: 3px;
  background-color: #f7faf8;
  color: #34463a;
  font-size: 11px;
  font-weight: 700;
  line-height: 22px;
}

.status-filter-select.is-active {
  border-color: #4f8d64;
  background-color: #e8f3eb;
  color: #1f6739;
}

.order-date-col {
  width: 10ch;
  max-width: 10ch;
  white-space: nowrap;
  text-align: center;
}

.order-flow-time-col {
  width: 9em;
  max-width: 9em;
  white-space: nowrap;
}

.order-route-action-col {
  width: 82px;
  min-width: 82px;
  max-width: 82px;
  text-align: center;
  white-space: nowrap;
}

.route-action-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.route-no-text {
  display: inline-block;
  max-width: 76px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  vertical-align: middle;
}

.warehouse-route-button {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.warehouse-route-button:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
  color: #fff;
}

.change-notification-table td {
  vertical-align: top;
}

.change-detail-cell {
  width: 112px;
  min-width: 112px;
  text-align: center;
  vertical-align: middle !important;
}

.change-detail-cell .mini-link {
  min-width: 96px;
}

.change-notification-table .js-confirm-change-notification:disabled {
  border-color: #d8ddda;
  background: #eef0ef;
  color: #9aa29d;
  cursor: not-allowed;
  opacity: 1;
}

.warehouse-route-dialog.change-detail-dialog {
  width: min(820px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: hidden;
}

.change-detail-dialog-content {
  box-sizing: border-box;
  display: flex;
  max-height: calc(100vh - 24px);
  flex-direction: column;
  overflow: hidden;
}

.change-detail-dialog-scroll {
  min-height: 0;
  margin-top: 10px;
  overflow-y: auto;
}

.change-detail-dialog-summary {
  padding: 8px 10px;
  border: 1px solid #cfd9d1;
  background: #f4f8f4;
  color: #26342a;
  font-size: 14px;
  font-weight: 900;
}

.change-detail-dialog-list {
  display: grid;
  gap: 6px;
  margin-top: 7px;
}

.change-detail-dialog-list .change-detail-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 24px minmax(0, 1fr);
  max-width: none;
  min-height: 38px;
  padding: 6px 8px;
  font-size: 13px;
}

.change-detail-dialog-list .change-detail-field {
  max-width: none;
  white-space: normal;
}

.change-detail-dialog-list .change-detail-old,
.change-detail-dialog-list .change-detail-new {
  overflow: visible;
  padding: 4px 6px;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.change-detail-dialog-list .change-detail-note {
  display: block;
  max-width: none;
  min-height: 34px;
  padding: 6px 8px;
  line-height: 20px;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.notification-pending-row td {
  background: #fff9e8;
}

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

.change-summary {
  display: inline-block;
  margin-right: 6px;
  color: #26342a;
  font-size: 12px;
  font-weight: 900;
  line-height: 20px;
}

.change-detail-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 3px 5px;
  margin-top: 0;
  max-width: 100%;
  vertical-align: top;
}

.change-detail-item {
  display: inline-grid;
  grid-template-columns: max-content minmax(34px, 118px) 10px minmax(34px, 142px);
  gap: 2px;
  align-items: center;
  max-width: 100%;
  min-height: 20px;
  padding: 1px 4px;
  border: 1px solid #d7e3d7;
  border-radius: 4px;
  background: #fbfdfb;
  font-size: 12px;
  line-height: 18px;
}

.change-detail-field {
  max-width: 52px;
  overflow: hidden;
  color: #35433a;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.change-detail-old,
.change-detail-new {
  min-width: 0;
  overflow: hidden;
  padding: 0 4px;
  border-radius: 3px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.change-detail-old {
  background: transparent;
  color: #26342a;
}

.change-detail-new {
  background: transparent;
  color: #26342a;
}

.change-detail-old .change-detail-diff,
.change-detail-new .change-detail-diff {
  padding: 1px 2px;
  border-radius: 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  font-weight: 900;
}

.change-detail-old .change-detail-diff {
  background: #ffe3e0;
  color: #a42d24;
}

.change-detail-new .change-detail-diff {
  background: #dff3e6;
  color: #17663b;
}

.change-detail-arrow {
  color: #7c8980;
  text-align: center;
  font-weight: 900;
}

.change-detail-note {
  display: inline-block;
  max-width: 320px;
  overflow: hidden;
  min-height: 20px;
  padding: 1px 5px;
  border: 1px solid #ead8a3;
  border-radius: 4px;
  background: #fff9e8;
  color: #7a5a12;
  font-size: 12px;
  font-weight: 800;
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-status-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.notification-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.notification-status-pill.is-done {
  background: #edf5ef;
  color: var(--green);
}

.notification-status-pill.is-pending {
  background: #fff2cc;
  color: #8a5a00;
}

.notification-action-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.force-notification-dialog {
  width: min(620px, calc(100vw - 24px));
  padding: 0;
  border: 1px solid #d3b05d;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(31, 37, 33, .28);
}

.force-notification-dialog::backdrop {
  background: rgba(23, 33, 27, .48);
}

.shortage-force-notification-dialog {
  border-color: #dc7a70;
}

.shortage-force-notification-dialog .force-notification-head {
  border-bottom-color: #efb0aa;
  background: #fff1f0;
}

.shortage-force-notification-dialog .force-notification-head span,
.shortage-force-notification-dialog .force-notification-item em {
  color: #9b2c25;
}

.shortage-force-notification-dialog .force-notification-item {
  border-color: #efd0cc;
  background: #fffafa;
}

.force-notification-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #ead8a3;
  background: #fff8df;
}

.force-notification-head span {
  display: inline-flex;
  margin-bottom: 3px;
  color: #8a5a00;
  font-size: 12px;
  font-weight: 900;
}

.force-notification-head h2 {
  margin: 0;
  font-size: 20px;
}

.force-notification-head strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #d33d2f;
  color: #fff;
  font-size: 22px;
}

.force-notification-body {
  padding: 14px 16px 4px;
}

.force-notification-body p {
  margin: 0 0 10px;
  color: #46544b;
  font-size: 14px;
  font-weight: 800;
}

.force-notification-list {
  display: grid;
  gap: 6px;
  max-height: 250px;
  overflow: auto;
}

.force-notification-item {
  display: grid;
  grid-template-columns: 120px minmax(150px, 1fr) 96px;
  gap: 7px;
  align-items: center;
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid #e6dcc0;
  background: #fffdf6;
  font-size: 13px;
}

.force-notification-item span,
.force-notification-item small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.force-notification-item em {
  color: #8a5a00;
  font-style: normal;
  font-weight: 900;
}

.force-notification-item small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.force-change-list {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  gap: 3px 5px;
}

.force-change-item {
  display: inline-grid;
  grid-template-columns: max-content minmax(34px, 105px) 10px minmax(34px, 125px);
  gap: 2px;
  align-items: center;
  max-width: 100%;
  min-width: 0;
  min-height: 20px;
  padding: 1px 4px;
  border: 1px solid #d7e3d7;
  border-radius: 4px;
  background: #fbfdfb;
  font-size: 12px;
  line-height: 18px;
}

.force-change-item b {
  max-width: 52px;
  overflow: hidden;
  color: #35433a;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.force-change-item i {
  min-width: 0;
  overflow: hidden;
  padding: 0 4px;
  border-radius: 3px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.force-change-old {
  background: #fff0ef;
  color: #9b2c25;
}

.force-change-new {
  background: #eaf6ee;
  color: #1f6b41;
  font-weight: 900;
}

.force-change-note {
  max-width: 320px;
  overflow: hidden;
  padding: 1px 5px;
  border: 1px solid #ead8a3;
  border-radius: 4px;
  background: #fff9e8;
  color: #7a5a12;
  font-size: 12px;
  font-weight: 800;
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.force-notification-empty,
.force-notification-more {
  padding: 7px 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.force-notification-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px 14px;
}

.muted-action-text {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.warehouse-route-summary {
  margin-bottom: 12px;
}

.warehouse-route-page-form {
  grid-template-columns: minmax(240px, 1fr) 120px;
  max-width: 560px;
}

.warehouse-route-dialog {
  width: min(500px, calc(100vw - 24px));
  max-width: none;
  padding: 0;
  border: 1px solid #aebcaf;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 22px 60px rgba(23, 33, 27, .24);
}

.warehouse-route-dialog::backdrop {
  background: rgba(23, 33, 27, .42);
}

.warehouse-route-dialog-form {
  padding: 14px;
}

.warehouse-route-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.warehouse-route-dialog-head > div {
  min-width: 0;
}

.warehouse-route-dialog-head span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.warehouse-route-dialog-head strong {
  display: block;
  margin-top: 3px;
  font-size: 19px;
  line-height: 1.25;
  word-break: break-word;
}

.warehouse-dialog-close {
  flex: 0 0 30px;
  width: 30px;
  min-height: 30px;
  padding: 0;
  border-color: var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.warehouse-dialog-close:hover {
  border-color: #bcc8bd;
  background: #f2f5f2;
  color: var(--text);
}

.warehouse-route-dialog-order {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.warehouse-route-dialog-remark {
  margin-top: 7px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f8faf8;
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
}

.warehouse-route-dialog-fields {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 110px;
  gap: 8px;
  margin-top: 5px;
}

.warehouse-route-lines-wrap {
  grid-column: 1 / -1;
}

.warehouse-route-lines-head {
  display: grid;
  grid-template-columns: 72px 120px 74px 54px;
  gap: 6px;
  align-items: center;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.warehouse-route-lines-head span:nth-child(2) {
  text-align: center;
}

.warehouse-route-lines-head button {
  width: 100%;
  min-width: 0;
}

.warehouse-route-lines {
  display: grid;
  gap: 5px;
}

.warehouse-route-line {
  display: grid;
  grid-template-columns: 72px 120px 74px 54px;
  gap: 6px;
  align-items: center;
}

[data-editor-role="warehouse"] .warehouse-route-lines-head,
[data-editor-role="warehouse"] .warehouse-route-line {
  grid-template-columns: 72px 250px 74px 54px;
}

[data-editor-role="warehouse"] .warehouse-route-lines-head span:nth-child(2) {
  white-space: nowrap;
}

.warehouse-route-number-heading {
  display: block;
  width: max-content;
  max-width: none;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap !important;
}

.warehouse-route-line select,
.warehouse-route-line input {
  width: 100%;
  min-height: 32px;
  padding: 5px 7px;
  font-size: 13px;
}

.warehouse-route-line .warehouse-route-no-button {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  padding: 5px 7px;
  border-color: #2f7d4a;
  border-radius: 4px;
  background: #2f7d4a;
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
}

.warehouse-route-line .warehouse-route-no-button:hover,
.warehouse-route-line .warehouse-route-no-button:focus-visible {
  background: #24653b;
}

.warehouse-route-line .warehouse-route-no-button.is-changed {
  border-color: #b7791f;
  background: #f4c95d;
  color: #49320a;
}

.warehouse-route-line .warehouse-route-no-button:disabled {
  border-color: #c8ced2;
  background: #e5e8ea;
  color: #687078;
  cursor: default;
}

.warehouse-route-line .mini-link {
  min-height: 32px;
  padding: 0 8px;
}

.warehouse-route-line.is-readonly select,
.warehouse-route-line.is-readonly input {
  border-color: #d8dce1;
  background: #f1f3f5;
  color: #5f6872;
}

.warehouse-route-line.is-readonly .mini-link {
  opacity: 0.45;
}

.route-detail-box {
  margin-bottom: 10px;
}

.route-detail-table {
  display: grid;
  gap: 4px;
}

.route-detail-row {
  display: grid;
  grid-template-columns: 72px minmax(120px, 1fr) 90px;
  gap: 6px;
  align-items: center;
  min-height: 30px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  font-size: 13px;
}

.route-detail-row strong {
  font-size: 14px;
}

.warehouse-route-dialog-fields label {
  margin-bottom: 0;
}

.warehouse-route-dialog-actions {
  justify-content: flex-end;
  margin-top: 12px;
}

.route-operation-record-link {
  margin-right: auto;
}

.route-split-dialog {
  width: min(1100px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow-y: auto;
}

.route-split-dialog .warehouse-route-dialog-form {
  display: grid;
  gap: 10px;
}

.route-operation-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(360px, 100%);
  gap: 8px;
}

.route-operation-tabs button {
  min-height: 42px;
  padding: 0 18px;
  border: 2px solid;
  border-radius: 7px;
  font-size: 15px;
  font-weight: 900;
}

.route-operation-tabs button[data-operation="split"] {
  border-color: #5e9870;
  background: #f2f8f3;
  color: #24613a;
}

.route-operation-tabs button[data-operation="replacement"] {
  border-color: #7898bd;
  background: #f1f6fc;
  color: #315f91;
}

.route-operation-tabs button[data-operation="split"].is-active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(45, 109, 68, .15);
}

.route-operation-tabs button[data-operation="replacement"].is-active {
  background: #356fa8;
  border-color: #356fa8;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(53, 111, 168, .16);
}

.route-operation-tabs button:not(.is-active) {
  opacity: .78;
}

.route-split-lookup-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 88px;
  gap: 8px;
  align-items: end;
}

.route-split-lookup-row label,
.route-split-controls label {
  gap: 3px;
  margin: 0;
}

.route-split-lookup-row button {
  min-height: 38px;
}

.route-split-summary {
  min-width: 0;
  padding: 8px 10px;
  border-left: 3px solid var(--green);
  background: #f2f7f3;
}

.route-split-summary strong,
.route-split-summary span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-split-summary strong {
  font-size: 16px;
}

.route-split-summary span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.route-split-orders {
  overflow-x: auto;
  border: 1px solid #d8e1da;
}

.route-split-orders-head,
.route-split-order-row {
  display: grid;
  grid-template-columns: 118px 90px minmax(240px, 1fr) 66px 66px 76px 66px 158px;
  gap: 6px;
  align-items: center;
  min-width: 970px;
}

.route-split-dialog.is-replacement .route-split-orders-head,
.route-replacement-order-row {
  grid-template-columns: 118px 100px minmax(320px, 1fr) 86px 86px;
  min-width: 760px;
}

.route-split-orders-head {
  min-height: 30px;
  padding: 4px 7px;
  background: #edf3ee;
  color: #45534a;
  font-size: 12px;
  font-weight: 900;
}

.route-split-order-rows {
  display: grid;
}

.route-split-order-row {
  min-height: 36px;
  padding: 4px 7px;
  border-top: 1px solid #e0e6e1;
  background: #fff;
  font-size: 13px;
}

.route-split-order-row > span,
.route-split-order-row > strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-split-order-row input[type="number"] {
  width: 70px;
  min-height: 28px;
  padding: 3px 5px;
}

.route-split-order-row select {
  width: 154px;
  min-height: 28px;
  padding: 3px 5px;
  font-size: 12px;
}

.route-split-order-row.is-invalid {
  background: #fff0ef;
}

.planner-stock-split-dialog {
  width: min(720px, calc(100vw - 24px));
}

.planner-stock-split-dialog .warehouse-route-dialog-form {
  display: grid;
  gap: 10px;
}

.planner-stock-split-notice {
  padding: 8px 10px;
  border-left: 3px solid #c98716;
  background: #fff8e7;
  color: #634b1d;
  font-size: 13px;
}

.planner-stock-split-head,
.planner-stock-split-row {
  display: grid;
  grid-template-columns: 94px 78px 78px 78px minmax(112px, 1fr);
  gap: 8px;
  align-items: center;
}

.planner-stock-split-head {
  min-height: 30px;
  padding: 4px 8px;
  background: #edf3ee;
  color: #45534a;
  font-size: 12px;
  font-weight: 900;
}

.planner-stock-split-rows {
  display: grid;
  border: 1px solid #d8e1da;
  border-top: 0;
}

.planner-stock-split-row {
  min-height: 38px;
  padding: 4px 8px;
  background: #fff;
  font-size: 14px;
}

.planner-stock-split-row + .planner-stock-split-row {
  border-top: 1px solid #e0e6e1;
}

.planner-stock-split-row input {
  width: 100%;
  min-width: 0;
  min-height: 30px;
  padding: 3px 6px;
  font-size: 14px;
}

.route-split-controls {
  display: grid;
  grid-template-columns: minmax(180px, 360px);
  gap: 8px;
}

.route-split-controls input,
.route-split-controls select {
  min-width: 0;
}

.route-split-equation {
  padding: 7px 10px;
  border: 1px solid #bfd2c4;
  background: #f7fbf8;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.route-split-equation.is-invalid {
  border-color: #e2aaa5;
  background: #fff0ef;
  color: var(--red);
}

@media (max-width: 700px) {
  .route-split-controls {
    grid-template-columns: 1fr;
  }
}

.tech-upload-dialog {
  width: min(580px, calc(100vw - 24px));
}

.tech-drawing-dialog {
  width: min(640px, calc(100vw - 24px));
}

.tech-batch-dialog {
  width: min(1080px, calc(100vw - 24px));
}

.warehouse-batch-dialog.warehouse-batch-multi-mode[data-batch-action="create"] {
  width: min(1280px, calc(100vw - 24px));
}

.order-view-dialog {
  width: min(980px, calc(100vw - 24px));
}

.order-view-meta-row {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.order-view-meta-row .warehouse-route-dialog-order {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-view-print-count {
  flex: 0 0 auto;
  margin-top: 8px;
  padding: 3px 8px;
  border: 1px solid #9dbdde;
  border-radius: 4px;
  background: #edf6ff;
  color: #245f98;
  font-size: 12px;
  font-weight: 800;
}

.sales-order-edit-dialog {
  width: min(760px, calc(100vw - 24px));
}

.sales-edit-panel {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.sales-edit-dialog-form {
  display: grid;
  grid-template-columns: 120px minmax(240px, 1fr) 82px 138px;
  gap: 7px;
  align-items: end;
}

.sales-edit-dialog-form label,
.sales-main-edit-form label,
.sales-edit-delete-form {
  margin: 0;
}

.sales-edit-dialog-form input,
.sales-main-edit-form input {
  min-height: 32px;
}

.sales-edit-dialog-remark {
  grid-column: 1 / 4;
}

.sales-edit-dialog-actions {
  display: flex;
  align-items: end;
}

.sales-edit-dialog-actions button,
.sales-edit-delete-form .danger-button {
  width: 100%;
  min-height: 32px;
}

.sales-main-edit-form {
  display: grid;
  grid-template-columns: 150px 140px minmax(220px, 1fr) 118px;
  gap: 7px;
  align-items: end;
}

.sales-edit-delete-form {
  display: grid;
  gap: 7px;
  padding-top: 0;
  border-top: 0;
}

.sales-edit-single-delete-form {
  grid-template-columns: 120px minmax(240px, 1fr) 82px 138px;
}

.sales-edit-main-delete-form {
  grid-template-columns: 160px minmax(260px, 1fr) 118px;
}

.sales-edit-delete-form .danger-button {
  grid-column: -2 / -1;
}

.warehouse-route-dialog .sales-delete-danger-button:not(:disabled),
.warehouse-route-dialog .sales-delete-danger-button:not(:disabled):hover,
.warehouse-route-dialog .sales-delete-danger-button:not(:disabled):focus-visible {
  border-color: #d92d20;
  background: #d92d20;
  color: #fff;
}

.route-number-dialog {
  width: min(720px, calc(100vw - 24px));
}

.route-completion-dialog {
  width: min(820px, calc(100vw - 24px));
}

.route-number-list {
  margin-top: 10px;
  overflow-x: auto;
}

.route-number-dialog .warehouse-route-dialog-order {
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.4;
}

.route-completion-list {
  margin-top: 10px;
}

.route-number-head,
.route-number-row {
  display: grid;
  grid-template-columns: 60px 74px 82px 68px 68px 68px 70px 74px 86px 100px 86px minmax(100px, 1fr);
  min-width: 995px;
  gap: 5px;
  align-items: center;
}

.route-number-head {
  padding: 5px 7px;
  border: 1px solid #d6dfd2;
  border-bottom: 0;
  background: #edf3ec;
  color: #425047;
  font-size: 13px;
  font-weight: 900;
}

.route-number-rows {
  display: grid;
  gap: 0;
}

.route-number-row {
  min-height: 32px;
  padding: 5px 7px;
  border: 1px solid #d6dfd2;
  border-top: 0;
  background: #fff;
  font-size: 13px;
}

.route-number-row strong {
  font-size: 15px;
}

.route-allocation-sections {
  display: grid;
  gap: 8px;
  min-width: 650px;
  margin-top: 10px;
}

.route-allocation-title {
  color: #34463b;
  font-size: 14px;
  font-weight: 900;
}

.route-allocation-section {
  overflow: hidden;
  border: 1px solid #cfd9d2;
  border-radius: 6px;
  background: #fff;
}

.route-allocation-summary {
  display: grid;
  grid-template-columns: minmax(170px, 1.5fr) repeat(3, minmax(110px, 1fr));
  align-items: stretch;
  background: #eef4ef;
}

.route-allocation-identity,
.route-allocation-summary dl {
  min-width: 0;
  margin: 0;
  padding: 6px 9px;
  border-right: 1px solid #d7e0da;
}

.route-allocation-summary > :last-child {
  border-right: 0;
}

.route-allocation-identity {
  display: flex;
  align-items: center;
  gap: 7px;
}

.route-allocation-identity span,
.route-allocation-summary dt {
  color: #5f6d64;
  font-size: 11px;
  font-weight: 700;
}

.route-allocation-identity strong {
  color: #1f5f3b;
  font-size: 17px;
}

.route-allocation-identity em {
  padding: 1px 5px;
  border: 1px solid #b8c9bd;
  border-radius: 3px;
  color: #4d6254;
  font-size: 10px;
  font-style: normal;
  white-space: nowrap;
}

.route-allocation-summary dl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
}

.route-allocation-summary dd {
  margin: 0;
  color: #243b2d;
  font-size: 16px;
  font-weight: 900;
}

.route-allocation-order-head,
.route-allocation-order-row {
  display: grid;
  grid-template-columns: 125px 90px minmax(180px, 1fr) 70px 70px 82px;
  min-width: 650px;
  align-items: center;
}

.route-allocation-order-head {
  min-height: 27px;
  border-top: 1px solid #d7e0da;
  border-bottom: 1px solid #d7e0da;
  background: #f7f9f7;
  color: #526057;
  font-size: 11px;
  font-weight: 900;
}

.route-allocation-order-row {
  min-height: 29px;
  border-bottom: 1px solid #edf1ee;
  font-size: 12px;
}

.route-allocation-order-row:last-child {
  border-bottom: 0;
}

.route-allocation-order-head span,
.route-allocation-order-row > span,
.route-allocation-order-row > strong {
  min-width: 0;
  overflow: hidden;
  padding: 3px 6px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-allocation-order-row > span:nth-child(3) {
  text-align: left;
}

.route-allocation-order-row span b {
  display: inline-block;
  margin-right: 4px;
  color: #68766d;
  font-size: 9px;
}

.route-allocation-order-row > strong {
  color: #1f6b42;
  font-size: 14px;
}

.route-allocation-empty {
  padding: 9px;
  color: var(--muted);
  text-align: center;
}

.route-inbound-state {
  overflow: hidden;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-completion-state {
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.route-number-completed-quantity {
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.route-number-scrap-quantity {
  color: #a33a32;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.route-number-own-reuse-quantity {
  color: #7b5d16;
  font-weight: 900;
}

.route-number-other-reuse-quantity {
  color: #a34c21;
  font-weight: 900;
}

.route-completion-state.is-empty {
  color: #7a847d;
}

.route-completion-state.is-complete {
  color: #267047;
}

.route-completion-state.is-partial {
  color: #1f5f9f;
}

.route-number-completed-quantity.is-empty {
  color: #7a847d;
}

.route-number-completed-quantity.is-complete {
  color: #267047;
}

.route-number-completed-quantity.is-partial {
  color: #1f5f9f;
}

.route-number-date {
  color: #4f5c54;
  font-size: 12px;
  white-space: nowrap;
}

.route-number-note {
  color: #1f5f9f;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.route-inbound-state.is-empty {
  color: #7a847d;
}

.route-inbound-state.is-partial {
  color: #1f5f9f;
}

.route-inbound-state.is-complete {
  color: #267047;
}

.route-processing-state {
  display: block;
  margin-top: 1px;
  font-size: 10px;
  font-weight: 800;
}

.route-processing-state.is-active {
  color: #267047;
}

.route-processing-state.is-stopped {
  color: #a33a32;
}

.route-number-link {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1f5f9f;
  font: inherit;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.route-number-link:hover {
  text-decoration: underline;
}

.route-completion-head,
.route-completion-row {
  display: grid;
  grid-template-columns: 28px 52px 82px 62px 70px minmax(180px, 1fr) 82px;
  gap: 4px;
  align-items: center;
}

.route-completion-head {
  padding: 5px 7px;
  border: 1px solid #d6dfd2;
  border-bottom: 0;
  background: #edf3ec;
  color: #425047;
  font-size: 13px;
  font-weight: 900;
}

.route-completion-rows {
  display: grid;
}

.route-completion-row {
  min-height: 32px;
  margin: 0;
  padding: 4px 7px;
  border: 1px solid #d6dfd2;
  border-top: 0;
  background: #fff;
  font-size: 13px;
}

.route-completion-row input[type="checkbox"] {
  width: 14px;
  height: 14px;
  min-height: 14px;
  margin: 0 auto;
}

.route-completion-quantity {
  width: 64px;
  min-height: 24px;
  padding: 0 5px;
  border: 1px solid #cfd9ce;
  border-radius: 4px;
  font-size: 13px;
}

.route-completion-row strong {
  font-size: 15px;
}

.route-completion-row em {
  min-width: 0;
  overflow: hidden;
  color: #7a5a12;
  font-style: normal;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-completion-row.is-completed {
  background: #f4f7f4;
}

.route-completion-row.is-completed em {
  color: #1f6b41;
}

.route-completion-action {
  display: flex;
  justify-content: flex-end;
}

.route-stock-transfer-button {
  border-color: #267047;
  background: #267047;
  color: #fff;
  white-space: nowrap;
}

.route-stock-transfer-button:hover,
.route-stock-transfer-button:focus-visible {
  border-color: #1e5939;
  background: #1e5939;
  color: #fff;
}

.route-flow-panel {
  margin-top: 10px;
  overflow-x: auto;
  border: 1px solid #d6dfd2;
  background: #fff;
}

.route-flow-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-bottom: 1px solid #d6dfd2;
  background: #edf3ec;
  color: #425047;
  font-size: 13px;
  font-weight: 900;
}

.route-flow-head,
.route-flow-row {
  display: grid;
  grid-template-columns: 106px 58px 60px minmax(110px, 1fr) 42px 54px 58px 58px 42px 54px 62px 122px;
  min-width: 930px;
  gap: 5px;
  align-items: center;
}

.route-flow-head {
  padding: 5px 7px;
  border-bottom: 1px solid #d6dfd2;
  color: #425047;
  font-size: 12px;
  font-weight: 900;
}

.route-flow-row {
  min-height: 28px;
  padding: 4px 7px;
  border-bottom: 1px solid #edf1ed;
  font-size: 12px;
}

.route-flow-row:last-child {
  border-bottom: 0;
}

.route-flow-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-flow-own-reuse,
.route-flow-effective {
  color: #6f5818;
  font-weight: 800;
}

.route-flow-other-reuse {
  color: #9b4b20;
  font-weight: 800;
}

.route-flow-scrap {
  color: #a33a32;
  font-weight: 900;
}

.route-inherited-mark {
  display: inline-block;
  margin-right: 3px;
  padding: 0 3px;
  border: 1px solid #a9c7b1;
  border-radius: 3px;
  background: #edf7f0;
  color: #246443;
  font-size: 10px;
  line-height: 16px;
}

.tech-drawing-dialog-content {
  display: block;
}

.tech-batch-dialog-content {
  display: block;
}

.tech-batch-dialog-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfb;
}

.tech-batch-dialog-toolbar button,
.tech-batch-dialog-toolbar .button,
.tech-batch-dialog-toolbar .batch-select-all {
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

.warehouse-batch-route-form {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.tech-batch-dialog-toolbar form[hidden] {
  display: none !important;
}

.warehouse-batch-create-mode {
  display: inline-grid;
  grid-template-columns: repeat(2, 124px);
  gap: 5px;
  margin-top: 10px;
  padding: 5px;
  border: 2px solid #aebbb1;
  border-radius: 6px;
  background: #e8ede9;
}

.warehouse-batch-create-mode[hidden] {
  display: none;
}

.warehouse-batch-create-mode button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #aebbb1;
  border-radius: 4px;
  background: #fff;
  color: #33443a;
  box-shadow: none;
  font-size: 13px;
  font-weight: 700;
}

.warehouse-batch-create-mode button.is-active {
  border-color: #165f3b;
  background: #165f3b;
  color: #fff;
  box-shadow: 0 0 0 2px #165f3b;
  font-weight: 900;
}

.warehouse-batch-create-mode button.is-active::before {
  content: "✓";
  display: inline-block;
  margin-right: 6px;
  font-size: 15px;
  line-height: 1;
}

.warehouse-batch-dialog-table .warehouse-batch-type-col {
  width: 78px;
  max-width: 78px;
}

.warehouse-batch-dialog-table .warehouse-batch-opening-col {
  width: 82px;
  min-width: 82px;
  max-width: 82px;
  text-align: center;
}

.warehouse-batch-dialog-table .order-quantity-col {
  width: 82px;
  min-width: 82px;
  max-width: 82px;
  text-align: center;
}

.warehouse-batch-dialog-table .warehouse-batch-opening-col input {
  box-sizing: border-box;
  width: 68px;
  min-height: 27px;
  padding: 0 5px;
  text-align: center;
}

.warehouse-batch-dialog-table .warehouse-batch-type-col select {
  width: 72px;
  min-height: 30px;
  padding: 0 22px 0 7px;
  font-size: 12px;
}

.warehouse-batch-dialog:not([data-batch-action="create"]) .warehouse-batch-type-col {
  display: none;
}

.warehouse-batch-dialog:not([data-batch-action="create"]) .warehouse-batch-opening-col {
  display: none;
}

.warehouse-batch-dialog[data-batch-action="create"][data-create-step="select"] .warehouse-batch-type-col {
  display: none;
}

.warehouse-batch-dialog[data-batch-action="create"][data-create-step="types"] .batch-select-all {
  display: none;
}

.tech-batch-dialog .batch-upload-panel {
  grid-template-columns: minmax(520px, 650px) auto;
  margin-top: 8px;
  padding: 8px;
}

.batch-upload-file-field {
  margin-top: 0;
}

.batch-upload-file-field .tech-upload-drop-zone {
  min-height: 78px;
  padding: 8px;
}

.batch-upload-file-field .tech-upload-drop-zone strong {
  font-size: 14px;
}

.tech-batch-dialog-scroll {
  max-height: min(55vh, 470px);
  margin-top: 9px;
  border: 1px solid #cbd8c8;
  background: #fff;
}

.tech-batch-dialog-table {
  min-width: 820px;
  border-collapse: separate;
  border-spacing: 0;
}

.tech-batch-dialog-table th,
.tech-batch-dialog-table td {
  padding: 5px 7px;
  border-right: 1px solid #d6dfd2;
  border-bottom: 1px solid #d6dfd2;
  font-size: 13px;
  line-height: 1.25;
}

.tech-batch-dialog-table th {
  background: #edf3ec;
  font-weight: 900;
  text-align: left;
  white-space: nowrap;
}

.tech-batch-dialog-table .product-table-cell {
  min-width: 300px;
}

.tech-batch-dialog-table .drawing-name-link {
  max-width: 260px;
}

.warehouse-batch-dialog-table {
  min-width: 900px;
}

.warehouse-batch-dialog-table .product-table-cell {
  width: 220px;
  min-width: 220px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-batch-dialog-table .warehouse-batch-route-col {
  width: 110px;
  min-width: 110px;
  max-width: 110px;
}

.warehouse-batch-dialog-table .warehouse-batch-route-col .status-pill {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  justify-content: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-batch-dialog-table .warehouse-batch-remark {
  width: 230px;
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combined-route-preview-toolbar {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) 92px 170px auto;
  align-items: end;
  gap: 7px;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfb;
}

.combined-route-preview-toolbar label {
  margin: 0;
}

.combined-route-preview-toolbar label:not(.batch-select-all) {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.combined-route-preview-toolbar input,
.combined-route-preview-toolbar select {
  min-height: 30px;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 13px;
}

.combined-route-select-all {
  min-height: 30px;
  align-self: end;
  border-radius: 5px;
}

.combined-route-number-field input[readonly] {
  background: #eef3ef;
  color: #33483a;
}

.combined-route-preview-summary {
  display: flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid #cbd8c8;
  border-radius: 5px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.combined-route-preview-summary i {
  color: var(--line-strong);
  font-style: normal;
}

.combined-route-preview-summary strong {
  color: var(--green-dark);
}

.combined-route-preview-scroll {
  max-height: min(62vh, 560px);
  margin-top: 9px;
  border: 1px solid #cbd8c8;
  background: #fff;
}

.combined-route-preview-table {
  min-width: 900px;
  border-collapse: separate;
  border-spacing: 0;
}

.combined-route-preview-table th,
.combined-route-preview-table td {
  height: 32px;
  padding: 4px 6px;
  border-right: 1px solid #d6dfd2;
  border-bottom: 1px solid #d6dfd2;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combined-route-preview-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #edf3ec;
  font-weight: 900;
  text-align: left;
}

.combined-route-preview-table tbody tr.is-selected td {
  background: #f0f8f2;
}

.combined-route-preview-table .product-table-cell {
  width: 220px;
  min-width: 220px;
  max-width: 220px;
}

.combined-route-preview-table .product-table-cell strong {
  font-weight: 700;
}

.combined-route-preview-table .warehouse-batch-opening-col input {
  width: 62px;
  min-height: 26px;
  padding: 0 5px;
  text-align: center;
}

.combined-route-preview-table .warehouse-batch-type-col {
  text-align: center;
}

.warehouse-batch-dialog[data-create-mode="combined"] .combined-route-preview-table .warehouse-batch-type-col {
  display: table-cell;
}

.combined-route-preview-table .warehouse-batch-route-col .status-pill {
  width: 100%;
  max-width: 100%;
  justify-content: center;
}

.combined-route-preview-table .combined-route-order-group td {
  height: 30px;
  padding: 4px 9px;
  background: #e4ece5;
  color: #35473b;
  font-size: 12px;
  text-align: left;
}

.combined-route-preview-table .combined-route-order-group strong {
  margin-right: 8px;
  color: #1e4f35;
}

.combined-route-preview-table .combined-route-order-group span {
  margin-right: 8px;
}

.combined-route-preview-actions {
  justify-content: flex-end;
  margin-top: 9px;
}

@media (max-width: 760px) {
  .combined-route-preview-toolbar {
    grid-template-columns: auto minmax(180px, 1fr);
  }

  .combined-route-preview-summary {
    grid-column: 1 / -1;
  }
}

.tech-drawing-list {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.tech-drawing-item {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 5px 6px;
  border: 1px solid #d7e0d5;
  border-radius: 6px;
  background: #fbfcfb;
}

.tech-drawing-name {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tech-drawing-item .mini-link {
  min-height: 25px;
  padding: 0 8px;
  font-size: 12px;
}

.tech-drawing-empty {
  min-height: 34px;
  padding: 8px 9px;
  border: 1px solid #d7e0d5;
  border-radius: 6px;
  background: #fbfcfb;
  color: var(--muted);
  font-size: 13px;
}

.tech-upload-file-field {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tech-upload-file-field > span {
  display: block;
  margin-bottom: 5px;
}

.tech-upload-drop-zone {
  position: relative;
  display: flex;
  min-height: 104px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border: 2px dashed #abc0b0;
  border-radius: 6px;
  background: #f7faf8;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.tech-upload-drop-zone:hover,
.tech-upload-drop-zone:focus,
.tech-upload-drop-zone.is-dragging {
  border-color: var(--green);
  outline: 0;
  background: #edf6f0;
}

.tech-upload-drop-zone strong {
  font-size: 16px;
  line-height: 1.3;
}

.tech-upload-drop-zone > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.tech-upload-drop-zone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 1px;
  margin: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.tech-upload-file-summary {
  min-height: 18px;
  margin-top: 5px;
  color: #486052;
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.order-view-scroll {
  max-height: min(70vh, 620px);
  overflow: auto;
}

.order-view-section {
  margin-top: 10px;
}

.order-view-section h3 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 14px;
}

.order-view-info-grid {
  display: grid;
  grid-template-columns: 78px minmax(120px, 1fr) 78px minmax(120px, 1fr);
  border-top: 1px solid #d6dfd2;
  border-left: 1px solid #d6dfd2;
}

.order-view-info-label,
.order-view-info-value {
  min-height: 30px;
  padding: 5px 7px;
  border-right: 1px solid #d6dfd2;
  border-bottom: 1px solid #d6dfd2;
  font-size: 13px;
  line-height: 1.35;
}

.order-view-info-label {
  background: #edf3ec;
  color: #425047;
  font-weight: 900;
  white-space: nowrap;
}

.order-view-info-value {
  min-width: 0;
  overflow: hidden;
  background: #fff;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-view-loading {
  grid-column: 1 / -1;
  min-height: 34px;
  padding: 8px 9px;
  color: var(--muted);
  font-size: 13px;
}

.order-view-attachments {
  display: grid;
  gap: 5px;
}

.order-view-attachment-item {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 92px 138px auto auto;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 4px 6px;
  border: 1px solid #d6dfd2;
  background: #fff;
  font-size: 13px;
}

.print-attachment-frame {
  position: fixed;
  right: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.order-view-log-scroll {
  max-height: 260px;
  border: 1px solid #d6dfd2;
  background: #fff;
}

.order-view-log-table {
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
}

.order-view-log-table th,
.order-view-log-table td {
  padding: 5px 7px;
  border-right: 1px solid #d6dfd2;
  border-bottom: 1px solid #d6dfd2;
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
  vertical-align: top;
}

.order-view-log-table th {
  background: #edf3ec;
  font-weight: 900;
  white-space: nowrap;
}

.topbar nav .button,
.topbar nav button,
.order-list-panel .button,
.order-list-panel .mini-link:not(.disabled-mini-link),
.order-list-panel button:not(:disabled),
.warehouse-route-dialog button:not(:disabled) {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.topbar nav .button:hover,
.topbar nav button:hover,
.order-list-panel .button:hover,
.order-list-panel .mini-link:not(.disabled-mini-link):hover,
.order-list-panel button:not(:disabled):hover,
.warehouse-route-dialog button:not(:disabled):hover {
  border-color: var(--green-dark);
  background: var(--green-dark);
  color: #fff;
}

.warehouse-route-dialog .danger-button:not(:disabled),
.warehouse-route-dialog .danger-mini-link:not(:disabled) {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.warehouse-route-dialog .danger-button:not(:disabled):hover,
.warehouse-route-dialog .danger-mini-link:not(:disabled):hover {
  border-color: #b42318;
  background: #b42318;
  color: #fff;
}

.warehouse-route-dialog .sales-edit-delete-form .sales-delete-danger-button:not(:disabled),
.warehouse-route-dialog .sales-edit-delete-form .sales-delete-danger-button:not(:disabled):hover,
.warehouse-route-dialog .sales-edit-delete-form .sales-delete-danger-button:not(:disabled):focus-visible {
  border-color: #d92d20;
  background: #d92d20;
  color: #fff;
}

.priority-mark-form {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0;
}

.priority-mark-control {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin: 0;
  border-radius: 50%;
}

.priority-mark-trigger,
.order-list-panel button.priority-mark-trigger:not(:disabled) {
  width: 26px;
  min-width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.priority-mark-trigger:hover,
.order-list-panel .priority-mark-trigger:not(:disabled):hover {
  border: 0;
  background: #edf5ef;
  color: inherit;
}

.priority-mark-circle,
.filter-mark-circle {
  display: inline-block;
  flex: 0 0 auto;
  box-sizing: border-box;
  width: 18px;
  height: 18px;
  border: 2px solid #8b9690;
  border-radius: 50%;
  background: transparent;
}

.priority-mark-circle.is-empty,
.filter-mark-circle.is-empty {
  border-color: #87948d;
  background: #fff;
}

.priority-mark-circle.is-red,
.filter-mark-circle.is-red {
  border-color: #cf352e;
  background: #e5483f;
}

.priority-mark-circle.is-yellow,
.filter-mark-circle.is-yellow {
  border-color: #d69a00;
  background: #f4bf24;
}

.priority-mark-circle.is-blue,
.filter-mark-circle.is-blue {
  border-color: #2769bd;
  background: #3c8de8;
}

.priority-mark-circle.is-purple,
.filter-mark-circle.is-purple {
  border-color: #7040ae;
  background: #9461d4;
}

.priority-mark-menu {
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  display: flex;
  width: max-content;
  gap: 2px;
  margin: 0;
  padding: 3px;
  border: 1px solid #aebbb2;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 4px 12px rgb(37 52 43 / 18%);
}

.priority-mark-menu[hidden] {
  display: none;
}

.priority-mark-option,
.order-list-panel button.priority-mark-option:not(:disabled) {
  width: 26px;
  min-width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: #fff;
}

.priority-mark-option:hover,
.order-list-panel .priority-mark-option:not(:disabled):hover {
  border-color: #c2d0c6;
  background: #edf5ef;
  color: inherit;
}

.priority-filter-list {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  min-width: 0;
}

.priority-filter-box {
  display: grid;
  grid-template-columns: 29px minmax(0, 1fr);
  flex: 0 0 86px;
  width: 86px;
  min-height: 29px;
  border: 1px solid #c6d0c9;
  border-radius: 5px;
  background: #fff;
  overflow: hidden;
}

.priority-filter-box[data-color="red"] {
  border-color: #e8bbb7;
  background: #fff8f7;
}

.priority-filter-box[data-color="yellow"] {
  border-color: #e4cf88;
  background: #fffdf3;
}

.priority-filter-box[data-color="blue"] {
  border-color: #b9d1ea;
  background: #f7fbff;
}

.priority-filter-box[data-color="purple"] {
  border-color: #d1bee5;
  background: #fcf8ff;
}

.priority-filter-box[data-color="red"].is-active {
  border-color: #cf352e;
  box-shadow: inset 0 0 0 1px #cf352e;
}

.priority-filter-box[data-color="yellow"].is-active {
  border-color: #d69a00;
  box-shadow: inset 0 0 0 1px #d69a00;
}

.priority-filter-box[data-color="blue"].is-active {
  border-color: #2769bd;
  box-shadow: inset 0 0 0 1px #2769bd;
}

.priority-filter-box[data-color="purple"].is-active {
  border-color: #7040ae;
  box-shadow: inset 0 0 0 1px #7040ae;
}

.mark-filter-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 29px;
  width: 29px;
  min-height: 27px;
  padding: 0;
  border: 0;
  border-right: 1px solid #d5ddd7;
  border-radius: 0;
  background: transparent;
}

.mark-filter-button:hover {
  border-color: #d5ddd7;
  background: #edf5ef;
}

.priority-filter-list .priority-color-note-button,
.order-list-panel button.priority-color-note-button:not(:disabled) {
  width: 100%;
  min-width: 0;
  min-height: 27px;
  padding: 0 3px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #46524b;
  font-size: 12px;
  text-align: center;
  font-weight: 700;
  overflow: hidden;
  touch-action: manipulation;
}

.priority-filter-list .priority-color-note-button:hover,
.order-list-panel button.priority-color-note-button:not(:disabled):hover {
  border: 0;
  background: rgba(255, 255, 255, 0.72);
  color: #253029;
}

.priority-filter-list .priority-color-note-button:focus {
  outline: 2px solid #74a68a;
  outline-offset: -2px;
}

.priority-filter-list .priority-color-note-button.is-long-pressing,
.order-list-panel button.priority-color-note-button.is-long-pressing:not(:disabled) {
  background: #eaf6ee;
  box-shadow: inset 0 0 0 1px rgba(43, 119, 78, .22);
}

.priority-filter-list .priority-color-note-button.is-empty,
.order-list-panel button.priority-color-note-button.is-empty:not(:disabled) {
  color: #7b867f;
  font-weight: 500;
}

.priority-color-note-text {
  display: block;
  width: 100%;
  overflow: hidden;
  line-height: 27px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.priority-filter-list .priority-color-note-button.is-saving,
.order-list-panel button.priority-color-note-button.is-saving:not(:disabled) {
  background: #fff9dc;
}

.priority-filter-list .priority-color-note-button.is-saved,
.order-list-panel button.priority-color-note-button.is-saved:not(:disabled) {
  background: #eaf6ee;
}

.priority-filter-list .priority-color-note-button.is-error,
.order-list-panel button.priority-color-note-button.is-error:not(:disabled) {
  background: #fff0ef;
}

.priority-note-popover {
  position: fixed;
  z-index: 1100;
  width: 214px;
  padding: 8px;
  border: 1px solid #c6d0c9;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(23, 33, 27, 0.16);
}

.priority-note-form {
  display: grid;
  gap: 7px;
  margin: 0;
}

.priority-note-head {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 22px;
  color: var(--text);
  font-size: 13px;
}

.priority-note-head .filter-mark-circle {
  width: 15px;
  height: 15px;
  border-width: 2px;
}

.priority-note-form input {
  min-height: 31px;
  padding: 0 8px;
  font-size: 13px;
}

.priority-note-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.priority-note-actions .small-button {
  min-height: 29px;
  padding: 0 9px;
  font-size: 12px;
}

.order-sales-col {
  width: 8ch;
  max-width: 8ch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-table-cell {
  min-width: 220px;
  color: var(--text);
  font-weight: 700;
  line-height: 1.35;
}

.planner-locked-row td {
  background: #eef1ee !important;
  color: #7b857e;
}

.planner-locked-row .product-table-cell {
  color: #5f6962;
}

.planner-progress-link {
  border-color: #d2d8d3;
  color: #66736b;
}

.planner-lock-pill {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 9px;
  border: 1px solid #d2d8d3;
  border-radius: 999px;
  background: #fff;
  color: #66736b;
  font-size: 13px;
  font-weight: 800;
}

.planner-supplement-button {
  border-color: #7aa58a;
  background: #eef8f1;
}

.planner-supplement-tag {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid #d6a54d;
  border-radius: 999px;
  background: #fff5d8;
  color: #805400;
  font-size: 12px;
  font-weight: 800;
}

.planner-supplement-dialog {
  width: min(560px, calc(100vw - 24px));
}

.order-view-dialog.is-drawing-only .order-view-info-section,
.order-view-dialog.is-drawing-only .order-view-log-section {
  display: none;
}

.order-view-dialog:not(.is-drawing-only) .order-view-info-section,
.order-view-dialog:not(.is-drawing-only) .order-view-drawing-section {
  display: none;
}

.order-view-dialog:not(.is-drawing-only) .order-view-log-section > h3 {
  display: none;
}

.order-view-dialog.is-drawing-only .order-view-drawing-section {
  display: block;
  margin-top: 10px;
}

.planner-supplement-note-field {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.planner-supplement-note-field textarea {
  width: 100%;
  min-height: 82px;
  resize: vertical;
}

.planner-supplement-warning {
  margin-top: 10px;
  padding: 8px 10px;
  border-left: 3px solid #d6a54d;
  background: #fff9e9;
  color: #6f520e;
  font-size: 13px;
}

.planner-locked-panel {
  background: #f6f8f6;
}

.planner-locked-message {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #d2d8d3;
  border-radius: 8px;
  background: #fff;
  color: #66736b;
}

.planner-locked-message strong {
  color: var(--text);
}

.order-group-blue td {
  background: #fff;
}

.order-group-yellow td {
  background: #fff;
}

.order-main-header.order-group-blue td {
  background: #eef7ff;
}

.order-main-header.order-group-yellow td {
  background: #fff9e6;
}

td input, td select {
  min-height: 32px;
  font-size: 13px;
}

.empty-cell {
  text-align: center;
  color: var(--muted);
  padding: 18px;
}

.status-pill {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 9px;
  border: 1px solid #c9d7c4;
  border-radius: 999px;
  color: var(--green);
  background: #fff;
  font-weight: 700;
}

.status-pill.status-in_production {
  justify-content: center;
  border-color: #8bb7e0;
  background: #e8f3ff;
  color: #1f5f9f;
}

.status-pill.status-partially_in_production {
  justify-content: center;
  border-color: #d5a84b;
  background: #fff5d8;
  color: #805400;
}

.status-pill.status-waiting_supplementary_drawing {
  justify-content: center;
  border-color: #d6a54d;
  background: #fff5d8;
  color: #805400;
}

.status-pill.status-waiting-inbound {
  justify-content: center;
  border-color: #d5a84b;
  background: #fff5d8;
  color: #805400;
}

.status-pill.status-stock-transferred {
  justify-content: center;
  border-color: #d5a84b;
  background: #fff5d8;
  color: #805400;
}

.status-pill.status-partially_inbound {
  justify-content: center;
  border-color: #79a9d5;
  background: #e9f4ff;
  color: #185a91;
}

.status-pill.status-partially_completed {
  justify-content: center;
  border-color: #5796cf;
  background: #e6f2ff;
  color: #155b96;
}

.status-pill.status-inspection_completed {
  justify-content: center;
  border-color: #0f6670;
  background: #187f8a;
  color: #fff;
}

.status-pill.status-waiting_purchase_inbound,
.status-pill.status-outsourced_processing,
.status-pill.outsourced-no-route {
  justify-content: center;
  border-color: #d5a84b;
  background: #fff5d8;
  color: #805400;
}

.status-pill.status-outsourced_partially_inbound {
  justify-content: center;
  border-color: #79a9d5;
  background: #e9f4ff;
  color: #185a91;
}

.status-pill.status-outsourced_completed {
  justify-content: center;
  border-color: #85b79a;
  background: #eaf6ee;
  color: #1f6b41;
}

.order-grid-table .warehouse-post-status-col .status-pill {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  padding: 0 3px;
  overflow: hidden;
  font-size: 12px;
  white-space: nowrap;
}

.warehouse-force-inbound-button {
  border-color: #c94949;
  background: #fff;
  color: #a82f2f;
}

.warehouse-force-inbound-button:hover {
  border-color: #a82f2f;
  background: #fff1f1;
  color: #8f2020;
}

.warehouse-route-dialog.warehouse-inbound-dialog {
  width: min(760px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: hidden;
}

.warehouse-inbound-dialog .warehouse-route-dialog-form {
  box-sizing: border-box;
  display: flex;
  width: 100%;
  max-height: calc(100vh - 24px);
  flex-direction: column;
  overflow: hidden;
}

.warehouse-print-dialog {
  width: min(760px, calc(100vw - 24px));
}

.warehouse-print-dialog .warehouse-route-dialog-form {
  padding: 12px;
}

.warehouse-print-toolbar {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding: 0 9px;
  border: 1px solid var(--line);
  background: #f4f7f4;
  font-size: 13px;
}

.warehouse-print-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-weight: 800;
}

.warehouse-print-toolbar input,
.warehouse-print-order-row input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.warehouse-print-order-list {
  max-height: min(430px, calc(100vh - 210px));
  overflow-y: auto;
  border: 1px solid var(--line);
  border-top: 0;
}

.warehouse-print-order-row {
  display: grid;
  grid-template-columns: 22px 142px minmax(110px, 1fr) 100px 82px;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 4px 9px;
  border-bottom: 1px solid #e4e9e5;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}

.warehouse-print-order-row:last-child {
  border-bottom: 0;
}

.warehouse-print-order-row:hover,
.warehouse-print-order-row:has(input:checked) {
  background: #edf7ef;
}

.warehouse-print-order-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-print-order-row em {
  color: var(--muted);
  font-style: normal;
  text-align: right;
}

.warehouse-print-empty {
  padding: 28px 12px;
  color: var(--muted);
  text-align: center;
}

.warehouse-route-dialog.planner-dispatch-dialog {
  width: min(1040px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: hidden;
}

.planner-dispatch-form {
  box-sizing: border-box;
  display: flex;
  max-height: calc(100vh - 24px);
  flex-direction: column;
  overflow: hidden;
}

.planner-dispatch-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  margin-top: 8px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  background: #f4f7f4;
}

.planner-dispatch-search-label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  margin: 0;
  font-size: 13px;
  font-weight: 800;
}

.planner-dispatch-search-label input {
  min-height: 30px;
  padding: 4px 7px;
}

.planner-dispatch-color-tools,
.planner-dispatch-selected-summary {
  display: flex;
  min-height: 30px;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
}

.planner-dispatch-select-all-label {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 4px;
  margin: 0 4px 0 0;
  padding: 0 7px;
  border: 1px solid #c8d2ca;
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.planner-dispatch-select-all-label input {
  width: 14px;
  min-height: 14px;
  margin: 0;
}

.warehouse-route-dialog .planner-dispatch-color-button:not(:disabled) {
  display: inline-flex;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid #c8d2ca;
  border-radius: 4px;
  background: #fff;
}

.warehouse-route-dialog .planner-dispatch-color-button:not(:disabled):hover,
.warehouse-route-dialog .planner-dispatch-color-button:not(:disabled):focus-visible {
  border-color: var(--green);
  background: #eef6f0;
}

.planner-dispatch-color-button .filter-mark-circle {
  width: 13px;
  height: 13px;
}

.warehouse-route-dialog .planner-dispatch-clear:not(:disabled) {
  min-height: 28px;
  padding: 0 7px;
  border-color: #c9d7c4;
  background: #fff;
  color: var(--green);
  font-size: 12px;
}

.planner-dispatch-selected-summary {
  justify-content: flex-end;
  color: #4c5a51;
}

.planner-dispatch-selected-summary strong {
  min-width: 20px;
  color: var(--green);
  font-size: 15px;
  text-align: center;
}

.planner-dispatch-list {
  min-height: 160px;
  max-height: min(560px, calc(100vh - 220px));
  overflow-y: auto;
  border: 1px solid var(--line);
  border-top: 0;
  background: #fff;
}

.planner-dispatch-group {
  border-bottom: 1px solid #dfe5e0;
}

.planner-dispatch-group[hidden],
.planner-dispatch-product-row[hidden] {
  display: none;
}

.planner-dispatch-group:last-child {
  border-bottom: 0;
}

.planner-dispatch-group.is-selected > .planner-dispatch-group-head {
  background: #edf7ef;
}

.planner-dispatch-group-head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  min-height: 40px;
  align-items: stretch;
  background: #fff;
}

.planner-dispatch-group-check-label {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  border-right: 1px solid #e2e7e3;
}

.planner-dispatch-group-check-label input,
.planner-dispatch-product-row input {
  width: 17px;
  height: 17px;
  margin: 0;
}

.warehouse-route-dialog .planner-dispatch-group-toggle:not(:disabled) {
  display: grid;
  grid-template-columns: 22px 142px minmax(120px, 1fr) 100px 84px;
  min-width: 0;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  padding: 4px 9px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.warehouse-route-dialog .planner-dispatch-group-toggle:not(:disabled):hover {
  background: #f5f8f5;
  color: var(--text);
}

.planner-dispatch-group-toggle strong,
.planner-dispatch-group-toggle span,
.planner-dispatch-group-toggle em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planner-dispatch-group-toggle strong {
  font-size: 14px;
}

.planner-dispatch-group-toggle em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  text-align: right;
}

.planner-dispatch-expand-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5cd;
  border-radius: 3px;
  background: #fff;
  color: var(--green);
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.planner-dispatch-products[hidden] {
  display: none;
}

.planner-dispatch-products {
  border-top: 1px solid #e2e7e3;
  background: #fafcfb;
}

.planner-dispatch-product-row {
  display: grid;
  grid-template-columns: 24px 42px minmax(280px, 1fr) 68px 92px 150px 86px;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 3px 9px 3px 43px;
  border-bottom: 1px solid #e8ece9;
  cursor: pointer;
  font-size: 12px;
}

.planner-dispatch-product-row:last-child {
  border-bottom: 0;
}

.planner-dispatch-product-row:hover,
.planner-dispatch-product-row:has(input:checked) {
  background: #eef7f0;
}

.planner-dispatch-product-row strong,
.planner-dispatch-product-row span,
.planner-dispatch-product-row em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planner-dispatch-product-row strong {
  font-size: 13px;
  font-weight: 800;
}

.planner-dispatch-product-row em {
  color: var(--muted);
  font-style: normal;
  text-align: center;
}

.planner-dispatch-seq,
.planner-dispatch-quantity {
  text-align: center;
}

.planner-dispatch-empty {
  padding: 40px 12px;
  color: var(--muted);
  text-align: center;
}

.planner-dispatch-actions {
  flex-shrink: 0;
}

.delivery-tracking-head-panel {
  padding: 10px 12px;
}

.delivery-tracking-head {
  align-items: center;
  margin-bottom: 0;
}

.delivery-tracking-title-line,
.delivery-tracking-summary,
.delivery-tracking-head-actions {
  display: flex;
  align-items: center;
}

.delivery-tracking-title-line {
  gap: 16px;
}

.planner-tracker-title-stack {
  display: grid;
  grid-template-rows: repeat(2, 30px);
  gap: 3px;
}

.planner-tracker-title-stack .pending-inline {
  min-height: 30px;
  margin: 0;
  padding: 2px 10px;
  gap: 9px;
  box-shadow: none;
}

.planner-tracker-title-stack .pending-label {
  font-size: 13px;
}

.planner-tracker-title-stack .pending-number {
  font-size: 12px;
}

.planner-tracker-title-stack .pending-number strong {
  font-size: 18px;
}

.delivery-tracking-title-line h2 {
  margin: 0;
  font-size: 20px;
}

.delivery-tracking-summary {
  gap: 5px;
}

.delivery-tracking-summary > span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border: 1px solid #cbd7ce;
  border-radius: 4px;
  background: #f7faf8;
  color: #506057;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.delivery-tracking-summary strong {
  color: var(--green);
  font-size: 17px;
}

.delivery-tracking-head-actions {
  gap: 6px;
}

.delivery-tracking-head-actions .button {
  min-height: 31px;
  font-size: 13px;
}

.delivery-tracking-list-panel {
  padding: 0;
  overflow: hidden;
}

.delivery-tracking-table-scroll {
  width: 100%;
  overflow: auto;
}

.delivery-tracking-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.delivery-tracking-table.is-plan-view {
  min-width: 1430px;
}

.delivery-tracking-table.is-tracker {
  min-width: 1560px;
}

.delivery-tracking-table.is-sales-view .delivery-action-col {
  width: 86px;
}

.delivery-tracking-table th,
.delivery-tracking-table td {
  height: 36px;
  padding: 3px 6px;
  overflow: hidden;
  border-right: 1px solid #dfe5e0;
  border-bottom: 1px solid #dfe5e0;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delivery-tracking-table th {
  height: 34px;
  background: #edf2ee;
  color: #34463b;
  font-weight: 900;
}

.delivery-tracking-table tbody td {
  background: #fff;
}

.delivery-tracking-table .delivery-tracking-row.is-failed_wait td {
  background: #fff9ee;
}

.delivery-tracking-table .delivery-tracking-row.is-completed td {
  background: #f3f5f3;
  color: #6c746f;
}

.delivery-tracking-table .delivery-remind-date-col { width: 84px; }
.delivery-tracking-table .delivery-target-col { width: 80px; }
.delivery-tracking-table .delivery-state-col { width: 92px; }
.delivery-tracking-table .delivery-order-col { width: 104px; }
.delivery-tracking-table .delivery-seq-col { width: 48px; }
.delivery-tracking-table .delivery-customer-col { width: 90px; }
.delivery-tracking-table .delivery-sales-col { width: 82px; }
.delivery-tracking-table .delivery-product-col { width: 280px; }
.delivery-tracking-table .delivery-remark-col { width: 160px; }
.delivery-tracking-table .delivery-quantity-col { width: 58px; }
.delivery-tracking-table .delivery-date-col { width: 84px; }
.delivery-tracking-table .delivery-route-col { width: 130px; }
.delivery-tracking-table .delivery-result-col { width: 120px; }
.delivery-tracking-table .delivery-action-col { width: 188px; }

.delivery-tracking-table .delivery-product-cell {
  font-size: 13px;
  font-weight: 750;
  text-align: left;
}

.delivery-tracking-table .delivery-remark-cell {
  text-align: left;
}

button.delivery-text-open {
  display: block;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  line-height: 1.25;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button.delivery-text-open:hover,
button.delivery-text-open:focus-visible {
  background: transparent;
  color: var(--green);
  text-decoration: underline;
}

.delivery-customer-cell button.delivery-text-open {
  text-align: center;
}

.warehouse-route-dialog.delivery-text-dialog {
  width: min(640px, calc(100vw - 24px));
}

.delivery-full-text {
  min-height: 96px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #f8faf8;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.7;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.delivery-target-badge,
.delivery-status-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border: 1px solid #c6d7cb;
  border-radius: 4px;
  background: #eff7f1;
  color: var(--green-dark);
  font-weight: 800;
}

.delivery-target-badge.is-seal {
  border-color: #cdd3de;
  background: #f2f4f8;
  color: #44546b;
}

.delivery-status-badge.is-failed_wait {
  border-color: #e4c982;
  background: #fff6dc;
  color: #7a5b0d;
}

.delivery-status-badge.is-completed {
  border-color: #cfd5d1;
  background: #fff;
  color: #68716b;
}

.delivery-result-cell span,
.delivery-result-cell small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.delivery-result-cell small {
  color: var(--muted);
  font-size: 10px;
}

.delivery-row-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.delivery-row-actions form {
  margin: 0;
}

.delivery-row-actions .small-button {
  min-height: 26px;
  padding: 0 8px;
  font-size: 11px;
}

.delivery-row-actions .delivery-fail-button {
  border-color: #d9bd75;
  color: #74570d;
}

.delivery-row-actions .delivery-cancel-button {
  border-color: #d7aaa5;
  background: #fff;
  color: #9a3027;
}

.delivery-row-actions .delivery-cancel-button:hover,
.delivery-row-actions .delivery-cancel-button:focus-visible {
  border-color: #bc746c;
  background: #fff2f0;
  color: #81251e;
}

.delivery-action-placeholder {
  color: var(--muted);
}

.delivery-selection-toolbar {
  grid-template-columns: minmax(280px, 1fr) auto;
}

.delivery-selection-actions {
  align-items: end;
}

.delivery-target-choice {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0 auto 0 0;
  padding: 0;
  border: 0;
}

.delivery-target-choice legend {
  display: block;
  margin-right: 3px;
  color: #4b5b51;
  font-size: 12px;
  font-weight: 900;
}

.delivery-target-choice label {
  margin: 0;
  cursor: pointer;
}

.delivery-target-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.delivery-target-choice span {
  display: inline-flex;
  min-height: 31px;
  align-items: center;
  justify-content: center;
  padding: 2px 12px;
  border: 1px solid #bdc9c0;
  border-radius: 4px;
  background: #fff;
  color: #47574d;
  font-size: 13px;
  font-weight: 800;
}

.delivery-target-choice input:checked + span {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.planner-dispatch-print-page {
  margin: 0;
  background: #e9eeea;
  color: #111;
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

.planner-dispatch-print-actions {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 1px 5px rgba(0, 0, 0, .14);
}

.planner-dispatch-print-sheet {
  box-sizing: border-box;
  width: 277mm;
  min-height: 190mm;
  margin: 12px auto;
  padding: 7mm;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .14);
}

.planner-dispatch-print-head h1 {
  margin: 0 0 4px;
  font-size: 20px;
  text-align: center;
}

.planner-dispatch-print-head > div {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-bottom: 7px;
  font-size: 10px;
}

.planner-dispatch-print-group {
  margin-top: 7px;
  break-inside: avoid;
  page-break-inside: avoid;
}

.planner-dispatch-print-group-head {
  display: grid;
  grid-template-columns: 1fr 1fr .8fr .7fr;
  gap: 7px;
  padding: 4px 6px;
  border: 1px solid #222;
  border-bottom: 0;
  background: #e8efe9;
  font-size: 10px;
}

.planner-dispatch-print-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 9px;
}

.planner-dispatch-print-table th,
.planner-dispatch-print-table td {
  height: 28px;
  padding: 2px 3px;
  border: 1px solid #222;
  text-align: center;
  vertical-align: middle;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.planner-dispatch-print-table th {
  background: #f0f3f1;
  font-weight: 800;
}

.planner-dispatch-print-table .dispatch-print-seq { width: 7mm; }
.planner-dispatch-print-table .dispatch-print-quantity { width: 10mm; }
.planner-dispatch-print-table .dispatch-print-delivery { width: 19mm; }
.planner-dispatch-print-table .dispatch-print-route { width: 37mm; }
.planner-dispatch-print-table .dispatch-print-status { width: 17mm; }
.planner-dispatch-print-table .dispatch-print-remark { width: 39mm; }
.planner-dispatch-print-table .dispatch-print-note { width: 40mm; }

.planner-dispatch-print-product {
  font-size: 11px;
  font-weight: 800;
  text-align: left !important;
}

@media (max-width: 760px) {
  .delivery-tracking-head {
    display: grid;
    gap: 8px;
  }

  .delivery-tracking-title-line {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .delivery-tracking-summary {
    width: 100%;
    flex-wrap: wrap;
  }

  .delivery-tracking-summary > span {
    flex: 1 1 auto;
    justify-content: center;
  }

  .delivery-tracking-head-actions {
    width: 100%;
  }

  .delivery-tracking-head-actions .button {
    flex: 1 1 auto;
  }

  .warehouse-route-dialog.planner-dispatch-dialog {
    width: calc(100vw - 14px);
  }

  .planner-dispatch-form {
    max-height: calc(100vh - 14px);
    padding: 10px;
  }

  .planner-dispatch-toolbar {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .planner-dispatch-color-tools,
  .planner-dispatch-selected-summary {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .planner-dispatch-group-toggle {
    grid-template-columns: 22px minmax(104px, 1fr) minmax(80px, 1fr) 62px;
  }

  .planner-dispatch-group-toggle span:nth-of-type(3) {
    display: none;
  }

  .planner-dispatch-product-row {
    grid-template-columns: 24px 36px minmax(180px, 1fr) 60px 82px 120px 72px;
    min-width: 650px;
    padding-left: 9px;
  }

  .planner-dispatch-products {
    overflow-x: auto;
  }

  .delivery-selection-actions {
    flex-wrap: wrap;
  }

  .delivery-target-choice {
    width: 100%;
    margin-bottom: 2px;
  }

  .delivery-target-choice label {
    flex: 1 1 0;
  }

  .delivery-target-choice span {
    width: 100%;
  }
}

.warehouse-print-page {
  margin: 0;
  background: #e9eeea;
  color: #111;
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

.warehouse-print-page-actions {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 1px 5px rgba(0, 0, 0, .14);
}

.warehouse-print-sheet {
  position: relative;
  box-sizing: border-box;
  width: 210mm;
  height: 148mm;
  margin: 12px auto;
  padding: 2mm 3mm 6mm;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .14);
  overflow: hidden;
  page: warehouse-detail;
}

.warehouse-print-sheet + .warehouse-print-sheet {
  break-before: page;
  page-break-before: always;
}

.warehouse-print-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 10px;
}

.warehouse-print-table th,
.warehouse-print-table td {
  box-sizing: border-box;
  height: 29px;
  padding: 1px 2px;
  border: 1px solid #222;
  text-align: center;
  vertical-align: middle;
  line-height: 12px;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.warehouse-print-table thead {
  display: table-header-group;
}

.warehouse-print-table tr {
  break-inside: avoid;
  page-break-inside: avoid;
}

.warehouse-print-table tr.warehouse-print-long-row td {
  height: calc(29px * var(--warehouse-print-row-slots));
}

.warehouse-print-table th {
  background: #eef1ee;
  padding-right: 1px;
  padding-left: 1px;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.warehouse-print-table .print-order-col { width: 23mm; }
.warehouse-print-table .print-customer-col { width: 19mm; }
.warehouse-print-table .print-product-col { width: 93mm; }
.warehouse-print-table .print-quantity-col { width: 8mm; }
.warehouse-print-table .print-remark-col { width: 61mm; }

.warehouse-print-table .warehouse-print-order-no {
  padding-right: 1px;
  padding-left: 1px;
  font-size: 9px;
  white-space: nowrap;
}

.warehouse-print-table .warehouse-print-customer {
  padding-right: 1px;
  padding-left: 1px;
  font-size: 10px;
  white-space: nowrap;
}

.warehouse-print-table .warehouse-print-product {
  font-size: 11px;
  font-weight: 700;
  text-align: left;
}

.warehouse-print-table .warehouse-print-remark {
  font-size: 10px;
  text-align: left;
}

.warehouse-print-page-number {
  position: absolute;
  right: 3mm;
  bottom: 1.5mm;
  left: 3mm;
  height: 3mm;
  color: #333;
  font-size: 10px;
  line-height: 3mm;
  text-align: center;
}

@page {
  margin: 8mm;
}

@page warehouse-detail {
  size: A5 landscape;
  margin: 0;
}

@media print {
  .warehouse-print-page {
    background: #fff;
  }

  .warehouse-print-page-actions {
    display: none;
  }

  .planner-dispatch-print-page {
    background: #fff;
  }

  .planner-dispatch-print-actions {
    display: none;
  }

  .planner-dispatch-print-sheet {
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    box-shadow: none;
  }

  .warehouse-print-sheet {
    width: 210mm;
    height: 148mm;
    margin: 0;
    padding: 2mm 3mm 6mm;
    box-shadow: none;
  }
}

.warehouse-inbound-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.warehouse-inbound-summary span {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: #f7faf7;
  font-size: 13px;
}

.warehouse-inbound-summary strong {
  color: var(--green-dark);
  font-size: 17px;
}

.warehouse-force-inbound-warning {
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid #df9a9a;
  background: #fff3f3;
  color: #8f2020;
  font-size: 13px;
  font-weight: 800;
}

.warehouse-inbound-quantity-label {
  display: grid;
  grid-template-columns: 110px 150px;
  align-items: center;
  margin-top: 10px;
}

.warehouse-inbound-quantity-label input {
  min-height: 36px;
}

.warehouse-inbound-route-list {
  display: grid;
  min-height: 0;
  max-height: min(430px, calc(100vh - 250px));
  margin-top: 10px;
  overflow: auto;
  border: 1px solid #d6dfd2;
}

.warehouse-inbound-route-head,
.warehouse-inbound-route-row {
  display: grid;
  grid-template-columns: 70px 82px 72px minmax(145px, 1fr) 112px 124px;
  min-width: 650px;
  gap: 5px;
  align-items: center;
  min-height: 34px;
  padding: 4px 7px;
  border-bottom: 1px solid #d6dfd2;
}

.warehouse-inbound-route-head {
  position: sticky;
  z-index: 1;
  top: 0;
  background: #edf3ec;
  color: #425047;
  font-size: 12px;
  font-weight: 900;
}

.warehouse-inbound-route-row {
  background: #fff;
  font-size: 13px;
}

.warehouse-inbound-route-row input {
  width: 100%;
  min-height: 28px;
}

.warehouse-outsourced-inbound-head,
.warehouse-outsourced-inbound-row {
  grid-template-columns: repeat(3, minmax(90px, 1fr)) 120px;
  min-width: 520px;
}

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

.tech-detail-grid {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
}

.tech-order-line {
  margin: 0;
  font-size: 17px;
  line-height: 1.4;
}

.compact-detail-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 13px;
}

.sales-detail-line {
  margin-top: 6px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfb;
  color: #526158;
  font-size: 13px;
}

.sales-date-panel {
  padding-top: 10px;
  padding-bottom: 10px;
}

.sales-date-form {
  display: grid;
  grid-template-columns: 220px auto;
  gap: 8px;
  align-items: end;
  max-width: 360px;
}

.sales-date-form label {
  margin: 0;
}

.sales-date-form input,
.sales-date-form button {
  min-height: 32px;
}

.sales-date-form .form-actions {
  margin-top: 0;
}

.sales-order-edit-panel {
  padding-top: 10px;
  padding-bottom: 10px;
}

.sales-order-edit-form {
  display: grid;
  grid-template-columns: 150px minmax(360px, 1fr) 80px 145px minmax(260px, .8fr) auto;
  gap: 7px;
  align-items: end;
}

.sales-order-edit-form label {
  margin: 0;
}

.sales-order-edit-form input,
.sales-order-edit-form button {
  min-height: 32px;
}

.sales-order-edit-form .form-actions {
  margin-top: 0;
}

.sales-order-edit-form button {
  padding-left: 12px;
  padding-right: 12px;
}

.sales-order-cancel-form {
  display: grid;
  grid-template-columns: minmax(260px, 420px) auto;
  gap: 7px;
  align-items: end;
  margin-top: 8px;
}

.sales-order-cancel-form label {
  margin: 0;
}

.sales-order-cancel-form input,
.sales-order-cancel-form button {
  min-height: 32px;
}

.sales-order-cancelled-text {
  margin-top: 8px;
}

.sales-attachment-list {
  display: grid;
  gap: 6px;
}

.sales-attachment-item {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfb;
}

.sales-attachment-item span {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-panel .section-head {
  margin-bottom: 8px;
}

.warehouse-form {
  grid-template-columns: 220px 180px minmax(260px, 1fr) auto;
  align-items: end;
}

.warehouse-form label {
  margin: 0;
}

.warehouse-form textarea {
  min-height: 38px;
  padding-top: 8px;
}

.warehouse-form .form-actions {
  grid-column: auto;
  margin-top: 0;
  flex-wrap: nowrap;
}

.warehouse-note {
  grid-column: auto;
}

.detail-grid div, .progress-placeholder, .note-box, .result-box {
  border: 1px solid var(--line);
  background: #fbfcfb;
  border-radius: 8px;
  padding: 10px;
}

.detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.detail-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}

.note-box {
  margin-top: 10px;
  white-space: pre-wrap;
}

.progress-placeholder {
  color: var(--muted);
}

.flash {
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 10px;
}

.error {
  background: #fee4e2;
  color: var(--red);
}

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

.order-success-dialog {
  width: min(420px, calc(100vw - 28px));
  max-width: none;
  padding: 0;
  overflow: hidden;
  border: 1px solid #9fbaa9;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 18px 48px rgb(18 43 29 / 24%);
  color: var(--text);
}

.order-success-dialog::backdrop {
  background: rgb(16 28 21 / 42%);
}

.order-success-dialog-body {
  display: grid;
  gap: 12px;
  padding: 22px 24px 20px;
  text-align: center;
}

.order-success-dialog h2 {
  margin: 0;
  color: var(--green-dark);
  font-size: 22px;
}

.order-success-dialog p {
  margin: 0;
  color: #3f4f46;
  font-size: 14px;
  line-height: 1.6;
}

.order-success-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.order-success-dialog-actions form {
  margin: 0;
}

.order-success-dialog-actions button {
  width: 64px;
  min-height: 34px;
  font-size: 14px;
}

.order-success-dialog-actions .order-success-edit-button {
  width: 64px;
  border-color: #d0a437;
  background: #f1c75b;
  color: #3f3005;
}

.order-success-dialog-actions .order-success-edit-button:hover {
  border-color: #b98d24;
  background: #dfb347;
  color: #342703;
}

.stock-production-success-actions .button,
.stock-production-success-actions button {
  width: 92px;
  min-height: 34px;
  justify-content: center;
}

@media (max-width: 480px) {
  .order-success-dialog-body {
    padding-right: 12px;
    padding-left: 12px;
  }
}

.result-box {
  margin-top: 12px;
}

.result-box ul {
  margin-bottom: 0;
  color: var(--red);
}

.import-preview {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.preview-head {
  margin-bottom: 8px;
}

.import-grid-tools {
  display: grid;
  grid-template-columns: 78px 120px 420px 72px 130px 400px 90px;
  gap: 0;
  min-width: 1320px;
}

.import-preview-table {
  min-width: 1320px;
  table-layout: fixed;
}

.import-preview-table th:first-child,
.import-preview-table td:first-child {
  width: 78px;
}

.import-preview-table th:nth-child(2),
.import-preview-table td:nth-child(2) {
  width: 120px;
}

.import-preview-table th:nth-child(3),
.import-preview-table td:nth-child(3) {
  width: 420px;
}

.import-preview-table th:nth-child(4),
.import-preview-table td:nth-child(4) {
  width: 72px;
}

.import-preview-table th:nth-child(5),
.import-preview-table td:nth-child(5) {
  width: 130px;
  position: relative;
}

.import-preview-table th:nth-child(6),
.import-preview-table td:nth-child(6) {
  width: 400px;
}

.import-preview-table th:last-child,
.import-preview-table td:last-child {
  width: 90px;
}

.sales-import-preview-table {
  min-width: 1600px;
}

.sales-import-preview-table th:nth-child(5),
.sales-import-preview-table td:nth-child(5) {
  width: 170px;
  position: static;
}

.sales-import-preview-table th.import-drawing-col > span,
.sales-import-preview-table th.import-outsourced-col > span {
  display: block;
  width: 100%;
  text-align: center;
}

.sales-import-preview-table th:nth-child(6),
.sales-import-preview-table td:nth-child(6) {
  width: 110px;
  position: static;
}

.sales-import-preview-table th:nth-child(7),
.sales-import-preview-table td:nth-child(7) {
  width: 130px;
  position: relative;
}

.sales-import-preview-table th:nth-child(8),
.sales-import-preview-table td:nth-child(8) {
  width: 400px;
}

.import-outsourced-toggle {
  display: flex;
  min-height: 32px;
  margin: 0;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid #cfd8d1;
  border-radius: 4px;
  background: #fff;
  font-size: 12px;
}

.import-outsourced-toggle:has(input:checked) {
  border-color: #d0a437;
  background: #fff3c8;
  color: #6b4f00;
  font-weight: 800;
}

.import-outsourced-toggle input {
  width: 14px;
  min-width: 14px;
  height: 14px;
  min-height: 14px;
  margin: 0;
  padding: 0;
  accent-color: #c38b11;
}

.import-drawing-batch-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 3px;
}

.import-drawing-batch-actions button {
  min-height: 24px;
  padding: 0 4px;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

.import-row-drawing-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 32px;
  overflow: hidden;
  border: 1px solid #cfd8d1;
  border-radius: 4px;
  background: #fff;
}

.import-row-drawing-choice label {
  display: flex;
  min-width: 0;
  margin: 0;
  padding: 4px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 12px;
  white-space: nowrap;
}

.import-row-drawing-choice label + label {
  border-left: 1px solid #d8e0da;
}

.import-row-drawing-choice label:has(input:checked) {
  background: #e9f4ec;
  color: #1f6739;
  font-weight: 800;
}

.import-row-drawing-choice input {
  width: 13px;
  min-width: 13px;
  height: 13px;
  min-height: 13px;
  margin: 0;
  padding: 0;
  accent-color: var(--green);
}

.stock-import-preview-table {
  min-width: 1280px;
}

.stock-import-preview-table th:nth-child(3),
.stock-import-preview-table td:nth-child(3) {
  width: 380px;
}

.stock-import-preview-table .stock-route-no-col {
  width: 110px;
}

.stock-import-preview-table th:nth-child(6),
.stock-import-preview-table td:nth-child(6) {
  width: 130px;
  position: relative;
}

.stock-import-preview-table th:nth-child(7),
.stock-import-preview-table td:nth-child(7) {
  width: 300px;
}

.stock-production-entry-buttons {
  flex-wrap: nowrap;
}

.import-preview-table th:first-child,
.import-preview-table td:first-child,
.import-preview-table th:last-child,
.import-preview-table td:last-child {
  text-align: center;
}

.batch-date-header-button {
  width: 100%;
  min-height: 30px;
  padding: 0 6px;
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  font-size: 12px;
  white-space: normal;
  line-height: 1.15;
}

.batch-date-picker {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 1px;
  height: 1px;
  min-height: 1px;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.import-total-row td {
  background: #fbfcfb;
  border-bottom: 0;
}

.import-total-label {
  text-align: right;
  color: var(--muted);
  font-weight: 800;
}

.import-total-row strong {
  width: 100%;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfb;
  color: var(--text);
}

.import-preview-table input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.import-preview-table input[type="number"]::-webkit-outer-spin-button,
.import-preview-table input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.preview-actions {
  margin-top: 10px;
  align-items: end;
  justify-content: flex-end;
}

.preview-actions .sales-drawing-choice {
  margin-right: auto;
}

.import-draft-button {
  width: 86px;
}

.import-draft-button.is-stored {
  border-color: #d0a437;
  background: #fff3c8;
  color: #5a4305;
}

@media (min-width: 761px) and (max-width: 1200px) {
  .manual-order-form:not(.stock-production-form) {
    display: block;
  }

  .manual-order-line {
    grid-template-columns: 140px minmax(240px, 1fr) 80px 140px;
  }

  .order-list-panel .section-head {
    flex-wrap: wrap;
  }

  .dashboard-right-tools {
    width: 100%;
    gap: 6px;
    flex-wrap: wrap;
  }

  .planner-dashboard-tools {
    align-items: flex-start;
  }

  .planner-action-grid {
    width: 263px;
    grid-template-columns: repeat(3, 85px);
  }

  .dashboard-right-tools .priority-search-tools {
    flex: 1 0 100%;
    justify-content: flex-end;
  }

  .planner-dashboard-tools .priority-search-tools {
    display: grid;
    flex: 1 1 520px;
    grid-template-columns: 204px minmax(280px, 1fr);
    justify-content: stretch;
  }

  .dashboard-search-bar {
    flex: 1 1 420px;
  }

  .delivery-tracking-table,
  .delivery-tracking-table.is-plan-view,
  .delivery-tracking-table.is-tracker {
    width: 100%;
    min-width: 0;
  }

  .delivery-tracking-table th,
  .delivery-tracking-table td {
    height: 34px;
    padding: 2px 3px;
    font-size: 11px;
  }

  .delivery-tracking-table .delivery-remind-date-col { width: 6%; }
  .delivery-tracking-table .delivery-target-col { width: 5.5%; }
  .delivery-tracking-table .delivery-state-col { width: 6%; }
  .delivery-tracking-table .delivery-order-col { width: 9%; }
  .delivery-tracking-table .delivery-seq-col { width: 3.5%; }
  .delivery-tracking-table .delivery-customer-col { width: 5.5%; }
  .delivery-tracking-table .delivery-sales-col { width: 5%; }
  .delivery-tracking-table .delivery-product-col { width: 19%; }
  .delivery-tracking-table.is-plan-view .delivery-order-col { width: 8%; }
  .delivery-tracking-table.is-plan-view .delivery-product-col { width: 14%; }
  .delivery-tracking-table.is-plan-view .delivery-remark-col { width: 10%; }
  .delivery-tracking-table .delivery-quantity-col { width: 4%; }
  .delivery-tracking-table .delivery-date-col { width: 6%; }
  .delivery-tracking-table .delivery-route-col { width: 8%; }
  .delivery-tracking-table .delivery-result-col { width: 8%; }
  .delivery-tracking-table .delivery-action-col { width: 14%; }
  .delivery-tracking-table.is-plan-view .delivery-route-col { width: 7%; }
  .delivery-tracking-table.is-plan-view .delivery-result-col { width: 7.5%; }
  .delivery-tracking-table.is-plan-view .delivery-action-col { width: 12%; }
  .delivery-tracking-table.is-sales-view .delivery-action-col { width: 7%; }

  .delivery-tracking-table .delivery-product-cell {
    font-size: 12px;
  }

  .delivery-target-badge,
  .delivery-status-badge {
    min-height: 22px;
    padding: 1px 3px;
    font-size: 10px;
  }

  .delivery-row-actions {
    gap: 2px;
  }

  .delivery-row-actions .small-button {
    min-height: 24px;
    padding: 0 4px;
    font-size: 10px;
  }
}

@media (min-width: 761px) and (max-width: 900px) {
  .delivery-tracking-table tbody td {
    height: 52px;
  }

  .delivery-row-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .delivery-row-actions .small-button {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px 8px;
    padding: 5px 8px;
  }

  .topbar h1 {
    font-size: 17px;
  }

  .topbar nav {
    gap: 4px;
  }

  .layout {
    width: calc(100vw - 14px);
    margin-top: 8px;
  }

  .panel {
    padding: 12px;
    border-radius: 8px;
  }

  .section-head {
    display: grid;
  }

  .sales-dashboard-summary-panel .section-head {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .sales-dashboard-summary-panel .action-button-row {
    grid-column: 1;
    grid-row: 2;
  }

  .sales-dashboard-summary-panel .sales-status-grid {
    grid-row: 3;
  }

  .sales-summary-priority-tools {
    flex: 1 0 100%;
    width: 100%;
    flex-wrap: wrap;
  }

  .sales-summary-priority-tools .dashboard-search-bar {
    flex: 1 0 100%;
    width: 100%;
    max-width: none;
  }

  .sales-dashboard-action-buttons {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .dashboard-search-bar {
    grid-template-columns: minmax(0, 1fr) auto auto;
    width: 100%;
  }

  .dashboard-right-tools {
    display: grid;
    width: 100%;
    gap: 6px;
  }

  .planner-dashboard-tools {
    align-items: start;
  }

  .planner-action-grid {
    width: 263px;
    grid-template-columns: repeat(3, 85px);
  }

  .planner-primary-actions {
    width: 174px;
    flex-basis: 174px;
  }

  .priority-filter-list {
    width: 100%;
    flex-wrap: wrap;
  }

  .priority-search-tools {
    display: grid;
    width: 100%;
    gap: 4px;
  }

  .planner-dashboard-tools .priority-search-tools {
    grid-template-columns: 1fr;
  }

  .planner-dashboard-tools .priority-filter-list {
    width: 204px;
    grid-column: 1;
    grid-row: auto;
  }

  .planner-workload-summary,
  .planner-dashboard-tools .dashboard-search-bar {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
    max-width: none;
    justify-self: stretch;
  }

  .warehouse-route-dialog-fields {
    grid-template-columns: 1fr;
  }

  .change-detail-dialog-list .change-detail-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .change-detail-dialog-list .change-detail-arrow {
    text-align: left;
  }

  .warehouse-route-dialog.warehouse-inbound-dialog {
    width: calc(100vw - 14px);
  }

  .warehouse-inbound-dialog .warehouse-route-dialog-form {
    padding: 10px;
  }

  .warehouse-inbound-summary span {
    min-height: 38px;
    padding: 0 6px;
    font-size: 12px;
  }

  .warehouse-inbound-route-head,
  .warehouse-inbound-route-row {
    grid-template-columns: 42px minmax(64px, 1fr) 50px 120px 76px 88px;
    min-width: 560px;
    gap: 2px;
    padding: 3px 4px;
    font-size: 11px;
  }

  .warehouse-outsourced-inbound-head,
  .warehouse-outsourced-inbound-row {
    grid-template-columns: repeat(3, minmax(54px, 1fr)) 72px;
    min-width: 0;
  }

  .warehouse-inbound-route-head {
    font-size: 10px;
  }

  .stats-grid, .grid-form, .detail-grid, .filter-bar {
    grid-template-columns: 1fr;
  }

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

  .manual-order-line {
    grid-template-columns: 1fr;
  }

  .manual-order-line-action {
    min-height: 34px;
    grid-template-columns: 1fr auto;
    align-items: center;
    justify-items: start;
  }

  .manual-order-actions {
    flex-wrap: nowrap;
  }

  .sales-drawing-choice,
  .sales-outsourced-choice {
    max-width: none;
  }

  .user-admin-head,
  .user-list-head {
    align-items: stretch;
    flex-direction: column;
  }

  .user-create-form,
  .user-filter-form,
  .planner-operator-create-form,
  .route-operation-filter,
  .user-handover-form {
    grid-template-columns: 1fr;
  }

  .user-handover-arrow {
    min-height: 20px;
    transform: rotate(90deg);
  }

  .user-create-action button,
  .user-filter-form button,
  .user-filter-form .button {
    width: 100%;
  }

  .admin-module-button {
    width: 100%;
  }

  .planner-operator-select-grid {
    grid-template-columns: repeat(2, minmax(110px, 1fr));
  }

  .role-select-layout {
    min-height: auto;
    padding-top: 28px;
  }

  .role-select-grid {
    grid-template-columns: repeat(2, minmax(110px, 1fr));
  }

  .check-row {
    margin-top: 0;
  }

  table {
    min-width: 860px;
  }
}

.table-cell-preview-source {
  outline: 2px solid #2f7d4a;
  outline-offset: -2px;
}

.table-cell-preview {
  position: fixed;
  z-index: 5000;
  box-sizing: border-box;
  width: max-content;
  min-width: 120px;
  max-width: min(560px, calc(100vw - 16px));
  max-height: min(50vh, 360px);
  padding: 10px 38px 10px 12px;
  overflow: auto;
  border: 1px solid #94a79a;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(24, 42, 31, 0.2);
  color: #18251d;
  font-size: 14px;
  line-height: 1.55;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.table-cell-preview-content {
  min-width: 0;
}

.table-cell-preview-close {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  width: 27px;
  min-width: 27px;
  height: 27px;
  min-height: 27px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #4f5f55;
  font-size: 21px;
  line-height: 1;
}

.table-cell-preview-close:hover {
  background: #edf3ef;
  color: #173d27;
}

.route-template-panel {
  max-width: none;
}

.route-template-upload {
  display: flex;
  align-items: end;
  gap: 12px;
  padding: 14px 0;
}

.route-template-upload label {
  display: grid;
  flex: 1;
  gap: 6px;
  max-width: 680px;
}

.route-template-upload input[type="file"] {
  min-height: 38px;
  padding: 6px 8px;
}

.route-template-current {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #c9d7cd;
  background: #f7faf8;
}

.route-template-current > span,
.route-template-current em {
  color: #66736a;
}

.route-template-current em {
  margin-left: auto;
  font-style: normal;
}

.route-template-history {
  margin-top: 12px;
}

.route-template-history table {
  min-width: 760px;
}

.warehouse-route-line .js-warehouse-route-no[readonly] {
  background: #eef3ef;
  color: #33483a;
  cursor: default;
}

@media (max-width: 760px) {
  .route-template-upload,
  .route-template-current {
    align-items: stretch;
    flex-direction: column;
  }

  .route-template-current em {
    margin-left: 0;
  }
}

@media (min-width: 761px) {
  .planner-dashboard-tools .dashboard-search-bar {
    width: 100%;
    max-width: 320px;
    justify-self: end;
  }

  .warehouse-desktop-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 4px;
  }

  body[data-table-role="warehouse"] .warehouse-desktop-action {
    width: 78px;
    min-width: 78px;
    padding: 0 5px;
  }

  body[data-table-role="warehouse"] .dashboard-search-bar {
    max-width: 320px;
    margin-left: auto;
  }
}

@media (min-width: 1100px) {
  body[data-table-role="warehouse"] .order-list-panel > .section-head {
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
  }

  body[data-table-role="warehouse"] .order-list-panel > .section-head > div:first-child {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
  }

  body[data-table-role="warehouse"] .order-list-title-line {
    flex-wrap: nowrap;
    gap: 6px;
  }

  body[data-table-role="warehouse"] .dashboard-right-tools {
    flex: 0 1 auto;
    width: auto;
    min-width: 0;
    flex-wrap: nowrap;
    gap: 4px;
    margin-left: auto;
  }

  .warehouse-desktop-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 4px;
  }

  body[data-table-role="warehouse"] .warehouse-desktop-action {
    width: 78px;
    min-width: 78px;
    padding: 0 5px;
  }

  body[data-table-role="warehouse"] .priority-search-tools {
    display: flex;
    flex: 0 1 auto;
    min-width: 0;
    justify-content: flex-end;
    gap: 4px;
    margin-left: 0;
  }

  body[data-table-role="warehouse"] .priority-filter-list {
    flex: 0 0 auto;
  }

  body[data-table-role="warehouse"] .priority-filter-box {
    flex: 0 0 74px;
    width: 74px;
  }

  body[data-table-role="warehouse"] .dashboard-search-bar {
    flex: 0 1 320px;
    width: 320px;
    max-width: 320px;
    grid-template-columns: minmax(88px, 1fr) auto auto;
  }

  body[data-table-role="warehouse"] .dashboard-keyword-input {
    min-width: 0;
  }
}

@media (min-width: 900px) {
  .order-list-panel .planner-order-list-head {
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 4px;
  }

  .planner-order-list-head > div:first-child {
    flex: 0 0 auto;
    min-width: 0;
  }

  .planner-order-list-title-line {
    display: grid;
    grid-template-rows: repeat(2, 29px);
    align-items: stretch;
    gap: 3px;
  }

  .order-list-panel .planner-order-list-title-line h2 {
    display: flex;
    min-height: 29px;
    align-items: center;
    white-space: nowrap;
  }

  .planner-order-list-title-line .pending-inline {
    align-self: stretch;
    min-height: 29px;
  }

  .planner-order-list-head .planner-dashboard-tools {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 4px;
  }

  .planner-order-list-head .planner-dashboard-tools .priority-search-tools {
    flex: 0 1 524px;
    width: 524px;
    max-width: 524px;
    min-width: 514px;
    grid-template-columns: 204px minmax(0, 1fr);
    align-items: stretch;
  }

  .planner-order-list-head .planner-dashboard-tools .dashboard-search-bar {
    align-self: end;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto auto;
  }
}

@media (min-width: 900px) and (max-width: 1200px) {
  body[data-table-role="planner_followup"] .planner-order-list-head .planner-dashboard-tools .priority-search-tools {
    flex: 0 0 348px;
    width: 348px;
    min-width: 348px;
    max-width: 348px;
    grid-template-columns: 174px minmax(0, 170px);
  }

  body[data-table-role="planner_followup"] .planner-dashboard-tools .priority-filter-list {
    width: 174px;
    grid-template-columns: repeat(2, 85px);
  }

  body[data-table-role="planner_followup"] .planner-dashboard-tools .priority-filter-box {
    width: 85px;
  }

  body[data-table-role="planner_followup"] .planner-workload-summary {
    padding: 0;
    font-size: 10px;
  }

  body[data-table-role="planner_followup"] .planner-workload-summary strong {
    min-width: 3ch;
    font-size: 11px;
  }

  body[data-table-role="planner_followup"] .planner-workload-summary .planner-workload-quantity {
    min-width: 3ch;
  }
}

.app-refresh-button,
.delivery-tracking-head-actions .app-refresh-button {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  height: auto;
  min-height: 28px;
  padding: 0 9px;
  font-size: 13px;
  font-weight: 400;
  line-height: normal;
}

.sandbox-environment-label {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  margin-left: 10px;
  padding: 0 8px;
  border: 1px solid #a72b2b;
  border-radius: 4px;
  background: #fff;
  color: #a72b2b;
  font-size: 13px;
  font-weight: 900;
  vertical-align: middle;
}

.warehouse-inbound-history-head {
  padding: 8px 10px;
}

.warehouse-inbound-history-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.warehouse-inbound-history-title h2 {
  margin: 0 8px 0 0;
}

.warehouse-inbound-history-title span {
  color: var(--muted);
  font-size: 13px;
}

.warehouse-inbound-history-title strong {
  margin-left: 3px;
  color: var(--green-dark);
  font-size: 15px;
}

.warehouse-inbound-history-filter {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 150px 150px 76px auto;
  gap: 6px;
  margin-top: 7px;
}

.warehouse-inbound-history-filter input,
.warehouse-inbound-history-filter button,
.warehouse-inbound-history-filter .button {
  min-height: 32px;
}

.warehouse-inbound-history-panel {
  padding: 0;
  overflow: hidden;
}

.warehouse-inbound-history-scroll {
  width: 100%;
  overflow: auto;
}

.warehouse-inbound-history-table {
  width: 100%;
  min-width: 1180px;
  table-layout: fixed;
}

.warehouse-inbound-history-table th,
.warehouse-inbound-history-table td {
  height: 32px;
  padding: 2px 5px;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-inbound-history-table tbody td {
  background: #fff;
}

.warehouse-inbound-history-table .inbound-history-time-col { width: 126px; }
.warehouse-inbound-history-table .inbound-history-order-col { width: 108px; }
.warehouse-inbound-history-table .inbound-history-seq-col { width: 46px; }
.warehouse-inbound-history-table .inbound-history-customer-col { width: 100px; }
.warehouse-inbound-history-table .inbound-history-product-col { width: 400px; }
.warehouse-inbound-history-table .inbound-history-quantity-col { width: 72px; }
.warehouse-inbound-history-table .inbound-history-total-col { width: 88px; }
.warehouse-inbound-history-table .inbound-history-route-col { width: 118px; }
.warehouse-inbound-history-table .inbound-history-user-col { width: 84px; }

.warehouse-inbound-history-table .inbound-history-product-cell {
  text-align: left;
}

button.warehouse-inbound-history-text {
  width: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 750;
  line-height: 1.25;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button.warehouse-inbound-history-text:hover,
button.warehouse-inbound-history-text:focus-visible {
  background: transparent;
  color: var(--green);
  text-decoration: underline;
}

.warehouse-inbound-history-pages {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px;
  border-top: 1px solid var(--line);
  background: #f7faf7;
}

.warehouse-inbound-history-pages .button,
.warehouse-inbound-history-pages button {
  min-height: 30px;
}

.stock-origin-pill {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border: 1px solid #a9b9c7;
  border-radius: 3px;
  background: #f4f8fb;
  color: #36566f;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.stock-origin-pill.stock-origin-order_transfer {
  border-color: #d5a84b;
  background: #fff5d8;
  color: #805400;
}

.warehouse-stock-inbound-head {
  padding: 8px 10px;
}

.warehouse-stock-inbound-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.warehouse-stock-inbound-title h2 {
  margin: 0 8px 0 0;
}

.warehouse-stock-inbound-title span {
  color: var(--muted);
  font-size: 13px;
}

.warehouse-stock-inbound-title strong {
  margin-left: 3px;
  color: var(--green-dark);
  font-size: 15px;
}

.warehouse-stock-inbound-filter {
  display: grid;
  grid-template-columns: minmax(280px, 440px) 76px 76px;
  gap: 6px;
  justify-content: start;
  margin-top: 7px;
}

.warehouse-stock-inbound-filter input,
.warehouse-stock-inbound-filter button,
.warehouse-stock-inbound-filter .button {
  min-height: 32px;
}

.warehouse-stock-inbound-panel {
  padding: 0;
  overflow: hidden;
}

.warehouse-stock-inbound-scroll {
  width: 100%;
  overflow: auto;
}

.warehouse-stock-inbound-table {
  width: 100%;
  min-width: 1120px;
  table-layout: fixed;
}

.warehouse-stock-inbound-table th,
.warehouse-stock-inbound-table td {
  height: 32px;
  padding: 2px 5px;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warehouse-stock-inbound-table tbody td {
  background: #fff;
}

.warehouse-stock-inbound-table .stock-inbound-seq-col { width: 52px; }
.warehouse-stock-inbound-table .stock-inbound-origin-col { width: 104px; }
.warehouse-stock-inbound-table .stock-inbound-customer-col { width: 116px; }
.warehouse-stock-inbound-table .stock-inbound-product-col { width: 400px; }
.warehouse-stock-inbound-table .stock-inbound-quantity-col { width: 78px; }
.warehouse-stock-inbound-table .stock-inbound-route-col { width: 92px; }
.warehouse-stock-inbound-table .stock-inbound-progress-col { width: 90px; }
.warehouse-stock-inbound-table .stock-inbound-status-col { width: 112px; }
.warehouse-stock-inbound-table .stock-inbound-action-col { width: 98px; }

.warehouse-stock-inbound-table .stock-inbound-product-cell {
  text-align: left;
}

.warehouse-stock-inbound-table .status-pill {
  box-sizing: border-box;
  width: 100%;
  justify-content: center;
}

.warehouse-stock-inbound-button {
  border-color: #4f8f69;
  background: #edf8f0;
  color: #1f6b41;
}

.warehouse-route-dialog.warehouse-stock-inbound-dialog {
  width: min(720px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: hidden;
}

.warehouse-stock-inbound-dialog .warehouse-route-dialog-form {
  box-sizing: border-box;
  display: flex;
  width: 100%;
  max-height: calc(100vh - 24px);
  flex-direction: column;
  overflow: hidden;
}

.warehouse-stock-inbound-route-list {
  display: grid;
  min-height: 0;
  max-height: min(430px, calc(100vh - 250px));
  margin-top: 10px;
  overflow: auto;
  border: 1px solid #d6dfd2;
}

.warehouse-stock-inbound-route-head,
.warehouse-stock-inbound-route-row {
  display: grid;
  grid-template-columns: 76px 100px 92px 82px 82px minmax(126px, 1fr);
  min-width: 620px;
  gap: 5px;
  align-items: center;
  min-height: 34px;
  padding: 4px 7px;
  border-bottom: 1px solid #d6dfd2;
}

.warehouse-stock-inbound-route-head {
  position: sticky;
  z-index: 1;
  top: 0;
  background: #edf3ec;
  color: #425047;
  font-size: 12px;
  font-weight: 900;
}

.warehouse-stock-inbound-route-row {
  background: #fff;
  font-size: 13px;
}

.warehouse-stock-inbound-route-row input {
  width: 100%;
  min-height: 28px;
  text-align: center;
}

@media (max-width: 760px) {
  .warehouse-inbound-history-title {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .warehouse-inbound-history-filter {
    grid-template-columns: 1fr 1fr;
  }

  .warehouse-inbound-history-filter input[name="q"] {
    grid-column: 1 / -1;
  }

  .warehouse-stock-inbound-title {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .warehouse-stock-inbound-filter {
    grid-template-columns: minmax(180px, 1fr) 72px 72px;
  }

  .warehouse-route-dialog.warehouse-stock-inbound-dialog {
    width: calc(100vw - 14px);
  }

  .warehouse-stock-inbound-dialog .warehouse-route-dialog-form {
    padding: 10px;
  }

  .warehouse-stock-inbound-route-head,
  .warehouse-stock-inbound-route-row {
    grid-template-columns: 54px 74px 66px 62px 62px 94px;
    min-width: 444px;
    gap: 2px;
    padding: 3px 4px;
    font-size: 11px;
  }
}

/* Technical flow colors: green = drawing ready, red = no drawing, yellow = supplementary drawing. */
.order-list-panel .mini-link.tech-flow-with-drawing:not(:disabled),
.warehouse-route-dialog button.tech-flow-with-drawing:not(:disabled),
.tech-batch-panel button.tech-flow-with-drawing:not(:disabled) {
  border-color: #2f7d4e;
  background: #2f7d4e;
  color: #fff;
}

.order-list-panel .mini-link.tech-flow-with-drawing:not(:disabled):hover,
.warehouse-route-dialog button.tech-flow-with-drawing:not(:disabled):hover,
.tech-batch-panel button.tech-flow-with-drawing:not(:disabled):hover {
  border-color: #25663f;
  background: #25663f;
  color: #fff;
}

.order-list-panel .mini-link.tech-flow-without-drawing:not(:disabled),
.warehouse-route-dialog button.tech-flow-without-drawing:not(:disabled),
.tech-batch-panel button.tech-flow-without-drawing:not(:disabled) {
  border-color: #c8322b;
  background: #d64038;
  color: #fff;
}

.order-list-panel .mini-link.tech-flow-without-drawing:not(:disabled):hover,
.warehouse-route-dialog button.tech-flow-without-drawing:not(:disabled):hover,
.tech-batch-panel button.tech-flow-without-drawing:not(:disabled):hover {
  border-color: #a8231e;
  background: #b92d27;
  color: #fff;
}

.order-list-panel .mini-link.tech-flow-supplement:not(:disabled),
.warehouse-route-dialog button.tech-flow-supplement:not(:disabled) {
  border-color: #d6a54d;
  background: #d6a54d;
  color: #fff;
}

.order-list-panel .mini-link.tech-flow-supplement:not(:disabled):hover,
.warehouse-route-dialog button.tech-flow-supplement:not(:disabled):hover {
  border-color: #bd8b31;
  background: #bd8b31;
  color: #fff;
}

.dsn-only-button:not(:disabled),
.order-list-panel .mini-link.dsn-only-button:not(:disabled),
.warehouse-batch-create-mode button.dsn-only-button:not(:disabled) {
  border-color: #4f9467;
  background: linear-gradient(90deg, #fff 0 50%, #76b98b 50% 100%);
  color: #174b2a;
}

.dsn-only-button:not(:disabled):hover,
.order-list-panel .mini-link.dsn-only-button:not(:disabled):hover,
.warehouse-batch-create-mode button.dsn-only-button:not(:disabled):hover {
  border-color: #367b4f;
  background: linear-gradient(90deg, #f7fbf8 0 50%, #62a978 50% 100%);
  color: #103d21;
}

.account-simulation-grid .dsn-only-button small {
  color: #174b2a;
}

/* The selected list stays visibly distinct from the green action buttons. */
.dashboard-view-button.is-view-active,
.order-list-panel .dashboard-view-button.is-view-active,
.dashboard-view-button.is-view-active:focus-visible,
.order-list-panel .dashboard-view-button.is-view-active:focus-visible {
  border-color: #2f6fae;
  background: #2f6fae;
  color: #fff;
  box-shadow: none;
}

.dashboard-view-button.is-view-active:hover,
.order-list-panel .dashboard-view-button.is-view-active:hover {
  border-color: #255989;
  background: #255989;
  color: #fff;
}

.warehouse-route-dialog.planner-shared-route-dialog {
  width: min(1120px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: hidden;
}

.planner-shared-route-content {
  display: grid;
  grid-template-rows: auto auto auto auto minmax(180px, 1fr) auto;
  gap: 9px;
  max-height: calc(100vh - 26px);
  padding: 14px;
}

.planner-shared-route-mode {
  display: grid;
  grid-template-columns: repeat(2, 150px);
  gap: 5px;
}

.warehouse-route-dialog .planner-shared-route-mode button:not(:disabled) {
  min-height: 32px;
  border: 1px solid #9eaaa1;
  background: #fff;
  color: #344239;
  font-weight: 800;
}

.warehouse-route-dialog .planner-shared-route-mode button.is-active:not(:disabled) {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.planner-shared-route-toolbar {
  display: flex;
  align-items: end;
  gap: 7px;
}

.planner-shared-route-toolbar label {
  display: grid;
  flex: 0 0 120px;
  gap: 3px;
  margin: 0;
}

.planner-shared-route-toolbar label[hidden] {
  display: none;
}

.planner-shared-route-toolbar label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.planner-shared-route-toolbar input,
.planner-shared-route-toolbar select {
  width: 100%;
  min-height: 32px;
  padding: 3px 7px;
}

.planner-shared-route-toolbar .planner-shared-route-existing-field {
  flex-basis: 330px;
}

.planner-shared-route-toolbar .planner-shared-route-no-field {
  flex-basis: 150px;
}

.planner-shared-route-toolbar .planner-shared-total-field {
  flex-basis: 100px;
}

.planner-shared-route-toolbar .planner-shared-search-field {
  flex: 1 1 300px;
}

.planner-shared-route-summary {
  display: flex;
  width: fit-content;
  min-height: 30px;
  align-items: center;
  gap: 11px;
  padding: 0 10px;
  border: 1px solid #cbd5cd;
  background: #f8faf8;
  color: #445249;
  font-size: 13px;
  white-space: nowrap;
}

.planner-shared-route-summary strong {
  display: inline-block;
  min-width: 4ch;
  color: #166237;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.planner-shared-route-summary i {
  color: #adb8b0;
  font-style: normal;
}

.planner-shared-route-summary strong.is-over-limit {
  color: #bf1e2e;
}

.planner-shared-route-scroll {
  min-height: 180px;
  max-height: min(56vh, 520px);
  overflow: auto;
  border: 1px solid var(--line);
}

.planner-shared-route-table {
  width: 100%;
  min-width: 880px;
  table-layout: fixed;
  border-collapse: collapse;
}

.planner-shared-route-table th,
.planner-shared-route-table td {
  height: 31px;
  padding: 3px 6px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planner-shared-route-table th {
  position: sticky;
  z-index: 2;
  top: 0;
  background: #eaf2e9;
  font-weight: 900;
  text-align: center;
}

.planner-shared-route-table tr.is-selected td {
  background: #f3f8f4;
}

.planner-shared-route-table tr.is-disabled td {
  color: #8a948d;
  background: #f7f8f7;
}

.planner-shared-route-table .order-select-col {
  width: 42px;
  text-align: center;
}

.planner-shared-route-table .planner-shared-order-col {
  width: 126px;
}

.planner-shared-route-table .planner-shared-customer-col {
  width: 100px;
}

.planner-shared-route-table .order-quantity-col,
.planner-shared-route-table .planner-shared-allocated-col,
.planner-shared-route-table .planner-shared-remaining-col,
.planner-shared-route-table .planner-shared-current-col {
  width: 88px;
  min-width: 88px;
  max-width: 88px;
  text-align: center;
}

.planner-shared-route-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
}

.planner-shared-route-table .js-planner-shared-quantity {
  width: 68px;
  min-height: 25px;
  padding: 1px 4px;
  text-align: center;
}

.planner-shared-used-label {
  color: #7b877e;
  font-size: 12px;
}

.planner-shared-route-actions {
  justify-content: flex-end;
  margin-top: 0;
}

.planner-shared-route-actions button {
  width: 96px;
  min-height: 32px;
}

.warehouse-route-dialog .planner-shared-route-actions .secondary:not(:disabled),
.warehouse-route-dialog .js-close-planner-shared-route.warehouse-dialog-close:not(:disabled) {
  border-color: #aeb9b0;
  background: #fff;
  color: #4c5b51;
}

@media (max-width: 900px) {
  .warehouse-route-dialog.planner-shared-route-dialog {
    width: calc(100vw - 14px);
    max-height: calc(100vh - 14px);
  }

  .planner-shared-route-content {
    max-height: calc(100vh - 16px);
    padding: 10px;
  }

  .planner-shared-route-toolbar {
    flex-wrap: wrap;
  }

  .planner-shared-route-toolbar .planner-shared-search-field {
    flex-basis: 100%;
  }

  .planner-shared-route-scroll {
    max-height: 52vh;
  }
}
