:root {
  --forest: #153e32;
  --green: #276e55;
  --pale: #dce8bc;
  --bg: #f4f6ef;
  --ink: #203d33;
  --muted: #7d9185;
  --line: #e1e8dc;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    14px/1.6 'Microsoft YaHei',
    'Segoe UI',
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 14px;
  background: #fff;
  color: var(--ink);
}
button:hover {
  border-color: #96b294;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.primary {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
.danger {
  color: #af4d3c;
}
.link {
  padding: 3px 7px;
  border: 0;
  background: transparent;
  color: var(--green);
}
input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  background: white;
  color: var(--ink);
  min-width: 0;
  max-width: 100%;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #bfd4b0;
}
input[type='checkbox'] {
  accent-color: var(--green);
  width: 17px;
  height: 17px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: #617c6b;
  font-size: 12px;
}
label.check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 27px;
  letter-spacing: 1px;
}
h2 {
  font-size: 21px;
}
h3 {
  font-size: 16px;
}
.muted {
  color: var(--muted);
  font-size: 12px;
}
.loading {
  padding: 80px;
  text-align: center;
}
.sidebar {
  width: 200px;
  position: fixed;
  inset: 0 auto 0 0;
  background: var(--forest);
  color: #b5cdbb;
  padding: 23px 15px;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  font-size: 21px;
  font-weight: 700;
  margin: 0 10px 18px;
}
.mark {
  background: var(--pale);
  border-radius: 14px;
  color: var(--forest);
  width: 44px;
  height: 46px;
  display: grid;
  place-items: center;
  font-size: 30px;
}
.sidebar .book {
  background: #ffffff0a;
  border: 1px solid #ffffff16;
  border-radius: 11px;
  padding: 11px;
  margin-bottom: 15px;
  font-size: 12px;
}
.sidebar nav {
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
}
.group {
  font-size: 11px;
  letter-spacing: 2px;
  padding: 13px 12px 5px;
  color: #7f9c8b;
}
.sidebar button {
  display: block;
  text-align: left;
  width: 100%;
  background: none;
  color: #b7cebf;
  border: 0;
  padding: 9px 12px;
  border-radius: 9px;
  margin: 2px 0;
}
.sidebar button.active {
  background: var(--pale);
  color: #153e32;
  font-weight: 700;
}
.sidefoot {
  border-top: 1px solid #ffffff17;
  padding-top: 10px;
  font-size: 11px;
}
.workspace {
  margin-left: 200px;
  min-width: 0;
}
.top {
  height: 63px;
  border-bottom: 1px solid var(--line);
  padding: 12px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafbf7;
}
.dot {
  color: #87ac66;
}
.top .actions {
  gap: 9px;
}
.body {
  padding: 25px;
  max-width: 1900px;
  margin: auto;
}
.body.framebody {
  padding: 0;
  max-width: none;
}
.body iframe {
  display: block;
  width: 100%;
  height: calc(100vh - 63px);
  border: 0;
}
.titlebar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}
.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.hero {
  background: #e8eddd;
  border: 1px solid #dbe5cf;
  border-radius: 18px;
  padding: 25px;
  margin-bottom: 18px;
}
.hero .number {
  font-size: 40px;
  color: var(--green);
  font-variant-numeric: tabular-nums;
}
.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
}
.card,
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
}
.card {
  padding: 20px;
}
.card .value {
  font-size: 27px;
  font-weight: 650;
  margin: 12px 0 5px;
  word-break: break-word;
}
.panel {
  padding: 18px;
  margin-bottom: 17px;
}
.panel.tablepanel {
  padding: 0;
}
.columns {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 17px;
}
.notice {
  padding: 13px 16px;
  background: #eaf0e0;
  border-radius: 9px;
  color: #627c59;
  margin-bottom: 16px;
}
.warning {
  background: #fff3dc;
  color: #98742c;
}
.filters {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filters input[type='search'] {
  width: 280px;
}
.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 12px 0 18px;
}
.tabs button.active {
  background: var(--forest);
  color: white;
}
.tablewrap {
  max-width: 100%;
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
  font-size: 12px;
}
th {
  background: #f0f4e9;
  color: #65806c;
  font-weight: 500;
  text-align: left;
  padding: 12px 9px;
}
td {
  padding: 11px 9px;
  border-bottom: 1px solid #edf1e8;
  vertical-align: middle;
  overflow-wrap: anywhere;
}
tbody tr:hover {
  background: #f7f9f3;
}
.num {
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.sub {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}
.badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 5px;
  background: #eaf1df;
  color: #67864e;
  font-size: 11px;
}
.badge.warn {
  background: #fbefd6;
  color: #a77d32;
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 45px;
}
.foot {
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 19px;
}
.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.wide {
  grid-column: 1/-1;
}
.summary {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  background: #edf2e5;
  padding: 14px;
  border-radius: 9px;
  margin-bottom: 17px;
}
.summary b {
  font-size: 17px;
  margin-left: 5px;
}
.login {
  max-width: 520px;
  margin: 6vh auto;
  padding: 32px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 50px #123c3210;
}
.login .brand {
  color: var(--ink);
}
.login label {
  margin: 15px 0;
}
.login h2 {
  margin: 18px 0 6px;
}
.login button {
  width: 100%;
  margin-top: 15px;
}
.error {
  color: #ad4c38;
  background: #fbece4;
  padding: 10px;
  border-radius: 8px;
  margin-top: 12px;
  display: none;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  width: min(980px, 96vw);
  max-height: 94vh;
}
dialog.large {
  width: min(1300px, 98vw);
}
dialog::backdrop {
  background: #153e3266;
}
.modalhead {
  padding: 17px 23px;
  background: white;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 2;
}
.modalbody {
  padding: 22px;
}
.modalfoot {
  padding: 15px 22px;
  border-top: 1px solid var(--line);
  background: white;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  position: sticky;
  bottom: 0;
}
.billgrid input,
.billgrid select {
  padding: 5px 3px;
  width: 100%;
  font-size: 12px;
  border-radius: 5px;
}
.billgrid td,
.billgrid th {
  padding: 5px 3px;
}
.billgrid .check input {
  width: 16px;
}
.checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.audit-detail {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 420px;
  overflow: auto;
  font-size: 12px;
}
.chart {
  height: 160px;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-top: 18px;
}
.barbox {
  flex: 1;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}
.barbox b {
  display: block;
  background: #4d7f61;
  min-height: 2px;
  border-radius: 4px 4px 0 0;
}
.statline {
  display: flex;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--forest);
  color: white;
  padding: 12px 24px;
  border-radius: 10px;
  z-index: 100;
  display: none;
  max-width: 85vw;
}
.readonly {
  background: #f5f7ef;
}
.printarea {
  background: white;
  color: #111;
  padding: 10mm;
  font-family: SimSun, '宋体', serif;
}
.printarea h1,
.printarea h2 {
  text-align: center;
  margin: 0 0 10mm;
}
.printarea table {
  font-size: 10pt;
}
.printarea td,
.printarea th {
  border: 1px solid #222;
  color: #111;
  background: white;
  text-align: center;
  padding: 5px;
  overflow-wrap: anywhere;
}
.printarea th {
  font-weight: bold;
}
.printarea .meta {
  margin-bottom: 8mm;
}
.signature {
  margin-top: 14mm;
  display: flex;
  justify-content: space-between;
  padding: 0 5mm 8mm;
}
.pagination {
  margin-top: 15px;
  text-align: right;
}
.badge small {
  font-size: 10px;
}
@media (max-width: 1150px) {
  .sidebar {
    width: 180px;
    padding: 17px 10px;
  }
  .workspace {
    margin-left: 180px;
  }
  .body {
    padding: 18px;
  }
  .top {
    padding: 10px 18px;
  }
  .cards {
    gap: 9px;
  }
  .card {
    padding: 14px;
  }
  .card .value {
    font-size: 23px;
  }
  td,
  th {
    padding: 9px 6px;
  }
  .columns {
    grid-template-columns: 1fr;
  }
  .grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 750px) {
  .sidebar {
    width: 145px;
  }
  .workspace {
    margin-left: 145px;
  }
  .brand {
    font-size: 17px;
  }
  .mark {
    display: none;
  }
  .cards {
    grid-template-columns: 1fr 1fr;
  }
  .grid,
  .grid.three {
    grid-template-columns: 1fr;
  }
  .checks {
    grid-template-columns: 1fr;
  }
  .top .muted {
    display: none;
  }
  .titlebar {
    align-items: flex-start;
    flex-direction: column;
  }
}
@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }
  body {
    padding: 10mm !important;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
  }
  body > #app,
  body > #toast {
    display: none !important;
  }
  dialog {
    display: block !important;
    position: static;
    margin: 0;
    width: 100%;
    max-height: none;
    overflow: visible;
    border: 0;
    background: white;
  }
  dialog > *:not(.modalbody) {
    display: none !important;
  }
  .modalbody {
    padding: 0;
  }
  .modalbody > *:not(.printarea) {
    display: none !important;
  }
  .printarea {
    padding: 0;
  }
  .printarea table {
    table-layout: fixed;
    width: 100%;
  }
  .printarea tr {
    break-inside: avoid;
  }
  .printarea thead {
    display: table-row-group;
  }
  .signature {
    break-inside: avoid;
  }
  .printarea h1 {
    font-size: 20pt;
  }
  .printarea h2 {
    font-size: 16pt;
  }
}

.sidebar .brand {
  font-size: 17px;
  gap: 8px;
  margin: 0 0 18px;
  white-space: nowrap;
}
.sidebar .mark {
  width: 34px;
  height: 38px;
  flex-shrink: 0;
  font-size: 25px;
}

@media screen and (max-width: 1100px) {
  .suppliergrid colgroup,
  .suppliergrid thead {
    display: none;
  }
  .suppliergrid,
  .suppliergrid tbody {
    display: block;
  }
  .suppliergrid tbody tr {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
  }
  .suppliergrid td {
    display: block;
    border: 0;
    min-width: 0;
  }
  .suppliergrid td:before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 3px;
  }
  .suppliergrid td:nth-child(3),
  .suppliergrid td:nth-child(4) {
    grid-column: span 2;
  }
}
@media screen and (max-width: 650px) {
  .suppliergrid tbody tr {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.module-tabs {
  padding: 12px 25px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  background: #fafbf7;
}
.module-tabs .active {
  background: var(--forest);
  color: white;
}
.module-tabs + .framebody iframe {
  height: calc(100vh - 125px);
}
.business-frame {
  width: 100%;
  height: 72vh;
  border: 0;
  display: block;
}
.cards {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
#businessParty {
  max-width: 340px;
}
.body iframe {
  min-width: 0;
}

.batch-toolbar {
  padding: 12px 18px;
  background: #fff;
}
.batch-toolbar + iframe {
  height: calc(100% - 65px);
}
#dailyRows input {
  min-width: 0;
  width: 100%;
  margin: 3px 0;
}
.panel .tablepanel {
  border: 0;
  padding: 0;
}
.tablewrap td {
  overflow-wrap: anywhere;
}
.number {
  font-variant-numeric: tabular-nums;
}

.supplier-print .tablewrap {
  overflow: visible;
}
.supplier-print table {
  font-size: 9pt;
}
.supplier-print td:first-child,
.supplier-print th:first-child {
  width: 4%;
  white-space: nowrap;
  overflow-wrap: normal;
}
.supplier-print th:nth-child(4),
.supplier-print th:nth-child(5) {
  width: 11%;
}
.supplier-print th:nth-child(6) {
  width: 4%;
}
.supplier-print td {
  word-break: normal;
}
.modalfoot {
  flex-wrap: wrap;
}
@media print {
  /* 供应商对账单与客户对账单一致：A4 纵向 */
  @page supplier {
    size: A4 portrait;
    margin: 0;
  }
  .supplier-print {
    page: supplier;
  }
  .supplier-print td,
  .supplier-print th {
    padding: 3px;
  }
  .supplier-print .num {
    white-space: nowrap;
  }
}

/* Staff documents use an isolated printable frame, not the application layout. */
#staffGenerateForm input[type='checkbox'],
#staffPrintSelect input[type='checkbox'] {
  width: auto;
  min-width: 18px;
}
#staffUploadForm input[type='file'] {
  max-width: 100%;
}
.actions {
  flex-wrap: wrap;
}
#staffDocFrame {
  display: block;
}
.modalbody {
  overflow-wrap: anywhere;
}

[hidden] {
  display: none !important;
}

#results:has(th:nth-child(14)) td {
  white-space: nowrap;
  min-width: 88px;
}

@media screen {
  dialog {
    resize: both;
    overflow: auto;
    min-width: 340px;
    min-height: 250px;
  }
  dialog.maximized {
    width: 98vw !important;
    max-width: 98vw !important;
    height: 96vh !important;
    max-height: 96vh !important;
  }
  dialog.maximized .modalbody {
    max-height: none;
    flex: 1;
    overflow: auto;
  }
  dialog.maximized iframe {
    height: 76vh !important;
  }
  .cash-details {
    margin: 12px 0;
    padding: 14px;
    background: white;
    border: 1px solid #d6dfd7;
    border-radius: 10px;
  }
  .cash-details summary {
    cursor: pointer;
    font-weight: bold;
  }
  .cash-details .tablewrap {
    overflow: auto;
  }
}

/* Compact customer bill overview: details stay in the existing detail dialog. */
.compact-customers .titlebar {
  margin-bottom: 12px;
  align-items: center;
}
.compact-customers .titlebar h1 {
  font-size: 22px;
}
.compact-customers .titlebar p {
  display: none;
}
.compact-customers .compact-totals {
  background: transparent;
  padding: 8px 0;
  margin: 0 0 10px;
  gap: 22px;
}
.compact-customers .compact-totals b {
  font-size: 16px;
}
.compact-customers > .filters {
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 12px;
}
.compact-customers > .filters input[type='search'] {
  width: 240px;
}
.compact-customers > .filters select {
  max-width: 200px;
}
.compact-customers > .filters button {
  padding: 8px 10px;
}
.compact-customers table {
  table-layout: auto;
  font-size: 12px;
}
.compact-customers th,
.compact-customers td {
  padding: 8px 7px;
  white-space: nowrap;
  overflow-wrap: normal;
}
.compact-customers .num {
  text-align: right;
}
.compact-customers .compact-ops {
  white-space: nowrap;
}
.compact-customers .compact-ops button {
  padding: 2px 4px;
}
.compact-customers .tablepanel {
  border-radius: 8px;
}
.compact-customers .badge {
  white-space: nowrap;
}

.page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 180px;
  color: #365e50;
  font-size: 16px;
}
.loading-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid #dbe5d7;
  border-top-color: #276d55;
  border-radius: 50%;
  animation: page-spin 0.8s linear infinite;
}
@keyframes page-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .loading-spinner {
    animation: none;
  }
}

/* A focused bill uses one host window; the embedded page contains only its details. */
@media screen {
  dialog.detail-host[open] {
    display: flex;
    flex-direction: column;
    height: 90vh;
    overflow: hidden;
  }
  dialog.detail-host > .modalhead,
  dialog.detail-host > .modalfoot {
    flex: none;
    position: static;
  }
  dialog.detail-host > .modalbody {
    flex: 1;
    min-height: 0;
    padding: 0;
    overflow: hidden;
  }
  dialog.detail-host .business-frame,
  dialog.detail-host.maximized iframe {
    height: 100% !important;
    width: 100%;
    border: 0;
  }
}
.business-stat-total th,
.business-stat-total td {
  font-weight: 700;
  background: #e9f0df;
  border-top: 2px solid #bfd0bb;
}

/* 正在处理的按钮：显示处理中，避免以为“点不动” */
button.is-busy {
  position: relative;
  color: transparent !important;
}
button.is-busy::after {
  content: '处理中…';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2f6b4f;
  font-size: 12px;
}

.compact-customers .compact-totals {
  row-gap: 2px;
}
.net-total {
  flex: 0 0 100%;
  margin-top: 4px;
}
.net-total small {
  font-size: 13px;
  font-weight: normal;
  color: #687b72;
}
.order-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.order-fields label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.order-editor {
  margin: 18px 0;
}
.order-editor table {
  min-width: 1700px;
}
/* 名称、规格栏放宽，长规格（例如 129H25-16900 OP110）不被图号栏盖住 */
.order-editor th:first-child { width: 170px; }
.order-editor th:nth-child(2) { width: 260px; }
.order-editor th.col-due { width: 160px; }
.order-editor input,
.order-editor select {
  width: 100%;
  min-width: 85px;
}
.order-editor td:first-child input,
.order-editor td:nth-child(2) input {
  min-width: 150px;
}
.order-editor input[type='file'] {
  max-width: 200px;
}
.order-summary {
  padding: 12px 0;
}
.order-summary p {
  white-space: pre-wrap;
}
#orderForm details,
#modal .modalbody > details {
  margin-top: 20px;
}
#orderPaste {
  width: 100%;
  min-height: 120px;
}
#orderResults .foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#orderShipForm input[type='number'] {
  width: 120px;
}

/* Order-to-quotation navigation keeps the order form alive while browsing. */
.oq-page {
  max-width: 100%;
  min-width: 0;
}
.oq-order-context {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  background: #e8eedf;
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
}
.oq-search,
.oq-pager,
.oq-book-heading,
.oq-sheet-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
  flex-wrap: wrap;
}
.oq-search {
  justify-content: flex-start;
}
.oq-search input {
  width: 340px;
  max-width: 100%;
}
.oq-list {
  width: 100%;
  background: #fff;
}
.oq-book-heading p {
  font-size: 13px;
  color: #71857a;
  margin: 6px 0;
}
.oq-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  background: #e8eedf;
  position: sticky;
  top: 0;
  z-index: 4;
}
.oq-tab {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #ccd6c8;
  border-radius: 4px;
  padding-left: 10px;
}
.oq-tab.active {
  border-color: #245e49;
  background: #dce7cb;
}
.oq-tab input,
.oq-accessories input[type='checkbox'] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin: 0;
  accent-color: #276d52;
  cursor: pointer;
}
.oq-tab button {
  border: 0;
  background: transparent;
  padding: 10px 16px;
}
.oq-sheet-heading {
  font-size: 14px;
}
.oq-paper {
  max-width: 100%;
  overflow-x: auto;
}
.oq-paper td {
  padding: 5px 3px !important;
  line-height: 1.35;
  word-break: break-word;
  text-align: center;
  color: #254a3b;
}
.oq-paper .title {
  font-size: 22px;
}
.oq-paper .subtitle {
  font-size: 17px;
}
.oq-accessories {
  background: #fff;
  border: 1px solid #d4ded0;
  padding: 20px;
}
.oq-accessories h2,
.oq-accessories h3 {
  text-align: center;
}
.oq-accessories table {
  width: 100%;
  min-width: 900px;
}
.oq-accessories td,
.oq-accessories th {
  text-align: center;
}
.oq-accessories td:nth-child(3),
.oq-accessories td:last-child {
  text-align: left;
}
.oq-selected {
  background: #edf3e4;
}
.oq-link-footer {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  background: #f5f7ef;
  border: 1px solid #d4ded0;
  padding: 12px;
  margin-top: 16px;
}
.oq-link-footer > div {
  font-size: 14px;
}
.oq-link-footer button {
  white-space: nowrap;
}
#oqError:empty {
  display: none;
}
#oqError {
  padding: 14px;
  background: #fff4ef;
  border: 1px solid #e8b8a6;
}
[data-order-quote] button {
  font-size: 12px;
  padding: 7px;
  margin: 2px 0;
}
#oqError:not(:empty) {
  display: block;
}
.oq-search input {
  width: 460px;
}
.oq-search select {
  width: auto;
}
.oq-list td {
  vertical-align: middle;
}
.oq-customer-match {
  display: block;
  color: #276d52;
  font-size: 12px;
  margin-top: 4px;
}
.oq-customer-notice {
  padding: 12px 16px;
  background: #fff8e9;
  border: 1px solid #e3d3a5;
  border-radius: 6px;
  margin: 14px 0;
  font-size: 14px;
}
.oq-customer-notice p {
  margin: 0 0 8px;
}
.oq-customer-notice label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.oq-customer-notice input[type='checkbox'] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin: 0;
  accent-color: #276d52;
}
.quotes .oq-customer-notice label {
  flex-direction: row;
}
.oq-tab {
  flex: 0 0 auto;
}
.oq-tab button {
  white-space: nowrap;
}
.danger {
  color: #993f30;
}
#orderResults td:last-child {
  white-space: nowrap;
}
#orderResults td:last-child .muted {
  font-size: 12px;
}
#orderRemoveForm label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
}
#orderRemoveForm input {
  width: 100%;
}
.order-editor select[aria-label="对账类别"] { min-width: 130px; }

.quotes .q-toolbar,
.quotes .q-tabs,
.quotes .q-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.quotes .q-toolbar {
  margin: 16px 0;
}
.quotes .q-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}
.quotes label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 14px;
  color: #49675d;
}
.quotes input,
.quotes select,
.quotes textarea {
  width: 100%;
  min-width: 0;
}
.quotes textarea {
  min-height: 85px;
  resize: vertical;
}
.quotes fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}
.quotes .q-wide {
  grid-column: 1/-1;
}
.quotes .q-card {
  background: white;
  border: 1px solid #dfe7dc;
  border-radius: 12px;
  padding: 18px;
  margin: 14px 0;
}
.quotes .q-card h3 {
  margin: 0 0 14px;
}
.quotes .q-sheet {
  overflow: auto;
  max-height: 65vh;
  border: 1px solid #d7e1d5;
  border-radius: 8px;
}
.quotes .q-sheet table {
  border-collapse: collapse;
  min-width: 1050px;
  width: 100%;
}
.quotes .q-sheet th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #e9efdf;
  font-size: 13px;
}
.quotes .q-sheet td,
.quotes .q-sheet th {
  padding: 6px;
  border: 1px solid #dde4d9;
}
.quotes .q-sheet td input,
.quotes .q-sheet td select {
  border-radius: 3px;
  min-width: 78px;
  padding: 7px;
  height: 38px;
}
.quotes .q-sheet td:first-child input {
  min-width: 145px;
}
.quotes .q-sheet td output {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.quotes .q-tabs {
  position: sticky;
  bottom: 0;
  background: #e7eddf;
  padding: 12px;
  border: 1px solid #d7e1d5;
  z-index: 3;
  box-shadow: 0 -3px 12px #183d3010;
}
.quotes .q-tabs button.active {
  background: #173f32;
  color: white;
}
.quotes .q-savebar {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #f7f9f1;
  padding: 10px;
  border-bottom: 1px solid #dce4d6;
}
.quotes .q-warning {
  color: #b34329;
}
.quotes .q-summary {
  font-size: 18px;
  font-weight: bold;
  margin: 12px 0;
}
.quotes .q-inline {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.quotes .q-inline input[type='checkbox'] {
  width: auto;
}
.quotes details > summary {
  cursor: pointer;
  padding: 10px 0;
  font-weight: bold;
}
.quotes .q-table {
  width: 100%;
}
.quotes .q-table td,
.quotes .q-table th {
  padding: 12px;
  border-bottom: 1px solid #e3e8df;
  text-align: left;
}
.quotes .q-table th {
  background: #eaf0e1;
}
.quotes .q-table button {
  white-space: nowrap;
}
.quotes .q-muted {
  color: #708578;
  font-size: 13px;
}
.quotes .q-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 15px 0;
}
.q-dialog {
  width: min(1150px, 94vw);
  max-height: 90vh;
  border: 1px solid #d1dccb;
  border-radius: 14px;
  padding: 22px;
  overflow: auto;
}
.q-dialog::backdrop {
  background: #123c3260;
}
.q-dialog .q-close {
  float: right;
}
.quotes .q-clause {
  margin: 12px 0;
  padding: 12px;
  background: #f7f9f3;
  border-radius: 6px;
}
.quotes .q-cost {
  min-width: 90px;
  text-align: right;
}
.quotes .q-checklist {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 0;
}
.quotes .q-checklist label {
  display: flex;
  flex-direction: row;
  align-items: center;
}
.quotes .q-checklist input {
  width: auto;
}
@media (max-width: 1000px) {
  .quotes .q-fields {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}
@media (max-width: 650px) {
  .quotes .q-fields {
    grid-template-columns: 1fr;
  }
  .quotes .q-savebar {
    position: static;
  }
}
.quotes .q-compactbar {
  display: flex;
  align-items: end;
  gap: 14px;
  margin: 12px 0;
  flex-wrap: wrap;
}
.quotes .q-compactbar label {
  max-width: 190px;
}
.quotes .q-workpaper {
  overflow: auto;
  background: #fff;
  border: 1px solid #a4afa8;
}
.quotes .q-worksheet {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
  min-width: 1440px;
  font-family: SimSun, 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  color: #152b24;
}
.quotes .q-worksheet td {
  border: 1px solid #82938a;
  padding: 2px;
  text-align: center;
  vertical-align: middle;
  overflow-wrap: anywhere;
}
.quotes .q-worksheet input,
.quotes .q-worksheet textarea {
  font: inherit;
  width: 100%;
  height: 28px;
  min-width: 0;
  padding: 3px 1px;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  text-align: center;
  color: #193c65;
}
.quotes .q-worksheet textarea {
  height: 45px;
  min-height: 0;
  resize: vertical;
}
.quotes .q-worksheet input:focus,
.quotes .q-worksheet textarea:focus {
  background: #fffce8;
  border-color: #538268;
  outline: 0;
}
.quotes .q-worksheet small {
  display: block;
  font-size: 11px;
  line-height: 1.2;
  color: #304c41;
}
.quotes .q-worksheet .title td {
  padding: 10px;
  border: 0;
  font-size: 23px;
  font-weight: bold;
}
.quotes .q-worksheet .subtitle td {
  font-size: 19px;
  padding: 6px;
}
.quotes .q-worksheet .title input,
.quotes .q-worksheet .subtitle input {
  height: auto;
  font-weight: bold;
}
.quotes .q-worksheet .head td,
.quotes .q-worksheet .section td {
  background: #f2f5f0;
}
.quotes .q-worksheet .section {
  font-size: 16px;
}
.quotes .q-worksheet .total {
  font-weight: bold;
}
.quotes .q-cell-action {
  padding: 1px 5px;
  font-size: 11px;
  line-height: 1.5;
  border: 0;
  background: transparent;
  color: #396d56;
  min-height: 0;
  box-shadow: none;
}
.quotes .q-workpaper output {
  font-variant-numeric: tabular-nums;
}
.quotes .q-below {
  background: white;
  padding: 16px;
  margin: 0 0 12px;
  border: 1px solid #dfe7dc;
}
.quotes .q-below > details {
  border-top: 1px solid #e0e7de;
  margin-top: 10px;
}
.quotes .q-below #quoteSummary {
  font-size: 15px;
  font-weight: normal;
}
.quotes #quoteSummary .q-warning {
  font-size: 12px;
}
.quotes .q-menu {
  margin-left: auto;
  position: relative;
}
.quotes .q-menu > div {
  position: absolute;
  right: 0;
  width: 200px;
  background: white;
  box-shadow: 0 5px 20px #0002;
  padding: 10px;
  z-index: 6;
  display: grid;
  gap: 7px;
}
.quotes .q-menu summary {
  padding: 5px;
}
.quotes .q-simple-paper {
  max-width: 1100px;
  margin: auto;
  padding: 26px;
  background: white;
  border: 1px solid #cbd7ca;
  color: #152b24;
}
.quotes .q-simple-paper h2,
.quotes .q-simple-paper h3 {
  text-align: center;
  margin: 0 0 18px;
}
.quotes .q-simple-paper h3 input {
  border: 0;
  font-size: 22px;
  text-align: center;
  font-weight: bold;
}
.quotes .q-contact-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}
.quotes .q-contact-header label {
  display: grid;
  grid-template-columns: 75px 1fr;
  align-items: center;
}
.quotes .q-contact-header input {
  border: 0;
  border-bottom: 1px solid #e6ece4;
  border-radius: 0;
  padding: 6px;
}
.quotes .q-simple-paper .q-sheet {
  max-height: none;
  border-radius: 0;
}
.quotes .q-simple-paper .q-sheet table {
  min-width: 850px;
  table-layout: fixed;
}
.quotes .q-simple-paper .q-sheet th {
  background: white;
  position: static;
}
.quotes .q-simple-paper .q-sheet td {
  padding: 2px;
}
.quotes .q-simple-paper .q-sheet td input {
  min-width: 0;
  border: 0;
  background: white;
  font-size: 13px;
  padding: 3px;
}
.quotes .q-simple-paper .q-sheet th:first-child {
  width: 38px;
}
.quotes .q-simple-paper .q-sheet th:nth-child(2) {
  width: 18%;
}
.quotes .q-simple-paper .q-sheet th:nth-child(3) {
  width: 20%;
}
.quotes .q-simple-paper .q-sheet th:nth-child(4) {
  width: 40px;
}
.quotes .q-simple-paper .q-sheet th:nth-child(5) {
  width: 55px;
}
.quotes .q-simple-paper .q-sheet th:last-child {
  width: 35px;
}
.quotes .q-simple-total {
  text-align: right;
  padding: 14px;
  font-weight: bold;
  border-bottom: 1px solid #888;
}
.quotes .q-sign-space {
  display: flex;
  justify-content: space-between;
  min-height: 125px;
  padding: 22px 20px 0;
}
.quotes .q-sign-space span {
  width: 45%;
}
.quotes .q-quote-note {
  font-size: 14px;
}
.quotes .q-tabs {
  padding: 7px;
}
.quotes .q-tabs button {
  padding: 7px 16px;
  border-radius: 0;
}
.quotes .q-savebar button {
  padding: 9px 16px;
}

/* Keep the worksheet inside the workspace: fieldsets otherwise use min-content width. */
.quotes,
.quotes fieldset,
.quotes #quoteSheetBody,
.quotes .q-workpaper,
.quotes .q-simple-paper {
  min-width: 0;
  max-width: 100%;
  width: 100%;
}
.quotes .q-worksheet {
  min-width: 0;
  font-size: 12px;
  line-height: 1.25;
}
.quotes .q-worksheet input,
.quotes .q-worksheet select {
  font: inherit;
  height: 25px;
  padding: 2px 0;
  min-width: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  text-align: center;
  color: #193c65;
}
.quotes .q-worksheet td {
  padding: 1px;
}
.quotes .q-worksheet textarea {
  font-size: 11px;
  line-height: 1.3;
  height: 52px;
  resize: vertical;
}
.quotes .q-worksheet .title td {
  font-size: 20px;
  padding: 8px;
}
.quotes .q-worksheet .subtitle td {
  font-size: 17px;
  padding: 5px;
}
.quotes .q-worksheet .section {
  font-size: 13px;
}
.quotes .q-worksheet small {
  font-size: 10px;
  overflow-wrap: anywhere;
}
.quotes .q-worksheet .q-gap,
.quotes .q-worksheet .spacer td {
  border: 0;
  background: white;
}
.quotes .q-worksheet .spacer td {
  height: 9px;
}
.quotes .q-cell-action {
  font-size: 10px;
  padding: 1px;
  white-space: normal;
}
.quotes .q-savebar {
  max-width: 100%;
  padding: 7px;
}
.quotes .q-simple-paper {
  padding: 16px;
}
.quotes .q-simple-paper .q-sheet table {
  min-width: 0;
}
.quotes .q-contact-header {
  gap: 16px;
}
.quotes .q-line-coefficient {
  display: flex;
  flex-direction: row;
  align-items: center;
  font-size: 10px;
  gap: 2px;
  justify-content: center;
  white-space: nowrap;
}
.quotes .q-line-coefficient input {
  width: 48px !important;
  max-width: 65%;
  height: 22px !important;
  padding: 0 !important;
  background: #f3f6ee !important;
}
.quotes .q-material-prices {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 8px;
  background: white;
}
.quotes .q-material-prices label {
  max-width: 150px;
  font-size: 12px;
}
.quotes .q-tabs {
  max-width: 100%;
  overflow-x: auto;
  flex-wrap: nowrap;
}
.quotes .q-tabs button {
  flex-shrink: 0;
}
@media (max-width: 1100px) {
  .quotes .q-worksheet {
    font-size: 10px;
  }
  .quotes .q-worksheet textarea {
    font-size: 10px;
  }
  .quotes .q-cell-action {
    font-size: 9px;
  }
}

.quotes .q-worksheet output {
  font-size: 11px;
  white-space: nowrap;
  letter-spacing: -0.25px;
}
.quotes .q-worksheet .total output {
  font-size: 10px;
}

/* The editor scrolls its worksheet; the navigation and action bars stay put. */
.quotes .q-worksheet {
  min-width: 1680px;
  font-size: 13px;
  line-height: 1.35;
}
.quotes .q-workpaper {
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
}
.quotes .q-worksheet input,
.quotes .q-worksheet select {
  height: 28px;
}
.quotes .q-worksheet textarea {
  font-size: 12px;
  height: 52px;
}
.quotes .q-worksheet .q-part-model {
  height: 32px;
  font-size: 12px;
  background: #f6f8f2;
}
.quotes .q-worksheet td.q-left {
  text-align: left;
  padding: 5px 8px;
}
.quotes .q-sheet-footer {
  position: sticky;
  bottom: 0;
  z-index: 3;
  background: #e7eddf;
  max-width: 100%;
  min-width: 0;
}
.quotes .q-sheet-footer .q-tabs {
  position: static;
  box-shadow: none;
  border-top: 0;
}
.quotes .q-xscroll {
  height: 20px;
  overflow-x: scroll;
  overflow-y: hidden;
  width: 100%;
  background: #f1f3ef;
}
.quotes .q-xscroll > div {
  height: 1px;
}
.quotes .q-current-sheet {
  font-size: 14px;
  font-weight: bold;
  color: #173f32;
}
.quotes .q-simple-paper .q-sheet table {
  min-width: 900px;
}

.quotes .q-xscroll::-webkit-scrollbar {
  height: 16px;
}
.quotes .q-xscroll::-webkit-scrollbar-track {
  background: #dce5d8;
}
.quotes .q-xscroll::-webkit-scrollbar-thumb {
  background: #768e80;
  border: 3px solid #dce5d8;
  border-radius: 8px;
}

/* Keep the three material blocks readable without the previous oversized canvas. */
.quotes .q-worksheet {
  min-width: 1380px;
  font-size: 12px;
}
.quotes .q-worksheet input,
.quotes .q-worksheet select {
  height: 26px;
}
.quotes .q-worksheet td.q-ordinal {
  position: relative;
  font-size: 11px;
}
.quotes .q-ordinal .q-cell-action {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  font-size: 0;
}
.quotes .q-ordinal:hover {
  background: #f5f9ee;
}
.quotes .q-ordinal .q-cell-action:focus-visible {
  opacity: 1;
  border: 2px solid #538268;
}
.quotes .q-worksheet .q-part-model {
  height: 28px;
}

/* Direct export choices avoid native popup menus inside the modal dialog. */
dialog.q-dialog.quotes {
  width: min(1000px, 94vw);
  resize: none;
  max-height: 90vh;
}
.quotes .q-export-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  clear: both;
}
.quotes .q-export-choice legend {
  font-size: 14px;
  color: #49675d;
  margin-bottom: 8px;
}
.quotes .q-export-choice > div {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.quotes .q-export-choice label {
  flex-direction: row;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid #cad7c5;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  color: #183d30;
}
.quotes .q-export-choice label:has(input:checked) {
  background: #e7efda;
  border-color: #2b7156;
}
.quotes .q-export-choice input {
  width: auto;
  min-width: 14px;
  margin: 0;
  accent-color: #2b7156;
}
.quotes button.q-delete {
  color: #963c31;
  border-color: #d9bab4;
  background: #fff;
}
@media (max-width: 700px) {
  .quotes .q-export-options {
    grid-template-columns: 1fr;
  }
}

.quotes .q-part-total {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.quotes .q-part-total select {
  font-size: 10px;
  height: 20px;
  background: #f3f6ee;
  max-width: 65px;
}

.q-deal-source {
  display: block;
  font-size: 12px;
  color: #71857a;
  white-space: normal;
}
.q-simple-paper .q-sheet table {
  min-width: 1100px;
}
.q-simple-paper .q-sheet input[data-q-deal-price] {
  background: #f3f6ed;
  min-width: 85px;
}

.inv-filters,
.inv-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.inv-filters label,
.inv-fields label,
.inv-form > label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}
.inv-filters input,
.inv-filters select,
.inv-fields input,
.inv-fields select,
.inv-form > label input {
  width: 100%;
  min-width: 0;
  font-size: 15px;
  padding: 10px;
}
.inv-filters button {
  align-self: end;
}
.inv-toolbar {
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}
.inv-page td,
.inv-page th,
.inv-detail td,
.inv-detail th {
  text-align: center;
  font-size: 14px;
}
.inv-page .pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0;
}
.inv-line {
  padding: 16px;
  border: 1px solid #ccd8cd;
  border-radius: 10px;
  margin: 14px 0;
  background: white;
}
.inv-line-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.inv-line-totals {
  padding: 10px;
  background: #edf2e7;
  font-size: 14px;
}
.inv-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
}
.inv-check input {
  width: auto;
}
.inv-item-text {
  grid-column: span 2;
  align-self: center;
  overflow-wrap: anywhere;
}
.inv-chooser {
  width: min(1000px, 94vw);
  max-height: 88vh;
  border: 1px solid #b4cbbd;
  border-radius: 14px;
  padding: 24px;
  color: #173e32;
  background: #fafbf6;
}
.inv-chooser > input {
  width: 100%;
  margin-bottom: 14px;
}
.inv-choices {
  max-height: 55vh;
  overflow: auto;
  margin-bottom: 16px;
}
.inv-choice {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid #e0e5dc;
}
.inv-choice input {
  width: 20px;
  flex: none;
}
.inv-page .notice {
  line-height: 1.8;
}
.inv-detail .tablewrap {
  max-height: 50vh;
}
.inv-form .inv-fields {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}
@media (max-width: 900px) {
  .inv-form .inv-fields {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}

.inv-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.inv-filters > label {
  min-width: 140px;
  max-width: 220px;
}
.inv-entry-table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}
.inv-entry-table td,
.inv-entry-table th {
  padding: 5px;
  text-align: center;
  border: 1px solid #d6ded3;
  white-space: nowrap;
}
.inv-entry-table input,
.inv-entry-table select {
  border: 1px solid #e0e5dc;
  border-radius: 5px;
  padding: 7px;
  width: 100px;
  min-width: 70px;
  font-size: 14px;
}
.inv-entry-table input[data-inv-field$='item.name'],
.inv-entry-table input[data-inv-field$='item.spec'] {
  width: 160px;
}
.inv-entry-table input[type='checkbox'] {
  width: auto;
}
.inv-entry-table output {
  display: block;
  white-space: normal;
  width: 220px;
  font-size: 13px;
}
.inv-entry-wrap {
  max-height: 55vh;
  overflow: auto;
}
.inv-entry-table thead {
  position: sticky;
  top: 0;
  background: #eef3e7;
  z-index: 1;
}

.inv-choice-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}
.inv-chooser .inv-choice-table td,
.inv-chooser .inv-choice-table th {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid #dae4d7;
  vertical-align: middle;
}
.inv-chooser .inv-choice-table th {
  position: sticky;
  top: 0;
  background: #eef3e7;
}
.inv-chooser .inv-choice-table input[type='checkbox'],
.inv-page input[data-inv-select] {
  width: 18px;
  height: 18px;
  padding: 0;
  margin: 0;
  display: inline-block;
}
.inv-chooser .inv-choice-table td:first-child {
  width: 35px;
}
.inv-choice-table td:nth-child(4) {
  white-space: nowrap;
}
.inv-form h3 {
  margin: 20px 0 10px;
}

/* ===== 新系统共用组件（外观沿用 5.0，见 base.css） ===== */
.dlg-mask { position: fixed; inset: 0; background: #153e3266; z-index: 50; display: flex; align-items: center; justify-content: center; }
.dlg { border: 1px solid var(--line); border-radius: 15px; background: var(--bg); color: var(--ink); width: min(980px, 96vw); max-height: 94vh;
  display: flex; flex-direction: column; overflow: hidden; resize: both; min-width: 340px; min-height: 200px; box-shadow: 0 20px 60px #0003; }
.dlg.large { width: min(1300px, 98vw); }
.dlg.small { width: min(480px, 94vw); resize: none; }
.dlg.maximized { width: 98vw !important; height: 96vh !important; max-height: 96vh; }
.dlg > .modalhead, .dlg > .modalfoot { position: static; flex: none; }
.dlg > .modalbody { flex: 1; overflow: auto; min-height: 0; }
.dlg .modalhead h2 { font-size: 19px; }
.ask-msg { margin-bottom: 12px; color: var(--ink); white-space: pre-line; }
.error.show { display: block; }
.danger-fill { background: #af4d3c; color: #fff; border-color: #af4d3c; }
.toasts { position: fixed; bottom: 25px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--forest); color: #fff; padding: 12px 24px; border-radius: 10px; max-width: 85vw; cursor: pointer; box-shadow: 0 6px 24px #0003; }
.jt-time { display: inline-flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.jt-time label { display: flex; flex-direction: column; gap: 5px; font-size: 14px; color: #789182; }
.jt-time input, .jt-time select { min-height: 42px; padding: 10px 12px; width: 180px; max-width: 100%; border-radius: 10px; }
.jt-time select { width: 200px; }
.filters { align-items: end; }
.sidefoot button { display: inline-block; width: auto; padding: 4px 8px; margin-left: 8px; color: #b7cebf; }
.sidefoot { display: flex; align-items: center; justify-content: space-between; }
td.num, th.num { text-align: right; }
td.c, th.c { text-align: center; }
td .link, .ops .link { padding: 2px 5px; }
.ops { white-space: nowrap; }
.row-sel { width: 38px; }
tr.selected { background: #f0f6e6; }
.right { text-align: right; }
.money { font-variant-numeric: tabular-nums; }
.red { color: #b03a2e; }
.green { color: var(--green); }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; }
.kv > span:nth-child(odd) { color: var(--muted); }
.edit-table input, .edit-table select { width: 100%; padding: 5px 6px; font-size: 12px; border-radius: 6px; }
.edit-table td, .edit-table th { padding: 5px 4px; }
.paper-frame { width: 100%; height: 70vh; border: 1px solid var(--line); background: #fff; border-radius: 8px; }
.dlg.maximized .paper-frame { height: calc(96vh - 190px); }
.paper-preview { background: #e9ece9; padding: 14px; overflow: auto; min-height: 60vh; border-radius: 8px; }
.paper-preview .sheet { background: #fff; margin: 0 auto 14px; box-shadow: 0 1px 6px rgba(0,0,0,.18); }
.paper-dialog .modalbody { padding: 10px; }
.edit-table button { white-space: nowrap; padding: 6px 8px; }
.found-line { background: #fff7d6 !important; }
.line-total td { font-weight: 700; background: #f3f6ee; }
.statement-lines { table-layout: auto; }
.statement-lines td, .statement-lines th { white-space: nowrap; }
.statement-lines td:nth-child(4), .statement-lines td:nth-child(5) { white-space: normal; min-width: 90px; }
.ops-col .link { display: block; text-align: left; }

/* ===== 公司账目（5.0 总账页面的样式，统一到主界面配色） ===== */
.badge.bad { background: #faebe5; color: #af5b44; }
.badge.grey { background: #edf0ec; color: #81907d; }
.amount-note { margin: 14px 0; font-size: 11px; color: #889381; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.detail-grid > div { background: #f6f8f2; padding: 8px 10px; border-radius: 6px; overflow-wrap: anywhere; }
.detail-grid small { display: block; margin-bottom: 4px; color: #7c8983; font-size: 12px; }
.detail-grid .wide { grid-column: 1/-1; }
pre.audit { white-space: pre-wrap; font-size: 11px; background: #f6f8f2; padding: 10px; border-radius: 6px; max-height: 300px; overflow: auto; }
.grid-status { display: flex; align-items: center; justify-content: space-between; padding: 7px 10px; color: #647c67; font-size: 11px; }
.fixed-panel .tablewrap { overflow-x: auto; }
.fixed-grid { width: 100%; table-layout: fixed; font-size: 12px; border-collapse: collapse; }
.fixed-grid th, .fixed-grid td { padding: 0; border: 1px solid #d9e0df; white-space: nowrap; overflow: visible; }
.fixed-grid thead th { background: #235576; color: #fff; font-size: 12px; text-align: center; height: 33px; font-weight: 600; }
.fixed-grid tbody th { font-weight: 400; text-align: left; background: #fff; height: 29px; }
.fixed-grid tbody tr:hover td { background: #f5f9fc; }
.fixed-grid .project-name { font-size: 12px; color: #215575; border: 0; background: none; border-radius: 0; padding: 3px 7px; width: 100%; text-align: left; white-space: normal; line-height: 1.3; }
.fixed-cell { width: 100%; min-width: 0; padding: 5px 4px; text-align: right; border: 0 !important; border-radius: 0 !important; background: transparent; font: 12px/1.4 Consolas, 'Microsoft YaHei', sans-serif; color: #155bb2; font-variant-numeric: tabular-nums; height: 29px; }
.fixed-cell:focus { outline: 2px solid #398858; outline-offset: -2px; background: #fff; position: relative; z-index: 1; }
.fixed-cell.edited { background: #fff6d9; }
.fixed-cell.invalid { background: #ffdfd5; color: #a3291b; }
.fixed-grid .total { padding: 4px; font-weight: 500; color: #1c3d49; text-align: right; }
.fixed-grid tfoot { background: #e0edf4; font-weight: 700; }
.fixed-grid tfoot th, .fixed-grid tfoot td { padding: 7px 4px; font-size: 11px; text-align: right; }
.fixed-grid.transposed thead th { white-space: normal; font-size: 11px; line-height: 1.3; padding: 5px 3px; }
.fixed-grid.transposed tbody th { padding-left: 10px; }
.daily-batch td input, .daily-batch td select { width: 100%; margin-bottom: 3px; }
@media print { .sidebar, .top, .module-tabs, .titlebar .actions, .tabs { display: none !important; } }
.top .has-pending { background: #faebe5; color: #af5b44; border-color: #e8c4b8; }
/* 可填可选输入框（5.0 finished-ui 的样式） */
.jt-input-select,.stock-combo{position:relative;display:flex;align-items:stretch;width:100%;min-width:0;border:1px solid #cad7cf;border-radius:9px;background:#fff;overflow:hidden;box-sizing:border-box;transition:border-color .15s}
.jt-input-select:focus-within,.stock-combo:focus-within{border-color:#6b967b;box-shadow:0 0 0 2px #6b967b22}
.jt-input-select>input,.stock-combo>input{display:block;flex:1 1 0%;width:100%!important;min-width:0!important;max-width:none;margin:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;outline:none!important;background:transparent!important;min-height:40px;padding:9px 12px!important;font:inherit;box-sizing:border-box}
.jt-input-select>button,.stock-combo>button{position:static!important;flex:0 0 34px;width:34px!important;min-width:34px;max-width:34px;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;background:transparent;color:#245c4c;font-size:13px;line-height:1;white-space:nowrap;cursor:pointer;align-self:stretch}
.jt-input-select>button:hover,.stock-combo>button:hover{background:#eef4ee}
.jt-choice-list{position:fixed;box-sizing:border-box;z-index:2147483000;margin:0;padding:4px;max-height:260px;overflow:auto;border:1px solid #bfcec4;border-radius:8px;background:white;box-shadow:0 6px 20px #173e3229;color:#203e35;font:14px/1.5 'Microsoft YaHei',sans-serif}
.jt-choice-option{padding:9px 10px;cursor:pointer;border-radius:5px;overflow-wrap:anywhere;white-space:normal}
.jt-choice-option:hover,.jt-choice-option[aria-selected=true]{background:#e7efdf}
.jt-choice-empty{padding:10px;color:#7d8b81;font-size:13px}
.q-worksheet .jt-input-select>input{min-height:28px;padding:3px 6px!important}
@media print{.jt-choice-list{display:none!important}}
/* 横向滚动条常显（见 ui/global.ts） */
.jt-hbar{position:fixed;height:16px;overflow-x:scroll;overflow-y:hidden;z-index:60;display:none;background:#f3f6f2cc}
.jt-hbar>div{height:1px}
@media print{.jt-hbar{display:none!important}}
/* 勾选框加大，点击所在单元格也能勾选 */
input[type=checkbox]{width:20px;height:20px;min-width:20px;min-height:0;cursor:pointer;vertical-align:middle}
td:has(>input[type=checkbox]:only-child),th:has(>input[type=checkbox]:only-child){cursor:pointer}
.row-sel{width:44px}

/* 必填项提示：显示在输入框旁边 */
.field-bad input, .field-bad select { border-color: #c0392b !important; background: #fff5f3; }
.field-error { color: #b03a2e; font-size: 12px; margin-top: 3px; }

.stale-banner{position:sticky;top:0;z-index:300;background:#b03a2e;color:#fff;padding:10px 16px;font-size:15px;text-align:center}

/* ===== 2026-10-22 版面：表格按内容分宽度、详情窗口放宽（只影响屏幕，打印 / 导出不变） ===== */
@media screen {
  table { table-layout: auto; }
  td { overflow-wrap: break-word; }
  th { white-space: nowrap; }
  /* 短列不换行：勾选框、金额数字、状态、操作 */
  td.num, th.num, .badge { white-space: nowrap; }
  td:has(> input[type=checkbox]:only-child), th:has(> input[type=checkbox]:only-child) { width: 1%; white-space: nowrap; }
  table:has(> tbody > tr > td:first-child > input[type=checkbox]:only-child) > thead > tr > th:first-child { width: 1%; }
  td:last-child:has(> button.link), td:last-child:has(> .link) { white-space: nowrap; width: 1%; }
  td > button.link + button.link { margin-left: 2px; }
  /* 固定格子的表照旧 */
  .fixed-grid { table-layout: fixed; }

  /* 详情窗口放宽 */
  .dlg { width: min(1100px, 96vw); }
  .dlg.large { width: min(1600px, 98vw); }
  dialog { width: min(1100px, 96vw); }
  dialog.large { width: min(1600px, 98vw); }

  /* 资料卡式详情：一行 3～4 项 */
  .detail-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

  /* 仓库库存余额：名称、规格宽，其余收窄 */
  .inv-stock td:nth-child(4) { min-width: 110px; }
  .inv-stock td:nth-child(5) { min-width: 170px; }
  .inv-stock td:nth-child(3) { min-width: 90px; max-width: 150px; }
  .inv-stock td:nth-child(2), .inv-stock td:nth-child(6), .inv-stock td:nth-child(7) { white-space: nowrap; }
}
@media screen {
  .inv-documents td:nth-child(2), .inv-documents td:nth-child(3), .inv-purchases td:nth-child(2), .inv-purchases td:nth-child(3),
  .inv-ledger td:nth-child(2), .inv-ledger td:nth-child(3) { white-space: nowrap; }
}

/* 固定开销表：费用项目列收窄，月份格用比例字体，数字完整显示 */
.fixed-cell { font: 12px/1.4 'Segoe UI', 'Microsoft YaHei', Arial, sans-serif; font-variant-numeric: tabular-nums; padding: 5px 5px; }
.fixed-grid .project-name { padding: 3px 6px; }
.fixed-grid tfoot th, .fixed-grid tfoot td { font-size: 12px; padding: 7px 5px; }
/* 屏幕放大或窄屏时：表格不再硬挤，最窄 1120 像素，放不下就左右拖动；合计行字稍小 */
.fixed-grid:not(.transposed) { min-width: 1120px; }
.fixed-grid tfoot td { font-size: 11.5px; font-weight: 600; letter-spacing: -0.2px; padding: 7px 4px; }

/* 仓库：“更多单据”下拉 */
.more-docs { position: relative; display: inline-block; }
.more-docs-menu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 30; min-width: 180px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 6px; display: flex; flex-direction: column; }
.more-docs-menu button { text-align: left; background: none; border: 0; padding: 9px 12px; border-radius: 6px; font: inherit; color: var(--ink); cursor: pointer; white-space: nowrap; }
.more-docs-menu button:hover { background: var(--bg); }
@media screen {
  /* 库存余额：数字列不换行 */
  .inv-stock td:nth-child(8), .inv-stock td:nth-child(9), .inv-stock td:nth-child(10) { white-space: nowrap; }
  /* 库存流水：名称 / 规格放宽，数字列收窄不换行，一屏放得下 */
  .inv-ledger td:nth-child(5) { min-width: 150px; }
  .inv-ledger td:nth-child(4), .inv-ledger td:nth-child(6), .inv-ledger td:nth-child(7), .inv-ledger td:nth-child(8), .inv-ledger td:nth-child(9) { white-space: nowrap; }
  .inv-ledger td:nth-child(10) { min-width: 80px; }
  .inv-ledger td:nth-child(3) { white-space: normal !important; min-width: 56px; }
  .inv-ledger td:nth-child(2) span, .inv-documents td:nth-child(2) span { font-size: 12px; }
  .inv-documents td:nth-child(7), .inv-documents td:nth-child(8) { white-space: nowrap; }
}

.sub.warn {
  color: #b45309;
}

.stmt-sum-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.stmt-summary tr.clickable {
  cursor: pointer;
}
.stmt-summary tr.clickable:hover td {
  background: rgba(46, 125, 80, 0.06);
}
.stmt-summary .link {
  color: var(--accent, #1f6b45);
  white-space: nowrap;
}

/* 2026-11-13 记账窗口 */
.qb-tip { margin: 0 0 10px; }
.qb { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.qb-row { border: 1px solid var(--line, #e3e6df); border-radius: 10px; padding: 8px 10px; background: #fff; }
.qb-row.income { border-color: #b7d7c2; background: #f4faf6; }
.qb-main { display: grid; grid-template-columns: 150px minmax(160px, 1fr) 120px 200px 72px 52px 28px; gap: 8px; align-items: center; }
.qb-main input, .qb-main select, .qb-more input { margin: 0; width: 100%; }
.qb-pay { display: flex; gap: 6px; }
.qb-pay select { min-width: 0; }
.qb-amt { text-align: right; }
.qb-more { display: grid; grid-template-columns: 1fr 1fr 200px auto; gap: 8px; align-items: center; margin-top: 8px; }
.qb-op { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.qb-main .link { white-space: nowrap; text-align: left; }
.qb-total { margin-right: auto; color: var(--muted); }
.qb-total b { color: inherit; }
@media (max-width: 760px) {
  .qb-main { grid-template-columns: 1fr 1fr; }
  .qb-main .qb-item { grid-column: 1 / -1; order: -1; }
  .qb-more { grid-template-columns: 1fr; }
}

/* 2026-11-13 日常收支列表 */
.daily-list table { border-collapse: collapse; }
.daily-list tr.dl-day td { background: var(--soft, #f1f4ec); padding: 7px 12px; font-size: 13px; border-top: 1px solid var(--line, #e3e6df); }
.daily-list tr.dl-day td b { margin-right: 14px; }
.daily-list tr.dl-day td span { color: var(--muted); }
.daily-list tr.dl-row { cursor: pointer; }
.daily-list tr.dl-row:hover td { background: rgba(46, 125, 80, 0.05); }
.daily-list tr.dl-row td { padding-top: 9px; padding-bottom: 9px; vertical-align: middle; }
.daily-list .dl-item { min-width: 220px; }
.daily-list .dl-item .sub { max-width: 520px; }
.daily-list .dl-party { color: var(--muted); max-width: 200px; }
.daily-list .dl-amt { font-weight: 600; white-space: nowrap; }
.daily-list .dl-amt.inc { color: #1f7a45; }
.daily-list .dl-pay { white-space: nowrap; }
.daily-list .dl-ops { width: 96px; text-align: right; white-space: nowrap; }
.daily-list .dl-ops-in { position: relative; display: inline-flex; gap: 10px; align-items: center; }
.daily-list .dl-more { font-size: 18px; line-height: 1; padding: 0 4px; }
.daily-list .dl-menu { position: absolute; right: 0; top: 100%; z-index: 20; background: #fff; border: 1px solid var(--line, #e3e6df); border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.12); display: flex; flex-direction: column; min-width: 96px; padding: 4px; }
.daily-list .dl-menu button { border: 0; background: none; text-align: left; padding: 7px 10px; border-radius: 6px; cursor: pointer; font: inherit; }
.daily-list .dl-menu button:hover { background: var(--soft, #f1f4ec); }
.daily-list .dl-menu button.danger { color: #b42318; }
@media (max-width: 760px) {
  .daily-list .dl-party { display: none; }
}
.daily-list .dl-det { margin-top: 4px; display: table; font-size: 12px; color: var(--muted); }
.daily-list .dl-det-line { display: table-row; }
.daily-list .dl-det-line span { display: table-cell; padding: 1px 14px 1px 0; white-space: nowrap; }
.daily-list .dl-det-line .n { color: var(--ink, #2a3a30); }
.daily-list .dl-det-line .q, .daily-list .dl-det-line .p { text-align: right; font-variant-numeric: tabular-nums; }
.daily-list .dl-party { font-size: 12px; max-width: 120px; width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 2026-11-13 我的待办 */
.td-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.td-chips .chip { border: 1px solid var(--line, #dfe3da); background: #fff; border-radius: 999px; padding: 5px 12px; cursor: pointer; font: inherit; font-size: 13px; }
.td-chips .chip.on { background: #1f5c43; border-color: #1f5c43; color: #fff; }
.td-chips input[type=date] { width: auto; margin: 0; padding: 4px 8px; }
.td-row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; align-items: end; margin-bottom: 10px; }
.td-due .lbl { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.td-due .td-chips { margin-bottom: 0; }
.td-repeat { border-top: 1px dashed var(--line, #dfe3da); margin-top: 12px; padding-top: 10px; }
.td-repeat label.inline { display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.td-list { display: flex; flex-direction: column; gap: 14px; }
.td-group h4 { margin: 0 0 6px; font-size: 14px; display: flex; gap: 8px; align-items: center; }
.td-group h4 span { background: var(--soft, #eef2e8); border-radius: 999px; padding: 0 8px; font-size: 12px; color: var(--muted); }
.td-group.late h4 { color: #b42318; }
.td-item { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: start; padding: 10px 12px; background: #fff; border: 1px solid var(--line, #e3e6df); border-radius: 10px; margin-bottom: 6px; }
.td-item input[type=checkbox] { width: 18px; height: 18px; margin: 2px 0 0; }
.td-item.late { border-left: 3px solid #d92d20; }
.td-item.done { opacity: .6; }
.td-item.done .td-title b { text-decoration: line-through; }
.td-title { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.td-tag { font-size: 11px; border: 1px solid var(--line, #dfe3da); border-radius: 4px; padding: 0 5px; color: var(--muted); }
.td-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.td-meta .late { color: #b42318; font-weight: 600; }
.td-meta .link { font-size: 12.5px; padding: 0; }
.td-ret { font-size: 12.5px; color: #b45309; margin-top: 3px; }
.td-notes { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.td-ops { display: flex; gap: 10px; white-space: nowrap; }
.td-panel { margin-bottom: 16px; }
.td-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.td-panel-head h3, .td-panel-head h4 { margin: 0; }
.td-panel-head em.late, .td-person em { color: #b42318; font-style: normal; }
.td-people { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.td-person { border: 1px solid var(--line, #dfe3da); background: #fff; border-radius: 10px; padding: 8px 14px; text-align: left; cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 2px; }
.td-person span { font-size: 12.5px; color: var(--muted); }
.td-person.on { border-color: #1f5c43; box-shadow: 0 0 0 2px rgba(31,92,67,.15); }
.td-perm { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.td-order { border: 1px solid var(--line, #e3e6df); border-radius: 10px; padding: 10px 12px; margin: 12px 0; background: #fbfcf9; }
.td-steps { display: flex; flex-wrap: wrap; gap: 8px; }
.td-step { border: 1px solid var(--line, #dfe3da); border-radius: 8px; padding: 6px 10px; background: #fff; display: flex; flex-direction: column; font-size: 13px; min-width: 120px; }
.td-step span { font-size: 12px; color: var(--muted); }
.td-step.done { background: #eef7f1; border-color: #b7d7c2; }
.td-step.doing { border-color: #e0b44a; background: #fffaf0; }
.td-step.late { border-color: #f1a7a0; background: #fff5f4; }
@media (max-width: 760px) {
  .td-item { grid-template-columns: 22px 1fr; }
  .td-ops { grid-column: 2; }
}
.td-order { padding: 6px 10px; margin: 10px 0; }
.td-order-line { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; width: 100%; border: 0; background: none; padding: 4px 0; font: inherit; text-align: left; cursor: pointer; }
.td-order-line span { color: var(--muted); font-size: 13px; }
.td-order-line span.late { color: #b42318; }
.td-order-line em { margin-left: auto; font-style: normal; color: var(--g2, #1f5c43); font-size: 13px; }
.td-order .td-steps { margin: 6px 0 4px; }
.td-lbl { display: block; font-size: 13px; color: var(--muted); margin: 6px 0 6px; }
.td-dot { width: 8px; height: 8px; border-radius: 50%; background: #d92d20; display: inline-block; }
.td-item .td-body { cursor: pointer; min-width: 0; }
.td-item.open { box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.td-more { margin-top: 10px; border-top: 1px dashed var(--line, #dfe3da); padding-top: 10px; display: flex; flex-direction: column; gap: 10px; cursor: default; }
.td-actions2 { display: flex; gap: 8px; flex-wrap: wrap; }
.td-comments { display: flex; flex-direction: column; gap: 6px; }
.td-c { background: var(--soft, #f1f4ec); border-radius: 8px; padding: 6px 10px; max-width: 640px; }
.td-c.me { background: #e8f3ec; }
.td-c b { margin-right: 8px; font-size: 13px; }
.td-c span { font-size: 12px; color: var(--muted); }
.td-c p { margin: 2px 0 0; }
.td-say { display: flex; gap: 8px; }
.td-say input { flex: 1; margin: 0; }
.td-log { font-size: 12.5px; color: var(--muted); }
.td-log summary { cursor: pointer; }
.td-log div { padding: 2px 0 2px 12px; }
.td-new { color: #b42318; margin-left: 12px; font-size: 14px; }
.td-lines { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; max-height: 260px; overflow: auto; }
.tdb input, .tdb select { margin: 0; width: 100%; min-width: 90px; }
.tdb td { padding: 4px; }
.tdb-cc { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.tdb-cc .td-chips { margin: 0; }
.td-step .link { font-size: 12px; padding: 0; text-align: left; }
.up-mini { position: fixed; right: 16px; bottom: 16px; z-index: 60; background: #fff; border: 1px solid var(--line, #dfe3da); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.15); padding: 10px 14px; max-width: 360px; font-size: 13px; }
.up-mini div { margin-top: 3px; word-break: break-all; }
.up-mini-btns { display: flex; gap: 14px; justify-content: flex-end; }

/* 2026-11-14 待办简化：一张清单 + 右侧详情 */
.td-seg { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }
.td-seg button { border: 1px solid var(--line, #dfe3da); background: #fff; border-radius: 10px; padding: 8px 16px; cursor: pointer; font: inherit; display: flex; gap: 8px; align-items: center; }
.td-seg button b { font-size: 16px; }
.td-seg button em { font-style: normal; color: #b42318; font-size: 12.5px; }
.td-seg button.on { background: #1f5c43; border-color: #1f5c43; color: #fff; }
.td-seg button.on em { color: #ffd0cc; }
.td-people { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.td-people .chip { border: 1px solid var(--line, #dfe3da); background: #fff; border-radius: 999px; padding: 5px 12px; cursor: pointer; font: inherit; font-size: 13px; }
.td-people .chip.on { background: #1f5c43; color: #fff; border-color: #1f5c43; }
.td-people .chip em { font-style: normal; color: #b42318; }
.td-people .chip.on em { color: #ffd0cc; }
.td-tbl { background: #fff; border: 1px solid var(--line, #e3e6df); border-radius: 12px; overflow: hidden; }
.td-r { display: grid; grid-template-columns: 34px minmax(0, 1fr) 90px 110px 76px; gap: 8px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line, #eef0ea); cursor: pointer; }
.td-tbl > .td-r:first-child { border-top: 0; }
.td-r:hover { background: #f7f9f4; }
.td-r input[type=checkbox] { width: 18px; height: 18px; margin: 0; }
.td-h { background: var(--soft, #f3f5ef); color: var(--muted); font-size: 12.5px; cursor: default; padding: 7px 14px; }
.td-h:hover { background: var(--soft, #f3f5ef); }
.td-r-t { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.td-r-t span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.td-r-t em { font-style: normal; font-size: 12px; color: var(--muted); }
.td-r-w { font-size: 13.5px; }
.td-r-d { font-size: 13.5px; color: var(--muted); }
.td-r-d.late { color: #b42318; font-weight: 600; }
.td-r-s { font-size: 12.5px; border-radius: 6px; padding: 2px 8px; text-align: center; background: #f1f3ee; color: #5b6b62; }
.td-r-s.s-进行中 { background: #fff4dc; color: #8a5a00; }
.td-r-s.s-被退回 { background: #fde8e6; color: #b42318; }
.td-r-s.s-已完成 { background: #e8f3ec; color: #1f7a45; }
.td-r.done .td-r-t b { text-decoration: line-through; color: var(--muted); }
.td-tbl:has(.td-h > :nth-child(5)) .td-r { grid-template-columns: 34px minmax(0, 1fr) 90px 110px 76px; }
.td-tbl:not(:has(.td-h > :nth-child(5))) .td-r { grid-template-columns: 34px minmax(0, 1fr) 110px 76px; }
.td-donebtn { margin: 8px 14px; }
.td-tbl .empty { padding: 22px; }
.td-drawer-mask { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.25); display: flex; justify-content: flex-end; }
.td-drawer { width: min(520px, 100vw); height: 100%; background: var(--bg, #f6f7f3); box-shadow: -8px 0 30px rgba(0,0,0,.15); display: flex; flex-direction: column; }
.td-drawer-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 18px 8px; }
.td-drawer-h h3 { margin: 0; font-size: 19px; }
.td-drawer-ops { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 18px 12px; border-bottom: 1px solid var(--line, #e3e6df); }
.td-drawer-b { padding: 14px 18px; overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.td-drawer-b h4 { margin: 10px 0 0; }
.td-kv { display: grid; grid-template-columns: 70px 1fr; gap: 10px; font-size: 14px; }
.td-kv > span { color: var(--muted); }
.td-drawer-foot { display: flex; gap: 18px; justify-content: flex-end; margin-top: 12px; }
.td-big { font-size: 17px; padding: 10px 12px; margin: 4px 0 10px; width: 100%; }
.td-line { display: grid; grid-template-columns: 58px 1fr; gap: 10px; align-items: center; margin-bottom: 10px; }
.td-line .lbl { color: var(--muted); font-size: 13.5px; }
.td-line select, .td-line input { margin: 0; }
.td-line .td-chips { margin: 0; }
.td-morebtn { margin: 2px 0 8px; }
.td-morebox { border: 1px dashed var(--line, #dfe3da); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.td-sec { border-bottom: 1px solid var(--line, #e3e6df); padding: 6px 0 14px; margin-bottom: 8px; }
.td-sec h3 { margin: 6px 0; }
.td-rule { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--line, #eef0ea); }
.td-rule span { color: var(--muted); font-size: 13px; }
.td-rule-ops { margin-left: auto; display: flex; gap: 12px; }
.td-steps-help { font-size: 13px; padding-left: 18px; line-height: 1.7; }
.td-panel .td-tbl { margin-top: 6px; }
@media (max-width: 760px) {
  .td-r, .td-tbl:has(.td-h > :nth-child(5)) .td-r, .td-tbl:not(:has(.td-h > :nth-child(5))) .td-r { grid-template-columns: 30px minmax(0, 1fr) 70px; }
  .td-r-w, .td-r-s, .td-h > :nth-child(n+4) { display: none; }
  .td-line { grid-template-columns: 1fr; }
}
/* 2026-11-15 订单出货窗口：搜索 + 勾选 */
.ship-pick-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0; }
.wh-seg { display: inline-flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; margin: 4px 0 10px; }
.wh-seg button { border: 0; border-radius: 0; border-right: 1px solid var(--line); padding: 7px 14px; background: none; }
.wh-seg button:last-child { border-right: 0; }
.wh-seg button.on { background: var(--forest); color: #fff; }
.inv-more { position: relative; align-self: flex-end; }
.inv-more > summary { list-style: none; cursor: pointer; border: 1px solid var(--line); border-radius: 9px; padding: 8px 14px; background: #fff; }
.inv-more > summary::-webkit-details-marker { display: none; }
.inv-more[open] > summary { border-color: var(--green); color: var(--green); }
.inv-more[open] { display: contents; }
.inv-more[open] > summary { order: 0; }
.flow-note { margin-top: 3px; font-size: 12px; color: #276e55; background: #eef5e8; border-radius: 6px; padding: 1px 6px; display: inline-block; }
/* 2026-11-15 生产进度 / 闲置材料 */
.pg-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 14px; }
.pg-card { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; text-align: left; color: var(--muted); }
.pg-card b { font-size: 24px; color: var(--ink); }
.pg-card.on { border-color: var(--green); box-shadow: 0 0 0 2px #dce8bc; }
.pg-card .late { color: #b84236; font-size: 12px; }
.pg-st { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; background: #eef1ec; color: #50625a; white-space: nowrap; }
.pg-st.st-no { background: #ffe9e6; color: #b84236; }
.pg-st.st-part { background: #fff4e0; color: #8a5a00; }
.pg-st.st-ok { background: #e6f2e9; color: #276e55; }
tr.pg-late td { background: #fff6f4; }
td.late { color: #b84236; font-weight: 600; }
/* 2026-11-21 日常收支发票 */
.inv-tag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px; font-size: 11px; background: #e6f0fb; color: #2a5d9f; vertical-align: 1px; }
.inv-filter { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; margin: 0 0 10px; }
.inv-filter button { border: 0; border-radius: 0; border-right: 1px solid var(--line); padding: 6px 12px; background: none; }
.inv-filter button:last-child { border-right: 0; }
.inv-filter button.on { background: var(--forest); color: #fff; }
