:root{font:16px/1.65 'Nirmala UI','Segoe UI',sans-serif;color:#192334;background:#f4f6fb;--blue:#2644ed;--line:#e1e5ee}*{box-sizing:border-box}body{margin:0}header{padding:22px 5%;background:#fff;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center}.brand{font:800 25px 'Segoe UI',sans-serif;color:#192334;text-decoration:none}.brand span{font-size:13px;font-weight:500;color:#768094}.local,.eyebrow{font:600 12px 'Segoe UI',sans-serif;letter-spacing:1.5px;color:#5c6b86}main{max-width:1280px;margin:auto;padding:40px 35px}.auth{max-width:480px;margin:30px auto!important;padding:35px!important}h1{font-size:28px;line-height:1.4;margin:12px 0}h2{font-size:20px;margin:0 0 14px}p{margin:10px 0}label{display:block;margin-top:14px;margin-bottom:6px;font-size:15px}input{width:100%;min-width:0;border:1px solid #c8d0df;border-radius:6px;padding:11px 12px;font:inherit;background:white}button{font:inherit;cursor:pointer;background:var(--blue);color:white;border:0;border-radius:6px;padding:11px 18px}form>button{width:100%;margin-top:22px}button:disabled{opacity:.5;cursor:wait}button.secondary{background:white;color:#33435e;border:1px solid #ccd3e2;white-space:nowrap}input:focus-visible,button:focus-visible,a:focus-visible{outline:3px solid #e3a91c;outline-offset:3px}.panel{background:white;padding:25px;border:1px solid var(--line);border-radius:12px}.note{font-size:14px;color:#69748a;line-height:1.8}.heading,.table-heading{display:flex;justify-content:space-between;align-items:center;gap:20px}.heading p{color:#69748a}.notice{border-left:3px solid var(--blue);padding:15px 20px;background:#eaf0ff;margin:25px 0;color:#34476d}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:20px;margin:25px 0}.stats>div{background:white;border:1px solid var(--line);border-radius:9px;padding:20px;color:#667085;font-size:14px}.stats strong{display:block;font-size:26px;color:#192334;margin-top:8px}.layout{display:grid;grid-template-columns:400px minmax(0,1fr);gap:25px}.row{display:grid;grid-template-columns:1fr 1fr;gap:14px}.table-wrap{overflow:auto;margin:20px 0}table{width:100%;border-collapse:collapse;text-align:left;font-size:14px}td,th{padding:14px 10px;border-bottom:1px solid var(--line)}th{white-space:nowrap;color:#667085}td{overflow-wrap:anywhere}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}footer{padding:25px 5%;display:flex;justify-content:space-between;border-top:1px solid var(--line);color:#69748a;font-size:14px}[role=status],[role=alert]{color:#9c302a;font-size:15px;overflow-wrap:anywhere}[hidden]{display:none!important}@media(max-width:850px){.layout{grid-template-columns:1fr}.stats{gap:10px}.stats strong{font-size:22px}main{padding:25px 18px}}@media(max-width:480px){.stats{grid-template-columns:1fr}.stats>div{display:flex;justify-content:space-between;align-items:center}.stats strong{margin:0}.local{font-size:10px}.brand{font-size:21px}.brand span{display:none}.auth{padding:24px!important}.heading{align-items:flex-start}.table-heading{flex-wrap:wrap}footer{flex-direction:column;gap:8px}}
.receive-panel{margin-top:26px}.receive-panel>h2{margin-top:15px}.receive-panel form{max-width:800px}.receive-panel select{font:inherit;width:100%;min-width:0;padding:11px 12px;border:1px solid #c8d0df;border-radius:6px;background:white}.receipt-history{padding:14px 0;border-bottom:1px solid var(--line)}.receipt-history p{font-size:15px;margin:4px 0;overflow-wrap:anywhere}@media(max-width:480px){.receive-panel .row{grid-template-columns:1fr}}

.paid-check{display:flex;gap:12px;align-items:flex-start}.paid-check input{width:auto;flex:none;margin-top:6px}select:focus-visible{outline:3px solid #e3a91c;outline-offset:3px}
.web-order-card{margin:16px 0}.web-order-card h3{font-size:17px;margin:0}.web-order-items{padding-left:22px}.web-order-items li{padding:5px 0}.web-order-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:16px}

.identity-logo{width:175px;height:auto;display:inline-block;vertical-align:middle}header .brand{display:flex;align-items:center;gap:12px}header .brand img,footer .identity-logo{width:125px}body[data-theme="dark"] .brand img{filter:brightness(0) invert(1) sepia(1) saturate(0.4) hue-rotate(15deg)}

#sale-receipt-dialog{border:0;border-radius:14px;background:#f1f4f8;width:calc(100% - 24px);max-width:940px;max-height:94vh;padding:24px;overflow:auto}#sale-receipt-dialog::backdrop{background:#15233399}.receipt-tools{display:flex;gap:16px;align-items:center;justify-content:space-between;margin-bottom:16px}.receipt-tools h2{margin:0}.receipt-tools select{font:inherit;padding:8px}.receipt-tools label{margin:0}#sale-receipt{max-width:760px;margin:auto;background:white;padding:32px;color:#111;overflow-wrap:anywhere}#sale-receipt .printed-brand svg{width:220px;max-width:100%;height:auto}#sale-receipt p{font-size:14px;line-height:1.7}#sale-receipt table{table-layout:fixed}#sale-receipt td,#sale-receipt th{padding:10px 5px;white-space:normal;text-align:right}#sale-receipt td:first-child,#sale-receipt th:first-child{width:40%;text-align:left}#sale-receipt dl>div{display:flex;justify-content:space-between;border-bottom:1px solid #ddd;padding:7px 0;gap:16px}#sale-receipt dd{margin:0}#sale-receipt.thermal{width:74mm;max-width:100%;padding:8px;font-size:13px}#sale-receipt.thermal p,#sale-receipt.thermal table{font-size:12px}#sale-receipt.thermal .printed-brand svg{width:170px}#sale-receipt.thermal h2{font-size:17px}@media(max-width:600px){#sale-receipt-dialog{padding:12px}.receipt-tools{flex-wrap:wrap}#sale-receipt{padding:18px 10px}#sale-receipt table{font-size:12px}}
@media print{body:has(#sale-receipt-dialog[open])>*:not(#sale-receipt-dialog){display:none!important}#sale-receipt-dialog[open]{position:static!important;margin:0!important;padding:0!important;width:100%!important;max-width:none!important;max-height:none!important;height:auto!important;overflow:visible!important;border:0!important;background:white!important}#sale-receipt-dialog[open]>*:not(#sale-receipt){display:none!important}#sale-receipt-dialog[open]::backdrop{display:none!important}#sale-receipt{max-width:none!important;padding:0!important;width:100%!important}#sale-receipt.thermal{width:74mm!important;max-width:100%!important}#sale-receipt tr,#sale-receipt dl{break-inside:avoid}#sale-receipt thead{display:table-header-group}}
#sale-receipt.thermal th:first-child,#sale-receipt.thermal td:first-child{width:32%}#sale-receipt.thermal th:nth-child(2),#sale-receipt.thermal td:nth-child(2){width:16%}#sale-receipt.thermal th:nth-child(n+3),#sale-receipt.thermal td:nth-child(n+3){width:26%}#sale-receipt.thermal td:not(:first-child){white-space:nowrap;font-size:11px}#sale-receipt.thermal td,#sale-receipt.thermal th{padding:8px 2px}

/* Step 15: workspace layout; existing receipt and print rules remain above. */
:root{font:15px/1.6 'Segoe UI','Nirmala UI',sans-serif;--blue:#b74a00;--line:#e1e4e8;color:#202b38;background:#f6f7f9}
header{padding:20px 32px;min-height:76px}.brand span{border-left:1px solid var(--line);padding-left:16px;letter-spacing:2px;font-size:11px}.local{font-size:11px;letter-spacing:1px}
main{max-width:1600px;padding:0 28px;margin:auto}.app-shell{display:grid;grid-template-columns:218px minmax(0,1fr);gap:34px}.sidebar{padding:28px 18px 32px 0;border-right:1px solid var(--line)}
.business-identity{display:flex;gap:12px;align-items:center;margin:2px 0 30px}.business-identity small{display:block;color:#667180}.identity-mark{width:38px;height:38px;display:grid;place-items:center;background:#202c38;color:white;border-radius:10px;font-weight:700}.nav-label{display:block;margin:25px 12px 10px;font-size:10px;letter-spacing:1.6px;color:#667180;font-weight:700}.sidebar nav{display:grid;gap:5px}.sidebar a{display:block;text-decoration:none;color:#505d6e;border-radius:7px;padding:11px 12px;font-weight:500;font-size:14px}.sidebar a:hover{background:#eceff2}.sidebar a[aria-current=page]{background:#fff0e4;color:#9c4000;box-shadow:inset 3px 0 #e97822;font-weight:650}.sidebar-foot{margin:60px 12px 0;color:#607080;font-size:12px}.sidebar-foot small{padding-left:14px}.status-dot{display:inline-block;width:6px;height:6px;background:#467562;border-radius:50%;margin-right:6px}
.workspace{min-width:0;padding:30px 0 42px}.heading{margin-bottom:4px}.heading h1{font-size:29px;letter-spacing:-.8px;margin:5px 0}.heading p{margin:0}.eyebrow{font-size:10px;letter-spacing:1.7px}.heading-actions{display:flex;gap:8px}button,.button-link{font-size:14px;font-weight:600;min-height:42px;padding:10px 16px;border-radius:7px}button:hover:not(:disabled){filter:brightness(.94)}button.secondary{color:#425164;border-color:#d8dde3}a{color:#a94300}input,select{font:inherit;width:100%;padding:10px 12px;border:1px solid #cbd2db;background:#fff;border-radius:6px;min-width:0}label{font-size:13px;color:#455466;font-weight:600}.panel{padding:24px;border-radius:10px;box-shadow:0 2px 3px #1d2b3903}h2{font-size:18px;letter-spacing:-.25px}.note{color:#5e6b7c;font-size:13px;line-height:1.7}.notice{background:#fff6ec;color:#6f461e;border-left-color:#e97822;margin:18px 0;padding:12px 16px}.receive-panel{margin-top:16px}.receive-panel>h2:first-of-type{margin-top:6px}.receive-panel form{max-width:850px}.layout{grid-template-columns:minmax(260px,.85fr) minmax(0,1.3fr);gap:20px;margin-top:16px}.table-heading{gap:10px}.table-heading h2{margin:0}table{font-variant-numeric:tabular-nums;font-size:13px}th{font-size:12px;background:#f8f9fb}td,th{padding:13px 10px}.table-wrap{border:1px solid var(--line);border-radius:7px}.table-wrap td:nth-child(n+2){text-align:right;white-space:nowrap}.table-wrap th:nth-child(n+2){text-align:right}
.overview-intro{margin:20px 0 28px;padding:24px 28px;background:#202c38;color:#fff;border-radius:11px;display:flex;align-items:center;justify-content:space-between;gap:24px}.overview-intro h2{font-size:25px;letter-spacing:-.6px;margin:7px 0}.overview-intro p{margin:0;color:#d2d9df;font-size:14px}.overview-intro .eyebrow{color:#ffc69b}.button-link{display:inline-block;background:#ffad6d;color:#282420;text-decoration:none;white-space:nowrap}.section-heading{display:flex;justify-content:space-between;align-items:center;gap:12px}.section-heading h2{font-size:16px;margin:0}.section-heading>span{color:#647184;font-size:12px}.stats{gap:16px;margin:13px 0 26px}.stats>div{padding:18px 20px;color:#5d6878;border-radius:9px;font-size:13px}.stats strong{font-size:28px;letter-spacing:-.7px;margin:7px 0 5px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}.stats small{font-size:11px;color:#647184;display:block}.inventory-stats{grid-template-columns:repeat(4,minmax(0,1fr))}.inventory-stats strong{font-size:23px}.dashboard-columns{display:grid;grid-template-columns:1.4fr 1fr;gap:20px}.dashboard-columns .table-heading a{font-size:12px}.activity-row{padding:15px 0;display:flex;justify-content:space-between;align-items:center;gap:12px;border-bottom:1px solid var(--line);overflow-wrap:anywhere}.activity-row:last-child{border:0}.activity-row strong{font-size:13px}.activity-row small{display:block;font-size:12px;color:#667180}.stock-line{border-bottom:1px solid var(--line);padding:10px 0;font-size:13px;overflow-wrap:anywhere}.dashboard-columns>section>p,.dashboard-columns>section>div>p{color:#5e6b7c;font-size:13px}.history-filters{display:grid;grid-template-columns:2fr 1fr 1fr;gap:14px;padding:15px 0}.history-filters:has(#sales-payment){grid-template-columns:2fr 1fr 1fr 1fr}.history-filters label{margin-top:0}.pager{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:18px}.pager [role=status]{color:#647184;font-size:12px;text-align:center}.receipt-history{padding:18px 0}.receipt-history p{font-size:14px}.receipt-history p:first-child{font-weight:650}.receipt-history summary{cursor:pointer;color:#a94300;font-size:13px;padding:8px 0}.receipt-history button{margin-top:8px}.guide{margin-top:18px;max-width:900px}.guide h2:not(:first-child){margin-top:30px}.guide dl{display:grid;grid-template-columns:140px 1fr;gap:9px}.guide dt{color:#637083}.guide dd{margin:0;overflow-wrap:anywhere}.guide li{margin-bottom:12px}.guide p,.guide li{color:#506075}.skip-link{position:absolute;left:20px;top:-100px;background:white;padding:12px;z-index:10}.skip-link:focus{top:10px}#load-status{min-height:22px;font-size:12px;color:#637083;margin:10px 0}#global-message:not(:empty){background:#fff0eb;border:1px solid #e7b5a6;border-radius:7px;padding:12px 16px;margin-top:18px}#retry-connection{margin:8px 0}#workspace-title:focus{outline:none}[role=status]:empty,[role=alert]:empty{display:none}[role=status][data-state=success]{color:#276047}[role=status][data-state=error]{color:#9c302a}footer{font-size:12px}.auth{margin:60px auto!important}.auth h1{font-size:25px}.auth [role=status]{margin-top:15px}
.layout>.panel,.dashboard-columns>.panel{min-width:0}.table-wrap th:first-child{min-width:150px}.receipt-tools select{width:auto;flex:1 1 150px;min-width:140px}.receipt-tools button,.receipt-tools label{white-space:nowrap;flex-shrink:0}
@media(min-width:1100px){.sidebar{position:sticky;top:0;height:calc(100vh - 80px)}}
@media(max-width:1150px){.app-shell{grid-template-columns:195px minmax(0,1fr);gap:22px}.inventory-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.layout{grid-template-columns:1fr}.overview-intro{padding:22px}.overview-intro h2{font-size:23px}.history-filters:has(#sales-payment){grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:850px){header{padding:18px 20px}main{padding:0 18px}.app-shell{display:block}.sidebar{border-right:0;border-bottom:1px solid var(--line);padding:14px 0}.business-identity,.nav-label,.sidebar-foot{display:none}.sidebar nav{display:flex;flex-wrap:wrap;gap:5px}.sidebar nav+nav{margin-top:5px}.sidebar a{padding:8px 10px;font-size:12px}.workspace{padding-top:22px}.overview-intro{margin-top:18px}.heading h1{font-size:26px}.stats{gap:10px}.stats strong{font-size:24px}.stats>div{padding:16px}.dashboard-columns{grid-template-columns:1fr}.panel{padding:20px}}
@media(max-width:560px){.heading{flex-wrap:wrap;gap:14px}.heading-actions{width:100%}.heading-actions button{flex:1}.overview-intro{align-items:flex-start;flex-direction:column;gap:16px;padding:20px}.overview-intro h2{font-size:23px}.stats,.inventory-stats{grid-template-columns:1fr 1fr}.stats:not(.inventory-stats)>div:first-child{grid-column:1/-1}.stats>div{display:block;padding:14px}.stats strong{font-size:22px;margin:7px 0}.stats small{font-size:11px}.stats>div>span{font-size:12px}.section-heading{align-items:flex-start;flex-direction:column;gap:3px}.row,.history-filters,.history-filters:has(#sales-payment){grid-template-columns:1fr}.panel{padding:17px}.pager{gap:6px}.pager button{padding:9px 11px;font-size:12px}.guide dl{grid-template-columns:1fr;gap:4px}.guide dd{margin-bottom:10px}.brand .identity-logo{width:145px}.local{font-size:10px}.receipt-tools{gap:10px}#sale-receipt.thermal{max-width:100%}footer{padding:20px}}

/* Database management controls */
.management-filters{display:flex;flex-wrap:wrap;gap:12px;margin:16px 0}.management-filters>div{flex:1;min-width:130px}.management-panel{min-width:0;overflow-wrap:anywhere}.record-actions{min-width:220px}.record-actions button{padding:7px 10px;margin:3px;font-size:13px}.management-panel .receipt-history button{margin:5px}.setup-key{display:block;padding:12px;background:#edf4ef;overflow-wrap:anywhere;font-size:18px}#management-dialog{width:min(620px,calc(100% - 24px));max-height:90dvh;overflow:auto;padding:24px;border:1px solid #dce5df;border-radius:18px;box-sizing:border-box}#management-dialog form>button{margin-top:20px}#management-dialog p,#management-dialog pre{overflow-wrap:anywhere;white-space:pre-wrap}#view-products .layout{display:block}#view-products .layout>.panel+ .panel{margin-top:20px}#data-counts{overflow:auto}#data-counts table{min-width:0}#management-dialog::backdrop{background:#14251acc}@media(max-width:420px){#management-dialog{padding:14px}#management-dialog .table-heading{align-items:start;gap:8px}#management-dialog h2{font-size:22px}.management-filters>div{min-width:0;flex-basis:100%}}

.photo-preview{display:block;max-width:100%;width:280px;max-height:280px;object-fit:contain;margin:16px auto;border:1px solid #dce5df;border-radius:12px}input[type=file]{max-width:100%;box-sizing:border-box}.setup-key{user-select:all;letter-spacing:1px}

#import-file{max-width:100%;width:100%;margin:12px 0} [data-view="import"] .table-wrap{max-height:420px;overflow:auto;margin:16px 0}[data-view="import"] td{max-width:260px;white-space:normal;overflow-wrap:anywhere}

/* Step 17: due collection, customer ledger and collection summary. */
.sales-stats{grid-template-columns:repeat(4,minmax(0,1fr))}.due-payment{max-width:850px;margin:34px 0;padding:22px;background:#fff8f1;border:1px solid #f0d9c6;border-radius:10px}.due-payment h2{margin-top:6px}.customer-filters{display:grid;grid-template-columns:2fr 1fr;gap:14px;margin:24px 0}.customer-filters label{margin-top:0}.ledger-payment{color:#276047;font-weight:650}.ledger-payment+button{margin:0 0 8px}
@media(max-width:1150px){.sales-stats{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){.sales-stats{grid-template-columns:1fr 1fr}.customer-filters{grid-template-columns:1fr}.due-payment{padding:16px}}

/* Product photo + full editor revision. */
.new-product-photo{margin:22px 0 0;padding:18px;border:1px solid #e2d3c6;border-radius:9px;background:#fffaf5}.new-product-photo h3{margin:0 0 6px;font-size:16px}.new-product-photo .photo-preview{margin:14px auto}.product-thumb{display:block;width:58px;height:58px;object-fit:contain;border:1px solid #e1e4e8;border-radius:8px;background:#fff;padding:3px}.product-edit-photo{width:220px;max-height:220px}.record-actions{min-width:255px}
.inventory-stats{grid-template-columns:repeat(3,minmax(0,1fr))}
@media(max-width:1150px){.inventory-stats{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Visual refresh only. Print declarations and business behavior are untouched. */
@media screen {
 :root{--blue:#a64000;--line:#e1e4e8;font:16px/1.65 'Segoe UI','Nirmala UI',sans-serif;color:#242830;background:#f5f6f8}
 body>header{background:#fff;border-top:4px solid #ed7b24;padding:18px 32px;min-height:94px}.local{font-size:12px;letter-spacing:.8px;color:#5f6570}
 main{max-width:1600px;padding:0 32px}.app-shell{grid-template-columns:230px minmax(0,1fr);gap:30px}
 .sidebar{padding:28px 18px 30px 0}.sidebar a{font-size:14px;padding:12px 14px;min-height:46px;border-radius:8px;color:#454d5b}.sidebar a[aria-current=page]{background:#fff0e3;color:#933a00;box-shadow:inset 3px 0 #df6915}.nav-label{font-size:12px;color:#646d7a;letter-spacing:1.3px}.business-identity{margin-bottom:26px}.business-identity small{font-size:13px}.identity-mark{background:#202329;border-radius:10px;width:42px;height:42px}.sidebar-foot{font-size:13px;margin-top:30px}
 .workspace{padding:28px 0 40px}.heading h1{font-size:32px;letter-spacing:-.8px}.heading p{font-size:15px;color:#606876}.eyebrow{font-size:12px;letter-spacing:1.5px;color:#8f3c06}.heading-actions button{min-height:44px}
 .overview-intro{background:#22262d;border-radius:12px;border-left:4px solid #f6954a;padding:22px 26px;margin:20px 0 28px}.overview-intro h2{font-size:24px}.overview-intro p{font-size:15px}.button-link{background:#ffad63;color:#271c12;border-radius:8px;min-height:46px}
 .section-heading h2{font-size:18px;letter-spacing:-.2px}.section-heading>span{font-size:13px}.stats{gap:16px;margin:14px 0 28px}.stats>div{padding:20px;border:1px solid #e0e3e8;border-radius:11px;box-shadow:0 3px 10px #1b243005;font-size:14px}.stats strong{font-size:30px;letter-spacing:-.7px;color:#21262e;margin:8px 0 6px}.stats small{font-size:13px;line-height:1.6;color:#646c79}.inventory-stats strong{font-size:25px}#best-selling-product{font-size:21px}.sales-stats>div:first-child{border-top:3px solid #dc6e20}.profit-stats>div{border-top:3px solid #e1e4e8}
 .panel{border-radius:12px;padding:24px;box-shadow:0 3px 14px #20263004}.panel h2{font-size:20px}.note{font-size:14px;line-height:1.75;color:#5b6574}label{font-size:14px;color:#3e4856;line-height:1.6}input,select,textarea{font-size:16px;border-color:#c6ccd5;border-radius:8px;min-height:46px}input[type=checkbox]{min-height:auto}button{font-size:14px;min-height:44px;border-radius:8px}button.secondary{border-color:#cbd1da;background:#fff;color:#3d4858}
 .table-wrap{border-radius:10px}table{font-size:14px}th{font-size:13px;background:#f3f5f7}td,th{padding:14px 12px}.record-actions button{font-size:13px;min-height:40px}.receipt-history p{font-size:15px}.activity-row strong,.stock-line{font-size:14px}.activity-row small,.dashboard-columns .table-heading a{font-size:13px}.dashboard-columns>section>p,.dashboard-columns>section>div>p{font-size:14px}.pager [role=status],#load-status{font-size:13px}
 .auth{max-width:480px;margin:48px auto!important;padding:36px!important;border:1px solid #dce0e6;border-top:4px solid #ed7b24;border-radius:14px;box-shadow:0 12px 40px #222a3510}.auth h1{font-size:29px;letter-spacing:-.7px}.auth .note{font-size:13px}.auth label{margin-top:18px}.auth input{min-height:48px}.auth button{background:#252930;min-height:48px;font-size:16px}.auth .eyebrow{color:#96410a}
 footer{font-size:13px;color:#606b79;background:#fff;padding:24px 32px}a{color:#9b3d00}:is(input,select,textarea,button,a):focus-visible{outline:3px solid #a64200;outline-offset:3px}.guide{max-width:1000px}.guide p,.guide li{font-size:15px}
 @media(min-width:1100px){.sidebar{height:auto;max-height:calc(100vh - 24px);overflow-y:auto;top:12px;align-self:start}}
 @media(max-width:1150px){.app-shell{grid-template-columns:210px minmax(0,1fr);gap:22px}.stats{gap:12px}.stats>div{padding:16px}.sales-stats{grid-template-columns:repeat(2,minmax(0,1fr))}}
 @media(max-width:850px){main{padding:0 20px}body>header{padding:16px 20px}.app-shell{display:block}.sidebar{padding:14px 0;border-right:0}.sidebar nav{gap:6px}.sidebar a{font-size:14px;padding:10px 12px}.workspace{padding-top:22px}.heading h1{font-size:28px}.dashboard-columns{grid-template-columns:1fr}.auth{margin:32px auto!important}}
 @media(max-width:560px){main{padding:0 16px}body>header{gap:16px;flex-wrap:wrap;padding:14px 16px}.local{font-size:12px}.heading{gap:14px}.section-heading{gap:4px}.stats,.sales-stats,.inventory-stats{grid-template-columns:1fr}.stats>div{padding:18px}.stats strong{font-size:28px}.stats>div>span{font-size:14px}.overview-intro{padding:20px;gap:16px}.overview-intro h2{font-size:23px}.panel{padding:18px}.auth{padding:25px!important;margin:26px auto!important}.auth h1{font-size:27px}.pager{flex-wrap:wrap}.pager button{font-size:14px;min-height:44px}.guide dl{grid-template-columns:1fr}footer{padding:20px 16px}.sidebar nav{gap:4px}.sidebar a{font-size:13px;padding:10px}}

 /* Admin sign-in layout follows the supplied secure-workspace reference. */
 body:has(.admin-auth-shell:not([hidden])) {
   min-height: 100vh;
   background:
     radial-gradient(ellipse at 78% 42%, rgba(255,255,255,0.95), transparent 38%),
     linear-gradient(115deg, #f7f5f1 0%, #f1f2f4 100%);
 }
 body[data-theme="dark"]:has(.admin-auth-shell:not([hidden])) {
   background:
     radial-gradient(ellipse at 78% 42%, rgba(54,45,37,0.55), transparent 38%),
     linear-gradient(115deg, #151819 0%, #1a1d20 100%);
 }
 .admin-header {
   min-height: 76px;
   padding: 10px clamp(20px, 4vw, 48px);
   background: rgba(255,255,255,0.84);
 }
 body[data-theme="dark"] .admin-header {
   background: rgba(18,21,23,0.88);
 }
 .admin-header .brand {
   gap: 0;
 }
 .admin-header > .brand > span:not(.brand-lockup),
 .admin-header .local {
   display: none;
 }
 .admin-header .brand-lockup {
   width: 175px;
 }
 .admin-header .brand-lockup img {
   width: 100%;
   max-width: 175px;
 }
 body[data-theme="dark"] .admin-header .brand-lockup img {
   filter: invert(1) hue-rotate(180deg);
 }
 body[data-theme="dark"] .admin-header .brand-tagline,
 body[data-theme="dark"] .admin-header .brand-subtitle {
   color: #fff;
 }
 .admin-header-actions {
   margin-left: auto;
 }
 .admin-main {
   display: flex;
   min-height: calc(100vh - 132px);
   flex-direction: column;
   justify-content: center;
   padding: 24px 20px;
 }
 .admin-auth-shell {
   width: min(1100px, 100%);
   max-width: 1100px;
   grid-template-columns: minmax(0, 0.96fr) minmax(0, 1.04fr);
   gap: 30px;
   margin: 0 auto;
   overflow: visible;
   border: 0;
   border-radius: 0;
   background: transparent;
   box-shadow: none;
 }
 #auth {
   align-self: center;
   border: 1px solid #e8e5e1 !important;
   border-top: 3px solid var(--admin-accent) !important;
   border-radius: 12px !important;
   background: #fff !important;
   box-shadow: 0 16px 42px rgba(39,42,46,0.08);
 }
 body[data-theme="dark"] #auth {
   border-color: var(--admin-border) !important;
   background: var(--admin-panel) !important;
 }
 .auth-card-inner {
   padding: clamp(28px, 3.5vw, 42px);
   background: transparent;
 }
 #auth .eyebrow {
   font-size: 0.7rem;
   letter-spacing: 0.16em;
 }
 #auth h1 {
   margin: 0.55rem 0 0.15rem;
   font-size: clamp(1.9rem, 3vw, 2.3rem);
   letter-spacing: -0.045em;
 }
 #auth-description {
   margin: 0 0 1rem;
   font-size: 0.9rem;
 }
 #auth form {
   gap: 0.55rem;
 }
 #auth label {
   font-size: 0.8rem;
   color: var(--admin-text);
 }
 #auth input {
   min-height: 46px;
   border-radius: 8px;
   background: #fff;
 }
 body[data-theme="dark"] #auth input {
   background: var(--admin-surface);
 }
 #auth .note {
   font-size: 0.72rem;
   line-height: 1.65;
 }
 #auth #auth-code-wrap .note {
   margin: 0.1rem 0 0.35rem;
 }
 #auth button[id="auth-submit"] {
   min-height: 48px;
   margin-top: 0.4rem;
   border-radius: 8px;
   background: #252930;
 }
 .security-visual {
   position: relative;
   min-height: 540px;
   align-items: flex-end;
   justify-content: center;
   overflow: hidden;
   padding: 32px clamp(28px, 4vw, 54px);
   border: 0;
   border-radius: 12px;
   background:
     linear-gradient(180deg, rgba(255,253,249,0.16), rgba(255,253,249,0.24)),
     url("/hero-backdrop.svg") 70% center / cover no-repeat;
 }
 body[data-theme="dark"] .security-visual {
   background:
     linear-gradient(180deg, rgba(17,19,21,0.64), rgba(17,19,21,0.58)),
     url("/hero-backdrop.svg") 70% center / cover no-repeat;
 }
 .security-visual::before {
   display: none;
 }
 .security-visual::after {
   display: none;
 }
 .security-panel {
   width: min(100%, 430px);
   align-items: flex-start;
   text-align: left;
 }
 .security-brand-mark {
   position: relative;
   z-index: 2;
   align-self: center;
   width: min(78%, 320px);
   height: auto;
   margin: 0 auto 1.3rem;
   filter: drop-shadow(0 12px 14px rgba(103,70,35,0.12));
 }
 body[data-theme="dark"] .security-brand-mark {
   filter: invert(1) hue-rotate(180deg) drop-shadow(0 12px 14px rgba(0,0,0,0.22));
 }
 .security-pill {
   display: none;
 }
 .security-shield {
   position: relative;
   z-index: 2;
   align-self: center;
   width: 112px;
   height: 128px;
   margin: 0 auto 1.1rem;
   border-radius: 0;
   background: transparent;
   color: var(--admin-accent);
   box-shadow: none;
 }
 .security-shield svg {
   width: 100%;
   height: 100%;
   filter: drop-shadow(0 12px 14px rgba(103,70,35,0.12));
 }
 .security-panel h2 {
   margin: 0;
   font-size: clamp(1.8rem, 3vw, 2.2rem);
   letter-spacing: -0.05em;
 }
 .security-panel h2 span {
   color: var(--admin-accent);
 }
 .security-panel p {
   max-width: 25rem;
   font-size: 0.9rem;
 }
 body:has(.admin-auth-shell:not([hidden])) > footer {
   min-height: 48px;
   padding: 14px 28px;
   background: rgba(255,255,255,0.8);
   font-size: 0.72rem;
 }
 body[data-theme="dark"]:has(.admin-auth-shell:not([hidden])) > footer {
   background: rgba(18,21,23,0.82);
 }
 @media (max-width: 900px) {
   .admin-auth-shell {
     grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
     gap: 18px;
   }
   .security-visual {
     min-height: 500px;
   }
   .security-brand-mark {
     width: min(78%, 280px);
   }
 }
 @media (max-width: 700px) {
   .admin-auth-shell {
     grid-template-columns: 1fr;
     max-width: 520px;
   }
   .security-visual {
     display: none;
   }
   .admin-main {
     min-height: calc(100vh - 124px);
   }
 }
 @media (max-width: 560px) {
   .admin-header {
     min-height: 64px;
     padding: 10px 16px;
   }
   .admin-header .brand-lockup {
     width: 145px;
   }
   .admin-main {
     padding: 20px 14px;
   }
 }

:root{
  --admin-bg: #f5f1eb;
  --admin-surface: rgba(255,255,255,0.7);
  --admin-panel: #fffaf6;
  --admin-text: #1c1a18;
  --admin-muted: #5d5854;
  --admin-border: rgba(58,41,25,0.08);
  --admin-accent: #ef7a2d;
  --admin-accent-deep: #d45d1f;
  --admin-soft: rgba(239,122,45,0.1);
}

body[data-theme="dark"] {
  --admin-bg: #121517;
  --admin-surface: rgba(27,31,34,0.75);
  --admin-panel: #171c1f;
  --admin-text: #f2efe9;
  --admin-muted: #b2aca4;
  --admin-border: rgba(255,255,255,0.08);
  --admin-accent: #f28e4f;
  --admin-accent-deep: #ffb57d;
  --admin-soft: rgba(242,142,79,0.14);
}

body {
  background: var(--admin-bg);
  color: var(--admin-text);
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 20px 32px;
  background: rgba(255,255,255,0.56);
  border-bottom: 1px solid var(--admin-border);
  backdrop-filter: blur(10px);
}
body[data-theme="dark"] .admin-header {
  background: rgba(15,19,21,0.7);
}
.admin-header .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--admin-text);
}
.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}
.admin-header .theme-button,
.admin-header .language-switcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 42px;
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  background: var(--admin-surface);
  color: var(--admin-text);
}
.admin-header .language-switcher {
  min-width: 86px;
  font-weight: 700;
}
.admin-auth-shell {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: 0;
  max-width: 1280px;
  margin: 30px auto 0;
  border: 1px solid var(--admin-border);
  border-radius: 28px;
  overflow: hidden;
  background: var(--admin-panel);
  box-shadow: 0 18px 40px rgba(17,14,11,0.06);
}
#auth {
  margin: 0 !important;
  max-width: 100% !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}
.auth-card-inner {
  height: 100%;
  padding: clamp(24px, 4vw, 50px);
  background: rgba(255,255,255,0.2);
}
#auth .eyebrow {
  display: inline-block;
  color: var(--admin-accent);
}
#auth h1 {
  margin: 14px 0 8px;
  font-size: clamp(2.1rem, 3vw, 3rem);
  letter-spacing: -0.06em;
}
#auth-description {
  color: var(--admin-muted);
  margin-bottom: 1.5rem;
}
#auth form {
  display: grid;
  gap: 0.75rem;
}
#auth label {
  margin: 0;
  font-weight: 600;
}
#auth input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  background: rgba(255,255,255,0.3);
  color: var(--admin-text);
}
#auth button[id="auth-submit"] {
  min-height: 52px;
  margin-top: 8px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--admin-accent), var(--admin-accent-deep));
  color: #fff;
  font-weight: 700;
}
#auth .note {
  color: var(--admin-muted);
}
#auth-message {
  min-height: 1.4em;
  margin: 0;
}
.security-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 480px;
  padding: clamp(24px, 4vw, 52px);
  background:
    linear-gradient(180deg, rgba(255,253,249,0.1), rgba(255,253,249,0.18)),
    url("/hero-backdrop.svg") 70% center / cover no-repeat;
  border-left: 1px solid var(--admin-border);
}
body[data-theme="dark"] .security-visual {
  background:
    linear-gradient(180deg, rgba(17,19,21,0.58), rgba(17,19,21,0.66)),
    url("/hero-backdrop.svg") 70% center / cover no-repeat;
}
.security-visual::before {
  content: "";
  position: absolute;
  inset: 14% 10% 18% 10%;
  border-radius: 36px;
  background: radial-gradient(circle at 50% 30%, rgba(255,255,255,0.7), rgba(255,255,255,0.18) 32%, rgba(0,0,0,0) 68%);
}
body[data-theme="dark"] .security-visual::before {
  background: radial-gradient(circle at 50% 30%, rgba(255,255,255,0.08), rgba(255,255,255,0.02) 40%, rgba(0,0,0,0) 72%);
}
.security-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 460px;
}
.security-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--admin-border);
  background: rgba(255,255,255,0.54);
  color: var(--admin-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.security-shield {
  display: grid;
  place-items: center;
  width: 120px;
  height: 120px;
  margin: 1.5rem 0 0.9rem;
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(239,122,45,0.18), rgba(255,255,255,0.4));
  font-size: 4rem;
  box-shadow: inset 0 1px rgba(255,255,255,0.8);
}
.security-panel h2 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3rem);
  letter-spacing: -0.06em;
}
.security-panel p {
  margin: 0.8rem 0 0;
  color: var(--admin-muted);
  max-width: 28rem;
}

.admin-main {
  padding: 0 20px 40px;
}

@media (max-width: 900px) {
  .admin-auth-shell {
    grid-template-columns: 1fr;
  }
  .security-visual {
    display: none;
  }
}

@media (max-width: 560px) {
  .admin-header {
    flex-wrap: wrap;
    padding: 16px 20px;
  }
  .admin-header-actions {
    margin-left: 0;
  }
  .admin-main {
    padding: 0 14px 26px;
  }
  .admin-auth-shell {
    margin-top: 18px;
  }
  .auth-card-inner {
    padding: 18px 16px 22px;
  }
  #auth h1 {
    font-size: 2.1rem;
  }
}}

/* Login controls retain keyboard access and room on small screens. */
#auth .password-control { position: relative; }
#auth .password-control input { padding-right: 82px; }
#auth #toggle-password { position: absolute; top: 5px; right: 5px; min-height: 42px; margin: 0; padding: 6px 12px; border: 1px solid var(--admin-border); border-radius: 8px; background: transparent; color: var(--admin-text); font-size: 14px; }
#auth #toggle-password:focus-visible, .login-help summary:focus-visible, .login-store-link:focus-visible { outline: 3px solid var(--admin-accent); outline-offset: 3px; }
#caps-lock-warning { margin: 0; }
#caps-lock-warning[hidden] { display: none; }
.login-help { margin-top: 20px; border-top: 1px solid var(--admin-border); padding-top: 16px; color: var(--admin-muted); font-size: 14px; }
.login-help summary { min-height: 44px; cursor: pointer; color: var(--admin-text); }
.login-help p { line-height: 1.7; }
.login-store-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; color: var(--admin-text); }
#auth-submit:disabled { opacity: .65; cursor: wait; }

/* Authenticated workspace uses a text wordmark and consistent theme colors. */
.admin-header .brand > .workspace-wordmark:not([hidden]) {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 0;
  border: 0;
  color: var(--admin-text);
  font: 800 26px/1.15 'Segoe UI', sans-serif;
  letter-spacing: 3px;
}
.workspace-wordmark small {
  color: var(--admin-muted);
  font: 600 9px/1.5 'Segoe UI', sans-serif;
  letter-spacing: 2px;
}
body[data-authenticated="true"] .admin-main { justify-content: flex-start; padding-top: 28px; }
body[data-authenticated="true"] .admin-header { padding-block: 16px; }
#business { width: 100%; min-width: 0; --line: var(--admin-border); }
#business .business-identity { padding: 0 12px 20px; border-bottom: 1px solid var(--admin-border); }
#business .business-identity strong { font-size: 20px; letter-spacing: 2px; color: var(--admin-text); }
#business .business-identity small { margin-top: 4px; font-size: 9px; letter-spacing: 1.6px; }
#business .panel, #business .stats > div {
  background: var(--admin-panel);
  border-color: var(--admin-border);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,.03);
  color: var(--admin-text);
}
#business .stats { gap: 14px; }
#business .stats > div { padding: 22px; }
#business .stats strong { color: var(--admin-text); font-variant-numeric: tabular-nums; letter-spacing: -.6px; }
#business .stats small, #business .stats > div > span,
#business .heading p, #business .nav-label, #business .sidebar-foot,
#business .business-identity small, #business .guide p, #business .guide li,
#business .guide dt, #business th, #business label, #business .note,
#business .activity-row small, #business .pager [role="status"], #load-status,
#business .section-heading > span, #business .history-filters label { color: var(--admin-muted); }
#business .sidebar a { color: var(--admin-muted); transition: background 150ms ease, color 150ms ease; }
#business .sidebar a:hover { background: var(--admin-soft); color: var(--admin-text); }
#business .sidebar a[aria-current="page"] { background: var(--admin-soft); color: var(--admin-accent-deep); box-shadow: inset 3px 0 var(--admin-accent); }
#business .overview-intro { background: var(--admin-soft); border: 1px solid var(--admin-border); border-radius: 20px; }
#business .overview-intro h2 { color: var(--admin-text); }
#business .overview-intro p { color: var(--admin-muted); }
#business :is(input, select, textarea) { background: var(--admin-panel); color: var(--admin-text); border-color: var(--admin-border); color-scheme: light; }
body[data-theme="dark"] #business :is(input, select, textarea) { color-scheme: dark; }
#business button.secondary { background: var(--admin-panel); color: var(--admin-text); border-color: var(--admin-border); }
#business a.button-link { background: var(--admin-accent); color: #1c1a18; }
.product-photo-empty { display: grid; place-items: center; width: 56px; min-height: 56px; border-radius: 10px; border: 1px dashed var(--admin-border); color: var(--admin-muted); font-size: 11px; }
.receipt-wordmark { display: inline-flex; flex-direction: column; color: #192334; font: 800 26px/1.2 'Segoe UI',sans-serif; letter-spacing: 3px; }
.receipt-wordmark small { margin-top: 5px; font-size: 9px; font-weight: 500; letter-spacing: 2px; }
@media (max-width: 560px) {
  .admin-header .brand > .workspace-wordmark:not([hidden]) { font-size: 22px; }
  #business .stats > div { padding: 16px; }
}

/* Login motion: short introductions, quiet focus feedback and a busy indicator. */
@keyframes login-reveal {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes login-shield-float {
  0%, 100% { transform: translateY(0) rotate(0); }
  35% { transform: translateY(-8px) rotate(-2deg); }
  70% { transform: translateY(-4px) rotate(2deg); }
}
@keyframes login-glow {
  0%, 100% { opacity: .35; transform: scale(.94); }
  50% { opacity: .85; transform: scale(1.06); }
}
@keyframes login-spin {
  to { transform: rotate(360deg); }
}
#auth .auth-card-inner > .eyebrow,
#auth-title, #auth-description, #auth-form,
#auth .login-help, #auth .login-store-link {
  animation: login-reveal 600ms cubic-bezier(.2,.7,.2,1) both;
}
#auth-title { animation-delay: 60ms; }
#auth-description { animation-delay: 100ms; }
#auth-form { animation-delay: 140ms; }
#auth .login-help, #auth .login-store-link { animation-delay: 200ms; }
.admin-auth-shell:has(#auth:not([hidden])) .security-panel {
  animation: login-reveal 800ms 100ms cubic-bezier(.2,.7,.2,1) both;
}
.admin-auth-shell:has(#auth:not([hidden])) .security-shield {
  position: relative;
  isolation: isolate;
  animation: login-shield-float 4.5s 800ms ease-in-out both;
}
.security-shield::before {
  content: "";
  position: absolute;
  inset: -20px;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(239,122,45,.25), transparent 70%);
  opacity: .35;
}
.admin-auth-shell:has(#auth:not([hidden])) .security-shield::before {
  animation: login-glow 4.5s 800ms ease-in-out both;
}
#auth input {
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
#auth input:focus-visible {
  border-color: var(--admin-accent);
  box-shadow: 0 0 0 4px rgba(239,122,45,.13);
}
#auth #auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
#auth #auth-submit:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(239,122,45,.22);
}
#auth #auth-submit:not(:disabled):active { transform: translateY(0); }
#auth-form[aria-busy="true"] #auth-submit::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: login-spin 700ms linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  #auth *, #auth *::before,
  .admin-auth-shell .security-panel,
  .admin-auth-shell .security-shield,
  .admin-auth-shell .security-shield::before {
    animation: none !important;
    transition: none !important;
  }
  #auth #auth-submit:not(:disabled):hover { transform: none; }
}
#password-recovery-dialog {
  width: min(500px, calc(100% - 24px));
  max-height: 90dvh;
  overflow: auto;
  border: 1px solid var(--admin-border, #dce5df);
  border-radius: 20px;
  padding: clamp(18px, 4vw, 30px);
  background: var(--admin-panel, #fff);
  color: var(--admin-text, #192334);
  box-shadow: 0 24px 80px #0005;
}
#password-recovery-dialog::backdrop { background: #101718b8; }
#password-recovery-dialog > p { font-size: 14px; }
#password-recovery-dialog input { background: var(--admin-panel, #fff); color: var(--admin-text, #192334); border-color: var(--admin-border, #ccd3e2); }
#password-recovery-dialog button[type="submit"] { background: var(--admin-accent, #ef7a2d); color: #1c1a18; }
#auth #forgot-password { margin-top: 16px; white-space: normal; }
#password-recovery-dialog #recovery-close { background: var(--admin-panel, #fff); color: var(--admin-text, #192334); border-color: var(--admin-border, #ccd3e2); }
/* Inventory surfaces and product editors follow the selected admin theme. */
:root {
  --admin-table-head: #f0e7de;
  --admin-row-hover: #fff0e2;
  --admin-placeholder: #736b63;
}
body[data-theme="dark"] {
  --admin-table-head: #252e33;
  --admin-row-hover: #222b30;
  --admin-placeholder: #a39d95;
}
#business .table-wrap {
  background: var(--admin-panel);
  border-color: var(--admin-border);
}
#business table { background: var(--admin-panel); color: var(--admin-text); }
#business table th {
  background: var(--admin-table-head);
  color: var(--admin-text);
  border-color: var(--admin-border);
}
#business table td { color: var(--admin-text); border-color: var(--admin-border); }
@media (hover: hover) {
  #business tbody tr:hover { background: var(--admin-row-hover); }
}
#view-products .muted { color: var(--admin-muted); }
#view-products #save-product { background: var(--admin-accent); color: #20140f; }
#view-products .product-photo-empty { background: var(--admin-soft); }
#view-products .new-product-photo {
  background: var(--admin-surface);
  border-color: var(--admin-border);
  color: var(--admin-text);
}
#view-products .new-product-photo h3 { color: var(--admin-text); }
#view-products .new-product-photo :is(label,.note) { color: var(--admin-muted); }
#business .due-payment {
  background: var(--admin-surface);
  border-color: var(--admin-border);
  color: var(--admin-text);
}
#business .due-payment h2 { color: var(--admin-text); }
#business .due-payment .eyebrow { color: var(--admin-accent-deep); }
#business .due-payment .notice {
  background: var(--admin-soft);
  border-color: var(--admin-accent);
  color: var(--admin-text);
}
body[data-theme="dark"] #business .due-payment [role="status"][data-state="success"] { color: #9ad8b7; }
body[data-theme="dark"] #business .due-payment [role="status"][data-state="error"] { color: #ffaaa0; }
#view-products .notice, #management-dialog .notice {
  background: var(--admin-soft);
  color: var(--admin-text);
  border-color: var(--admin-accent);
}
body[data-theme="dark"] #view-products [role="status"][data-state="success"] { color: #9ad8b7; }
body[data-theme="dark"] :is(#view-products,#management-dialog) [role="status"][data-state="error"] { color: #ffaaa0; }
#management-dialog {
  background: var(--admin-panel);
  color: var(--admin-text);
  border-color: var(--admin-border);
}
#management-dialog :is(input,select,textarea),
#management-dialog button.secondary {
  background: var(--admin-panel);
  color: var(--admin-text);
  border-color: var(--admin-border);
}
#management-dialog :is(label,.note) { color: var(--admin-muted); }
#business input::placeholder, #management-dialog input::placeholder { color: var(--admin-placeholder); opacity: 1; }
#business input[type="file"]::file-selector-button,
#management-dialog input[type="file"]::file-selector-button {
  background: var(--admin-soft);
  color: var(--admin-text);
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  padding: 8px 12px;
  margin-right: 12px;
}
#business, #management-dialog { color-scheme: light; }
body[data-theme="dark"] :is(#business,#management-dialog) { color-scheme: dark; }

/* Website order delivery editor follows the active admin theme. */
#web-order-edit-dialog{width:min(650px,calc(100% - 24px));max-height:90dvh;overflow:auto;padding:24px;border:1px solid var(--admin-border);border-radius:18px;background:var(--admin-panel);color:var(--admin-text);box-sizing:border-box;color-scheme:light}
body[data-theme="dark"] #web-order-edit-dialog{color-scheme:dark}
#web-order-edit-dialog::backdrop{background:#101820b3}
#web-order-edit-dialog :is(input,textarea){display:block;width:100%;box-sizing:border-box;background:var(--admin-soft);color:var(--admin-text);border:1px solid var(--admin-border);border-radius:8px;padding:12px;font:inherit}
#web-order-edit-dialog :is(label,.note){color:var(--admin-muted)}
#web-order-edit-dialog button.secondary{background:var(--admin-soft);color:var(--admin-text);border-color:var(--admin-border)}
#web-order-edit-save{margin-top:18px}
#sale-receipt .dispatch-brand img{display:block;max-width:100%;height:auto;width:210px}
#sale-receipt.thermal .dispatch-brand img{width:150px}
#sale-receipt .dispatch-brand{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;min-height:0;background:#fff;color:#111;border-bottom:2px solid #ff7600;padding:0 0 10px;margin-bottom:12px}
#sale-receipt .dispatch-brand p{margin:4px 0;font-size:12px;line-height:1.5}
#sale-receipt.thermal .dispatch-brand{display:block}
#sale-receipt.thermal .dispatch-brand p{font-size:11px}
#sale-receipt .dispatch-status{font-weight:700;letter-spacing:.5px}
#sale-receipt .dispatch-customer p{white-space:normal;overflow-wrap:anywhere}
#sale-receipt[data-receipt-kind="web-order"] small{display:block;font-size:10px}
#sale-receipt[data-receipt-kind="web-order"] th:first-child,#sale-receipt[data-receipt-kind="web-order"] td:first-child{width:42%}
#sale-receipt[data-receipt-kind="web-order"] th:nth-child(2),#sale-receipt[data-receipt-kind="web-order"] td:nth-child(2){width:10%}
#sale-receipt[data-receipt-kind="web-order"] th:nth-child(3),#sale-receipt[data-receipt-kind="web-order"] td:nth-child(3){width:23%}
#sale-receipt[data-receipt-kind="web-order"] th:nth-child(4),#sale-receipt[data-receipt-kind="web-order"] td:nth-child(4){width:25%}
#sale-receipt[data-receipt-kind="web-order"] td{white-space:normal!important;overflow-wrap:anywhere}
#sale-receipt .dispatch-note{font-size:11px;line-height:1.5}
@media print{html:has(#sale-receipt-dialog[open]),body:has(#sale-receipt-dialog[open]){margin:0!important;padding:0!important;background:#fff!important;color:#111!important;height:auto!important;overflow:visible!important}}

#sale-receipt-dialog:not(:has(#sale-receipt[data-receipt-kind="web-order"])) #receipt-order-actions{display:none!important}
#web-order-action-dialog{width:min(620px,calc(100% - 24px));max-height:92vh;overflow:auto;border:1px solid var(--admin-border);border-radius:16px;padding:24px;background:var(--admin-panel);color:var(--admin-text)}
#web-order-action-dialog::backdrop{background:rgba(0,0,0,.65)}
#web-order-action-dialog :is(input,textarea,select){background:var(--admin-bg);color:var(--admin-text);border:1px solid var(--admin-border);border-radius:8px;font:inherit;padding:10px;width:100%}
#web-order-action-dialog .check{display:flex;gap:10px;align-items:flex-start;font-size:14px}
#web-order-action-dialog input[type=checkbox]{width:auto;margin-top:6px;flex-shrink:0}
#web-order-action-dialog .secondary{background:var(--admin-soft);color:var(--admin-text);border:1px solid var(--admin-border)}
#web-order-action-dialog .note{color:var(--admin-muted)}
body[data-theme=dark] #web-order-action-dialog{color-scheme:dark}
