:root {
  --bg: #f4f5f1;
  --panel: #fff;
  --line: #dfe5df;
  --text: #17211b;
  --muted: #657169;
  --green: #2e6b4f;
  --red: #b42318;
}

* { box-sizing: border-box; }

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;
}

.login-tip {
  margin-top: -10px;
  margin-bottom: 16px;
  font-size: 12px;
}

.remember-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 12px;
  color: var(--text);
}

.remember-row input {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  accent-color: var(--green);
}

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

input, button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
}

input {
  padding: 0 11px;
  background: #fbfcfb;
  color: var(--text);
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  background: var(--green);
  color: #fff;
  border-color: var(--green);
  cursor: pointer;
}

button:disabled,
button.is-submitting {
  cursor: wait;
  opacity: .68;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  background: var(--green);
  color: #fff;
  border: 1px solid var(--green);
  border-radius: 8px;
  text-decoration: none;
}

.disabled-button {
  background: #eef1ee;
  color: var(--muted);
  border-color: var(--line);
  cursor: not-allowed;
  opacity: .78;
}

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

.home-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.home-meta span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfb;
}

.main-process-board {
  display: grid;
  gap: 10px;
}

.main-process-section-label {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.main-process-recent-grid {
  grid-template-columns: minmax(150px, 240px);
}

.main-process-recent-choice {
  background: #24563f;
  border-color: #24563f;
}

.main-process-divider {
  height: 1px;
  background: var(--line);
}

.main-process-button-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
}

.main-process-button-grid form {
  margin: 0;
}

.main-process-choice {
  width: 100%;
  min-height: 48px;
  justify-content: center;
  padding: 0 12px;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
}

.origin-menu {
  margin-bottom: 12px;
  padding: 14px;
}

.origin-menu-row {
  gap: 8px;
}

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

.menu-button.active-button {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.sub-menu-row {
  gap: 8px;
  margin: 4px 0 12px;
}

.sub-menu-row .button {
  min-height: 34px;
  padding: 0 14px;
  font-size: 13px;
}

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

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.check input {
  min-height: auto;
}

.flash {
  padding: 10px;
  border-radius: 8px;
  margin: 8px 0;
}

.error {
  background: #fee4e2;
  color: var(--red);
}

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

.login-card {
  width: min(420px, 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;
}

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

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  background: #edf1eb;
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  font-size: 22px;
  margin-bottom: 0;
}

nav {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

nav form {
  margin: 0;
}

.nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
}

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

.layout {
  padding: 14px;
  max-width: 1100px;
  margin: auto;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
}

.stack {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

textarea,
select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  padding: 9px 11px;
  background: #fbfcfb;
  color: var(--text);
}

textarea {
  resize: vertical;
}

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

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

.section-hidden {
  display: none;
}

.origin-layout {
  max-width: 1440px;
}

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

.completion-register-form {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
}

.completion-register-form label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}

.completion-register-form .route-no-input {
  width: 110px;
}

.completion-register-form .qty-field {
  width: 88px;
}

.completion-remark-field {
  flex: 1 1 260px;
  min-width: 180px;
}

.completion-dialog {
  width: min(920px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: #fff;
  color: var(--text);
  box-shadow: 0 18px 42px rgba(24, 35, 27, .22);
}

.completion-dialog::backdrop {
  background: rgba(20, 28, 24, .36);
}

.completion-dialog-form {
  display: grid;
  gap: 10px;
  padding: 14px;
}

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

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

.completion-dialog-head strong {
  font-size: 18px;
}

.completion-dialog-close {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 20px;
  line-height: 1;
}

.completion-dialog-fields {
  display: grid;
  grid-template-columns: 110px 92px minmax(180px, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.completion-dialog-fields label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}

.completion-dialog-message {
  min-height: 28px;
  padding: 7px 9px;
  border-radius: 6px;
  background: #f6f7f4;
  color: var(--muted);
  font-size: 13px;
}

.completion-dialog-message.error {
  background: #fff1ef;
  color: var(--red);
}

.completion-dialog-message.ok {
  background: #eef7ef;
  color: #207a3c;
}

.completion-allocation {
  display: grid;
  gap: 6px;
}

.completion-allocation-summary {
  color: var(--muted);
  font-size: 13px;
}

.completion-allocation-head,
.completion-allocation-row {
  display: grid;
  grid-template-columns: 36px 110px minmax(180px, 1fr) 60px 90px 78px 66px;
  gap: 6px;
  align-items: center;
}

.completion-allocation-head {
  min-height: 28px;
  padding: 0 8px;
  background: #eef1ea;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.completion-allocation-row {
  min-height: 30px;
  padding: 0 8px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.completion-allocation-row strong,
.completion-allocation-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.completion-allocation-row em {
  font-style: normal;
  color: #207a3c;
}

.completion-dialog-actions {
  justify-content: flex-end;
}

.process-board {
  display: grid;
  grid-template-columns: minmax(280px, .95fr) minmax(420px, 1.35fr);
  gap: 12px;
  align-items: start;
}

.process-block {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  min-width: 0;
}

.process-board .process-block {
  margin-top: 0;
}

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

.process-matrix-grid {
  display: grid;
  grid-template-columns: minmax(240px, .8fr) minmax(450px, 1.45fr) minmax(300px, 1fr);
  gap: 8px;
  align-items: start;
}

.process-matrix-column {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.process-matrix-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  border: 1px solid var(--line);
  background: #fff;
}

.process-matrix-table th,
.process-matrix-table td {
  height: 26px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  text-align: center;
  vertical-align: middle;
}

.process-matrix-table th {
  height: 30px;
  background: #f6f8f6;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.process-matrix-table-paired th:first-child,
.process-matrix-table-paired td:first-child {
  width: 58%;
}

.process-matrix-table-paired th:last-child,
.process-matrix-table-paired td:last-child {
  width: 42%;
}

.process-matrix-table-main .process-select-link {
  font-size: 13px;
}

.process-matrix-table-main th:nth-child(1),
.process-matrix-table-main td:nth-child(1) {
  width: 56%;
}

.process-matrix-table-main th:nth-child(2),
.process-matrix-table-main td:nth-child(2),
.process-matrix-table-main th:nth-child(3),
.process-matrix-table-main td:nth-child(3) {
  width: 22%;
}

.process-matrix-table-sub th:nth-child(1),
.process-matrix-table-sub td:nth-child(1) {
  width: 44%;
}

.process-matrix-table-sub th:nth-child(2),
.process-matrix-table-sub td:nth-child(2) {
  width: 28%;
}

.process-matrix-table-sub th:nth-child(3),
.process-matrix-table-sub td:nth-child(3),
.process-matrix-table-sub th:nth-child(4),
.process-matrix-table-sub td:nth-child(4) {
  width: 14%;
}

.process-select-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.2;
  word-break: break-all;
}

.price-link {
  color: var(--muted);
  font-size: 12px;
}

.process-matrix-action-button,
.process-multiplier-button {
  width: 52px;
  min-height: 22px;
  margin: 0 auto;
  padding: 0 6px;
  justify-content: center;
  font-size: 12px;
  background: #fff;
  border-color: var(--line);
  color: var(--text);
}

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

.process-matrix-action-button.process-configured-button,
.process-preparation-button.process-configured-button {
  background: var(--green) !important;
  border-color: var(--green) !important;
  color: #fff !important;
}

.process-selected-row td {
  background: #e8f5ec;
}

.process-selected-row .process-select-link {
  color: var(--green);
  font-weight: 700;
}

.process-column-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-height: 82px;
  padding: 4px 0;
}

.process-column-actions .mini-button,
.process-column-actions .secondary-link,
.process-column-actions .disabled-mini {
  width: 70px;
  min-height: 24px;
  justify-content: center;
  font-size: 12px;
}

.process-column-actions .action-add,
.process-column-actions .action-save {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.process-column-actions .action-edit {
  background: #f0f5ff;
  border-color: #b9c9ed;
  color: #28558f;
}

.process-column-actions .action-delete {
  background: #fff1f1;
  border-color: #edb8b8;
  color: #a33a3a;
}

.disabled-mini {
  background: #eef1ee;
  color: var(--muted);
  border-color: var(--line);
  opacity: .72;
  cursor: not-allowed;
}

.process-matrix-disabled .process-matrix-table {
  background: #fbfcfb;
}

.matrix-name-input {
  width: 100%;
  min-height: 22px;
  text-align: center;
  padding: 0 5px;
  font-size: 12px;
}

.matrix-price-cell {
  display: grid;
  grid-template-columns: minmax(58px, .8fr) minmax(66px, 1fr);
  gap: 3px;
  align-items: center;
}

.formula-price-fields {
  display: grid;
  grid-template-columns: minmax(54px, 1fr) minmax(54px, 1fr);
  gap: 3px;
}

.pricing-field-hidden {
  display: none !important;
}

.matrix-mode-select,
.matrix-price-input,
.formula-price-input {
  width: 100%;
  min-height: 22px;
  padding: 0 4px;
  font-size: 11px;
}

.matrix-product-price-block {
  margin-top: 2px;
}

.formula-summary-block {
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.formula-summary-block .table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.formula-summary-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.compact-head {
  margin-bottom: 6px;
}

.formula-summary-table th,
.formula-summary-table td {
  padding: 4px 6px;
  white-space: normal;
}

.formula-summary-table th:nth-child(1) {
  width: 20%;
}

.formula-summary-table th:nth-child(2) {
  width: 38%;
}

.formula-summary-table th:nth-child(3) {
  width: 32%;
}

.formula-summary-table th:nth-child(4) {
  width: 10%;
}

.formula-helper-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-bottom: 6px;
}

.formula-insert-button {
  border: 1px solid #c9d8d0;
  background: #f6faf7;
  color: var(--text);
  border-radius: 6px;
  min-height: 24px;
  padding: 2px 8px;
  font-size: 12px;
}

.formula-path-cell {
  min-width: 0;
}

.formula-path-cell .cell-text {
  min-height: 24px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.formula-expression-cell {
  min-width: 0;
}

.formula-expression-input {
  width: 100% !important;
  min-width: 0;
  max-width: 100%;
  min-height: 24px;
  padding: 1px 6px;
  font-size: 12px;
}

.formula-readonly-text {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 24px;
  padding: 0 6px;
  border: 1px solid transparent;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.formula-label-cell {
  display: grid;
  grid-template-columns: repeat(3, minmax(56px, 1fr));
  gap: 3px;
  min-width: 0;
  max-width: 100%;
}

.formula-label-input {
  width: 100%;
  min-height: 22px;
  padding: 0 4px;
  font-size: 11px;
}

.formula-label-readonly {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  min-width: 0;
  max-width: 100%;
}

.formula-label-readonly span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f8faf8;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.formula-option-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.formula-option-link {
  min-width: 74px;
  min-height: 24px;
  padding: 0 6px;
}

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

.formula-inline-option-link {
  min-height: 22px;
  align-self: stretch;
}

.formula-summary-table .formula-action-cell {
  display: table-cell;
  min-width: 0;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.formula-action-cell .mini-button {
  min-width: 52px;
  min-height: 24px;
  padding: 0 8px;
}

.formula-note-label {
  display: inline-flex;
  align-items: center;
  flex: 1 1 auto;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  min-width: 0;
}

.formula-note-input {
  width: 100% !important;
  min-width: 0;
  max-width: 100%;
  min-height: 22px;
  padding: 0 5px;
  font-size: 11px;
}

.formula-note-display {
  display: inline-flex;
  align-items: center;
  flex: 1 1 120px;
  width: auto;
  min-width: 0;
  max-width: 100%;
  min-height: 22px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.formula-note-under-expression {
  display: flex;
  box-sizing: border-box;
  width: 100%;
  margin-top: 2px;
  padding: 0 6px;
}

.mini-button[data-formula-edit-open] {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.formula-edit-row td {
  background: #f8faf8;
  padding: 6px;
}

.formula-edit-panel {
  display: grid;
  grid-template-columns: minmax(120px, 170px) minmax(240px, 1fr) minmax(230px, 300px) auto;
  align-items: center;
  gap: 6px 8px;
  width: 100%;
  min-width: 0;
}

.formula-edit-panel label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  min-width: 0;
}

.formula-edit-title {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.formula-edit-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-self: end;
  white-space: nowrap;
}

.formula-edit-panel .formula-note-label {
  grid-column: 2 / 3;
}

@media (max-width: 1200px) {
  .formula-edit-panel {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .formula-edit-title,
  .formula-edit-panel label,
  .formula-label-cell,
  .formula-edit-actions {
    grid-column: auto;
  }

  .formula-edit-panel .formula-note-label {
    grid-column: 1 / -1;
  }

  .formula-edit-actions {
    justify-self: start;
  }
}

.formula-setting-field {
  width: 86px;
  min-height: 24px;
  padding: 1px 5px;
}

.process-filter {
  margin: 0;
}

.process-filter-select {
  width: min(220px, 100%);
}

.employee-prep-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.preparation-price-block {
  max-width: 660px;
}

.process-multiplier-panel {
  max-width: 760px;
}

.process-batch-panel {
  max-width: 820px;
}

.process-multiplier-path {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
  margin-bottom: 10px;
}

.process-multiplier-rule-table {
  min-width: 460px;
}

.process-rule-section {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.process-rule-section h3 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.process-rule-existing-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

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

.formula-options-panel {
  max-width: 680px;
}

.formula-options-rule-table {
  width: auto;
  min-width: 460px;
}

.formula-option-name-field {
  width: 190px;
  min-width: 190px;
}

.formula-option-value-field {
  width: 110px;
  min-width: 110px;
}

.employee-prep-setting-wrap {
  width: 100%;
  max-width: 640px;
  margin-bottom: 8px;
}

.employee-prep-setting-table {
  width: auto;
  min-width: 560px;
}

.employee-prep-setting-table th,
.employee-prep-setting-table td,
.employee-prep-rule-table th,
.employee-prep-rule-table td {
  padding: 5px 6px;
}

.employee-prep-setting-table th:nth-child(1),
.employee-prep-setting-table td:nth-child(1) {
  width: 210px;
}

.employee-prep-setting-table th:nth-child(2),
.employee-prep-setting-table td:nth-child(2) {
  width: 116px;
}

.employee-prep-setting-table th:nth-child(3),
.employee-prep-setting-table td:nth-child(3) {
  width: 116px;
}

.employee-prep-setting-table th:nth-child(4),
.employee-prep-setting-table td:nth-child(4) {
  width: 70px;
}

.prep-employee-select {
  width: 190px;
  min-width: 190px;
}

.employee-prep-select-form {
  flex: 0 0 auto;
}

.employee-prep-setting-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.employee-prep-check {
  background: #f7faf7;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 9px;
  min-height: 28px;
}

.employee-prep-rule-table {
  width: auto;
  min-width: 430px;
}

.employee-prep-rule-table th:nth-child(1),
.employee-prep-rule-table td:nth-child(1),
.employee-prep-rule-table th:nth-child(2),
.employee-prep-rule-table td:nth-child(2) {
  width: 86px;
}

.employee-prep-rule-table th:nth-child(3),
.employee-prep-rule-table td:nth-child(3) {
  width: 96px;
}

.employee-prep-rule-table th:nth-child(4),
.employee-prep-rule-table td:nth-child(4) {
  width: 126px;
}

.prep-rule-number-field {
  width: 72px;
  min-width: 72px;
}

.prep-rule-time-field {
  width: 82px;
  min-width: 82px;
}

.multiplier-rule-field {
  width: 84px;
  min-width: 84px;
}

.employee-rule-subhead {
  margin-top: 10px;
  margin-bottom: 6px;
}

.employee-rule-subhead h2 {
  font-size: 15px;
}

.employee-prep-rule-table .row-actions,
.employee-prep-setting-actions {
  flex-wrap: nowrap;
  gap: 4px;
}

.employee-prep-rule-table .mini-button,
.employee-prep-setting-actions .mini-button {
  min-width: 48px;
  min-height: 28px;
  padding: 0 7px;
}

.process-main .short-field {
  width: min(160px, 100%);
}

.employee-process-field {
  width: min(170px, 100%);
}

.process-sub .short-field {
  width: min(180px, 100%);
}

.mode-field {
  width: min(150px, 100%);
}

.price-field {
  width: min(110px, 100%);
}

.inspection-stack {
  display: grid;
  gap: 6px;
}

.inspector-picker {
  width: min(220px, 100%);
  position: relative;
}

.inspector-picker-button {
  width: 100%;
  justify-content: flex-start;
  min-height: 34px;
  padding: 0 10px;
  background: #fbfcfb;
  color: var(--text);
  border: 1px solid var(--line);
  font-size: 12px;
}

.inspector-picker-menu {
  display: grid;
  gap: 4px;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  width: min(260px, calc(100vw - 48px));
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 32px rgba(23, 33, 27, 0.12);
  max-height: 220px;
  overflow: auto;
}

.inspector-picker-menu[hidden] {
  display: none !important;
}

.inspector-picker-option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 7px 8px;
  border: 1px solid #edf1ed;
  border-radius: 6px;
  background: #fbfcfb;
  font-size: 12px;
  color: var(--text);
  white-space: normal;
}

.inspector-picker-option:hover {
  border-color: #cad8cf;
  background: #f4f8f5;
}

.inspector-picker-option span {
  display: block;
  line-height: 1.35;
}

.inspector-picker-option small {
  color: var(--muted);
  font-size: 11px;
}

.inspector-picker-option input {
  min-height: auto;
}

.inspector-picker-title {
  padding: 0 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.inspector-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 1;
}

.inspector-picker-options {
  display: grid;
  gap: 6px;
  min-height: 0;
  overflow: auto;
}

.role-field {
  width: min(110px, 100%);
}

.binding-field {
  width: min(190px, 100%);
}

.status-field {
  width: min(88px, 100%);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f6f8f6;
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
}

.pending-pill {
  background: #fff6e8;
  border-color: #f1d6a2;
  color: #9a6700;
}

.confirmed-pill {
  background: #e8f5ec;
  border-color: #b7d9c2;
  color: var(--green);
}

.plain-pill {
  background: #f6f8f6;
  border-color: var(--line);
  color: var(--muted);
}

.ticket-panel {
  margin-bottom: 12px;
}

.ticket-records-head {
  align-items: center;
}

.ticket-head-main {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.ticket-stats-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.record-filter-form {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.record-filter-button {
  min-width: 68px;
  min-height: 30px;
  background: #f7faf8;
  border-color: var(--line);
  color: var(--text);
}

.record-filter-button.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.record-date-range {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.record-date-input {
  width: 122px;
  min-height: 30px;
  padding-left: 6px;
  padding-right: 4px;
}

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

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

.plan-title-actions {
  flex: 1;
}

.compact-section-button {
  min-height: 30px;
  padding: 0 12px;
  font-size: 13px;
}

@media (min-width: 721px) and (max-width: 1366px) {
  .inspection-pending-head {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
  }

  .inspection-pending-head .ticket-head-main {
    width: auto;
    min-width: 0;
    flex: 1 1 auto;
    flex-wrap: nowrap;
    gap: 7px;
  }

  .inspection-pending-head h2 {
    margin: 0;
    font-size: 15px;
    white-space: nowrap;
  }

  .inspection-pending-head .hint {
    min-width: 0;
    overflow: hidden;
    font-size: 11px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .inspection-pending-head .section-title-actions {
    width: auto;
    flex: 0 0 auto;
    justify-content: flex-end;
  }

  .inspection-pending-head .compact-section-button {
    min-height: 27px;
    padding: 3px 9px;
    font-size: 12px;
  }
}

.planner-ticket-employee-form {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 7px;
}

.planner-proxy-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.planner-proxy-picker-row {
  justify-content: flex-start;
}

.planner-ticket-employee-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  flex-wrap: wrap;
}

.planner-proxy-option {
  display: inline-flex;
}

.planner-proxy-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

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

.planner-proxy-radio:checked + .planner-proxy-button {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.planner-ticket-employee-no {
  width: 72px;
  min-width: 72px;
}

.planner-ticket-employee-select {
  width: 168px;
  min-width: 168px;
}

.stats-open-button,
.stats-tab-button {
  min-width: 88px;
}

.stats-tab-button.active-button {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.ticket-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.ticket-stats-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  overflow: hidden;
}

.ticket-stats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #f6f8f6;
}

.ticket-stats-head h3 {
  margin: 0;
  font-size: 14px;
}

.ticket-stats-table th,
.ticket-stats-table td {
  white-space: nowrap;
}

.ticket-stats-table tfoot th {
  background: #f6f8f6;
}

.ticket-stats-dialog {
  width: min(760px, calc(100vw - 24px));
}

.ticket-stats-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px 0;
}

.ticket-stats-body {
  display: grid;
  gap: 14px;
}

.ticket-stats-panel[hidden] {
  display: none !important;
}

.ticket-stats-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.ticket-stats-headline strong {
  font-size: 14px;
}

.ticket-stats-filter-form {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.ticket-stats-filter-item {
  display: grid;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.ticket-stats-filter-item input {
  min-width: 150px;
}

.stats-panel {
  margin-bottom: 12px;
}

.stats-filter-form {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.stats-filter-form label {
  margin: 0;
}

.stats-filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stats-filter-actions .mini-button {
  min-width: 88px;
}

.export-panel {
  max-width: 1120px;
}

.export-filter-form {
  align-items: end;
}

.export-fields-area {
  flex: 1 0 100%;
  margin-top: 10px;
}

.export-field-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.export-field-head {
  margin-bottom: 8px;
}

.export-field-head h2 {
  font-size: 15px;
}

.export-field-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.export-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.export-checkbox-item {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  margin: 0;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
  color: var(--text);
  font-size: 13px;
}

.export-checkbox-item input {
  width: 15px;
  height: 15px;
}

.muted-filter {
  opacity: 0.55;
}

.stats-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.stats-kpi {
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stats-kpi span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.stats-kpi strong {
  display: block;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 800;
}

.stats-summary-table th,
.stats-summary-table td,
.stats-detail-table th,
.stats-detail-table td {
  white-space: nowrap;
}

.stats-detail-table .stats-algorithm-cell {
  min-width: 720px;
  white-space: nowrap;
  line-height: 1.45;
}

.stats-summary-table tfoot th,
.stats-detail-table tfoot th {
  background: #f6f8f6;
}

.log-filter-form {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.log-filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.log-summary {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.log-table th,
.log-table td {
  white-space: nowrap;
  vertical-align: middle;
  padding-top: 6px;
  padding-bottom: 6px;
}

.log-detail-cell {
  max-width: 680px;
}

.log-detail {
  display: block;
  max-width: min(680px, 48vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.muted-price-input {
  background: #eef1ee;
  color: var(--muted);
}

.ticket-stats-empty {
  min-height: 92px;
}

.route-field {
  width: 48px;
}

.route-input-group {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  flex-wrap: nowrap;
}

.route-input-group .route-field {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  max-width: none;
}

.route-scan-button {
  flex: 0 0 52px;
  min-height: 30px;
  min-width: 52px;
  padding: 0 8px;
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.route-scanner-modal[hidden] {
  display: none;
}

.route-scanner-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.route-scanner-mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
}

.route-scanner-dialog {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(92vw, 460px);
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.24);
  overflow: hidden;
}

.route-scanner-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.route-scanner-head h2 {
  margin: 0;
  font-size: 16px;
}

.route-scanner-video {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #111827;
  object-fit: cover;
}

.route-scanner-status {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.prep-field {
  width: 76px;
  background: #eef1ef;
  color: var(--muted);
}

.ticket-formula-row[hidden] {
  display: none;
}

.ticket-formula-panel {
  width: 100%;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
}

.ticket-formula-cell {
  background: #f8fbf9;
}

.formula-size-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: end;
}

.formula-size-fields [hidden] {
  display: none !important;
}

.formula-size-field {
  width: 112px;
}

.formula-option-field {
  min-width: 112px;
}

.formula-size-title {
  flex: 0 0 100%;
}

.formula-size-fields label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.formula-summary-panel {
  padding: 6px;
}

.formula-summary-title {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.formula-summary-list {
  display: grid;
  gap: 5px;
}

.formula-summary-item {
  display: grid;
  grid-template-columns: minmax(84px, 0.9fr) minmax(120px, 1.6fr) auto;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 5px;
  border: 1px solid #dce7df;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
}

.formula-summary-missing {
  border-color: #d8b36a;
  background: #fffaf0;
}

.formula-summary-name,
.formula-summary-values {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.formula-summary-name {
  color: var(--text);
  font-weight: 700;
}

.formula-summary-values {
  color: var(--muted);
}

.formula-summary-edit {
  min-height: 24px;
  padding: 0 8px;
  font-size: 12px;
}

.formula-input-modal {
  z-index: 1200;
}

.formula-input-dialog {
  width: min(440px, calc(100vw - 24px));
  margin-top: 42px;
}

.formula-input-body {
  display: grid;
  gap: 10px;
}

.formula-modal-fields {
  display: grid;
  gap: 8px;
}

.formula-modal-fields label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.formula-modal-fields .formula-size-field {
  width: 100%;
}

.prep-process-field {
  min-width: 160px;
}

.ticket-process-field {
  width: min(160px, 100%);
}

.ticket-main-process-field {
  width: 104px;
  min-width: 104px;
}

.selected-process-display {
  min-height: 34px;
  display: flex;
  align-items: center;
  width: min(680px, 100%);
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfb;
  font-size: 12px;
  line-height: 1.4;
  white-space: normal;
  word-break: break-all;
}

.selected-process-display-empty {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.hidden-process-check {
  display: none;
}

.name-col {
  width: 72px;
  max-width: 72px;
}

.process-shortcuts-row td {
  padding-top: 0;
  background: #f8fbf9;
}

.process-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 0 4px;
}

.process-chip {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 12px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.process-chip.active-chip {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.process-picker-button {
  width: 350px;
  min-width: 350px;
  max-width: 350px;
  justify-content: center;
  margin-bottom: 3px;
}

.submit-ticket-button {
  min-width: 64px;
}

.process-shortcuts-helper td {
  padding-top: 6px;
}

.process-picker-modal[hidden] {
  display: none;
}

.modal-open {
  overflow: hidden;
}

.process-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.process-picker-mask {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 19, 0.38);
}

.process-picker-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(760px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  margin: 16px auto 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 20px 40px rgba(23, 33, 27, 0.16);
  overflow: hidden;
}

.second-process-dialog {
  width: min(420px, calc(100vw - 24px));
  margin-top: 32px;
}

.process-picker-head,
.process-picker-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

.process-picker-head {
  border-bottom: 1px solid var(--line);
}

.process-picker-head h2 {
  margin: 2px 0 0;
  font-size: 18px;
}

.process-picker-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.process-picker-close {
  min-height: 34px;
}

.process-picker-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 12px 12px;
}

.process-picker-current {
  margin-bottom: 8px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
  color: var(--muted);
  font-size: 12px;
}

.process-picker-grid {
  gap: 8px;
}

.process-picker-tree {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
  gap: 6px;
}

.process-picker-group {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.process-sort-mode .process-picker-group {
  padding: 4px;
  border: 1px dashed #cddbd0;
  border-radius: 8px;
  background: #f9fbfa;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.process-sort-mode .process-picker-group:active {
  cursor: grabbing;
}

.process-sort-mode .process-picker-group .process-chip {
  pointer-events: none;
}

.process-picker-group.process-dragging {
  opacity: 0.92;
  transform: scale(1.03);
  pointer-events: none;
  box-shadow: 0 14px 28px rgba(23, 33, 27, 0.18);
}

.process-sort-placeholder {
  min-height: 42px;
  border: 1px dashed var(--green);
  border-radius: 8px;
  background: #eef8f0;
}

.process-drag-active {
  user-select: none;
  cursor: grabbing;
}

.process-picker-group[hidden] {
  display: none !important;
}

.process-picker-group.expanded-process-group {
  grid-column: 1 / -1;
}

.process-parent-chip {
  width: 100%;
  justify-content: center;
  background: #f8fbf9;
}

.process-parent-chip::after {
  content: "";
}

.process-parent-chip.expanded-parent-chip::after {
  content: "";
}

.process-parent-chip.active-parent-chip {
  border-color: var(--green);
  color: var(--green);
}

.process-child-panel {
  margin-top: 10px;
  padding: 8px;
  border: 1px solid #d6e4da;
  border-radius: 8px;
  background: #f6fbf7;
}

.process-child-panel[hidden] {
  display: none !important;
}

.process-child-panel-title {
  display: flex;
  align-items: center;
  min-height: 22px;
  margin-bottom: 6px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.process-child-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
  gap: 5px;
  padding-left: 0;
}

.second-process-grid {
  justify-content: center;
  grid-template-columns: minmax(min(100%, var(--second-process-button-width, 220px)), var(--second-process-button-width, 220px));
  gap: 8px;
}

.process-child-grid[hidden] {
  display: none !important;
}

.child-chip {
  background: #fff;
  min-height: 34px;
  max-height: 34px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-align: center;
  font-size: 12px;
  line-height: 1;
}

.second-process-grid .child-chip {
  width: 100%;
  max-width: 100%;
  padding-left: 12px;
  padding-right: 12px;
  overflow: visible;
  text-overflow: clip;
}

.picker-chip {
  min-height: 30px;
  padding: 0 8px;
  line-height: 1;
  white-space: nowrap;
}

.process-picker-actions {
  border-top: 1px solid var(--line);
  justify-content: flex-end;
}

.process-picker-action {
  min-width: 84px;
}

.product-price-field {
  min-width: 220px;
  margin-bottom: 4px;
}

.ticket-product-field {
  width: 108px;
  min-width: 108px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uppercase-input {
  text-transform: uppercase;
}

.spec-field {
  width: 56px;
}

.qty-field {
  width: 72px;
}

.qty-input-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.route-qty-max-hint {
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}

.route-qty-error {
  min-height: 14px;
  margin-top: 2px;
  color: #b42318;
  font-size: 11px;
  line-height: 1.2;
}

.qty-field[aria-invalid="true"] {
  border-color: #d92d20;
  background: #fff7f6;
}

.product-price-block {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.muted-cell {
  color: var(--muted);
}

.process-empty-state {
  min-height: 150px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 16px;
}

.compact-empty-state {
  min-height: 72px;
  margin-top: 12px;
}

.process-current-parent {
  font-size: 12px;
  color: var(--muted);
  padding: 6px 8px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--line);
}

.process-current-parent strong {
  color: var(--text);
}

.origin-panel h2 {
  font-size: 16px;
  margin-bottom: 0;
}

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

.plan-section-head {
  align-items: center;
}

.plan-search-form {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.plan-search-input {
  width: 220px;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
}

.plan-pending-table .route-preview-cell {
  max-width: 145px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inspection-pending-table .employee-preview-cell {
  width: 5em;
  min-width: 5em;
  max-width: 5em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspection-pending-table .route-preview-cell {
  width: 92px;
  min-width: 92px;
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plan-pending-table .product-name-cell {
  width: 180px;
  min-width: 180px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspection-pending-table .product-name-cell {
  width: 11ch;
  min-width: 11ch;
  max-width: 11ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspection-pending-table .spec-preview-cell {
  width: 7ch;
  min-width: 7ch;
  max-width: 7ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspection-pending-table .process-preview-cell {
  width: 26ch;
  min-width: 26ch;
  max-width: 26ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspection-pending-table [data-full-text] {
  cursor: pointer;
}

.inspection-pending-table tbody tr:nth-child(odd) td {
  background: #ffffff;
}

.inspection-pending-table tbody tr:nth-child(even) td {
  background: #f3f7f4;
}

.cell-preview-popover {
  position: fixed;
  z-index: 1200;
  max-height: min(260px, calc(100vh - 40px));
  overflow: auto;
  padding: 10px 12px;
  border: 1px solid var(--green);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 12px 28px rgba(29, 49, 37, 0.18);
  font-size: 13px;
  line-height: 1.45;
  white-space: normal;
  word-break: break-all;
}

.plan-pending-table input.product-name-cell {
  width: 180px;
  min-width: 180px;
  max-width: 180px;
}

.plan-pending-table .sales-remark-cell {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plan-pending-table .employee-cell {
  width: 11ch;
  max-width: 11ch;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plan-action-cell {
  position: relative;
}

.plan-action-cell .plan-confirm-picker {
  width: 130px;
}

.plan-action-cell .inspector-picker-menu {
  left: auto;
  right: 0;
}

.inspector-picker-submit {
  display: flex;
  justify-content: flex-end;
  padding: 0;
  margin: 0;
  border-top: 0;
}

.inspector-picker-submit .mini-button {
  min-width: 78px;
  min-height: 30px;
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

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

.origin-form {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.single-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.assignment-form {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto;
  align-items: end;
}

.origin-layout label {
  margin: 0;
  font-size: 12px;
}

.origin-layout input,
.origin-layout select,
.origin-layout button {
  min-height: 34px;
  font-size: 13px;
  border-radius: 6px;
}

.origin-layout input,
.origin-layout select {
  padding: 0 9px;
}

.compact-check {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  white-space: nowrap;
}

.inline-check {
  justify-content: center;
  min-height: 30px;
}

.table-wrap {
  overflow: auto;
}

.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.mini-table th,
.mini-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 6px;
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
}

.ticket-table th,
.ticket-table td,
.ticket-record-table th,
.ticket-record-table td {
  padding-left: 4px;
  padding-right: 4px;
}

.mini-table th {
  color: var(--muted);
  font-weight: 700;
  background: #f1f5f2;
}

.excel-detail-table {
  border: 1px solid #cfd8cf;
  table-layout: auto;
  background: #fff;
}

.excel-detail-table th,
.excel-detail-table td {
  height: 29px;
  padding: 0 5px;
  border: 1px solid #cfd8cf;
  background: #fff;
  color: var(--text);
  line-height: 1.2;
  vertical-align: middle;
}

.excel-detail-table th {
  background: #eef3ef;
  color: #26342b;
  font-weight: 700;
}

.excel-detail-table .status-pill {
  min-height: 21px;
  padding: 0 7px;
  border-radius: 4px;
  font-size: 12px;
}

.excel-detail-table .mini-button,
.excel-detail-table .secondary-link,
.excel-detail-table .inspector-picker-button,
.excel-detail-table .table-input {
  min-height: 23px;
  height: 23px;
  padding: 0 7px;
  border-radius: 4px;
  font-size: 12px;
}

.excel-detail-table .inspector-picker {
  width: 160px;
}

.excel-detail-table .row-actions {
  gap: 4px;
}

.inspection-member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 3px 8px;
  min-width: 360px;
}

.inspection-member-option {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  white-space: nowrap;
}

.disabled-member-option {
  color: var(--muted);
}

.device-auth-table {
  min-width: 980px;
}

.device-auth-table .device-name-field {
  width: 150px;
}

.device-auth-table .device-note-field {
  width: 190px;
}

.table-head-note {
  margin-left: 2px;
  font-size: 11px;
  font-weight: 600;
}

.table-input,
.table-select {
  width: 100%;
  min-width: 0;
  min-height: 30px;
  font-size: 12px;
  border-radius: 6px;
}

.ticket-table .route-field,
.ticket-record-table .route-field {
  width: 100px;
  min-width: 100px;
  max-width: 100px;
}

.ticket-table .spec-field,
.ticket-record-table .spec-field {
  width: 80px;
  min-width: 80px;
  max-width: 80px;
}

.short-field {
  width: min(180px, 100%);
}

.auto-text {
  display: inline-block;
  min-width: 72px;
  color: var(--muted);
  font-size: 12px;
}

.add-row td {
  background: #f8fbf9;
}

.edit-row td {
  background: #fffaf0;
}

.locked-ticket-row td {
  background: #f1f3f1;
  color: #7b857d;
}

.locked-ticket-row .status-pill {
  opacity: 0.95;
}

.locked-ticket-pill {
  min-width: 64px;
  justify-content: center;
}

.cell-text {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
}

.code-cell {
  font-variant-numeric: tabular-nums;
}

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

.inline-delete {
  margin: 0;
}

.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 8px;
  font-size: 12px;
  border-radius: 6px;
  text-decoration: none;
}

.danger {
  background: #fff;
  color: var(--red);
  border: 1px solid #f1b7b1;
}

.secondary-link {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
  text-decoration: none;
}

.inspection-action-button {
  min-width: 68px;
  min-height: 28px;
  padding: 0 6px;
  background: var(--green);
  color: #fff;
  border: 1px solid var(--green);
}

.scrap-picker {
  position: relative;
}

.scrap-picker-button {
  width: 56px;
  min-width: 56px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.scrap-picker-popover {
  position: fixed;
  z-index: 5000;
  width: 380px;
  max-width: min(88vw, 380px);
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.18);
}

.scrap-picker-popover[hidden],
.scrap-other-row[hidden] {
  display: none;
}

.scrap-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.scrap-picker-head strong {
  display: block;
  font-size: 13px;
}

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

.scrap-current-block {
  margin-bottom: 8px;
}

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

.scrap-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
}

.scrap-special-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-top: 8px;
}

.scrap-choice-button {
  min-height: 28px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  line-height: 1.15;
  cursor: pointer;
}

.scrap-choice-button[draggable="true"] {
  cursor: grab;
}

.scrap-choice-button.dragging {
  opacity: 0.45;
}

.scrap-choice-button.active {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.scrap-choice-button.current-choice {
  width: 100%;
  background: #eef8f2;
  border-color: rgba(34, 142, 93, 0.35);
  color: var(--green);
  font-weight: 700;
}

.scrap-choice-button.current-choice.active {
  background: var(--green);
  color: #fff;
}

.scrap-choice-button.special-choice {
  min-height: 24px;
  padding: 3px 4px;
  font-size: 12px;
  font-weight: 700;
}

.scrap-other-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.scrap-other-row .table-input {
  min-width: 0;
  flex: 1;
}

.empty {
  color: var(--muted);
  text-align: center;
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    width: 100%;
    justify-content: space-between;
  }

  .origin-grid {
    grid-template-columns: 1fr;
  }

  .process-board {
    grid-template-columns: 1fr;
  }

  .process-matrix {
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .process-matrix-grid {
    min-width: 980px;
    grid-template-columns: 240px 450px 280px;
  }

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

  .employee-prep-toolbar,
  .employee-prep-setting-form {
    align-items: stretch;
    flex-direction: column;
  }

  .employee-prep-select-form,
  .employee-prep-select-form .process-filter-select,
  .employee-prep-setting-form .mini-button {
    width: 100%;
  }

  .employee-prep-check {
    justify-content: flex-start;
  }

  .preparation-price-block,
  .employee-prep-setting-wrap {
    max-width: 100%;
  }

  .employee-prep-setting-table {
    min-width: 360px;
  }

  .employee-prep-rule-table {
    min-width: 360px;
  }

  .prep-employee-select {
    width: 180px;
    min-width: 180px;
  }

  .prep-rule-number-field {
    width: 62px;
    min-width: 62px;
  }

  .prep-rule-time-field {
    width: 72px;
    min-width: 72px;
  }

  .row-actions {
    flex-wrap: wrap;
  }

  .employee-prep-rule-table .row-actions,
  .employee-prep-setting-actions {
    flex-wrap: nowrap;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .ticket-head-main,
  .ticket-stats-actions,
  .section-title-actions {
    width: 100%;
  }

  .section-title-actions {
    justify-content: flex-start;
  }

  .completion-dialog-fields {
    grid-template-columns: 1fr 1fr;
  }

  .completion-dialog-remark {
    grid-column: 1 / -1;
  }

  .completion-dialog-fields .mini-button {
    grid-column: 1 / -1;
  }

  .completion-allocation {
    overflow-x: auto;
  }

  .completion-allocation-head,
  .completion-allocation-row {
    min-width: 740px;
  }

  .plan-title-actions {
    flex: none;
  }

  .planner-ticket-employee-select {
    width: 168px;
    min-width: 168px;
  }

  .planner-ticket-employee-no {
    width: 72px;
    min-width: 72px;
  }

  .scrap-picker-button {
    width: 100%;
    min-width: 0;
  }

  .scrap-picker-popover {
    width: min(88vw, 340px);
  }

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

  .ticket-stats-actions {
    gap: 8px;
  }

  .ticket-stats-grid {
    grid-template-columns: 1fr;
  }

  .ticket-table,
  .ticket-record-table,
  .ticket-table thead,
  .ticket-record-table thead,
  .ticket-table tbody,
  .ticket-record-table tbody,
  .ticket-table tr,
  .ticket-record-table tr,
  .ticket-table td,
  .ticket-record-table td {
    display: block;
    width: 100%;
  }

  .ticket-table thead,
  .ticket-record-table thead {
    display: none;
  }

  .ticket-table tr,
  .ticket-record-table tr {
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
  }

  .ticket-table td,
  .ticket-record-table td {
    padding: 10px 12px;
    white-space: normal;
    border-bottom: 1px solid var(--line);
  }

  .ticket-table td:last-child,
  .ticket-record-table td:last-child {
    border-bottom: 0;
  }

  .ticket-entry-row td::before,
  .ticket-record-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .ticket-entry-row td[data-label="日期"]::before,
  .ticket-entry-row td[data-label="主工序"]::before {
    margin-bottom: 4px;
  }

  .ticket-table .row-actions,
  .ticket-record-table .row-actions {
    gap: 8px;
  }

  .ticket-table .mini-button,
  .ticket-record-table .mini-button,
  .ticket-table .secondary-link,
  .ticket-record-table .secondary-link {
    min-width: 86px;
  }

  .ticket-stats-tabs {
    padding: 12px 12px 0;
  }

  .ticket-stats-headline {
    align-items: flex-start;
    flex-direction: column;
  }

  .ticket-stats-filter-form {
    display: grid;
    grid-template-columns: 1fr;
  }

  .stats-filter-form {
    display: grid;
    grid-template-columns: 1fr;
  }

  .stats-kpis {
    grid-template-columns: 1fr;
  }

  .log-filter-form {
    display: grid;
    grid-template-columns: 1fr;
  }

  .log-filter-actions {
    margin-left: 0;
    justify-content: flex-start;
  }


  .ticket-stats-filter-item input,
  .ticket-stats-filter-item select,
  .stats-filter-actions .mini-button,
  .stats-open-button,
  .stats-tab-button {
    width: 100%;
  }

  .process-shortcuts-helper td::before {
    display: none;
  }

  .route-field,
  .ticket-product-field,
  .spec-field,
  .qty-field,
  .process-picker-button,
  .selected-process-display {
    width: 100%;
    min-width: 0;
  }

  .ticket-formula-panel {
    margin-top: 8px;
    padding: 8px;
  }

  .ticket-formula-panel .formula-size-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
  }

  .ticket-formula-panel .formula-size-title {
    grid-column: 1 / -1;
  }

  .ticket-formula-panel .formula-size-fields label {
    min-width: 0;
  }

  .ticket-formula-panel .formula-size-field {
    width: 100%;
  }

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

  .formula-summary-values {
    grid-column: 1 / -1;
  }

  .process-picker-dialog {
    width: calc(100vw - 20px);
    margin-top: 12px;
  }

  .ticket-stats-dialog {
    width: calc(100vw - 20px);
  }

  .process-picker-head,
  .process-picker-actions {
    padding: 12px;
  }

  .process-picker-body {
    padding: 12px;
  }

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

  .process-child-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-left: 0;
  }

  .table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  .ticket-record-table {
    display: table;
    width: max-content;
    min-width: 100%;
    table-layout: auto;
  }

  .ticket-record-table thead {
    display: table-header-group;
  }

  .ticket-record-table tbody {
    display: table-row-group;
  }

  .ticket-record-table tr {
    display: table-row;
    margin: 0;
    border: 0;
    border-radius: 0;
    overflow: visible;
    background: transparent;
  }

  .ticket-record-table th,
  .ticket-record-table td {
    display: table-cell;
    padding: 7px 5px;
    white-space: nowrap;
  }

  .ticket-record-table td {
    border-bottom: 1px solid var(--line);
  }

  .ticket-record-table td::before {
    display: none;
    content: none;
  }

  .ticket-record-table .row-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    min-width: 112px;
  }

  .ticket-record-table .inline-delete {
    display: inline-flex;
  }

  .ticket-record-table .mini-button,
  .ticket-record-table .secondary-link {
    min-width: 48px;
    min-height: 28px;
    padding: 0 7px;
  }

  .ticket-record-table tr.edit-row {
    display: block;
    width: min(100%, calc(100vw - 34px));
    min-width: min(100%, calc(100vw - 34px));
    margin: 0 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    background: #fffaf0;
  }

  .ticket-record-table tr.edit-row td {
    display: block;
    width: 100%;
    padding: 9px 10px;
    white-space: normal;
    border-bottom: 1px solid var(--line);
  }

  .ticket-record-table tr.edit-row td:last-child {
    border-bottom: 0;
  }

  .ticket-record-table tr.edit-row td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .ticket-record-table tr.edit-row .ticket-main-process-field,
  .ticket-record-table tr.edit-row .route-field,
  .ticket-record-table tr.edit-row .ticket-product-field,
  .ticket-record-table tr.edit-row .spec-field,
  .ticket-record-table tr.edit-row .qty-field,
  .ticket-record-table tr.edit-row .process-picker-button,
  .ticket-record-table tr.edit-row .selected-process-display,
  .ticket-record-table tr.edit-row .route-input-group {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .ticket-record-table tr.edit-row .ticket-formula-panel {
    width: 100%;
    margin-top: 8px;
  }

  .ticket-record-table tr.edit-row .formula-size-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .ticket-record-table tr.edit-row .formula-size-title {
    grid-column: 1 / -1;
  }

  .ticket-record-table tr.edit-row .formula-size-fields label {
    min-width: 0;
  }

  .ticket-record-table tr.edit-row .formula-size-field {
    width: 100%;
    min-width: 0;
  }

  .ticket-record-table tr.edit-row .row-actions {
    min-width: 0;
    flex-wrap: wrap;
    gap: 6px;
  }
}

.inspection-record-table .inspection-action-button {
  min-width: 68px;
  min-height: 28px;
  padding: 0 6px;
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.ticket-record-table.excel-detail-table {
  display: table;
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
}

.ticket-record-table.excel-detail-table thead {
  display: table-header-group;
}

.ticket-record-table.excel-detail-table tbody {
  display: table-row-group;
}

.ticket-record-table.excel-detail-table tr {
  display: table-row;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.ticket-record-table.excel-detail-table th,
.ticket-record-table.excel-detail-table td {
  display: table-cell;
  height: 29px;
  padding: 0 5px;
  border: 1px solid #cfd8cf;
  white-space: nowrap;
}

.ticket-record-table.excel-detail-table td::before {
  display: none;
  content: none;
}

.plan-record-table {
  min-width: 1120px;
  table-layout: fixed;
}

.plan-record-table th:nth-child(1),
.plan-record-table td:nth-child(1) {
  width: 108px;
}

.plan-record-table th:nth-child(2),
.plan-record-table td:nth-child(2),
.plan-record-table th:nth-child(3),
.plan-record-table td:nth-child(3) {
  width: 86px;
}

.plan-record-table th:nth-child(4),
.plan-record-table td:nth-child(4) {
  width: 76px;
}

.plan-record-table th:nth-child(5),
.plan-record-table td:nth-child(5) {
  width: 96px;
}

.plan-record-table th:nth-child(6),
.plan-record-table td:nth-child(6) {
  width: 20ch;
  max-width: 20ch;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plan-record-table th:nth-child(7),
.plan-record-table td:nth-child(7) {
  width: 230px;
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plan-record-table th:nth-child(8),
.plan-record-table td:nth-child(8) {
  width: 58px;
}

.plan-record-table th:nth-child(9),
.plan-record-table td:nth-child(9) {
  width: 88px;
}

.plan-record-table th:nth-child(10),
.plan-record-table td:nth-child(10) {
  width: 108px;
}

.plan-record-table th:nth-child(11),
.plan-record-table td:nth-child(11) {
  width: 82px;
}

.inspection-confirmed-record-table {
  min-width: 1180px;
  table-layout: fixed;
}

.inspection-confirmed-record-table th:nth-child(1),
.inspection-confirmed-record-table td:nth-child(1) {
  width: 92px;
}

.inspection-confirmed-record-table th:nth-child(2),
.inspection-confirmed-record-table td:nth-child(2) {
  width: 78px;
}

.inspection-confirmed-record-table th:nth-child(3),
.inspection-confirmed-record-table td:nth-child(3) {
  width: 70px;
}

.inspection-confirmed-record-table th:nth-child(4),
.inspection-confirmed-record-table td:nth-child(4) {
  width: 88px;
}

.inspection-confirmed-record-table th:nth-child(5),
.inspection-confirmed-record-table td:nth-child(5) {
  width: 20ch;
  max-width: 20ch;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inspection-confirmed-record-table th:nth-child(6),
.inspection-confirmed-record-table td:nth-child(6) {
  width: 170px;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inspection-confirmed-record-table th:nth-child(7),
.inspection-confirmed-record-table td:nth-child(7),
.inspection-confirmed-record-table th:nth-child(8),
.inspection-confirmed-record-table td:nth-child(8),
.inspection-confirmed-record-table th:nth-child(9),
.inspection-confirmed-record-table td:nth-child(9),
.inspection-confirmed-record-table th:nth-child(10),
.inspection-confirmed-record-table td:nth-child(10) {
  width: 54px;
}

.inspection-confirmed-record-table th:nth-child(11),
.inspection-confirmed-record-table td:nth-child(11) {
  width: 82px;
  max-width: 82px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inspection-confirmed-record-table th:nth-child(12),
.inspection-confirmed-record-table td:nth-child(12) {
  width: 72px;
}

.inspection-confirmed-record-table th:nth-child(13),
.inspection-confirmed-record-table td:nth-child(13) {
  width: 92px;
}

.inspection-confirmed-record-table th:nth-child(14),
.inspection-confirmed-record-table td:nth-child(14) {
  width: 72px;
}

.inspection-confirmed-record-table th:nth-child(15),
.inspection-confirmed-record-table td:nth-child(15) {
  width: 96px;
}

@media (max-width: 1200px) {
  .plan-record-table {
    min-width: 930px;
    font-size: 11px;
  }

  .plan-record-table th,
  .plan-record-table td,
  .inspection-confirmed-record-table th,
  .inspection-confirmed-record-table td {
    padding-left: 3px;
    padding-right: 3px;
  }

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

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

  .plan-record-table th:nth-child(4),
  .plan-record-table td:nth-child(4) {
    width: 58px;
  }

  .plan-record-table th:nth-child(5),
  .plan-record-table td:nth-child(5) {
    width: 78px;
  }

  .plan-record-table th:nth-child(6),
  .plan-record-table td:nth-child(6) {
    width: 20ch;
    max-width: 20ch;
  }

  .plan-record-table th:nth-child(7),
  .plan-record-table td:nth-child(7) {
    width: 170px;
    max-width: 170px;
  }

  .plan-record-table th:nth-child(8),
  .plan-record-table td:nth-child(8) {
    width: 42px;
  }

  .plan-record-table th:nth-child(9),
  .plan-record-table td:nth-child(9) {
    width: 72px;
  }

  .plan-record-table th:nth-child(10),
  .plan-record-table td:nth-child(10) {
    width: 92px;
  }

  .plan-record-table th:nth-child(11),
  .plan-record-table td:nth-child(11) {
    width: 62px;
  }

  .inspection-confirmed-record-table {
    min-width: 1040px;
    font-size: 10.5px;
  }

  .inspection-confirmed-record-table th:nth-child(1),
  .inspection-confirmed-record-table td:nth-child(1) {
    width: 78px;
  }

  .inspection-confirmed-record-table th:nth-child(2),
  .inspection-confirmed-record-table td:nth-child(2) {
    width: 62px;
  }

  .inspection-confirmed-record-table th:nth-child(3),
  .inspection-confirmed-record-table td:nth-child(3) {
    width: 58px;
  }

  .inspection-confirmed-record-table th:nth-child(4),
  .inspection-confirmed-record-table td:nth-child(4) {
    width: 72px;
  }

  .inspection-confirmed-record-table th:nth-child(5),
  .inspection-confirmed-record-table td:nth-child(5) {
    width: 20ch;
    max-width: 20ch;
  }

  .inspection-confirmed-record-table th:nth-child(6),
  .inspection-confirmed-record-table td:nth-child(6) {
    width: 130px;
    max-width: 130px;
  }

  .inspection-confirmed-record-table th:nth-child(7),
  .inspection-confirmed-record-table td:nth-child(7),
  .inspection-confirmed-record-table th:nth-child(8),
  .inspection-confirmed-record-table td:nth-child(8),
  .inspection-confirmed-record-table th:nth-child(9),
  .inspection-confirmed-record-table td:nth-child(9),
  .inspection-confirmed-record-table th:nth-child(10),
  .inspection-confirmed-record-table td:nth-child(10) {
    width: 40px;
  }

  .inspection-confirmed-record-table th:nth-child(11),
  .inspection-confirmed-record-table td:nth-child(11) {
    width: 60px;
    max-width: 60px;
  }

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

  .inspection-confirmed-record-table th:nth-child(13),
  .inspection-confirmed-record-table td:nth-child(13) {
    width: 78px;
  }

  .inspection-confirmed-record-table th:nth-child(14),
  .inspection-confirmed-record-table td:nth-child(14) {
    width: 58px;
  }

  .inspection-confirmed-record-table th:nth-child(15),
  .inspection-confirmed-record-table td:nth-child(15) {
    width: 68px;
  }
}

.ticket-record-table.excel-detail-table .mini-button,
.ticket-record-table.excel-detail-table .secondary-link,
.ticket-record-table.excel-detail-table .inspection-action-button,
.ticket-record-table.excel-detail-table .inspector-picker-button,
.ticket-record-table.excel-detail-table .table-input {
  min-height: 23px;
  height: 23px;
  padding: 0 7px;
  border-radius: 4px;
}

.ticket-record-table.excel-detail-table .plan-action-cell {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  position: relative;
  min-width: 150px;
  height: 29px;
  white-space: nowrap;
}

.ticket-record-table.excel-detail-table .plan-action-cell form {
  display: none;
}

.ticket-record-table.excel-detail-table .plan-action-cell .plan-confirm-picker {
  display: inline-flex;
  width: auto;
  position: static;
}

.ticket-record-table.excel-detail-table .plan-action-cell .mini-button,
.ticket-record-table.excel-detail-table .plan-action-cell .secondary-link,
.ticket-record-table.excel-detail-table .plan-action-cell .inspector-picker-button {
  display: inline-flex;
  width: auto;
  min-width: 38px;
  min-height: 23px;
  height: 23px;
  padding: 0 7px;
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.ticket-record-table.excel-detail-table .plan-action-cell .inspector-picker-menu {
  position: fixed;
  top: 50%;
  left: 50%;
  right: auto;
  width: min(460px, calc(100vw - 32px));
  max-height: min(520px, calc(100vh - 72px));
  grid-template-rows: auto minmax(0, 1fr);
  transform: translate(-50%, -50%);
  z-index: 1000;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid #cfd9d2;
  box-shadow: 0 24px 60px rgba(23, 33, 27, 0.22);
  white-space: normal;
  overflow: hidden;
}

.ticket-entry-row .route-input-group,
.ticket-record-table tr.edit-row .route-input-group {
  width: 100%;
  min-width: 0;
}

.ticket-entry-row .route-input-group .route-field,
.ticket-record-table tr.edit-row .route-input-group .route-field {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  max-width: none;
}

.ticket-entry-row .route-input-group .route-scan-button,
.ticket-record-table tr.edit-row .route-input-group .route-scan-button {
  flex: 0 0 52px;
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

@media (min-width: 721px) {
  .ticket-entry-row .route-input-group,
  .ticket-record-table tr.edit-row .route-input-group {
    width: 180px;
    min-width: 180px;
  }
}

.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;
}
