/* ============================================================
   till.css — main sale screen (exact 1920x1080 layout)
   + lock screen, manager menu, settings, report, close day, history
   ============================================================ */

/* ================= TOP BAR (72px) ================= */
.topbar {
  height: 72px;
  flex: none;
  background: var(--chrome);
  color: var(--chrome-text);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 16px;
  position: relative;
}
.topbar--refund { background: var(--stop); }

.topbar-menu {
  width: 160px; height: 56px;
  font-size: 24px;
  --ic: 28px;
}

.tb-till { font-size: 28px; font-weight: 800; }
.tb-cashier { font-size: 24px; opacity: .8; margin-left: 4px; }

.tb-refund-banner {
  display: none;
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px; font-weight: 800;
  color: #fff;
  white-space: nowrap;
}
.topbar--refund .tb-refund-banner { display: block; }

.tb-clock {
  margin-left: auto;
  display: flex;
  gap: 24px;
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.save-ind {
  display: flex; align-items: center; gap: 10px;
  font-size: 20px; opacity: .9;
}
.save-ind .dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--go);
  display: inline-block;
}
@keyframes savedFlash {
  0% { transform: scale(1); }
  50% { transform: scale(1.6); filter: brightness(1.6); }
  100% { transform: scale(1); }
}
.save-ind.flash .dot { animation: savedFlash 1s ease; }
/* ready for the future backend state */
.save-ind.sync-pending .dot { background: var(--warn); }

/* ================= SALE BODY ================= */
.screen--sale { display: flex; flex-direction: column; background: var(--bg); }

.sale-body {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 16px;
  padding: 16px;
}

.col-left {
  width: 600px; flex: none;
  display: flex; flex-direction: column;
  justify-content: space-between; /* distributes the spare 22px evenly */
}
.col-mid { width: 560px; flex: none; display: flex; flex-direction: column; gap: 16px; }
.col-right { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

/* ---------- amount display (600 x 160) ---------- */
.amount-display {
  height: 160px;
  background: var(--panel);
  border: 3px solid var(--panel-border);
  border-radius: var(--radius);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 28px;
  flex: none;
}
.amount-display .lbl {
  position: absolute; top: 12px; left: 28px;
  font-size: 20px; font-weight: 700; letter-spacing: 1px;
  color: var(--text-muted);
}
.amount-display .amt {
  font-size: 104px; font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.amount-display.empty .amt { color: var(--text-muted); }
.qty-pill {
  position: absolute; left: 28px; top: 50%;
  transform: translateY(-50%);
  font-size: 44px; font-weight: 800;
  background: #EEF2FF; color: var(--key-fn);
  padding: 8px 18px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

/* ---------- keypads ---------- */
.kpad { display: flex; flex-direction: column; gap: 12px; }
.kgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.kpad--sale .kgrid { grid-template-rows: repeat(4, 150px); }
.kpad--sale .key-num { font-size: 64px; --ic: 40px; }
.kpad--sale .key-bk { --ic: 40px; }
.kpad--sale .key-clear { height: 130px; font-size: 40px; --ic: 44px; }

.kpad--sm .kgrid { grid-template-rows: repeat(4, 100px); }
.kpad--sm .key-num { font-size: 48px; --ic: 32px; }

.key-num { font-variant-numeric: tabular-nums; }
.key-bk .bk-label { font-size: 22px; font-weight: 800; }
.key-clear { width: 100%; }

/* ---------- category (ADD) keys, 424px tall ---------- */
.cat-keys { height: 424px; flex: none; display: grid; gap: 12px; }
.cat-keys.c1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.cat-keys.c2 { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
.cat-keys.c3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.cat-keys.c3 > .btn:first-child { grid-column: 1 / -1; }
.cat-keys.c4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }

.btn-cat .btn-label { line-height: 1.05; }
.cat-keys.c1 .btn-cat { --ic: 72px; }
.cat-keys.c1 .btn-cat .btn-label { font-size: 56px; }
.cat-keys.c2 .btn-cat .btn-label { font-size: 48px; }
.cat-keys.c3 .btn-cat .btn-label,
.cat-keys.c4 .btn-cat .btn-label { font-size: 40px; }
.cat-keys.c2 .btn-cat, .cat-keys.c3 .btn-cat, .cat-keys.c4 .btn-cat { --ic: 44px; }
.cat-vat { font-size: 22px; font-weight: 700; opacity: .85; letter-spacing: .5px; }

/* ---------- function keys 2x4 (274 x 125) ---------- */
.fn-keys {
  height: 536px; flex: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(4, 1fr);
  gap: 12px;
}
.fn-keys .btn { font-size: 26px; --ic: 40px; }

/* ---------- item list ---------- */
.item-list {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.il-head {
  height: 56px; flex: none;
  background: #F1F5F9;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  color: var(--text-muted);
  font-size: 22px; font-weight: 800;
  letter-spacing: .5px;
}
.il-body { flex: 1; min-height: 0; }
.il-line {
  height: 84px;
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px 0 14px;
  border-bottom: 2px solid #E2E8F0;
  border-left: 6px solid transparent;
  cursor: pointer;
}
.il-line.selected { background: #FEF3C7; border-left-color: var(--warn); }
.il-line.removed { opacity: .5; pointer-events: none; }
.il-line.removed .il-name, .il-line.removed .il-qty, .il-line.removed .il-total {
  text-decoration: line-through;
  color: var(--text-muted);
}
.il-num {
  width: 44px; height: 44px; flex: none;
  border-radius: 50%;
  background: #E2E8F0; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800;
}
.il-name { font-size: 26px; font-weight: 800; }
.il-qty { font-size: 22px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.il-total {
  margin-left: auto;
  font-size: 40px; font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.il-empty {
  height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 20px;
  color: var(--text-muted);
}
.il-empty .ic { width: 96px; height: 96px; color: #CBD5E1; }
.il-empty .ic svg { width: 100%; height: 100%; }
.il-empty-txt { font-size: 28px; text-align: center; padding: 0 24px; }

/* ---------- totals block (176px) ---------- */
.totals {
  height: 176px; flex: none;
  background: var(--chrome);
  border-radius: var(--radius);
  color: #fff;
  padding: 24px;
  position: relative;
}
.totals--refund { background: var(--stop); }
.totals .t-lbl { font-size: 28px; font-weight: 700; opacity: .8; letter-spacing: 1px; }
.totals .t-amt {
  position: absolute; right: 24px; bottom: 16px;
  font-size: 112px; font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* ---------- pay buttons (340 x 150) ---------- */
.pay-row { height: 150px; flex: none; display: flex; gap: 16px; }
.pay-btn { width: 340px; height: 150px; font-size: 48px; --ic: 52px; }

/* ============================================================
   LOCK / SIGN-ON SCREEN
   ============================================================ */
.screen--lock {
  background: var(--chrome);
  color: #fff;
  display: flex; flex-direction: column;
  align-items: center;
  padding-top: 90px;
}
.lock-shop { font-size: 56px; font-weight: 800; }
.lock-till { font-size: 32px; opacity: .7; margin-top: 8px; }
.lock-clock {
  display: flex; gap: 20px; justify-content: center;
  font-size: 40px; font-weight: 800; margin-top: 16px; font-variant-numeric: tabular-nums;
}
.lock-title { font-size: 36px; font-weight: 800; margin: 56px 0 28px; }
.lock-grid {
  display: grid; grid-template-columns: repeat(4, 360px); gap: 20px;
  justify-content: center;
  padding: 0 60px;
}
.cashier-btn {
  width: 360px; height: 140px;
  background: #fff; color: var(--chrome);
  border: none; border-bottom: 6px solid var(--panel-border);
  border-radius: 18px;
  display: flex; align-items: center; gap: 20px;
  padding: 0 24px;
  cursor: pointer;
  transition: transform 60ms ease, background-color 60ms ease;
}
.cashier-btn:active, .cashier-btn.pressed {
  transform: translateY(4px); border-bottom-width: 2px; background: #E8EDF5;
}
.cashier-init {
  width: 64px; height: 64px; flex: none;
  border-radius: 50%;
  background: #EEF2FF; color: var(--key-fn);
  font-size: 32px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.cashier-name { font-size: 40px; font-weight: 800; text-align: left; }

.lock-pin { display: flex; flex-direction: column; align-items: center; gap: 28px; }
.pin-dots { display: flex; gap: 24px; }
.pin-dot {
  width: 48px; height: 48px; border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, .4);
}
.pin-dot.filled { background: #fff; border-color: #fff; }
.pin-dots.error .pin-dot { border-color: var(--stop); background: var(--stop); }
.lock-msg { font-size: 28px; min-height: 36px; opacity: .9; }
.lock-msg.err { color: #FECACA; font-weight: 700; }

.lock-setup { display: flex; flex-direction: column; align-items: center; gap: 24px; margin-top: 30px; }
.lock-setup .btn { width: 520px; height: 130px; font-size: 40px; --ic: 56px; }
.lock-setup-sub { font-size: 26px; opacity: .8; max-width: 900px; text-align: center; line-height: 1.4; }

/* PIN keypad sizes (160 x 120 keys, 56px digits) */
.kgrid--pin { grid-template-columns: repeat(3, 160px); grid-template-rows: repeat(4, 120px); }
.key-pin { font-size: 56px; --ic: 36px; }
.key-pin .btn-label { font-size: 22px; }
.key-bk .bk-label, .key-pin .bk-label { font-size: 22px; font-weight: 800; letter-spacing: 0; }
.key-pin.key-bk { font-size: 22px; }

/* ============================================================
   MANAGER AREA (shared)
   ============================================================ */
.mgr-topbar { justify-content: flex-start; }
.mgr-topbar .tb-clock { margin-left: auto; }
.mgr-title { font-size: 30px; font-weight: 800; letter-spacing: 1px; }
.topbar-back { width: 160px; height: 56px; font-size: 22px; --ic: 28px; }

.mgr-body {
  flex: 1; min-height: 0;
  padding: 32px 48px;
  display: flex; flex-direction: column; gap: 24px;
}

/* manager menu tiles — fill the space, big touch targets */
.mgr-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 24px;
  width: 100%;
  flex: 1;
  min-height: 0;
}
.mgr-tile { min-height: 0; font-size: 48px; --ic: 112px; border-radius: 24px; }

/* big bottom action row (reports, close day) */
.mgr-actions { display: flex; gap: 24px; justify-content: center; flex: none; padding-bottom: 8px; }
.mgr-actions .btn { min-width: 300px; height: 110px; font-size: 36px; }
.mgr-actions .btn-wide { width: 520px; height: 130px; font-size: 40px; }

/* ---------- X report ---------- */
.rep-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rep-card {
  background: #fff; border: 3px solid var(--panel-border); border-radius: var(--radius);
  padding: 18px 28px;
  display: flex; flex-direction: column; gap: 6px;
}
.rep-card .k { font-size: 24px; font-weight: 700; color: var(--text-muted); }
.rep-card .v { font-size: 56px; font-weight: 800; font-variant-numeric: tabular-nums; }
.rep-card .v small { font-size: 26px; font-weight: 700; color: var(--text-muted); margin-left: 10px; }
.rep-card--big { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; }
.rep-card--big .v { font-size: 88px; }

.rep-section-title { font-size: 30px; font-weight: 800; margin-top: 8px; }
.rep-table { width: 100%; border-collapse: collapse; background: #fff; border: 3px solid var(--panel-border); border-radius: var(--radius); overflow: hidden; }
.rep-table th {
  background: #F1F5F9; color: var(--text-muted);
  font-size: 22px; text-align: left; padding: 10px 24px;
}
.rep-table td { font-size: 28px; padding: 0 24px; height: 72px; border-top: 2px solid #E2E8F0; font-variant-numeric: tabular-nums; }
.rep-table td.num, .rep-table th.num { text-align: right; }
.rep-scroll { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 16px; padding-bottom: 8px; }

/* ---------- close day ---------- */
.cd-step { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; }
.cd-title { font-size: 44px; font-weight: 800; text-align: center; }
.cd-sub { font-size: 32px; color: var(--text-muted); text-align: center; max-width: 1100px; line-height: 1.4; }
.cd-display {
  width: 700px; height: 140px;
  background: #fff; border: 3px solid var(--panel-border); border-radius: 18px;
  display: flex; align-items: center; justify-content: flex-end;
  padding: 0 32px;
  font-size: 88px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.cd-display.empty { color: var(--text-muted); }
.cd-result { display: flex; flex-direction: column; gap: 20px; align-items: center; }
.cd-row { display: flex; gap: 24px; }
.cd-card {
  width: 480px; background: #fff; border: 3px solid var(--panel-border); border-radius: 18px;
  padding: 24px 32px; text-align: center;
}
.cd-card .k { font-size: 26px; color: var(--text-muted); font-weight: 700; }
.cd-card .v { font-size: 64px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 6px; }
.cd-diff { font-size: 96px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cd-diff.ok { color: var(--go); }
.cd-diff.over { color: var(--warn-edge); }
.cd-diff.short { color: var(--stop); }

/* ---------- today's sales history ---------- */
.hist-filters { display: flex; gap: 16px; flex: none; }
.hist-filters .btn { width: 220px; height: 80px; font-size: 26px; }
.hist-list { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.hist-row {
  height: 96px; flex: none;
  background: #fff; border: 3px solid var(--panel-border); border-radius: 14px;
  display: flex; align-items: center; gap: 28px;
  padding: 0 28px; margin-bottom: 12px;
  font-size: 28px;
  cursor: pointer;
}
.hist-row .h-time { font-weight: 800; width: 110px; font-variant-numeric: tabular-nums; }
.hist-row .h-no { width: 170px; color: var(--text-muted); font-weight: 700; }
.hist-row .h-who { flex: 1; }
.hist-chip {
  padding: 8px 18px; border-radius: 999px;
  font-size: 20px; font-weight: 800; letter-spacing: .5px;
  background: #E2E8F0; color: var(--text-muted);
}
.hist-chip.chip-cash { background: #DCFCE7; color: var(--go-edge); }
.hist-chip.chip-card { background: #DBEAFE; color: var(--card-edge); }
.hist-chip.chip-refund, .hist-chip.chip-cancelled { background: #FEE2E2; color: var(--stop-edge); }
.hist-row .h-total { font-size: 40px; font-weight: 800; font-variant-numeric: tabular-nums; }
.hist-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 30px; }

/* ---------- settings ---------- */
.set-body { flex-direction: row; gap: 32px; padding: 32px 48px; }
.set-tabs { display: flex; flex-direction: column; gap: 16px; width: 300px; flex: none; }
.set-tabs .btn { height: 96px; font-size: 28px; --ic: 44px; }
.set-content {
  flex: 1; min-width: 0;
  background: #fff; border: 3px solid var(--panel-border); border-radius: 18px;
  padding: 28px;
  display: flex; flex-direction: column; gap: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.set-content::-webkit-scrollbar { width: 12px; }
.set-content::-webkit-scrollbar-thumb { background: #C9D3E0; border-radius: 6px; }
.set-row { display: flex; flex-direction: column; gap: 8px; }
.set-label { font-size: 24px; font-weight: 800; color: var(--text-muted); letter-spacing: .5px; }
.set-inputs-col { display: flex; flex-direction: column; gap: 12px; }
.set-row-inline { display: flex; gap: 16px; align-items: center; }
.set-hint { font-size: 22px; color: var(--text-muted); }
/* SAVE row always visible, even when the tab content scrolls */
.set-content.has-actions { padding-bottom: 0; }
.set-actions {
  position: sticky; bottom: 0;
  margin: 8px -28px 0;
  padding: 16px 28px 20px;
  background: #fff;
  border-top: 3px solid #E2E8F0;
  border-radius: 0 0 15px 15px;
  display: flex; gap: 24px; justify-content: flex-end;
  flex: none;
  z-index: 2;
}
.set-actions .btn { width: 300px; height: 110px; font-size: 36px; }
/* two-column form layout (Shop tab): shop details left, receipt right */
.set-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
.set-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.set-col .set-title2 { margin-bottom: 4px; }
.set-err { color: var(--stop); font-size: 24px; font-weight: 700; min-height: 30px; }
.set-title2 { font-size: 32px; font-weight: 800; }
.set-radio-row { display: flex; gap: 16px; }
.set-radio-row .btn { width: 240px; height: 96px; font-size: 30px; }
.cat-edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cat-edit-card {
  border: 3px solid var(--panel-border); border-radius: 14px;
  padding: 16px 20px; display: flex; flex-direction: column; gap: 12px;
}
.cat-edit-head { font-size: 24px; font-weight: 800; color: var(--text-muted); }
.swatches { display: flex; gap: 12px; }
.swatch {
  width: 72px; height: 72px; border-radius: 14px;
  border: none; border-bottom: 5px solid rgba(0, 0, 0, .25);
  cursor: pointer;
}
.swatch.is-selected { outline: 6px solid var(--key-fn); outline-offset: 2px; }
.cat-swatch-1 { background: var(--cat-1); }
.cat-swatch-2 { background: var(--cat-2); }
.cat-swatch-3 { background: var(--cat-3); }
.cat-swatch-4 { background: var(--cat-4); }
.cat-preview-wrap { width: 296px; height: 224px; position: relative; overflow: hidden; border: 3px dashed var(--panel-border); border-radius: 14px; flex: none; }
.cat-preview { position: absolute; left: 0; top: 0; width: 560px; height: 424px; transform: scale(0.5); transform-origin: top left; }
.cashier-card {
  border: 3px solid var(--panel-border); border-radius: 14px;
  padding: 16px 24px; display: flex; align-items: center; gap: 20px;
}
.cashier-card .cc-name { font-size: 30px; font-weight: 800; flex: 1; }
.cashier-card .btn { width: 220px; height: 96px; font-size: 24px; --ic: 34px; }
.cc-role { font-size: 22px; font-weight: 800; color: var(--key-fn); width: 150px; }
.cc-state { font-size: 22px; font-weight: 800; width: 150px; }
.cc-state.off { color: var(--text-muted); }
.bk-row { display: flex; align-items: center; gap: 32px; }
.bk-last { font-size: 26px; color: var(--text-muted); }
