:root{font-family:system-ui,"Nirmala UI",sans-serif;color:#172334;background:#f0f4f6;--primary:#08665d;--edge:#d5e0df}*{box-sizing:border-box}[hidden]{display:none!important}body{margin:0}header{background:#123331;color:#fff;padding:20px max(16px,calc((100vw - 1080px)/2));display:flex;justify-content:space-between;gap:12px;align-items:center}header h1{margin:2px 0;font-size:clamp(18px,4vw,28px)}header small{color:#c6eae0}header select{width:auto}main{max-width:1112px;margin:auto;padding:16px}nav,.actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:0 0 12px}.actions{margin:14px 0 0}nav button:not([aria-current=true]){background:#e0ece9;color:#174b44}section,dialog{background:white;padding:clamp(12px,3vw,24px);border:1px solid var(--edge);border-radius:12px}section h2{margin:0 0 10px}form{margin:0 0 10px}label{display:grid;gap:4px;font-weight:600;margin:0 0 9px}input,select,button,.button{font:inherit;border-radius:7px;min-height:40px;padding:7px 10px}input,select{width:100%;border:1px solid #aabdb9;background:white;color:#182522}button,.button{display:inline-block;text-decoration:none;border:0;background:var(--primary);color:white;font-weight:650;cursor:pointer}button:disabled{opacity:.55}.secondary{background:#e0ece9;color:#174b44}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:0 12px}.scroller{overflow:auto;margin:9px 0}table{border-collapse:collapse;width:100%;text-align:start}th,td{text-align:start;padding:8px;border-bottom:1px solid var(--edge)}th{background:#eef5f3}td button{min-height:32px}.stats{display:flex;gap:8px;flex-wrap:wrap;padding:8px 0}.stats div{background:#eef5f3;border-radius:7px;padding:8px 12px}#message{margin-bottom:10px;padding:10px;background:#e2f2e9;border-left:4px solid #08665d}#message.error{background:#fff0e8;border-color:#ad3c19}dialog{width:min(650px,95vw);max-height:90vh}dialog::backdrop{background:#10251e8c}#receiptStatus{color:#a13924}#paper h2{margin-top:0}@media(max-width:530px){main{padding:10px}th,td{padding:5px}#cart td:first-child{min-width:120px}#cart input{min-width:56px}}@media print{body{background:white}body.printing header,body.printing #workspace,body.printing #message,body.printing #signin,body.printing #paymentForm,body.printing .dialog-actions{display:none!important}dialog[open]{position:static;max-height:none;max-width:none;width:100%;margin:0;padding:0;border:0;overflow:visible}dialog::backdrop{display:none}}

:root{--primary:#40348a;--edge:#e0e2ed;background:#f4f5fa;color:#1d2540}
header{background:#24214d;border-bottom:3px solid #e3b86b}
header small{color:#eee1bf}
nav{gap:6px;margin:4px 0 16px;background:#e9e9f4;border-radius:11px;padding:5px;width:fit-content;max-width:100%}
nav button:not([aria-current=true]){background:transparent;color:#3a3656}
nav button[aria-current=true]{box-shadow:0 2px 5px #29205a30}
.secondary{background:#efedf9;color:#383078}
input,select{border-color:#c8cbdd}
:focus-visible{outline:2px solid #6856bb;outline-offset:2px}
th{background:#f1f1f9}
#sale{padding:0;background:transparent;border:0}
.checkout{display:grid;grid-template-columns:minmax(0,1fr) minmax(255px,310px);gap:16px;align-items:start}
.checkout-main,.checkout-summary{border:1px solid var(--edge);border-radius:14px;background:#fff;padding:clamp(14px,2.3vw,24px);min-width:0;box-shadow:0 3px 10px #22254c08}
.checkout-main h2,.checkout-summary h2{margin-bottom:16px}
.checkout-summary{background:#faf9ff}
.section-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:16px 0 8px}
.section-head h3{font-size:16px;margin:0}
.empty-stock{border:1px dashed #c8c3dc;border-radius:10px;text-align:center;padding:16px;color:#484560}
.bill-amount,.due-amount{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border-radius:8px;margin:0 0 12px}
.bill-amount{background:#eae6fb;color:#342875}
.bill-amount strong{font-size:22px;overflow-wrap:anywhere}
.due-amount{background:#fff0d9;color:#69420d;margin-top:12px}
.text-action{background:transparent;color:#40348a;padding:0;text-decoration:underline;min-height:28px;margin:-5px 0 8px}
.save-sale{width:100%}
#cart td:nth-child(2){width:100px}
@media(max-width:760px){.checkout{grid-template-columns:1fr}}

body{min-height:100vh;background:linear-gradient(135deg,#f2f4ff,#fdf7ef 75%)}
header{padding:16px clamp(12px,3vw,44px);background:linear-gradient(110deg,#271b58,#433481 60%,#365278);position:relative}
main{max-width:none;width:100%;padding:clamp(12px,2.3vw,36px)}
.brand,.header-actions{display:flex;align-items:center;gap:12px}
.brand-mark{font-size:25px;font-weight:800;color:#34214e;background:#ffd992;border-radius:12px;padding:7px 14px}
.header-actions button{background:#fff2dc;color:#3b254f;white-space:nowrap}
.launcher{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));width:100%;gap:10px;background:none;padding:0}
.launch{--tile:#4c3c99;--pale:#eee9ff;display:flex;align-items:stretch;background:var(--pale);border-radius:11px;border:1px solid #0001;overflow:hidden;min-height:60px}
.stock-launch{--tile:#09735f;--pale:#def5eb}
.customer-launch{--tile:#9a3d6c;--pale:#fbe6f2}
.report-launch{--tile:#155ea0;--pale:#e2f2ff}
.settings-launch{--tile:#805016;--pale:#fff1da}
.launch button{display:flex;flex:1;align-items:center;gap:9px;width:100%;text-align:start;border-radius:0;padding:8px 12px;background:var(--pale);color:var(--tile)}
.launch button:not([aria-current=true]){background:var(--pale);color:var(--tile)}
.launch button[aria-current=true]{background:var(--tile);color:#fff;box-shadow:none}
.launch button span{font-size:24px;line-height:1}
.launch a{display:grid;place-items:center;width:36px;flex:none;color:var(--tile);font-size:22px;text-decoration:none;border-inline-start:1px solid #0001}
.launch a:hover,.launch a:focus-visible{background:#fff}
.checkout{grid-template-columns:minmax(0,1fr) minmax(275px,26%);gap:18px;min-height:calc(100vh - 210px);align-items:stretch}
.checkout-main,.checkout-summary{box-shadow:0 5px 18px #3421600c}
.checkout-summary{align-self:start;background:linear-gradient(165deg,#fff,#f6edff)}
#customers,#stock,#settings,#reports{min-height:calc(100vh - 210px)}
#settings form{max-width:720px}
textarea{width:100%;font:inherit;border:1px solid #c8cbdd;border-radius:7px;padding:8px 10px;resize:vertical}
.receipt-address{white-space:pre-line;overflow-wrap:anywhere}
@media(max-width:860px){.launcher{grid-template-columns:repeat(3,minmax(0,1fr))}.checkout{min-height:auto}}
@media(max-width:700px){.checkout{grid-template-columns:1fr}.header-actions{flex-wrap:wrap;justify-content:flex-end}.brand-mark{display:none}}
@media(max-width:490px){.launcher{grid-template-columns:repeat(2,minmax(0,1fr))}.launch{min-height:45px}.launch button{padding:6px}.launch button span{font-size:18px}.launch a{width:31px}}
@media print{body{background:white}}

:root{--primary:#321c49;--edge:#e3d9ec;color:#291c3b;background:#f5f0fb}
body{background:#f5f0fb}
header{background:#2e1a44;border-bottom:1px solid #684f7a}
.brand-mark{background:#f4c670;color:#361f4e}
.connection{font-size:13px;font-weight:700;border:1px solid #8f799d;border-radius:20px;padding:4px 9px;white-space:nowrap;color:#fff}
.connection:before{content:"";display:inline-block;background:#52cc95;width:8px;height:8px;border-radius:50%;margin-right:6px}
.connection.disconnected:before{background:#f4bd62}
main{padding:16px clamp(12px,2vw,30px)}
#signin{margin:48px auto;width:min(460px,100%);background:#fff}
#signin details{margin-top:20px;border-top:1px solid var(--edge);padding-top:14px}
#signin details form{margin-top:12px}
#workspace{display:grid;grid-template-columns:215px minmax(0,1fr);gap:16px;min-height:calc(100vh - 113px)}
#workspace .launcher{grid-column:1;grid-row:1;display:flex;flex-direction:column;background:#321c49;margin:0;padding:12px;border-radius:12px;min-height:100%;gap:7px}
#workspace .tab{grid-column:2;grid-row:1}
#workspace .launch{background:transparent;border:0;min-height:46px}
#workspace .launch button{background:transparent;color:#fff}
#workspace .launch button[aria-current=true]{background:#f4c670;color:#2e1a44}
#workspace .launch a{color:#e3d1f3}
#workspace .launch a:hover{background:#5b4372}
#workspace .checkout{grid-template-columns:minmax(0,1fr) minmax(240px,29%);min-height:auto}
#workspace .checkout-main,#workspace .checkout-summary{background:#fff}
#workspace th{background:#eee4f7}
.bill-amount,.due-amount{background:#f2eafa;color:#321c49}
.due-amount{background:#fff0d3;color:#634019}
#noticePanel{overflow:hidden;margin-bottom:14px;border:1px solid #e3cb9b;background:#fff5df;padding:12px 16px}
.notice-top{display:flex;align-items:center;justify-content:space-between;gap:10px;color:#694510}
.notice-top button{min-height:30px;padding:0 12px}
#noticeSlide{overflow-wrap:anywhere;padding-top:7px}
#noticeSlide p,.shop-card p{white-space:pre-wrap;margin:4px 0}
#lockPanel{margin-top:14px;max-width:780px;border-inline-start:5px solid #d39b48}
.admin-grid{display:grid;grid-template-columns:1.1fr 1fr;gap:18px}
.shop-card{border:1px solid var(--edge);border-radius:11px;background:#fbf8ff;padding:12px;margin:0 0 8px;overflow-wrap:anywhere}
.shop-card h4{margin:0 0 5px}.shop-card form{margin-top:10px}.shop-card input{max-width:140px}.shop-card .actions{margin-top:4px}
.status-active{color:#08724b}.status-pending,.status-paused,.status-expired{color:#8d4215}
#paper{padding:0 0 8px}#paper h2{color:#321c49;border-bottom:2px solid #d9b36d;padding-bottom:6px}
#paper th{background:#ede2f5}
@media(max-width:850px){#workspace{grid-template-columns:160px minmax(0,1fr)}#workspace .checkout{grid-template-columns:1fr}}
@media(max-width:680px){
  header{padding:10px 12px}.brand h1{font-size:15px}.header-actions{gap:5px}#fullscreen{display:none}
  #workspace{display:block;padding-bottom:64px}
  #workspace .launcher{position:fixed;z-index:3;bottom:0;left:0;right:0;flex-direction:row;padding:5px 3px;margin:0;min-height:auto;border-radius:0;gap:2px}
  #workspace .launch{flex:1;min-width:0}
  #workspace .launch button{font-size:10px;min-height:42px;flex-direction:column;gap:3px;padding:3px}
  #workspace .launch button span{font-size:16px}#workspace .launch a{display:none}
  .admin-grid{grid-template-columns:1fr}
  #cartTable thead{display:none}#cart,#cartTable table{display:block}
  #cart tr{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:6px;margin:6px 0;border:1px solid var(--edge);border-radius:8px;padding:6px}
  #cart td{border:0;padding:0;align-self:center}
  #cart td:first-child{grid-column:1/-1}
  #cart td:nth-child(2){width:76px}#cart td:nth-child(3){text-align:right}
}
@media print{body.printing #noticePanel,body.printing #adminPanel,body.printing #lockPanel{display:none!important}body.printing main{padding:0}body{background:#fff}}
.receipt-totals>div{display:flex;justify-content:space-between;padding:5px 10px;gap:12px}
.receipt-totals .due-amount{padding:10px}

#receipt{max-width:810px;width:min(810px,96vw)}
.logo-settings{display:flex;align-items:end;gap:10px;flex-wrap:wrap;margin:12px 0}
#logoPreview{border:1px solid #c2c2c2;object-fit:contain;background:#fff}
.invoice{color:#151515;background:#fff;border:1px solid #999;font-size:14px;overflow-wrap:anywhere}
.invoice .invoice-value,.invoice-items tbody td{color:#17459a}
.invoice-brand{display:flex;gap:15px;align-items:start;background:#e5eefb;color:#151515;border-top:5px solid #15376e;border-bottom:2px solid #151515;padding:18px 20px}
#paper .invoice-brand h2{color:#123b82;border:0;margin:0 0 5px;padding:0}
.invoice-logo{flex:0 0 64px;height:64px;background:#fff;border-radius:8px;display:grid;place-items:center}
.invoice-logo img{object-fit:contain;padding:3px}
.receipt-phone-icon{width:19px;height:30px;border:2px solid #123b82;border-radius:5px;position:relative}
.receipt-phone-icon:after{content:"";position:absolute;bottom:2px;left:6px;width:3px;height:3px;border-radius:50%;background:#123b82}
.invoice-heading{display:flex;justify-content:space-between;gap:10px;align-items:baseline;padding:18px 20px 0}
.invoice-heading h3{font-size:23px;margin:0;color:#151515}
.invoice-number{margin:2px 20px 13px}
.invoice-customer{display:grid;grid-template-columns:1fr 1fr;gap:10px;background:#f1f1f1;margin:0 20px 16px;padding:10px}
.invoice-customer strong,.invoice-customer span{display:block}
.invoice-items{width:calc(100% - 40px);margin:0 20px}
#paper .invoice-items th{background:#e9e9e9;color:#151515}
.invoice-items th,.invoice-items td{border-bottom:1px solid #b9b9b9;padding:6px}
.invoice-items :is(th,td):nth-child(n+2){text-align:right}
.invoice-items tbody tr:nth-child(odd){background:#f8f8f8}
.invoice-settlement{display:grid;grid-template-columns:1fr 1.1fr;gap:10px;margin:14px 20px}
.invoice .receipt-sum,.invoice .receipt-due{background:#eaeaea;font-weight:700}
.invoice .receipt-due{margin-top:8px}
.invoice-signatures{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;align-items:end;margin:16px 20px 12px;text-align:center;break-inside:avoid}
.invoice-signatures>div{border-top:1px solid #555;padding-top:4px}
.invoice-signatures .invoice-stamp{height:55px;border:1px dashed #777;display:grid;align-items:end}
.invoice-thanks{border-top:1px solid #aaa;margin:0 20px;padding:8px 0;text-align:center;font-weight:600}
@media(max-width:450px){
 .invoice-brand{padding:12px;gap:9px}.invoice-logo{width:45px;height:45px;flex-basis:45px}.invoice-logo img{width:45px;height:45px}
 .invoice-items{width:calc(100% - 16px);margin:0 8px}.invoice-items th,.invoice-items td{padding:4px;font-size:11px}
 .invoice-settlement{grid-template-columns:1fr;margin:10px}.invoice-signatures{margin:8px;gap:5px;font-size:10px}
}
@page{size:A4;margin:11mm}
@media print{
 #receipt[open]{max-width:none;width:100%;font-size:11pt}
 .invoice{print-color-adjust:exact;-webkit-print-color-adjust:exact}
 .invoice-items thead{display:table-header-group}
 .invoice-items tr,.invoice-settlement,.invoice-thanks{break-inside:avoid}
}
.line-imei{margin-top:5px}
.stock-toggle{display:flex;align-items:center;gap:8px;margin:10px 0}
.stock-toggle input{width:18px;min-height:18px}
#scannerVideo{display:block;width:100%;max-height:60vh;background:#151515}
#scannerStatus{margin:8px 0}
.invoice-imei{font-size:.83em;overflow-wrap:anywhere}
.invoice-imei span{color:#151515}
.invoice-note{margin:10px 20px;border:1px solid #aaa;padding:8px;break-inside:avoid}
.invoice-note p{white-space:pre-wrap;margin:3px 0 0}
.scan-card{border:1px solid #b3a4cb;background:#f6f2fc;border-radius:10px;margin:8px 0;padding:12px}
.scan-card p{margin:4px 0 10px}
.line-price{margin-top:5px}
@media(max-width:680px){
 header{padding-top:max(10px,env(safe-area-inset-top));flex-wrap:wrap}
 .header-actions{justify-content:flex-start;flex-wrap:wrap}
 .header-actions button,.header-actions select{min-height:40px}
 main{padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right))}
 #workspace{padding-bottom:calc(68px + env(safe-area-inset-bottom))}
 #workspace .launcher{padding-bottom:calc(5px + env(safe-area-inset-bottom))}
 #workspace .launch button{min-height:46px}
 input,select,textarea{font-size:16px}
 .scan-card .actions button{min-height:44px}
}
