dialog.order-detail-dialog{width:min(1080px,calc(100vw - 64px));max-width:1120px;max-height:86vh;overflow:hidden}
.order-detail-dialog>.modal-card{display:grid;grid-template-rows:auto minmax(0,1fr);width:100%;max-height:86vh;padding:0;overflow:hidden}
.order-detail-dialog>.modal-card>header{align-items:center;margin:0;padding:18px 28px 14px;border-bottom:1px solid var(--ui-border)}
.order-detail-dialog #modalBody{min-height:0;overflow:hidden;padding:16px 28px 24px}
.order-detail-dialog #modalBody{position:relative}
.web-order-detail{display:grid;grid-template-rows:auto auto auto minmax(0,1fr) auto auto;gap:16px;width:100%;min-width:0;max-width:none;max-height:calc(86vh - 74px);overflow:hidden}
.order-detail-dialog #modalTitle{display:flex;align-items:center;gap:12px;min-width:0}.order-detail-dialog #modalTitle>span:first-child{overflow-wrap:anywhere}.order-title-status{flex:0 0 auto;padding:5px 10px;border-radius:999px;background:#fff1d6;color:#b35c00;font-size:12px;font-weight:800}.order-title-status.danger{background:#fff0f1;color:#d64550}
.order-detail-status{display:flex;align-items:center;gap:8px;min-height:28px}
.order-detail-status small{margin-left:auto;color:var(--ui-text-muted);white-space:nowrap}
.order-party-summary{padding:12px 14px;border:1px solid var(--ui-border);border-radius:10px;background:var(--ui-surface-soft)}
.web-order-detail .order-party-summary{display:grid;grid-template-columns:50px minmax(174px,.82fr) minmax(0,2fr);align-items:center;gap:10px;min-height:88px;max-height:108px;border-color:color-mix(in srgb,#087f5b 20%,var(--ui-border));background:color-mix(in srgb,#087f5b 4%,var(--ui-surface))}
.order-party-avatar{display:grid;place-items:center;width:48px;height:48px;border-radius:50%;background:#dff5ed;color:#087f5b}.order-party-avatar svg{width:28px;height:28px;fill:currentColor}.order-party-copy{min-width:0}
.order-party-title{display:flex;align-items:center;gap:8px}
.order-party-title strong{font-size:16px;color:var(--ui-text-primary)}
.order-party-level{padding:2px 7px;border:1px solid color-mix(in srgb,var(--business-action-primary) 25%,var(--ui-border));border-radius:999px;background:color-mix(in srgb,var(--business-action-primary) 8%,var(--ui-surface));color:var(--business-action-primary);font-size:11px;font-weight:700}
.order-party-note{margin:4px 0 0;color:var(--ui-text-muted);font-size:12px}
.order-party-meta{display:grid;grid-template-columns:minmax(120px,.65fr) minmax(300px,2fr) minmax(150px,.8fr);gap:10px 18px;color:var(--ui-text-secondary);font-size:13px}
.web-order-detail .order-party-meta{grid-template-columns:minmax(140px,.72fr) minmax(250px,1.65fr) minmax(130px,.68fr);gap:6px 14px;padding-left:12px;border-left:1px solid var(--ui-border)}
.order-party-meta span{display:flex;gap:6px;min-width:0}.order-party-meta small{flex:0 0 auto;color:var(--ui-text-muted)}.order-party-meta b{color:var(--ui-text-primary)}
.order-party-address{overflow-wrap:anywhere}
.order-logistics-progress{display:grid;grid-template-columns:minmax(0,1fr);gap:7px;padding:10px 18px;border:1px solid var(--ui-border);border-radius:10px;background:var(--ui-surface)}
.order-logistics-progress.is-complete{grid-template-columns:minmax(0,1fr) 142px}.order-logistics-progress ol{display:grid;grid-template-columns:repeat(6,minmax(70px,1fr));gap:0;margin:0;padding:0 4px;list-style:none}.order-logistics-progress li{position:relative;display:grid;justify-items:center;gap:4px;min-width:0;color:var(--ui-text-muted);font-size:12px;text-align:center}.order-progress-node{position:relative;z-index:2;display:grid;place-items:center;width:34px;height:34px;border:2px solid var(--ui-border-strong);border-radius:50%;background:var(--ui-surface);color:var(--ui-text-muted)}.order-progress-node svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.order-logistics-progress li.is-reached{color:#087f5b}.order-logistics-progress li.is-reached .order-progress-node{border-color:#087f5b;background:#087f5b;color:#fff}.order-logistics-progress li.is-current .order-progress-node{box-shadow:0 0 0 4px rgba(8,127,91,.14)}.order-logistics-progress li>small{position:absolute;top:36px;padding:0 4px;border-radius:5px;background:#e4f7ef;color:#087f5b;font-size:9px}.order-progress-line{position:absolute;z-index:1;top:16px;left:calc(50% + 17px);width:calc(100% - 34px);height:2px;background:var(--ui-border-strong)}.order-progress-line.is-reached{background:#087f5b}.order-progress-note{grid-column:1/-1;display:flex;align-items:center;justify-content:center;gap:7px;min-height:20px;color:var(--ui-text-secondary);font-size:12px}.order-progress-note.danger{color:#d64550}.order-signed-celebration{grid-column:2;grid-row:1;display:grid;justify-items:center;align-content:center;border-left:1px solid var(--ui-border);color:#087f5b}.order-signed-celebration img{width:106px;height:66px;object-fit:contain}.order-signed-celebration strong{font-size:13px}.order-waybill-list{display:grid;gap:5px;margin:0;padding:8px 12px;border:1px solid var(--ui-border);border-radius:8px;background:var(--ui-surface-soft);list-style:none}.order-waybill-list li{display:grid;grid-template-columns:minmax(180px,1fr) 120px 170px;gap:10px;align-items:center;font-size:12px}.order-waybill-list small{color:var(--ui-text-muted)}
.supply-logistics-progress{display:grid;flex:none;gap:8px;min-height:max-content}.supply-logistics-progress>header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:0 2px}.supply-logistics-progress>header h3{margin:0;color:var(--ui-text-primary);font-size:14px}.supply-logistics-progress>header p{margin:2px 0 0;color:var(--ui-text-muted);font-size:11px}.supply-logistics-progress>header>span{flex:none;padding:3px 8px;border:1px solid var(--ui-border);border-radius:999px;background:var(--ui-surface-soft);color:var(--ui-text-secondary);font-size:11px}.supply-logistics-progress .order-logistics-progress{margin:0}.supply-progress-sync{min-height:16px;color:var(--ui-text-muted);font-size:11px;text-align:right}.supply-progress-sync:empty{display:none}.supply-progress-sync.is-error{color:#b85b15}.supply-progress-retry{display:flex;align-items:center;justify-content:center;gap:8px;color:var(--ui-text-muted);font-size:12px}.supply-progress-retry.is-error{padding:7px 10px;border:1px solid rgba(214,69,80,.28);border-radius:8px;background:rgba(214,69,80,.06);color:#d64550}.supply-logistics-progress .order-waybill-list-host[hidden]{display:none}
.order-detail-items,.supply-detail-items{min-height:0}.web-order-detail .order-detail-items{display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:6px;overflow:hidden}.order-detail-items>header{display:flex;align-items:center;justify-content:space-between;padding:0 2px}.order-detail-items>header h4{margin:0;font-size:14px}.order-detail-items>header span{color:var(--ui-text-muted);font-weight:500}
.order-detail-table-wrap{max-height:min(42vh,490px);overflow:auto;border:1px solid var(--ui-border);border-radius:10px;background:var(--ui-surface);scrollbar-gutter:stable}
.web-order-detail .order-detail-table-wrap{min-height:0;max-height:none}
.order-detail-item-table{min-width:920px;table-layout:fixed}
.order-detail-item-table thead,.supply-detail-table thead{position:sticky;z-index:3;top:0}
.order-detail-item-table th:nth-child(1){width:276px}.order-detail-item-table th:nth-child(2){width:94px}.order-detail-item-table th:nth-child(3){width:120px}.order-detail-item-table th:nth-child(4){width:130px}.order-detail-item-table th:nth-child(5){width:130px}.order-detail-item-table th:nth-child(6){width:170px}
.order-detail-item-table td{vertical-align:middle!important}
.order-detail-item-table td>small{display:block;margin-top:4px;color:var(--ui-text-muted)}
.order-detail-item-table .order-item-preview{min-width:250px}
.order-detail-item-table .order-quantity-control{justify-content:flex-start}
.order-item-code{padding-left:56px}.order-item-state{display:inline-flex;margin-bottom:4px;padding:3px 7px;border-radius:999px;background:#e4f7ef;color:#087f5b;font-size:11px;font-weight:750}.order-item-expand{width:100%;min-height:38px;margin-top:6px;border:1px solid color-mix(in srgb,#087f5b 22%,var(--ui-border));border-radius:8px;background:color-mix(in srgb,#087f5b 5%,var(--ui-surface));color:#087f5b;font-weight:750}
.order-detail-item-table .order-final-price{display:grid;grid-template-columns:minmax(90px,1fr) auto;align-items:center;gap:5px;font-weight:650}
.order-detail-item-table .order-final-price input{width:100%;height:34px;border:1px solid var(--ui-border);border-radius:7px;padding:0 8px;background:var(--ui-surface);color:var(--ui-text-primary)}
.order-price-reference{margin-top:5px;color:var(--ui-text-muted);font-size:11px}
.order-price-reference summary,.order-secondary-details>summary{cursor:pointer;color:var(--color-link)}
.order-price-reference p,.order-price-reference small{display:block;margin:5px 0;line-height:1.45}
.order-item-error{display:block;margin-top:4px;color:var(--status-danger);font-size:11px;line-height:1.4}
.order-secondary-details{border:1px solid var(--ui-border);border-radius:9px;background:var(--ui-surface)}
.order-secondary-details>summary{padding:9px 12px;font-size:12px;font-weight:700}
.order-secondary-content{padding:0 12px 12px;color:var(--ui-text-secondary);font-size:12px}
.order-detail-footer{position:sticky;z-index:6;bottom:0;display:flex;align-items:center;gap:12px;margin:0;padding:10px 12px;border:1px solid var(--ui-border-strong);border-radius:10px;background:color-mix(in srgb,var(--ui-surface) 97%,transparent);box-shadow:0 -8px 24px rgba(20,40,34,.08);backdrop-filter:blur(8px)}
.order-readonly-summary,.order-next-step{justify-content:flex-end}
.order-detail-official-total,.order-footer-summary{display:flex;flex-direction:column;align-items:flex-end;gap:1px;min-width:150px}
.order-detail-official-total strong,.order-footer-summary strong{color:var(--ds-text-strong,#18332d);font-size:18px}
.order-detail-official-total small,.order-footer-summary small{color:var(--ds-text-muted,#667a75);font-size:11px}
.order-footer-summary span{color:var(--ui-text-muted);font-size:11px}
.order-footer-remark{display:grid;gap:3px;min-width:220px;color:var(--ui-text-muted);font-size:11px}
.order-footer-remark input{height:34px;border:1px solid var(--ui-border);border-radius:7px;padding:0 9px;background:var(--ui-surface);color:var(--ui-text-primary)}
.order-action-buttons,.supply-primary-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-left:auto}
.order-danger-menu{position:relative;flex:0 0 auto}
.order-danger-menu>summary{cursor:pointer;color:var(--status-danger);font-size:12px;font-weight:700;white-space:nowrap}
.order-danger-menu[open]{z-index:20}.order-danger-menu button{margin:6px 0 0 6px}
.order-danger-option{display:flex;align-items:end;gap:6px;padding-top:6px}
.order-danger-option label{display:grid;gap:3px;font-size:11px;color:var(--ui-text-muted)}
.order-danger-option select{height:32px;border:1px solid var(--ui-border);border-radius:6px;background:var(--ui-surface);color:var(--ui-text-primary)}
.order-allocation-confirmation{position:absolute;z-index:30;inset:0;display:grid;place-items:center;padding:20px;background:rgba(15,35,31,.5);backdrop-filter:blur(3px)}.order-allocation-card{display:grid;grid-template-rows:auto auto minmax(0,1fr) auto auto;width:min(1120px,calc(100vw - 74px));max-height:calc(100vh - 96px);overflow:hidden;border:1px solid var(--ui-border-strong);border-radius:14px;background:var(--ui-surface);box-shadow:0 24px 70px rgba(8,31,29,.28)}.order-allocation-card>header{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:15px 18px;border-bottom:1px solid var(--ui-border)}.order-allocation-card h4{margin:0;font-size:19px}.order-allocation-card header p{margin:3px 0 0;color:var(--ui-text-muted);font-size:12px}.allocation-message{margin:10px 14px 0;padding:10px 12px;border-left:3px solid #087f5b;border-radius:7px;background:#eef9f5;color:#315e50;font-size:13px}.allocation-table-wrap{min-height:0;margin:10px 14px;overflow:auto;border:1px solid var(--ui-border);border-radius:9px}.allocation-table-wrap table{width:100%;min-width:940px;border-collapse:collapse}.allocation-table-wrap th{position:sticky;z-index:2;top:0;background:var(--ui-surface-soft)}.allocation-table-wrap th,.allocation-table-wrap td{padding:9px 10px;border-bottom:1px solid var(--ui-border);text-align:left;vertical-align:middle}.allocation-table-wrap td>small{display:block;margin-top:3px;color:var(--ui-text-muted)}.allocation-table-wrap input{height:34px;border:1px solid var(--ui-border);border-radius:7px;padding:0 8px;background:var(--ui-surface);color:var(--ui-text-primary)}.allocation-table-wrap .confirm-quantity{width:76px}.allocation-table-wrap label{display:flex;align-items:center;gap:5px}.allocation-table-wrap em{color:#c66a13;font-size:11px}.order-allocation-card>footer{display:grid;grid-template-columns:minmax(200px,1fr) auto auto auto;align-items:end;gap:10px;padding:11px 14px;border-top:1px solid var(--ui-border);background:var(--ui-surface-soft)}.order-allocation-card>footer>label{display:grid;gap:4px;color:var(--ui-text-muted);font-size:11px}.order-allocation-card>footer>label input{height:36px;border:1px solid var(--ui-border);border-radius:7px;padding:0 9px}.allocation-total{display:grid;text-align:right}.allocation-total span{color:var(--ui-text-muted);font-size:11px}.allocation-total strong{color:#087f5b;font-size:18px}.allocation-status{margin:0;padding:0 14px 10px}.order-print-root{display:none}
.supply-detail-page{display:grid;gap:16px;width:min(1080px,100%);max-width:1120px;max-height:calc(100vh - 176px);min-height:0;margin:0 auto;padding:24px 28px;overflow:hidden;border:1px solid var(--ui-border);border-radius:14px;background:var(--ui-surface);box-shadow:0 14px 38px rgba(20,40,34,.08)}
.supply-detail-head{display:flex;align-items:end;justify-content:space-between;gap:16px;margin:0;padding:0 0 4px}.supply-detail-head>div{display:grid;gap:4px}.supply-detail-head small{color:var(--ui-text-muted)}
.supply-detail-title-row{display:flex;align-items:center;gap:10px}.supply-detail-title-row h3{margin:0;font-size:20px}
.supply-party-summary{min-height:88px;max-height:108px}.supply-party-summary .order-party-meta{grid-template-columns:minmax(100px,.58fr) minmax(120px,.68fr) minmax(260px,1.7fr) minmax(120px,.68fr);gap:6px 14px}
.supply-detail-table-wrap{max-height:min(44vh,500px)}
[data-supply-item-details]{padding:0!important;border:0!important;background:transparent!important}
[data-supply-item-details] .supply-detail-table{min-width:980px;table-layout:auto}
[data-supply-item-details] .supply-detail-actions{position:sticky;z-index:6;bottom:0;margin:0;padding:10px 12px;border:1px solid var(--ui-border-strong);background:color-mix(in srgb,var(--ui-surface) 97%,transparent)}
.supply-record-details{margin-top:0}.p2p-signed-receipts{margin-top:8px}
.annual-sales-goal-form .form-note{margin:0;padding:10px 12px;border-left:3px solid var(--business-action-primary);background:var(--ui-surface-soft);color:var(--ui-text-secondary);line-height:1.6}
@media(max-width:900px){dialog.order-detail-dialog{width:calc(100vw - 28px);max-height:92vh}.order-detail-dialog>.modal-card{max-height:92vh}.order-detail-dialog>.modal-card>header{padding:15px 18px 12px}.order-detail-dialog #modalBody{padding:14px 18px 18px}.web-order-detail{min-width:0;max-height:calc(92vh - 68px)}.web-order-detail .order-party-summary{grid-template-columns:48px 1fr;max-height:none}.web-order-detail .order-party-meta{grid-column:1/-1;padding:10px 0 0;border-top:1px solid var(--ui-border);border-left:0}.order-party-meta,.supply-party-summary .order-party-meta{grid-template-columns:1fr 1fr}.order-party-address{grid-column:1/-1}.order-logistics-progress.is-complete{grid-template-columns:1fr}.order-signed-celebration{grid-column:1;grid-row:auto;border:0;border-top:1px solid var(--ui-border)}.order-detail-footer{position:static;flex-wrap:wrap}.order-footer-remark{flex:1 1 260px}.order-action-buttons,.supply-primary-actions{margin-left:0}.order-detail-table-wrap{max-height:55vh}.supply-detail-page{max-height:none;padding:18px}.supply-party-summary{max-height:none}[data-supply-item-details] .supply-detail-actions{position:static}.order-allocation-card>footer{grid-template-columns:1fr auto auto}.order-allocation-card>footer>label{grid-column:1/-1}}
@media print{@page{size:A4;margin:13mm}body *{visibility:hidden!important}#orderPrintRoot,#orderPrintRoot *{visibility:visible!important}#orderPrintRoot{position:absolute;inset:0;display:block!important;color:#111;font:10pt/1.45 system-ui,sans-serif}#orderPrintRoot header{display:flex;justify-content:space-between;gap:24px;border-bottom:2px solid #111;padding-bottom:10px}#orderPrintRoot h1{margin:3px 0;font-size:22pt}#orderPrintRoot header p,#orderPrintRoot header strong{margin:0;font-size:9pt}#orderPrintRoot dl{margin:0}#orderPrintRoot dl div{display:grid;grid-template-columns:70px 1fr;gap:8px}#orderPrintRoot dt{color:#555}#orderPrintRoot dd{margin:0;font-weight:700}#orderPrintRoot section{display:grid;grid-template-columns:1fr 1fr;gap:5px 20px;padding:10px 0}#orderPrintRoot section p{margin:0}#orderPrintRoot table{width:100%;border-collapse:collapse}#orderPrintRoot th,#orderPrintRoot td{padding:7px;border:1px solid #aaa;text-align:left}#orderPrintRoot td small{display:block;color:#555}#orderPrintRoot footer{padding-top:10px;text-align:right;color:#555}}

/* Electronic order V2 and the formalized order-detail table use explicit inner
   wrappers so table cells keep their native table-cell layout. */
@media screen{
  .web-order-detail .order-party-summary,.supply-party-summary{display:grid;grid-template-columns:minmax(250px,.9fr) minmax(0,1.7fr);align-items:center;gap:18px;min-height:92px;max-height:none}
  .order-party-identity{display:grid;grid-template-columns:50px minmax(0,1fr);align-items:center;gap:12px;min-width:0}
  .order-party-supplier-avatar svg{fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
  .order-party-status{margin:4px 0 0;color:var(--ui-text-muted);font-size:12px}.order-party-status b{color:var(--ui-text-primary)}
  .order-party-meta,.web-order-detail .order-party-meta,.supply-party-summary .order-party-meta{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:7px 18px;margin:0;padding-left:18px;border-top:0;border-left:1px solid var(--ui-border);color:var(--ui-text-secondary);font-size:13px}
  .order-party-field{display:grid;grid-template-columns:78px minmax(0,1fr);align-items:start;gap:8px;min-width:0}.order-party-field dt{color:var(--ui-text-muted);white-space:nowrap}.order-party-field dd{min-width:0;margin:0;color:var(--ui-text-primary);font-weight:650}.order-party-address{grid-column:1/-1}.order-party-address dd{overflow-wrap:anywhere;line-height:1.45}.order-party-phone-value{display:inline-flex!important;align-items:center;gap:6px;white-space:nowrap}.order-party-phone-value .text-btn{flex:0 0 auto;padding:0 2px;font-size:12px}
  .order-detail-item-table{min-width:960px;table-layout:fixed;border-collapse:collapse}
  .order-detail-item-table th:nth-child(1){width:224px}.order-detail-item-table th:nth-child(2){width:126px}.order-detail-item-table th:nth-child(3){width:92px}.order-detail-item-table th:nth-child(4){width:112px}.order-detail-item-table th:nth-child(5){width:118px}.order-detail-item-table th:nth-child(6){width:118px}.order-detail-item-table th:nth-child(7){width:170px}
  .order-detail-item-table th,.order-detail-item-table td,.supply-detail-table th,.supply-detail-table td{padding:9px 10px;border-bottom:1px solid var(--ui-border);vertical-align:middle!important}.order-detail-item-table th,.supply-detail-table th{background:var(--ui-surface-soft);color:var(--ui-text-secondary);font-size:12px;font-weight:750;white-space:nowrap}.order-detail-item-table tbody tr:hover td,.supply-detail-table tbody tr:hover td{background:color-mix(in srgb,var(--business-action-primary) 4%,var(--ui-surface))}
  .order-detail-item-table .order-item-preview,[data-supply-item-details] .supply-detail-table .order-item-preview{min-width:0}.order-item-spec-cell b{display:block;color:var(--ui-text-primary)}.order-item-spec-cell small{display:block;margin-top:3px;color:var(--ui-text-muted)}
  [data-supply-item-details] .supply-detail-table{min-width:1040px;table-layout:auto;border-collapse:collapse}[data-supply-item-details] .supply-detail-table th:first-child{width:220px}[data-supply-item-details] .supply-detail-table th:nth-child(2){width:128px}

  .electronic-order-dialog{width:min(920px,calc(100vw - 40px));max-width:none;max-height:90vh;padding:0;overflow:hidden;border:0;border-radius:14px;background:var(--ui-surface);color:var(--ui-text-primary);box-shadow:0 28px 80px rgba(8,31,29,.28)}.electronic-order-dialog::backdrop{background:rgba(15,35,31,.58);backdrop-filter:blur(3px)}.electronic-order-sheet{display:grid;grid-template-rows:auto auto auto minmax(0,1fr) auto auto;max-height:90vh;overflow:hidden}.electronic-order-header{display:flex;align-items:center;justify-content:space-between;padding:18px 22px;border-bottom:1px solid var(--ui-border)}.electronic-order-brand{display:flex;align-items:center;gap:10px}.electronic-order-brand>span{display:grid;place-items:center;width:38px;height:38px;border-radius:10px;background:#087f5b;color:#fff;font-size:20px;font-weight:800}.electronic-order-brand div{display:grid;gap:1px}.electronic-order-brand strong{font-size:17px}.electronic-order-brand small{color:var(--ui-text-muted);font-size:11px}.electronic-order-close{display:grid;place-items:center;width:34px;height:34px;border:0;border-radius:8px;background:var(--ui-surface-soft);color:var(--ui-text-secondary);font-size:24px;line-height:1}.electronic-order-title{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:14px 22px}.electronic-order-title>div{display:flex;align-items:center;gap:10px}.electronic-order-title h3{margin:0;font-size:20px}.electronic-order-title span{padding:4px 9px;border-radius:999px;background:#fff1d6;color:#b35c00;font-size:12px;font-weight:750}.electronic-order-title time{color:var(--ui-text-muted);font-size:12px;white-space:nowrap}.electronic-order-party{display:grid;grid-template-columns:minmax(180px,.7fr) minmax(0,1.5fr);gap:18px;margin:0 22px 14px;padding:12px 14px;border:1px solid var(--ui-border);border-radius:10px;background:var(--ui-surface-soft)}.electronic-order-party>div{display:grid;align-content:start;gap:3px}.electronic-order-party>div small{color:var(--ui-text-muted)}.electronic-order-party>div strong{font-size:16px}.electronic-order-party>div em{color:#087f5b;font-size:11px;font-style:normal}.electronic-order-party dl{display:grid;gap:5px;margin:0}.electronic-order-party dl div{display:grid;grid-template-columns:72px minmax(0,1fr);gap:8px}.electronic-order-party dt{color:var(--ui-text-muted)}.electronic-order-party dd{margin:0;overflow-wrap:anywhere}.electronic-order-table-wrap{min-height:0;margin:0 22px;overflow:auto;border:1px solid var(--ui-border);border-radius:10px}.electronic-order-items{width:100%;min-width:760px;border-collapse:collapse;table-layout:fixed}.electronic-order-items th,.electronic-order-items td{padding:10px;border-bottom:1px solid var(--ui-border);text-align:left;vertical-align:middle}.electronic-order-items th{position:sticky;z-index:2;top:0;background:var(--ui-surface-soft);color:var(--ui-text-secondary);font-size:12px}.electronic-order-items th:first-child{width:34%}.electronic-order-items td small{display:block;margin-top:3px;color:var(--ui-text-muted)}.electronic-order-summary{display:flex;align-items:start;justify-content:space-between;gap:18px;padding:14px 22px}.electronic-order-summary p{margin:0;color:var(--ui-text-secondary)}.electronic-order-summary p span{margin-right:8px;color:var(--ui-text-muted)}.electronic-order-summary>div{display:grid;justify-items:end;gap:2px;min-width:180px}.electronic-order-summary>div span,.electronic-order-summary>div small{color:var(--ui-text-muted);font-size:11px}.electronic-order-summary>div strong{color:#087f5b;font-size:21px}.electronic-order-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:12px 22px;border-top:1px solid var(--ui-border);background:var(--ui-surface-soft)}.electronic-order-actions>small{margin-right:auto;color:var(--ui-text-muted)}
}
@media screen and (max-width:900px){.web-order-detail .order-party-summary,.supply-party-summary{grid-template-columns:1fr;max-height:none}.order-party-meta,.web-order-detail .order-party-meta,.supply-party-summary .order-party-meta{padding:10px 0 0;border-top:1px solid var(--ui-border);border-left:0}}
@media screen and (max-width:640px){.electronic-order-dialog{width:calc(100vw - 20px);max-height:94vh}.electronic-order-sheet{max-height:94vh}.electronic-order-header,.electronic-order-title,.electronic-order-summary,.electronic-order-actions{padding-left:14px;padding-right:14px}.electronic-order-title{align-items:flex-start}.electronic-order-title>div{display:grid;gap:6px}.electronic-order-title time{white-space:normal;text-align:right}.electronic-order-party{grid-template-columns:1fr;margin:0 14px 12px}.electronic-order-table-wrap{margin:0 14px;border:0;overflow:auto}.electronic-order-items{display:block;min-width:0}.electronic-order-items thead{display:none}.electronic-order-items tbody{display:grid;gap:10px}.electronic-order-items tr{display:grid;padding:10px;border:1px solid var(--ui-border);border-radius:9px;background:var(--ui-surface)}.electronic-order-items td{display:grid;grid-template-columns:96px minmax(0,1fr);gap:8px;padding:6px 2px;border:0}.electronic-order-items td::before{content:attr(data-label);color:var(--ui-text-muted);font-size:12px}.electronic-order-summary{display:grid}.electronic-order-summary>div{justify-items:start}.electronic-order-actions{flex-wrap:wrap}.electronic-order-actions>small{flex:1 0 100%;margin:0}}

/* V2: formal document tables and a WYSIWYG canvas delivery-note preview. */
@media screen{
  .order-detail-table-wrap,.supply-detail-table-wrap{border:1px solid var(--ui-border-strong);border-radius:8px;box-shadow:0 0 0 1px color-mix(in srgb,var(--ui-border) 24%,transparent) inset}
  .order-detail-item-table,[data-supply-item-details] .supply-detail-table{width:100%;border-collapse:separate;border-spacing:0}
  .order-detail-item-table th,.order-detail-item-table td,[data-supply-item-details] .supply-detail-table th,[data-supply-item-details] .supply-detail-table td{border-right:1px solid var(--ui-border);border-bottom:1px solid var(--ui-border)}
  .order-detail-item-table th:last-child,.order-detail-item-table td:last-child,[data-supply-item-details] .supply-detail-table th:last-child,[data-supply-item-details] .supply-detail-table td:last-child{border-right:0}
  .order-detail-item-table tbody tr:last-child td,[data-supply-item-details] .supply-detail-table tbody tr:last-child td{border-bottom:0}
  .order-detail-item-table thead th,[data-supply-item-details] .supply-detail-table thead th{background:color-mix(in srgb,var(--ui-surface-soft) 82%,var(--ui-border));color:var(--ui-text-primary);font-weight:800}
  .order-detail-item-table .ds-cell-numeric,.order-detail-item-table .ds-cell-money{font-variant-numeric:tabular-nums}

  .electronic-order-dialog.electronic-order-print-preview{width:min(1040px,calc(100vw - 40px));max-height:92vh;background:var(--ui-surface-soft)}
  .electronic-order-workspace{display:grid;grid-template-rows:auto auto minmax(0,1fr) auto;max-height:92vh;overflow:hidden}
  .electronic-order-workspace-header{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;border-bottom:1px solid var(--ui-border);background:var(--ui-surface)}
  .electronic-order-workspace-header>div{display:flex;align-items:center;gap:10px}.electronic-order-workspace-header>div>span{display:grid;place-items:center;width:36px;height:36px;border-radius:8px;background:#087f5b;color:#fff;font-size:19px;font-weight:800}.electronic-order-workspace-header>div>div{display:grid;gap:1px}.electronic-order-workspace-header strong{font-size:16px}.electronic-order-workspace-header small{color:var(--ui-text-muted);font-size:11px}
  .electronic-order-config{margin:12px 18px 0;border:1px solid var(--ui-border);border-radius:9px;background:var(--ui-surface)}.electronic-order-config>summary{padding:10px 12px;cursor:pointer;color:var(--ui-text-primary);font-size:13px;font-weight:750}.electronic-order-config-body{display:grid;gap:10px;padding:0 12px 12px;border-top:1px solid var(--ui-border)}.electronic-order-config-toggles{display:flex;flex-wrap:wrap;gap:8px 18px;padding-top:10px}.electronic-order-config-toggles label{display:inline-flex;align-items:center;gap:5px;color:var(--ui-text-secondary);font-size:12px}.electronic-order-config-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.electronic-order-config-fields label{display:grid;gap:4px;color:var(--ui-text-muted);font-size:11px}.electronic-order-config-fields input{width:100%;height:34px;border:1px solid var(--ui-border);border-radius:6px;padding:0 8px;background:var(--ui-surface);color:var(--ui-text-primary)}
  .electronic-order-preview-scroll{min-height:0;margin:12px 18px;overflow:auto;border:1px solid var(--ui-border-strong);border-radius:8px;background:#cfd6d3;padding:18px}.electronic-order-canvas-host{width:min(100%,980px);margin:0 auto;box-shadow:0 8px 24px rgba(17,38,32,.2)}.electronic-order-canvas{display:block;width:100%;height:auto;background:#fff}

  .supply-order-detail-dialog .supply-detail-page{display:grid;grid-template-rows:max-content max-content minmax(260px,1fr) max-content;align-content:start;gap:16px;width:100%;max-width:none;max-height:calc(86vh - 74px);margin:0;padding:0 4px 2px 0;overflow-x:hidden;overflow-y:auto;scrollbar-gutter:stable;border:0;border-radius:0;background:transparent;box-shadow:none}
  .supply-order-detail-dialog .supply-party-summary,.supply-order-detail-dialog .supply-logistics-progress,.supply-order-detail-dialog .supply-record-details{min-height:max-content;overflow:visible}
  .supply-order-detail-dialog .supply-detail-items{display:grid;grid-template-rows:minmax(160px,1fr) max-content;min-height:260px;overflow:visible}
  .supply-order-detail-dialog .supply-detail-table-wrap{min-height:160px;max-height:none;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
  .supply-order-detail-dialog .supply-detail-table thead th{position:sticky;z-index:4;top:0}
  .supply-order-detail-dialog .supply-detail-actions{position:sticky;z-index:6;bottom:0}
  .supply-order-detail-dialog .supply-detail-table{min-width:900px;table-layout:fixed}.supply-order-detail-dialog .supply-detail-table.is-wide{min-width:1160px}
  .supply-detail-inline-note{margin:0;padding:7px 10px;border-bottom:1px solid var(--ui-border);background:var(--ui-surface-soft);color:var(--ui-text-muted);font-size:12px}
  .supply-detail-col-product{width:220px}.supply-detail-col-spec{width:125px}.supply-detail-col-quantity{width:112px}.supply-detail-col-price,.supply-detail-col-amount{width:122px}.supply-detail-col-received,.supply-detail-col-remaining{width:96px}.supply-detail-col-confirmed,.supply-detail-col-shortage{width:112px}.supply-detail-col-current{width:120px}.supply-detail-col-batch{width:260px}
  .supply-order-detail-dialog .supply-primary-actions{flex-wrap:wrap}.supply-modal-created{margin-left:auto;color:var(--ui-text-muted);font-size:12px;font-weight:500;white-space:nowrap}
}
.order-embedded-logistics{display:grid;gap:10px;padding:12px 14px;border:1px solid var(--ui-border);border-radius:10px;background:var(--ui-surface)}.order-embedded-logistics header{display:flex;align-items:center;justify-content:space-between;gap:12px}.order-embedded-logistics h4{margin:0;font-size:14px}.order-embedded-logistics dl{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin:0}.order-embedded-logistics dl>div{min-width:0;padding:7px 9px;border-radius:7px;background:var(--ui-surface-soft)}.order-embedded-logistics dt{color:var(--ui-text-muted);font-size:11px}.order-embedded-logistics dd{margin:3px 0 0;overflow:hidden;color:var(--ui-text-primary);font-size:12px;text-overflow:ellipsis;white-space:nowrap}.order-logistics-history-note{margin:0;padding:7px 9px;border-left:3px solid #c58a08;background:rgba(197,138,8,.08);color:var(--ui-text-secondary);font-size:12px}.order-item-shortage-closed{color:#b45309}.embedded-shipping{display:grid;gap:16px}.embedded-shipping-note{margin:0;padding:10px 12px;border-radius:8px;background:rgba(8,127,91,.08);color:var(--ui-text-secondary);font-size:13px}.embedded-shipping-table td:first-child b,.embedded-shipping-table td:first-child small{display:block}.embedded-shipping-table td:first-child small{margin-top:3px;color:var(--ui-text-muted)}.embedded-shipping-method{display:flex;gap:22px;margin:0;padding:14px;border:1px solid var(--ui-border);border-radius:10px}.embedded-shipping-method legend{padding:0 6px;font-weight:600}.embedded-shipping-method label{display:flex;align-items:center;gap:7px}.embedded-shipping-other{display:grid;grid-template-columns:1fr 1fr;gap:12px}.embedded-shipping-other[hidden]{display:none}.embedded-shipping-other label,.embedded-shipping-remark{display:grid;gap:6px;color:var(--ui-text-secondary);font-size:12px}.embedded-shipping-other input,.embedded-shipping-remark input{min-height:38px;padding:0 10px;border:1px solid var(--ui-border);border-radius:8px;background:var(--ui-surface);color:var(--ui-text-primary)}.embedded-shipping footer{display:flex;justify-content:flex-end;gap:10px}
@media screen and (max-width:720px){.electronic-order-dialog.electronic-order-print-preview{width:calc(100vw - 16px);max-height:96vh}.electronic-order-workspace{max-height:96vh}.electronic-order-config-fields{grid-template-columns:1fr 1fr}.electronic-order-preview-scroll{margin:10px;padding:8px}.electronic-order-canvas-host{width:720px;min-width:720px}.electronic-order-actions{padding:10px 12px}.electronic-order-actions>small{flex:1 0 100%}}
@media screen and (max-width:900px){.order-embedded-logistics dl{grid-template-columns:repeat(2,minmax(0,1fr))}.embedded-shipping-method{flex-wrap:wrap}.embedded-shipping-other{grid-template-columns:1fr}}
@media screen and (max-width:900px){.supply-order-detail-dialog .supply-detail-page{grid-template-rows:max-content max-content minmax(220px,1fr) max-content;max-height:calc(92vh - 68px)}.supply-order-detail-dialog .supply-detail-items{min-height:220px}.supply-order-detail-dialog .supply-detail-actions{position:static}}
@media screen and (max-height:760px){.supply-order-detail-dialog .supply-detail-page{grid-template-rows:max-content max-content minmax(220px,1fr) max-content}.supply-order-detail-dialog .supply-detail-items{min-height:220px}}
/* Credit Gate: seller-only structured decision shown on top of the existing allocation flow. */
.order-detail-dialog .customer-credit-gate-dialog{z-index:40}
.customer-credit-gate-dialog{position:absolute;inset:0;z-index:9;display:grid;place-items:center;padding:24px;background:rgba(20,34,31,.42)}.customer-credit-gate-card{width:min(680px,calc(100% - 24px));max-height:calc(100% - 24px);overflow:auto;padding:22px;border:1px solid #efb2b7;border-radius:16px;background:var(--surface-bg,#fff);box-shadow:0 20px 60px rgba(25,39,36,.22)}.customer-credit-gate-card>header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.customer-credit-gate-card h4{margin:0 0 5px;font-size:20px}.customer-credit-gate-card header p{margin:0;color:var(--text-muted)}.customer-credit-gate-reasons{display:grid;gap:8px;margin:18px 0;padding:0;list-style:none}.customer-credit-gate-reasons li{display:grid;gap:3px;padding:11px 13px;border-left:3px solid #d64550;background:#fff4f5}.customer-credit-gate-reasons span{color:#7f3b42}.customer-credit-gate-facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:0}.customer-credit-gate-facts div{padding:11px;border:1px solid var(--border-color);border-radius:10px}.customer-credit-gate-facts dt{font-size:12px;color:var(--text-muted)}.customer-credit-gate-facts dd{margin:5px 0 0;font-weight:700;font-variant-numeric:tabular-nums}.customer-credit-override-reason{display:grid;gap:6px;margin-top:16px;font-weight:650}.customer-credit-override-reason textarea{min-height:88px;padding:10px;border:1px solid var(--border-color);border-radius:10px;resize:vertical}.customer-credit-gate-guidance{margin:16px 0 0;padding:10px 12px;background:var(--surface-soft);color:var(--text-muted)}.customer-credit-gate-card>footer{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}@media(max-width:760px){.customer-credit-gate-dialog{padding:10px}.customer-credit-gate-facts{grid-template-columns:1fr 1fr}}
