/* Lua POS app mockups. Loaded after ../assets/lua.css.
   The page shows the installed Windows app in a window, 1366x768 app area, on a desk background. */

html, body { height: 100%; }
body { background: #CFC9C1; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.num, .money { font-variant-numeric: tabular-nums lining-nums; }

/* ---------- desk + window ---------- */
.desk { position: fixed; inset: 32px 0 0 0; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(1200px 700px at 30% 20%, rgba(255,255,255,.35), transparent 60%),
    radial-gradient(900px 600px at 80% 90%, rgba(120,104,86,.18), transparent 60%),
    linear-gradient(160deg, #D9D4CD 0%, #CBC4BB 100%); }
.win { width: 1366px; border-radius: 8px; overflow: hidden; background: var(--espresso);
  box-shadow: 0 0 0 1px rgba(0,0,0,.35), 0 30px 80px rgba(40,30,20,.35), 0 8px 20px rgba(40,30,20,.2); }
.titlebar { height: 32px; display: flex; align-items: center; background: #14120F; color: #CFC6BA;
  font: 400 12px/1 'Segoe UI', var(--sans); user-select: none; }
.titlebar img { height: 16px; margin: 0 8px 0 12px; }
.titlebar .tt { flex: 1; letter-spacing: .01em; }
.caps { display: flex; height: 100%; }
.caps span { width: 46px; display: grid; place-items: center; }
.caps span:hover { background: rgba(255,255,255,.08); }
.caps span.x:hover { background: #C42B1C; color: #fff; }
.caps svg { width: 10px; height: 10px; stroke: currentColor; fill: none; stroke-width: 1; }

.app { width: 1366px; height: 768px; display: flex; flex-direction: column; background: var(--cream); position: relative; overflow: hidden; }

/* ---------- app header ---------- */
.ahead { height: 56px; flex: none; display: flex; align-items: center; gap: 18px; padding: 0 16px 0 0;
  background: var(--espresso); color: var(--cream); border-bottom: 1px solid #2E2923; }
.ahead .brand { width: 80px; height: 56px; display: grid; place-items: center; flex: none; }
.ahead .brand img { height: 30px; }
.ahead .till { display: flex; flex-direction: column; gap: 3px; padding-left: 2px; }
.ahead .till b { font: 500 15px/1 var(--sans); }
.ahead .till small, .ahead .who small, .ahead .clock small { font: 400 12px/1 var(--sans); color: #A99E90; }
.ahead .grow { flex: 1; }
.ahead .who { display: flex; align-items: center; gap: 10px; padding-right: 6px; }
.ahead .who > span:last-child { display: flex; flex-direction: column; gap: 4px; }
.ahead .who b { font: 500 14px/1 var(--sans); }
.av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--espresso-3); color: var(--gold); font: 500 13px/1 var(--sans); letter-spacing: .04em; }
.ahead .clock { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 70px; }
.ahead .clock b { font: 500 17px/1 var(--sans); font-variant-numeric: tabular-nums; }
.ahead .sep { width: 1px; height: 28px; background: #3A342C; }

/* connection chip */
.conn { display: inline-flex; align-items: center; gap: 9px; height: 36px; padding: 0 14px 0 12px; border-radius: 18px;
  font: 500 13px/1 var(--sans); text-decoration: none; white-space: nowrap; border: 1px solid transparent; }
.conn .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.conn--online { background: rgba(111,160,122,.14); color: #B9D8BF; border-color: rgba(111,160,122,.32); }
.conn--online .dot { background: #7DBA8A; box-shadow: 0 0 0 3px rgba(125,186,138,.18); }
.conn--offline { background: rgba(214,160,74,.16); color: #F0C98A; border-color: rgba(214,160,74,.45); }
.conn--offline .dot { background: #E2A54B; box-shadow: 0 0 0 3px rgba(226,165,75,.2); }
.conn--syncing { background: rgba(200,168,122,.14); color: #E6D2AE; border-color: rgba(200,168,122,.4); }
.conn--syncing .spin { width: 13px; height: 13px; border-radius: 50%; border: 2px solid rgba(230,210,174,.3); border-top-color: #E6D2AE; animation: spin 1s linear infinite; }
.conn:hover { filter: brightness(1.12); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- body + rail ---------- */
.abody { flex: 1; display: flex; min-height: 0; }
.rail { width: 80px; flex: none; background: var(--espresso); display: flex; flex-direction: column; align-items: center;
  padding: 10px 0 12px; gap: 4px; }
.rail a { position: relative; width: 66px; height: 62px; border-radius: 12px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; color: #A99E90; text-decoration: none; font: 400 11.5px/1 var(--sans); }
.rail a:hover { color: var(--cream); background: #26221D; }
.rail a.on { color: var(--gold); background: #2A251F; }
.rail a.on::before { content: ''; position: absolute; left: -7px; top: 16px; bottom: 16px; width: 3px; border-radius: 2px; background: var(--gold); }
.rail .badge { position: absolute; top: 7px; right: 12px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--blush); color: var(--espresso); font: 600 11px/18px var(--sans); text-align: center; }
.rail .badge.muted { background: #4A4239; color: #CFC6BA; }
.rail .gap { flex: 1; }
.screen { flex: 1; min-width: 0; min-height: 0; position: relative; display: flex; }

/* ---------- icons ---------- */
.ic { flex: none; display: block; }

/* ---------- common controls ---------- */
.btn { height: 48px; padding: 0 20px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; font: 500 15px/1 var(--sans);
  text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: var(--taupe); background: var(--paper); }
.btn-primary { background: var(--espresso); color: var(--cream); border-color: var(--espresso); }
.btn-primary:hover { background: var(--espresso-3); border-color: var(--espresso-3); }
.btn-gold { background: var(--gold); color: var(--espresso); border-color: var(--gold); }
.btn-gold:hover { background: #D2B486; border-color: #D2B486; }
.btn-quiet { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-quiet:hover { background: rgba(28,25,20,.05); border-color: transparent; }
.btn-lg { height: 64px; font-size: 18px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; }
.btn-danger { color: var(--bad); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.muted { color: var(--ink-3); }
.ink2 { color: var(--ink-2); }
.lbl { font: 400 13px/1.2 var(--sans); color: var(--ink-3); }
.h1 { font: 500 30px/1.1 var(--serif); margin: 0; letter-spacing: -.005em; }
.h2 { font: 500 22px/1.15 var(--serif); margin: 0; }
.h3 { font: 500 16px/1.2 var(--sans); margin: 0; }
.serifnum { font-family: var(--serif); font-variant-numeric: lining-nums tabular-nums; }

.tag { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 12px;
  font: 500 12px/1 var(--sans); white-space: nowrap; background: var(--sand); color: var(--ink-2); }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.bad { background: var(--bad-bg); color: var(--bad); }
.tag.info { background: var(--info-bg); color: var(--info); }
.tag.gold { background: #F1E6D3; color: var(--gold-deep); }

.seg { display: inline-flex; background: #EDE5DA; border-radius: 12px; padding: 4px; gap: 4px; }
.seg button, .seg a { height: 44px; padding: 0 18px; border: 0; border-radius: 9px; background: transparent; font: 500 14.5px/1 var(--sans);
  color: var(--ink-2); display: inline-flex; align-items: center; gap: 8px; text-decoration: none; white-space: nowrap; }
.seg .on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

.field { height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--ink-3); }
.field input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; font: 400 16px/1 var(--sans); color: var(--ink); }
.field input::placeholder { color: var(--ink-3); }
.field kbd { font: 500 11.5px/1 var(--sans); padding: 5px 7px; border-radius: 6px; background: var(--cream); color: var(--ink-3); border: 1px solid var(--line); }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); overflow: hidden; }
.stepper button { width: 44px; height: 44px; border: 0; background: transparent; display: grid; place-items: center; color: var(--ink-2); }
.stepper button:hover { background: var(--paper); }
.stepper b { min-width: 30px; text-align: center; font: 500 16px/1 var(--sans); font-variant-numeric: tabular-nums; }

.check { width: 26px; height: 26px; border-radius: 7px; border: 1.5px solid var(--line-2); display: grid; place-items: center; flex: none; background: var(--surface); color: transparent; }
.check.on { background: var(--espresso); border-color: var(--espresso); color: var(--cream); }

.toggle { width: 52px; height: 30px; border-radius: 15px; background: var(--line-2); position: relative; flex: none; border: 0; }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); transition: left .15s; }
.toggle.on { background: var(--ok); }
.toggle.on::after { left: 25px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chipbtn { height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--line-2); background: var(--surface);
  font: 400 14.5px/1 var(--sans); color: var(--ink-2); display: inline-flex; align-items: center; gap: 8px; }
.chipbtn.on { background: var(--espresso); border-color: var(--espresso); color: var(--cream); }

/* product thumb */
.thumb { background: linear-gradient(160deg, #EADFD2, var(--sand)); border-radius: 10px; display: grid; place-items: center; overflow: hidden; flex: none; position: relative; }
.thumb.blush { background: linear-gradient(160deg, var(--blush-soft), #E6CFC6); }
.thumb img { width: 100%; height: 100%; object-fit: contain; padding: 8%; }
.thumb .ph { font: 500 26px/1 var(--serif); color: var(--gold-deep); opacity: .55; }
.sw { width: 14px; height: 14px; border-radius: 50%; display: inline-block; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }

/* keypad */
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.keypad button { height: 64px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  font: 400 24px/1 var(--sans); color: var(--ink); font-variant-numeric: tabular-nums; display: grid; place-items: center; }
.keypad button:hover { background: var(--paper); }
.keypad button:active { background: var(--sand); }
.keypad button.fn { font-size: 15px; color: var(--ink-2); background: transparent; }

/* scroll areas */
.scroll { overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }

/* ---------- sell screen ---------- */
.sell { flex: 1; display: flex; min-width: 0; }
.catalog { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 18px 20px 0; gap: 14px; position: relative; }
.cat-top { display: flex; gap: 12px; }
.cat-top .field { flex: 1; }
.cat-top .scan { width: 300px; flex: none; color: var(--gold-deep); background: #FBF6EE; border-color: #E6D6BE; }
.tabs { display: flex; gap: 6px; }
.tabs a { height: 44px; padding: 0 18px; border-radius: 22px; display: inline-flex; align-items: center; text-decoration: none;
  font: 400 15px/1 var(--sans); color: var(--ink-2); border: 1px solid transparent; }
.tabs a:hover { background: rgba(28,25,20,.04); }
.tabs a.on { background: var(--espresso); color: var(--cream); }
.tabs a span { margin-left: 8px; font-size: 12.5px; opacity: .6; }
.grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; align-content: start; padding: 2px 2px 18px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 8px; display: flex; flex-direction: column;
  gap: 8px; text-align: left; position: relative; min-width: 0; }
.tile:hover { border-color: var(--taupe); box-shadow: var(--shadow-1); }
.tile .thumb { height: 104px; }
.tile .nm { font: 500 14px/1.25 var(--sans); padding: 0 4px; height: 35px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tile .row { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 2px; gap: 6px; }
.tile .pr { font: 500 15px/1 var(--sans); font-variant-numeric: tabular-nums; }
.tile .st { font: 400 12px/1 var(--sans); color: var(--ink-3); white-space: nowrap; }
.tile .st.low { color: var(--warn); }
.tile .st.out { color: var(--bad); }
.tile.sold { opacity: .55; }
.tile .vars { position: absolute; top: 14px; left: 14px; display: flex; gap: 3px; }
.tile .vars .sw { width: 10px; height: 10px; box-shadow: 0 0 0 1.5px #fff; }
.tile.picked { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(200,168,122,.5); }

/* variant popover */
.scrim { position: absolute; inset: 0; background: rgba(28,25,20,.18); z-index: 5; }
.pop { position: absolute; z-index: 6; width: 400px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-3); padding: 18px; border: 1px solid var(--line); }
.pop::before { content: ''; position: absolute; left: -8px; top: 52px; width: 16px; height: 16px; background: var(--surface); transform: rotate(45deg); border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pop-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.pop-head .thumb { width: 64px; height: 64px; }
.opts { display: grid; gap: 8px; margin-bottom: 14px; }
.opt { height: 56px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); display: flex; align-items: center; gap: 12px; padding: 0 14px; text-align: left; }
.opt .sw { width: 26px; height: 26px; }
.opt b { font: 500 15px/1 var(--sans); flex: 1; }
.opt.on { border-color: var(--espresso); box-shadow: inset 0 0 0 1px var(--espresso); background: var(--paper); }
.opt.dis { opacity: .5; }

/* cart panel */
.cart { width: 400px; flex: none; background: var(--surface); border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.cart-head { height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px 0 20px; border-bottom: 1px solid var(--line); flex: none; }
.cart-head .h2 { font-size: 22px; }
.cart-lines { flex: 1; min-height: 0; padding: 6px 0; }
.cl { display: flex; gap: 12px; padding: 12px 20px; align-items: center; }
.cl + .cl { border-top: 1px solid var(--line); }
.cl .thumb { width: 52px; height: 52px; }
.cl .info { flex: 1; min-width: 0; }
.cl .info b { display: block; font: 500 14.5px/1.25 var(--sans); }
.cl .info small { display: flex; align-items: center; gap: 6px; font: 400 13px/1.2 var(--sans); color: var(--ink-3); margin-top: 4px; }
.cl .amt { text-align: right; font: 500 15px/1.2 var(--sans); font-variant-numeric: tabular-nums; }
.cl .amt s { display: block; font-size: 12.5px; color: var(--ink-3); font-weight: 400; }
.cart-empty { padding: 26px 24px; color: var(--ink-3); font: 400 14px/1.5 var(--sans); text-align: center; }
.cart-foot { border-top: 1px solid var(--line); padding: 14px 20px 18px; flex: none; background: var(--paper); }
.tot { display: flex; justify-content: space-between; font: 400 14px/1 var(--sans); color: var(--ink-2); padding: 5px 0; font-variant-numeric: tabular-nums; }
.tot.big { color: var(--ink); align-items: baseline; padding-top: 10px; }
.tot.big b { font: 500 34px/1 var(--serif); font-variant-numeric: lining-nums tabular-nums; }
.tot.big span { font: 500 16px/1 var(--sans); }
.paybtn { margin-top: 12px; display: flex; gap: 8px; }
.paybtn .btn-lg { flex: 1; justify-content: space-between; padding: 0 22px; }

/* ---------- banners ---------- */
.banner { display: flex; gap: 14px; align-items: flex-start; padding: 14px 18px; border-radius: 14px; }
.banner.offline { background: #FBF1E0; border: 1px solid #EED6AE; color: #6E4E1E; }
.banner.ok { background: var(--ok-bg); border: 1px solid #CFE0D2; color: #34573E; }
.banner .ic { margin-top: 1px; }
.banner b { font: 500 15.5px/1.35 var(--sans); }
.banner p { margin: 4px 0 0; font: 400 13.5px/1.45 var(--sans); }

/* ---------- generic screen layout ---------- */
.pagepad { flex: 1; min-width: 0; padding: 22px 24px; display: flex; flex-direction: column; gap: 16px; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.pagehead p { margin: 6px 0 0; color: var(--ink-3); font: 400 14px/1.3 var(--sans); }
.cols { display: flex; gap: 16px; flex: 1; min-height: 0; }

.kv { display: flex; justify-content: space-between; align-items: baseline; padding: 9px 0; font: 400 14px/1.3 var(--sans); gap: 12px; font-variant-numeric: tabular-nums; }
.kv + .kv { border-top: 1px solid var(--line); }
.kv span:first-child { color: var(--ink-2); }
.kv b { font-weight: 500; }

table.t { width: 100%; border-collapse: collapse; font: 400 14px/1.25 var(--sans); font-variant-numeric: tabular-nums; }
table.t th { text-align: left; font: 400 12.5px/1 var(--sans); color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; }
table.t td { padding: 0 12px; height: 54px; border-bottom: 1px solid var(--line); }
table.t tr.sel td { background: #FBF4E9; }
table.t tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
table.t .r { text-align: right; }

/* receipt paper */
.paper { width: 300px; background: #FFFEFB; color: #222; font: 400 11.5px/1.45 var(--sans); padding: 18px 18px 26px; position: relative;
  box-shadow: 0 10px 30px rgba(28,25,20,.14); font-variant-numeric: tabular-nums; }
.paper::after { content: ''; position: absolute; left: 0; right: 0; bottom: -8px; height: 8px;
  background: linear-gradient(-45deg, transparent 6px, #FFFEFB 0) 0 0/12px 8px repeat-x, linear-gradient(45deg, transparent 6px, #FFFEFB 0) 0 0/12px 8px repeat-x; }
.paper .c { text-align: center; }
.paper .logo { height: 40px; display: block; margin: 0 auto 4px; }
.paper hr { border: 0; border-top: 1px dashed #BDB3A6; margin: 8px 0; }
.paper .ln { display: flex; justify-content: space-between; gap: 10px; }
.paper .sub { color: #6B6258; padding-left: 10px; }
.paper .big { font: 600 14px/1.4 var(--sans); }
.paper .bars { height: 34px; margin: 8px 14px 2px; background: repeating-linear-gradient(90deg, #222 0 1px, transparent 1px 3px, #222 3px 5px, transparent 5px 6px, #222 6px 7px, transparent 7px 10px); }
.paper .ar { font-size: 14px; }

/* small utility */
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.grow { flex: 1; }
.stack { display: flex; flex-direction: column; }
.divider { height: 1px; background: var(--line); margin: 4px 0; }
.dot-ok, .dot-warn { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot-ok { background: var(--ok); } .dot-warn { background: var(--warn); }
.powered { font: 400 11px/1 var(--sans); color: #8D8274; letter-spacing: .02em; }
.powered b { font-weight: 500; color: #B3A797; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.paybtn .btn-lg.sq { flex: none; width: 64px; padding: 0; justify-content: center; }
.h1, .h2, .serifnum { font-variant-numeric: lining-nums tabular-nums; }
/* review round 2 */
.conn { height: 44px; border-radius: 22px; }
.rail a { font-size: 13px; height: 66px; }
.chipbtn { height: 48px; }
.bn { width: 50px; height: 28px; border-radius: 4px; flex: none; display: grid; place-items: center; font: 600 10.5px/1 var(--sans); font-style: normal; color: rgba(28,25,20,.72); box-shadow: inset 0 0 0 1px rgba(28,25,20,.14), inset 0 0 0 3px rgba(255,255,255,.25); letter-spacing: .02em; }
.check { width: 32px; height: 32px; border-radius: 8px; }
.rounding { font: 400 12.5px/1.3 var(--sans); color: var(--ink-3); }
[hidden] { display: none !important; }
.kv b { white-space: nowrap; }
