.admin-operation-view{padding-bottom:40px}
.operation-panel{background:#fff;border:1px solid #dce4f1;border-radius:15px;padding:22px;margin:18px 0;display:grid;grid-template-columns:minmax(0,1fr);gap:18px;min-width:0}
.admin-operation-view,.admin-operation-view .operation-panel>*,.admin-operation-view .operation-grid>*,#purchaseLines{min-width:0;max-width:100%}
.operation-panel>h3,.operation-lines-head h3{margin:0;color:#172033}
.operation-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.operation-lines-head{display:flex;align-items:center;justify-content:space-between;gap:15px;flex-wrap:wrap;min-width:0}
.operation-lines-head button{border:1px solid #1759e8;background:#fff;color:#1759e8;border-radius:9px;padding:9px 14px;font-weight:700;cursor:pointer}
.sale-line-tools{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex:1}.sale-line-tools label{min-width:220px;max-width:360px;flex:1}.sale-line-tools input{width:100%;height:42px;border:1px solid #dfe4ed;border-radius:9px;padding:0 13px;font:inherit;color:#172033}.sale-line-tools input:focus{border-color:#1759e8;outline:2px solid rgba(23,89,232,.12)}
#resetAdminSale{margin-left:auto;border:1px solid #c9d3e4;border-radius:9px;background:#fff;color:#3f4e68;padding:10px 15px;font-weight:700;cursor:pointer}#resetAdminSale:hover{border-color:#1759e8;color:#1759e8}
.operation-line{display:grid;grid-template-columns:2fr repeat(4,minmax(110px,1fr)) 130px 32px;gap:10px;align-items:end;border:1px solid #edf0f5;border-radius:10px;padding:12px;min-width:0;max-width:100%}
.sale-line{grid-template-columns:2fr minmax(110px,1fr) 130px minmax(140px,1fr) 32px}
.purchase-line{grid-template-columns:minmax(180px,2fr) repeat(5,minmax(95px,1fr)) 110px 94px}
.purchase-line .line-actions{display:flex;gap:5px;align-items:center}
.purchase-line .line-edit{border:1px solid #1759e8;background:#fff;color:#1759e8;border-radius:7px;min-height:34px;padding:5px 8px;font-weight:700;cursor:pointer}
.purchase-line.line-summary input:not(.product-search),.purchase-line.line-summary .product-picker-trigger{border:0;background:transparent;padding:0;color:#172033;font-weight:600;box-shadow:none}
.purchase-line.line-summary .product-picker-trigger{cursor:default}
.purchase-line.line-summary input[type="number"]::-webkit-inner-spin-button,.purchase-line.line-summary input[type="number"]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
.purchase-line .package-details{grid-column:1/-1;display:block;min-width:0;padding:12px 0 2px;border-top:1px dashed #dfe4ed}
.purchase-line .package-details,.purchase-line .package-batches,.purchase-line .package-batch{width:100%;max-width:100%;box-sizing:border-box}
.purchase-line.line-summary .package-batch{grid-template-columns:repeat(4,minmax(0,1fr))}
.purchase-line .package-details[hidden]{display:none}
.package-batch-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px;flex-wrap:wrap}
.package-batch-head button{border:1px solid #1759e8;background:#fff;color:#1759e8;border-radius:8px;padding:8px 11px;font-weight:700;cursor:pointer}
.package-batches{display:grid;gap:9px}
.package-batch{display:grid;grid-template-columns:repeat(4,minmax(0,1fr)) 34px;align-items:end;gap:9px;border:1px solid #e6eaf1;border-radius:9px;padding:10px;min-width:0}
.package-batch>*{min-width:0}
.package-batch-remove{height:36px;border:0;border-radius:7px;background:#fff1f1;color:#bd2c2c;font-size:20px;cursor:pointer}
.package-batch-remove[hidden],.purchase-line.line-summary .package-batch-head button,.purchase-line.line-summary .package-batch-remove{display:none}
#purchaseLines:empty::before{content:"No products added yet. Click Add product to start.";display:block;border:1px dashed #dce4f1;border-radius:10px;padding:18px;color:#687389}
.purchase-extras{margin-top:16px;max-width:560px}
.payment-bill-balance{margin:0;padding:12px 14px;border-radius:9px;background:#edf3ff;color:#1146bd;font-weight:700}
.bill-transaction-panel{margin:16px 0 20px}.bill-transaction-panel h4{margin:0 0 8px}.bill-transaction-row{display:grid;grid-template-columns:120px minmax(0,1fr) 130px auto;gap:12px;align-items:center;padding:9px 0;border-top:1px solid #e7ecf6}.bill-transaction-row strong{text-align:right}.bill-number-link{border:0;background:none;padding:0;text-align:left;color:#1146bd;font:inherit;font-weight:700;cursor:pointer;text-decoration:underline}.bill-details-card{max-width:1000px}.bill-details-meta{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}.bill-details-meta p{flex-basis:100%;margin:0;color:#687389}.bill-details-meta{flex-wrap:wrap}.bill-details-table-wrap{max-height:48vh;overflow:auto;border:1px solid #e1e7f0;border-radius:8px}.bill-details-table{width:100%;min-width:680px;border-collapse:collapse;text-align:left}.bill-details-table th,.bill-details-table td{padding:12px 14px;border-bottom:1px solid #e7ecf6;vertical-align:top}.bill-details-table thead th{position:sticky;top:0;z-index:1;background:#f5f7fb;color:#4e5b70;font-size:12px;text-transform:uppercase}.bill-details-table th:last-child,.bill-details-table td:last-child{text-align:right}.bill-details-table tbody td:first-child{width:28%}.bill-details-table tbody td:last-child{white-space:nowrap}.bill-details-table small{display:block;margin-top:5px;color:#687389}.bill-details-table .bill-package-detail{padding-top:5px;border-top:1px dashed #dce3ee}.bill-details-table tfoot th,.bill-details-table tfoot td{padding-top:8px;padding-bottom:8px;background:#fbfcfe;text-align:right}.bill-details-table .bill-grand-total th,.bill-details-table .bill-grand-total td{padding-top:13px;padding-bottom:13px;border-bottom:0;background:#f2f6fd;color:#172033;font-size:18px}.bill-payments-title{margin:22px 0 9px}.bill-details-payments{max-height:260px}.bill-payments-table{min-width:620px}.bill-payments-table td:nth-child(3),.bill-payments-table th:nth-child(3){text-align:right}.bill-payments-table td:last-child{width:120px}.bill-empty-payments{margin:0;padding:16px;color:#687389}.bill-payment-delete{border:1px solid #e8b9b9;border-radius:8px;background:#fff4f4;color:#b72121;padding:7px 10px;cursor:pointer}#editPurchaseBill{margin:12px 0;padding:10px 18px;border:1px solid #1853d7;border-radius:8px;background:#1853d7;color:white;cursor:pointer}#editPurchaseBill:disabled{opacity:.5;cursor:not-allowed}
#purchasesView .portal-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap}#newPurchaseButton{margin-left:auto;border:1px solid #1853d7;border-radius:9px;background:#1853d7;color:#fff;padding:11px 17px;font-weight:700;cursor:pointer}#deletePurchaseBill{margin:12px 0 12px 10px;padding:10px 18px;border:1px solid #c02c2c;border-radius:8px;background:#fff3f3;color:#a82020;font-weight:700;cursor:pointer}#deletePurchaseBill:disabled{opacity:.5;cursor:not-allowed}
.operation-lines-head h3 small{display:block;margin-top:4px;color:#687389;font-size:13px;font-weight:500}.production-lines{display:grid;gap:10px}.production-line{display:grid;grid-template-columns:minmax(260px,2fr) minmax(130px,1fr) 42px;gap:12px;align-items:end;border:1px solid #e2e8f2;border-radius:11px;padding:13px;min-width:0}.production-line>*{min-width:0}.production-line .supplier-picker{width:100%}.production-line .supplier-picker-trigger{width:100%;min-height:48px;text-align:left}.production-line .production-picker-menu{z-index:30}.production-line .production-search{width:100%;margin-bottom:8px}.production-line .line-remove{height:46px;border:0;border-radius:8px;background:#fff1f1;color:#bd2c2c;font-size:20px;cursor:pointer}.production-line>small{grid-column:1/-1;color:#687389}.production-lines:empty::before{content:'Add at least one product.';padding:14px;border:1px dashed #dce4f1;border-radius:9px;color:#687389}
.production-line[data-type="output"]{grid-template-columns:minmax(240px,2fr) minmax(150px,1fr) minmax(120px,1fr) 42px}
@media(max-width:620px){.production-line,.production-line[data-type="output"]{grid-template-columns:minmax(0,1fr) 44px}.production-line>label:first-child{grid-column:1/-1}.production-line>small{grid-column:1/-1}}
@media(max-width:620px){.bill-transaction-row{grid-template-columns:1fr auto}.bill-transaction-row span{grid-column:1}.bill-transaction-row strong{grid-column:2;grid-row:1}.bill-transaction-row .bill-payment-delete{grid-column:2;grid-row:2}}
#supplierPaymentAmount[readonly]{background:#f4f6fa;color:#172033}
.admin-operation-view .product-search,.admin-operation-view #purchaseSupplierSearch{margin-bottom:6px}
.supplier-picker{position:relative;width:100%}
.supplier-picker-trigger{width:100%;min-width:0;min-height:48px;padding:12px 16px;background:#fff;border:1px solid #dfe4ed;border-radius:11px;text-align:left;font:inherit;color:#172033;display:flex;align-items:center;justify-content:space-between;gap:10px;cursor:pointer;overflow-wrap:anywhere}
.supplier-picker-trigger span{font-size:20px;line-height:1}
.supplier-picker-menu{position:absolute;top:calc(100% + 4px);left:0;width:100%;z-index:60;background:#fff;border:1px solid #dfe4ed;border-radius:11px;box-shadow:0 14px 34px rgba(20,32,55,.16);padding:8px;max-height:300px;overflow:auto}
.supplier-picker-menu[hidden]{display:none}
.supplier-picker-menu #purchaseSupplierSearch{width:100%;margin:0 0 6px}
.supplier-picker-menu .product-search{width:100%;margin:0 0 6px}
.supplier-picker-results button{display:block;width:100%;padding:10px 12px;border:0;border-radius:7px;background:#fff;text-align:left;font:inherit;color:#172033;cursor:pointer}
.supplier-picker-results button:hover,.supplier-picker-results button[aria-selected="true"]{background:#eaf0ff;color:#1759e8}
.supplier-picker-results p{margin:8px;color:#687389}
.admin-operation-view #purchaseDescription{width:100%;resize:vertical}
.sale-line{grid-template-columns:2fr 110px 150px 1fr 1fr 32px}
.operation-line .login-field{min-width:0}.operation-line input,.operation-line select{width:100%}
.line-result{display:grid;gap:2px;font-size:11px;color:#687389}.line-result b{font-size:13px;color:#172033}
.line-remove{border:0;background:#fff1f1;color:#bd2c2c;border-radius:7px;height:34px;font-size:20px;cursor:pointer}
.operation-total{display:flex;justify-content:flex-end;gap:20px;flex-wrap:wrap;border-top:1px solid #edf0f5;padding-top:15px}.operation-total strong{color:#1759e8}
.operation-history{display:grid;grid-template-columns:170px 1fr 140px;gap:12px;align-items:center;border-top:1px solid #edf0f5;padding:12px 0}.operation-history span{color:#687389}.operation-history strong{text-align:right}
@media(max-width:1200px){.purchase-line{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:1000px){.operation-line,.sale-line{grid-template-columns:repeat(3,minmax(0,1fr))}.operation-line>.operation-product{grid-column:1/-1}.operation-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:800px){.admin-operation-view .operation-lines-head{align-items:stretch;flex-direction:column}.admin-operation-view .operation-lines-head button{width:100%;max-width:100%;white-space:normal}.admin-operation-view .operation-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.admin-operation-view .operation-total{justify-content:flex-start}}
@media(max-width:800px){.sale-line-tools{width:100%;align-items:stretch}.sale-line-tools label{max-width:none}}
@media(max-width:520px){.sale-line-tools{flex-direction:column}.sale-line-tools label{width:100%;min-width:0}}
@media(max-width:620px){.admin-operation-view .operation-grid,.admin-operation-view .operation-line,.admin-operation-view .purchase-line .package-details{grid-template-columns:minmax(0,1fr)}.admin-operation-view .operation-line>*,.admin-operation-view .purchase-line .package-details>*{min-width:0;max-width:100%}.admin-operation-view .operation-line input,.admin-operation-view .operation-line select,.admin-operation-view .operation-line button,.admin-operation-view textarea{max-width:100%}.admin-operation-view .operation-line .line-actions{justify-content:flex-end}.operation-history{grid-template-columns:1fr}.operation-history strong{text-align:left}.operation-panel{padding:14px}}
.purchase-editor-overlay{position:fixed;inset:0;z-index:1000;display:flex;align-items:center;justify-content:center;padding:16px;background:rgba(13,24,48,.65)}
.purchase-editor-overlay[hidden]{display:none}
.purchase-editor-card{width:min(900px,100%);max-height:calc(100vh - 32px);overflow:auto;background:#fff;border-radius:16px;padding:22px;box-shadow:0 24px 70px rgba(8,22,50,.28)}
.purchase-editor-head,.purchase-editor-footer{display:flex;align-items:center;justify-content:space-between;gap:12px}
.purchase-editor-head{margin-bottom:16px}.purchase-editor-head h2{margin:0;font-size:22px}
.purchase-editor-head button{border:1px solid #dce4f1;border-radius:9px;background:#fff;font-size:23px;width:40px;height:40px;cursor:pointer}
.purchase-editor-card .purchase-line{grid-template-columns:repeat(3,minmax(0,1fr));align-items:start}
.purchase-editor-card .purchase-line>*,.purchase-editor-card .package-details>*{min-width:0}
.purchase-editor-card .line-actions{display:none}
.purchase-editor-footer{justify-content:flex-end;margin-top:18px}
.purchase-editor-footer button{padding:11px 18px;border-radius:9px;border:1px solid #1759e8;background:#fff;color:#1759e8;font:inherit;font-weight:700;cursor:pointer}
.purchase-editor-footer #okPurchaseEditor{background:#1759e8;color:#fff}
@media(max-width:700px){.purchase-editor-card{padding:14px}.purchase-editor-card .purchase-line,.purchase-editor-card .package-batch{grid-template-columns:minmax(0,1fr)}.purchase-editor-footer{flex-wrap:wrap}.purchase-editor-footer button{flex:1 1 120px}.package-batch-remove{justify-self:end;min-width:40px}}
