*{box-sizing:border-box}body{margin:0;background:#f2f5f3;color:#20352d;font:16px system-ui,sans-serif}header{background:#153b2d;color:#fff;padding:22px max(20px,calc((100% - 1200px)/2));display:flex;justify-content:space-between;align-items:center;gap:15px}header b{font-size:25px;letter-spacing:1px}header small{display:block;color:#c5ded0}main{max-width:1200px;margin:24px auto;padding:0 16px}nav,.tabs{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:20px}nav a,.tabs a{padding:12px 17px;border-radius:8px;background:white;color:#153b2d;text-decoration:none;font-weight:650;border:1px solid #d4e0d8}.selected{background:#176b46!important;color:white!important}section{background:white;padding:24px;border:1px solid #dde6df;border-radius:14px;box-shadow:0 3px 15px #183c2608;margin-bottom:20px}h1{font-size:25px;margin:0 0 20px}h2{font-size:20px}label{display:block;margin:12px 0;font-weight:600}input,select,textarea{font:inherit;padding:12px;border:1px solid #c7d4cc;border-radius:7px;background:#fff;color:#20352d;width:100%;margin-top:5px}input[type=checkbox]{width:auto}button{background:#176b46;color:#fff;border:0;border-radius:8px;padding:13px 20px;font:inherit;font-weight:700;cursor:pointer}button:hover{background:#105435}.ghost{background:#ffffff20}.danger{background:#a83b39}.inline{display:inline}.scroll{overflow-x:auto}table{border-collapse:collapse;width:100%;margin:14px 0}th,td{text-align:left;padding:12px 10px;border-bottom:1px solid #e1e8e3}th{background:#edf3ef;font-size:13px;color:#456255}td input{margin:0}.price{max-width:140px}.step{display:flex;align-items:center;gap:4px;min-width:150px}.step button{padding:9px 14px;font-size:20px}.step input{width:75px;text-align:center}.total{display:flex;justify-content:space-between;align-items:center;background:#e8f4ec;padding:18px;border-radius:10px;gap:10px}.total strong{font-size:28px}.fields,.metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;align-items:end}.metrics div{padding:18px;background:#f1f6f3;border:1px solid #dce8df;border-radius:9px}.metrics strong{display:block;font-size:22px;margin-top:8px}.login{max-width:420px;margin:60px auto}.login button{width:100%}.err,.ok{padding:15px;border-radius:8px;margin-bottom:15px}.err{background:#fce5e5;color:#922}.ok{background:#e1f3e7;color:#175c36}.muted,footer{color:#65786d;font-size:13px}footer{text-align:center;padding:20px}a{color:#176b46}@media(max-width:600px){section{padding:12px}header{padding:16px}header b{font-size:20px}td,th{padding:8px 5px}.total strong{font-size:21px}}@media print{header,nav,.tabs,button,form,footer{display:none!important}body,section{background:white;border:0}main{max-width:none;margin:0}}

.payment-options{border:0;padding:0;margin:18px 0;min-width:0}.payment-options legend{font-weight:700;margin-bottom:8px}.payment-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.payment-choice{position:relative;margin:0;cursor:pointer}.payment-choice input{position:absolute;opacity:0;width:1px;height:1px;margin:0;padding:0}.payment-choice span{display:flex;align-items:center;justify-content:center;text-align:center;min-height:48px;padding:10px 5px;border:1px solid #c7d4cc;border-radius:8px;background:white;color:#153b2d;font-weight:700}.payment-choice input:checked+span{background:#176b46;color:white;border-color:#176b46}.payment-choice input:focus-visible+span{outline:3px solid #82bca0;outline-offset:2px}@media(max-width:480px){.payment-row{gap:4px}.payment-choice span{font-size:12px;padding:8px 2px}}

/* Compact desktop layout: sales and returns, without changing program logic. */
@media screen and (min-width: 800px) {
 body:has(#sale){font-size:13px}
 body:has(#sale) header{padding:7px max(16px,calc((100% - 1200px)/2));gap:8px}
 body:has(#sale) header b{font-size:19px;letter-spacing:.5px}
 body:has(#sale) header small{font-size:11px}
 body:has(#sale) main{margin:8px auto;padding:0 12px}
 body:has(#sale) nav{gap:5px;margin-bottom:8px}
 body:has(#sale) nav a{padding:6px 12px;border-radius:6px}
 body:has(#sale) section{padding:10px 14px;margin-bottom:5px;border-radius:9px}
 body:has(#sale) h1{font-size:18px;margin:0 0 5px}
 #sale table{margin:4px 0;table-layout:fixed}
 #sale th,#sale td{padding:2px 8px;line-height:1.15;vertical-align:middle}
 #sale th{height:23px;font-size:11px}
 #sale th:nth-child(1){width:35%}#sale th:nth-child(2){width:22%}#sale th:nth-child(3){width:25%}#sale th:nth-child(4){width:18%}
 #sale input.price,#sale input.qty{height:25px;padding:2px 6px;font-size:13px;border-radius:4px;margin:0}
 #sale .price{max-width:150px}#sale .step{min-width:0;gap:4px}
 #sale .step button{padding:0;width:30px;height:25px;font-size:18px;line-height:1;border-radius:4px}
 #sale .step input{width:55px;min-width:0}
 #sale .subtotal{font-weight:650;white-space:nowrap}
 #sale .payment-options{margin:7px 0 4px}
 #sale .payment-options legend{margin-bottom:3px;font-size:12px}
 #sale .payment-row{gap:6px}
 #sale .payment-choice span{min-height:29px;padding:4px;border-radius:5px;font-size:13px}
 #sale > label{margin:5px 0;font-size:12px}
 #sale textarea{display:block;height:32px;min-height:32px;padding:5px 8px;margin-top:3px;resize:vertical;font-size:13px}
 #sale .total{padding:6px 10px;border-radius:6px}
 #sale .total strong{font-size:22px}
 body:has(#sale) button{padding:6px 12px;font-size:13px}
 #sale .step button{padding:0;font-size:18px}
 body:has(#sale) footer{padding:4px;font-size:10px}
 body:has(#sale) .err,body:has(#sale) .ok{padding:7px;margin-bottom:6px;font-size:12px}
}
@media screen and (max-width:799px){#sale .payment-row{grid-template-columns:repeat(2,minmax(0,1fr))}#sale .step{min-width:116px}#sale .step button{padding:6px 9px}#sale .step input{width:48px}#sale table{min-width:480px}}

.cashgrid{display:grid;grid-template-columns:repeat(9,minmax(0,1fr));gap:4px;margin:3px 0 6px}.cashgrid div{background:#edf5ef;border:1px solid #d5e4d9;border-radius:5px;padding:4px 6px;min-width:0}.cashgrid small{display:block;font-size:10px;color:#456255}.cashgrid strong{display:block;font-size:12px;line-height:1.3;color:#153b2d;overflow-wrap:anywhere}@media(max-width:799px){.cashgrid{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(min-width:800px) and (max-height:800px){#sale th,#sale td{padding-top:1px;padding-bottom:1px}#sale input.price,#sale input.qty,#sale .step button{height:23px}body:has(#sale) header{padding-top:4px;padding-bottom:4px}body:has(#sale) footer{padding:0}}
/* V1.8: readable compact sales screen */
@media screen and (min-width:800px){
body:has(#sale){font-size:15px}
body:has(#sale) header b{font-size:21px}
body:has(#sale) header small{font-size:12px}
body:has(#sale) nav a{font-size:14px;padding:5px 10px}
body:has(#sale) h1{font-size:20px}
#sale th{font-size:13px}
#sale td{font-size:15px;line-height:1.15}
#sale input.price,#sale input.qty{font-size:15px;padding:1px 6px}
#sale .payment-choice span{font-size:14px}
#sale .payment-options legend,#sale > label{font-size:14px}
#sale textarea{font-size:14px}
body:has(#sale) button{font-size:14px}
#sale .step button{font-size:19px}
.cashgrid small{font-size:12px;line-height:1.15}
.cashgrid strong{font-size:14px;line-height:1.2}
body:has(#sale) footer{font-size:11px}
}
/* V1.9: wider and more readable desktop sales screen */
@media screen and (min-width:800px){
 body:has(#sale){font-size:17px}
 body:has(#sale) main{max-width:1500px;width:97%;margin:6px auto;padding:0 10px}
 body:has(#sale) header{padding-inline:max(16px,calc((100% - 1460px)/2))}
 body:has(#sale) header b{font-size:24px}
 body:has(#sale) nav a{font-size:15px;padding:5px 11px}
 body:has(#sale) h1{font-size:22px}
 #sale th{font-size:14px}
 #sale td{font-size:17px;line-height:1.1}
 #sale input.price,#sale input.qty{font-size:17px;height:27px}
 #sale .step button{height:27px;width:34px;font-size:21px}
 #sale .payment-choice span{font-size:16px;min-height:30px}
 #sale .payment-options legend,#sale > label,#sale textarea{font-size:15px}
 #sale .total strong{font-size:26px}
 body:has(#sale) button{font-size:15px}
 .cashgrid small{font-size:13px}.cashgrid strong{font-size:17px}
}
@media screen and (min-width:800px) and (max-height:800px){
 #sale input.price,#sale input.qty,#sale .step button{height:25px}
 #sale td{padding-block:1px}
}

#credit-fields[hidden],.debt-row[hidden]{display:none!important}.credit-fields{display:grid;grid-template-columns:2fr 1fr 1fr 1fr;gap:8px;align-items:end;background:#edf5ef;border:1px solid #d5e4d9;border-radius:6px;padding:6px}.credit-fields label{margin:0}.credit-fields strong{display:block;color:#a32b2b;font-size:19px}.collect-form{display:flex;gap:6px;align-items:center;flex-wrap:wrap}.collect-form input[type=number]{width:110px}.collect-form select{width:auto}.collect-form button{white-space:nowrap}@media(max-width:799px){.credit-fields{grid-template-columns:1fr 1fr}}

/* V2.1 – phone and small tablet layout; desktop unchanged */
@media screen and (max-width:799px){
 html,body{width:100%;min-width:0;margin:0}
 body{font-size:14px}
 header{padding:10px 12px;gap:6px;flex-wrap:wrap}
 header>div{min-width:0;overflow-wrap:anywhere}
 header b{font-size:20px}header small{font-size:11px}header button{padding:7px 10px}
 main{width:100%;min-width:0;margin:8px auto;padding:0 8px}
 nav,.tabs{gap:4px;margin-bottom:8px}
 nav a,.tabs a{padding:7px 8px;font-size:12px;flex:1 1 auto;text-align:center;line-height:1.25}
 section{padding:9px;margin-bottom:10px;min-width:0;border-radius:9px}
 h1{font-size:20px;margin:0 0 8px}h2{font-size:17px}
 .fields,.metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
 .fields>* ,.metrics>*{min-width:0;overflow-wrap:anywhere}
 .metrics div{padding:8px}.metrics strong{font-size:17px;margin-top:4px}
 input,select,textarea{min-width:0;max-width:100%;font-size:16px;padding:8px}
 button{padding:9px 12px;font-size:14px}
 .cashgrid{grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;margin:4px 0 9px}
 .cashgrid div{padding:5px 4px}.cashgrid small{font-size:10px;line-height:1.15}.cashgrid strong{font-size:13px;line-height:1.25}
 #sale .scroll{overflow:visible}
 #sale table{display:block;min-width:0;width:100%;margin:0;table-layout:auto}
 #sale thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
 #sale tbody{display:block;width:100%}
 #sale tr.line{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.38fr) minmax(0,1fr);gap:3px 5px;align-items:end;padding:6px 0;border-bottom:1px solid #e1e8e3}
 #sale tr.line td{display:block;min-width:0;padding:0;border:0;font-size:14px;line-height:1.2}
 #sale tr.line td:first-child{grid-column:1/-1;font-size:15px;overflow-wrap:anywhere}
 #sale tr.line td:nth-child(2)::before,#sale tr.line td:nth-child(3)::before,#sale tr.line td:nth-child(4)::before{display:block;font-size:10px;font-weight:600;color:#65786d;margin-bottom:3px}
 #sale tr.line td:nth-child(2)::before{content:'Birim fiyat (TL)'}
 #sale tr.line td:nth-child(3)::before{content:'Adet'}
 #sale tr.line td:nth-child(4)::before{content:'Tutar'}
 #sale input.price,#sale input.qty{width:100%;max-width:none;min-width:0;height:34px;padding:3px 4px;font-size:16px;margin:0;border-radius:5px}
 #sale .step{display:grid;grid-template-columns:30px minmax(0,1fr) 30px;min-width:0;gap:2px}
 #sale .step button{width:30px;height:34px;padding:0;font-size:20px;line-height:1;border-radius:5px;touch-action:manipulation}
 #sale .step input{width:100%;min-width:0;text-align:center;appearance:textfield;-moz-appearance:textfield}
 #sale input::-webkit-inner-spin-button,#sale input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
 #sale .subtotal{text-align:right;font-size:13px;font-weight:700;overflow-wrap:anywhere;padding-bottom:8px!important}
 #sale .payment-options{margin:9px 0 6px}
 #sale .payment-row{grid-template-columns:repeat(4,minmax(0,1fr));gap:3px}
 #sale .payment-choice span{min-height:42px;padding:4px 2px;font-size:11px;overflow-wrap:anywhere}
 #sale .credit-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
 #sale .credit-fields label:first-child{grid-column:1/-1}
 #sale .credit-fields label{min-width:0;font-size:12px}
 #sale .credit-fields strong{font-size:17px}
 #sale>label{margin:7px 0;font-size:13px}#sale textarea{height:44px;min-height:44px;resize:vertical}
 #sale .total{padding:8px;gap:6px;flex-wrap:wrap}#sale .total strong{font-size:23px;overflow-wrap:anywhere}
 #sale .total button{min-height:44px;flex:1 1 auto}
 section>table{display:block;max-width:100%;overflow-x:auto}
 section>.scroll{max-width:100%;overflow-x:auto}
 .collect-form{min-width:130px}.collect-form input[type=number],.collect-form select,.collect-form button{width:100%}
 .login{margin:20px auto}.err,.ok{padding:8px;overflow-wrap:anywhere}footer{padding:8px}
}
@media screen and (max-width:350px){#sale .step{grid-template-columns:26px minmax(0,1fr) 26px}#sale .step button{width:26px}#sale tr.line{gap:3px}#sale .subtotal{font-size:12px}.fields,.metrics{grid-template-columns:1fr}}

/* V2.2: satış öncelikli düzen */
.primary-nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin-bottom:6px}
.primary-nav a{text-align:center;font-weight:700;padding:8px 10px}
.secondary-nav{margin-top:8px;margin-bottom:4px;display:flex;flex-wrap:wrap;gap:5px}
#sale + .cashgrid{margin-top:9px;margin-bottom:0}
@media screen and (max-width:600px){.primary-nav{grid-template-columns:repeat(2,minmax(0,1fr));position:static}.primary-nav a{padding:10px 4px;font-size:15px}.secondary-nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));position:static}.secondary-nav a{text-align:center;white-space:normal;overflow-wrap:anywhere;padding:8px 4px}.secondary-nav a:last-child{margin-bottom:0}}

/* V2.3: yönetici kâr raporu */
.profit-summary th,.profit-summary td{padding:10px 12px;white-space:nowrap}.profit-summary tbody tr:nth-child(even){background:#f4f8f5}.profit-positive{color:#176b46;font-weight:700}.profit-negative{color:#a83b39;font-weight:700}.profit-warning{padding:10px 12px;background:#fff4dd;color:#80510a;border-radius:6px}.profit-summary td:last-child{font-size:1.1em}

/* V2.5: full-width desktop, unchanged mobile sale layout */
@media screen and (min-width:800px){main{max-width:none;width:100%;margin:8px auto;padding:0 18px}header{padding-inline:24px}#sale tr.line td{font-size:17px}#sale input.price,#sale input.qty{font-size:16px}#sale .step button{font-size:19px}.cashgrid strong{font-size:17px}.primary-nav a{font-size:16px}.secondary-nav a{font-size:14px}}
.azime-report{background:#f4f8f5;border:1px solid #c6d9ce;padding:14px;margin:14px 0;border-radius:9px}.azime-metrics{grid-template-columns:repeat(4,minmax(0,1fr))}.azime-metrics strong{font-size:24px}.expense-edit{background:#f2f7f4;border:1px solid #c6d9ce;padding:14px;border-radius:8px;margin:10px 0}.expense-management details{display:inline-block;margin-left:12px}.expense-management summary{cursor:pointer;color:#a83b39;font-weight:bold}.expense-management details[open]{display:block;margin:6px 0}.edit-link{color:#176b46;font-weight:bold}.expense-management td{vertical-align:top}@media(max-width:799px){.azime-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.azime-metrics strong{font-size:18px}}

/* V2.6: full-width desktop; compact reports, mobile layout preserved. */
.report-extra{margin:6px 0;border:1px solid #d6e2da;border-radius:6px;padding:6px 9px}.report-extra summary{cursor:pointer;font-weight:650;color:#176b46}.report-extra[open]{padding-bottom:10px}
@media screen and (min-width:800px){
 body:has(#sale) main,body.reports-page main{max-width:none;width:100%;margin:8px 0;padding:0 16px}
 body:has(#sale) header,body.reports-page header{padding:8px 20px}
 body:has(#sale) #sale td{font-size:clamp(16px,1.05vw,20px)}
 body:has(#sale) #sale .price{max-width:200px}
 body:has(#sale) #sale input.price,body:has(#sale) #sale input.qty{font-size:17px;height:clamp(26px,3.5vh,36px)}
 body:has(#sale) #sale .step button{height:clamp(26px,3.5vh,36px);width:40px}
 body:has(#sale) #sale .step input{width:70px}
 body:has(#sale) .primary-nav a{padding:8px;font-size:17px}
 body:has(#sale) .cashgrid strong{font-size:18px}
 body.reports-page{font-size:13px}
 body.reports-page section.report-page{padding:10px 12px;margin-bottom:6px}
 .report-page h1{font-size:20px;margin:0 0 5px}.report-page h2{font-size:15px;margin:5px 0}.report-page h3{font-size:14px;margin:4px 0}
 .report-top{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(0,1fr);gap:10px;align-items:start}
 .report-top>*{min-width:0}.report-page .azime-report{margin:0;padding:8px}.report-page .azime-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
 .report-page .muted,.report-page p{font-size:11px;margin:4px 0;line-height:1.3}
 .report-page table{margin:4px 0}.report-page th,.report-page td,.report-page .profit-summary th,.report-page .profit-summary td{padding:4px 6px;font-size:12px;line-height:1.2;white-space:normal}
 .report-page .profit-summary td:last-child{font-size:13px}.report-page .metrics{grid-template-columns:repeat(7,minmax(0,1fr));gap:5px;margin:4px 0}.report-page .azime-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
 .report-page .metrics div{padding:6px;min-width:0}.report-page .metrics strong{font-size:15px;margin-top:2px;overflow-wrap:anywhere}.report-page .azime-metrics strong{font-size:18px}.report-page .metrics small{font-size:11px}
 .report-page .tabs{margin:4px 0;gap:4px}.report-page .tabs a{padding:5px 10px}.report-page .fields{grid-template-columns:1fr 1fr auto;gap:6px;align-items:end}.report-page .fields label{margin:0}.report-page input,.report-page button{padding:5px 9px;margin-top:2px;font-size:13px}.report-page .profit-warning{padding:5px 8px;margin:4px 0}
 body.reports-page .primary-nav a,body.reports-page .secondary-nav a{padding:5px 9px;font-size:13px}body.reports-page footer{padding:3px}
}
@media screen and (min-width:800px) and (max-height:800px){body:has(#sale) #sale input.price,body:has(#sale) #sale input.qty,body:has(#sale) #sale .step button{height:26px}.report-page th,.report-page td,.report-page .profit-summary th,.report-page .profit-summary td{padding-block:3px}.report-page .metrics div{padding:4px}.report-page .report-extra{margin:3px 0;padding:3px 6px}}
@media screen and (min-width:800px) and (min-height:900px){body:has(#sale) #sale th,body:has(#sale) #sale td{padding-block:4px}body:has(#sale) #sale .payment-choice span{min-height:38px}body:has(#sale) #sale textarea{height:40px}}
@media print{@page{size:landscape;margin:8mm}.report-page{padding:0!important}.report-page table{margin:3px 0}.report-page th,.report-page td{font-size:9px;padding:3px 4px}.report-top{display:grid;grid-template-columns:1.55fr 1fr;gap:8px}.report-page .azime-report{margin:0;padding:6px}.report-page .metrics{grid-template-columns:repeat(7,minmax(0,1fr));gap:4px}.report-page .azime-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.report-page .metrics div{padding:4px}.report-page .metrics strong{font-size:12px}.report-page h1,.report-page h2{font-size:14px;margin:3px 0}.report-page p,.report-page .muted{font-size:9px;margin:3px 0}.report-extra:not([open]){display:none}.report-page .scroll{overflow:visible}}
.discount-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:4px 0;color:inherit}.discount-row label{display:flex;align-items:center;gap:8px;margin:0}.discount-row input{width:120px;margin:0}.discount-row span{font-size:inherit}#sale-confirm{border:0;border-radius:16px;padding:28px;max-width:calc(100vw - 36px);width:410px;text-align:center;box-shadow:0 14px 60px #0005}#sale-confirm::backdrop{background:#142b25aa}#sale-confirm h2{color:#176b46;font-size:22px}.confirm-amount{font-size:32px;font-weight:800;color:#176b46}#sale-confirm button{width:100%;font-size:18px;padding:12px}@media(max-width:600px){.discount-row{gap:6px;flex-wrap:wrap}.discount-row input{width:95px}.discount-row label{font-size:14px}}

/* V2.8: mobile-only single-row product entry. */
@media screen and (max-width:799px){
 body:has(#sale) header{padding:5px 9px;gap:4px;flex-wrap:nowrap}
 body:has(#sale) header b{font-size:17px;letter-spacing:.2px}
 body:has(#sale) header small{font-size:9px;line-height:1.15}
 body:has(#sale) header button{font-size:12px;padding:5px 7px}
 body:has(#sale) main{padding:0 4px;margin:4px auto}
 body:has(#sale) .primary-nav{margin-bottom:4px;gap:4px}
 body:has(#sale) .primary-nav a{padding:6px 3px;font-size:13px}
 body:has(#sale) section:has(#sale){padding:5px;margin-bottom:5px;border-radius:6px}
 body:has(#sale) section:has(#sale)>h1{font-size:15px;margin:0 0 3px}
 #sale table,#sale tbody{display:block;width:100%;min-width:0}
 #sale thead{position:static;clip-path:none;width:auto;height:auto;overflow:visible;display:block;white-space:normal}
 #sale thead tr,#sale tr.line{display:grid;grid-template-columns:minmax(0,1fr) minmax(56px,19%) minmax(96px,29%) minmax(48px,18%);gap:3px;align-items:center}
 #sale thead th{padding:3px 1px;font-size:10px;line-height:1.1;overflow-wrap:anywhere}
 #sale tr.line{padding:2px 0;min-height:37px}
 #sale tr.line td,#sale tr.line td:first-child{grid-column:auto;font-size:12px;line-height:1.15;padding:0;min-width:0;overflow-wrap:anywhere}
 #sale tr.line td:nth-child(2)::before,#sale tr.line td:nth-child(3)::before,#sale tr.line td:nth-child(4)::before{display:none;content:none}
 #sale input.price,#sale input.qty{height:32px;font-size:16px;padding:1px 2px;border-radius:4px;min-width:0;width:100%}
 #sale .step{grid-template-columns:30px minmax(0,1fr) 30px;gap:2px;min-width:0}
 #sale .step button{width:30px;height:32px;font-size:18px;line-height:1;padding:0}
 #sale tr.line td.subtotal{font-size:11px;text-align:right;white-space:normal;overflow-wrap:anywhere;padding:0!important}
 #sale .payment-options{margin:4px 0}#sale .payment-options legend{font-size:11px;margin-bottom:2px}
 #sale .payment-choice span{min-height:32px;padding:2px;font-size:11px;border-radius:4px}
 #sale>label{margin:3px 0;font-size:11px}#sale textarea{height:30px;min-height:30px;padding:3px 5px;margin-top:2px}
 #sale .discount-row{margin:3px 0;gap:3px;font-size:11px;flex-wrap:nowrap}
 #sale .discount-row label{font-size:11px;gap:3px}#sale .discount-row input{width:66px;height:30px;padding:2px;font-size:16px}
 #sale .total{padding:4px 6px;gap:5px;flex-wrap:nowrap}#sale .total strong{font-size:20px}#sale .total button{min-height:36px;padding:5px 8px;font-size:13px;flex:0 1 auto}
 body:has(#sale) .cashgrid{margin-top:5px}body:has(#sale) .cashgrid div{padding:3px 4px}
 body:has(#sale) .secondary-nav{margin-top:4px}body:has(#sale) .secondary-nav a{padding:5px;font-size:11px}
}
@media screen and (max-width:350px){
 #sale thead tr,#sale tr.line{grid-template-columns:minmax(0,1fr) 56px 90px 45px;gap:2px}
 #sale .step{grid-template-columns:27px minmax(0,1fr) 27px}#sale .step button{width:27px}
 #sale tr.line td:first-child{font-size:11px}#sale tr.line td.subtotal{font-size:10px}
}

/* V2.9 quick entry */
.quick-entry{margin:4px 0 8px;padding:6px 8px;background:#eef5f0;border:1px solid #cbded0;border-radius:7px}.quick-entry>label{display:block;font-size:13px;font-weight:700;margin:0 0 3px;color:#174b35}.quick-controls{display:flex;gap:6px;align-items:center}.quick-controls input{flex:1;min-width:0;margin:0;font-size:16px;height:36px}.quick-controls button{flex:none;white-space:nowrap;padding:6px 14px;min-height:36px}.quick-entry small{display:block;font-size:12px;min-height:15px;color:#23603d;margin-top:2px}.quick-entry .quick-error{color:#b42318}@media(max-width:799px){.quick-entry{margin:2px 0 4px;padding:3px 4px}.quick-entry>label{font-size:11px;margin:0 0 2px}.quick-controls{gap:3px}.quick-controls input,.quick-controls button{height:32px;min-height:32px}.quick-controls button{padding:3px 8px;font-size:13px}.quick-entry small{font-size:10px;min-height:12px;margin-top:1px}}

/* V3.0: quick-sale first, expandable catalog. */
.quick-cart{margin:4px 0 6px;font-size:14px;line-height:1.35;border:1px solid #d4e1d8;border-radius:6px;padding:4px 8px;background:#f7faf8}.quick-cart p{margin:3px 0;color:#64756a;font-size:14px}.cart-line{display:grid;grid-template-columns:minmax(0,1fr) auto 28px;align-items:center;gap:8px;padding:3px 0;border-bottom:1px solid #e1e9e3;font-size:14px}.cart-line:last-child{border:0}.cart-line strong{white-space:nowrap}.cart-remove{background:#fff;color:#a83b39;border:1px solid #e4caca;padding:0;width:28px;height:28px;font-size:19px;line-height:1;margin:0}.catalog-toggle{margin:5px 0;border:1px solid #cbded0;border-radius:6px}.catalog-toggle summary{cursor:pointer;background:#eaf3ed;color:#174b35;font-weight:700;font-size:14px;padding:7px 10px}.catalog-toggle summary span{font-weight:400;font-size:12px}.catalog-toggle[open]>.scroll{padding:3px}.quick-cart span{overflow-wrap:anywhere}@media(max-width:799px){.quick-cart{padding:3px 5px}.cart-line{gap:4px}.catalog-toggle summary{padding:6px 7px}}

/* V3.1: staff sales guide and locked management */
.quick-guide{margin-top:12px;padding:10px;border:1px solid #d4e1d8;background:#f7faf8;border-radius:8px}.quick-guide h2{font-size:15px;margin:0 0 8px;color:#174b35}.quick-guide-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px 12px}.quick-guide-grid>div{display:flex;justify-content:space-between;gap:6px;border-bottom:1px solid #e0e9e2;padding:5px 2px;font-size:14px}.quick-guide-grid span{white-space:nowrap;color:#52665a}.quick-guide>small{display:block;margin-top:8px;color:#52665a}.primary-nav .admin-entry{background:#e7eee9;color:#174b35}.primary-nav .admin-lock{margin:0;display:inline-flex}.primary-nav .admin-lock button{margin:0;padding:7px 10px;background:#52665a}.admin-page .cashgrid{margin-top:8px}.admin_login-page .login{max-width:450px;margin:12px auto}.admin_login-page .login a{display:inline-block;margin-top:12px}@media(max-width:799px){.quick-guide{padding:6px;margin-top:7px}.quick-guide-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:2px 8px}.quick-guide-grid>div{font-size:13px;padding:4px 0}.quick-guide h2{font-size:14px}.primary-nav{flex-wrap:wrap}.primary-nav a,.primary-nav .admin-lock button{font-size:12px;padding:6px 8px}}

/* V3.2: payment at the bottom, separate administration entry. */
.payment-bottom{margin-top:10px}.bottom-admin{margin:12px 0 4px;justify-content:flex-end}.bottom-admin a{min-width:150px;text-align:center}.bottom-admin .admin-entry{background:#e7eee9;color:#174b35}.payment-bottom .total{margin-top:5px}@media(max-width:799px){.payment-bottom{margin-top:5px}.bottom-admin{margin:7px 0 2px}.bottom-admin a{width:100%;text-align:center}.payment-bottom .payment-choice span{min-height:36px}}
/* V3.3: separate desktop catalog and mobile prefix search. */
#mobile-suggestions[hidden]{display:none!important}#mobile-keypad{border:0;border-radius:12px;width:min(360px,calc(100vw - 24px));max-height:90dvh;overflow:auto;padding:12px;box-sizing:border-box;color:#173b2a;background:#fff;box-shadow:0 8px 40px #0004}#mobile-keypad::backdrop{background:#142b2588}#mobile-keypad h2{font-size:19px;margin:0 0 10px}.keypad-values{display:grid;grid-template-columns:1fr 1fr;gap:8px}.keypad-values label{font-size:13px;min-width:0}.keypad-values input{width:100%;box-sizing:border-box;font-size:20px;text-align:center}.keypad-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:5px;margin-top:10px}.keypad-grid button{background:#eaf3ed;color:#174b35;border:1px solid #cadcd0;height:43px;font-size:21px;padding:0;margin:0}.keypad-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px}.keypad-actions button{margin:0;padding:10px 4px}.keypad-actions button:first-child{background:#596b62}#keypad-total{font-size:20px;font-weight:700;margin:8px 0}#keypad-error{font-size:13px;color:#b42318;margin:3px 0}.suggest-product{width:100%;display:flex;justify-content:space-between;align-items:center;text-align:left;gap:8px;background:white;color:#174b35;border:1px solid #cbded0;border-radius:5px;font-size:14px;padding:10px 7px;margin:3px 0}.suggest-product strong{white-space:nowrap}@media(min-width:800px){#mobile-suggestions,#mobile-keypad{display:none!important}#sale #catalog-toggle>summary{display:none}#sale #quick-cart{display:none}#sale .quick-guide{padding:4px 8px;margin-top:4px}#sale .quick-guide-grid>div{padding:2px 0}}@media(max-width:799px){#sale .cart-line{font-size:14px}.suggest-product{min-height:42px}}

/* V3.4 */
#sale #quick-status:empty{display:none} #sale .quick-guide{display:none!important}

/* V3.5: compact sales layout, prominent product entry. */
#sale .quick-entry{margin:3px 0 6px;padding:6px 8px;border-radius:7px}
#sale .quick-entry>label{font-size:15px;line-height:1.2;margin:0 0 4px}
#sale .quick-controls{display:flex;gap:6px;align-items:stretch}
#sale #quick-command{flex:1;min-width:0;width:100%;height:48px;min-height:48px;font-size:20px;line-height:1.2;padding:8px 12px;margin:0;border:1px solid #97b4a2;border-radius:6px}
#sale #quick-command:focus{outline:2px solid #268052;outline-offset:1px}
#sale #quick-add{height:48px;min-height:48px;font-size:16px;padding:0 16px;margin:0;border-radius:6px}
#sale #quick-status:empty{display:none}
#sale .quick-cart{margin:4px 0;padding:4px 7px}
#sale .catalog-toggle{margin:4px 0}
#sale .payment-bottom{margin-top:5px}
#sale .payment-bottom .total{margin-top:4px}
body:has(#sale) main>section:has(#sale){padding:10px 14px;margin-bottom:6px}
body:has(#sale) main>section:has(#sale)>h1{margin:0 0 5px;font-size:19px;line-height:1.25}
@media(max-width:799px){
 body:has(#sale) main>section:has(#sale){padding:6px;margin-bottom:4px}
 body:has(#sale) main>section:has(#sale)>h1{font-size:16px;margin-bottom:4px}
 #sale .quick-entry{padding:4px 5px;margin:2px 0 4px}
 #sale .quick-entry>label{font-size:14px;margin-bottom:3px}
 #sale .quick-controls{gap:4px}
 #sale #quick-command{height:46px;min-height:46px;font-size:18px;padding:6px 8px}
 #sale #quick-add{height:46px;min-height:46px;font-size:14px;padding:0 10px}
 #sale .quick-cart{margin:3px 0;padding:3px 5px}
 #sale .discount-row{margin:4px 0}
 #sale .payment-bottom{margin-top:4px}
 body:has(#sale) .bottom-admin{margin:5px 0 2px}
}

/* V3.6: product entry text, desktop and mobile. */
#sale #quick-command, #sale #quick-command::placeholder { font-size: 14pt; }

/* V3.7 — mobile quantity first */
.keypad-actions-top{margin:0 0 10px}.keypad-actions-top #keypad-accept{background:#196b46;color:#fff;font-size:17px;font-weight:700;min-height:44px}#keypad-qty:focus{outline:2px solid #196b46;outline-offset:1px;background:#f0faf3}#mobile-keypad .keypad-values label:first-child{font-weight:700}

/* V3.8 — prominent totals and save controls; compact layout. */
#sale .discount-row{gap:10px;margin:5px 0;align-items:center;flex-wrap:wrap}
#sale .discount-row>span,#sale .discount-row label{font-size:18px;font-weight:700;line-height:1.2}
#sale #gross-total{font-size:23px;font-weight:800;font-variant-numeric:tabular-nums}
#sale #discount{width:135px;min-width:0;height:44px;padding:5px 8px;font-size:22px;font-weight:700;line-height:1.2;margin:0}
#sale .payment-bottom .total{padding:7px 12px;gap:10px;align-items:center;flex-wrap:wrap}
#sale .sale-total-value{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;min-width:0}
#sale .sale-total-label{font-size:17px;font-weight:800;color:#174b35}
#sale .payment-bottom .total #total{font-size:32px;line-height:1.12;font-weight:800;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
#sale .payment-bottom .total button[name=action]{font-size:22px;font-weight:800;min-height:48px;padding:7px 26px;line-height:1.2;margin:0}
@media(max-width:799px){
 #sale .discount-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:6px;margin:4px 0}
 #sale .discount-row>span,#sale .discount-row label{display:flex;flex-direction:column;align-items:stretch;gap:3px;font-size:16px;margin:0}
 #sale #gross-total{font-size:23px;overflow-wrap:anywhere}
 #sale #discount{width:100%;height:42px;font-size:22px}
 #sale .payment-bottom .total{padding:7px 8px;gap:6px;display:grid;grid-template-columns:minmax(0,1fr) auto}
 #sale .sale-total-value{display:flex;flex-direction:column;gap:2px;align-items:flex-start}
 #sale .sale-total-label{font-size:15px}
 #sale .payment-bottom .total #total{font-size:clamp(22px,7vw,30px)}
 #sale .payment-bottom .total button[name=action]{font-size:20px;min-height:48px;padding:6px 12px;white-space:normal;max-width:44vw}
}

/* V4.0: desktop catalog stays accessible for any number of active products. */
@media(min-width:800px){#sale #catalog-toggle>.scroll{display:block;max-height:none;overflow:visible} #sale #catalog-toggle:not([open])>summary{display:block} #sale #catalog-toggle[open]>summary{display:none} #sale #catalog-toggle tbody tr.line{display:table-row;visibility:visible}}

/* V4.1 desktop quantity shortcut */
@media (min-width:800px){
 #sale tr.line > td:first-child{cursor:pointer;}
 #sale tr.line > td:first-child:hover{color:#196b46;text-decoration:underline;}
 #sale .qty:focus{outline:2px solid #198754;outline-offset:1px;}
}

/* V4.2 — desktop: keep sales controls close together on wide monitors. */
@media screen and (min-width:800px){
 body:has(#sale) #sale{max-width:920px;width:100%;margin-inline:auto}
 body:has(#sale) main>section:has(#sale)>h1{max-width:920px;margin-inline:auto}
 body:has(#sale) #sale #catalog-toggle{width:100%}
 body:has(#sale) #sale table{width:100%;table-layout:fixed;margin:2px 0}
 body:has(#sale) #sale th:nth-child(1){width:40%}
 body:has(#sale) #sale th:nth-child(2){width:20%}
 body:has(#sale) #sale th:nth-child(3){width:24%}
 body:has(#sale) #sale th:nth-child(4){width:16%}
 body:has(#sale) #sale th,body:has(#sale) #sale td{padding:2px 6px;vertical-align:middle}
 body:has(#sale) #sale input.price{max-width:120px;width:100%;padding-inline:5px}
 body:has(#sale) #sale .step{gap:3px;min-width:0}
 body:has(#sale) #sale .step button{width:32px;flex:0 0 32px}
 body:has(#sale) #sale .step input{width:55px;min-width:0}
 body:has(#sale) #sale .subtotal{text-align:left;white-space:nowrap}
 body:has(#sale) #sale .discount-row{justify-content:flex-start;gap:20px}
 body:has(#sale) #sale .payment-bottom .total{justify-content:flex-start;gap:24px}
 body:has(#sale) #sale .payment-row{gap:5px}
 body:has(#sale) .bottom-admin{max-width:920px;margin-inline:auto}
}

/* V4.3: desktop row save buttons submit the entire existing sale form. */
@media(max-width:799px){#sale .row-save-cell{display:none!important}}
@media(min-width:800px){
 body.sale-page #sale th:nth-child(1){width:32%}
 body.sale-page #sale th:nth-child(2){width:18%}
 body.sale-page #sale th:nth-child(3){width:22%}
 body.sale-page #sale th:nth-child(4){width:16%}
 body.sale-page #sale th:nth-child(5){width:12%}
 #sale .row-save{width:100%;min-height:30px;padding:4px 6px;margin:0;background:#196b46;color:white;font-size:14px;font-weight:700;white-space:nowrap}
 #sale .row-save:disabled{opacity:.55;cursor:not-allowed}
}

/* V4.4: collected amount and automatic discount */
#sale #received-label[hidden]{display:none!important}
#sale #received{width:180px;max-width:100%;min-width:0;height:44px;padding:5px 8px;font-size:22px;font-weight:700;margin:0}
#sale #received::placeholder{font-size:13px;font-weight:400}
#sale #discount[readonly]{background:#edf5ef;color:#174b35}
@media(max-width:799px){#sale .discount-row{grid-template-columns:repeat(2,minmax(0,1fr))}#sale .discount-row>span{grid-column:1/-1}#sale #received{width:100%;height:42px}}

/* V4.5: discounts are visible only in existing administrator reports. */
.report-page .discount-value{color:#a52a35;font-weight:700}
.report-page .profit-summary th,.report-page .profit-summary td{padding:5px 6px;white-space:normal}

/* V4.7: recent sales, outside sale form */
.recent-sales{margin:8px auto;padding:12px;width:100%;box-sizing:border-box;max-width:920px}.recent-sales h2{margin:0 0 8px;font-size:18px}.recent-sale{border:1px solid #d5e2da;border-radius:8px;padding:8px;margin-top:7px}.recent-head,.recent-items>div,.recent-actions{display:flex;align-items:center;justify-content:space-between;gap:8px}.recent-head{background:#e7f2eb;padding:6px;border-radius:4px;font-size:14px}.recent-items>div{padding:4px 2px;border-bottom:1px solid #eef2ef;font-size:14px}.recent-edit{margin-top:6px}.recent-edit summary,.recent-admin{color:#196b46;font-weight:700;cursor:pointer;font-size:13px}.recent-edit input[type=number]{width:100%;min-width:65px}.recent-edit table{width:100%}.recent-actions{justify-content:flex-end;flex-wrap:wrap;margin-top:8px}.recent-edit label{margin-top:6px}.recent-sales small{font-size:12px}@media(max-width:799px){.recent-sales{padding:8px}.recent-head,.recent-items>div{font-size:13px}.recent-edit table{min-width:320px}}

/* V4.8: discount is a display, not an editable control. */
#sale output#discount{display:inline-flex;align-items:center;justify-content:flex-end;box-sizing:border-box;width:auto;min-width:100px;height:44px;padding:5px 8px;color:#a52a35;font-weight:800;font-size:22px;background:transparent;border:0;font-variant-numeric:tabular-nums;white-space:normal;overflow-wrap:anywhere}
@media(max-width:799px){#sale output#discount{width:100%;min-width:0;justify-content:flex-start;height:42px;padding:4px 0}}
