
:root{
  --ink:#101A2E; --ink-2:#1B2941; --indigo:#1E3A6E; --indigo-2:#2A4E8F;
  --indigo-soft:#E8EDF6; --slate:#475569; --muted:#64748B; --chalk:#EEF1F6; --card:#fff;
  --rule:#DCE2EC; --thread:#B4342A; --leaf:#17694F; --brass:#A8791F;
  --ui:"Segoe UI","Noto Naskh Arabic","Noto Sans Arabic",Tahoma,"Jameel Noori Nastaleeq",Arial,sans-serif;
  --num:"Consolas","DejaVu Sans Mono","Courier New",monospace;
  --r:10px; --sh:0 1px 2px rgba(16,26,46,.06),0 6px 18px rgba(16,26,46,.06);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{background:var(--chalk);color:var(--ink);font-family:var(--ui);font-size:14.5px;line-height:1.75;-webkit-font-smoothing:antialiased}
button,input,select,textarea{font-family:inherit;font-size:inherit;color:inherit}
input,select,textarea{background:#fff;border:1px solid var(--rule);border-radius:8px;padding:8px 11px;width:100%;outline:none;transition:border-color .12s,box-shadow .12s}
input:focus,select:focus,textarea:focus{border-color:var(--indigo);box-shadow:0 0 0 3px rgba(30,58,110,.12)}
input[type=number]{font-family:var(--num);font-variant-numeric:tabular-nums}
label{display:block;font-size:12.5px;color:var(--slate);margin-bottom:4px;font-weight:600}
a{color:var(--indigo)}
:focus-visible{outline:2px solid var(--indigo);outline-offset:2px}
.num{font-family:var(--num);font-variant-numeric:tabular-nums;letter-spacing:-.2px}

/* ---------- shell ---------- */
#app{display:flex;min-height:100vh}
aside{width:236px;flex:none;background:var(--ink);color:#C9D3E4;display:flex;flex-direction:column;position:sticky;top:0;height:100vh}
.brandmark{padding:20px 18px 16px;border-bottom:1px solid rgba(255,255,255,.09)}
.brandmark .bn{font-size:17px;font-weight:700;color:#fff;line-height:1.4;word-break:break-word}
.brandmark .bt{font-size:11.5px;color:#8FA0BC;letter-spacing:.3px}
.brandmark img{max-width:96px;max-height:46px;object-fit:contain;background:#fff;border-radius:6px;padding:4px;margin-bottom:8px;display:block}
nav{padding:10px 10px;flex:1;overflow:auto}
nav button{display:flex;align-items:center;gap:9px;width:100%;background:none;border:0;color:#C9D3E4;padding:9px 12px;border-radius:8px;cursor:pointer;text-align:right;font-size:14px;margin-bottom:2px}
nav button:hover{background:rgba(255,255,255,.07);color:#fff}
nav button.on{background:var(--indigo-2);color:#fff;font-weight:600}
nav button .ic{width:18px;text-align:center;opacity:.9}
.sidefoot{padding:12px 16px;border-top:1px solid rgba(255,255,255,.09);font-size:11px;color:#7C8CA8}
main{flex:1;min-width:0;display:flex;flex-direction:column}
.topbar{background:#fff;border-bottom:1px solid var(--rule);padding:12px 22px;display:flex;align-items:center;gap:14px;position:sticky;top:0;z-index:20}
.topbar h1{font-size:19px;margin:0;font-weight:700;letter-spacing:-.2px}
.topbar .sub{font-size:12px;color:var(--slate)}
.spacer{flex:1}
.wrap{padding:22px;max-width:1250px;width:100%;flex:1 0 auto}

/* ---------- stitch motif (signature) ---------- */
.stitch{height:6px;border-top:1px solid var(--rule);border-bottom:1px solid var(--rule);
  background-image:repeating-linear-gradient(90deg,var(--rule) 0 7px,transparent 7px 14px);
  background-size:14px 1px;background-position:center;background-repeat:repeat-x;margin:18px 0}

/* ---------- pieces ---------- */
.card{background:var(--card);border:1px solid var(--rule);border-radius:var(--r);box-shadow:var(--sh)}
.card>.hd{padding:13px 16px;border-bottom:1px solid var(--rule);display:flex;align-items:center;gap:10px}
.card>.hd h2{font-size:15px;margin:0;font-weight:700}
.card>.bd{padding:16px}
.grid{display:grid;gap:14px}
.g2{grid-template-columns:repeat(2,1fr)}
.g3{grid-template-columns:repeat(3,1fr)}
.g4{grid-template-columns:repeat(4,1fr)}
.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}

.btn{display:inline-flex;align-items:center;gap:7px;background:var(--indigo);color:#fff;border:1px solid var(--indigo);
  padding:8px 15px;border-radius:8px;cursor:pointer;font-weight:600;font-size:14px;white-space:nowrap;transition:filter .12s}
.btn:hover{filter:brightness(1.12)}
.btn:active{filter:brightness(.94)}
.btn.ghost{background:#fff;color:var(--ink);border-color:var(--rule)}
.btn.ghost:hover{background:var(--indigo-soft);border-color:#C3CFE3}
.btn.red{background:var(--thread);border-color:var(--thread)}
.btn.green{background:var(--leaf);border-color:var(--leaf)}
.btn.sm{padding:5px 10px;font-size:12.5px;border-radius:7px}
.btn:disabled{opacity:.45;cursor:not-allowed}
.icobtn{background:none;border:1px solid var(--rule);border-radius:7px;width:30px;height:30px;line-height:1;cursor:pointer;color:var(--slate)}
.icobtn:hover{background:var(--indigo-soft);color:var(--ink)}
.icobtn.wa{color:#128C7E;border-color:#BFE3DC;font-size:15px}
.icobtn.wa:hover{background:#E4F4F0;color:#0B6B5F;border-color:#128C7E}

.tile{background:#fff;border:1px solid var(--rule);border-radius:var(--r);padding:14px 16px;box-shadow:var(--sh);position:relative;overflow:hidden}
.tile .k{font-size:12px;color:var(--slate);font-weight:600}
.tile .v{font-family:var(--num);font-size:25px;font-weight:700;letter-spacing:-1px;margin-top:2px}
.tile .n{font-size:11.5px;color:var(--slate)}
.tile::after{content:"";position:absolute;inset-block:0;inset-inline-start:0;width:3px;background:var(--indigo)}
.tile.t-red::after{background:var(--thread)} .tile.t-green::after{background:var(--leaf)} .tile.t-brass::after{background:var(--brass)}

table{width:100%;border-collapse:collapse}
th{text-align:right;font-size:12px;color:var(--slate);font-weight:700;padding:9px 12px;border-bottom:1px solid var(--rule);white-space:nowrap;background:#F7F9FC}
td{padding:9px 12px;border-bottom:1px solid #EEF1F6;vertical-align:middle}
tbody tr:hover{background:#FAFBFD}
td.n,th.n{font-family:var(--num);font-variant-numeric:tabular-nums;text-align:left;direction:ltr}
.tblwrap{overflow:auto}
.empty{padding:40px 20px;text-align:center;color:var(--slate)}
.empty .big{font-size:16px;color:var(--ink);font-weight:600;margin-bottom:4px}

.pill{display:inline-block;padding:2px 9px;border-radius:99px;font-size:11.5px;font-weight:700;border:1px solid}
.p-new{color:var(--indigo);background:var(--indigo-soft);border-color:#C7D4EA}
.p-pack{color:var(--brass);background:#FBF3E2;border-color:#EBDCB8}
.p-ship{color:#0F5D86;background:#E3F1F8;border-color:#BEDCEC}
.p-done{color:var(--leaf);background:#E4F1EC;border-color:#BEDDD1}
.p-ret{color:var(--thread);background:#FAE9E7;border-color:#EFCCC7}
.p-can{color:#6B7280;background:#F1F2F4;border-color:#DFE2E7}

/* modal */
.veil{position:fixed;inset:0;background:rgba(16,26,46,.5);display:flex;align-items:flex-start;justify-content:center;padding:36px 16px;z-index:60;overflow:auto}
.modal{background:#fff;border-radius:12px;width:100%;max-width:640px;box-shadow:0 20px 60px rgba(16,26,46,.3)}
.modal.wide{max-width:900px}
.modal .mh{padding:14px 18px;border-bottom:1px solid var(--rule);display:flex;align-items:center}
.modal .mh h3{margin:0;font-size:16px}
.modal .mb{padding:18px}
.modal .mf{padding:14px 18px;border-top:1px solid var(--rule);display:flex;gap:10px;justify-content:flex-start;background:#FAFBFD;border-radius:0 0 12px 12px}

#toast{position:fixed;inset-block-end:22px;inset-inline-start:22px;z-index:90;display:flex;flex-direction:column;gap:8px}
.toast{background:var(--ink);color:#fff;padding:10px 16px;border-radius:9px;box-shadow:0 8px 24px rgba(0,0,0,.25);font-size:13.5px;animation:tin .22s ease}
.toast.ok{background:var(--leaf)} .toast.err{background:var(--thread)}
@keyframes tin{from{transform:translateY(8px);opacity:0}}

.hint{font-size:12px;color:var(--slate)}
.searchbox{position:relative}
.suggest{position:absolute;inset-inline:0;top:calc(100% + 4px);background:#fff;border:1px solid var(--rule);border-radius:9px;box-shadow:0 12px 28px rgba(16,26,46,.14);max-height:270px;overflow:auto;z-index:30}
.suggest div{padding:8px 12px;cursor:pointer;border-bottom:1px solid #F2F4F8;font-size:13.5px}
.suggest div:last-child{border-bottom:0}
.suggest div:hover{background:var(--indigo-soft)}
.suggest .m{color:var(--slate);font-size:12px;font-family:var(--num)}

.totbox{background:#F7F9FC;border:1px solid var(--rule);border-radius:var(--r);padding:14px}
.totline{display:flex;justify-content:space-between;align-items:center;padding:5px 0;font-size:13.5px}
.totline b{font-family:var(--num);font-variant-numeric:tabular-nums}
.totline.big{border-top:1px dashed var(--rule);margin-top:6px;padding-top:10px;font-size:17px;font-weight:700}
.totline.cod{background:#FAE9E7;border-radius:8px;padding:8px 10px;margin-top:8px;color:var(--thread);font-weight:700}

.bars{display:flex;align-items:flex-end;gap:5px;height:110px;padding-top:6px}
.bars .b{flex:1;background:var(--indigo-soft);border-radius:4px 4px 0 0;position:relative;min-height:2px}
.bars .b>i{position:absolute;inset-inline:0;bottom:0;background:var(--indigo);border-radius:4px 4px 0 0;display:block}
.bars .b:hover>i{background:var(--thread)}
.barlbl{display:flex;gap:5px;margin-top:5px}
.barlbl span{flex:1;text-align:center;font-size:9.5px;color:var(--slate);font-family:var(--num)}

.chip{display:inline-flex;gap:6px;align-items:center;background:var(--indigo-soft);border:1px solid #C7D4EA;border-radius:99px;padding:3px 10px;font-size:12.5px}
.logo-drop{border:1.5px dashed var(--rule);border-radius:var(--r);padding:14px;text-align:center;background:#FAFBFD}
.logo-drop img{max-width:170px;max-height:80px;object-fit:contain}

/* ---------- developer / service-provider footer ---------- */
.appfoot{margin-top:auto;background:#0D1427;color:#E6EAF2;font-size:12px;padding:10px 16px;
  border-top:1px solid #1E2B47;box-shadow:0 -1px 0 rgba(255,255,255,.02)}
.appfoot-inner{max-width:1250px;margin:0 auto;display:flex;gap:9px 12px;align-items:center;
  justify-content:center;flex-wrap:wrap}
.appfoot .foot-brand-logo{width:82px;height:34px;object-fit:contain;background:#fff;border-radius:7px;padding:2px 4px;flex:0 0 auto}
.appfoot .foot-copy{font-weight:600;color:#E6EAF2}
.appfoot .foot-link{display:inline-flex;align-items:center;gap:6px;color:#BFDBFE;text-decoration:none;
  padding:3px 7px;border-radius:7px;transition:background .12s,color .12s}
.appfoot .foot-link:hover{background:rgba(255,255,255,.07);color:#fff;text-decoration:none}
.appfoot .foot-link.wa{color:#86EFAC}
.appfoot .foot-icon{width:20px;height:20px;border-radius:6px;display:grid;place-items:center;
  background:rgba(255,255,255,.06);flex:0 0 20px}
.appfoot .foot-icon svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:1.7;
  stroke-linecap:round;stroke-linejoin:round}
.appfoot .foot-phone{font-family:var(--num);font-variant-numeric:tabular-nums;letter-spacing:.1px}
.appfoot .sep{color:#495266}
.pv-devfoot{margin-top:7px;padding-top:4px;border-top:1px solid #000;text-align:center;font-size:9px;line-height:1.5}
.pv-devfoot img{max-width:100%;max-height:30px;object-fit:contain;display:block;margin:0 auto}
.lbl-wrap .pv-devfoot{margin:0;border-top:1.5px solid #000;padding:3px 6px}
@media(max-width:680px){
  .appfoot{padding:9px 10px}
  .appfoot-inner{gap:6px 8px}
  .appfoot .foot-copy{width:100%;text-align:center}
  .appfoot .sep{display:none}
}

/* ---------- English (LTR) overrides ---------- */
[dir=ltr] nav button{text-align:left}
[dir=ltr] th{text-align:left}
[dir=ltr] td.n,[dir=ltr] th.n{text-align:right}
[dir=ltr] .pv-meta{text-align:right}
[dir=ltr] .pv-tbl th{text-align:left}
[dir=ltr] .pv-tbl td.n,[dir=ltr] .pv-tot td.n{text-align:right}
[dir=ltr] .lbl-phone{text-align:left}
.btn.lang{font-weight:700;letter-spacing:.3px;padding-inline:12px}


/* ---------- R2.5 settings workspace ---------- */
body.route-settings .wrap{max-width:1600px;padding-inline:18px}
.settings-layout{display:block;column-width:440px;column-count:3;column-gap:14px}
.settings-layout>div{display:contents}
.settings-layout .card{display:inline-block;width:100%;vertical-align:top;break-inside:avoid-column;
  -webkit-column-break-inside:avoid;page-break-inside:avoid;margin:0 0 14px!important}
.settings-layout .card .bd{overflow:visible}
@media(max-width:1480px){
  body.route-settings .wrap{max-width:1380px}
  .settings-layout{column-count:2;column-width:480px}
}
@media(max-width:930px){
  body.route-settings .wrap{max-width:100%;padding-inline:14px}
  .settings-layout{column-count:1}
  .settings-layout .card{display:block}
}

@media (max-width:1000px){ .g4{grid-template-columns:repeat(2,1fr)} .g3{grid-template-columns:1fr 1fr} }
@media (max-width:760px){
  #app{flex-direction:column} aside{width:100%;height:auto;position:static;flex-direction:row;align-items:center;overflow:auto}
  .brandmark{border-bottom:0;border-inline-end:1px solid rgba(255,255,255,.09);padding:10px 14px;white-space:nowrap}
  .brandmark img{display:none} nav{display:flex;padding:8px} nav button{white-space:nowrap} .sidefoot{display:none}
  .g2,.g3,.g4{grid-template-columns:1fr} .wrap{padding:14px}
}

.qgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(132px,1fr));gap:8px}
.qbtn{display:flex;flex-direction:column;align-items:flex-start;gap:2px;background:#fff;border:1px solid var(--rule);
  border-radius:10px;padding:10px 11px;cursor:pointer;text-align:start;min-height:62px;transition:border-color .12s,background .12s}
.qbtn:hover{border-color:var(--indigo);background:var(--indigo-soft)}
.qbtn:active{background:#DCE5F4}
.qbtn .qn{font-weight:700;font-size:13.5px;line-height:1.4}
.qbtn .qp{font-size:13px;color:var(--indigo);font-weight:700}
.qbtn .qu{font-size:11px;color:var(--slate)}
@media (max-width:760px){.qgrid{grid-template-columns:repeat(auto-fill,minmax(112px,1fr))}}

/* ---------- موبائل اور لگی ہوئی ایپ ---------- */
@media (max-width:900px){
  #saleGrid{grid-template-columns:1fr!important}
  #saleGrid>div:last-child{position:static!important}
}
@media (max-width:760px){
  .topbar{flex-wrap:wrap;gap:8px;row-gap:8px;padding:10px 14px}
  .topbar h1{font-size:17px}
  .topbar .btn{padding:8px 12px;font-size:13.5px}
  input,select,textarea{font-size:16px;padding:10px 12px}
  .btn{min-height:42px}
  .icobtn{width:36px;height:36px}
  th,td{padding:8px 9px}
  .tile .v{font-size:22px}
  .veil{padding:12px 8px}
  .modal .mf{flex-wrap:wrap}
  .modal .mf .btn,.modal .mf .btn.ghost{flex:1;justify-content:center}
}
.appfoot{padding-bottom:calc(9px + env(safe-area-inset-bottom))}
aside{padding-top:env(safe-area-inset-top)}
@media (display-mode:standalone){
  .topbar{padding-top:calc(12px + env(safe-area-inset-top))}
}

/* ---------- PRINT ---------- */
#printRoot{display:none}
@media print{
  body{background:#fff}
  #app,#toast,.veil{display:none!important}
  #printRoot{display:block}
}
/* R2.6 — Clothing/Fabrics receipt: one visual shell for preview + print/PDF */
.clothing-invoice-shell{
  width:100%;max-width:900px;margin:0 auto;background:#fff;
  border:1px solid #cbd5e1;border-radius:9px;padding:14px;
  box-sizing:border-box;overflow:hidden;
}
.clothing-invoice-shell>.paper{width:100%!important;max-width:none!important;margin:0!important}
.clothing-invoice-shell,.clothing-invoice-shell *{
  box-sizing:border-box;
  -webkit-print-color-adjust:exact;
  print-color-adjust:exact;
}
@media print{
  html,body{background:#fff!important}
  #printRoot{width:100%;margin:0;padding:0}
  .clothing-invoice-shell{
    width:100%;max-width:100%;margin:0 auto;
    border:1px solid #cbd5e1!important;border-radius:2.2mm;
    padding:3.7mm;background:#fff!important;
    break-inside:avoid;page-break-inside:avoid;
  }
  .clothing-invoice-shell .pv-tbl th{
    background:#000!important;color:#fff!important;
  }
  .clothing-invoice-shell .pv-head,
  .clothing-invoice-shell .pv-tbl,
  .clothing-invoice-shell .pv-tot,
  .clothing-invoice-shell .stitchline{
    break-inside:avoid;page-break-inside:avoid;
  }
}

/* R3.1 — Fast Food Counter full-width invoice workspace */
body.food-counter-wide .wrap{
  max-width:none;
  width:100%;
  padding:18px;
}
body.food-counter-wide .counter-pos-layout{
  grid-template-columns:minmax(680px,1.5fr) minmax(500px,.92fr);
  gap:18px;
  width:100%;
}
body.food-counter-wide .counter-menu-pane{
  min-width:0;
}
body.food-counter-wide .counter-ticket{
  width:100%;
  min-width:0;
  padding:18px;
  border-radius:15px;
  top:82px;
  max-height:calc(100vh - 98px);
  overflow:auto;
  scrollbar-gutter:stable;
}
body.food-counter-wide .counter-ticket-head{
  gap:12px;
  padding-bottom:14px;
  margin-bottom:14px;
}
body.food-counter-wide .counter-ticket-head>div{
  flex:1;
  min-width:0;
}
body.food-counter-wide .counter-ticket-head b{
  font-size:19px;
}
body.food-counter-wide .counter-customer{
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  gap:10px;
  margin-bottom:14px;
}
body.food-counter-wide .counter-ticket input,
body.food-counter-wide .counter-ticket select,
body.food-counter-wide .counter-ticket textarea{
  min-height:42px;
  font-size:14px;
}
body.food-counter-wide .counter-lines{
  border-radius:12px;
}
body.food-counter-wide .counter-line{
  grid-template-columns:minmax(150px,1fr) 122px 108px 32px;
  gap:10px;
  padding:11px 10px;
  min-height:62px;
}
body.food-counter-wide .counter-line-name b{
  white-space:normal;
  overflow:visible;
  text-overflow:clip;
  font-size:14px;
  line-height:1.35;
}
body.food-counter-wide .counter-line-name span{
  font-size:12px;
}
body.food-counter-wide .counter-line-qty{
  gap:8px;
}
body.food-counter-wide .counter-line-qty button{
  width:32px;
  height:32px;
  font-size:16px;
}
body.food-counter-wide .counter-line-price{
  font-size:14px;
  white-space:nowrap;
}
body.food-counter-wide .counter-mini-grid{
  gap:10px;
  margin-top:13px;
}
body.food-counter-wide .counter-mini-grid label{
  min-height:22px;
  font-size:12px;
  line-height:1.35;
}
body.food-counter-wide .counter-totals{
  padding:13px 14px;
  margin-top:14px;
  font-size:15px;
  border-radius:12px;
}
body.food-counter-wide .counter-actions{
  gap:10px;
  margin-top:14px;
}
body.food-counter-wide .counter-actions .btn{
  width:100%;
  min-height:48px;
  padding:10px 9px;
  justify-content:center;
  text-align:center;
  white-space:normal;
  line-height:1.25;
  font-size:13px;
}
body.food-counter-wide .counter-product-grid{
  grid-template-columns:repeat(auto-fill,minmax(165px,1fr));
}
body.food-counter-wide .counter-product{
  min-height:174px;
}
body.food-counter-wide .counter-product-media{
  height:98px;
}
body.food-counter-wide .counter-product-name{
  font-size:14px;
}
@media(max-width:1380px){
  body.food-counter-wide .counter-pos-layout{
    grid-template-columns:minmax(0,1.35fr) minmax(440px,.85fr);
  }
  body.food-counter-wide .counter-line{
    grid-template-columns:minmax(120px,1fr) 112px 96px 30px;
  }
}
@media(max-width:1160px){
  body.food-counter-wide .counter-pos-layout{
    grid-template-columns:1fr;
  }
  body.food-counter-wide .counter-ticket{
    position:static;
    max-height:none;
    overflow:visible;
  }
}
@media(max-width:720px){
  body.food-counter-wide .wrap{
    padding:10px;
  }
  body.food-counter-wide .counter-ticket{
    padding:12px;
  }
  body.food-counter-wide .counter-line{
    grid-template-columns:minmax(0,1fr) 96px 78px 26px;
    gap:6px;
  }
  body.food-counter-wide .counter-actions{
    grid-template-columns:1fr;
  }
}

/* R3.0 — Fast Food Kitchen Board */
.kitchen-toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;background:var(--paper);border:1px solid var(--rule);border-radius:12px;padding:12px 14px;margin-bottom:14px}
.kitchen-toolbar>div:first-child{display:flex;flex-direction:column;gap:3px}
.kitchen-board{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;align-items:start}
.kitchen-column{background:#f8fafc;border:1px solid var(--rule);border-radius:14px;overflow:hidden;min-width:0}
.kitchen-column>header{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:11px 13px;border-bottom:1px solid var(--rule);background:#fff}
.kitchen-column>header h2{margin:0;font-size:14px}
.kitchen-column>header span{min-width:26px;height:26px;border-radius:999px;display:grid;place-items:center;font-weight:800;background:#e2e8f0;color:#334155;font-family:var(--num)}
.stage-new>header{border-top:4px solid #dc2626}
.stage-packed>header{border-top:4px solid #d97706}
.stage-shipped>header{border-top:4px solid #16a34a}
.kitchen-stack{padding:10px;display:grid;gap:10px}
.kitchen-empty{min-height:120px;display:grid;place-items:center;color:var(--muted);border:1px dashed var(--rule);border-radius:10px;background:#fff}
.kitchen-order{background:#fff;border:1px solid #dbe3ec;border-radius:12px;padding:11px;box-shadow:0 5px 16px rgba(15,23,42,.05)}
.kitchen-order.ready{border-color:#86efac;background:#f0fdf4}
.kitchen-order>header{display:flex;justify-content:space-between;gap:10px;border-bottom:1px dashed var(--rule);padding-bottom:8px}
.kitchen-order>header>div{display:flex;flex-direction:column;gap:3px}
.kitchen-order>header b{font-size:15px}
.kitchen-order>header span,.kitchen-order time{font-size:11px;color:var(--muted)}
.kitchen-order ul{list-style:none;margin:9px 0;padding:0;display:grid;gap:7px}
.kitchen-order li{display:grid;grid-template-columns:36px 1fr;gap:6px;align-items:start}
.kitchen-order li>b{font-family:var(--num);font-size:14px}
.kitchen-order li span{font-weight:700;line-height:1.25}
.kitchen-order li small{display:block;font-weight:500;color:var(--muted);margin-top:2px}
.kitchen-note{border:1px solid #f59e0b;background:#fffbeb;color:#78350f;border-radius:8px;padding:7px 8px;font-size:12px;font-weight:650}
.kitchen-order>footer{display:flex;gap:7px;justify-content:flex-end;margin-top:10px}
@media(max-width:1100px){.kitchen-board{grid-template-columns:1fr}}

/* R2.7 — multi-up A4 print sheets */
.print-sheet{
  width:100%;
  margin:0;
  padding:0;
  box-sizing:border-box;
}
.print-sheet,.print-sheet *{
  box-sizing:border-box;
  -webkit-print-color-adjust:exact;
  print-color-adjust:exact;
}

/* Two Clothing/Fabrics invoices side-by-side on one A4 landscape page. */
.invoice-sheet-2up{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:5mm;
  align-items:start;
}
.invoice-sheet-2up .invoice-copy{
  min-width:0;
  width:100%;
  overflow:hidden;
}
.invoice-sheet-2up .clothing-invoice-shell{
  width:100%;
  max-width:none;
  margin:0;
  padding:3.5mm;
}
.invoice-sheet-2up .clothing-invoice-shell>.paper{
  width:100%!important;
  max-width:none!important;
}

/* Four courier labels on one A4 portrait page. */
.label-sheet-4up{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  grid-template-rows:repeat(2,143mm);
  gap:2mm;
  align-content:start;
}
.label-sheet-4up .label-copy{
  min-width:0;
  width:100%;
  height:143mm;
  overflow:hidden;
  display:flex;
  align-items:flex-start;
  justify-content:center;
}
.label-sheet-4up .label-copy .lbl-wrap{
  width:100%;
  height:100%;
  margin:0;
}
.label-sheet-4up .label-copy.empty{
  border:0;
}

/* Two kitchen slips side-by-side on one A4 portrait page. */
.kot-sheet-2up{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10mm;
  align-items:start;
}
.kot-sheet-2up .kot-copy{
  min-width:0;
  display:flex;
  align-items:flex-start;
  justify-content:center;
}
.kot-sheet-2up .kot-copy>.paper{
  width:74mm!important;
  max-width:100%;
  margin:0 auto!important;
}

@media print{
  .invoice-sheet-2up,
  .label-sheet-4up,
  .kot-sheet-2up{
    break-inside:avoid;
    page-break-inside:avoid;
  }
  .invoice-sheet-2up .invoice-copy,
  .label-sheet-4up .label-copy,
  .kot-sheet-2up .kot-copy{
    break-inside:avoid;
    page-break-inside:avoid;
  }
  .label-sheet-4up .lbl-wrap{
    border:1.6px solid #000!important;
  }
}

/* paper */
.paper{color:#000;font-family:var(--ui);background:#fff}
.paper .mono{font-family:var(--num);font-variant-numeric:tabular-nums}
.pv-head{display:flex;gap:12px;align-items:flex-start;border-bottom:2px solid #000;padding-bottom:9px}
.pv-head .lg{max-width:120px;max-height:64px;object-fit:contain}
.pv-brand{font-size:20px;font-weight:800;line-height:1.35}
.pv-tag{font-size:11px;color:#333}
.pv-meta{margin-inline-start:auto;text-align:left;direction:ltr;font-size:11.5px}
.pv-meta .t{font-size:15px;font-weight:800;letter-spacing:1px}
.pv-sec{margin-top:9px}
.pv-lbl{font-size:10.5px;font-weight:800;letter-spacing:.6px;color:#000;border-bottom:1px solid #000;display:inline-block;margin-bottom:3px}
.pv-tbl{width:100%;border-collapse:collapse;margin-top:8px;font-size:12px}
.pv-tbl th{background:#000;color:#fff;padding:5px 7px;border:1px solid #000;font-size:11px;text-align:right}
.pv-tbl td{border:1px solid #444;padding:5px 7px}
.pv-tbl td.n{font-family:var(--num);text-align:left;direction:ltr}
.pv-tot{width:100%;font-size:12.5px;margin-top:8px}
.pv-tot td{padding:2.5px 6px}
.pv-tot td.n{font-family:var(--num);text-align:left;direction:ltr}
.pv-tot tr.grand td{border-top:1.5px solid #000;border-bottom:2.5px double #000;font-size:15px;font-weight:800;padding:5px 6px}
.cutline{border-top:2px dashed #000;margin:8px 0;height:0}
.stitchline{height:0;border-top:1.4px dashed #000;margin:7px 0}
/* label */
.lbl-wrap{border:2px solid #000;padding:0;font-size:12px}
.lbl-from{display:flex;gap:8px;align-items:center;padding:6px 8px;border-bottom:1.5px solid #000}
.lbl-from img{max-width:74px;max-height:34px;object-fit:contain}
.lbl-body{display:flex;border-bottom:1.5px solid #000}
.lbl-to{flex:1;padding:8px 10px;border-inline-end:1.5px solid #000}
.lbl-qr{width:140px;flex:none;padding:7px;text-align:center}
.lbl-qr svg{width:120px;height:120px;display:block;margin:0 auto}
.lbl-name{font-size:20px;font-weight:800;line-height:1.35}
.lbl-addr{font-size:15px;line-height:1.6;margin-top:2px}
.lbl-phone{font-size:19px;font-weight:800;font-family:var(--num);margin-top:4px;direction:ltr;text-align:right}
.lbl-cod{border:2px solid #000;padding:5px 8px;text-align:center;margin-top:6px}
.lbl-cod .a{font-size:23px;font-weight:800;font-family:var(--num);line-height:1.2}
.lbl-foot{display:flex;gap:8px;padding:6px 8px;font-size:11px}
.lbl-foot>div{flex:1}
.pagebreak{page-break-after:always;break-after:page}

/* =========================================================
   R2 — Counter POS, menu cards and product variants
   ========================================================= */
.counter-pos-layout{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(360px,.75fr);gap:18px;align-items:start}
.counter-menu-pane{min-width:0}.counter-ticket{position:sticky;top:78px;background:#fff;border:1px solid var(--rule);border-radius:14px;box-shadow:var(--sh);padding:15px;max-height:calc(100vh - 94px);overflow:auto}
.counter-ticket-head{display:flex;align-items:center;gap:10px;padding-bottom:12px;border-bottom:1px solid var(--rule);margin-bottom:12px}.counter-ticket-head b{font-size:17px}.counter-ticket-head .hint{display:block;margin-top:2px}.counter-kindbar{background:#fff;border:1px solid var(--rule);border-radius:13px;padding:10px 12px;display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:14px;box-shadow:var(--sh)}
.counter-kindbar button,.counter-cats button{border:1px solid var(--rule);background:#fff;color:var(--ink);border-radius:9px;padding:7px 10px;font-weight:700;cursor:pointer}.counter-kindbar button.on,.counter-cats button.on{background:var(--ink);border-color:var(--ink);color:#fff}.counter-kindbar input{width:120px;min-height:36px}
.counter-menu-card{background:#fff;border:1px solid var(--rule);border-radius:14px;box-shadow:var(--sh);overflow:hidden}.counter-menu-head{padding:14px 15px;border-bottom:1px solid var(--rule);display:flex;align-items:center;gap:10px}.counter-menu-head b{font-size:18px}.counter-search{max-width:330px}.counter-cats{display:flex;gap:7px;flex-wrap:wrap;padding:10px 14px;border-bottom:1px solid var(--rule);background:#f8fafc}
.counter-product-grid{padding:14px;display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:11px}.counter-product{min-height:155px;border:1px solid var(--rule);background:#fff;border-radius:13px;padding:0;overflow:hidden;display:flex;flex-direction:column;text-align:start;cursor:pointer;transition:transform .12s ease,box-shadow .12s ease,border-color .12s ease}.counter-product:hover{transform:translateY(-2px);box-shadow:0 9px 24px rgba(15,23,42,.10);border-color:#94a3b8}.counter-product-media{height:86px;background:linear-gradient(135deg,#eff6ff,#f8fafc);display:grid;place-items:center;overflow:hidden}.counter-product-media img{width:100%;height:100%;object-fit:cover}.counter-product-icon{width:46px;height:46px;border-radius:13px;background:#0f172a;color:#fff;display:grid;place-items:center;font-size:21px;font-weight:800}.counter-product-name{font-weight:800;padding:9px 10px 2px;line-height:1.3}.counter-product-price{font-family:var(--num);font-weight:800;color:#0f766e;padding:2px 10px}.counter-product-variants{font-size:11px;color:var(--muted);padding:2px 10px 9px}
.counter-customer{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:12px}.counter-lines{border:1px solid var(--rule);border-radius:11px;overflow:hidden}.counter-line{display:grid;grid-template-columns:minmax(0,1fr) 108px 92px 28px;align-items:center;gap:8px;padding:9px 8px;border-bottom:1px solid var(--rule)}.counter-line:last-child{border-bottom:0}.counter-line-name{min-width:0}.counter-line-name b{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.counter-line-name span{display:block;font-size:11px;color:var(--muted);margin-top:2px}.counter-line-qty{display:flex;align-items:center;justify-content:center;gap:7px}.counter-line-qty button{width:28px;height:28px;border:1px solid var(--rule);background:#f8fafc;border-radius:8px;font-weight:800;cursor:pointer}.counter-line-price{text-align:end;font-family:var(--num);font-weight:800}.counter-line-del{border:0;background:transparent;color:#b91c1c;font-size:20px;cursor:pointer}.counter-empty{padding:28px 10px;text-align:center;border:1px dashed var(--rule);border-radius:11px;color:var(--muted);margin-bottom:12px}.counter-mini-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:11px}.counter-mini-grid label{font-size:11px}.counter-totals{margin-top:12px;background:#f8fafc;border:1px solid var(--rule);border-radius:11px;padding:10px}.counter-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:12px}.counter-actions .btn{justify-content:center;min-height:40px}.btn.brass{background:#b7791f;color:#fff}.btn.dark{background:#0f172a;color:#fff}
.variant-picker{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.variant-choice{border:1px solid var(--rule);border-radius:12px;background:#fff;padding:14px;cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:10px;text-align:start}.variant-choice:hover{border-color:#0f766e;background:#f0fdfa}.variant-choice b{font-size:15px}.variant-choice span{font-family:var(--num);font-weight:800;color:#0f766e}
.product-cell{display:flex;align-items:center;gap:9px}.product-cell img{width:42px;height:42px;object-fit:cover;border-radius:8px;border:1px solid var(--rule)}.product-editor{display:grid;grid-template-columns:190px minmax(0,1fr);gap:16px}.product-image-editor{display:flex;flex-direction:column;gap:9px}.product-image-preview{height:170px;border:1px dashed var(--rule);background:#f8fafc;border-radius:12px;display:grid;place-items:center;overflow:hidden;color:var(--muted);font-weight:700}.product-image-preview img{width:100%;height:100%;object-fit:cover}.split-kitchen{page-break-before:always}
@media(max-width:1050px){.counter-pos-layout{grid-template-columns:1fr}.counter-ticket{position:static;max-height:none}.counter-product-grid{grid-template-columns:repeat(auto-fill,minmax(135px,1fr))}}
@media(max-width:640px){.counter-product-grid{grid-template-columns:repeat(2,minmax(0,1fr));padding:9px}.counter-product{min-height:140px}.counter-menu-head{align-items:stretch;flex-direction:column}.counter-search{max-width:none;width:100%}.counter-ticket{border-radius:10px}.counter-customer,.counter-mini-grid{grid-template-columns:1fr 1fr}.counter-line{grid-template-columns:minmax(0,1fr) 92px 75px 24px}.counter-actions{grid-template-columns:1fr}.product-editor{grid-template-columns:1fr}.product-image-preview{height:210px}.variant-picker{grid-template-columns:1fr}}

/* =========================================================
   R3.2 — High contrast Counter POS and professional print documents
   ========================================================= */
body.food-counter-wide .counter-ticket{
  color:#0f172a;
  border-color:#94a3b8;
  background:#fff;
}
body.food-counter-wide .counter-ticket label{
  color:#1e293b;
  font-weight:750;
  font-size:12.5px;
}
body.food-counter-wide .counter-ticket input,
body.food-counter-wide .counter-ticket select,
body.food-counter-wide .counter-ticket textarea{
  color:#0f172a!important;
  -webkit-text-fill-color:#0f172a!important;
  background:#fff!important;
  border:1.4px solid #94a3b8!important;
  font-weight:650;
  opacity:1!important;
}
body.food-counter-wide .counter-ticket input::placeholder,
body.food-counter-wide .counter-ticket textarea::placeholder{
  color:#64748b!important;
  opacity:1!important;
  -webkit-text-fill-color:#64748b!important;
}
body.food-counter-wide .counter-ticket select option{
  color:#0f172a;
  background:#fff;
  font-weight:600;
}
body.food-counter-wide .counter-ticket input:focus,
body.food-counter-wide .counter-ticket select:focus,
body.food-counter-wide .counter-ticket textarea:focus{
  border-color:#1e3a6e!important;
  box-shadow:0 0 0 3px rgba(30,58,110,.18)!important;
}
body.food-counter-wide .counter-ticket-head b,
body.food-counter-wide .counter-line-name b,
body.food-counter-wide .counter-line-price,
body.food-counter-wide .counter-line-qty,
body.food-counter-wide .counter-totals,
body.food-counter-wide .counter-totals .totline{
  color:#0f172a!important;
  opacity:1!important;
}
body.food-counter-wide .counter-line-name span{
  color:#475569!important;
  opacity:1!important;
}
body.food-counter-wide .counter-line{
  border-bottom-color:#cbd5e1;
}
body.food-counter-wide .counter-line-qty button{
  color:#0f172a;
  background:#f8fafc;
  border-color:#94a3b8;
}
body.food-counter-wide .counter-totals{
  background:#f8fafc;
  border-color:#94a3b8;
}
body.food-counter-wide .counter-totals .totline.big{
  color:#0f172a!important;
  border-top-color:#94a3b8;
}
body.food-counter-wide .counter-totals .totline.cod{
  color:#991b1b!important;
  background:#fee2e2;
  border:1px solid #fecaca;
}
body.food-counter-wide .counter-actions .btn{
  font-weight:750;
  opacity:1!important;
}

.r32-kitchen-mode{background:#ecfeff;border-color:#67e8f9;color:#155e75;font-weight:750}
.r32-printer-card input,.r32-printer-card select{font-family:var(--ui)}
.r32-printer-status{
  margin-top:12px;padding:10px 12px;border-radius:9px;
  background:#f8fafc;border:1px solid #cbd5e1;color:#334155;font-weight:700
}
.r32-printer-status.ok{background:#ecfdf5;border-color:#86efac;color:#166534}
.r32-printer-status.bad{background:#fff7ed;border-color:#fdba74;color:#9a3412}
.r32-printer-note,.r32-kitchen-help{
  margin-top:12px;padding:10px 12px;border-radius:9px;
  background:#f8fafc;border:1px solid #cbd5e1;
  color:#334155;font-size:12px;line-height:1.65
}
.r32-check{min-height:42px;border-radius:8px;background:#fff;border-color:#94a3b8}

/* Professional customer receipt */
.pro-receipt{
  color:#111827;background:#fff;box-sizing:border-box;
  font-family:var(--ui);line-height:1.45
}
.pro-receipt *{box-sizing:border-box}
.pro-receipt.document{width:100%;max-width:190mm;margin:0 auto;padding:6mm;font-size:12px}
.pro-receipt.thermal{width:74mm;margin:0 auto;padding:1mm;font-size:11.5px}
.pro-receipt-head{
  display:grid;grid-template-columns:auto minmax(0,1fr) auto;
  gap:10px;align-items:center;border-bottom:2px solid #111827;padding-bottom:9px
}
.pro-receipt-head img{max-width:72px;max-height:52px;object-fit:contain}
.pro-receipt-brand h1{font-size:20px;line-height:1.15;margin:0;font-weight:850}
.pro-receipt-brand p{margin:3px 0 0;color:#374151;font-size:11px}
.pro-receipt-number{text-align:end;display:flex;flex-direction:column;gap:1px}
.pro-receipt-number span{font-size:10px;font-weight:800;letter-spacing:1.2px}
.pro-receipt-number b{font-size:15px}
.pro-receipt-number small{font-size:9.5px}
.pro-order-strip{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));
  gap:1px;background:#111827;border:1px solid #111827;margin-top:8px
}
.pro-order-strip>div{background:#fff;padding:6px 7px;min-width:0}
.pro-order-strip span,.pro-parties span{
  display:block;font-size:9px;color:#4b5563;font-weight:750;text-transform:uppercase;letter-spacing:.5px
}
.pro-order-strip b{display:block;font-size:11.5px;margin-top:1px}
.pro-parties{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;margin-top:8px
}
.pro-parties>div{border:1px solid #9ca3af;border-radius:5px;padding:7px 8px}
.pro-parties b{display:block;font-size:12px;margin-top:2px}
.pro-parties small{display:block;margin-top:2px;font-size:10px}
.pro-thermal-items{margin-top:9px;border-top:1.5px solid #111827}
.pro-thermal-items article{padding:7px 0;border-bottom:1px dashed #6b7280}
.pro-item-title{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
.pro-item-title>span{display:flex;align-items:flex-start;gap:6px;min-width:0}
.pro-item-title em{
  width:18px;height:18px;display:grid;place-items:center;border-radius:50%;
  background:#111827;color:#fff;font-style:normal;font-size:9px;flex:none
}
.pro-item-title b{font-size:12px;line-height:1.3}
.pro-item-title strong{font-size:11.5px;white-space:nowrap}
.pro-item-sub{font-size:9.5px;color:#374151;margin:2px 0 0 24px}
.pro-item-math{font-size:9.5px;color:#374151;margin:2px 0 0 24px}
.pro-document-items{width:100%;border-collapse:collapse;margin-top:10px;font-size:11.5px}
.pro-document-items th{background:#111827!important;color:#fff!important;border:1px solid #111827;padding:7px}
.pro-document-items td{border:1px solid #6b7280;padding:7px;vertical-align:top}
.pro-document-items td small{display:block;color:#374151;margin-top:2px}
.pro-document-items .n{text-align:end;direction:ltr;font-family:var(--num)}
.pro-receipt-summary{margin-top:9px;margin-inline-start:auto;width:min(100%,88mm)}
.pro-receipt-summary>div{
  display:flex;justify-content:space-between;gap:10px;padding:4px 7px;
  border-bottom:1px solid #d1d5db
}
.pro-receipt-summary .grand{
  font-size:15px;font-weight:850;border-top:2px solid #111827;border-bottom:2px solid #111827;
  margin-top:4px;padding-block:6px
}
.pro-receipt-summary .balance{
  margin-top:6px;background:#fee2e2;color:#991b1b;
  border:1px solid #fecaca;border-radius:5px;font-weight:850;padding:6px 8px
}
.pro-receipt-note{margin-top:9px;border:2px solid #111827;padding:7px 8px}
.pro-receipt-note b{display:block;font-size:10px;letter-spacing:.6px}
.pro-receipt-qr{text-align:center;margin-top:10px}
.pro-receipt-qr svg{display:block;margin:0 auto}
.pro-receipt-qr span{display:block;font-size:9px;margin-top:2px}
.pro-receipt-foot{
  text-align:center;border-top:1px dashed #374151;margin-top:10px;padding-top:7px
}
.pro-receipt-foot p{margin:0 0 5px;font-size:9.5px}
.pro-receipt-foot>b{display:block;font-size:11px}
.pro-receipt-foot>small{display:block;font-size:9px;margin-top:4px}

/* Professional Kitchen Ticket */
.pro-kot{
  width:74mm;margin:0 auto;color:#000;background:#fff;
  font-family:var(--ui);font-size:12px;line-height:1.35
}
.pro-kot *{box-sizing:border-box}
.pro-kot>header{
  text-align:center;border:3px solid #000;padding:7px 5px;
  display:flex;flex-direction:column;gap:2px
}
.pro-kot>header span{font-size:18px;font-weight:900;letter-spacing:1.2px}
.pro-kot>header b{font-size:18px}
.pro-kot>header small{font-size:10px}
.pro-kot-kind{
  margin-top:6px;padding:6px;border-top:2px solid #000;border-bottom:2px solid #000;
  display:flex;justify-content:space-between;align-items:center;gap:8px
}
.pro-kot-kind b{font-size:17px}
.pro-kot-kind strong{font-size:16px;border:2px solid #000;padding:3px 7px}
.pro-kot-items{margin-top:4px}
.pro-kot-items article{
  display:grid;grid-template-columns:42px minmax(0,1fr);gap:8px;
  align-items:start;border-bottom:1px dashed #000;padding:8px 0
}
.pro-kot-items article>strong{
  display:grid;place-items:center;min-height:38px;border:2px solid #000;
  font-size:18px
}
.pro-kot-items article b{display:block;font-size:16px;line-height:1.25}
.pro-kot-items article small{display:block;font-size:11px;margin-top:3px}
.pro-kot-note{
  border:3px solid #000;margin-top:7px;padding:7px;
  background:#fff
}
.pro-kot-note b{display:block;font-size:11px;letter-spacing:.8px}
.pro-kot-note div{font-size:15px;font-weight:850;margin-top:3px}
.pro-kot>footer{
  border-top:2px solid #000;margin-top:7px;padding-top:5px;
  display:grid;grid-template-columns:1fr auto;gap:3px 8px;font-size:10px
}
.pro-kot>footer b{grid-column:1/-1;text-align:center;font-size:12px;border:1px solid #000;padding:3px}
.pro-test-slip{width:72mm;margin:0 auto;text-align:center;padding:6mm;color:#000}
.pro-test-slip h2{margin:0 0 6px}

.pro-receipt.thermal .pro-receipt-head{
  grid-template-columns:1fr;text-align:center;gap:4px
}
.pro-receipt.thermal .pro-receipt-head img{margin:0 auto;max-width:58px;max-height:42px}
.pro-receipt.thermal .pro-receipt-number{text-align:center}
.pro-receipt.thermal .pro-order-strip{grid-template-columns:repeat(2,minmax(0,1fr))}
.pro-receipt.thermal .pro-parties{grid-template-columns:1fr}
.pro-receipt.thermal .pro-receipt-summary{width:100%}
.pro-receipt.thermal .pv-devfoot{font-size:8px;line-height:1.35}

@media print{
  .pro-receipt,.pro-kot{
    -webkit-print-color-adjust:exact!important;
    print-color-adjust:exact!important;
  }
  .pro-receipt-head,.pro-order-strip,.pro-parties,
  .pro-thermal-items article,.pro-document-items,
  .pro-receipt-summary,.pro-receipt-note,.pro-kot>header,
  .pro-kot-kind,.pro-kot-items article,.pro-kot-note{
    break-inside:avoid;page-break-inside:avoid
  }
}
@media(max-width:760px){
  .r32-printer-card .g2,.r32-kitchen-settings .g2{grid-template-columns:1fr}
}

/* =========================================================
   R3.3 — Receipt grid correction and print isolation
   ========================================================= */
.pro-receipt.thermal .pro-order-strip>div:last-child:nth-child(odd){
  grid-column:1/-1;
}
#r33PrintFrame{
  position:fixed!important;
  width:1px!important;
  height:1px!important;
  right:100vw!important;
  bottom:0!important;
  border:0!important;
  opacity:0!important;
  pointer-events:none!important;
}
html.print-dialog-active,
body.print-dialog-active{
  width:auto!important;
  max-width:none!important;
  min-width:0!important;
}
@media screen{
  html,body{
    width:auto;
    max-width:none;
  }
}

/* =========================================================
   R3.4 — Compact thermal receipt and mobile-ready application
   ========================================================= */

/* Keep ordinary 80mm receipts compact enough for one PDF page. */
.pro-receipt.thermal{
  font-size:10.8px;
  line-height:1.35;
  padding:.5mm;
}
.pro-receipt.thermal .pro-receipt-head{
  gap:2px;
  padding-bottom:6px;
}
.pro-receipt.thermal .pro-receipt-brand h1{
  font-size:18px;
}
.pro-receipt.thermal .pro-receipt-brand p{
  font-size:9.5px;
  margin-top:1px;
}
.pro-receipt.thermal .pro-receipt-number span{
  font-size:8.8px;
}
.pro-receipt.thermal .pro-receipt-number b{
  font-size:13.5px;
}
.pro-receipt.thermal .pro-receipt-number small{
  font-size:8.7px;
}
.pro-receipt.thermal .pro-order-strip{
  margin-top:6px;
}
.pro-receipt.thermal .pro-order-strip>div{
  padding:4px 6px;
}
.pro-receipt.thermal .pro-parties{
  gap:5px;
  margin-top:6px;
}
.pro-receipt.thermal .pro-parties>div{
  padding:5px 6px;
}
.pro-receipt.thermal .pro-thermal-items{
  margin-top:6px;
}
.pro-receipt.thermal .pro-thermal-items article{
  padding:5px 0;
}
.pro-receipt.thermal .pro-item-title b{
  font-size:11.2px;
}
.pro-receipt.thermal .pro-item-title strong{
  font-size:10.8px;
}
.pro-receipt.thermal .pro-item-sub,
.pro-receipt.thermal .pro-item-math{
  font-size:8.8px;
  margin-top:1px;
}
.pro-receipt.thermal .pro-receipt-summary{
  margin-top:6px;
}
.pro-receipt.thermal .pro-receipt-summary>div{
  padding:3px 6px;
}
.pro-receipt.thermal .pro-receipt-summary .grand{
  font-size:13.5px;
  padding-block:4px;
}
.pro-receipt.thermal .pro-receipt-summary .balance{
  margin-top:4px;
  padding:4px 6px;
}
.pro-receipt.thermal .pro-receipt-foot{
  margin-top:6px;
  padding-top:5px;
}
.pro-receipt.thermal .pro-receipt-foot p{
  margin-bottom:3px;
  font-size:8.4px;
}
.pro-receipt.thermal .pro-receipt-foot>b{
  font-size:9.8px;
}
.pro-receipt.thermal .pro-receipt-foot>small{
  margin-top:2px;
  font-size:7.9px;
}
.pro-receipt.thermal .pv-devfoot{
  margin-top:4px;
  padding-top:3px;
  font-size:7.4px;
  line-height:1.25;
}

/* Global overflow protection. */
html,body{
  max-width:100%;
}
#app,main,.wrap,.card,.card>.bd,.grid,.row{
  min-width:0;
}
img,svg,canvas{
  max-width:100%;
}

/* Tablet and phone application shell. */
@media(max-width:900px){
  .wrap{
    max-width:100%;
    width:100%;
  }
  .topbar{
    flex-wrap:wrap;
  }
  .topbar .spacer{
    flex-basis:100%;
    height:0;
    order:2;
  }
  .topbar>.btn,
  .topbar>.chip{
    max-width:100%;
  }
  .tblwrap{
    width:100%;
    max-width:100%;
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
    scrollbar-gutter:stable;
  }
  .tblwrap table{
    min-width:680px;
  }
  .route-dashboard .tblwrap table,
  .route-reports .tblwrap table{
    min-width:560px;
  }
  .kitchen-toolbar{
    align-items:flex-start;
  }
}

@media(max-width:760px){
  html,body{
    overflow-x:hidden;
  }
  body{
    font-size:14px;
    line-height:1.55;
  }
  #app{
    width:100%;
    min-height:100dvh;
  }
  aside{
    position:sticky;
    top:0;
    z-index:40;
    width:100%;
    height:auto;
    max-width:100%;
    flex-direction:column;
    align-items:stretch;
    overflow:visible;
    padding-top:0;
  }
  .brandmark{
    width:100%;
    padding:8px 12px;
    border-inline-end:0;
    border-bottom:1px solid rgba(255,255,255,.09);
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
  }
  .brandmark .bn{
    font-size:15px;
  }
  .brandmark .bt{
    font-size:10.5px;
  }
  nav{
    width:100%;
    display:flex;
    gap:4px;
    overflow-x:auto;
    overflow-y:hidden;
    padding:6px 8px;
    scroll-snap-type:x proximity;
    -webkit-overflow-scrolling:touch;
  }
  nav button{
    flex:0 0 auto;
    width:auto;
    min-height:40px;
    margin:0;
    padding:7px 10px;
    scroll-snap-align:start;
    white-space:nowrap;
  }
  nav button .ic{
    width:15px;
  }
  main{
    width:100%;
    min-width:0;
  }
  .topbar{
    position:sticky;
    top:0;
    z-index:30;
    width:100%;
    padding:9px 10px;
    gap:7px;
    align-items:flex-start;
  }
  .topbar>div:first-child{
    width:100%;
    min-width:0;
  }
  .topbar h1{
    font-size:17px;
    line-height:1.3;
  }
  .topbar .sub{
    line-height:1.45;
  }
  .topbar .spacer{
    display:none;
  }
  .topbar .chip{
    white-space:normal;
    line-height:1.35;
  }
  .topbar .btn{
    flex:1 1 auto;
    min-width:0;
    white-space:normal;
    justify-content:center;
    text-align:center;
  }
  .wrap,
  body.route-settings .wrap,
  body.food-counter-wide .wrap{
    width:100%;
    max-width:100%;
    padding:10px;
  }
  .grid,
  .g2,
  .g3,
  .g4,
  .settings-layout{
    grid-template-columns:1fr;
    column-count:1;
  }
  .card{
    width:100%;
    max-width:100%;
    overflow:hidden;
  }
  .card>.hd{
    padding:11px 12px;
    align-items:flex-start;
    flex-wrap:wrap;
  }
  .card>.hd .spacer{
    display:none;
  }
  .card>.bd{
    padding:12px;
  }
  .row{
    width:100%;
    align-items:stretch;
  }
  .row>div[style*="min-width:220px"],
  .row>div[style*="min-width: 220px"]{
    min-width:100%!important;
    width:100%!important;
  }
  .row>.btn{
    flex:1 1 140px;
    justify-content:center;
  }
  .btn{
    white-space:normal;
    text-align:center;
    justify-content:center;
    line-height:1.25;
  }
  .tile{
    min-height:112px;
  }
  .tile .v{
    font-size:21px;
    overflow-wrap:anywhere;
  }
  .tblwrap{
    margin-inline:0;
    border-radius:8px;
    border:1px solid var(--rule);
    background:#fff;
  }
  .tblwrap table{
    min-width:640px;
  }
  th,td{
    padding:8px 9px;
    white-space:normal;
  }
  th{
    white-space:nowrap;
  }
  .empty{
    padding:28px 14px;
  }
  .veil{
    align-items:flex-start;
    padding:8px;
  }
  .modal,
  .modal.wide{
    max-width:100%;
    max-height:calc(100dvh - 16px);
    overflow:auto;
    border-radius:10px;
  }
  .modal .mh,
  .modal .mb,
  .modal .mf{
    padding:12px;
  }
  .modal .mf{
    position:sticky;
    bottom:0;
    z-index:2;
  }
  .modal .mf .btn{
    flex:1 1 130px;
  }
  .kitchen-toolbar{
    padding:10px;
  }
  .kitchen-toolbar>*{
    max-width:100%;
  }
  .kitchen-board{
    grid-template-columns:1fr;
    gap:10px;
  }
  .kitchen-order>header,
  .kitchen-order>footer{
    flex-wrap:wrap;
  }
  .kitchen-order>footer .btn{
    flex:1 1 120px;
  }
  .counter-pos-layout{
    grid-template-columns:1fr!important;
    gap:10px;
  }
  .counter-kindbar{
    gap:6px;
    padding:8px;
  }
  .counter-kindbar button{
    flex:1 1 auto;
  }
  .counter-kindbar input{
    width:100%;
    flex-basis:100%;
  }
  .counter-product-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:7px;
  }
  .counter-product{
    min-width:0;
    min-height:142px!important;
  }
  .counter-product-media{
    height:82px!important;
  }
  .counter-product-name{
    font-size:12.5px!important;
    overflow-wrap:anywhere;
  }
  .counter-product-price{
    font-size:12px;
  }
  .counter-ticket{
    position:static!important;
    width:100%;
    max-height:none!important;
    overflow:visible!important;
  }
  .counter-customer,
  .counter-mini-grid{
    grid-template-columns:1fr!important;
  }
  .counter-line{
    grid-template-columns:minmax(0,1fr) auto auto!important;
    gap:7px!important;
  }
  .counter-line-name{
    grid-column:1/-1;
  }
  .counter-line-qty{
    justify-self:start;
  }
  .counter-line-price{
    justify-self:end;
  }
  .counter-line-del{
    justify-self:end;
  }
  .counter-actions{
    grid-template-columns:1fr!important;
  }
  .product-editor{
    grid-template-columns:1fr!important;
  }
  .product-image-preview{
    height:190px!important;
  }
  .variant-picker{
    grid-template-columns:1fr!important;
  }
  .appfoot{
    width:100%;
  }
  .appfoot-inner{
    max-width:100%;
    text-align:center;
  }
  .appfoot .foot-link{
    max-width:100%;
    overflow-wrap:anywhere;
  }
  #toast{
    inset-inline:10px;
    inset-block-end:10px;
  }
  .toast{
    width:100%;
  }
}

@media(max-width:420px){
  .topbar .btn{
    flex-basis:calc(50% - 4px);
    font-size:12.5px;
    padding:8px;
  }
  .counter-product-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  .counter-product{
    padding:7px!important;
  }
  .counter-product-media{
    height:72px!important;
  }
  .counter-line-qty button,
  .icobtn{
    min-width:36px;
    min-height:36px;
  }
  .pro-receipt.thermal{
    font-size:10.5px;
  }
}

/* =========================================================
   R3.5 — Waiter mobile ordering and counter approval
   ========================================================= */
.p-waiter{
  color:#854d0e;
  background:#fef9c3;
  border-color:#fde047;
}
.r35-pending-card{
  margin-bottom:14px;
  border:2px solid #f59e0b;
}
.r35-pending-list{
  display:grid;
  gap:10px;
}
.r35-pending-order{
  border:1px solid #fbbf24;
  border-radius:12px;
  background:#fffbeb;
  padding:12px;
}
.r35-pending-order>header{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
}
.r35-pending-order>header>div{
  display:flex;
  flex-direction:column;
  gap:2px;
}
.r35-pending-order>header>div:last-child{
  text-align:end;
}
.r35-pending-items{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:10px;
}
.r35-pending-items span{
  background:#fff;
  border:1px solid #fcd34d;
  border-radius:999px;
  padding:5px 8px;
  font-size:12px;
}
.r35-pending-note{
  margin-top:9px;
  padding:8px 10px;
  background:#fff7ed;
  border:1px solid #fdba74;
  border-radius:8px;
}
.r35-pending-order>footer{
  display:flex;
  gap:8px;
  margin-top:10px;
}
.r35-pending-order>footer .btn{
  flex:1 1 180px;
  justify-content:center;
}
.r35-waiter-shell{
  display:grid;
  grid-template-columns:minmax(0,1.35fr) minmax(360px,.65fr);
  gap:14px;
  align-items:start;
}
.r35-waiter-order{
  grid-column:1/-1;
}
.r35-waiter-kind{
  display:flex;
  gap:7px;
  flex-wrap:wrap;
}
.r35-table-field{
  margin-top:10px;
  max-width:260px;
}
.r35-table-field input{
  font-size:18px;
  font-weight:800;
}
.r35-waiter-ticket{
  position:sticky;
  top:82px;
}
.r35-submit-order{
  width:100%;
  min-height:54px;
  margin-top:12px;
  font-size:15px;
  justify-content:center;
}
.r35-my-orders{
  display:grid;
  gap:10px;
}
.r35-my-order header{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:flex-start;
}
.r35-my-order header>div{
  display:flex;
  flex-direction:column;
  gap:2px;
}
.r35-my-order-main{
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin-top:10px;
  padding:9px 10px;
  background:#f8fafc;
  border-radius:8px;
}
.r35-my-order-items{
  display:flex;
  flex-wrap:wrap;
  gap:5px;
  margin-top:9px;
}
.r35-my-order-items span{
  border:1px solid #cbd5e1;
  border-radius:999px;
  padding:4px 7px;
  font-size:12px;
}
.r35-rejection{
  margin-top:9px;
  padding:8px 10px;
  border-radius:8px;
  color:#991b1b;
  background:#fee2e2;
}
.r35-workflow-help{
  margin-top:12px;
  padding:10px 12px;
  border:1px solid #cbd5e1;
  border-radius:9px;
  background:#f8fafc;
  color:#334155;
  line-height:1.6;
}
.pro-receipt.thermal .pro-parties:has(>div:only-child){
  grid-template-columns:1fr;
}
@media(max-width:900px){
  .r35-waiter-shell{
    grid-template-columns:1fr;
  }
  .r35-waiter-order{
    grid-column:auto;
  }
  .r35-waiter-ticket{
    position:static;
  }
}
@media(max-width:760px){
  body.route-sale .r35-waiter-shell{
    display:flex;
    flex-direction:column;
  }
  .r35-waiter-shell>*{
    width:100%;
  }
  .r35-table-field{
    max-width:none;
  }
  .r35-pending-order>header,
  .r35-my-order header{
    flex-direction:column;
  }
  .r35-pending-order>header>div:last-child{
    text-align:start;
  }
  .r35-pending-order>footer{
    flex-direction:column;
  }
  .r35-pending-order>footer .btn{
    width:100%;
    flex-basis:auto;
  }
}

/* =========================================================
   R3.6 — Financial settings, guest count and realtime alerts
   ========================================================= */
.r36-tax-registration{
  display:flex;
  flex-wrap:wrap;
  gap:3px 10px;
  margin-top:2px;
  font-size:8.5px;
  color:#374151;
}
.r36-setting-section{
  padding:12px 0;
  border-bottom:1px solid var(--rule);
}
.r36-setting-section:first-child{padding-top:0}
.r36-setting-section:last-of-type{border-bottom:0}
.r36-setting-section h3{
  margin:0 0 9px;
  font-size:14px;
}
.r36-check-row{
  margin-bottom:10px;
}
.r36-check{
  display:inline-flex;
  align-items:center;
  gap:7px;
  min-height:38px;
  padding:7px 10px;
  border:1px solid var(--rule);
  border-radius:8px;
  background:#fff;
  font-weight:700;
  cursor:pointer;
}
.r36-check input{
  width:auto!important;
  margin:0!important;
}
.r36-help{
  margin-top:8px;
  line-height:1.6;
}
.r36-legal-note{
  margin-top:12px;
  padding:10px 12px;
  border:1px solid #fcd34d;
  border-radius:9px;
  background:#fffbeb;
  color:#713f12;
  line-height:1.6;
}
.r36-permission-row{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  min-height:42px;
}
.r36-waiter-fields{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  margin-top:10px;
}
.r36-alert-button{
  position:relative;
  gap:6px;
}
.r36-alert-button b{
  display:grid;
  place-items:center;
  min-width:22px;
  height:22px;
  padding:0 5px;
  border-radius:999px;
  background:#e2e8f0;
  color:#0f172a;
  font-size:11px;
}
.r36-alert-button.active{
  border-color:#f59e0b!important;
  background:#fffbeb!important;
  color:#92400e!important;
  animation:r36Pulse 1.2s ease-in-out infinite;
}
.r36-alert-button.active b{
  background:#dc2626;
  color:#fff;
}
.r36-bell{
  color:#f59e0b;
  font-size:12px;
}
.r36-order-alert-panel{
  position:fixed;
  z-index:9999;
  inset-inline-end:18px;
  top:18px;
  width:min(460px,calc(100vw - 24px));
  display:grid;
  grid-template-columns:42px minmax(0,1fr) auto;
  gap:10px;
  align-items:center;
  padding:12px;
  border:2px solid #f59e0b;
  border-radius:12px;
  background:#fff;
  box-shadow:0 18px 50px rgba(15,23,42,.25);
  transform:translateY(-160%);
  opacity:0;
  pointer-events:none;
  transition:.25s ease;
}
.r36-order-alert-panel.show{
  transform:translateY(0);
  opacity:1;
  pointer-events:auto;
}
.r36-order-alert-panel>div:nth-child(2){
  display:flex;
  min-width:0;
  flex-direction:column;
  gap:2px;
}
.r36-order-alert-panel span{
  overflow-wrap:anywhere;
  color:#475569;
  font-size:12px;
}
.r36-order-alert-icon{
  display:grid;
  place-items:center;
  width:40px;
  height:40px;
  border-radius:50%;
  background:#f59e0b;
  color:#fff;
  font-size:22px;
  font-weight:900;
}
.pro-kot-waiter{
  display:flex;
  justify-content:space-between;
  gap:8px;
  padding:5px 0;
  border-bottom:1px solid #000;
}
@keyframes r36Pulse{
  0%,100%{box-shadow:0 0 0 0 rgba(245,158,11,.15)}
  50%{box-shadow:0 0 0 6px rgba(245,158,11,.15)}
}
@media(max-width:760px){
  .r36-waiter-fields{grid-template-columns:1fr}
  .r36-setting-section .g4,
  .r36-setting-section .g3,
  .r36-setting-section .g2{grid-template-columns:1fr!important}
  .r36-check-row{align-items:stretch}
  .r36-check{width:100%}
  .r36-order-alert-panel{
    top:auto;
    bottom:10px;
    inset-inline:10px;
    width:auto;
    grid-template-columns:38px minmax(0,1fr);
  }
  .r36-order-alert-panel .btn{
    grid-column:1/-1;
    width:100%;
  }
  .r36-alert-button span:not(.r36-bell){display:none}
}

/* =========================================================
   R3.7 — add-on rounds, inline alerts, continuous roll print
   ========================================================= */
.r37-topbar-alert-host{
  flex:1 1 320px;
  min-width:0;
  display:flex;
  justify-content:center;
  align-items:center;
  opacity:0;
  transform:translateY(-4px);
  pointer-events:none;
  transition:.18s ease;
}
.r37-topbar-alert-host.show{opacity:1;transform:none;pointer-events:auto}
.r37-topbar-alert-host.show + .spacer{flex:.15}
.r37-inline-alert{
  width:min(560px,100%);
  border:1px solid #f59e0b;
  border-radius:11px;
  background:#fffaf0;
  color:#111827;
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:9px;
  padding:7px 10px;
  text-align:start;
  cursor:pointer;
  box-shadow:0 5px 18px rgba(15,23,42,.09);
}
.r37-inline-alert-icon{
  width:27px;height:27px;border-radius:50%;display:grid;place-items:center;
  background:#f59e0b;color:#fff;font-weight:900
}
.r37-inline-alert span:nth-child(2){min-width:0;display:flex;flex-direction:column}
.r37-inline-alert b,.r37-inline-alert small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.r37-inline-alert small{color:#64748b;font-size:11px;margin-top:1px}
.r37-inline-alert strong{background:#1e3a6f;color:#fff;border-radius:6px;padding:5px 8px;font-size:11px}
.r36-order-alert-panel{display:none!important}
.r37-addon-banner{
  grid-column:1/-1;
  display:flex;justify-content:space-between;align-items:center;gap:12px;
  border:2px solid #0f766e;background:#ecfdf5;border-radius:12px;padding:11px 13px
}
.r37-addon-banner>div{display:flex;flex-direction:column}.r37-addon-banner span{color:#475569;font-size:12px}
.r37-add-items{width:100%;margin-top:10px;justify-content:center}
.r37-round-history{display:grid;gap:6px;margin-top:10px;padding-top:9px;border-top:1px dashed #cbd5e1}
.r37-round-history>div{display:grid;grid-template-columns:auto auto minmax(0,1fr);align-items:center;gap:7px;padding:7px 8px;background:#f8fafc;border-radius:8px}
.r37-round-history>div>span:last-child{font-size:12px;color:#475569;overflow-wrap:anywhere}
.r37-pending-round-card{margin-bottom:14px;border:2px solid #0f766e}
.r37-kitchen-round{border:2px solid #0f766e;background:#f0fdfa}
.r37-delta-label,.r37-kot-addon-banner{background:#0f766e;color:#fff;font-weight:900;text-align:center;padding:5px 7px;letter-spacing:.03em}
.r37-kot-addon-banner{margin-bottom:5px;border-radius:4px}
#r37PersistentPrintFrame{position:fixed!important;width:2px!important;height:2px!important;right:100vw!important;bottom:0!important;border:0!important;opacity:0!important;pointer-events:none!important}
@media print{
  .pro-receipt.thermal,.pro-kot,.split-slip,.pro-thermal-items article,.pro-kot-items article{break-inside:avoid-page!important;page-break-inside:avoid!important}
}
@media(max-width:900px){
  .r37-topbar-alert-host{order:99;position:fixed;z-index:85;left:10px;right:10px;bottom:calc(10px + env(safe-area-inset-bottom));display:block;max-width:none}
  .r37-inline-alert{width:100%;box-shadow:0 12px 32px rgba(15,23,42,.25)}
}
@media(max-width:760px){
  .r37-round-history>div{grid-template-columns:1fr auto}.r37-round-history>div>span:last-child{grid-column:1/-1}
  .r37-addon-banner{flex-direction:column;align-items:stretch}.r37-addon-banner .btn{width:100%}
}



/* =========================================================
   R3.8 — bounded waiter, post-sale and ready-notification UI
   ========================================================= */
.role-waiter .topbar{gap:8px}
.role-waiter .topbar>.spacer{flex:1 1 auto}
.role-waiter #appFoot{display:none}
.r38-post-sale-summary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  border:1px solid #bbf7d0;
  border-radius:11px;
  background:#f0fdf4;
  padding:14px 16px;
  color:#166534
}
.r38-post-sale-summary b{font-size:18px;color:#14532d}
.r38-ready-alert{border-color:#16a34a;background:#f0fdf4}
.r38-ready-icon{background:#16a34a}
.r38-ready-alert strong{background:#166534}
@media(max-width:760px){
  .role-waiter .topbar{align-items:center}
  .r38-post-sale-summary{align-items:flex-start;flex-direction:column}
}


/* R3.8-R2 — compact post-sale invoice actions */
.r38-post-sale-open{
  width:100%;border:1px solid #bbf7d0;background:#f0fdf4;color:#14532d;
  border-radius:10px;padding:13px 14px;display:flex;align-items:center;
  justify-content:space-between;gap:14px;text-align:start;cursor:pointer
}
.r38-post-sale-open:hover{background:#dcfce7;border-color:#86efac}
.r38-post-sale-open span{display:flex;flex-direction:column;gap:2px}
.r38-post-sale-open span>b{font-size:14px}
.r38-post-sale-open small{font-size:11.5px;color:#4b5563;font-weight:600}
.r38-post-sale-open strong{font-size:18px;color:#14532d;white-space:nowrap}
.r38-invoice-preview-shell{
  max-height:68vh;overflow:auto;background:#eef1f6;border:1px solid var(--rule);
  border-radius:10px;padding:18px
}
.r38-invoice-preview-paper{width:max-content;max-width:100%;margin:0 auto}
.r38-invoice-preview-paper>.paper,
.r38-invoice-preview-paper .paper{
  background:#fff;box-shadow:0 8px 28px rgba(15,23,42,.14)
}
.r38-pdf-capture-host,.r38-pdf-capture-root{background:#fff;color:#000}
@media(max-width:700px){
  .r38-post-sale-open{align-items:flex-start}
  .r38-post-sale-open strong{font-size:15px}
  .r38-invoice-preview-shell{max-height:62vh;padding:10px}
  .r38-invoice-preview-paper{width:100%}
}


/* R3.8-R3 - kitchen incoming order alert */
.r38-kitchen-new-alert{border-color:#ea580c;background:#fff7ed}
.r38-kitchen-new-icon{background:#ea580c}
.r38-kitchen-new-alert strong{background:#9a3412}


/* R3.8-R5 - compact receipt user meta and paid stamp */
.r38-receipt-user{
  display:block;
  margin-top:2px;
  font-family:var(--ui);
  font-size:8.4px!important;
  line-height:1.25;
  color:#334155;
  letter-spacing:0;
  text-transform:none;
  white-space:normal;
  max-width:42mm;
}
.r38-receipt-user span{
  font-size:8px;
  font-weight:800;
  color:#64748b;
  letter-spacing:.45px;
}
.pro-parties:has(>div:only-child){
  grid-template-columns:1fr;
}
.pro-receipt-summary .balance.paid{
  background:#dcfce7;
  color:#166534;
  border-color:#86efac;
}
.r38-paid-stamp{
  width:max-content;
  max-width:90%;
  margin:10px auto 6px;
  padding:5px 18px 4px;
  border:3px double #15803d;
  color:#166534;
  background:#f0fdf4;
  font-size:16px;
  line-height:1;
  font-weight:900;
  letter-spacing:1.2px;
  text-align:center;
  transform:rotate(-3deg);
  transform-origin:center;
}
.pro-receipt.thermal .r38-receipt-user{
  max-width:72mm;
  margin-inline:auto;
  font-size:7.8px!important;
}
.pro-receipt.thermal .r38-paid-stamp{
  margin-top:8px;
  padding:4px 14px 3px;
  font-size:13px;
}
@media print{
  .r38-paid-stamp{
    -webkit-print-color-adjust:exact!important;
    print-color-adjust:exact!important;
  }
}

/* =========================================================
   R3.9-R1 - Clothing mobile, printer and one-page invoice
   ========================================================= */
.r39-clothing-printer-bar{
  margin-bottom:14px;
  padding:12px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.r39-clothing-printer-copy{
  display:flex;
  flex-direction:column;
  min-width:0;
}
.r39-clothing-printer-copy b{
  font-size:13.5px;
}
.r39-clothing-printer-copy span{
  color:var(--slate);
  font-size:11.5px;
  overflow-wrap:anywhere;
}
.r39-clothing-printer-controls{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:7px;
  flex-wrap:wrap;
}
.r39-clothing-printer-controls select{
  width:auto;
  min-width:190px;
}
.r39-clothing-sheet{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:5mm;
  align-items:start;
  width:100%;
  height:194mm;
  overflow:hidden;
}
.r39-clothing-copy{
  position:relative;
  width:100%;
  min-width:0;
  max-height:194mm;
  overflow:hidden;
}
.r39-clothing-fit{
  width:100%;
  will-change:transform;
}
.r39-clothing-fit .clothing-invoice-shell{
  width:100%;
  max-width:none;
  margin:0;
}
@media print{
  .r39-clothing-sheet,
  .r39-clothing-copy,
  .r39-clothing-fit,
  .r39-clothing-fit .clothing-invoice-shell,
  .r39-clothing-fit .paper{
    break-inside:avoid!important;
    page-break-inside:avoid!important;
  }
}

@media(max-width:900px){
  body.biz-clothing .topbar{
    gap:8px;
  }
  body.biz-clothing .r39-clothing-printer-bar{
    align-items:flex-start;
    flex-direction:column;
  }
  body.biz-clothing .r39-clothing-printer-controls{
    width:100%;
    justify-content:flex-start;
  }
}

@media(max-width:760px){
  body.biz-clothing #app{
    display:block;
    width:100%;
    min-height:100dvh;
  }
  body.biz-clothing aside{
    position:relative;
    top:auto;
    width:100%;
    height:auto;
  }
  body.biz-clothing main{
    width:100%;
    min-width:0;
  }
  body.biz-clothing .topbar{
    position:sticky;
    top:0;
    z-index:38;
    align-items:stretch;
  }
  body.biz-clothing .topbar>div:first-child{
    flex:1 1 100%;
  }
  body.biz-clothing .topbar>.chip,
  body.biz-clothing .topbar>.btn{
    flex:1 1 calc(50% - 6px);
    min-height:42px;
  }
  body.biz-clothing .wrap{
    padding:9px;
  }
  body.biz-clothing .grid.g4{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
  }
  body.biz-clothing .tile{
    min-height:104px;
    padding:11px 12px;
  }
  body.biz-clothing .tile .v{
    font-size:19px;
  }
  body.biz-clothing #saleGrid{
    display:flex!important;
    flex-direction:column;
    gap:10px!important;
  }
  body.biz-clothing #saleGrid>div{
    width:100%;
    min-width:0;
  }
  body.biz-clothing #saleGrid>div:last-child{
    position:static!important;
    top:auto!important;
  }
  body.biz-clothing .r39-clothing-printer-bar{
    margin-bottom:10px;
    border-radius:9px;
  }
  body.biz-clothing .r39-clothing-printer-controls{
    display:grid;
    grid-template-columns:1fr 1fr;
  }
  body.biz-clothing .r39-clothing-printer-controls select{
    width:100%;
    min-width:0;
    grid-column:1/-1;
  }
  body.biz-clothing .r39-clothing-printer-controls .btn{
    width:100%;
  }
  body.biz-clothing #itemsTbl{
    min-width:720px;
  }
  body.biz-clothing .r39-mobile-card-table{
    min-width:0!important;
    width:100%;
    border-collapse:separate;
    border-spacing:0;
  }
  body.biz-clothing .r39-mobile-card-table thead{
    display:none;
  }
  body.biz-clothing .r39-mobile-card-table tbody{
    display:grid;
    gap:9px;
    width:100%;
  }
  body.biz-clothing .r39-mobile-card-table tr{
    display:block;
    width:100%;
    border:1px solid var(--rule);
    border-radius:10px;
    background:#fff;
    box-shadow:0 2px 10px rgba(15,23,42,.05);
    overflow:hidden;
  }
  body.biz-clothing .r39-mobile-card-table td{
    display:grid;
    grid-template-columns:minmax(96px,38%) minmax(0,62%);
    gap:10px;
    align-items:start;
    width:100%;
    min-height:38px;
    padding:8px 10px;
    border-bottom:1px solid #eef1f6;
    text-align:start!important;
    white-space:normal;
    overflow-wrap:anywhere;
  }
  body.biz-clothing .r39-mobile-card-table td:last-child{
    border-bottom:0;
  }
  body.biz-clothing .r39-mobile-card-table td::before{
    content:attr(data-label);
    color:var(--slate);
    font-size:11px;
    font-weight:750;
    line-height:1.35;
    text-align:start;
  }
  body.biz-clothing .r39-mobile-card-table td.r39-mobile-actions-cell{
    display:block;
  }
  body.biz-clothing .r39-mobile-card-table td.r39-mobile-actions-cell::before{
    display:none;
  }
  body.biz-clothing .r39-mobile-card-table td.r39-mobile-actions-cell>.row{
    width:100%;
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:6px!important;
  }
  body.biz-clothing .r39-mobile-card-table td.r39-mobile-actions-cell .btn,
  body.biz-clothing .r39-mobile-card-table td.r39-mobile-actions-cell .icobtn{
    width:100%;
    min-width:0;
    min-height:40px;
    justify-content:center;
  }
  body.biz-clothing .r39-mobile-card-table input[type=checkbox]{
    min-width:22px;
    min-height:22px;
  }
  body.biz-clothing .modal.wide .tblwrap{
    overflow-x:auto;
  }
  body.biz-clothing .modal.wide .tblwrap table:not(.r39-mobile-card-table){
    min-width:560px;
  }
  body.biz-clothing .card>.hd,
  body.biz-clothing .row{
    gap:7px;
  }
  body.biz-clothing .row>.spacer{
    display:none;
  }
  body.biz-clothing .row>.btn{
    flex:1 1 140px;
  }
  body.biz-clothing .settings-layout{
    column-count:1!important;
  }
}

@media(max-width:430px){
  body.biz-clothing .grid.g4{
    grid-template-columns:1fr;
  }
  body.biz-clothing .topbar>.chip,
  body.biz-clothing .topbar>.btn{
    flex-basis:100%;
  }
  body.biz-clothing .r39-clothing-printer-controls{
    grid-template-columns:1fr;
  }
  body.biz-clothing .r39-clothing-printer-controls select{
    grid-column:auto;
  }
  body.biz-clothing .r39-mobile-card-table td{
    grid-template-columns:1fr;
    gap:3px;
  }
  body.biz-clothing .r39-mobile-card-table td.r39-mobile-actions-cell>.row{
    grid-template-columns:1fr;
  }
}
