/* Transfer lookup and editor stay together in the same browser window. */
.tf-intro { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:18px; }
.tf-intro>div:first-child { display:flex; flex-wrap:wrap; align-items:center; gap:10px; color:#5f6878; font-size:12px; }
.tf-tabs { display:flex; flex-shrink:0; background:#e7e9ee; border:1px solid #dbdee5; border-radius:9px; padding:4px; gap:4px; }
.tf-tabs button { border:0; background:transparent; color:#5d6676; padding:8px 13px; font-size:12px; }
.tf-tabs button[aria-selected=true] { background:#fff; color:#24324b; box-shadow:0 1px 3px #25324b20; font-weight:600; }
.tf-tabs button span { display:inline-block; padding:0 5px; border-radius:4px; background:#dee4f0; }
.tf-layout { display:grid; grid-template-columns:minmax(0,1.12fr) minmax(390px,1fr); align-items:start; gap:20px; }
.tf-lookup { min-width:0; position:sticky; top:16px; overflow:hidden; }
.tf-lookup .card-head,.tf-draft .card-head { padding:17px 19px; }
.tf-lookup .card-head { flex-wrap:wrap; gap:8px; }
.tf-lookup .card-head p,.tf-draft .card-head p { margin-top:4px; }
.tf-query { padding:15px 19px; display:grid; gap:12px; border-bottom:1px solid var(--line); }
.tf-query select { padding:8px 10px; font-size:12px; }
.tf-query .field { gap:5px; font-size:11px; }
.tf-search { display:flex; gap:8px; }
.tf-search input { flex:1; min-width:0; font-size:13px; }
.tf-search button { flex-shrink:0; font-size:12px; padding:9px 14px; }
.tf-query-bottom { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.tf-route-default { display:grid; grid-template-columns:minmax(0,1fr) 16px minmax(0,1fr); align-items:end; gap:9px; padding:14px 19px; background:#eff2f8; border-bottom:1px solid #dee2ea; }
.tf-route-default>.field { min-width:0; font-size:11px; color:#4f5a6d; }
.tf-route-default select { padding:8px 9px; font-size:12px; min-width:0; width:100%; }
.tf-route-default>span { margin-bottom:10px; color:#6e7a91; }
.tf-stock-note { font-size:10px; color:#6b7689; line-height:1.9; padding:11px 19px; border-bottom:1px solid var(--line); }
.tf-matrix { overflow:auto; max-height:calc(100vh - 470px); min-height:190px; }
.tf-matrix table { width:max-content; min-width:100%; border-spacing:0; font-size:12px; }
.tf-matrix th { position:sticky; top:0; z-index:2; background:#f1f3f6; min-width:94px; padding:12px 11px; white-space:normal; text-align:center; }
.tf-matrix th small { display:block; font-size:9px; font-weight:400; color:#62718c; }
.tf-matrix td { padding:12px 9px; vertical-align:middle; }
.tf-matrix .tf-product-col { position:sticky; left:0; background:white; z-index:1; width:225px; min-width:225px; max-width:225px; white-space:normal; border-right:1px solid var(--line); text-align:left; }
.tf-matrix th.tf-product-col { background:#f1f3f6; z-index:3; }
.tf-product-col strong { display:block; font-size:12px; font-weight:600; overflow-wrap:anywhere; }
.tf-product-col>span { display:block; font-size:10px; margin:4px 0 2px; color:#636d80; }
.tf-product-col>small { display:block; font-size:9px; color:#758093; }
.tf-matrix .tf-from-col { background:#ebf0f8; }
.tf-stock-button { min-width:44px; padding:6px 8px; border:1px solid transparent; font-variant-numeric:tabular-nums; background:transparent; color:#31405d; font-size:16px; font-weight:600; }
.tf-stock-button:hover { background:#cfdaed; border-color:#97a6c1; }
.tf-stock-button:disabled { color:#9aa2b0; cursor:default; opacity:.7; }
.tf-stock-button.tf-unknown { color:#80899b; font-weight:400; }
.tf-stock-button.tf-negative { color:#a54a3d; }
.tf-lookup .ledger-footer { padding:12px 16px; gap:8px; font-size:10px; }
.tf-lookup .ledger-footer button { font-size:11px; padding:7px 10px; }
.tf-draft { min-width:0; overflow:hidden; }
.tf-document-fields { padding:17px 19px 7px; display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.tf-document-fields .field { font-size:11px; gap:5px; min-width:0; }
.tf-document-fields input,.tf-document-fields textarea { font-size:12px; padding:8px 10px; width:100%; }
.tf-document-fields textarea { min-height:54px; }
.tf-full { grid-column:1/-1; }
.tf-lines { max-height:48vh; overflow:auto; margin-top:7px; }
.tf-line { padding:15px 19px; border-top:1px solid var(--line); }
.tf-line:nth-child(even) { background:#fbfcfd; }
.tf-line-title { display:flex; gap:9px; align-items:start; margin-bottom:12px; }
.tf-line-number { background:#e8ecf2; color:#5c6981; border-radius:5px; font-size:10px; padding:2px 5px; margin-top:2px; }
.tf-line-title>div { flex:1; min-width:0; }
.tf-line-title strong { display:block; font-weight:600; font-size:12px; overflow-wrap:anywhere; }
.tf-line-title small { display:block; color:#757f92; font-size:10px; margin-top:3px; overflow-wrap:anywhere; }
.tf-line-title .text-button { color:#9b695a; font-size:11px; flex-shrink:0; }
.tf-line-fields { display:grid; grid-template-columns:minmax(0,1fr) 10px minmax(0,1fr) 70px; align-items:end; gap:8px; }
.tf-line-fields .field { font-size:10px; gap:4px; min-width:0; }
.tf-line-fields select,.tf-line-fields input { padding:7px 8px; font-size:11px; width:100%; min-width:0; }
.tf-line-qty input { font-size:14px; text-align:right; padding-left:3px; }
.tf-arrow { padding-bottom:9px; color:#838d9e; font-size:11px; }
.tf-line-fields .tf-line-memo { grid-column:1/-1; }
.tf-line-stock { font-size:9px; color:#717c90; line-height:1.8; margin-top:8px; }
.tf-line-stock>span { display:block; }
.tf-stale { color:#a47635 !important; }
.tf-empty-lines { padding:33px 20px; text-align:center; color:#6e788b; border-top:1px dashed #d3d9e4; margin:12px 19px 0; }
.tf-empty-lines>span { font-size:25px; color:#6d7e9e; display:block; margin-bottom:7px; }
.tf-empty-lines h3 { font-size:13px; }
.tf-empty-lines p { margin-top:7px; font-size:11px; line-height:1.9; }
.tf-summary { display:flex; justify-content:space-between; gap:15px; padding:15px 19px; border-top:1px solid #d8dde7; background:#eff2f8; font-size:12px; }
.tf-summary strong { font-variant-numeric:tabular-nums; color:#34425c; font-size:19px; font-weight:600; margin:0 4px; }
.tf-save-note { padding:12px 19px 0; color:#697385; font-size:10px; line-height:1.8; }
.tf-save-actions { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:8px; padding:12px 19px 18px; }
.tf-save-actions button { font-size:12px; padding:10px 12px; }
.tf-save-actions button:first-child { margin-right:auto; }
.tf-error { color:#a44035; font-size:12px; padding:0 19px; line-height:1.7; }
.tf-error:empty { display:none; }
.tf-error:not(:empty) { margin-top:10px; }
.tf-alert,.tf-success { display:flex; align-items:center; flex-wrap:wrap; gap:8px; font-size:12px; padding:12px 18px; background:#fff4e2; color:#8f6735; border-bottom:1px solid #efd7b5; }
.tf-alert { margin-bottom:12px; border-radius:6px; }
.tf-success { background:#e5ebf6; color:#394863; border-color:#c6d1e6; }
.tf-alert button,.tf-success button { font-size:11px; padding:5px 9px; }
.tf-history-filters { display:flex; align-items:end; gap:12px; flex-wrap:wrap; padding:18px 22px; border-bottom:1px solid var(--line); }
.tf-history-filters .field { font-size:11px; }
.tf-history-filters input,.tf-history-filters select { font-size:12px; padding:8px 10px; }
.tf-history-query { flex:1; min-width:210px; }
.tf-history-filters>button { font-size:12px; padding:8px 10px; }
#tf-record-table td { font-size:12px; white-space:normal; max-width:300px; vertical-align:middle; }
#tf-record-table td:first-child { min-width:155px; }
.tf-record-actions { display:flex; flex-wrap:wrap; gap:5px; }
.tf-record-actions button { padding:5px 9px; font-size:11px; }
.tf-preview { margin:10px 19px 20px; padding:19px; border:1px solid var(--line); background:#fff; border-radius:6px; }
.tf-preview-title { display:flex; gap:10px; align-items:start; justify-content:space-between; margin-bottom:16px; }
.tf-preview h2 { font-size:17px; }
.tf-preview p { font-size:11px; color:#677183; line-height:1.9; }
.tf-preview-title button { padding:6px 9px; font-size:11px; }
.tf-print-meta { display:flex; flex-wrap:wrap; gap:7px 15px; font-size:11px; margin-bottom:9px; }
.tf-preview table { font-size:10px; margin-top:12px; }
.tf-preview th,.tf-preview td { padding:8px; white-space:normal; }
.tf-print-total { text-align:right; margin-top:12px; }
.tf-signatures { display:flex; justify-content:space-between; gap:20px; margin-top:35px; font-size:11px; }
#transfer-print-area { display:none; }
@media (max-width:1200px) {
  .tf-layout { grid-template-columns:minmax(0,1fr) minmax(370px,.95fr); gap:14px; }
  .tf-intro { align-items:start; }
  .tf-intro>div:first-child>span:last-child { display:none; }
  .tf-matrix .tf-product-col { min-width:190px; width:190px; max-width:190px; }
  .tf-line-fields { grid-template-columns:minmax(0,1fr) 8px minmax(0,1fr) 60px; gap:5px; }
  .tf-document-fields,.tf-line,.tf-draft .card-head { padding-left:14px; padding-right:14px; }
  .tf-save-actions { padding-left:14px; padding-right:14px; gap:5px; }
  .tf-save-actions button { padding:9px; font-size:11px; }
}
@media (max-width:980px) {
  .tf-layout { grid-template-columns:minmax(0,1fr); }
  .tf-lookup { position:static; }
  .tf-matrix { max-height:350px; }
  .tf-lines { max-height:500px; }
  .tf-query { grid-template-columns:1fr 1.3fr; align-items:end; }
  .tf-query-bottom { grid-column:1/-1; }
}
@media (max-width:580px) {
  .tf-intro { flex-direction:column; gap:10px; }
  .tf-tabs { width:100%; }
  .tf-tabs button { flex:1; }
  .tf-query { grid-template-columns:1fr; padding:14px; }
  .tf-query-bottom { grid-column:auto; }
  .tf-matrix { max-height:320px; }
  .tf-matrix .tf-product-col { min-width:155px; width:155px; max-width:155px; }
  .tf-product-col strong { font-size:11px; }
  .tf-matrix th { min-width:80px; font-size:10px; }
  .tf-document-fields { gap:10px; }
  .tf-line-fields { grid-template-columns:minmax(0,1fr) 8px minmax(0,1fr) 65px; }
  .tf-save-actions { justify-content:stretch; }
  .tf-save-actions button:first-child { flex-basis:100%; margin:0; }
  .tf-save-actions button { flex:1; }
  .tf-history-filters { padding:14px; gap:10px; }
  .tf-history-filters .field { flex:1; min-width:120px; }
  .tf-history-filters .tf-history-query { flex-basis:100%; }
  .tf-preview { margin:10px 10px 15px; padding:12px; }
}
@media print {
  body.tf-printing>* { display:none !important; }
  body.tf-printing dialog::backdrop { display:none !important; }
  body.tf-printing>#transfer-print-area { display:block !important; }
  #transfer-print-area .tf-preview { border:0; padding:0; margin:0; }
  #transfer-print-area table { width:100%; border-collapse:collapse; }
  #transfer-print-area th,#transfer-print-area td { border:1px solid #bbb; color:#111; }
  #transfer-print-area .table-wrap { overflow:visible; }
  #transfer-print-area .tf-preview h2 { color:#111; font-size:21px; }
  #transfer-print-area tr { break-inside:avoid; }
  #transfer-print-area thead { display:table-header-group; }
  @page { margin:15mm; size:A4 landscape; }
}
