/* Record view: one identity group, then boxes, then source-order contents. */
.record-panel[hidden] {
  display: none;
}
.record-panel {
  border-color: #dce5da;
  box-shadow: 0 4px 18px #34523108;
}
.record-panel .records-heading {
  padding: 24px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
}
.record-panel .records-heading h2 {
  font-size: 17px;
  gap: 10px;
}
.record-panel .records-heading p {
  font-size: 12px;
  margin-top: 8px;
  color: #778a78;
}
.record-panel .record-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}
.record-panel .record-actions input {
  width: 220px;
  height: 38px;
  font-size: 12px;
}
.record-panel .record-actions select {
  height: 38px;
  font-size: 12px;
}
.record-panel .record-actions .button {
  height: 38px;
  font-size: 11px;
}
.record-panel .table-wrap {
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
}
.record-panel table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}
.record-panel thead,
.record-panel th {
  position: static;
}
.record-panel th {
  font-size: 12px;
  color: #697e6b;
  background: #f1f5ee;
  padding: 15px 18px;
  border-top: 1px solid #e2e9de;
  border-bottom: 1px solid #dfe7dc;
  font-weight: 600;
}
.record-panel th:first-child {
  width: 14%;
}
.record-panel th:nth-child(2) {
  width: 22%;
}
.record-panel th:nth-child(3) {
  width: 25%;
}
.record-panel th:nth-child(4) {
  width: 39%;
}
.record-panel td {
  padding: 16px 18px;
  border-bottom: 1px solid #edf1e9;
  vertical-align: middle;
  white-space: normal;
}
.record-panel .box-group-start:not(:first-child) > td {
  border-top: 1px solid #dfe7db;
}
.record-panel .identity-group-start:not(:first-child) > td {
  border-top: 7px solid #f3f6f0;
}
.record-panel .record-identity-cell {
  vertical-align: top;
  background: #fbfcf9;
  border-right: 1px solid #e6ece1;
}
.record-identity-cell > strong {
  display: inline-block;
  font:
    650 15px Consolas,
    "Microsoft YaHei",
    monospace;
  color: #326045;
  background: #edf4e8;
  border: 1px solid #dce8d5;
  padding: 7px 10px;
  border-radius: 5px;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.record-identity-cell > span {
  display: block;
  color: #8b9b85;
  font-size: 11px;
  margin-top: 10px;
  padding-left: 2px;
}
.record-panel .record-box-cell {
  vertical-align: top;
  background: white;
  border-right: 1px solid #edf1e8;
}
.record-box-cell > strong {
  display: inline-block;
  font:
    650 15px Consolas,
    "Microsoft YaHei",
    monospace;
  color: #244d36;
  vertical-align: middle;
  margin-right: 8px;
}
.record-status {
  display: inline-block;
  vertical-align: middle;
  padding: 4px 6px;
  border-radius: 4px;
  background: #eaf3e5;
  color: #5e8659;
  font-size: 10px;
  font-weight: 500;
  margin-top: 0;
  white-space: nowrap;
}
.record-status.closed {
  background: #f0f2ed;
  color: #8a9583;
}
.record-box-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 13px;
}
.record-box-actions .text-button {
  padding: 6px 8px;
  border: 1px solid #dde6d7;
  border-radius: 4px;
  background: #fbfdf9;
  color: #5a785a;
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
}
.record-box-actions .text-button:hover {
  background: #ecf4e6;
  border-color: #aac59a;
}
.record-box-actions .record-seal-action {
  color: #8b6838;
  background: #fffdf6;
  border-color: #e9dfc6;
}
.record-panel .record-order-cell {
  font:
    13px/1.5 Consolas,
    "Microsoft YaHei",
    monospace;
  color: #506e57;
  overflow-wrap: anywhere;
}
.record-panel .record-sku-items {
  gap: 8px;
  align-items: center;
}
.record-panel .record-sku-item {
  padding: 7px 10px;
  gap: 10px;
  border-color: #e2e9dc;
  background: #f8faf5;
  border-radius: 4px;
}
.record-panel .record-sku-item code {
  font-size: 13px;
  color: #3f604b;
}
.record-panel .record-sku-item b {
  font-size: 14px;
  color: #2b6a45;
}
.record-panel .table-footer {
  padding: 16px 24px;
  font-size: 11px;
  background: #fcfdfb;
  gap: 14px;
  color: #82927c;
}
.record-panel .table-footer #tableSummary {
  color: #637d60;
  font-weight: 500;
}
@media (max-width: 1200px) {
  .record-panel .record-actions {
    width: 100%;
    margin-left: 0;
  }
  .record-panel .record-actions input {
    flex: 1;
    min-width: 190px;
  }
  .record-panel table {
    min-width: 810px;
  }
  .record-panel .records-heading {
    align-items: flex-start;
  }
}
@media (max-width: 760px) {
  .record-panel .records-heading {
    padding: 20px;
  }
  .record-panel .record-actions input {
    flex-basis: 100%;
  }
  .record-panel .record-actions .button {
    flex: 1;
  }
  .record-panel th:first-child {
    width: 14%;
  }
  .record-panel th:nth-child(2) {
    width: 23%;
  }
  .record-panel th:nth-child(3) {
    width: 25%;
  }
  .record-panel th:nth-child(4) {
    width: 38%;
  }
  .record-panel td {
    padding: 15px;
  }
  .record-panel .table-footer {
    padding: 15px 20px;
    flex-direction: column;
    align-items: flex-start;
  }
}

/* SKU and quantity stay separate; supporting times sit below their own field. */
.record-panel table {
  min-width: 1000px;
}
.record-panel th:first-child {
  width: 11%;
}
.record-panel th:nth-child(2) {
  width: 27%;
}
.record-panel th:nth-child(3) {
  width: 22%;
}
.record-panel th:nth-child(4) {
  width: 30%;
}
.record-panel th:nth-child(5) {
  width: 10%;
  text-align: right;
  padding-right: 24px;
}
.record-panel .record-order-cell {
  vertical-align: top;
  padding-top: 18px;
  font-weight: 500;
}
.record-panel .record-sku-cell {
  vertical-align: top;
  padding-top: 16px;
}
.record-panel .record-quantity-cell {
  text-align: right;
  vertical-align: top;
  padding: 17px 24px 16px 8px;
  font-variant-numeric: tabular-nums;
}
.record-quantity-cell > strong {
  font:
    650 21px/1.1 Consolas,
    monospace;
  color: #2b6643;
}
.record-quantity-cell > small {
  display: block;
  font-size: 10px;
  margin-top: 6px;
  color: #9b856e;
}
.box-selection,
.record-sku-line {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 500;
  margin: 0;
  line-height: 1.4;
}
.box-selection input,
.record-sku-line input,
#selectFiltered {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #34724e;
  flex-shrink: 0;
  cursor: pointer;
}
.box-selection strong {
  font:
    650 15px Consolas,
    "Microsoft YaHei",
    monospace;
  color: #285039;
  overflow-wrap: anywhere;
}
.record-sku-line code {
  font:
    500 14px Consolas,
    "Microsoft YaHei",
    monospace;
  color: #31563f;
  overflow-wrap: anywhere;
}
.record-box-cell > .record-status {
  margin: 9px 0 2px 24px;
}
.record-box-times {
  margin: 9px 0 0 24px;
  display: grid;
  gap: 5px;
  font-size: 10px;
  color: #87937f;
}
.record-box-times > span {
  display: flex;
  gap: 7px;
  align-items: baseline;
  flex-wrap: wrap;
}
.record-box-times time {
  font:
    11px/1.5 Consolas,
    "Microsoft YaHei",
    monospace;
  color: #73846c;
}
.record-box-cell .record-box-actions {
  margin-left: 24px;
  margin-top: 12px;
}
.record-scan-time {
  font:
    11px/1.7 Consolas,
    "Microsoft YaHei",
    monospace;
  color: #84917d;
  margin: 7px 0 0 24px;
}
.scan-time-detail {
  margin: 5px 0 0 24px;
  font-size: 10px;
  color: #61805e;
}
.scan-time-detail summary {
  cursor: pointer;
  width: fit-content;
}
.scan-time-list {
  max-height: 180px;
  overflow-y: auto;
  margin: 8px 0 0;
  padding: 10px 10px 10px 30px;
  background: #f5f8f1;
  border: 1px solid #e2e9db;
  border-radius: 4px;
  font:
    10px/1.9 Consolas,
    monospace;
  color: #77866d;
}
.record-filterbar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  padding: 0 24px 16px;
}
.record-filterbar > label {
  font-size: 11px;
  margin: 0 3px 0 0;
  color: #71876c;
}
.record-filterbar select,
.record-filterbar input {
  height: 34px;
  font-size: 11px;
  padding: 5px 9px;
}
.record-filterbar select {
  min-width: 126px;
}
.record-filterbar input {
  width: 144px;
}
.record-filterbar > span {
  font-size: 11px;
  color: #8b9785;
}
.record-filterbar > small {
  margin-left: auto;
  color: #8d9a86;
  font-size: 10px;
}
.record-filterbar .text-button {
  font-size: 11px;
}
.record-filter-error {
  margin: 0;
  padding: 0 24px 12px;
  font-size: 12px;
  color: #ac684a;
}
.record-filter-error[hidden] {
  display: none;
}
.record-filter-hint {
  margin: 0;
  padding: 0 24px 12px;
  color: #8c987f;
  font-size: 11px;
}
.record-filter-hint[hidden] {
  display: none;
}
.export-selection-bar {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
  border-top: 1px solid #edf1e8;
  background: #fafcf8;
  padding: 12px 24px;
}
.export-selection-bar label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  color: #617b5d;
}
.export-selection-bar > span {
  font-size: 10px;
  color: #8c9985;
}
.export-selection-bar .text-button {
  font-size: 11px;
  margin-left: auto;
}
@media (max-width: 760px) {
  .record-panel table {
    min-width: 1000px;
  }
  .record-panel th:first-child {
    width: 11%;
  }
  .record-panel th:nth-child(2) {
    width: 27%;
  }
  .record-panel th:nth-child(3) {
    width: 22%;
  }
  .record-panel th:nth-child(4) {
    width: 30%;
  }
  .record-panel th:nth-child(5) {
    width: 10%;
  }
  .record-filterbar,
  .export-selection-bar {
    padding-left: 20px;
    padding-right: 20px;
  }
  .record-filterbar > small {
    margin-left: 0;
    flex-basis: 100%;
  }
}
.box-details-dialog{width:min(850px,calc(100vw - 40px));padding:28px;border:1px solid #dce5df;border-radius:16px;color:#254538}
.box-details-meta{white-space:pre-line;line-height:1.9;margin:16px 0 8px}
.box-details-note{font-size:13px;color:#7b8e81;margin-bottom:18px}
.box-details-table-wrap{max-height:55vh;overflow:auto;border:1px solid #e1e9e3;border-radius:8px}
.box-details-table-wrap table{width:100%;border-collapse:collapse}
.box-details-table-wrap th{position:sticky;top:0;background:#f0f5ef;text-align:left}
.box-details-table-wrap td,.box-details-table-wrap th{padding:14px 16px;border-bottom:1px solid #e8eee9}
.detail-time{font-variant-numeric:tabular-nums;white-space:nowrap;font-size:14px}
.detail-tracking{overflow-wrap:anywhere}.detail-voided{color:#89958e;background:#f7f8f7}.detail-void-label{display:block;color:#ac7053}
.box-details-footer{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:16px;font-size:14px;color:#718578}
.record-sku-code{font-size:14px}
.language-switch{display:flex;align-items:center;gap:8px;white-space:nowrap;font-size:13px;color:#607b6c}.language-switch select{min-width:105px;padding:8px 10px;border:1px solid #dce5df;border-radius:7px;background:white;color:#254538}html[lang="es"] .nav{white-space:normal}html[lang="es"] .scan-options{flex-wrap:wrap}html[lang="es"] .header-right{flex-wrap:wrap}html[lang="es"] .button{white-space:normal}html[lang="es"] .record-actions{flex-wrap:wrap}@media(max-width:700px){.language-switch{font-size:12px}.header-right #today{display:none}}

.record-edit-dialog{width:min(960px,94vw);max-height:88vh;padding:28px;border:1px solid #d8e4da;border-radius:14px;color:#21463b;overflow:auto}
.record-edit-dialog::backdrop{background:#173c3155}.record-edit-dialog p{line-height:1.6}.record-edit-meta strong{font-size:22px}.record-edit-table{overflow:auto;margin:20px 0}.record-edit-table table{width:100%;border-collapse:collapse}.record-edit-table th,.record-edit-table td{padding:10px;text-align:left;border-bottom:1px solid #e1e8e1}.record-edit-table input{width:100%;min-width:160px;box-sizing:border-box}.record-edit-table td:last-child input{min-width:80px;width:100px}.record-edit-dialog input,.record-edit-dialog textarea{padding:11px;border:1px solid #cbdacf;border-radius:6px;font:inherit;background:white;color:#21463b}.record-edit-dialog input:disabled,.record-edit-dialog textarea:disabled{background:#f2f5f1;color:#52685d}.record-edit-dialog textarea{display:block;width:100%;box-sizing:border-box;margin-top:8px}.record-edit-dialog .dialog-actions{display:flex;gap:12px;justify-content:flex-end;flex-wrap:wrap;margin-top:22px}#recordEditError{color:#a34520}.record-edit-change{padding:12px 16px;border-left:3px solid #a3bb9c;background:#f3f7f1;margin:10px 0;overflow-wrap:anywhere}.record-edit-change div+div{font-weight:600;margin-top:6px}.record-edit-history{border-top:1px solid #dae4d8;margin-top:24px;padding-top:15px}.record-edit-history details{padding:12px 0;border-bottom:1px solid #e1e8e1}.record-edit-history summary{cursor:pointer}.record-edit-history li{overflow-wrap:anywhere}

.record-edit-table .record-edit-deleted{background:#fff1ec}.record-edit-table .record-edit-deleted input{text-decoration:line-through;opacity:.65}.record-edit-table .record-edit-delete{color:#a54824;white-space:nowrap;min-width:88px}.record-edit-table td:nth-child(3) input{min-width:80px;width:90px}.record-edit-empty-warning{font-weight:700;color:#a54824}

.record-copy-box {display:inline-flex;align-items:center;gap:6px;padding:2px 4px;border:0;border-radius:4px;background:transparent;color:inherit;font:inherit;cursor:copy;text-align:left;}
.record-copy-box > span {font-size:16px;opacity:.65;}
.record-copy-box:hover {background:#e8f1eb;color:#24694f;}
.record-copy-box:focus-visible {outline:2px solid #24694f;outline-offset:3px;}

/* Compact operational ledger: clear box boundaries and quiet metadata. */
.record-panel th:first-child{width:14%}.record-panel th:nth-child(2){width:30%}.record-panel th:nth-child(3){width:26%}.record-panel th:nth-child(4){width:22%}.record-panel th:nth-child(5){width:8%;text-align:right}
.record-panel td{padding:10px 16px;font-family:Arial,"Microsoft YaHei",sans-serif;line-height:1.45}
.record-panel .record-order-cell,.record-panel .record-sku-code{font-family:Consolas,"Microsoft YaHei",monospace;font-size:13px;color:#2d4a3e;font-variant-numeric:tabular-nums}
.record-panel .box-group-start:not(:first-child)>td{border-top:6px solid #eef3ee}
.record-panel .record-box-cell{background:#fafcf9;padding:14px 16px;border-right:1px solid #dfe8df}
.record-box-cell>strong{font-size:16px}.record-panel .record-copy-box{padding:0;gap:7px}
.record-panel .record-box-times{margin-top:8px;gap:3px;font-size:11px;color:#7a897e;line-height:1.5}
.record-panel .record-box-times time{font-size:11px;font-variant-numeric:tabular-nums}
.record-panel .record-station,.record-panel .record-operators{display:inline-block;margin:6px 10px 0 0;font-size:11px;color:#788a7e}
.record-panel .record-box-actions{margin-top:9px;gap:5px}
.record-panel .record-box-actions .text-button{padding:5px 7px;font-size:11px;border-radius:5px;background:white;color:#527462}
.record-panel .record-quantity-cell{text-align:right;background:#fbfdfb;font-variant-numeric:tabular-nums}
.record-panel .record-quantity-cell>strong{font-family:Arial,sans-serif;font-size:17px;font-weight:650;color:#24694f}
.record-panel tbody tr:hover>td:not(.record-identity-cell):not(.record-box-cell){background:#edf5ef}
.record-panel .record-order-cell{border-right:1px solid #edf1eb}
#scanQueueStatus:not(:empty){padding:8px 12px;background:#fff5df;color:#79571e;border-radius:6px;font-size:13px}

.record-panel .record-sku-cell,.record-panel .record-quantity-cell{padding-top:11px;padding-bottom:11px;vertical-align:middle}
.record-panel .record-box-cell .record-box-actions{margin-left:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
.record-panel .record-box-actions .text-button{min-width:0;white-space:normal;text-align:center}
.record-panel .record-order-cell{vertical-align:middle}
@media(min-width:761px){.record-panel table{min-width:0}}

/* Scan details: one parcel section, one SKU/operator row, optional per-piece timestamps. */
#boxDetailsDialog{width:min(960px,calc(100vw - 40px));max-height:90dvh;overflow:auto;padding:24px}
#boxDetailsDialog .box-details-meta{display:grid;grid-template-columns:.7fr 1.2fr 1.2fr;gap:16px;white-space:normal;padding:14px 16px;margin:16px 0 10px}
#boxDetailsMeta>div{display:flex;flex-direction:column;gap:3px;min-width:0}#boxDetailsMeta span{font-size:11px;color:#7d8e82}#boxDetailsMeta strong{font-size:13px;font-weight:500;font-variant-numeric:tabular-nums}
#boxDetailsDialog .box-details-note{margin:10px 0 14px;font-size:12px}
#boxDetailsDialog .box-details-table-wrap{max-height:56dvh;border-color:#d7e2db}
#boxDetailsDialog th{font-size:12px;color:#6e8175;padding:11px 16px;z-index:1}
#boxDetailsDialog .detail-order-heading td{padding:11px 16px;background:#eaf2ed;border-top:7px solid #fff;border-bottom:1px solid #d7e3db}
#boxDetailsDialog .detail-order-heading:first-child td{border-top:0}
.detail-order-heading td>div{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.detail-order-heading span{font-size:11px;color:#718579}.detail-order-heading code{font:600 14px/1.4 Consolas,monospace;color:#245a43;overflow-wrap:anywhere}.detail-order-heading small{margin-left:auto;font-size:11px;color:#6d8274}
#boxDetailsDialog .detail-item-row td{padding:13px 16px;vertical-align:top;background:#fff}#boxDetailsDialog .detail-item-row>td:first-child{width:26%}#boxDetailsDialog .detail-item-row code{font:14px/1.5 Consolas,monospace;overflow-wrap:anywhere}.detail-quantity{width:9%;text-align:center}.detail-quantity strong{font-size:19px;line-height:1.3;color:#24664a}
#boxDetailsDialog .detail-time{font-size:12px;white-space:normal;line-height:1.7;min-width:210px}.detail-operator{display:inline-block;padding:3px 8px;border-radius:5px;background:#f0f4f1;font-size:12px;color:#496554}
.detail-scan-times{margin-top:4px}.detail-scan-times summary{font-size:11px;color:#73877a;cursor:pointer}.detail-scan-times ol{display:grid;gap:3px;padding-left:22px;margin:8px 0 0;color:#6c8173}.detail-scan-times li{padding-left:3px}.detail-scan-times[open]{background:#f6f9f6;padding:7px 10px;border-radius:5px}
@media(max-width:650px){#boxDetailsDialog{padding:16px;width:calc(100vw - 24px)}#boxDetailsDialog .box-details-meta{grid-template-columns:1fr;gap:8px}#boxDetailsMeta>div{flex-direction:row;justify-content:space-between;gap:12px}#boxDetailsDialog .box-details-table-wrap table{min-width:600px}.detail-order-heading small{margin-left:0}}
