:root {
  --tblr-primary: #1d5fd1;
  --app-ink: #172033;
  --app-muted: #64748b;
  --app-line: #d9e2ef;
  --app-soft: #eef4fb;
  --app-panel: #ffffff;
  --app-accent: #0f766e;
  --app-warm: #b45309;
}

html {
  scrollbar-gutter: stable;
}

body.modal-open {
  padding-right: 0 !important;
}

body {
  color: var(--app-ink);
  background:
    linear-gradient(180deg, #f6f8fb 0, #f9fafb 260px);
}

.navbar {
  border-bottom: 1px solid var(--app-line);
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .04);
}

.navbar-brand {
  font-weight: 800;
  letter-spacing: 0;
}

.session-countdown {
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}

.app-page-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: center;
  gap: .5rem;
  height: 34px;
  padding: 0 .75rem;
  margin: 0;
  border-bottom: 1px solid var(--app-line);
  background: #fff;
}

.app-page-title {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: var(--app-ink);
  font-size: .95rem;
  font-weight: 800;
  white-space: nowrap;
}

.page-title {
  position: relative;
  margin: 0;
  padding-left: .9rem;
  color: var(--app-ink);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.25;
}

.app-page-title::before {
  content: "";
  width: 3px;
  height: 16px;
  border-radius: 3px;
  background: var(--tblr-primary);
}

.page-body > .container-xl > .page-title::before,
.page-body > .container-fluid > .page-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: .16rem;
  bottom: .16rem;
  width: 4px;
  height: auto;
  border-radius: 4px;
}

.app-page-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 .45rem;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  color: #475569;
  background: #f8fafc;
  font-size: .78rem;
  font-weight: 600;
  text-decoration: none;
}

.app-page-back:hover {
  color: var(--tblr-primary);
  border-color: rgba(29, 95, 209, .35);
  background: rgba(29, 95, 209, .08);
  text-decoration: none;
}

.app-page-meta {
  min-width: 0;
  max-width: min(56vw, 720px);
  overflow: hidden;
  padding-left: .45rem;
  border-left: 1px solid #e2e8f0;
  color: #334155;
  font-size: .8rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-page-meta-sep {
  margin: 0 .35rem;
  color: #cbd5e1;
}

page-header + .page-body {
  margin-top: 0;
  padding-top: .75rem;
}

.card {
  border-color: var(--app-line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.card-header {
  background: #fff;
  border-color: var(--app-line);
}

.card-title {
  color: var(--app-ink);
  font-weight: 800;
}

.card-disabled { opacity: .55; cursor: not-allowed; }

.card-link {
  position: relative;
  min-height: 104px;
  overflow: hidden;
  border-color: var(--app-line);
  color: var(--app-ink);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.card-link::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--tblr-primary);
}

.row-cards > [class*="col-"]:nth-child(2n) .card-link::before { background: var(--app-accent); }
.row-cards > [class*="col-"]:nth-child(3n) .card-link::before { background: var(--app-warm); }
.row-cards > [class*="col-"]:nth-child(4n) .card-link::before { background: #7c3aed; }

.card-link:hover {
  transform: translateY(-2px);
  border-color: rgba(29, 95, 209, .35);
  box-shadow: 0 .85rem 1.6rem rgba(15, 23, 42, .10);
  text-decoration: none;
}

.card-link .avatar {
  width: 2.65rem;
  height: 2.65rem;
  border-radius: 8px;
  box-shadow: inset 0 -10px 18px rgba(0, 0, 0, .08);
  font-weight: 800;
}

.font-weight-medium,
.fw-medium {
  color: var(--app-ink);
  font-weight: 700 !important;
}

.form-label {
  margin-bottom: .25rem;
  color: #334155;
  font-size: .8125rem;
  font-weight: 700;
}

.form-control:not(.form-control-lg):not(.form-control-plaintext),
.form-select:not(.form-select-lg) {
  min-height: calc(1.5em + .5rem + 2px);
  padding: .25rem .5rem;
  font-size: .875rem;
  border-radius: 4px;
}

textarea.form-control:not(.form-control-lg) {
  min-height: 0;
}

.input-group-sm > .form-control,
.input-group-sm > .form-select,
.input-group-sm > .input-group-text,
.input-group-sm > .btn {
  font-size: .8125rem;
}

.input-group-text {
  padding: .25rem .5rem;
  font-size: .875rem;
}

.form-control,
.form-select {
  border-color: #cbd5e1;
}

.form-control:hover,
.form-select:hover {
  border-color: #94a3b8;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--tblr-primary);
  box-shadow: 0 0 0 .18rem rgba(29, 95, 209, .16);
}

.form-select:not(:disabled),
.form-check-input:not(:disabled),
.list-group-item-action:not(:disabled),
.order-tree-item:not(:disabled) {
  cursor: pointer;
}

.form-check-input {
  width: .95rem;
  height: .95rem;
  border-color: #94a3b8;
}

.form-check-input:checked {
  border-color: var(--tblr-primary);
  background-color: var(--tblr-primary);
  box-shadow: 0 0 0 .15rem rgba(29, 95, 209, .12);
}

.list-group-item.active,
.order-tree-item.active,
.btn-outline-secondary.active,
.btn-outline-primary.active {
  border-color: var(--tblr-primary);
  color: #fff;
  background: var(--tblr-primary);
  box-shadow: inset 4px 0 0 rgba(255, 255, 255, .5), 0 6px 14px rgba(29, 95, 209, .18);
}

.table-hover tbody tr:hover {
  background-color: rgba(29, 95, 209, .055);
}

.card-table.table > :not(caption) > * > * {
  padding: .34rem .45rem;
}

.table-responsive > .table.card-table:not(.order-grid):not(.order-history-table) {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}

.table-responsive > .table.card-table:not(.order-grid):not(.order-history-table) > :not(caption) > * > * {
  width: auto;
  white-space: nowrap;
}

.table-vcenter > :not(caption) > * > * {
  vertical-align: middle;
}

.table tbody tr:has(.form-check-input:checked) {
  background-color: rgba(29, 95, 209, .10);
}

.badge {
  font-weight: 700;
}

.tjt-choice-modal-title,
.tjt-choice-modal .modal-footer .btn,
.tjt-action-inline-icon {
  display: inline-flex;
  align-items: center;
}

.tjt-choice-modal-title {
  min-width: 0;
  gap: .45rem;
}

.tjt-choice-modal-icon,
.tjt-action-inline-icon {
  justify-content: center;
  width: 1rem;
  height: 1rem;
}

.tjt-choice-modal-icon svg,
.tjt-action-inline-icon svg {
  width: 1rem;
  height: 1rem;
}

.tjt-choice-modal .modal-footer .btn {
  gap: .35rem;
}

#layout-root.layout-loading {
  position: relative;
  min-height: 220px;
}

#layout-root.layout-loading > .layout-section {
  visibility: hidden;
}

#layout-root.layout-loading::before {
  content: "正在加载...";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  color: var(--tblr-secondary, #6b7280);
  font-size: 14px;
}

.layout-section {
  position: relative;
}

.layout-section + .layout-section {
  margin-top: 1rem;
}

.layout-section-header {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 1rem 0 .75rem;
}

.layout-section-header h2 {
  margin: 0;
}

.layout-section-actions {
  display: none;
  gap: .25rem;
  margin-left: auto;
}

body.layout-editing .layout-section-actions {
  display: inline-flex;
}

body.layout-editing .layout-section {
  border-radius: .5rem;
  outline: 1px dashed rgba(32, 107, 196, .35);
  outline-offset: 6px;
}

body.layout-editing .layout-card {
  cursor: grab;
}

body.layout-editing .layout-card .card {
  box-shadow: 0 0 0 1px rgba(32, 107, 196, .25);
}

body.layout-editing .layout-card.dragging {
  opacity: .45;
  cursor: grabbing;
}

body.layout-editing .layout-card.drop-before > .card {
  box-shadow: -3px 0 0 0 #206bc4;
}

body.layout-editing .layout-card.drop-after > .card {
  box-shadow: 3px 0 0 0 #206bc4;
}

.layout-toolbar {
  display: none;
}

body.layout-editing .layout-toolbar {
  display: inline-flex;
  gap: .25rem;
}

.layout-toolbar-msg {
  display: none;
  margin-left: .5rem;
  color: #d6336c;
  font-size: .85rem;
}

body.layout-editing .layout-toolbar-msg {
  display: inline;
}

.stamp-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 1rem;
  align-items: start;
}

.stamp-preview-shell {
  min-height: 640px;
  overflow: auto;
  background: #f6f8fb;
}

.stamp-page {
  position: relative;
  display: inline-block;
  margin: 1rem auto;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .16);
}

.stamp-page-wrap {
  min-width: 100%;
  text-align: center;
}

.stamp-page canvas,
.stamp-page img {
  display: block;
  max-width: 100%;
  height: auto;
}

.stamp-overlay {
  position: absolute;
  border: 1px dashed rgba(214, 57, 57, .7);
  cursor: move;
  touch-action: none;
}

.stamp-overlay-locked {
  border-color: rgba(214, 57, 57, .35);
  border-style: solid;
  cursor: default;
}

.stamp-overlay img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: .88;
  pointer-events: none;
}

.stamp-resize-handle {
  position: absolute;
  right: -7px;
  bottom: -7px;
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #d63939;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .25);
  cursor: nwse-resize;
  touch-action: none;
}

.stamp-rotate-handle {
  position: absolute;
  left: 50%;
  top: -28px;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #4263eb;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .35);
  cursor: grab;
  touch-action: none;
}

.stamp-rotate-handle::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 13px;
  width: 2px;
  height: 14px;
  margin-left: -1px;
  background: rgba(66, 99, 235, .7);
}

.stamp-empty {
  display: grid;
  min-height: 420px;
  place-items: center;
  color: #667085;
}

.stamp-side .form-label {
  margin-bottom: .25rem;
}

.stamp-record-table td {
  vertical-align: middle;
}

.stamp-record-table .text-end {
  white-space: nowrap;
}

.stamp-record-month-select {
  min-width: 104px;
  padding-right: 1.75rem !important;
  background-position: right .5rem center;
}


.stamp-action-separator {
  display: inline-block;
  width: 1px;
  height: 16px;
  margin: 0 4px;
  vertical-align: middle;
  background: #d9e2ec;
}

.stamp-upload-drop {
  padding: .75rem;
  border: 1px dashed #b6c2d1;
  border-radius: 8px;
  background: #f8fafc;
  position: relative;
}

.stamp-upload-drop:hover {
  border-color: #206bc4;
  background: #f1f7ff;
}

.stamp-file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.stamp-upload-label {
  position: relative;
  overflow: hidden;
  margin-bottom: 0;
  cursor: pointer;
}

.stamp-upload-label input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
}

.stamp-pending-thumb {
  width: 56px;
  height: 56px;
  border: 1px solid #d9e2ec;
  border-radius: 6px;
  object-fit: cover;
  background: #eef2f7;
}

.stamp-pending-name {
  word-break: break-all;
  line-height: 1.3;
}

.stamp-seal-thumb {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #d9e2ec;
  border-radius: 6px;
  background: #fff;
  color: #98a2b3;
  font-size: 12px;
}

.stamp-seal-thumb img {
  max-width: 42px;
  max-height: 42px;
  object-fit: contain;
}

.stamp-file-name {
  max-width: 260px;
}

.stamp-record-edit-overlay {
  position: fixed;
  inset: 0;
  z-index: 1055;
  display: block;
  background: rgba(15, 23, 42, .35);
}

.stamp-record-edit-dialog {
  max-width: 500px;
}

.stamp-record-edit-dialog .modal-content {
  background: #fff;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  color: #1f2937;
  box-shadow: 0 16px 48px rgba(15, 23, 42, .18);
}

.stamp-record-edit-dialog .modal-header,
.stamp-record-edit-dialog .modal-body,
.stamp-record-edit-dialog .modal-footer {
  background: #fff;
}

.stamp-action-group .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1 1 0;
  min-width: 0;
  padding-left: 8px;
  padding-right: 8px;
  white-space: nowrap;
}

.stamp-action-group .stamp-action-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  flex: 0 0 auto;
}

.stamp-action-group .stamp-action-icon svg {
  width: 14px;
  height: 14px;
}

.stamp-main-btn {
  font-weight: 500;
}

.stamp-page-stamp-tools {
  padding: .5rem .625rem;
  border: 1px solid #d9e2ec;
  border-radius: 6px;
  background: #f8fafc;
}
.stamp-page-stamp-tools .btn-list {
  gap: .35rem;
}
.stamp-page-stamp-tools .btn {
  flex: 1 1 0;
  min-width: 0;
}


.stamp-rename-btn {
  flex: 0 0 auto;
}

.order-code-prefix-input {
  max-width: 120px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.customer-reconciliation-period {
  max-width: 96px;
}

@media (max-width: 991.98px) {
  .stamp-workbench {
    grid-template-columns: 1fr;
  }

  .stamp-preview-shell {
    min-height: 420px;
  }
}

@media print {
  .navbar, .page-header, .no-print, .btn-toolbar, .toast-container { display: none !important; }
}

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

@page contract-page {
  size: A4 portrait;
  margin: 8mm 10mm 10mm;
  @bottom-right {
    content: "第 " counter(page) " / " counter(pages) " 页";
    color: #6b7280;
    font-size: 8pt;
  }
}

@page statement-page {
  size: A4 portrait;
  margin: 8mm 10mm 10mm;
  @bottom-right {
    content: "第 " counter(page) " / " counter(pages) " 页";
    color: #6b7280;
    font-size: 8pt;
  }
}

.customer-table {
  table-layout: auto;
}

.customer-table th,
.customer-table td {
  padding-top: .28rem;
  padding-bottom: .28rem;
  font-size: .875rem;
  vertical-align: middle;
}

.customer-table th {
  white-space: nowrap;
}

.customer-info-cell,
.customer-table-text {
  min-width: 0;
  overflow: hidden;
}

.customer-name {
  overflow: hidden;
  color: var(--app-ink);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-address,
.customer-contact {
  overflow: hidden;
  margin-top: 2px;
  color: #64748b;
  font-size: .8125rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-contact {
  color: #475569;
}

.customer-mobile-status {
  display: none;
  margin-top: 2px;
}

.customer-row-disabled .customer-name {
  color: #64748b;
}

.customer-table-text {
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-table .badges-list {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
}

.customer-table .badge {
  padding: .12rem .32rem;
  font-size: .72rem;
  line-height: 1.15;
}

.company-table {
  table-layout: auto;
}

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

.customer-tree {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: .875rem;
}
.customer-tree-node {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 4px;
  user-select: none;
}
.customer-tree-node:hover {
  background: var(--tblr-bg-surface-secondary, #f6f8fb);
}
.customer-tree-node.selected {
  background: var(--tblr-primary-lt, #e9f2fc);
  color: var(--tblr-primary, #206bc4);
  font-weight: 500;
}
.customer-tree-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: #94a3b8;
  flex-shrink: 0;
  line-height: 0;
}
.customer-tree-arrow-empty {
  cursor: default;
}
.customer-tree-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: #64748b;
  flex-shrink: 0;
  line-height: 0;
}
.customer-tree-icon svg,
.customer-tree-arrow svg {
  display: block;
}
.customer-tree-node.selected .customer-tree-icon,
.customer-tree-node.selected .customer-tree-arrow {
  color: var(--tblr-primary, #206bc4);
}
.customer-tree-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.customer-tree-count {
  flex-shrink: 0;
  color: var(--tblr-secondary, #6c757d);
  font-size: .75rem;
}
.customer-tree-card {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.customer-print-tabs {
  gap: 4px;
  flex-wrap: wrap;
}
.customer-print-tabs .nav-link {
  padding: .25rem .75rem;
  font-size: 13px;
  border: 1px solid transparent;
  background: #f1f5f9;
  color: #475569;
  border-radius: 6px;
}
.customer-print-tabs .nav-link.active {
  background: var(--tblr-primary, #206bc4);
  color: #fff;
  border-color: var(--tblr-primary, #206bc4);
}

.customer-cat-grip {
  display: inline-block;
  margin-right: 6px;
  cursor: grab;
  opacity: .55;
  user-select: none;
  font-size: .9em;
  line-height: 1;
}
.customer-cat-grip:hover {
  opacity: 1;
}
.customer-cat-grip:active {
  cursor: grabbing;
}
.customer-tree-node.drag-over {
  background: var(--tblr-primary-lt, #e9f2fc);
  outline: 1px dashed var(--tblr-primary, #206bc4);
  outline-offset: -1px;
}
.row-drag-handle .row-drag-grip svg {
  display: block;
  vertical-align: middle;
  color: var(--tblr-secondary, #6c757d);
}

.row-drag-ghost {
  background: var(--tblr-primary-lt, #e9f2fc) !important;
}
.row-drag-ghost > td {
  border-top: 2px solid var(--tblr-primary, #1f7ac0) !important;
  border-bottom: 2px solid var(--tblr-primary, #1f7ac0) !important;
  background: var(--tblr-primary-lt, #e9f2fc) !important;
  color: transparent !important;
}
.row-drag-ghost > td > * {
  visibility: hidden;
}
.row-drag-fallback {
  display: table !important;
  width: min(960px, calc(100vw - 24px)) !important;
  table-layout: fixed !important;
  background: #fff !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .18);
  opacity: .96;
  pointer-events: none;
}
.row-drag-fallback > td {
  background: #fff !important;
  border-top: 1px solid #dbe3ef !important;
  border-bottom: 1px solid #dbe3ef !important;
}
.row-drag-chosen > td {
  background: #d4e7fa;
}
.row-drag-dragging {
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}
th.row-drag-handle,
td.row-drag-handle,
th.table-drag-col,
td.table-drag-col {
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  padding: 0 !important;
  box-sizing: border-box;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}
col.table-drag-col {
  width: 40px;
}
td.row-drag-handle {
  cursor: grab;
  user-select: none;
  color: var(--tblr-secondary, #94a3b8);
}
td.row-drag-handle:hover {
  color: var(--tblr-primary, #1f7ac0);
  background: var(--tblr-primary-lt, #e9f2fc);
}
td.row-drag-handle:active {
  cursor: grabbing;
}
.row-drag-grip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 34px;
  font-size: 16px;
  line-height: 1;
  letter-spacing: 0;
  pointer-events: none;
}

.row-drag-grip svg {
  display: block;
  width: 17px;
  height: 17px;
  margin: auto;
}

th.row-drag-handle.price-pin-cell,
td.row-drag-handle.price-pin-cell {
  width: 38px;
  min-width: 38px;
  max-width: 38px;
}
td.row-drag-handle.price-pin-cell {
  white-space: nowrap;
  text-align: center;
  padding: 2px 0 !important;
}
td.row-drag-handle.price-pin-cell .row-drag-grip {
  display: inline-flex;
  width: auto;
  min-height: 0;
  vertical-align: middle;
  margin-right: 0;
}
td.row-drag-handle.price-pin-cell .row-drag-grip svg {
  width: 14px;
  height: 14px;
}
.price-pin-top-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--tblr-secondary, #94a3b8);
  border-radius: 3px;
  cursor: pointer;
  vertical-align: middle;
}
.price-pin-top-btn:hover {
  background: var(--tblr-primary-lt, #e9f2fc);
  color: var(--tblr-primary, #1f7ac0);
}
.price-pin-top-btn svg {
  width: 10px;
  height: 10px;
  display: block;
}

.table-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
}

.table-sort-button:hover {
  color: var(--tblr-primary);
}

.table-sort-indicator {
  display: inline-block;
  width: 12px;
  color: var(--tblr-primary);
  text-align: center;
}

.table-sort-indicator.is-muted {
  color: var(--tblr-secondary-color);
}

.product-code-input-group > .form-control {
  min-width: 0;
}

.product-code-input-group > .form-control,
.product-code-input-group > .btn {
  min-height: calc(1.5em + .5rem + 2px);
  padding: .25rem .5rem;
  font-size: .875rem;
  line-height: 1.5;
}

.table-action-sticky {
  position: sticky;
  right: 0;
  z-index: 5;
  background: #fff !important;
  box-shadow: -6px 0 6px -6px rgba(0, 0, 0, .08);
}
th.table-action-sticky {
  z-index: 6;
  background: #f6f8fb !important;
}
.table-hover tbody tr:hover td.table-action-sticky {
  background: #f6f8fb !important;
}

.table-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  width: 100%;
  min-width: 76px;
  padding: 0 2px;
  background: inherit;
  border-radius: 4px;
  white-space: nowrap;
}

.table-row-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: background-color .12s, color .12s, border-color .12s;
}

.table-row-btn svg {
  width: 14px;
  height: 14px;
}

.table-row-btn tjt-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.table-row-btn:hover:not(:disabled) {
  background: #eef2f7;
  color: #1f2d3d;
}

.table-row-btn:active:not(:disabled) {
  background: #e2e8f0;
}

.table-row-btn:disabled {
  opacity: .28;
  cursor: not-allowed;
}

.table-row-btn-edit:hover:not(:disabled),
.table-row-btn-print:hover:not(:disabled) {
  color: var(--tblr-primary, #206bc4);
  background: rgba(32, 107, 196, .1);
}

.table-row-btn-ok {
  color: #16875b;
}

.table-row-btn-ok:hover:not(:disabled) {
  color: var(--tblr-success, #2fb344);
  background: rgba(47, 179, 68, .12);
}

.table-row-btn-warn {
  color: #b7791f;
}

.table-row-btn-warn:hover:not(:disabled) {
  color: #b45309;
  background: rgba(245, 159, 0, .14);
}

.table-row-btn-del {
  color: #b3475a;
}

.table-row-btn-del:hover:not(:disabled) {
  color: var(--tblr-danger, #d63939);
  background: rgba(214, 57, 57, .1);
}

.table-row-btn-invoice {
  width: auto;
  min-width: 42px;
  padding: 0 .45rem;
  border-color: rgba(32, 107, 196, .24);
  background: #eaf3ff;
  color: #1556a6;
  font-size: .72rem;
  font-weight: 600;
}

.table-row-btn-invoice:hover:not(:disabled) {
  border-color: rgba(32, 107, 196, .38);
  background: #dbeafe;
  color: #0f4c9c;
}

.table-row-btn-invoice-done,
.table-row-btn-invoice-done:disabled {
  opacity: 1;
  border-color: rgba(47, 179, 68, .28);
  background: #eaf8ee;
  color: #1f7a34;
  cursor: default;
}


.table-action-sticky-left {
  position: sticky;
  left: 0;
  background: var(--tblr-card-bg, #fff);
  box-shadow: 6px 0 6px -6px rgba(0, 0, 0, .08);
}
th.table-action-sticky-left {
  z-index: 2;
  background: var(--tblr-bg-surface-secondary, #f6f8fb);
}
.table-hover tbody tr:hover td.table-action-sticky-left {
  background: var(--tblr-bg-surface-secondary, #f6f8fb);
}

.table-text-md {
  max-width: 280px;
}

.table-input-xs {
  min-width: 80px;
}

.table-input-sm {
  min-width: 130px;
}

.table-input-code {
  min-width: 110px;
}

.table-input-name {
  min-width: 180px;
}

.order-page .page-body {
  margin-top: 0;
  padding-top: .55rem;
}

.order-compact-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: .45rem;
  min-height: 34px;
  padding: .25rem .75rem;
  border-bottom: 1px solid var(--app-line);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 1px 5px rgba(15, 23, 42, .05);
}

.order-compact-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 24px;
  padding: .08rem .42rem;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  color: #475569;
  background: #f8fafc;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.order-compact-back:hover {
  color: var(--tblr-primary);
  border-color: rgba(29, 95, 209, .35);
  background: rgba(29, 95, 209, .08);
  text-decoration: none;
}

.order-compact-title {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: .35rem;
  color: var(--app-ink);
  font-size: .9rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.order-compact-title::before {
  content: "";
  width: 3px;
  height: 16px;
  border-radius: 3px;
  background: var(--tblr-primary);
}

.order-compact-meta {
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(56vw, 720px);
  overflow: hidden;
  margin-left: .05rem;
  padding-left: .45rem;
  border-left: 1px solid #e2e8f0;
  color: #334155;
  font-size: .8rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.order-compact-sep {
  margin: 0 .35rem;
  color: #cbd5e1;
}

.order-workbench {
  display: grid;
  grid-template-columns: 280px minmax(640px, 1fr) 360px;
  gap: 12px;
  align-items: start;
}

/* 单据工作台：公司改下拉后左栏只剩客户列表，宽度按内容自适应（上限 260px），
   省出的宽度给中间商品明细区 */
.order-page .order-workbench {
  grid-template-columns: fit-content(260px) minmax(640px, 1fr) 360px;
}

.order-page .order-side {
  min-width: 180px;
}

/* 主菜单页头用户名 + 身份徽章保持同行垂直居中；
   覆盖 Tabler 对 .nav-link .badge 的绝对定位（通知角标）规则 */
.navbar-user-display {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.navbar .navbar-nav .nav-link .navbar-user-display .badge {
  position: static;
  transform: none;
}

/* 左栏卡片头：公司下拉 + 客户搜索纵向堆叠、贴边堆满（无左右空隙），
   取消独立公司卡片以显示更多客户 */
.order-side-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
}

.order-side-head .form-select,
.order-side-head .form-control {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.order-side-head .form-select {
  border-bottom: 1px solid var(--tblr-border-color);
}

.order-company-select {
  width: 100%;
  text-overflow: ellipsis;
}

/* 公司卡片合并后左栏省出约 70px 高度，客户列表相应加高 */
.order-page .order-side .order-tree {
  max-height: calc(100vh - 215px);
}

.order-side,
.order-panel {
  min-width: 0;
}

.order-main {
  min-width: 0;
}

.product-page .order-workbench {
  grid-template-columns: 280px minmax(0, 1fr);
}

.order-tree {
  max-height: calc(100vh - 250px);
  overflow: auto;
}

.order-tree-group {
  padding: .45rem .75rem .25rem;
  color: var(--tblr-primary);
  font-weight: 600;
  font-size: .8125rem;
  background: rgba(32, 107, 196, .06);
}

.order-tree-item {
  display: block;
  width: 100%;
  padding: .4rem .75rem;
  border: 0;
  background: transparent;
  text-align: left;
  color: inherit;
}

.order-tree-item:hover {
  background: rgba(0, 0, 0, .035);
}

.order-tree-item.active {
  color: #fff;
  background: var(--tblr-primary);
}

.order-customer-search-row {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem .45rem .25rem .75rem;
}

.order-customer-name-btn {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  padding: .15rem 0;
  background: transparent;
  color: inherit;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-customer-locate-btn {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #64748b;
  transition: background-color .12s, color .12s, border-color .12s;
}

.order-customer-locate-btn:hover {
  background: #eef2f7;
  color: var(--tblr-primary);
}

.order-customer-locate-btn tjt-action-icon,
.order-customer-locate-btn svg {
  width: 14px;
  height: 14px;
}

.order-tree-item.active .order-customer-locate-btn {
  background: rgba(255, 255, 255, .12);
  color: #fff;
}

.order-tree-item-located {
  box-shadow: inset 0 0 0 2px rgba(245, 158, 11, .9);
}

.order-grid td,
.order-grid th {
  vertical-align: middle;
}

.order-grid-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  align-items: start;
  width: 100%;
}

.order-grid-wrap {
  min-width: 0;
  overflow-x: auto;
}

.order-grid {
  width: auto;
  min-width: 0;
  table-layout: auto;
  font-size: .8125rem;
  margin-bottom: 0;
}

.order-grid th,
.order-grid td {
  width: 1%;
  padding: 0;
  border: 1px solid #d5dde8;
  white-space: nowrap;
  text-align: center;
}

.card-table.table.order-grid > :not(caption) > * > * {
  padding: 0;
}

.order-grid th {
  height: 24px;
  background: #f8fafc;
  color: #475569;
  font-weight: 800;
  text-align: center;
}

.order-grid th:nth-child(1),
.order-grid td:nth-child(1) { min-width: 30px; }
.order-grid th:nth-child(2),
.order-grid td:nth-child(2) { min-width: 90px; }
.order-grid th:nth-child(3),
.order-grid td:nth-child(3) { min-width: 150px; }
.order-grid th:nth-child(4),
.order-grid td:nth-child(4) { min-width: 80px; }
.order-grid th:nth-child(5),
.order-grid td:nth-child(5) { min-width: 46px; }
.order-grid th:nth-child(6),
.order-grid td:nth-child(6) { min-width: 92px; }
.order-grid th:nth-child(7),
.order-grid td:nth-child(7) { min-width: 86px; }
.order-grid th:nth-child(8),
.order-grid td:nth-child(8) { min-width: 86px; }
.order-grid th:nth-child(9),
.order-grid td:nth-child(9) { min-width: 96px; }
.order-grid th:nth-child(10),
.order-grid td:nth-child(10) { min-width: 56px; }
.order-grid th:nth-child(11),
.order-grid td:nth-child(11) { min-width: 140px; }
.order-grid th:nth-child(12),
.order-grid td:nth-child(12) { min-width: 130px; }

.order-grid-actions-pane {
  position: relative;
  z-index: 2;
  width: 104px;
  border-left: 1px solid #dbe3ec;
  background: var(--tblr-card-bg, #fff);
}

.order-grid-actions-head {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0;
  border-bottom: 1px solid #d5dde8;
  background: #f8fafc;
  color: #475569;
  font-size: .8125rem;
  font-weight: 800;
}

.order-grid-actions-row {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0;
  border-bottom: 1px solid #d5dde8;
  background: var(--tblr-card-bg, #fff);
}

.order-grid-actions-row:nth-child(odd) {
  background: var(--tblr-bg-surface-secondary, #f6f8fb);
}

.order-grid .form-control-sm,
.order-grid .form-select-sm {
  width: 100%;
  min-width: 0;
  min-height: 29px;
  padding: 0 .2rem;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  box-shadow: none;
  font-size: .8125rem;
  line-height: 29px;
  text-align: center;
}

.order-grid .form-control.form-control-sm,
.order-grid .form-select.form-select-sm {
  min-height: 29px;
  padding: 0 .125rem;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  box-shadow: none;
  line-height: 29px;
}

.order-grid .form-control-sm:focus,
.order-grid .form-select-sm:focus {
  background-color: #fff;
  box-shadow: inset 0 0 0 2px rgba(32, 107, 196, .45);
  outline: 0;
}

.order-grid input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.order-grid input[type="number"]::-webkit-outer-spin-button,
.order-grid input[type="number"]::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.order-grid .form-select-sm {
  padding-right: 1.25rem;
}

.order-grid .form-control-sm.text-end {
  text-align: center !important;
}

.order-grid .table-input-unit {
  padding-right: .25rem;
  background-image: none;
  text-align: center;
  text-align-last: center;
}

.order-grid .table-input-unit option {
  text-align: center;
}

.order-grid .table-input-xs,
.order-grid .table-input-sm,
.order-grid .table-input-code,
.order-grid .table-input-name,
.order-grid .table-input-unit {
  min-width: 0;
}

.order-grid .table-input-xs { width: 100%; }
.order-grid .table-input-sm { width: 100%; }
.order-grid .table-input-code { width: 100%; }
.order-grid .table-input-name { width: 100%; }
.order-grid .table-input-unit { width: 100%; }

.order-grid .order-product-select-btn {
  display: block;
  overflow: hidden;
  padding-right: .35rem;
  padding-left: .35rem;
  border-color: transparent !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: #1f2937 !important;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-grid .order-product-select-btn:hover {
  border-color: #cbd5e1 !important;
  background: #f8fafc !important;
  color: #111827 !important;
  box-shadow: none !important;
}

.order-grid .order-product-select-btn:focus {
  border-color: transparent !important;
  background: transparent !important;
  color: #1f2937 !important;
  box-shadow: none !important;
}

.order-grid .order-product-select-btn:disabled {
  border-color: transparent !important;
  background: transparent !important;
  color: #94a3b8 !important;
  opacity: 1;
}

.order-grid .order-grid-readonly-cell {
  background-color: #eef1f4;
}

.order-grid .order-grid-readonly-cell input[readonly],
.order-grid input[readonly] {
  background-color: #eef1f4;
  color: #6c757d;
  cursor: not-allowed;
}

.order-grid .form-check-input {
  margin-top: 0;
}

.agent-price-lines {
  font-size: .75rem;
  line-height: 1.35;
  white-space: nowrap;
  word-break: keep-all;
}

.agent-price-col {
  min-width: 132px;
}

.order-grid tfoot.order-grid-total td {
  height: 40px;
  padding: .38rem .5rem;
  border-top: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: .875rem;
  vertical-align: middle;
}

.order-grid-total-label {
  color: #1e293b;
  font-weight: 800;
}

.order-grid-total-main {
  color: #0f172a;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.order-grid-total-summary {
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-grid-total-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .5rem .9rem;
  min-height: 28px;
  padding: .16rem .5rem;
  border-top: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: .875rem;
}

.order-total-item {
  display: inline-flex;
  align-items: baseline;
  gap: .15rem;
  margin-right: .75rem;
  color: #475569;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.order-total-item-strong {
  padding: .12rem .45rem;
  border: 1px solid rgba(32, 107, 196, .22);
  border-radius: 4px;
  background: rgba(32, 107, 196, .08);
  color: #0f4a8a;
  font-weight: 800;
}

.order-total-item-strong strong {
  color: #0b3f78;
  font-size: .95rem;
}

.order-total-amount-cn {
  color: #64748b;
  font-weight: 600;
}

.order-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  white-space: nowrap;
}

.order-customer-col {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: nowrap;
  min-width: 0;
}
.order-customer-col > label {
  white-space: nowrap;
  margin-bottom: 0;
}
.order-customer-col > .order-customer-value {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: calc(1.5em + .5rem + 2px);
}

.order-form-row .input-group-text {
  min-width: 96px;
  justify-content: center;
  text-align: center;
  /* input-group-flat 默认左 8px 右 0 的不对称内边距会让文字右偏，改对称才能真正居中 */
  padding-left: .25rem;
  padding-right: .25rem;
  background: var(--tblr-bg-surface-secondary, #f6f8fb);
  color: #475569;
  font-weight: 600;
  white-space: nowrap;
}

/* Tabler 的 .input-group-flat .input-group-text:first-child 会把右内边距压成 0，
   需要同特异性（本文件后加载）覆盖回对称值，否则标签文字右偏不居中 */
.order-form-row .input-group-text:first-child {
  padding-right: .25rem;
}

/* 下拉符号统一靠右边缘对齐 */
.order-form-row .form-select {
  background-position: right .5rem center;
  padding-right: 2rem;
}
.order-form-row .order-field-label {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  line-height: 1;
}
.order-form-row .order-field-label .text-danger {
  line-height: 1;
}
.order-form-row .order-selected-name[readonly] {
  text-align: center;
  font-weight: 700;
  color: #0f172a;
  background: #eef6ff;
  border-color: #60a5fa;
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, .25);
  cursor: default;
}
.order-form-row .input-group-flat > .form-control,
.order-form-row .input-group-flat > .form-select {
  min-width: 0;
}
.order-form-row .input-group-flat > .form-control[readonly] {
  background: #fff;
  color: #1f2d3d;
  font-weight: 500;
  cursor: default;
  text-overflow: ellipsis;
}
.order-form-row .order-locked-field .input-group-text,
.order-form-row .order-locked-field > .form-control[readonly],
.order-form-row .order-locked-field > .form-select:disabled {
  background: #f1f5f9;
  color: #64748b;
  border-color: #cbd5e1;
  box-shadow: none;
  cursor: not-allowed;
}

.order-about-textarea {
  resize: none;
  overflow-y: hidden;
  min-height: calc(1.5em * 3 + .5rem + 2px);
}

.template-source-actions {
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
}
.statement-page .card-actions.template-source-actions {
  gap: .35rem;
}
.template-source-actions .btn {
  min-width: 5.75rem;
}

.template-source-status {
  display: inline-flex;
  align-items: center;
  min-height: calc(1.5em + .25rem + 2px);
  padding: .125rem .45rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #f8fafc;
  color: #475569;
  font-size: .75rem;
  line-height: 1.2;
  white-space: nowrap;
}
.template-source-status-active {
  border-color: rgba(32, 107, 196, .45);
  background: #edf5ff;
  color: #1556a6;
}
.template-source-status-muted {
  border-color: #d8dee9;
  background: #f6f8fb;
  color: #64748b;
}
.template-source-status-dirty {
  border-color: rgba(245, 159, 0, .5);
  background: #fff6df;
  color: #8a5b00;
}
.template-source-status-saved {
  border-color: rgba(47, 179, 68, .45);
  background: #eaf8ee;
  color: #1f7a34;
}
.btn.template-source-active:not(:disabled) {
  color: #fff;
  background: var(--tblr-primary, #206bc4);
  border-color: var(--tblr-primary, #206bc4);
}
.btn.template-source-dirty:not(:disabled) {
  color: #8a5b00;
  background: #fff6df;
  border-color: #f59f00;
}
.btn.template-source-saved:not(:disabled) {
  color: #fff;
  background: var(--tblr-success, #2fb344);
  border-color: var(--tblr-success, #2fb344);
}


.print-config-list .print-config-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: .25rem;
  padding-bottom: .25rem;
}
.print-config-list .print-config-cell-disabled {
  color: #64748b;
  cursor: not-allowed;
}
.print-config-list .print-config-cell-disabled .form-check {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
}
.print-config-list .print-config-cell-disabled .form-check,
.print-config-list .print-config-cell-disabled .form-check-input,
.print-config-list .print-config-cell-disabled .form-check-label {
  cursor: not-allowed;
}
.print-config-list .print-config-cell-disabled .form-check-input {
  opacity: .65;
}
.print-config-list .form-check {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin-bottom: 0;
  padding: .16rem .45rem;
  font-size: .8125rem;
  min-height: 0;
  width: 7.4em;
  text-align: left;
}
.print-config-list .form-check-label {
  display: inline-block;
  max-width: none;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  vertical-align: middle;
}
.print-config-list .form-check-input {
  flex: 0 0 auto;
  float: none;
  margin: 0;
}

.order-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  white-space: nowrap;
}

.order-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
}

.order-action-icon svg {
  width: 15px;
  height: 15px;
}

.order-print-confirm-title {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}

.order-print-confirm-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  color: var(--tblr-primary, #1d5fd1);
  background: rgba(29, 95, 209, .1);
}

.order-print-confirm-icon svg {
  width: 18px;
  height: 18px;
}

.order-row-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #8a94a6;
  cursor: pointer;
  transition: background-color .12s, color .12s, border-color .12s;
}

.order-row-btn svg {
  width: 14px;
  height: 14px;
}

.order-row-btn:hover:not(:disabled) {
  background: #eef2f7;
  color: #1f2d3d;
}

.order-row-btn:active:not(:disabled) {
  background: #e2e8f0;
}

.order-row-btn:disabled {
  opacity: .28;
  cursor: not-allowed;
}

.order-row-btn-pick:hover:not(:disabled) {
  color: var(--tblr-primary, #206bc4);
  background: rgba(32, 107, 196, .1);
}

.order-row-btn-del {
  color: #b3475a;
}

.order-row-btn-del:hover:not(:disabled) {
  color: var(--tblr-danger, #d63939);
  background: rgba(214, 57, 57, .1);
}

.order-history {
  max-height: calc(100vh - 370px);
  overflow-x: hidden;
  overflow-y: auto;
}

.order-history-table {
  width: 100%;
  min-width: 0;
  table-layout: auto;
  font-size: .72rem;
}

.order-history .order-history-table.table > :not(caption) > * > * {
  width: 1%;
  padding: .22rem .14rem !important;
  vertical-align: middle;
  line-height: 1.2;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.order-history .order-history-table.table > :not(caption) > * > *:first-child {
  padding-left: .45rem !important;
}

.order-history-code {
  width: auto;
  font-weight: 600;
}

.order-history-code-text {
  display: inline-block;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.order-history-revision-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.05rem;
  height: 1.05rem;
  margin-left: .25rem;
  padding: 0 .25rem;
  border-radius: 999px;
  background: rgba(245, 159, 0, .14);
  color: #9a6700;
  font-size: .66rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}

.order-history .badge {
  display: inline-flex;
  align-items: center;

.order-history .table-row-btn-invoice {
  width: auto;
  min-width: 46px;
  padding: 0 .45rem;
}

  justify-content: center;
  max-width: 100%;
  min-height: 1.35rem;
  padding: .12rem .32rem;
  font-size: .68rem;
  line-height: 1;
}

.order-history .table-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  width: auto;
  min-width: 52px;
  padding: 0;
}

.order-history .order-history-action-cell {
  overflow: visible;
}

.order-history .table-row-btn {
  width: 24px;
  height: 24px;
  min-width: 24px;
}

/* 单据列表按类型分浅色行底，便于扫读区分 */
.order-row-quote > td { background-color: rgba(32, 201, 151, .065); }
.order-row-statement > td { background-color: rgba(13, 110, 253, .055); }
.order-row-contract > td { background-color: rgba(255, 193, 7, .085); }
.order-row-invoice-summary > td { background-color: rgba(155, 81, 224, .07); }
.order-row-child > td { background-color: rgba(15, 23, 42, .035); }
.table-hover > tbody > tr.order-row-quote:hover > td { background-color: rgba(32, 201, 151, .14); }
.table-hover > tbody > tr.order-row-statement:hover > td { background-color: rgba(13, 110, 253, .12); }
.table-hover > tbody > tr.order-row-contract:hover > td { background-color: rgba(255, 193, 7, .18); }
.table-hover > tbody > tr.order-row-invoice-summary:hover > td { background-color: rgba(155, 81, 224, .15); }
.table-hover > tbody > tr.order-row-child:hover > td { background-color: rgba(15, 23, 42, .07); }

/* 单据级联：日期格内树枝缩进，子单据作为下一行渲染 */
.order-tree-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: calc(var(--tree-depth, 0) * 22px);
}
.order-tree-branch {
  color: #adb5bd;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: .85rem;
  flex-shrink: 0;
}
/* 客户历史窄列下树形缩进收紧，避免和日期/类型挤压 */
.order-history .order-tree-cell {
  gap: 3px;
  padding-left: calc(var(--tree-depth, 0) * 11px);
}
.order-history .order-tree-branch {
  font-size: .68rem;
  line-height: 1;
}
.order-row-inline-refs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: .4rem;
  vertical-align: middle;
}
.order-row-ref-link {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: .76rem;
  font-weight: 500;
  color: #6c757d;
  background: rgba(0, 0, 0, .04);
  text-decoration: none;
}
.order-row-ref-link:hover {
  color: #1f2937;
  background: rgba(0, 0, 0, .08);
  text-decoration: none;
}
.order-row-ref-link.is-voided {
  text-decoration: line-through;
  opacity: .65;
}
.order-row-ref-arrow {
  color: #adb5bd;
  font-size: .7rem;
  margin-right: 1px;
}
.order-row-flash > td {
  animation: orderRowFlash 1.5s ease-out;
}
@keyframes orderRowFlash {
  0% { background-color: rgba(214, 51, 108, .35); }
  100% { background-color: inherit; }
}

/* 跨表 ghost 行：当前过滤集之外的级联引用方（如 active 表里出现已作废的 DZ 子单据） */
tr.is-ghost-row > td {
  color: #adb5bd !important;
  background-color: rgba(0, 0, 0, .015) !important;
}
tr.is-ghost-row > td.fw-medium > span:first-child {
  text-decoration: line-through;
}
tr.is-ghost-row .badge {
  opacity: .6;
}
tr.is-ghost-row .table-row-actions > .table-row-btn:not(.table-row-btn-edit) {
  visibility: hidden;
}
tr.is-ghost-row .table-row-actions .table-row-btn-edit {
  opacity: .85;
}

/* 级联作废/恢复确认弹窗：当前单据 + 关联单据卡片堆 */
.cascade-stack {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.cascade-stack-summary {
  font-size: .92rem;
  color: #495057;
}
.cascade-stack-summary strong {
  color: #d6336c;
  font-size: 1.05rem;
  margin-right: 2px;
}
.cascade-stack-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.cascade-card {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .7rem;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  background: #f8f9fa;
}
.cascade-card.is-current {
  border-color: #d6336c;
  background: #fff5f8;
  box-shadow: 0 0 0 2px rgba(214, 51, 108, .08);
}
.cascade-card-badge {
  flex-shrink: 0;
  font-weight: 600;
}
.cascade-card-code {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-weight: 600;
  color: #1f2937;
  flex: 1;
  word-break: break-all;
}
.cascade-card-tag {
  font-size: .76rem;
  color: #6c757d;
  flex-shrink: 0;
}
.cascade-card.is-current .cascade-card-tag {
  color: #d6336c;
  font-weight: 600;
}
.cascade-arrow {
  display: flex;
  align-items: center;
  gap: .25rem;
  padding: .25rem 0 .25rem .9rem;
  color: #adb5bd;
  font-size: .72rem;
  line-height: 1;
}
.cascade-arrow svg {
  width: 12px;
  height: 12px;
}
.cascade-stack-warn {
  font-size: .8rem;
  color: #b02a37;
  margin-top: .15rem;
}

/* 对账单工作台：左中右三栏 */
.statement-page .order-workbench {
  grid-template-columns: 260px minmax(0, 1fr) 320px;
}
.statement-tab-nav .nav-link {
  cursor: pointer;
  padding: .35rem .75rem;
}
.statement-tab-nav .nav-link.active {
  background: var(--tblr-primary);
  color: #fff;
}
.statement-tab-badge {
  min-width: 1.35rem;
  background: rgba(32, 107, 196, .12);
  color: var(--tblr-primary);
}
.statement-tab-nav .nav-link.active .statement-tab-badge {
  background: #fff;
  color: var(--tblr-primary);
}
.statement-customer-pending {
  font-weight: 600;
}
.statement-customer-line {
  display: flex;
  align-items: center;
  gap: .25rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.statement-customer-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.statement-reminder-date {
  flex: 0 0 auto;
  color: var(--tblr-primary);
  font-size: .75rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.order-tree-item.active .statement-reminder-date {
  color: var(--tblr-primary);
  background: rgba(255, 255, 255, .9);
  padding: .08rem .16rem;
  border-radius: 2px;
}
.statement-date-disabled .input-group-text,
.statement-date-disabled .form-control:disabled {
  background: #eef1f4;
  color: #94a3b8;
  cursor: not-allowed;
}
.statement-meta-period {
  margin-left: .25rem;
}
.statement-candidate-table .statement-candidate-action-col {
  width: 38px;
  min-width: 38px;
  max-width: 38px;
  padding-left: .25rem;
  padding-right: .25rem;
}
.statement-candidate-table .statement-candidate-action-col .table-row-actions {
  min-width: 26px;
  justify-content: center;
  padding: 0;
}
.statement-page .statement-candidate-table tbody tr.statement-order-group-blue > td {
  background: #eef6ff;
}
.statement-page .statement-candidate-table tbody tr.statement-order-group-white > td {
  background: #fff;
}
.statement-page .statement-candidate-table tbody tr.statement-order-group-blue > td.table-action-sticky,
.statement-page .statement-candidate-table tbody tr.statement-order-group-blue > td.table-action-sticky-left {
  background: #eef6ff !important;
}
.statement-page .statement-candidate-table tbody tr.statement-order-group-white > td.table-action-sticky,
.statement-page .statement-candidate-table tbody tr.statement-order-group-white > td.table-action-sticky-left {
  background: #fff !important;
}
.statement-page .statement-candidate-table tbody tr:hover > td {
  background: #e7f1ff;
}
.statement-page .statement-candidate-table tbody tr:hover > td.table-action-sticky,
.statement-page .statement-candidate-table tbody tr:hover > td.table-action-sticky-left {
  background: #e7f1ff !important;
}

.statement-mode-choice {
  display: grid;
  gap: .75rem;
}

.statement-mode-choice-item {
  padding: .75rem;
  border: 1px solid rgba(98, 105, 118, .18);
  border-radius: 6px;
  background: #f8fafc;
}

@media (max-width: 1280px) {
  .statement-page .order-workbench {
    grid-template-columns: 240px minmax(0, 1fr);
  }
  .statement-page .order-workbench > .order-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767.98px) {
  .statement-page .order-workbench {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .statement-page .order-side,
  .statement-page .order-panel {
    grid-column: 1 / -1;
  }
  .statement-page .order-tree {
    max-height: 220px;
  }
  .statement-tab-nav {
    flex-wrap: wrap;
    gap: 4px;
  }
  .statement-tab-nav .nav-link {
    padding: .3rem .55rem;
    font-size: .8125rem;
  }
  .statement-page .card-header,
  .statement-page .card-actions {
    flex-wrap: wrap;
    gap: 4px;
  }
  .statement-page .row.g-2 > [class^="col-"],
  .statement-page .row.g-2 > .col-auto,
  .statement-page .row.g-2 > .col {
    flex: 0 0 100%;
    max-width: 100%;
  }
  .statement-page .order-grid-total-bar {
    flex-wrap: wrap;
    gap: 4px;
  }
  .statement-page .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .statement-page .statement-about-textarea {
    min-height: 80px;
  }
}

.order-history .table-row-btn svg {
  width: 14px;
  height: 14px;
}

.order-print-mode-actions {
  align-items: center;
  gap: 6px;
}

.order-print-mode-btn {
  min-width: 58px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid #6b7280;
  border-radius: 5px;
  background: #fff;
  color: #4b5563;
  line-height: 30px;
  box-shadow: none;
}

.order-print-mode-btn:hover {
  border-color: var(--tblr-primary, #206bc4);
  color: var(--tblr-primary, #206bc4);
  background: #fff;
}

.order-print-mode-btn.is-active {
  border-color: var(--tblr-primary, #206bc4);
  background: var(--tblr-primary, #206bc4);
  color: #fff;
  box-shadow: none;
}

#price-picker-modal .modal-content {
  height: min(760px, calc(100vh - 3.5rem));
}

#price-picker-modal .modal-body {
  min-height: 0;
  overflow: hidden;
}

#price-picker-modal .modal-footer {
  flex: 0 0 auto;
}

.order-picker-table {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
}

/* 货品选择弹窗：≥ 1200px 时把 modal-xl 默认 1140px 拓宽到 95vw（最大 1500px）以容纳所有列 */
@media (min-width: 1200px) {
  .price-picker-dialog { max-width: min(1500px, 95vw); }
}

/* 货品选择表格：桌面端列宽自适应 + 关键列 nowrap，长文本可换行；操作列 sticky right。
   < 768px 整表强制 nowrap 加滚动条，避免列被挤到难以点击。 */
.order-picker-table-grid { width: 100%; table-layout: auto; }
.order-picker-table-grid th,
.order-picker-table-grid td { white-space: normal; word-break: break-word; vertical-align: middle; }
.order-picker-table-grid .row-drag-handle,
.order-picker-table-grid .price-pin-cell { width: 36px; white-space: nowrap; }
.order-picker-table-grid th:nth-child(2),
.order-picker-table-grid td:nth-child(2) { width: 28px; white-space: nowrap; }
.order-picker-table-grid th:nth-child(3),
.order-picker-table-grid td:nth-child(3) { white-space: nowrap; }
.order-picker-table-grid th:nth-child(7),
.order-picker-table-grid td:nth-child(7) { white-space: nowrap; }
.order-picker-table-grid th:nth-child(8),
.order-picker-table-grid td:nth-child(8),
.order-picker-table-grid th:nth-child(10),
.order-picker-table-grid td:nth-child(10) { white-space: nowrap; }
.order-picker-table-grid th:last-child,
.order-picker-table-grid td:last-child {
  position: sticky;
  right: 0;
  background: #fff;
  white-space: nowrap;
  width: 56px;
  box-shadow: -4px 0 6px -4px rgba(0,0,0,.08);
}
.order-picker-table-grid thead th:last-child { background: #fbfcfd; z-index: 2; }
.order-picker-table-grid.table-hover tbody tr:hover td:last-child { background: var(--tblr-table-hover-bg, #f4f6fa); }

@media (max-width: 767.98px) {
  .order-picker-table-grid { white-space: nowrap; }
  .order-picker-table-grid th,
  .order-picker-table-grid td { white-space: nowrap; }
}

.order-picker-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 12px;
  height: 100%;
  min-height: 0;
}

.order-picker-categories {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding-right: 4px;
  border-right: 1px solid var(--tblr-border-color, #dce1e7);
}

.order-picker-category {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 32px;
  padding: 5px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--tblr-body-color, #1f2937);
  text-align: left;
  font-size: .875rem;
  line-height: 1.2;
}

.order-picker-category:hover {
  background: var(--tblr-bg-surface-secondary, #f6f8fb);
}

.order-picker-category.active {
  background: var(--tblr-primary-lt, #e9f2fc);
  color: var(--tblr-primary, #206bc4);
  font-weight: 600;
}

.order-picker-products {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.order-picker-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

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

.product-category-panel {
  position: sticky;
  top: 12px;
  min-width: 0;
  max-height: calc(100vh - 180px);
  padding: 10px;
  overflow: hidden;
  border: 1px solid var(--tblr-border-color, #dce1e7);
  border-radius: 6px;
  background: var(--tblr-bg-surface, #fff);
}

.product-category-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: .875rem;
  font-weight: 600;
}

.product-category-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: calc(100vh - 240px);
  overflow: auto;
}

.product-table-panel {
  min-width: 0;
}

.tjt-form-modal-body {
  background: #f8fafc;
}

.tjt-form-panel {
  background: #fff;
  border: 1px solid var(--tblr-border-color, #dce1e7);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.product-category-editor {
  max-width: none;
}

.product-category-modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 16px;
  align-items: start;
}

.product-category-modal-left {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-category-modal-left .tjt-form-panel {
  margin-bottom: 0;
  padding: 12px 14px;
}

.product-category-modal-left .tjt-form-section-title {
  margin-bottom: 6px;
}

.product-category-modal-left .product-code-preview {
  margin-top: 4px;
}

.product-category-modal-left .product-code-rule {
  grid-template-columns: 130px 110px 76px;
  gap: 8px;
}

.product-category-modal-left .product-unit-default-row {
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) auto;
  gap: 8px;
}

.product-category-modal-left .product-conversion-table {
  min-width: 0;
}

.product-category-modal-left .product-conversion-table thead {
  display: none;
}

.product-category-modal-left .product-conversion-table td {
  padding-top: 4px;
  padding-bottom: 4px;
  border-top: none;
}

.product-category-modal-left .product-category-conversion-list {
  margin-top: 8px;
  max-width: none;
}

.product-category-modal-left .product-unit-equation-row {
  grid-template-columns: auto minmax(96px, 1fr) auto minmax(80px, 1fr) minmax(40px, auto) auto;
  gap: 6px;
  width: 100%;
}

.product-category-modal-right {
  min-width: 0;
}

.product-category-modal-right .product-category-table-wrap {
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  overflow-x: hidden;
}

.product-category-modal-right .product-category-table-wrap .table {
  font-size: 13px;
  white-space: normal;
  table-layout: fixed;
  width: 100%;
}

.product-category-modal-right .product-category-table-wrap th,
.product-category-modal-right .product-category-table-wrap td {
  padding: .35rem .45rem;
  vertical-align: middle;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.product-category-modal-right .product-category-table-wrap col.col-drag { width: 40px; }
.product-category-modal-right .product-category-table-wrap col.col-name { width: auto; }
.product-category-modal-right .product-category-table-wrap col.col-global { width: 48px; }
.product-category-modal-right .product-category-table-wrap col.col-prefix { width: 56px; }
.product-category-modal-right .product-category-table-wrap col.col-conv { width: auto; }
.product-category-modal-right .product-category-table-wrap col.col-seq { width: 56px; }
.product-category-modal-right .product-category-table-wrap col.col-act { width: 64px; }

#product-category-modal .modal-dialog {
  max-width: min(1320px, calc(100vw - 32px));
}

@media (max-width: 1100px) {
  .product-category-modal-grid {
    grid-template-columns: 1fr;
  }
  .product-category-modal-right .product-category-table-wrap {
    max-height: none;
  }
}

.product-category-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
}

.product-category-section-head > :first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.product-category-section-head > .btn,
.product-category-section-head > .d-flex {
  flex: 0 0 auto;
}

.product-global-conversion-panel {
  background: #f8fbff;
  border-color: #c9dcfb;
}

.product-global-conversion-panel .product-conversion-table {
  background: transparent;
}

.product-customer-conversion-panel {
  background: #fff8f1;
  border-color: #f3d6b2;
}

.product-customer-conversion-panel .product-conversion-table {
  background: transparent;
}

.tjt-form-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 10px;
}

.tjt-form-panel .form-label {
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

.product-category-form-section + .product-category-form-section {
  margin-top: 16px;
}

.product-category-name-row,
.product-unit-default-row {
  display: grid;
  grid-template-columns: 280px auto;
  gap: 12px;
  align-items: end;
  justify-content: start;
}

.product-unit-default-row {
  grid-template-columns: 180px 180px auto;
}

.product-category-name-field,
.product-unit-field {
  display: block;
  margin: 0;
}

.product-code-rule {
  display: grid;
  grid-template-columns: 160px 120px 84px;
  gap: 10px;
  width: max-content;
  max-width: 100%;
}

.product-code-rule label {
  margin: 0;
}

.product-code-rule span {
  display: block;
  margin-bottom: 4px;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.product-code-preview {
  margin-top: 6px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
}

.product-code-preview strong {
  color: #1e293b;
  font-weight: 600;
  white-space: normal;
}

.product-category-save-btn {
  min-width: 88px;
}

.product-category-conversion-list {
  margin-top: 12px;
  max-width: 620px;
}

.product-conversion-table {
  width: auto;
  min-width: 500px;
  margin-bottom: 0;
}

.product-conversion-table th {
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.product-conversion-table td,
.product-conversion-table th {
  padding-left: 8px;
  padding-right: 8px;
}

.product-unit-panel {
  padding: 12px;
  margin-bottom: 0;
}

.product-unit-equation-row {
  display: grid;
  grid-template-columns: auto 128px auto 112px minmax(56px, auto) 72px;
  gap: 8px;
  align-items: center;
  width: max-content;
  max-width: 100%;
}

.product-unit-equation-text,
.product-unit-equation-unit {
  color: #475569;
  font-weight: 600;
  white-space: nowrap;
}

.product-unit-equation-text {
  font-size: 16px;
}

.product-unit-equation-unit {
  min-width: 56px;
}

.product-unit-equation-row + .product-unit-equation-row {
  margin-top: 8px;
}

.product-category-table-wrap {
  background: #fff;
  border: 1px solid var(--tblr-border-color, #dce1e7);
  border-radius: 8px;
}

.product-category-table-wrap .table {
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .product-category-name-row,
  .product-unit-default-row {
    grid-template-columns: 1fr;
  }

  .product-code-rule {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .product-unit-equation-row {
    grid-template-columns: auto minmax(96px, 1fr) auto minmax(96px, 1fr) minmax(48px, auto);
  }

  .product-unit-equation-row .btn {
    grid-column: 1 / -1;
  }
}

.product-page .product-table-panel .table-action-sticky {
  width: 1% !important;
  min-width: 0;
  max-width: 64px;
  padding-left: .25rem;
  padding-right: .25rem;
  white-space: nowrap;
}

.product-page .product-table-panel .table-row-actions {
  width: auto;
  min-width: 52px;
  gap: 4px;
  padding: 0;
}

.print-preview-modal-body {
  overflow: auto;
  background: #f3f4f6;
}

.order-print-tabs {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: .35rem;
  margin: -.75rem -.75rem .75rem;
  padding: .55rem .75rem;
  background: #fff;
  border-bottom: 1px solid rgba(4, 32, 69, .1);
}

.order-print-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  margin: -.5rem -.75rem .75rem;
  padding: .45rem .85rem;
  background: rgba(255, 244, 199, .55);
  border-bottom: 1px solid rgba(255, 193, 7, .35);
  font-size: .8rem;
  color: #4b5563;
}
.order-print-meta-item {
  display: inline-flex;
  align-items: baseline;
  gap: .35rem;
  white-space: nowrap;
}
.order-print-meta-label {
  color: #6b7280;
  font-size: .72rem;
}
.order-print-meta-value {
  color: #1f2937;
  font-weight: 600;
}

.order-print-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: .25rem .75rem;
  border: 1px solid transparent;
  border-radius: .35rem;
  background: transparent;
  color: #4b5563;
  font-size: .875rem;
  line-height: 1.2;
}

.order-print-tab:hover,
.order-print-tab.active {
  border-color: rgba(32, 107, 196, .18);
  background: rgba(32, 107, 196, .08);
  color: var(--tblr-primary, #206bc4);
}

.order-revision-panel {
  max-width: 1180px;
  margin: 0 auto;
}

.order-source-panel {
  max-width: 1180px;
  margin: 0 auto;
}

.order-source-groups {
  display: grid;
  gap: .75rem;
}

.order-source-group {
  background: #fff;
  border: 1px solid rgba(4, 32, 69, .08);
}

.order-source-group-head {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) minmax(120px, .8fr) minmax(80px, .5fr) minmax(90px, .5fr) minmax(110px, .6fr) minmax(90px, .5fr);
  gap: .65rem;
  padding: .65rem .75rem;
  border-bottom: 1px solid rgba(4, 32, 69, .08);
}

.order-source-group-head strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.order-source-table {
  margin-bottom: 0;
  background: #fff;
}

@media (max-width: 768px) {
  .order-source-group-head {
    grid-template-columns: 1fr 1fr;
  }
}


.order-revision-table {
  background: #fff;
  border: 1px solid rgba(4, 32, 69, .08);
}

.order-revision-row-cell {
  padding: .65rem .75rem !important;
  background: #fff;
}

.order-revision-summary-grid {
  display: grid;
  grid-template-columns: .35fr 1.35fr .8fr 1.3fr .8fr .8fr .8fr .65fr auto;
  gap: .5rem .75rem;
  align-items: center;
}

.order-revision-label {
  display: block;
  margin-bottom: .12rem;
  color: #6b7280;
  font-size: .72rem;
  line-height: 1.1;
  font-weight: 400;
}

.order-revision-detail-cell {
  margin-top: .65rem;
  padding: .55rem;
  background: #f8fafc;
  border: 1px solid rgba(4, 32, 69, .08);
  border-radius: .35rem;
}

.order-revision-detail-table {
  margin-bottom: 0;
  background: #fff;
}

@media (max-width: 991.98px) {
  .order-revision-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .order-revision-summary-grid .text-end {
    text-align: left !important;
  }
}

#order-print-root {
  display: none;
}

/* 导出 PDF 时离屏渲染分页报表的 iframe，须保持已渲染布局供 html2canvas 截图，故用屏外定位而非 display:none */
.tjt-pdf-render-frame {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 900px;
  height: 1400px;
  border: 0;
  background: #fff;
  pointer-events: none;
}

.print-window {
  margin: 0;
  padding: 0;
  background: #fff;
}

.print-window #order-print-root {
  display: block;
}

.print-window .print-sheet {
  margin: 0;
  box-shadow: none;
}

.print-pagination-measure {
  position: absolute;
  top: 0;
  left: -10000px;
  width: 210mm;
  visibility: hidden;
  pointer-events: none;
}

.print-sheet-paginated {
  position: relative;
  height: 296mm;
  min-height: 296mm;
  overflow: hidden;
}

.print-sheet-continued {
  padding-top: 7mm;
}

.print-page-mark {
  position: absolute;
  right: 14mm;
  bottom: 4mm;
  color: #6b7280;
  font-size: 8pt;
}

body.print-window.paged-report {
  background: #fff !important;
}

body.print-window.paged-report #order-print-root {
  display: block !important;
  width: auto;
}

body.print-window.paged-report.paged-report-ready > #order-print-root {
  display: none !important;
}

body.print-window.paged-report .print-sheet-quote,
body.print-window.paged-report .print-sheet-statement,
body.print-window.paged-report .print-sheet-contract,
body.print-window.paged-report .print-sheet-delivery {
  width: auto;
  height: auto;
  min-height: 0;
  padding: 0;
  overflow: visible;
  box-shadow: none;
}

body.print-window.paged-report .print-quote-sign {
  break-inside: avoid;
  page-break-inside: avoid;
  margin-top: 8mm;
}

.print-report-tail {
  break-inside: avoid;
  page-break-inside: avoid;
}

.pagedjs_page {
  background: #fff !important;
}

.pagedjs_sheet,
.pagedjs_pagebox,
.pagedjs_area,
.pagedjs_pages {
  background: #fff !important;
}

.pagedjs_bleed,
.pagedjs_marks-crop,
.pagedjs_marks-middle,
.pagedjs_marks-cross {
  display: none !important;
}

.pagedjs_page .print-table thead {
  display: table-header-group;
}

.print-window .print-sheet-delivery {
  height: 148.5mm;
  min-height: 148.5mm;
  overflow: visible;
}

.print-sheet {
  margin: 0 auto;
  background: #fff;
  color: #000;
  box-shadow: 0 .25rem 1.25rem rgba(0, 0, 0, .12);
  font-family: "Microsoft YaHei", SimSun, serif;
  box-sizing: border-box;
  position: relative;
}

.print-sheet *,
.print-sheet *::before,
.print-sheet *::after {
  box-sizing: border-box;
}

.print-sheet-delivery {
  page: delivery-page;
  width: 210mm;
  height: 148.5mm;
  min-height: 148.5mm;
  padding: 5mm 14mm 4mm;
  position: relative;
  font-size: 9.5pt;
  font-family: SimSun, "Microsoft YaHei", serif;
}

.print-delivery-head {
  display: grid;
  grid-template-columns: 1fr 55mm;
  gap: 5mm;
  min-height: 14mm;
  align-items: start;
  position: relative;
}

.print-company-block {
  display: grid;
  grid-template-columns: 18mm 1fr;
  grid-template-rows: auto auto;
  column-gap: 2.5mm;
  align-items: center;
}

.print-logo {
  grid-row: 1 / span 2;
  display: block;
  width: 14mm !important;
  height: 12mm !important;
  max-width: 14mm !important;
  max-height: 12mm !important;
  object-fit: contain;
  overflow: hidden;
}

.print-company-name {
  font-size: 14pt;
  font-weight: 700;
  line-height: 1.1;
  font-family: "Microsoft YaHei", SimHei, sans-serif;
}

.print-company-info {
  margin-top: .3mm;
  line-height: 1.2;
}

.print-title-block {
  text-align: center;
  padding-top: 0;
}

.print-report-title {
  text-align: center;
  font-size: 22pt;
  font-weight: 700;
  line-height: 1.05;
  font-family: SimHei, "Microsoft YaHei", sans-serif;
}

.print-report-code {
  text-align: center;
  color: #d00;
  font-weight: 700;
  font-family: SimSun, serif;
  font-size: 10.5pt;
  line-height: 1.25;
}

.print-void-mark {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(-22deg);
  font-size: 96pt;
  font-weight: 900;
  color: rgba(220, 38, 38, .22);
  letter-spacing: 12pt;
  font-family: SimHei, "Microsoft YaHei", sans-serif;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  z-index: 10;
  text-shadow: 0 0 1pt rgba(220, 38, 38, .12);
}

.print-meta-grid {
  display: grid;
  grid-template-columns: 1fr 55mm;
  gap: .6mm 4mm;
  margin: 0 8mm .5mm 0;
  line-height: 1.2;
  font-size: 9.5pt;
}

.print-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.print-table th,
.print-table td {
  border: .25pt solid #000;
  padding: .8mm 1.5mm;
  vertical-align: middle;
  word-break: break-word;
  text-align: center !important;
}

.print-table th {
  font-weight: 700;
}

.print-table thead {
  display: table-header-group;
}

.print-table tr {
  break-inside: avoid;
  page-break-inside: avoid;
}

.print-delivery-table {
  width: 100%;
  margin-right: 0;
  font-size: 10pt;
}

.print-delivery-table thead th {
  height: 6.2mm;
  font-size: 11pt;
  font-family: "Microsoft YaHei", SimHei, sans-serif;
}

.print-delivery-table tbody td {
  height: 6.4mm;
  font-size: 10pt;
}

.print-delivery-table tfoot td {
  height: 6.2mm;
  font-size: 10.5pt;
}

.print-delivery-table tfoot td:last-child {
  font-weight: 700;
  font-family: "Microsoft YaHei", SimHei, sans-serif;
}

.print-table tfoot td.print-footer-merged {
  padding: 1.6mm 2.4mm;
}
.print-footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4mm;
  flex-wrap: wrap;
}
.print-footer-grid > span {
  white-space: nowrap;
}
.print-footer-grid > .print-footer-total {
  font-weight: 700;
  font-family: "Microsoft YaHei", SimHei, sans-serif;
}

.print-delivery-footer {
  margin-top: 1mm;
  position: static;
  line-height: 1.18;
  font-size: 9.5pt;
}

.print-maker {
  margin-bottom: .8mm;
}

.print-sign-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18mm;
  padding: 0 13mm;
  font-size: 10pt;
}

.print-sign-title {
  font-weight: 700;
  text-align: left;
  padding-left: 9mm;
}

.print-sign-line {
  font-weight: 700;
}

.print-about {
  margin-top: 1.2mm;
  min-height: 0;
  line-height: 1.18;
  font-size: 9pt;
}

.print-sheet-contract {
  page: contract-page;
  width: 210mm;
  min-height: 297mm;
  padding: 12mm 12mm;
  overflow: hidden;
  color: #111827;
  font-family: "Microsoft YaHei", SimSun, serif;
  font-size: 9.6pt;
}

.print-contract-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58mm;
  gap: 8mm;
  align-items: start;
  padding-bottom: 4mm;
  border-bottom: 1.2pt solid #111827;
}

.print-contract-party-label {
  color: #6b7280;
  font-size: 9pt;
}

.print-contract-party-name {
  margin-top: 1mm;
  font-size: 15pt;
  font-weight: 700;
  line-height: 1.22;
}

.print-contract-party-info {
  display: flex;
  flex-wrap: wrap;
  gap: .35mm 2mm;
  margin-top: 1.5mm;
  color: #374151;
  font-size: 8.4pt;
  line-height: 1.28;
}

.print-contract-party-info span {
  white-space: nowrap;
}

.print-contract-title-block {
  text-align: right;
}

.print-contract-title {
  margin: 0;
  font-size: 22pt;
  line-height: 1.08;
  font-weight: 700;
}

.print-contract-code {
  margin-top: 1.6mm;
  color: #991b1b;
  font-size: 10pt;
  font-weight: 700;
}

.print-contract-date {
  margin-top: .8mm;
  color: #4b5563;
  font-size: 8.8pt;
}

.print-contract-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5mm 8mm;
  margin: 4mm 0 3.5mm;
}

.print-contract-parties div {
  display: grid;
  grid-template-columns: 18mm minmax(0, 1fr);
  gap: 2.5mm;
  min-height: 6.2mm;
  align-items: center;
  border-bottom: .25pt solid #d1d5db;
}

.print-contract-parties span {
  color: #6b7280;
}

.print-contract-parties strong {
  font-weight: 600;
  color: #111827;
  word-break: break-word;
}

.print-contract-parties .print-contract-party-wide {
  grid-column: 1 / -1;
}

.print-contract-section {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 1.5mm;
  font-size: 10.2pt;
  font-weight: 700;
}

.print-contract-section span {
  color: #4b5563;
  font-size: 8.8pt;
  font-weight: 400;
}

.print-contract-table {
  font-size: 8.8pt;
  table-layout: fixed;
  width: 100%;
  max-width: 100%;
}

.print-contract-table th,
.print-contract-table td {
  border-color: #6b7280;
  padding: .9mm .75mm;
  line-height: 1.25;
  text-align: center !important;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.print-contract-table th {
  background: #f3f4f6;
  color: #111827;
  font-weight: 700;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

.print-contract-table th:nth-child(4),
.print-contract-table td:nth-child(4),
.print-contract-table th:nth-child(5),
.print-contract-table td:nth-child(5),
.print-contract-table th:nth-child(6),
.print-contract-table td:nth-child(6),
.print-contract-table th:nth-child(7),
.print-contract-table td:nth-child(7),
.print-contract-table th:nth-child(8),
.print-contract-table td:nth-child(8),
.print-contract-table th:nth-child(9),
.print-contract-table td:nth-child(9) {
  white-space: nowrap;
}

.print-contract-terms {
  margin-top: 3.5mm;
  color: #374151;
  line-height: 1.5;
  font-size: 9pt;
}

.print-contract-sign {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16mm;
  margin-top: 12mm;
  line-height: 1.8;
  font-size: 9.2pt;
}

.print-contract-sign p {
  margin: 0;
}

.print-sheet-quote {
  page: contract-page;
  width: 210mm;
  min-height: 297mm;
  padding: 15mm 14mm;
  overflow: hidden;
  background: #fff !important;
  background-image: none !important;
  color: #111827;
  font-family: "Microsoft YaHei", SimSun, serif;
  font-size: 9.8pt;
}

.print-sheet-statement {
  page: statement-page;
  width: 210mm;
  min-height: 297mm;
  padding: 15mm 14mm;
  overflow: hidden;
  background: #fff !important;
  background-image: none !important;
  color: #111827;
  font-family: "Microsoft YaHei", SimSun, serif;
  font-size: 9.8pt;
}

.print-sheet-quote img,
.print-sheet-statement img {
  display: none !important;
}

.print-quote-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52mm;
  gap: 10mm;
  align-items: start;
  padding-bottom: 5mm;
  border-bottom: 1.2pt solid #111827;
}

.print-quote-company {
  font-size: 16pt;
  font-weight: 700;
  line-height: 1.25;
}

.print-quote-company-info {
  display: flex;
  flex-wrap: wrap;
  gap: .4mm 2.5mm;
  margin-top: 2mm;
  color: #374151;
  line-height: 1.35;
  font-size: 8.5pt;
}

.print-quote-company-info span {
  white-space: nowrap;
}

.print-quote-title-block {
  text-align: right;
}

.print-quote-title {
  margin: 0;
  font-size: 24pt;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: 0;
}

.print-quote-code {
  margin-top: 2mm;
  color: #991b1b;
  font-size: 11pt;
  font-weight: 700;
}

.print-quote-meta {
  display: grid;
  grid-template-columns: 1fr 52mm;
  gap: 2mm 10mm;
  margin: 6mm 0 5mm;
}

.print-quote-meta div {
  display: grid;
  grid-template-columns: 18mm minmax(0, 1fr);
  gap: 3mm;
  min-height: 7mm;
  align-items: center;
  border-bottom: .25pt solid #d1d5db;
}

.print-quote-meta span {
  color: #6b7280;
}

.print-quote-meta strong {
  font-weight: 600;
  color: #111827;
  word-break: break-word;
}

.print-quote-section {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 2mm;
  font-size: 10.5pt;
  font-weight: 700;
}

.print-quote-section span {
  color: #4b5563;
  font-size: 9pt;
  font-weight: 400;
}

.print-quote-table {
  font-size: 9.3pt;
  table-layout: fixed;
}

.print-quote-table th,
.print-quote-table td {
  border-color: #6b7280;
  padding: 1.5mm 1.6mm;
  line-height: 1.35;
  text-align: center !important;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.print-quote-table th {
  background: #f3f4f6;
  color: #111827;
  font-weight: 700;
  text-align: center !important;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

.print-quote-table td:nth-child(1),
.print-quote-table td:nth-child(5),
.print-quote-table th:nth-child(1),
.print-quote-table th:nth-child(5) {
  text-align: center !important;
}

.print-quote-table th:nth-child(2),
.print-quote-table td:nth-child(2),
.print-quote-table th:nth-child(5),
.print-quote-table td:nth-child(5),
.print-quote-table th:nth-child(6),
.print-quote-table td:nth-child(6),
.print-quote-table th:nth-child(7),
.print-quote-table td:nth-child(7) {
  white-space: nowrap;
}

.print-quote-note {
  margin-top: 5mm;
  color: #374151;
  line-height: 1.6;
  break-inside: avoid;
  page-break-inside: avoid;
}

.print-quote-note p {
  margin: 0 0 1.2mm;
}

.print-quote-sign {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18mm;
  margin-top: 28mm;
  line-height: 2.1;
}

.print-quote-sign p {
  margin: 0;
}

.print-statement-meta {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.print-statement-table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
  font-size: 9pt;
}

.print-statement-table th,
.print-statement-table td {
  border-color: #6b7280;
  min-width: 0 !important;
  max-width: none !important;
  padding: 1.35mm 1.1mm;
  line-height: 1.35;
  text-align: center !important;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.print-statement-table th {
  background: #f3f4f6;
  color: #111827;
  font-weight: 700;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

.print-statement-table tfoot td {
  background: #f9fafb;
  color: #111827;
  font-weight: 700;
}

.print-statement-table thead th:nth-child(1),
.print-statement-table tbody td:nth-child(1),
.print-statement-table thead th:nth-child(2),
.print-statement-table tbody td:nth-child(2),
.print-statement-table thead th:nth-child(3),
.print-statement-table tbody td:nth-child(3),
.print-statement-table thead th:nth-child(6),
.print-statement-table tbody td:nth-child(6),
.print-statement-table thead th:nth-child(7),
.print-statement-table tbody td:nth-child(7),
.print-statement-table thead th:nth-child(8),
.print-statement-table tbody td:nth-child(8) {
  white-space: nowrap;
}

.print-statement-table-hidden-price thead th:nth-child(5),
.print-statement-table-hidden-price tbody td:nth-child(5) {
  white-space: nowrap;
}

.print-report-table th,
.print-report-table td,
.print-statement-table th,
.print-statement-table td {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
}

.print-statement-table td {
  white-space: normal !important;
}

.print-statement-table th,
.print-statement-table tbody td:nth-child(1),
.print-statement-table tbody td:nth-child(2),
.print-statement-table tbody td:nth-child(3),
.print-statement-table tbody td:nth-child(5),
.print-statement-table tbody td:nth-child(6),
.print-statement-table tbody td:nth-child(7) {
  white-space: nowrap !important;
}

@media (max-width: 1199.98px) {
  .order-workbench {
    grid-template-columns: 1fr;
  }

  /* .order-page .order-workbench 基础规则特异性更高，小屏必须同特异性覆盖回单列 */
  .order-page .order-workbench {
    grid-template-columns: 1fr;
  }

  .product-page .order-workbench {
    grid-template-columns: 1fr;
  }

  .order-grid {
    min-width: 0;
  }

  .order-tree,
  .order-history {
    max-height: 360px;
  }
}

@media (max-width: 767.98px) {
  .page-body > .container-xl,
  .page-body > .container-fluid {
    padding-right: .5rem;
    padding-left: .5rem;
  }

  .card-table.table > :not(caption) > * > * {
    padding: .28rem .32rem;
    font-size: .8125rem;
  }

  th.row-drag-handle,
  td.row-drag-handle,
  th.table-drag-col,
  td.table-drag-col {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
  }

  .row-drag-grip {
    min-height: 38px;
  }

  .order-picker-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
  }

  .order-picker-categories {
    flex-direction: row;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding-right: 0;
    padding-bottom: 4px;
    border-right: 0;
    border-bottom: 1px solid var(--tblr-border-color, #dce1e7);
  }

  .order-picker-category {
    width: auto;
    min-width: 120px;
  }

  .order-picker-toolbar {
    align-items: stretch;
    gap: 8px;
  }

  .product-content-layout {
    grid-template-columns: 1fr;
  }

  .product-category-panel {
    position: static;
    max-height: none;
  }

  .product-category-list {
    flex-direction: row;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
  }

  .product-category-list .order-picker-category {
    width: auto;
    min-width: 120px;
  }

  .table-row-btn {
    width: 30px;
    height: 30px;
  }

  .table-row-btn svg {
    width: 15px;
    height: 15px;
  }

  .customer-layout {
    --tblr-gutter-x: .5rem;
    --tblr-gutter-y: .5rem;
  }

  .customer-tree-card {
    position: static;
    max-height: 220px;
  }

  .customer-table {
    font-size: .8125rem;
  }

  .customer-table th,
  .customer-table td {
    padding-right: .2rem !important;
    padding-left: .2rem !important;
  }

  .customer-mobile-status {
    display: block;
  }

  .customer-name {
    font-size: .875rem;
  }

  .customer-address,
  .customer-contact {
    font-size: .75rem;
  }

  .customer-table .badges-list {
    gap: 1px;
  }

  .customer-table .badge {
    padding: .1rem .24rem;
    font-size: .68rem;
  }

}

@media print {
  html,
  body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  body.printing-report > :not(#order-print-root) {
    display: none !important;
  }

  body.printing-report #order-print-root {
    display: block !important;
    width: 100%;
  }

  body.printing-report .print-sheet {
    margin: 0;
    box-shadow: none;
  }

body.printing-report .print-sheet-delivery {
  width: 210mm;
  height: 148.5mm;
  min-height: 148.5mm;
  overflow: visible;
}

body.print-window .print-sheet-delivery {
  width: 210mm;
  height: 148.5mm;
  min-height: 148.5mm;
  overflow: visible;
}

  body.printing-report .print-sheet-contract,
  body.print-window .print-sheet-contract {
    width: 210mm;
    min-height: 297mm;
    box-shadow: none;
  }

  body.printing-report .print-sheet-quote,
  body.print-window .print-sheet-quote,
  body.printing-report .print-sheet-statement,
  body.print-window .print-sheet-statement {
    width: 210mm;
    min-height: 297mm;
    box-shadow: none;
  }

  body.print-window.paged-report > #order-print-root {
    display: none !important;
  }

  body.print-window.paged-report .pagedjs_pages {
    display: block !important;
    background: #fff !important;
  }

  body.print-window.paged-report .pagedjs_page,
  body.print-window.paged-report .pagedjs_sheet,
  body.print-window.paged-report .pagedjs_pagebox,
  body.print-window.paged-report .pagedjs_area {
    background: #fff !important;
  }

  body.print-window.paged-report .pagedjs_bleed,
  body.print-window.paged-report .pagedjs_marks-crop,
  body.print-window.paged-report .pagedjs_marks-middle,
  body.print-window.paged-report .pagedjs_marks-cross {
    display: none !important;
  }

body.print-window.paged-report .print-sheet-contract,
body.print-window.paged-report .print-sheet-quote,
body.print-window.paged-report .print-sheet-statement {
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
    background: #fff !important;
  box-shadow: none !important;
}

body.print-window.paged-report .print-sheet-delivery {
  width: auto !important;
  height: 148.5mm !important;
  min-height: 148.5mm !important;
  padding: 0 !important;
  overflow: visible !important;
  background: #fff !important;
  box-shadow: none !important;
}

  body.printing-report .print-preview-modal-body {
    padding: 0 !important;
    background: #fff;
  }

  body.print-window #order-print-root {
    display: block !important;
    width: 100%;
  }
}

/* 商品批量修改模式 */
.bulk-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--tblr-primary-lt, #e9f2fc);
  border-bottom: 1px solid var(--tblr-border-color, #e6e7e9);
}
.bulk-toolbar .form-check {
  margin-bottom: 0;
}
.bulk-toolbar-spacer {
  flex: 1 1 auto;
}
.bulk-check-col {
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  padding: 0 !important;
  box-sizing: border-box;
  text-align: center;
  vertical-align: middle;
}
col.bulk-check-col {
  width: 40px;
}
.product-page .product-table-panel table.is-bulk-mode tbody tr.bulk-row-selected td {
  background: var(--tblr-primary-lt, #e9f2fc);
}
.product-page .product-table-panel table.is-bulk-mode tbody td.row-drag-handle {
  cursor: default;
  color: var(--tblr-secondary, #94a3b8);
  background: transparent;
}
.bulk-field {
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--tblr-border-color, #e6e7e9);
}
.bulk-field:last-child {
  border-bottom: 0;
}
.bulk-field > .form-check {
  margin-bottom: 0;
  font-weight: 500;
}
.bulk-field-body {
  margin-top: 0.5rem;
  padding-left: 1.6rem;
}
.bulk-price-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.bulk-price-row select.form-select {
  flex: 0 0 auto;
  width: auto;
  min-width: 9rem;
}
.bulk-price-row input.form-control {
  flex: 1 1 8rem;
  min-width: 7rem;
  max-width: 14rem;
}
.bulk-remarks-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.bulk-remarks-row .bulk-remarks-mode {
  flex: 0 0 auto;
  width: auto;
  min-width: 9rem;
}
.bulk-remarks-row input.form-control {
  flex: 1 1 12rem;
  min-width: 8rem;
}

@media (max-width: 575.98px) {
  .bulk-toolbar {
    padding: 0.5rem;
  }
  .bulk-toolbar .btn {
    flex: 1 1 auto;
  }
  .bulk-field-body {
    padding-left: 0;
  }
  .bulk-price-row select.form-select,
  .bulk-remarks-row .bulk-remarks-mode {
    width: 100%;
    min-width: 0;
  }
  .bulk-price-row input.form-control,
  .bulk-remarks-row input.form-control {
    width: 100%;
    max-width: none;
  }
}

/* ============================================================
   主菜单 - 顶部 tab
   ============================================================ */
.main-tabs { border-bottom: 2px solid #e9ecef; gap: 0; }
.main-tabs .nav-link {
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 0.6rem 1.4rem;
  color: #6b7280;
  font-weight: 500;
  font-size: 0.95rem;
  background: transparent;
  border-radius: 0;
  display: inline-flex; align-items: center; gap: 0.4rem;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.main-tabs .nav-link:hover { color: #206bc4; }
.main-tabs .nav-link.active {
  color: #206bc4;
  border-bottom-color: #206bc4;
  background: transparent;
}
.main-tab-icon { font-size: 1.05rem; line-height: 1; }

/* 商品新增/编辑弹窗 */
.product-edit-dialog .modal-body.product-edit-body { padding: 1rem 1.25rem; }
.product-edit-locked { background: #f3f4f6 !important; color: #4b5563; cursor: default; }
.product-edit-section { border: 1px solid #e6e7eb; border-radius: 8px; background: #fafbfc; }
.product-edit-section + .product-edit-section { margin-top: 0.5rem; }
.product-edit-section[open] { background: #fff; }
.product-edit-section-summary {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 0.85rem; cursor: pointer; user-select: none;
  list-style: none; font-weight: 500; color: #1f2937;
}
.product-edit-section-summary::-webkit-details-marker { display: none; }
.product-edit-section-summary::before {
  content: '▸'; display: inline-block; width: 1em; color: #6b7280;
  transition: transform 0.15s ease;
}
.product-edit-section[open] > .product-edit-section-summary::before { transform: rotate(90deg); }
.product-edit-section-summary:hover { background: #f3f4f6; border-radius: 8px; }
.product-edit-section-title { font-weight: 600; color: #1f2937; }
.product-edit-section-body { padding: 0.5rem 0.85rem 0.85rem; border-top: 1px solid #eef0f2; }

.product-edit-footer { gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.product-edit-footer > * { margin: 0; }
.product-edit-keep-adding {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.92rem;
  color: #374151;
  cursor: pointer;
  user-select: none;
}
.product-edit-keep-adding .form-check-input { margin: 0; flex-shrink: 0; }

@media (max-width: 575.98px) {
  .product-edit-dialog .modal-body.product-edit-body { padding: 0.85rem 0.85rem 1rem; }
  .product-edit-footer { flex-direction: column; align-items: stretch; }
  .product-edit-footer > * { margin: 0 !important; }
  .product-edit-keep-adding { justify-content: center; margin-bottom: 0.25rem !important; }
  .product-edit-footer .btn { width: 100%; }
  .product-edit-section-body { padding: 0.5rem 0.6rem 0.75rem; }
}

/* 打印边距设置弹窗 */
.tjt-print-margin-modal .modal-dialog { max-width: 520px; }
.tjt-print-margin-body {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 1.25rem;
  align-items: start;
}
.tjt-print-margin-fields .form-label { font-weight: 500; color: #495057; }
.tjt-print-margin-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
.tjt-print-margin-paper {
  position: relative;
  width: 140px;
  height: 198px; /* 140 * 297/210 */
  background: #f8f9fa;
  border: 1px solid #adb5bd;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.tjt-print-margin-area {
  position: absolute;
  background: #cfe2ff;
  border: 1px dashed #0d6efd;
  transition: top 0.15s, right 0.15s, bottom 0.15s, left 0.15s;
}
.tjt-print-margin-block {
  width: 100%;
  height: 100%;
  background-image: linear-gradient(#0d6efd33 1px, transparent 1px);
  background-size: 100% 6px;
}
.tjt-print-margin-paper-label {
  font-size: 11px;
  color: #6c757d;
}
@media (max-width: 575.98px) {
  .tjt-print-margin-body { grid-template-columns: 1fr; }
  .tjt-print-margin-preview { order: -1; }
}

/* ==================== 商品标签打印 (label-render.js) ==================== */
.tjt-label {
  position: relative;
  box-sizing: border-box;
  background: #fff;
  color: #111;
  font-family: "Microsoft YaHei", "PingFang SC", "Source Han Sans CN", -apple-system, sans-serif;
  line-height: 1.25;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.tjt-label-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 1mm;
  overflow: hidden;
  /* 三段布局：标题贴顶、字段居中、footer 贴底（剩余空间均分到段间） */
  justify-content: space-between;
}
.tjt-label-spacer { flex: none; }
.tjt-label-rule { height: 0; border-bottom: 1px solid #000; margin: 0.6mm 0; }
.tjt-label-rule-dashed { border-bottom-style: dashed; border-color: #444; }

.tjt-label-title {
  flex: none;
  text-align: center;
  letter-spacing: .04em;
  padding: 0.3mm 0 0.3mm;
  line-height: 1.1;
}
.tjt-label-fields-normal + .tjt-label-title,
.tjt-label-body > .tjt-label-title { padding-bottom: 1.5mm; }

.tjt-label-company-header { display: flex; flex-direction: column; gap: 0.4mm; flex: 0 0 auto; }
.tjt-label-company-row { display: flex; align-items: center; gap: 2mm; }
.tjt-label-company-logo {
  flex: none;
  width: 12mm; height: 12mm;
  object-fit: contain;
}
.tjt-label-company-logo-placeholder {
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed #888;
  font-size: 6pt; color: #888;
  background: #fafafa;
}
.tjt-label-company-title {
  flex: 1;
  text-align: center;
  letter-spacing: .02em;
}
.tjt-label-company-sub {
  display: flex;
  justify-content: space-between;
  gap: 4mm;
  color: #222;
  line-height: 1.2;
}
.tjt-label-company-sub-left { flex: none; }
.tjt-label-company-sub-right { flex: 1; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tjt-label-fields {
  flex: 0 0 auto;
  display: grid;
  align-content: start;
  padding: 0.4mm 0;
  overflow: hidden;
}
.tjt-label-fields-normal { gap: 1.4mm 3mm; }
.tjt-label-fields-tight  { gap: 0.6mm 3mm; }
.tjt-label-fields-cols-1 { grid-template-columns: 1fr; }
.tjt-label-fields-cols-2 { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); }
.tjt-label-fields-reserve-right { padding-right: 32mm; }

.tjt-label-field {
  display: flex;
  align-items: baseline;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
}
.tjt-label-fields-normal .tjt-label-field { line-height: 1.35; }
.tjt-label-fields-tight  .tjt-label-field { line-height: 1.1;  }
.tjt-label-field-multi {
  white-space: normal;
  overflow: visible;
  align-items: flex-start;
}
.tjt-label-field-full { grid-column: 1 / -1; }
.tjt-label-field-left { grid-column: 1 / span 1; }
.tjt-label-field-right { grid-column: 2 / span 1; }
.tjt-label-field-multi { align-items: flex-start; }
.tjt-label-field-multi .tjt-label-field-value { white-space: pre-wrap; }
.tjt-label-field-label { flex: none; white-space: nowrap; }
.tjt-label-field-value {
  flex: 1; min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.tjt-label-icon {
  position: absolute;
  width: 30mm;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.tjt-label-icon-right { right: 3mm; top: 50%; transform: translateY(-50%); }
.tjt-label-icon-left { left: 3mm; top: 50%; transform: translateY(-50%); }
.tjt-label-icon-image {
  width: 100%;
  max-width: 30mm;
  max-height: 30mm;
  height: auto;
  object-fit: contain;
  display: block;
}
/* 旧式带菱形 frame 的图标（已弃用，保留以兼容历史 schema） */
.tjt-label-icon-frame {
  width: 26mm; height: 26mm;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  align-items: center; justify-items: center;
  padding: 1mm;
  border: 1.4px solid #5a5a5a;
  background: #fff;
  position: relative;
  border-radius: 0.5mm;
}
.tjt-label-icon-frame::before {
  content: "";
  position: absolute;
  inset: 1mm;
  border: 1px solid #aaa;
  pointer-events: none;
}
.tjt-label-icon-symbol {
  width: 14mm; height: 14mm;
  margin-top: 1mm;
}
.tjt-label-icon-label {
  font-size: 9pt;
  font-weight: bold;
  color: #111;
  margin-top: 0.5mm;
  text-align: center;
}
.tjt-label-icon-class {
  font-size: 11pt;
  font-weight: bold;
  color: #111;
  border-top: 1px solid #5a5a5a;
  width: 70%;
  text-align: center;
  padding-top: 0.4mm;
  margin-top: 0.6mm;
}

.tjt-label-footer {
  flex: 0 0 auto;
  display: flex; flex-direction: column; gap: 0.4mm;
  margin-top: 0.5mm;
}
.tjt-label-footer-line { display: flex; align-items: baseline; gap: 1.5mm; line-height: 1.15; }
.tjt-label-footer-plain { color: #222; }
.tjt-label-tag {
  font-weight: bold;
  color: #111;
  padding: 0 1mm;
}
.tjt-label-tag-boxed {
  border: 1px solid #111;
  padding: 0 1.4mm;
}
.tjt-label-tag-text { color: #222; }
.tjt-label-tag-tail { color: #111; margin-left: auto; }
.tjt-label-tag-tail-underline { text-decoration: underline; text-underline-offset: 1px; }

/* 缩略图（编辑器 / 对话框预览） */
.tjt-label-thumb {
  display: block;
  position: relative;
  margin: 0 auto;
  background: #f7f8fa;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  border: 1px solid #e1e6ee;
  overflow: hidden;
}
.tjt-label-thumb-inner {
  transform-origin: top left;
}

/* 打印对话框 */
.tjt-label-print-modal .tjt-label-step { padding: .5rem 0 .8rem; border-top: 1px dashed #e2e8f0; }
.tjt-label-print-modal .tjt-label-step:first-child { border-top: 0; padding-top: 0; }
.tjt-label-print-modal .tjt-label-step-title { font-weight: 600; margin-bottom: .4rem; color: var(--app-ink); }
.tjt-label-items { display: flex; flex-direction: column; gap: .5rem; }
.tjt-label-item {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  padding: .5rem .65rem;
  border: 1px solid var(--app-line);
  border-radius: 6px;
  background: #fff;
}
.tjt-label-item-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .5rem;
  align-items: center;
}
.tjt-label-item-name { min-width: 0; }
.tjt-label-item-qty { display: flex; align-items: center; gap: .35rem; min-width: 0; }
.tjt-label-item-qty input { width: 5rem; }
.tjt-label-item-defaults {
  border-top: 1px dashed var(--app-line);
  padding-top: .4rem;
  margin-top: .1rem;
}
.tjt-label-item-defaults-title {
  font-size: 12px;
  color: var(--app-muted);
  margin-bottom: .35rem;
}
.tjt-label-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem;
}
.tjt-label-form-field { display: flex; flex-direction: column; gap: .15rem; }
.tjt-label-form-field span { font-size: 12px; color: var(--app-muted); }
.tjt-label-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: .8rem;
  padding-top: .25rem;
}
.tjt-label-preview-item { display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.tjt-label-preview-meta { text-align: center; }
.tjt-label-footer-bar { gap: .5rem; }
@media (max-width: 575.98px) {
  .tjt-label-item-head { grid-template-columns: auto 1fr; row-gap: .25rem; }
  .tjt-label-item-qty { grid-column: 1 / -1; justify-self: end; }
  .tjt-label-form-grid { grid-template-columns: 1fr; }
  .tjt-label-preview { grid-template-columns: 1fr; }
}

/* 模板编辑器（label-template.html） */
/* 模板编辑器 v2 — 画布模式（label-template.html 自由布局） */
.label-template-page .label-tpl-layout {
  display: grid;
  grid-template-columns: 220px minmax(420px, 1fr) 300px;
  gap: .75rem;
  align-items: start;
}
.label-tpl-list-card { position: sticky; top: 1rem; }
.label-tpl-list { display: flex; flex-direction: column; gap: .35rem; padding: .5rem; max-height: 70vh; overflow-y: auto; }
.label-tpl-list-item {
  display: flex; align-items: center; gap: .25rem;
  padding: .25rem .35rem;
  border: 1px solid var(--app-line);
  border-radius: 6px;
  background: #fff;
}
.label-tpl-list-item.is-active { border-color: var(--tblr-primary); background: #eef4ff; }
.label-tpl-list-item.is-hidden { opacity: .55; }
.label-tpl-list-drag-handle {
  display: inline-flex; align-items: center; justify-content: center;
  flex: none;
  width: 18px; height: 22px;
  color: #adb5bd;
  cursor: grab;
  user-select: none;
  border-radius: 3px;
}
.label-tpl-list-drag-handle:hover { color: var(--tblr-primary, #2563eb); background: rgba(0,0,0,.05); }
.label-tpl-list-drag-handle:active { cursor: grabbing; }
.label-tpl-list-item.row-drag-chosen {
  outline: 2px dashed var(--tblr-primary, #2563eb);
  outline-offset: -2px;
  opacity: .9;
}
.label-tpl-list-item.row-drag-dragging { box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.label-tpl-list-name-btn {
  flex: 1;
  display: flex; align-items: flex-start; flex-wrap: wrap; gap: .15rem .35rem;
  background: transparent; border: 0;
  text-align: left; padding: .25rem .35rem; min-width: 0;
  font-weight: 500; cursor: pointer; border-radius: 4px;
  line-height: 1.3;
}
.label-tpl-list-name-text {
  flex: 1 1 100%;
  word-break: break-word;
  white-space: normal;
}
.label-tpl-list-name-btn:hover { background: rgba(0,0,0,.04); }
.label-tpl-list-actions { display: flex; gap: .15rem; flex: none; }

.label-tpl-canvas-pane { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.label-tpl-name-input { max-width: 320px; }

.label-tpl-canvas-wrap {
  background: #f3f4f6;
  padding: 14px;
  border-radius: 8px;
  display: flex; justify-content: center;
  overflow: auto;
  max-width: 100%;
}
.label-tpl-canvas {
  position: relative;
  background: #fff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 4px 16px rgba(15, 23, 42, .08);
  user-select: none;
  flex: none;
}
.label-tpl-align-bar {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .25rem;
}
.label-tpl-align-bar .btn { min-width: 32px; padding: .15rem .35rem; line-height: 1; font-size: 14px; }
.label-tpl-align-bar .vr { height: 18px; }
.label-tpl-element {
  position: absolute;
  cursor: move;
  outline: 1px dashed transparent;
  font-family: "Microsoft YaHei", "PingFang SC", -apple-system, sans-serif;
  color: #111;
}
.label-tpl-element:hover { outline-color: rgba(29, 95, 209, .35); }
.label-tpl-element.is-selected { outline: 1.5px solid var(--tblr-primary); z-index: 5; }
.label-tpl-element.is-hidden { opacity: .35; }
.label-tpl-element.is-locked {
  cursor: not-allowed;
}
.label-tpl-element.is-locked.is-selected {
  outline-style: dotted;
}
.label-tpl-prop-sep {
  display: inline-block;
  width: 1px;
  height: 18px;
  margin: 0 4px;
  background: rgba(15, 23, 42, .25);
  align-self: center;
}
.label-tpl-element-text { width: 100%; height: 100%; display: block; pointer-events: none; }
.label-tpl-element-image { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.label-tpl-element-image-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed #94a3b8;
  color: #94a3b8; font-size: 11px;
  background: #f8fafc; pointer-events: none;
}
.label-tpl-element-rule { width: 100%; height: 1px; pointer-events: none; }
.label-tpl-element-box { pointer-events: none; }
.label-tpl-resize-handle {
  position: absolute;
  right: -5px; bottom: -5px;
  width: 12px; height: 12px;
  background: var(--tblr-primary);
  border: 2px solid #fff;
  border-radius: 2px;
  cursor: se-resize; z-index: 6;
}
.label-tpl-resize-handle-x {
  position: absolute;
  right: -5px; top: 50%;
  width: 12px; height: 12px;
  margin-top: -6px;
  background: var(--tblr-primary);
  border: 2px solid #fff;
  border-radius: 2px;
  cursor: e-resize; z-index: 6;
}

.label-tpl-prop-card { position: sticky; top: 1rem; }
.label-tpl-preview-pane {
  background: #f3f4f6;
  display: flex; justify-content: center;
  padding: 1rem;
  border-radius: 0 0 6px 6px;
}

@media (max-width: 991.98px) {
  .label-template-page .label-tpl-layout { grid-template-columns: 1fr; }
  .label-tpl-list-card,
  .label-tpl-prop-card { position: static; }
}

/* 旧版样式保留，兼容老 label-template-* 类（不再使用，可后续清理） */
.label-template-page .label-template-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1rem;
  align-items: start;
}
.label-template-list-card { position: sticky; top: 1rem; }
.label-template-list { display: flex; flex-direction: column; gap: .35rem; padding: .5rem; }
.label-template-list-item {
  display: flex; align-items: center; gap: .5rem;
  padding: .4rem .55rem;
  border: 1px solid var(--app-line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  text-align: left;
}
.label-template-list-item.is-active { border-color: var(--tblr-primary); background: #eef4ff; }
.label-template-list-item .label-template-list-name { flex: 1; min-width: 0; font-weight: 500; }
.label-template-list-item .label-template-list-default { font-size: 11px; color: var(--tblr-primary); }
.label-template-editor-pane { display: flex; flex-direction: column; gap: 1rem; }
.label-template-fields-table th, .label-template-fields-table td { vertical-align: middle; }
.label-template-fields-table input.form-control-sm,
.label-template-fields-table select.form-select-sm { padding: .2rem .4rem; font-size: 13px; }
.label-template-preview-pane {
  background: #f6f8fb;
  padding: 1rem;
  border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
}
.label-template-footer-editor textarea { font-family: monospace; }
@media (max-width: 991.98px) {
  .label-template-page .label-template-layout { grid-template-columns: 1fr; }
  .label-template-list-card { position: static; }
}

/* 图标 PNG 上传 UI */
.label-icon-file-input {
  position: absolute;
  opacity: 0;
  clip: rect(0, 0, 0, 0);
  pointer-events: none;
  width: 1px; height: 1px;
  overflow: hidden;
}
.label-icon-preview {
  display: block;
  max-width: 80px;
  max-height: 80px;
  border: 1px solid var(--app-line);
  background: #fff;
  padding: 2px;
}

/* === 测试打印 modal — 三栏自适应（桌面三栏 / 中屏 1+(1上1下) / 手机 tabs 切换） === */
.label-tpl-test-modal-content {
  height: min(86vh, 760px);
  max-height: min(86vh, 760px);
  display: flex;
  flex-direction: column;
}
@media (max-width: 991.98px) {
  .label-tpl-test-modal-content { height: 100%; max-height: 100%; }
}
.label-tpl-test-modal-content .modal-header,
.label-tpl-test-modal-content .modal-footer { flex: 0 0 auto; }
.label-tpl-test-modal-content .modal-body { flex: 1 1 auto; min-height: 0; }

.label-tpl-test-tabs { flex: 0 0 auto; border-bottom: 1px solid var(--tblr-border-color, #e6e7e9); background: #f8fafc; }
.label-tpl-test-tabs .nav-link { padding: .5rem .25rem; font-size: 13px; border: 0; border-bottom: 2px solid transparent; color: var(--tblr-secondary, #6b7280); }
.label-tpl-test-tabs .nav-link.active { color: var(--tblr-primary, #2563eb); border-bottom-color: var(--tblr-primary, #2563eb); background: transparent; }

.label-tpl-test-body { overflow: hidden; }
.label-tpl-test-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.05fr) minmax(280px, 1.2fr) minmax(240px, 1fr);
  height: 100%;
}
.label-tpl-test-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--tblr-border-color, #e6e7e9);
  background: #fff;
}
.label-tpl-test-pane:last-child { border-right: 0; }
.label-tpl-test-pane-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .4rem .75rem;
  border-bottom: 1px solid var(--tblr-border-color, #e6e7e9);
  font-size: 13px;
  font-weight: 600;
  color: var(--tblr-secondary, #6b7280);
  background: #f8fafc;
}
.label-tpl-test-pane-body {
  flex: 1 1 auto;
  overflow: auto;
  padding: .55rem .75rem .75rem;
  min-height: 0;
}

.label-tpl-test-section + .label-tpl-test-section { margin-top: .65rem; }
.label-tpl-test-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--tblr-secondary, #6b7280);
  margin: 0 0 .3rem;
  display: flex;
  align-items: center;
  gap: .35rem;
}
.label-tpl-test-section-hint {
  font-weight: 400;
  font-size: 11px;
  color: #94a3b8;
  font-family: var(--tblr-font-monospace, monospace);
}
.label-tpl-test-section .form-label.small { font-size: 11px; color: #4b5563; }

.label-tpl-test-preview {
  background: #f3f4f6;
  padding: 1rem;
  display: flex;
  align-items: safe center;
  justify-content: safe center;
}
.label-tpl-test-preview-frame {
  flex: 0 0 auto;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.10);
}
.label-tpl-test-preview-frame > .tjt-label,
.label-tpl-test-preview-frame > .tjt-label-free { display: block; }

.label-tpl-test-records { padding: .35rem .35rem .5rem; }
.label-tpl-test-record-item {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--tblr-border-color, #e6e7e9);
  border-radius: 6px;
  background: #fff;
  margin-bottom: .35rem;
  transition: border-color .15s, box-shadow .15s;
}
.label-tpl-test-record-item:hover {
  border-color: var(--tblr-primary, #2563eb);
  box-shadow: 0 1px 4px rgba(37,99,235,.12);
}
.label-tpl-test-record-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: .4rem .55rem;
  background: transparent;
  border: 0;
  text-align: left;
  min-width: 0;
}
.label-tpl-test-record-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--tblr-body-color, #1f2937);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.label-tpl-test-record-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 11px;
  color: var(--tblr-secondary, #6b7280);
  white-space: nowrap;
  overflow: hidden;
}
.label-tpl-test-record-meta .label-tpl-test-record-qty { margin-left: auto; color: var(--tblr-primary, #2563eb); font-weight: 600; }
.label-tpl-test-record-time { font-size: 11px; color: #94a3b8; }
.label-tpl-test-record-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 .35rem;
  border-left: 1px dashed var(--tblr-border-color, #e6e7e9);
}

@media (max-width: 991.98px) {
  .label-tpl-test-grid {
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
    grid-template-rows: 1fr 1fr;
  }
  .label-tpl-test-grid > [data-pane="form"]    { grid-column: 1 / 2; grid-row: 1 / 3; }
  .label-tpl-test-grid > [data-pane="preview"] { grid-column: 2 / 3; grid-row: 1 / 2; }
  .label-tpl-test-grid > [data-pane="records"] { grid-column: 2 / 3; grid-row: 2 / 3; }
  .label-tpl-test-grid > [data-pane="preview"],
  .label-tpl-test-grid > [data-pane="records"] {
    border-right: 0;
    border-bottom: 1px solid var(--tblr-border-color, #e6e7e9);
  }
  .label-tpl-test-grid > [data-pane="records"] { border-bottom: 0; }
}

@media (max-width: 767.98px) {
  .label-tpl-test-grid {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    height: 100%;
  }
  .label-tpl-test-grid > [data-pane] {
    display: none !important;
    grid-column: 1;
    grid-row: 1;
    border-right: 0;
    border-bottom: 0;
  }
  .label-tpl-test-grid[data-active-tab="form"]    > [data-pane="form"],
  .label-tpl-test-grid[data-active-tab="preview"] > [data-pane="preview"],
  .label-tpl-test-grid[data-active-tab="records"] > [data-pane="records"] {
    display: flex !important;
  }
  .label-tpl-test-pane-head { font-size: 12px; padding: .35rem .6rem; }
  .label-tpl-test-pane-body { padding: .5rem .6rem .65rem; }
  .label-tpl-test-record-item { margin-bottom: .3rem; }
}
