/* KhoViet 1.7.4 — readable desktop-first sales, purchase and returns workflow */
:root{--kv-blue:#0878ec;--kv-blue-dark:#0769d3;--kv-text:#1d2d41;--kv-border:#dde5ef;--kv-soft:#f4f7fb}
button,input,select,textarea{font-family:inherit}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid #318df5;outline-offset:2px}
/* Product price edit belongs to the clicked product, never an always-visible crowded grid. */
.product-expanded-panel{padding:20px 24px;gap:17px;background:linear-gradient(120deg,#f5f9ff,#fff 80%)}
.product-expanded-intro strong{font-size:19px;color:#20344e}
.product-expanded-intro small{font-size:14px}
.product-expanded-actions{gap:12px;align-items:flex-start}
.product-expanded-actions .inline-price-edit.price-editor-v174{flex:0 1 100%;max-width:none!important;order:2;margin:4px 0 0}
.product-expanded-actions .price-editor-v174 summary{display:inline-flex;align-items:center;min-height:42px;padding:10px 16px!important;background:#eaf3ff!important;border:1px solid #bcd8f9!important;color:#096ed2!important;font-size:15px!important;font-weight:750;border-radius:9px!important}
.product-expanded-actions .price-editor-v174[open] summary{background:#0878ec!important;color:#fff!important;border-color:#0878ec!important}
.price-editor-body{max-width:1120px;margin-top:13px;padding:20px;background:#fff;border:1px solid #dbe6f4;border-radius:14px;box-shadow:0 8px 28px #294a7410}
.price-editor-heading{display:flex;flex-direction:column;gap:4px;margin-bottom:18px}.price-editor-heading strong{font-size:18px;color:#1d304b}.price-editor-heading small{font-size:14px;color:#687b91}
.product-expanded-actions .inline-price-edit .price-editor-form{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(195px,1fr));gap:15px!important;box-shadow:none!important;padding:0!important;margin:0!important}
.price-editor-form label{display:flex;flex-direction:column;gap:8px!important;padding:15px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:11px;font-size:14px;font-weight:700;color:#3c4c63}
.price-editor-form label.price-editor-retail{background:#eff7ff;border-color:#c8e3ff}
.price-editor-form label.price-editor-cost{background:#fffaf1;border-color:#f3e2b7}
.price-editor-form input{min-height:44px;width:100%;padding:10px 12px!important;font-size:17px!important;font-variant-numeric:tabular-nums;font-weight:700;border:1px solid #d1ddeb!important;border-radius:8px}
.price-editor-form label small{font-size:12px;color:#78889d;font-weight:450}
.price-editor-bottom{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:14px;grid-column:1/-1;border-top:1px solid #e7edf4;padding:15px 0 0;color:#6f8196;font-size:13px}
.price-editor-bottom .btn{min-width:180px;min-height:44px;font-size:15px!important}
/* Purchase suggestions and lines: larger text, visible active keyboard selection */
.purchase-hints{z-index:130;max-height:310px;border:1px solid #c5d8f2;box-shadow:0 15px 38px #1b355933;border-radius:11px}
.purchase-hints button{font-size:15px!important;line-height:1.4;padding:13px 16px!important}
.purchase-hints button.is-active,.purchase-hints button:hover{background:#e6f2ff!important;color:#075bb6!important;box-shadow:inset 3px 0 var(--kv-blue)}
.purchase-hints .search-create{background:#eaf5ff!important;color:#096ccc!important;font-weight:750}
.purchase-no-match{font-size:14px;padding:14px 16px}
.purchase-row-v04 .line-product-search,.supplier-grid #supplier-search{font-size:15px;min-height:43px}
.purchase-row-v04 .line-qty,.purchase-row-v04 .line-price{font-size:16px;min-height:42px}
.purchase-row-v04 .line-total{font-size:16px;font-weight:800}
.toggle-new-product[hidden]{display:none!important}
.purchase-price-panel{margin:2px 14px 15px;border-radius:13px;border:1px solid #cfdff2;border-top:4px solid var(--kv-blue);background:#f6f9fe;padding:20px}
.purchase-price-panel-heading{margin-bottom:16px}.purchase-price-heading-title{font-size:17px}
.purchase-price-panel .purchase-price-tags{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px}
.purchase-price-panel .price-tag{width:auto;min-width:0;max-width:none;flex:none;box-shadow:0 4px 10px #112a4c08;padding:15px}
.purchase-price-panel .price-tag span{font-size:15px}.purchase-price-panel .price-tag input{font-size:17px;min-height:45px;font-weight:700}
/* POS: intuitive large typography and generous actionable targets */
body.pos-fullscreen{background:#e9edf2}
.pos-v174 .pos-toolbar{height:63px;min-height:63px;padding:7px 13px;border-radius:0;gap:9px;background:#0673e8}
.pos-v174 .pos-search-wrap{width:min(37%,510px);min-width:260px}
.pos-v174 .pos-search-wrap input{height:46px;font-size:16px;border-radius:8px;padding-left:15px}
.pos-v174 .pos-invoice-tabs{max-width:39%}
.pos-v174 .pos-v173-tab button{font-size:15px;padding:12px 10px}
.pos-v174 .pos-v173-tab button:last-child{font-size:21px}
.pos-v174 .pos-add-invoice{font-size:27px;min-width:38px}
.pos-v174 .pos-list-link{font-size:15px;font-weight:700}
.pos-v174 .pos-sales-grid{grid-template-columns:minmax(0,1fr) minmax(390px,30%);gap:12px;padding:13px;min-height:calc(100vh - 63px)}
.pos-v174 .pos-sales-center{min-height:calc(100vh - 90px)}
.pos-v174 .pos-v173-lines{gap:9px}
.pos-v174 .pos-v173-line{grid-template-columns:24px 34px minmax(175px,1fr) 84px 118px 116px 37px 95px;gap:9px;padding:15px 13px 12px;border:1px solid #dfe7f0;border-radius:12px;box-shadow:0 2px 8px #1838520c}
.pos-v174 .pos-v173-line-name strong{font-size:16px!important;font-weight:750;line-height:1.45;white-space:normal}
.pos-v174 .pos-v173-line-name small{font-size:13px!important;line-height:1.3}
.pos-v174 .pos-line-no{font-size:14px;color:#677991}
.pos-v174 .pos-remove{font-size:24px;color:#df6174;font-weight:400;min-height:37px}
.pos-v174 .pos-v173-line input.pos-qty,.pos-v174 .pos-v173-line input.pos-unit-price{font-size:16px!important;min-height:41px;padding:8px 5px;font-weight:600}
.pos-v174 .pos-v173-line .pos-line-total{font-size:16px;font-weight:800}
.pos-v174 .pos-v173-history{font-size:13px;min-height:37px;font-weight:700;padding:6px 7px;border-radius:7px}
.pos-v174 .pos-v173-add-row{font-size:27px;color:#0875ea}
.pos-v174-line-note{grid-column:3/-1;display:flex;align-items:center;gap:10px;margin-top:1px;background:#f6f8fc;border-radius:8px;padding:3px 10px;color:#72829a}
.pos-v174 .pos-v174-line-note input.pos-line-note{width:100%;min-width:0;height:36px;min-height:36px;border:0;background:transparent;text-align:left!important;font-size:14px!important;font-weight:400;padding:5px 0;box-shadow:none;outline:none}
.pos-v174 .pos-v173-note{font-size:15px;min-height:66px;padding:16px 18px}
.pos-v174 .pos-v173-note input{font-size:15px}
.pos-v174 .pos-v173-checkout{padding:20px!important;gap:17px}
.pos-v174 .pos-operator{font-size:16px;font-weight:750}
.pos-v174 .pos-customer-line input,.pos-v174 .pos-customer-line button{font-size:15px;min-height:44px}
.pos-v174 .pos-v173-list select{font-size:15px;min-height:42px;padding:9px 12px}
.pos-v174 .pos-money-row{font-size:15px;min-height:34px;gap:10px}
.pos-v174 .pos-money-row b,.pos-v174 .pos-money-row strong{font-size:16px}
.pos-v174 .pos-money-row.grand{min-height:58px;padding:12px 0;border-top:1px solid #e9eff6;border-bottom:1px solid #e9eff6}
.pos-v174 .pos-money-row.grand strong{font-size:18px}.pos-v174 .pos-money-row.grand strong:last-child{font-size:23px;color:var(--kv-blue)}
.pos-v174 .pos-money-row input{font-size:17px;font-weight:700;max-width:160px;min-height:39px}
.pos-v174 .pos-v173-methods{font-size:14px;gap:13px}.pos-v174 .pos-v173-methods label{font-size:14px;cursor:pointer}
.pos-v174 .pos-v173-cash{padding:12px;gap:8px}.pos-v174 .pos-v173-cash button{font-size:14px;padding:9px 11px;min-height:38px}
.pos-v174 .pos-checkout-actions{gap:8px}.pos-v174 .pos-print-btn,.pos-v174 .pos-checkout-btn{min-height:60px;font-size:17px;font-weight:800;border-radius:10px}
.pos-v174 .pos-v173-empty{font-size:16px}.pos-v174 .pos-v173-empty small{font-size:14px}
.pos-v174 .pos-v173-result{padding:14px 16px}.pos-v174 .pos-v173-result strong{font-size:16px}.pos-v174 .pos-v173-result small{font-size:13px}.pos-v174 .pos-v173-result>b{font-size:15px}
.pos-v174 .pos-customer-results button{font-size:15px;min-height:40px}
/* Purchase return: Kiot-like search, ledger-backed source allocation */
.return-entry{margin:-10px -8px 0;background:#edf1f5;min-height:calc(100vh - 190px);color:#20324b;font-size:15px}
.return-bar{display:flex;align-items:center;gap:14px;background:#fff;min-height:74px;padding:12px 16px;border-bottom:1px solid #d9e3ef;position:relative;z-index:11}
.return-back{font-size:27px;text-decoration:none;color:#34475d}.return-bar h1{font-size:24px;margin:0;white-space:nowrap}.return-search{position:relative;flex:1;max-width:640px}.return-search input{width:100%;height:48px;border:1px solid #8dbff5;border-radius:9px;padding:10px 15px;font-size:16px}.return-search input:disabled{background:#f3f6f8;cursor:not-allowed}.return-list{margin-left:auto;font-size:14px}
.return-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(350px,32%);gap:12px;padding:12px;align-items:start}
.return-cart{background:#fff;min-height:680px;border:1px solid #dce5ef;border-radius:12px;overflow:hidden}
.return-table-head,.return-line{display:grid;grid-template-columns:37px minmax(170px,1fr) 60px 85px 110px 120px 120px 28px;align-items:center;gap:8px;padding:14px 12px}
.return-table-head{background:#e4f1ff;color:#34516b;font-size:13px;font-weight:800;border-bottom:1px solid #d3e4f5}
.return-line{border-bottom:1px solid #e6edf5;min-height:92px}.return-line-name{min-width:0;display:flex;flex-direction:column;gap:6px}.return-line-name strong{font-size:15px;line-height:1.45}.return-line-name small{color:#7b8ca0;font-size:12px}
.return-line input{width:100%;min-height:40px;border:0;border-bottom:1px solid #d6e2ee;font-size:15px;text-align:right;padding:5px}.return-line .return-line-total{font-size:15px;text-align:right}.return-remove{border:0;background:#fff0f2;color:#bc4356;border-radius:6px;min-height:34px;font-size:21px;cursor:pointer}
.return-empty{display:flex;align-items:center;flex-direction:column;justify-content:center;min-height:580px;text-align:center;padding:30px;color:#788ba2}.return-empty[hidden]{display:none}.return-empty-icon{font-size:58px;color:#89bdf1}.return-empty h2{font-size:22px;color:#536a83;margin:4px 0}.return-empty p{font-size:15px;line-height:1.7}
.return-checkout{position:sticky;top:10px;background:#fff;padding:23px;border:1px solid #dce5ef;border-radius:13px;min-height:680px;display:flex;flex-direction:column;gap:14px;box-shadow:0 2px 12px #1b3d5b0a}
.return-checkout-head{display:flex;align-items:center;justify-content:space-between;font-size:15px;border-bottom:1px solid #e9eef4;padding-bottom:11px}.return-checkout-head span{font-size:13px;color:#8292a5}
.return-field{display:flex;flex-direction:column;gap:7px}.return-field>label{font-size:14px;font-weight:750}.return-field label b{color:#d9485c}.return-field input,.return-field textarea,.return-field select{width:100%;min-height:43px;padding:9px 11px;border:1px solid #d5dfeb;border-radius:8px;font-size:15px}.return-field textarea{resize:vertical}.return-field small{font-size:12px;color:#7f8fa2}.return-readonly{background:#f4f6fa;border-radius:7px;padding:11px;color:#7a8ca2}
.return-autocomplete{position:relative}.return-autocomplete input{width:100%;height:45px}.return-options{position:absolute;top:calc(100% + 4px);left:0;right:0;background:#fff;border:1px solid #cdddeb;border-radius:10px;z-index:100;box-shadow:0 13px 30px #132c4633;max-height:320px;overflow:auto}.return-options[hidden]{display:none}.return-result{display:flex;flex-direction:column;gap:3px;width:100%;text-align:left;background:#fff;border:0;border-bottom:1px solid #e9edf4;padding:12px 14px;cursor:pointer}.return-result strong{font-size:15px;color:#203850}.return-result small{font-size:13px;color:#8292a4}.return-result.is-active,.return-result:hover{background:#e9f5ff;box-shadow:inset 3px 0 #0878ec}.return-not-found{padding:16px;color:#7f90a4}
.return-metrics{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:12px;font-size:15px;min-height:43px}.return-metrics input{width:42%;text-align:right;font-weight:650;font-size:16px}.return-metrics b{font-size:16px}.return-amount{border-top:1px solid #e5ebf3;border-bottom:1px solid #e5ebf3;padding:12px 0;font-weight:750}.return-amount strong:last-child{font-size:23px;color:#0878ec}
.return-actions{margin-top:auto;position:sticky;bottom:10px}.return-actions .btn{min-height:55px;width:100%;font-size:17px;border-radius:9px;font-weight:800}
@media(max-width:1450px){.pos-v174 .pos-v173-line{grid-template-columns:22px 28px minmax(125px,1fr) 67px 90px 100px 30px 83px;gap:6px;padding:12px 8px}.pos-v174 .pos-v173-history{font-size:12px}.pos-v174 .pos-sales-grid{grid-template-columns:minmax(0,1fr) 390px}.return-table-head,.return-line{grid-template-columns:30px minmax(145px,1fr) 42px 70px 86px 96px 95px 26px;gap:6px;padding:12px 8px}}
@media(max-width:1120px){.pos-v174 .pos-sales-grid{grid-template-columns:minmax(0,1fr) 340px}.pos-v174 .pos-v173-line{grid-template-columns:22px 25px minmax(100px,1fr) 65px 85px 90px 30px;gap:5px}.pos-v174 .pos-v173-history{grid-column:3/8;justify-self:start}.pos-v174-line-note{grid-column:3/-1}.return-layout{grid-template-columns:1fr}.return-checkout{position:static;min-height:auto}.return-cart{min-height:360px}.return-empty{min-height:350px}}
@media(max-width:790px){.pos-v174 .pos-toolbar{flex-wrap:wrap;height:auto}.pos-v174 .pos-search-wrap{width:100%;max-width:none}.pos-v174 .pos-invoice-tabs{max-width:75%}.pos-v174 .pos-sales-grid{grid-template-columns:1fr}.pos-v174 .pos-sales-center{min-height:330px}.pos-v174 .pos-v173-checkout{min-height:560px}.pos-v174 .pos-v173-line{grid-template-columns:20px 25px minmax(110px,1fr) 58px 77px 76px 25px}.pos-v174 .pos-v173-line-name strong{font-size:14px!important}.pos-v174 .pos-v173-line input.pos-unit-price{font-size:14px!important}.pos-v174 .pos-v173-line .pos-line-total{font-size:13px}.return-bar{flex-wrap:wrap}.return-bar h1{font-size:20px}.return-search{min-width:100%;order:3}.return-list{font-size:12px}.return-cart{overflow:auto}.return-table-head,.return-line{min-width:850px}.price-editor-body{padding:14px}.product-expanded-panel{padding:14px}.price-editor-form{grid-template-columns:repeat(auto-fit,minmax(160px,1fr))}}
@media(prefers-reduced-motion:no-preference){.return-result,.purchase-hints button,.pos-v174 .pos-v173-line,.price-editor-form label{transition:background-color .12s ease,border-color .12s ease,box-shadow .12s ease}}
/* Final visual refinements after 1440px screenshot inspection. */
.price-editor-body{box-sizing:border-box;max-width:940px;width:100%;min-width:0;overflow:hidden}
.product-expanded-actions .inline-price-edit .price-editor-form{grid-template-columns:repeat(3,minmax(0,1fr))}
.price-editor-form label{min-width:0}.price-editor-form label input{min-width:0}
.return-actions{position:static;bottom:auto;margin-top:22px;padding-top:16px;border-top:1px solid #e4ebf3}
.return-checkout{gap:16px}
@media(max-width:1100px){.product-expanded-actions .inline-price-edit .price-editor-form{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:650px){.product-expanded-actions .inline-price-edit .price-editor-form{grid-template-columns:1fr}}

/* 1.7.5 desktop readability, information hierarchy, and restoration UX */
@media (min-width:1024px){
 body{font-size:16px;line-height:1.53}
 .app-header,.main-nav{font-size:15px}
 .nav-item,.nav-dropdown>summary{font-size:15px!important}
 .page-heading h1,.master-title h1{font-size:27px!important;line-height:1.3}
 .panel h2,.master-data-heading h2{font-size:20px!important}
 .panel p,.page-heading p,.master-title p{font-size:15px!important}
 .table-wrap table,.master-table{font-size:15px!important}
 .table-wrap th,.table-wrap td{padding:13px 12px!important}
 input:not([type=checkbox]):not([type=radio]),select,textarea{font-size:16px!important;min-height:43px}
 .btn,button{font-size:15px}
 .pos-line,.return-line{font-size:16px!important}
 .pos-v173-line-name strong,.return-line-name strong{font-size:16px!important}
 .pos-line-total,.return-line-total,.return-amount strong{font-size:18px!important}
 .pos-checkout strong,#grand-total{font-variant-numeric:tabular-nums}
}
.stock-overview{margin-top:16px;margin-bottom:18px;padding:18px 22px}
.stock-overview .stock-summary{margin-bottom:12px}
.purchase-view-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px;padding:18px 20px}
.purchase-view-grid>div{display:flex;flex-direction:column;gap:8px;background:#f5f9ff;border:1px solid #dce8fa;border-radius:12px;padding:18px}
.purchase-view-grid small{color:#64748b;font-size:14px}
.purchase-view-grid strong{font-size:19px;color:#0f2745}
.restore-panel{margin-top:1rem;border:1px solid #bdddfb!important}
.restore-warning{max-width:900px;margin:0 auto;border:1px solid #f0b4b4!important}
.restore-warning>h2{color:#b42318}
.restore-stats{display:flex;flex-wrap:wrap;gap:12px;margin:20px 0}
.restore-stats span{display:flex;flex-direction:column;background:#f2f6ff;border-radius:10px;min-width:130px;padding:13px 16px}
.restore-stats b{font-size:22px;color:#0556b0}
.kv-lookup{display:block;position:relative;min-width:190px;width:100%}
.kv-lookup .kv-lookup-source{display:none!important}
.kv-lookup-input{width:100%;height:43px;background:#fff;border:1px solid #bccde2;border-radius:9px;padding:9px 14px;font-size:15px}
.kv-lookup-input:focus{border-color:#1683ef;box-shadow:0 0 0 3px #1683ef20;outline:0}
.kv-lookup-options{position:absolute;top:calc(100% + 4px);left:0;right:0;max-height:280px;overflow-y:auto;background:#fff;box-shadow:0 12px 32px #09284f25;border:1px solid #bbcee5;border-radius:10px;z-index:1200;padding:5px}
.kv-lookup-options[hidden]{display:none!important}
.kv-lookup-options button{border:0;display:block;width:100%;text-align:left;white-space:normal;background:#fff;color:#173754;padding:11px 13px;border-radius:7px;font-size:15px;cursor:pointer}
.kv-lookup-options button:hover,.kv-lookup-options button.is-active{background:#e6f2ff;color:#085eb4}
.kv-lookup-empty{display:block;padding:12px;color:#697f99}
/* Monetary inputs have a consistent, readable, right-aligned VND display. */
input[data-kv-money="1"]{text-align:right;font-variant-numeric:tabular-nums;font-weight:600;font-size:16px!important;letter-spacing:.01em}
@media (max-width:850px){.purchase-view-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.kv-lookup{min-width:130px}}
@media (max-width:500px){.purchase-view-grid{grid-template-columns:1fr}.restore-stats span{min-width:100px}}

.kv-master-lookup{display:flex;position:relative;min-width:0;flex:1}
.kv-master-lookup>input{flex:1;min-width:0;width:100%}
.kv-master-lookup .kv-lookup-options{min-width:260px;text-align:left}
