/* counter.css — wallet and points on the bill, product tiles, and the
   Counter screen (Close the day, Stock). Built by counter.js. */

/* The Counter entries show only while Close the day or Stock is on. */
.gk-counter-only { display: none !important; }
body.gk-counter #menu-counter { display: flex !important; }
body.gk-counter #header-counter-btn { display: inline-flex !important; }

/* ---- wallet and points on the bill ---- */
.cart-money { display: flex; flex-direction: column; gap: 6px; }
.cart-money:empty { display: none; }
.cart-money__row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 0.82rem; color: var(--text-primary);
}
.cart-money__row--muted { color: var(--text-muted); gap: 8px; justify-content: flex-start; }
.cart-money__row--due {
  padding: 6px 10px; border-radius: var(--radius-md);
  background: var(--success-tint); color: var(--success-text); font-weight: 700;
}
.cart-money__label { display: flex; align-items: center; gap: 8px; cursor: pointer; min-width: 0; }
.cart-money__label input { width: 18px; height: 18px; accent-color: var(--brand-action); flex: none; }
.cart-money__label small { color: var(--text-muted); font-weight: 600; margin-left: 4px; }
.cart-money__label { flex: 1; }
.cart-money { gap: 4px; }
.cart-money__label input:disabled + span { opacity: 0.6; }
.cart-money__amt { font-weight: 700; color: var(--success-text); white-space: nowrap; }
.cart-money__links { display: flex; gap: 14px; flex-wrap: wrap; }
.cart-money__link {
  border: none; background: none; padding: 2px 0; cursor: pointer;
  color: var(--brand-action); font-size: 0.78rem; font-weight: 700;
}
.cart-money__link:hover { text-decoration: underline; }

body.gk-wallet-pays .charge-btn--cash,
body.gk-wallet-pays .charge-btn--split,
body.gk-wallet-pays .split-mini,
body.gk-wallet-pays .swipe-payout-wrapper--cash { display: none !important; }

/* ---- product tiles ---- */
.service-tile--product .tile-stock {
  font-size: 0.68rem; font-weight: 700; color: var(--text-muted);
}
.service-tile--product .tile-stock.is-low { color: var(--warn-text); }
.service-tile--product.is-out { opacity: 0.6; }

/* ---- dialog ---- */
.ctr-modal__box { max-width: 460px; width: 100%; }
.ctr-body { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.ctr-lead { margin: 0; font-size: 0.9rem; }
.ctr-muted { margin: 0; color: var(--text-muted); font-size: 0.78rem; line-height: 1.45; }
.ctr-h { margin: 14px 0 2px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.ctr-label { font-size: 0.78rem; font-weight: 700; color: var(--text-secondary); display: flex; gap: 6px; align-items: center; }
.ctr-input {
  width: 100%; min-height: 42px; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-btn);
  background: var(--surface); color: var(--text-primary); font: inherit; font-size: 0.9rem;
  box-sizing: border-box;
}
.ctr-input:focus { outline: 2px solid var(--brand-border); border-color: var(--brand-action); }
.ctr-input--big { font-size: 1.4rem; font-weight: 700; min-height: 52px; }
.ctr-input--date { width: auto; }
.ctr-wide { width: 100%; justify-content: center; }
.ctr-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.ctr-details summary { cursor: pointer; font-size: 0.8rem; font-weight: 700; color: var(--text-secondary); padding: 6px 0; }
.ctr-details[open] { display: flex; flex-direction: column; gap: 8px; }

.ctr-balance { display: flex; gap: 10px; }
.ctr-balance > div {
  flex: 1; padding: 12px 14px; border-radius: var(--radius-md);
  background: var(--surface-sunken); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 2px;
}
.ctr-balance span { font-size: 0.74rem; color: var(--text-muted); font-weight: 600; }
.ctr-balance strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }

.ctr-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ctr-chip {
  padding: 8px 12px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); background: var(--surface); color: var(--text-primary);
  font: inherit; font-size: 0.8rem; cursor: pointer;
}
.ctr-chip b { color: var(--success-text); }
.ctr-chip:hover { background: var(--surface-hover); border-color: var(--brand-border); }
.ctr-chip.is-on { background: var(--brand-action); border-color: var(--brand-action); color: #fff; }
.ctr-chip.is-on b { color: #fff; }

.ctr-seg { display: flex; border: 1px solid var(--border); border-radius: var(--radius-btn); overflow: hidden; }
.ctr-seg__btn {
  flex: 1; min-height: 40px; border: none; background: var(--surface); color: var(--text-primary);
  font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.ctr-seg__btn + .ctr-seg__btn { border-left: 1px solid var(--border); }
.ctr-seg__btn.is-on { background: var(--brand-action); color: #fff; }

.ctr-hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ctr-hist li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.84rem;
}
.ctr-hist li:last-child { border-bottom: none; }
.ctr-hist li > span { min-width: 0; flex: 1; }
.ctr-hist small { display: block; color: var(--text-muted); font-size: 0.72rem; }
.ctr-hist b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ctr-hist .is-neg { color: var(--danger-text); }
.ctr-hist .is-pos { color: var(--success-text); }

/* ---- Counter screen ---- */
.ctr { display: flex; flex-direction: column; gap: 12px; }
.ctr-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); }
.ctr-tab {
  padding: 10px 14px; border: none; background: none; cursor: pointer;
  font: inherit; font-size: 0.9rem; font-weight: 700; color: var(--text-muted);
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.ctr-tab.is-on { color: var(--brand-action); border-bottom-color: var(--brand-action); }
#counter-body { display: flex; flex-direction: column; gap: 10px; }

.ctr-warn {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 10px 12px; border-radius: var(--radius-md);
  background: var(--warn-tint); color: var(--warn-text); border: 1px solid var(--warn-border);
  font-size: 0.82rem; line-height: 1.45;
}
.ctr-daybar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ctr-daybar strong { font-size: 1.05rem; }

.ctr-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.ctr-tile {
  padding: 12px 14px; border-radius: var(--radius-md);
  border: 1px solid var(--border); background: var(--surface);
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.ctr-tile span { font-size: 0.74rem; color: var(--text-muted); font-weight: 600; }
.ctr-tile strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ctr-tile small { font-size: 0.7rem; color: var(--text-muted); }

.ctr-expense { display: grid; grid-template-columns: 110px 1fr 1.4fr 90px auto; gap: 8px; }
@media (max-width: 720px) { .ctr-expense { grid-template-columns: 1fr 1fr; } .ctr-expense button { grid-column: 1 / -1; } }

.ctr-closeform, .ctr-closed {
  display: flex; flex-direction: column; gap: 8px; max-width: 460px;
  padding: 14px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface-sunken);
}
.ctr-sum { display: flex; justify-content: space-between; gap: 10px; font-size: 0.88rem; }
.ctr-sum small { display: block; font-size: 0.7rem; color: var(--text-muted); }
.ctr-sum b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ctr-sum--total { padding-top: 8px; border-top: 1px solid var(--border); font-weight: 700; font-size: 1rem; }
.ctr-sum.is-ok { color: var(--success-text); font-weight: 700; }
.ctr-sum.is-off { color: var(--danger-text); font-weight: 700; }
.ctr-diff { font-size: 1rem; font-weight: 600; min-height: 1.4em; }
.ctr-diff.is-ok { color: var(--success-text); }
.ctr-diff.is-off { color: var(--danger-text); }

.ctr-stockbar { display: flex; gap: 10px; }
.ctr-stockbar .ctr-input { flex: 1; }
.ctr-stock { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ctr-stock li {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.ctr-stock li.is-off { opacity: 0.55; }
.ctr-stock__main { min-width: 0; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.ctr-stock__main small { color: var(--text-muted); font-size: 0.74rem; }
.ctr-stock__qty { font-size: 1.3rem; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.ctr-stock__qty small { display: block; font-size: 0.66rem; font-weight: 600; color: var(--text-muted); }
.ctr-stock__qty.is-low { color: var(--warn-text); }
.ctr-stock__acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) {
  .ctr-stock li { grid-template-columns: 1fr auto; }
  .ctr-stock__acts { grid-column: 1 / -1; justify-content: flex-start; }
}
