.stock-movements{margin:12px 0;border:1px solid #e5e7eb;border-radius:14px;overflow:hidden}
.stock-ledger>summary{padding:12px 14px;cursor:pointer;font-weight:600}
.stock-ledger-body{padding:0 12px 12px}.stock-totals{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;padding:8px;background:#f5f6f8;border-radius:10px}
.stock-totals div{display:flex;flex-direction:column;gap:4px}.stock-totals small,.stock-ledger-stamp{font-size:11px;color:#6b7280}.stock-totals b{font-size:19px}.stock-free b{color:#147b55}.stock-ledger-stamp{margin:7px 0}
.stock-ledger-filters{display:flex!important;flex-wrap:wrap;align-items:center;gap:5px;margin:10px 0}.stock-ledger-filters input,.stock-ledger-filters select{width:auto!important;min-width:0;max-width:160px;flex:1 1 110px;margin:0!important;min-height:32px!important;height:32px!important;padding:4px 7px!important;font-size:12px!important}.stock-ledger-filters input[type=search]{max-width:220px}.stock-ledger-filters button{width:32px;height:32px;min-height:32px;flex:none;margin:0}
.stock-ledger-scroll{overflow:auto}.stock-ledger-table{min-width:440px}.stock-ledger-row{display:grid;grid-template-columns:58px minmax(130px,1fr) 48px 48px 50px 28px;gap:6px;align-items:center;padding:7px 2px;border-bottom:1px solid #eef0f3;font-size:12px;line-height:1.3}.stock-ledger-head{font-size:10px;color:#6b7280;position:sticky;top:0;background:#fff}.stock-document{min-width:0}.stock-document b{font-weight:500}.stock-document small{display:block;color:#6b7280;font-size:10px;margin-top:2px}.stock-row-note{display:none!important}.stock-ledger-row:hover .stock-row-note{display:block!important}.stock-observation{background:#f8f9fb}.stock-in{color:#168454}.stock-out{color:#cc5148}.stock-ledger-row .round-action{width:26px;height:26px;min-height:26px;padding:4px}.stock-ledger-row .round-action svg{width:17px;height:17px}.stock-document button,.stock-reserves button{border:0;background:none;color:#007aff;font:inherit;padding:0;min-height:0}.stock-reserves summary,.stock-coverage summary{font-size:12px;cursor:pointer;padding:6px 0}.stock-reserves>div{display:flex;align-items:center;gap:10px;padding:4px 0;font-size:12px}.stock-reserves small{color:#6b7280}.stock-coverage p,.stock-coverage a{font-size:11px;color:#6b7280;line-height:1.5}.stock-more{margin-top:8px;font-size:12px}.stock-ledger-row>span:first-child{font-variant-numeric:tabular-nums}
@media(max-width:480px){.stock-ledger-body{padding:0 8px 8px}.stock-totals{grid-template-columns:repeat(2,minmax(0,1fr))}.stock-ledger-filters input,.stock-ledger-filters select{flex-basis:90px}.stock-ledger-scroll{margin:0 -4px}.stock-ledger-table{min-width:410px}.stock-ledger-row{grid-template-columns:52px minmax(118px,1fr) 42px 42px 44px 25px;gap:4px;font-size:11px}}

.stock-ledger .stock-ledger-table{min-width:0}
.stock-ledger .stock-ledger-row{display:grid;width:100%;grid-template-columns:52px minmax(0,1fr) max-content;align-items:center;text-align:left;background:transparent;color:inherit;border:0;border-bottom:1px solid #e8eaee;padding:3px 4px;min-height:28px;margin:0;font:inherit;font-size:12px;text-decoration:none}
.stock-ledger :is(a,button).stock-ledger-row:hover{background:#eef4fa}
.stock-ledger .stock-ledger-row>:last-child{text-align:right;font-variant-numeric:tabular-nums}
/* Shared alignment for recent and full product movement history. */
.jd-product-photo-column{min-width:0}.jd-product-photo-column .jd-product-photo{width:100%;box-sizing:border-box}
.product-under-photo{margin:8px 0 0;display:grid;gap:3px;font-size:12px}.product-under-photo>div{display:grid;grid-template-columns:1fr auto;align-items:center;gap:10px;border-radius:6px;padding:4px 7px}.product-under-photo dt,.product-under-photo dd{margin:0}.product-under-photo dd{font-weight:600;text-align:right;font-variant-numeric:tabular-nums}.product-under-photo small{display:inline-block;width:32px;font-size:10px;font-weight:400;margin-left:5px;text-align:right}.balance-available{background:#e8f5ee;color:#23734f}.balance-shelf{background:#edf3fb;color:#3f6187}.balance-reserved{background:#fff3dc;color:#936c23}
.product-history{margin:12px 0}.product-history-heading,.product-movements-dialog header{display:flex;justify-content:space-between;align-items:center;gap:10px}.product-history-heading strong{font-size:12px}.product-open-movements{font-size:12px;min-height:30px;padding:4px 10px;border-radius:7px}.product-history-scroll{overflow:auto;max-height:65vh;margin:7px 0}.product-history-table{border-collapse:collapse;width:100%;table-layout:fixed;font-size:12px}.product-history-table th,.product-history-table td{padding:5px 7px;border-bottom:1px solid #e8edf2;vertical-align:middle;text-align:right;font-variant-numeric:tabular-nums}.product-history-table th{font-size:10px;color:#758398;background:#f8fafc;position:sticky;top:0;z-index:1}.product-history-table th:first-child,.product-history-table td:first-child{text-align:left;width:52%}.product-history-table th:not(:first-child){width:16%}.product-history-table td:first-child time{display:block;color:#7e8ca0;font-size:10px}.product-history-table td:first-child span{display:block}.product-history-table button{font:inherit;color:#356a9a;background:transparent;border:0;padding:0 2px;min-height:0;border-radius:3px}.product-history-table td:first-child a svg{width:16px;height:16px;vertical-align:middle}.product-history-table .movement-reserve{color:#a47a22}.product-history-table .movement-out{color:#b64c45}.product-history-table .movement-in{color:#278262}.product-history-table td:last-child{font-weight:600}.product-history-note{display:block;color:#8190a2;font-size:10px;margin-top:4px}.product-movements-dialog h2{font-size:17px;margin:0}.product-movements-dialog header{justify-content:flex-start}
@media(max-width:550px){.product-history-table{font-size:11px}.product-history-table th,.product-history-table td{padding:5px 3px}.product-history-table th:first-child,.product-history-table td:first-child{width:46%}.product-history-table th:not(:first-child){width:18%}.product-under-photo{font-size:11px}.product-history-table td:first-child span{overflow-wrap:anywhere}}

#detail .product-document-row{display:grid!important;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;padding:7px 0;border-bottom:1px solid #e7ebef}#detail .product-document-row a{min-width:0;overflow-wrap:anywhere;text-decoration:none;color:#2479bf;font-size:12px}#detail .product-document-row small{white-space:nowrap;color:#7b8796;font-size:11px}#detail .product-document-list{padding-top:8px}

#detail .product-history{margin:6px 0;padding:4px 0}#detail .product-history-table{font-size:11px}#detail .product-history-table td,#detail .product-history-table th{padding:2px 4px;line-height:1.25}#detail .product-history-table td:first-child time,#detail .product-history-table td:first-child span{display:inline}#detail .product-history-table time{margin-right:7px}#detail .product-history-table a{font:inherit;color:#347cb4;text-decoration:none}#detail .product-history-heading{margin:3px 0;display:flex;justify-content:space-between;align-items:center}#detail .product-reservations-open{border:0;background:none;color:#a47a22;font:inherit;padding:0;min-height:0;height:auto;cursor:pointer}
.product-reservations-dialog{border:0;border-radius:14px;padding:16px;width:min(480px,calc(100vw - 32px));max-height:75vh;box-sizing:border-box;overflow:auto}.product-reservations-dialog::backdrop{background:#0005}.product-reservations-dialog header{display:flex;align-items:center;justify-content:space-between;gap:8px}.product-reservations-dialog h3{font-size:14px;margin:0}.product-reservation-row{display:flex;justify-content:space-between;gap:12px;padding:4px 0;font-size:12px;border-bottom:1px solid #e8edf2}.product-reservation-row a{color:#347cb4;text-decoration:none}

#detail details.product-history>summary.product-history-heading{display:list-item;cursor:pointer;font-size:12px;font-weight:600;padding:3px 0;margin:0}#detail details.product-history>.product-more-movements{margin:4px 0;min-height:26px;padding:2px 8px}

#detail .product-shelf-form{display:flex;flex-wrap:wrap;align-items:center;gap:3px;margin:0}#detail .product-shelf-form input{width:68px;max-width:100%;min-height:28px;height:28px;box-sizing:border-box;padding:2px 4px}#detail .product-shelf-form button{min-height:26px!important;height:26px!important;width:26px!important;padding:0!important}#detail .product-shelf-form [role=status]{flex-basis:100%;white-space:normal;color:#a44;font-size:10px}#detail .product-field-input{width:100%;min-width:0;max-width:100%;box-sizing:border-box;font:inherit;min-height:28px;height:auto;padding:3px 5px;margin:0}#detail .product-pack-inline{display:flex;gap:4px}#detail .product-pack-inline>span{flex:1;min-width:0}#detail .product-edit-status{font-size:11px;margin:3px 0;color:#a44}#detail .product-edit-status:empty{display:none}#detail .jd-product-heading h2{min-width:0;flex:1}

/* Stable balance alignment, including inline physical count editing. */
html.bk-personal-type #detail .product-under-photo>div{display:grid!important;grid-template-columns:70px minmax(0,1fr)!important;align-items:center!important;min-height:36px!important;box-sizing:border-box;padding:4px 8px!important;margin:3px 0!important;gap:4px!important}
html.bk-personal-type #detail .product-under-photo dt{margin:0!important;padding:0!important;min-width:0;line-height:1.2!important}
html.bk-personal-type #detail .product-under-photo dd{display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:8px!important;margin:0!important;padding:0!important;min-width:0;line-height:1.2!important}
html.bk-personal-type #detail .product-under-photo dd>small{width:30px!important;text-align:right!important;flex:0 0 30px;font:inherit}
html.bk-personal-type #detail .product-under-photo .product-reservations-open{min-height:0!important;height:auto!important;width:auto!important;padding:0!important;line-height:1.2!important;text-align:left}
html.bk-personal-type #detail .product-shelf-form{display:grid!important;grid-template-columns:minmax(40px,1fr) 26px 26px!important;align-items:center!important;gap:4px!important;width:100%;margin:0!important}
html.bk-personal-type #detail .product-shelf-form input{width:100%!important;min-width:0!important;min-height:26px!important;height:26px!important;max-height:26px!important;padding:2px 5px!important;margin:0!important;box-sizing:border-box!important;border:1px solid #c8d6e4!important;border-radius:6px!important;text-align:right!important;font:inherit!important;box-shadow:none!important;outline:none!important}
html.bk-personal-type #detail .product-shelf-form input:focus{border-color:#388bea!important;box-shadow:0 0 0 1px #388bea!important}
html.bk-personal-type #detail .product-shelf-form button{width:26px!important;min-width:26px!important;height:26px!important;min-height:26px!important;padding:0!important;margin:0!important;border-radius:6px!important;font-size:13px!important;line-height:26px!important}
html.bk-personal-type #detail .product-shelf-form [role=status]{grid-column:1/-1;max-width:100%;font-size:10px!important;line-height:1.2!important;margin:0!important}
html.bk-personal-type #detail .product-shelf-form [role=status]:empty{display:none!important}
