/* HF26G AP payment workflow: full-width, sticky summary/actions, no horizontal table drag */
.ap-payment-dialog{
  width:min(94vw,1400px)!important;
  height:min(92vh,900px);
  max-width:none!important;
  max-height:92vh!important;
  padding:0!important;
  overflow:hidden!important;
  border-radius:14px!important;
}
.ap-payment-dialog>.ap-heading{
  margin:0!important;
  padding:14px 18px!important;
  border-bottom:1px solid var(--line);
  background:#f7fbf9;
}
.ap-payment-dialog>.ap-heading h2{font-size:18px!important}
.ap-payment-workflow{
  height:calc(min(92vh,900px) - 68px);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  background:#f4f7f8;
}
.ap-pay-sticky-head{
  display:grid;
  grid-template-columns:minmax(280px,1.7fr) repeat(3,minmax(145px,.65fr));
  gap:10px;
  padding:12px 16px;
  background:#fff;
  border-bottom:1px solid var(--line);
  box-shadow:0 2px 8px rgba(20,50,45,.05);
  z-index:4;
}
.ap-pay-sticky-head>div{min-width:0}
.ap-pay-sticky-head>div:first-child{display:grid;grid-template-columns:auto 1fr;align-content:center;column-gap:8px}
.ap-pay-sticky-head>div:first-child span{grid-column:1/-1;font-size:10px;font-weight:700;color:#658078;letter-spacing:.06em}
.ap-pay-sticky-head>div:first-child strong{font-size:12px;color:#275247}
.ap-pay-sticky-head>div:first-child b{font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ap-pay-head-stat{display:flex;flex-direction:column;justify-content:center;padding:8px 12px;border:1px solid #dce9e5;border-radius:10px;background:#f8fbfa;text-align:right}
.ap-pay-head-stat span{font-size:11px;color:#6a7c77}
.ap-pay-head-stat strong{font-size:17px;font-variant-numeric:tabular-nums;color:#174d3e}
.ap-pay-step{padding:14px 16px;min-height:0;flex:1;overflow:hidden}
.ap-pay-step-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
.ap-pay-step-title>div:first-child span{font-size:10px;font-weight:800;letter-spacing:.08em;color:#168064}
.ap-pay-step-title h3{margin:2px 0 0;font-size:16px;color:#183b32}
.ap-pay-tools{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.ap-pay-table-wrap{height:calc(100% - 62px);overflow-y:auto;overflow-x:hidden;border:1px solid #dbe7e3;border-radius:10px;background:white}
.ap-pay-table{width:100%;min-width:0!important;border-collapse:separate;border-spacing:0;table-layout:fixed;font-size:12px}
.ap-pay-table th,.ap-pay-table td{padding:9px 10px;border-bottom:1px solid #edf2f0;vertical-align:middle;overflow-wrap:anywhere}
.ap-pay-table th{position:sticky;top:0;z-index:2;background:#e5f3ed;color:#214a40;text-align:left;font-size:11px;white-space:normal}
.ap-pay-table th:nth-child(1),.ap-pay-table td:nth-child(1){width:42px;text-align:center}
.ap-pay-table th:nth-child(2),.ap-pay-table td:nth-child(2){width:24%}
.ap-pay-table th:nth-child(3),.ap-pay-table td:nth-child(3){width:22%}
.ap-pay-table th:nth-child(4),.ap-pay-table td:nth-child(4){width:15%;text-align:right}
.ap-pay-table th:nth-child(5),.ap-pay-table td:nth-child(5){width:15%;text-align:right}
.ap-pay-table th:nth-child(6),.ap-pay-table td:nth-child(6){width:18%;text-align:right}
.ap-pay-table tr.selected:not(.ap-pay-detail-row){background:#f0faf6}
.ap-pay-table small{display:block;margin-top:3px;font-size:10px;color:#71817d;line-height:1.35}
.ap-pay-doc strong{display:block;color:#15483b;font-size:12px}
.ap-pay-detail-toggle{margin-top:4px;border:0;background:transparent;color:#18735d;text-decoration:underline;text-underline-offset:2px;padding:0;font-size:10px}
.ap-pay-cut input{width:100%!important;min-width:0!important;text-align:right;font-weight:700;font-variant-numeric:tabular-nums}
.ap-pay-money{font-variant-numeric:tabular-nums}
.ap-pay-detail-row td{padding:0 12px!important;background:#f8fbfa}
.ap-pay-detail-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px 18px;padding:10px 48px;font-size:11px;color:#60746e}
.ap-pay-detail-grid b{color:#263d37;margin-left:4px}
.ap-pay-tip{margin:7px 2px 0!important;font-size:10px!important;color:#74847f}
.ap-pay-review{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:2px 0 14px}
.ap-pay-review>div{padding:14px;border:1px solid #d8e6e1;border-radius:10px;background:#fff}
.ap-pay-review span{display:block;font-size:11px;color:#6f817c}
.ap-pay-review strong{display:block;margin-top:5px;font-size:17px;color:#174d3e;font-variant-numeric:tabular-nums}
.ap-pay-method-card{padding:16px;border:1px solid #d8e6e1;border-radius:10px;background:#fff}
.ap-pay-sticky-foot{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:11px 16px;
  border-top:1px solid #d3e0dc;
  background:#fff;
  box-shadow:0 -3px 12px rgba(25,55,47,.06);
  z-index:5;
}
.ap-pay-foot-total{display:flex;align-items:baseline;gap:10px}
.ap-pay-foot-total span{font-size:12px;color:#657873}
.ap-pay-foot-total strong{font-size:20px;color:#174d3e;font-variant-numeric:tabular-nums}
.ap-pay-foot-actions{display:flex;gap:8px}
.ap-payment-dialog .primary-btn{min-width:180px}
@media(max-width:1000px){
  .ap-payment-dialog{width:98vw!important;height:96vh;max-height:96vh!important}
  .ap-payment-workflow{height:calc(96vh - 64px)}
  .ap-pay-sticky-head{grid-template-columns:1fr 1fr}
  .ap-pay-sticky-head>div:first-child{grid-column:1/-1}
  .ap-pay-head-stat:last-child{grid-column:1/-1}
  .ap-pay-step{overflow:auto}
  .ap-pay-table-wrap{height:auto;overflow:visible;border:0;background:transparent}
  .ap-pay-table,.ap-pay-table tbody,.ap-pay-table tr,.ap-pay-table td{display:block;width:100%!important}
  .ap-pay-table thead{display:none}
  .ap-pay-table tr:not(.ap-pay-detail-row){margin:0 0 10px;border:1px solid #dbe7e3;border-radius:10px;background:white;padding:9px;display:grid;grid-template-columns:38px 1.3fr 1fr;gap:6px 10px}
  .ap-pay-table td{border:0!important;padding:4px!important;text-align:left!important}
  .ap-pay-table td:nth-child(1){grid-row:1/4;align-self:center}
  .ap-pay-table td:nth-child(4),.ap-pay-table td:nth-child(5),.ap-pay-table td:nth-child(6){text-align:right!important}
  .ap-pay-detail-row{margin-top:-8px!important}
  .ap-pay-detail-grid{grid-template-columns:1fr 1fr;padding:10px}
}
@media(max-width:620px){
  .ap-pay-sticky-head{grid-template-columns:1fr 1fr;padding:10px}
  .ap-pay-step{padding:10px}
  .ap-pay-step-title{align-items:flex-start;flex-direction:column}
  .ap-pay-review{grid-template-columns:1fr}
  .ap-pay-sticky-foot{align-items:stretch;flex-direction:column}
  .ap-pay-foot-total{justify-content:space-between}
  .ap-pay-foot-actions{display:grid;grid-template-columns:1fr}
  .ap-payment-dialog .primary-btn,.ap-payment-dialog .secondary-btn{width:100%;min-width:0}
}


/* HF26J · AP payable rows compact + detail beside document no. */
.ap-pay-table th,.ap-pay-table td{padding:6px 8px!important;line-height:1.25!important}
.ap-pay-table small{margin-top:1px!important;font-size:9.5px!important;line-height:1.25!important}
.ap-pay-doc-line{display:flex!important;align-items:center!important;gap:7px!important;min-width:0!important}
.ap-pay-doc-line strong{display:block!important;min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;color:#15483b!important;font-size:11.5px!important}
.ap-pay-detail-toggle{flex:0 0 auto!important;margin:0!important;padding:2px 6px!important;border:1px solid #c8ddd5!important;border-radius:6px!important;background:#f8fcfa!important;color:#176f59!important;text-decoration:none!important;font-size:9px!important;line-height:1.3!important;white-space:nowrap!important}
.ap-pay-detail-toggle:hover{background:#eaf7f1!important;border-color:#9fcbbb!important}
.ap-pay-date,.ap-pay-money{line-height:1.2!important}
.ap-pay-cut input{min-height:32px!important;height:32px!important;padding:4px 7px!important}
.ap-pay-detail-grid{padding:7px 42px!important;gap:4px 16px!important;font-size:10.5px!important}
@media(max-width:1000px){.ap-pay-detail-grid{padding:8px!important}.ap-pay-doc-line{gap:5px!important}.ap-pay-detail-toggle{padding:2px 5px!important}}

/* HF26K · Supplier invoice number + expandable invoice product detail */
.ap-pay-detail-docs{display:flex;flex-wrap:wrap;gap:5px 16px;padding:7px 42px 5px;font-size:10.5px;color:#526b64}
.ap-pay-detail-docs b{color:#153f35}
.ap-pay-items-title{padding:5px 42px 4px;font-size:10.5px;font-weight:800;color:#174f40}
.ap-pay-items-wrap{margin:0 42px 8px;overflow:auto;border:1px solid #dce9e4;border-radius:8px;background:#fff}
.ap-pay-items-table{width:100%;border-collapse:collapse;font-size:10.5px;min-width:720px}
.ap-pay-items-table th{padding:5px 7px;background:#edf7f3;color:#345d52;text-align:left;font-size:9.5px;white-space:nowrap}
.ap-pay-items-table td{padding:5px 7px!important;border-top:1px solid #edf2f0!important;vertical-align:top}
.ap-pay-items-table td.num,.ap-pay-items-table th:nth-child(n+4){text-align:right!important;white-space:nowrap}
.ap-pay-item-sn{display:block!important;margin-top:2px!important;color:#6a7e78!important;font-size:9px!important;white-space:normal!important;overflow-wrap:anywhere}
.ap-pay-items-empty{margin:0;padding:8px 42px;color:#71827d;font-size:10px}
@media(max-width:1000px){.ap-pay-detail-docs,.ap-pay-items-title{padding-left:8px;padding-right:8px}.ap-pay-items-wrap{margin-left:8px;margin-right:8px}.ap-pay-items-empty{padding-left:8px;padding-right:8px}}
