:root{font-family:Arial,sans-serif;color:#1e3046;background:#eef2f6;font-size:16px}*{box-sizing:border-box}body{margin:0}header{background:#1e3046;color:white;padding:25px 20px;display:flex;align-items:center;justify-content:space-between}header small{font-size:11px;letter-spacing:2px;color:#becbdb}h1{font-size:27px;margin:8px 0 0}h2{font-size:18px;margin:0}main{max-width:760px;margin:0 auto;padding:16px}.card{background:white;border-radius:18px;padding:18px;margin-bottom:14px;box-shadow:0 3px 15px #20304008}label{display:block;font-size:12px;font-weight:600;color:#536477;margin:0 0 12px}input,textarea{width:100%;font:inherit;font-size:16px;color:#1e3046;background:#f8fafc;border:1px solid #d9e1e9;border-radius:10px;padding:12px;margin-top:6px}textarea{min-height:72px}.row{display:flex;gap:12px}.row>*{flex:1;min-width:0}button{font:inherit;font-weight:600;border:0;border-radius:10px;padding:13px 16px;background:#dc663b;color:white;cursor:pointer}.ghost{background:#e5ebf1;color:#24394f}header .ghost{background:#344c66;color:white}.scan{width:100%;background:#24394f;padding:18px;font-size:17px}.search{display:flex;gap:8px;margin-top:16px}.search input{margin:0;min-width:0}.muted{font-size:12px;line-height:1.6;color:#6b7b8e}.sectionhead{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.sectionhead span{font-size:12px;color:#6b7b8e}.product,.line{padding:14px 0;border-top:1px solid #e8edf2}.product{display:block;width:100%;background:white;text-align:left;color:#24394f;border-radius:0}.product strong,.product small{display:block}.product small{font-weight:400;margin-top:6px;color:#63788b}.linehead{display:flex;gap:10px;justify-content:space-between;font-size:14px;line-height:1.5}.line strong{font-size:14px}.line .detail{font-size:12px;color:#62768c;margin-top:5px}.linebuttons{display:flex;gap:8px;margin-top:10px}.linebuttons button{font-size:12px;padding:7px 12px;background:#eaf0f6;color:#2b425b}.totals>div{display:flex;justify-content:space-between;padding:8px 0;font-size:14px}.totals .grand{font-size:19px;border-top:1px solid #dae3ec;margin-top:6px;padding-top:18px}.grand b{color:#bd5028}.actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}dialog{border:0;border-radius:20px;padding:22px;max-width:500px;width:calc(100% - 28px);max-height:90vh;overflow:auto;color:#24394f}dialog::backdrop{background:#152334aa}dialog h2{margin-bottom:12px}.error{font-size:13px;color:#b52727}#toast{position:fixed;bottom:20px;left:16px;right:16px;border-radius:12px;background:#24394f;color:white;padding:14px;display:none;z-index:100}#savedList button{margin:6px 0;width:100%;text-align:left;background:#edf2f7;color:#24394f}@media print{body{background:white;font-size:11pt}header{background:white;color:#1e3046;padding:0 18px}header small{color:#536477}.no-print,header button,.linebuttons{display:none!important}main{padding:0;max-width:none}.card{box-shadow:none;border-radius:0;border-bottom:1px solid #ddd;margin:0;padding:12px 18px;break-inside:avoid}input,textarea{border:0;background:white;padding:2px;margin:0}label{margin:3px 0}.line{break-inside:avoid}.meta{display:grid;grid-template-columns:1fr 1fr;gap:10px}.totals{max-width:320px;margin-left:auto}}

.discount-total{color:#a54624;background:#fff3eb;padding:10px 8px!important;border-radius:8px}.live-summary{background:#f7f9fc;border-radius:12px;padding:10px;margin:12px 0}

.tools{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:10px}.tools button{flex:1}select{width:100%;font:inherit;background:#f8fafc;color:#24394f;border:1px solid #d9e1e9;border-radius:10px;padding:12px;margin:6px 0 12px}#customerList{max-height:45vh;overflow:auto}#savedList{max-height:50vh;overflow:auto}#orderControls[hidden]{display:none}.meta textarea{min-height:48px}
.product-result{display:flex;align-items:center;gap:12px}.product-copy{min-width:0;overflow-wrap:anywhere}.product-photo{display:flex;align-items:center;justify-content:center;width:76px;height:76px;flex:0 0 76px;border:1px solid #e8edf2;border-radius:10px;background:#fafbfc;overflow:hidden}.product-photo img{width:100%;height:100%;object-fit:contain;background:white}.photo-placeholder{font-size:11px;color:#718096;text-align:center;font-weight:400}.product-photo.large{width:100%;height:160px;margin:12px 0}.product-photo.large img{max-width:100%;max-height:160px}

.visual-search{margin-top:16px;padding:12px;border:1px solid #d9e1e9;border-radius:10px}.visual-search summary{cursor:pointer;font-weight:600}#visualPreview{width:100%;height:140px;object-fit:contain;margin-top:12px}#visualPreview[hidden],#visualFile[hidden]{display:none}

#photoCandidate{width:100%;height:180px;object-fit:contain;margin:12px 0}#photoControls[hidden],#photoCandidate[hidden],#productPhotoFile[hidden]{display:none}button:disabled{opacity:.5;cursor:default}header{gap:10px;flex-wrap:wrap}

.totals>div[hidden],label[hidden]{display:none}.line>.product-photo{float:left;margin-right:12px}.line:after{content:"";display:block;clear:both}.linehead{padding-top:4px}.linebuttons{justify-content:flex-end}#receiptDialog{max-width:850px;width:calc(100% - 20px);padding:14px;background:#edf2f6}#receiptPages img{display:block;width:100%;height:auto;margin:14px 0;background:white}.receipt-tools{position:sticky;top:-14px;background:#edf2f6;padding:12px 0}.receipt-tools button{margin-bottom:6px}#receiptPrintArea{display:none}@media print{body>*{display:none!important}#receiptPrintArea{display:block!important}#receiptPrintArea img{display:block;width:100%;height:auto;break-after:page}#receiptPrintArea img:last-child{break-after:auto}@page{size:A4;margin:0}}

.saved-record{border-bottom:1px solid #dae3ec;padding:12px 0}.saved-record strong{display:block}#savedList .danger{background:#fce8e6;color:#ad2424}button:disabled{opacity:.55;cursor:wait}#receiptStatus{position:sticky;top:0;background:#edf2f6;padding:8px}

#assistantDialog{width:calc(100% - 24px);max-width:680px;box-sizing:border-box}#assistantMessages{max-height:38vh;overflow:auto}.assistant-message{white-space:pre-wrap;overflow-wrap:anywhere;padding:12px;border-radius:12px;background:#edf3f7}.assistant-message.question{background:#dcebe7}.assistant-message.status{background:#fff1d9}#assistantDialog .tools{margin-top:12px}
