/* Store Tills: the till screens, head office and the audit. The frame is /kit/kit.css. */

/* Bar widths (no inline styles under the content policy) */
.w-0 { width: 0; } .w-10 { width: 10%; } .w-20 { width: 20%; } .w-30 { width: 30%; } .w-40 { width: 40%; } .w-50 { width: 50%; }
.w-60 { width: 60%; } .w-70 { width: 70%; } .w-80 { width: 80%; } .w-90 { width: 90%; } .w-100 { width: 100%; }

/* ---- Line status ---- */
.line-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 12px 5px 5px; font: 700 13.5px/1 var(--display); white-space: nowrap; }
.line-pill .glyph { width: 24px; height: 24px; background: #fff; border-radius: 50%; padding: 1px; }
.line-pill.up { background: var(--green-soft); color: var(--green-ink); }
.line-pill.down { background: var(--amber-ink); color: #fff; }
.desk-actions { align-items: center; }
/* The kit's .desk clips with overflow: hidden, which stops sticky children (basket, pay bar). clip keeps the corners without that. */
.stage .desk { overflow: clip; }

/* ---- Till: point of sale ---- */
.offline-bar, .closed-bar { display: flex; align-items: center; gap: 12px; border-radius: 16px; padding: 10px 14px; flex-wrap: wrap; }
.offline-bar { background: var(--amber-ink); color: #fff; }
.closed-bar { background: var(--ink); color: #fff; }
.offline-bar .glyph, .closed-bar .glyph { background: #fff; border-radius: 10px; padding: 3px; }
.offline-bar div, .closed-bar div { flex: 1; min-width: 170px; display: flex; flex-direction: column; }
.offline-bar b, .closed-bar b { font: 700 17px/1.2 var(--display); }
.offline-bar span, .closed-bar span { font-size: 13.5px; opacity: .92; }
.ob-count { font: 700 14px/1 var(--display); background: rgba(255, 255, 255, .18); border-radius: 999px; padding: 8px 12px; white-space: nowrap; }

.pos { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: 16px; align-items: start; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.prod { position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 4px; min-height: 108px; padding: 12px; border-radius: 16px; border: 2px solid transparent; text-align: left; cursor: pointer; color: var(--ink); }
.prod:hover { border-color: color-mix(in srgb, var(--ink) 22%, transparent); }
.prod.on { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 20%, transparent); }
.prod[disabled] { opacity: .45; cursor: not-allowed; }
.prod-name { font: 700 15px/1.2 var(--display); padding-right: 30px; }
.prod-price { font: 800 21px/1 var(--display); font-variant-numeric: tabular-nums; }
.prod small { font-size: 12px; color: var(--ink-soft); }
.prod-qty { position: absolute; top: 8px; right: 8px; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px; background: var(--blue); color: #fff; font: 700 14px/26px var(--display); font-style: normal; text-align: center; }
.p-bread { background: #F6E7CF; }
.p-milk { background: #E6F0FD; }
.p-apples { background: #DCF5E2; }
.p-eggs { background: #FBF1DA; }
.p-coffee { background: #EFE3D8; }
.p-cheese { background: #FBEFC2; }
.p-water { background: #DFF0F8; }
.p-wine { background: #F2E4EC; }

.pos-side { background: var(--card); border-radius: 20px; box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 12px; position: sticky; top: 70px; }
.pos-side-head { display: flex; align-items: center; gap: 8px; }
.pos-side-head strong { font: 700 18px/1.2 var(--display); }
.pos-side-head span { color: var(--ink-faint); font-size: 14px; flex: 1; }
.link-btn { border: 0; background: transparent; color: var(--blue); font: 600 14px/1 var(--display); cursor: pointer; min-height: 40px; padding: 0 6px; }
.basket li { padding: 6px 0; gap: 10px; }
.minus { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 1.5px solid var(--rule); background: var(--card); font: 700 20px/1 var(--display); cursor: pointer; }
.minus:hover { border-color: var(--ink-faint); }
.basket-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 10px; text-align: center; color: var(--ink-faint); border: 1.5px dashed var(--rule); border-radius: 14px; font-weight: 600; }
.basket-empty small { font-size: 12.5px; font-weight: 400; }
.pos-total { display: flex; align-items: baseline; justify-content: space-between; border-top: 2px solid var(--ink); padding-top: 12px; }
.pos-total span { font: 700 15px/1 var(--display); color: var(--ink-soft); }
.pos-total b { font: 800 34px/1 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.card-note { font: 600 13.5px/1.35 var(--display); color: var(--amber-ink); background: var(--amber-soft); border-radius: 10px; padding: 8px 10px; }
.card-note.over { color: var(--red-ink); background: var(--red-soft); }
.pay { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pay-btn { min-height: 56px; font-size: 18px; border-radius: 16px; }

/* Copies of the store record */
.copies { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: var(--card); border-radius: 16px; padding: 10px 12px; box-shadow: var(--shadow); }
.panel .copies { box-shadow: none; padding: 0; }
.copies-title { display: inline-flex; align-items: center; gap: 8px; font: 700 14px/1 var(--display); margin-right: auto; }
.copy { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 7px 11px; font: 600 13px/1 var(--display); white-space: nowrap; }
.copy code { font: 600 12px/1 var(--mono); }
.copy.eq { background: var(--green-soft); color: var(--green-ink); }
.copy.eq::before { content: "\2713"; font-weight: 800; }
.copy.behind { background: var(--amber-soft); color: var(--amber-ink); }

/* ---- Head office ---- */
.hero-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.hero-card.amber { background: var(--amber-ink); }
.hero-card.red { background: var(--red-ink); }
.ho-banner { display: flex; align-items: center; gap: 14px; border-radius: 18px; padding: 14px 16px; flex-wrap: wrap; }
.ho-banner.up { background: var(--green-soft); }
.ho-banner.down { background: var(--amber-soft); }
.ho-banner .glyph { background: #fff; border-radius: 12px; padding: 4px; }
.ho-banner .grow { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 2px; }
.ho-banner b { font: 700 18px/1.25 var(--display); }
.ho-banner.up b { color: var(--green-ink); }
.ho-banner.down b { color: var(--amber-ink); }
.ho-banner span { font-size: 13.5px; color: var(--ink-soft); }

.arrivals { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.arrivals li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--green-soft); }
.arrivals .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.arrivals strong { font: 700 14.5px/1.25 var(--display); }
.arrivals .grow span { font-size: 13px; color: var(--ink-soft); }
.arr-n { font: 600 12px/1 var(--mono); color: var(--green-ink); min-width: 30px; }
@media (prefers-reduced-motion: no-preference) {
  .arrivals.play li { animation: land .55s cubic-bezier(.2, 0, 0, 1) both; }
  .arrivals.play .d1 { animation-delay: .3s; }
  .arrivals.play .d2 { animation-delay: .6s; }
  .arrivals.play .d3 { animation-delay: .9s; }
  .arrivals.play .d4 { animation-delay: 1.2s; }
  .arrivals.play .d5 { animation-delay: 1.5s; }
  .arrivals.play .d6 { animation-delay: 1.8s; }
  .arrivals.play .d7 { animation-delay: 2.1s; }
  .arrivals.play .d8 { animation-delay: 2.4s; }
  .arrivals.play .d9 { animation-delay: 2.7s; }
  @keyframes land { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
}

.store-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.store-head .grow { flex: 1; min-width: 150px; }
.till-rows { display: flex; flex-direction: column; gap: 8px; }
.till-row { display: grid; grid-template-columns: auto 110px minmax(60px, 1fr) auto; align-items: center; gap: 12px; padding: 10px 12px; background: var(--paper); border-radius: 14px; }
.tr-name { display: flex; flex-direction: column; }
.tr-name strong { font: 700 15px/1.2 var(--display); }
.tr-name span { font-size: 13px; color: var(--ink-faint); }
.pay-rows .bar { margin-top: 6px; }

.agree-bar { display: flex; align-items: center; gap: 12px; border-radius: 16px; padding: 12px 16px; }
.agree-bar b { font: 700 16px/1.3 var(--display); }
.agree-bar .glyph { background: #fff; border-radius: 10px; padding: 3px; }
.agree-bar.ok { background: var(--green-soft); color: var(--green-ink); }
.agree-bar.bad { background: var(--red-soft); color: var(--red-ink); }
.close-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.close-row .grow { flex: 1; min-width: 190px; display: flex; flex-direction: column; }
.close-row strong { font: 700 17px/1.25 var(--display); }
.close-row span { font-size: 13.5px; color: var(--ink-faint); }

/* ---- Audit ---- */
.copy-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.copy-card { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; border: 2px solid transparent; min-width: 0; }
.copy-card.eq { border-color: color-mix(in srgb, var(--green) 55%, transparent); }
.copy-card.behind { border-color: color-mix(in srgb, var(--amber-ink) 35%, transparent); }
.copy-card strong { font: 700 16px/1.2 var(--display); }
.copy-card .hash { font: 700 22px/1 var(--mono); letter-spacing: .02em; }
.copy-card span:not(.chip) { font-size: 13px; color: var(--ink-faint); }
.log-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.log-n { font: 600 12px/1 var(--mono); color: var(--ink-faint); min-width: 32px; }
.log li { padding-left: 10px; padding-right: 10px; }
.log li.ev { background: var(--paper-2); border-radius: 10px; padding-top: 8px; padding-bottom: 8px; border-top: 0; margin: 3px 0; }
.log li.ev.down { background: var(--amber-soft); }
.log li.ev.up { background: var(--green-soft); }
.log li.ev + li { border-top: 0; }

/* Phones: a pay bar that stays at the bottom while scanning */
.pos-mini { display: none; }

/* ---- Narrower screens ---- */
@media (max-width: 1100px) {
  .copy-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .pos { grid-template-columns: 1fr; }
  .pos-side { position: static; }
  .pos-mini { display: flex; align-items: center; gap: 8px; position: sticky; bottom: 10px; z-index: 5; background: var(--ink); color: #fff; border-radius: 18px; padding: 8px 8px 8px 14px; box-shadow: 0 10px 30px rgba(16, 22, 33, .25); }
  .pos-mini div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
  .pos-mini span { font-size: 12.5px; opacity: .85; }
  .pos-mini b { font: 800 22px/1.1 var(--display); font-variant-numeric: tabular-nums; }
  .pos-mini .btn { min-width: 76px; }
}
@media (max-width: 520px) {
  /* The app header: name and status on one row, the nav on its own row below. */
  .stage .desk-top { gap: 10px; }
  .stage .desk-nav { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .stage .desk-actions { margin-left: auto; }
  .hero-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .hero-row > :first-child { grid-column: 1 / -1; }
  .hero-card { padding: 14px; }
  .hero-card .big { font-size: 28px; }
  .pos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .prod { min-height: 92px; padding: 10px; }
  .prod-price { font-size: 19px; }
  .till-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .till-row .num { grid-column: 3; grid-row: 1; }
  .till-row .bar { grid-column: 1 / -1; grid-row: 2; }
  .copy-card { padding: 12px; }
  .copy-card .hash { font-size: 18px; }
  .ho-banner b { font-size: 16px; }
  .ho-banner .btn, .close-row .btn { flex: 1; }
}
