/* ============================================================
   modals.css — all pop-ups: confirm, PIN pad, no-sale,
   cash payment, card payment, held sales, history detail, errors
   ============================================================ */

.overlay {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, .6);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
  animation: fadeIn 90ms ease-out;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }

.mcard {
  background: #fff;
  border-radius: 24px;
  padding: 40px;
  display: flex; flex-direction: column; gap: 24px;
  max-height: 1000px;
  overflow: hidden;
  animation: popIn 120ms ease-out;
}
.mtitle { font-size: 44px; font-weight: 800; line-height: 1.15; }
.mbody { font-size: 32px; line-height: 1.4; }
.mbody b { font-weight: 800; }
.msub { font-size: 28px; color: var(--text-muted); line-height: 1.4; }

/* button rows inside modals — main action RIGHT, go-back LEFT */
.mrow { display: flex; gap: 24px; justify-content: center; align-items: center; }
.mrow .btn { min-width: 300px; height: 110px; font-size: 36px; --ic: 44px; }
.mrow .btn-keep-left { margin-right: auto; }
.mrow--spread { justify-content: space-between; }

/* ---------- PIN pad modal ---------- */
.pin-card { width: 720px; align-items: center; }
.pin-card .pin-dots { margin: 8px 0; }
.pin-card .pin-dots .pin-dot { border-color: var(--panel-border); }
.pin-card .pin-dots .pin-dot.filled { background: var(--key-fn); border-color: var(--key-fn); }
.pin-card .pin-dots.error .pin-dot { background: var(--stop); border-color: var(--stop); }
.pin-card .lock-msg { color: var(--stop); font-weight: 700; font-size: 28px; min-height: 40px; text-align: center; }
.pin-card .kgrid { justify-content: center; }
.pin-card .key-pin { background: var(--key-num); color: var(--key-num-text); border-bottom: 6px solid var(--key-num-edge); }

/* ---------- no-sale modal ---------- */
.nosale-card { width: 1120px; align-items: stretch; }
.nosale-card .mtitle { text-align: center; }
.nosale-reasons { display: flex; gap: 24px; justify-content: center; }
.nosale-reasons .btn { width: 300px; height: 110px; font-size: 36px; --ic: 48px; }
.nosale-card .mrow--spread { margin-top: 8px; }

/* ---------- cash payment modal (1240 x 930) ---------- */
.paycash-card { width: 1240px; }
.pc-top { display: flex; gap: 24px; }
.pc-half { flex: 1; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pc-lbl { font-size: 26px; font-weight: 800; color: var(--text-muted); letter-spacing: .5px; }
.pc-gave-display {
  width: 520px; height: 120px;
  background: #fff; border: 3px solid var(--panel-border); border-radius: 18px;
  display: flex; align-items: center; justify-content: flex-end;
  padding: 0 24px;
  font-size: 80px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.pc-gave-display.empty { color: var(--text-muted); }
.pc-total-amt { font-size: 96px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.05; }
.pc-quick { display: grid; grid-template-columns: repeat(2, 300px); gap: 16px; }
.pc-quick .btn { width: 300px; height: 100px; font-size: 40px; }

/* change strip */
.pc-change {
  height: 140px; flex: none;
  border-radius: 18px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px;
  font-size: 44px; font-weight: 800; letter-spacing: .5px;
}
.pc-change .pc-change-amt { font-size: 100px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pc-change.ok { background: #DCFCE7; color: #14532D; }
.pc-change.need { background: #FEE2E2; color: #991B1B; }

/* ---------- card payment modal (1000 x 560) ---------- */
.paycard-card { width: 1000px; align-items: center; text-align: center; }
.paycard-icon { width: 120px; height: 120px; color: var(--card); }
.paycard-icon svg { width: 100%; height: 100%; }
.paycard-amt { font-size: 40px; font-weight: 800; line-height: 1.35; }
.paycard-card .mrow { width: 100%; }
.paycard-card .mrow .btn { width: 400px; height: 120px; font-size: 32px; }

/* ---------- held sales modal (1100 x 800) ---------- */
.held-card { width: 1100px; height: 800px; }
.held-list { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.held-list::-webkit-scrollbar { width: 12px; }
.held-list::-webkit-scrollbar-thumb { background: #C9D3E0; border-radius: 6px; }
.held-row {
  height: 110px; flex: none;
  border: 3px solid var(--panel-border); border-radius: 14px;
  display: flex; align-items: center; gap: 24px;
  padding: 0 24px;
}
.held-time { font-size: 32px; font-weight: 800; width: 150px; font-variant-numeric: tabular-nums; }
.held-tag {
  background: #FEF3C7; color: var(--warn-edge);
  font-size: 20px; font-weight: 800;
  padding: 8px 16px; border-radius: 999px;
  width: fit-content;
}
.held-count { font-size: 26px; color: var(--text-muted); flex: 1; }
.held-total { font-size: 44px; font-weight: 800; font-variant-numeric: tabular-nums; }
.held-row .btn { width: 260px; height: 90px; font-size: 28px; --ic: 36px; }
.held-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 30px; }

/* ---------- history detail modal ---------- */
.detail-card { width: 1080px; height: 860px; }
.detail-meta { display: flex; gap: 28px; font-size: 26px; color: var(--text-muted); flex-wrap: wrap; }
.detail-lines { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.detail-lines::-webkit-scrollbar { width: 12px; }
.detail-lines::-webkit-scrollbar-thumb { background: #C9D3E0; border-radius: 6px; }
.detail-line {
  min-height: 84px; flex: none;
  display: flex; align-items: center; gap: 18px;
  border-bottom: 2px solid #E2E8F0;
  font-size: 28px;
  padding: 8px 4px;
}
.detail-line .d-idx { color: var(--text-muted); width: 40px; font-weight: 800; }
.detail-line .d-name { flex: 1; }
.detail-line .d-qty { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.detail-line .d-total { font-size: 36px; font-weight: 800; font-variant-numeric: tabular-nums; }
.detail-line.removed { opacity: .5; }
.detail-line.removed .d-name, .detail-line.removed .d-qty, .detail-line.removed .d-total {
  text-decoration: line-through; color: var(--text-muted);
}
.d-removed-tag {
  background: #FEE2E2; color: var(--stop-edge);
  font-size: 18px; font-weight: 800; padding: 4px 12px; border-radius: 999px;
}
.detail-pay { font-size: 30px; font-weight: 800; display: flex; gap: 40px; }

/* ---------- error modal ---------- */
.err-card { width: 760px; align-items: center; text-align: center; }
.err-card .ic { width: 96px; height: 96px; color: var(--warn-edge); }
.err-card .ic svg { width: 100%; height: 100%; }

/* ---------- done screen extras ---------- */
.screen--done {
  background: #F0FDF4;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 28px;
}
.done-tick { width: 180px; height: 180px; color: var(--go); }
.done-tick svg { width: 100%; height: 100%; }
.done-title { font-size: 64px; font-weight: 800; letter-spacing: 1px; }
.done-amount { font-size: 140px; font-weight: 800; color: #14532D; font-variant-numeric: tabular-nums; line-height: 1; }
.done-amount.small { font-size: 72px; }
.done-buttons { display: flex; gap: 24px; margin-top: 16px; }
.done-buttons .btn { width: 440px; height: 140px; font-size: 40px; --ic: 56px; }
.done-progress { position: absolute; left: 0; bottom: 0; width: 100%; height: 12px; background: rgba(22, 163, 74, .3); }
.done-progress .bar { height: 100%; background: var(--go); width: 100%; }
@keyframes doneCountdown { from { width: 100%; } to { width: 0%; } }
.done-progress .bar.run { animation: doneCountdown 10s linear forwards; }
.done-printing { font-size: 48px; font-weight: 800; color: var(--text); }
