/* TM Booth POS — mobile-first, brand orange #EA580C */
html { -webkit-text-size-adjust: 100%; }
body.tmbp-fullscreen { margin: 0; padding: 0; background: #f9fafb; font-family: Inter, system-ui, -apple-system, sans-serif; }
.tmbp { max-width: 640px; margin: 0 auto; padding: 12px 12px 60px; font-family: Inter, system-ui, -apple-system, sans-serif; color: #111827; background: #fff; min-height: 100vh; }
.tmbp *, .tmbp *::before, .tmbp *::after { box-sizing: border-box; }
.tmbp .tmbp-loading { text-align: center; padding: 40px 0; color: #6b7280; }

.tmbp-gate { text-align: center; padding: 48px 16px; }
.tmbp-gate p { font-size: 16px; color: #374151; margin: 0 0 20px; }

.tmbp-staffbar { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #6b7280; padding: 6px 2px 14px; }
.tmbp-staffbar-dot { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; display: inline-block; }

.tmbp-sec { display: flex; align-items: center; gap: 10px; margin: 18px 0 10px; }
.tmbp-sec-num { width: 24px; height: 24px; border-radius: 50%; background: #EA580C; color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.tmbp-sec-txt { font-size: 15px; font-weight: 700; }

/* Products */
.tmbp-products { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tmbp-prod { display: flex; align-items: center; gap: 10px; padding: 8px; border: 2px solid #e5e7eb; border-radius: 12px; background: #fff; cursor: pointer; text-align: left; min-height: 64px; transition: border-color .12s, box-shadow .12s; }
.tmbp-prod:active { transform: scale(.99); }
.tmbp-prod.is-active { border-color: #EA580C; box-shadow: 0 0 0 3px rgba(234,88,12,.15); }
.tmbp-prod-img { flex: 0 0 auto; width: 56px; height: 56px; border-radius: 10px; object-fit: cover; border: 1px solid rgba(0,0,0,.08); display: block; }
.tmbp-prod-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tmbp-prod-label { font-size: 14px; font-weight: 600; line-height: 1.2; }
.tmbp-prod-price { font-size: 12px; font-weight: 800; color: #EA580C; }

/* Sizes */
.tmbp-sizes { margin-top: 12px; }
.tmbp-sizes:empty { margin: 0; }
.tmbp-sizes-hint { font-size: 13px; color: #6b7280; margin-bottom: 8px; }
.tmbp-size-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tmbp-size { min-width: 54px; padding: 12px 10px; border: 2px solid #d1d5db; border-radius: 10px; background: #fff; font-size: 14px; font-weight: 700; cursor: pointer; }
.tmbp-size:active { background: #EA580C; color: #fff; border-color: #EA580C; }
.tmbp-size.is-oos { opacity: .4; text-decoration: line-through; cursor: not-allowed; font-size: 12px; }

/* Item lain (misc) */
.tmbp-misc { margin-top: 16px; padding: 12px; border: 1px dashed #d1d5db; border-radius: 12px; background: #fafafa; }
.tmbp-misc-title { font-size: 12px; font-weight: 600; color: #6b7280; margin-bottom: 8px; }
.tmbp-misc-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.tmbp-misc-preset { display: flex; flex-direction: column; align-items: flex-start; padding: 8px 12px; border: 2px solid #d1d5db; border-radius: 10px; background: #fff; cursor: pointer; line-height: 1.2; }
.tmbp-misc-preset:active { border-color: #EA580C; }
.tmbp-misc-preset-name { font-size: 13px; font-weight: 700; }
.tmbp-misc-preset-price { font-size: 12px; font-weight: 800; color: #EA580C; }
.tmbp-misc-other { justify-content: center; align-items: center; font-size: 14px; font-weight: 700; color: #6b7280; border-style: dashed; }
.tmbp-misc-custom { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tmbp-misc-custom input { padding: 12px; border: 2px solid #d1d5db; border-radius: 10px; font-size: 15px; }
.tmbp-misc-custom #tmbp-misc-name { flex: 1 1 100%; }
.tmbp-misc-custom #tmbp-misc-price { flex: 1 1 120px; }
.tmbp-misc-add { flex: 0 0 auto; padding: 12px 18px; border: 0; background: #111827; color: #fff; border-radius: 10px; font-size: 14px; font-weight: 800; cursor: pointer; }
.tmbp-line-tag { display: inline-block; margin-left: 8px; padding: 1px 7px; background: #e5e7eb; color: #6b7280; border-radius: 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; vertical-align: middle; }

/* Cart */
.tmbp-cart { border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; }
.tmbp-cart.tmbp-flash { animation: tmbpFlash .5s ease; }
@keyframes tmbpFlash { 0% { background: #fff7ed; } 100% { background: transparent; } }
.tmbp-cart-empty { padding: 18px; text-align: center; color: #9ca3af; font-size: 13px; }
.tmbp-line { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid #f3f4f6; }
.tmbp-line-name { font-size: 14px; font-weight: 600; }
.tmbp-line-ctrl { display: flex; align-items: center; gap: 4px; }
.tmbp-qtybtn { width: 34px; height: 34px; border: 1px solid #d1d5db; background: #fff; border-radius: 8px; font-size: 18px; font-weight: 700; cursor: pointer; line-height: 1; }
.tmbp-qty { min-width: 30px; text-align: center; font-size: 15px; font-weight: 700; }
.tmbp-total { display: flex; align-items: center; justify-content: space-between; padding: 14px; background: #fff7ed; font-size: 15px; }
.tmbp-total strong { font-size: 20px; color: #EA580C; }

/* Fields */
.tmbp-fields { display: grid; gap: 12px; }
.tmbp-field { display: flex; flex-direction: column; gap: 4px; }
.tmbp-field-label { font-size: 13px; font-weight: 600; color: #374151; }
.tmbp-field input { padding: 14px 14px; border: 2px solid #d1d5db; border-radius: 10px; font-size: 16px; width: 100%; }
.tmbp-field input:focus { outline: none; border-color: #EA580C; }

/* Resit bayaran */
.tmbp-receipt { }
.tmbp-receipt-btn { width: 100%; padding: 16px; border: 2px dashed #EA580C; border-radius: 12px; background: #fff7ed; color: #EA580C; font-size: 16px; font-weight: 800; cursor: pointer; }
.tmbp-receipt-btn:active { background: #ffedd5; }
.tmbp-receipt-preview { margin-top: 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.tmbp-receipt-preview:empty { margin: 0; }
.tmbp-receipt-proc { font-size: 13px; color: #6b7280; }
.tmbp-receipt-img { max-width: 220px; max-height: 260px; width: auto; border-radius: 10px; border: 1px solid #e5e7eb; }
.tmbp-receipt-ok { font-size: 14px; font-weight: 700; color: #16a34a; }
.tmbp-receipt-change { padding: 8px 16px; border: 1px solid #d1d5db; background: #fff; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }

.tmbp-error { color: #dc2626; font-size: 14px; font-weight: 600; min-height: 18px; margin: 12px 2px 0; }
.tmbp-submit-hint { text-align: center; font-size: 12px; color: #9ca3af; margin-top: 6px; min-height: 14px; }

.tmbp-btn { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.tmbp-submit { width: 100%; margin-top: 10px; padding: 18px; background: #EA580C; color: #fff; border: 0; border-radius: 12px; font-size: 17px; font-weight: 800; letter-spacing: .3px; cursor: pointer; }
.tmbp-submit:disabled { opacity: .6; cursor: default; }
.tmbp-btn-login { display: inline-flex; padding: 14px 24px; background: #EA580C; color: #fff; border-radius: 10px; font-weight: 700; }

/* Result */
.tmbp-result { display: none; margin-top: 20px; padding: 22px 18px; border: 2px solid #16a34a; border-radius: 16px; background: #f0fdf4; text-align: center; }
.tmbp-result.is-show { display: block; }
.tmbp-result-check { width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 50%; background: #16a34a; color: #fff; font-size: 30px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.tmbp-result-h { font-size: 18px; font-weight: 800; }
.tmbp-result-sub { font-size: 14px; color: #4b5563; margin-top: 2px; }
.tmbp-tickets { margin: 18px 0; padding: 16px; background: #fff; border-radius: 12px; }
.tmbp-tickets-lbl { font-size: 13px; color: #6b7280; margin-bottom: 10px; }
.tmbp-tickets-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.tmbp-ticket { padding: 10px 14px; background: #EA580C; color: #fff; border-radius: 8px; font-size: 16px; font-weight: 800; letter-spacing: .5px; }
.tmbp-ticket-warn { background: #f59e0b; font-size: 13px; }
.tmbp-result-mail { font-size: 13px; color: #4b5563; }
.tmbp-again { width: 100%; margin-top: 18px; padding: 16px; background: #111827; color: #fff; border: 0; border-radius: 12px; font-size: 16px; font-weight: 800; cursor: pointer; }

/* Guardrail: overlay pengesahan */
.tmbp-overlay { position: fixed; inset: 0; background: rgba(17,24,39,.55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 99999; }
.tmbp-confirm { background: #fff; border-radius: 16px; max-width: 420px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 20px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.tmbp-confirm-h { font-size: 18px; font-weight: 800; text-align: center; margin-bottom: 14px; }
.tmbp-confirm-items { border: 1px solid #f3f4f6; border-radius: 10px; overflow: hidden; }
.tmbp-confirm-item { display: flex; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid #f3f4f6; font-size: 14px; }
.tmbp-confirm-item:last-child { border-bottom: 0; }
.tmbp-confirm-total { display: flex; justify-content: space-between; align-items: center; padding: 12px; margin-top: 8px; background: #fff7ed; border-radius: 10px; }
.tmbp-confirm-total strong { font-size: 20px; color: #EA580C; }
.tmbp-confirm-cust { text-align: center; margin: 14px 0 10px; }
.tmbp-confirm-name { font-size: 16px; font-weight: 700; }
.tmbp-confirm-sub { font-size: 13px; color: #6b7280; margin-top: 2px; }
.tmbp-confirm-receipt { display: block; max-width: 160px; max-height: 200px; margin: 0 auto 10px; border-radius: 10px; border: 1px solid #e5e7eb; }
.tmbp-confirm-warn { font-size: 13px; color: #b45309; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 10px; text-align: center; margin-bottom: 16px; font-weight: 600; }
.tmbp-confirm-acts { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.tmbp-confirm-cancel { padding: 15px; border: 2px solid #d1d5db; background: #fff; border-radius: 12px; font-size: 15px; font-weight: 700; cursor: pointer; }
.tmbp-confirm-ok { padding: 15px; border: 0; background: #16a34a; color: #fff; border-radius: 12px; font-size: 15px; font-weight: 800; cursor: pointer; }

@media (min-width: 520px) {
    .tmbp-products { grid-template-columns: repeat(3, 1fr); }
}

/* ===== v1.11.0: cara bayaran (Tunai/QR) ===== */
.tmbp-pay-row{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:0 0 18px}
.tmbp-pay{display:flex;flex-direction:column;align-items:center;gap:2px;padding:14px 10px;border:2px solid #d1d5db;border-radius:12px;background:#fff;cursor:pointer;transition:border-color .12s, background .12s}
.tmbp-pay-big{font-size:18px;font-weight:800;letter-spacing:.5px;color:#111827}
.tmbp-pay-sub{font-size:11.5px;color:#6b7280}
.tmbp-pay.is-active{border-color:#16a34a;background:#f0fdf4;box-shadow:0 0 0 3px rgba(22,163,74,.15)}
.tmbp-pay.is-active .tmbp-pay-big{color:#15803d}

/* ===== v1.11.0: hint email conditional ===== */
.tmbp-email-hint{font-size:12px;color:#b45309;margin:-8px 0 14px;min-height:15px}
.tmbp-email-hint.is-optional{color:#6b7280}

/* ===== v1.11.0: carian + senarai item lain ===== */
.tmbp-misc-search{width:100%;box-sizing:border-box;padding:10px 12px;border:1.5px solid #d1d5db;border-radius:10px;font-size:14px;margin:0 0 10px;background:#fff}
.tmbp-misc-search:focus{outline:none;border-color:#16a34a}
.tmbp-misc-presets{max-height:220px;overflow-y:auto}
.tmbp-misc-none{font-size:12.5px;color:#6b7280;padding:6px 2px}
.tmbp-confirm-pay{font-size:13px;font-weight:700;color:#15803d;margin-top:4px}
.tmbp-result-mail-none{color:#6b7280}

/* v1.15.0: banner promo, kotak tunai + baki, harga asal dicoret */
.tmbp-promo{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:0 0 14px;padding:12px 14px;border-radius:12px;background:#fff7ed;border:2px solid #EA580C;font-size:14px;font-weight:700;color:#7c2d12}
.tmbp-promo-tag{background:#EA580C;color:#fff;border-radius:6px;padding:3px 8px;font-size:11px;font-weight:800;letter-spacing:.6px}
.tmbp-cash{display:flex;flex-direction:column;gap:6px;margin:0 0 12px;padding:12px;border:2px solid #16a34a;border-radius:12px;background:#f0fdf4}
.tmbp-cash[hidden]{display:none}
.tmbp-cash-lbl{font-size:13px;font-weight:700;color:#166534}
.tmbp-cash input{width:100%;padding:12px;font-size:18px;font-weight:700;border:1px solid #d1d5db;border-radius:10px;box-sizing:border-box}
.tmbp-cash-change{font-size:16px;font-weight:800;color:#15803d;min-height:20px}
.tmbp-cash-change.is-short{color:#b91c1c}
.tmbp-total-amt{display:flex;align-items:baseline;gap:8px}
.tmbp-total-was{color:#9ca3af;font-size:13px}

/* v1.16.0: scan QR slip peserta */
.tmbp-scan{display:flex;flex-direction:column;gap:8px;margin:0 0 12px}
.tmbp-scan-btn{width:100%;padding:14px;border:2px solid #111827;border-radius:12px;background:#111827;color:#fff;font-size:16px;font-weight:800;cursor:pointer}
.tmbp-scan-row{display:flex;gap:8px}
.tmbp-scan-row input{flex:1;min-width:0;padding:12px;font-size:15px;border:1px solid #d1d5db;border-radius:10px;text-transform:uppercase}
.tmbp-scan-go{padding:0 16px;border:0;border-radius:10px;background:#EA580C;color:#fff;font-weight:800;cursor:pointer}
.tmbp-qr-reader{width:100%;border-radius:12px;overflow:hidden;background:#000}
.tmbp-qr-reader[hidden],.tmbp-scan-stop[hidden]{display:none}
.tmbp-scan-stop{padding:10px;border:1px solid #d1d5db;border-radius:10px;background:#fff;font-weight:700;cursor:pointer}
.tmbp-scan-status{font-size:13px;color:#6b7280;min-height:16px}
.tmbp-scan-status.is-ok{color:#15803d;font-weight:700}
.tmbp-scan-status.is-err{color:#b91c1c;font-weight:700}

/* v1.17.0: footer jualan hari ini */
.tmbp-today{margin:22px 0 8px;padding:14px;border-radius:12px;background:#111827;color:#f9fafb}
.tmbp-today-h{display:flex;justify-content:space-between;align-items:center;font-size:12px;font-weight:800;letter-spacing:.6px;text-transform:uppercase;color:#fdba74}
.tmbp-today-rf{border:1px solid rgba(255,255,255,.3);background:transparent;color:#f9fafb;border-radius:8px;padding:4px 10px;font-size:12px;cursor:pointer}
.tmbp-today-fig{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;margin-top:8px}
.tmbp-today-fig strong{font-size:26px;color:#fb923c;font-variant-numeric:tabular-nums}
.tmbp-today-fig span{font-size:13px;color:#d1d5db}
.tmbp-today-pay{font-size:12px;color:#9ca3af;margin-top:2px}
.tmbp-today-cols{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:12px}
.tmbp-today-col-h{font-size:11px;font-weight:800;color:#9ca3af;text-transform:uppercase;letter-spacing:.4px;margin-bottom:4px}
.tmbp-today-list{margin:0;padding-left:18px;font-size:13px}
.tmbp-today-list li{margin:3px 0}
.tmbp-today-list li span{display:inline-block;margin-right:6px}
.tmbp-today-list li b{color:#fdba74;font-weight:700;white-space:nowrap}
.tmbp-today-empty{font-size:13px;color:#9ca3af;margin-top:6px}
@media (max-width:380px){.tmbp-today-cols{grid-template-columns:1fr}}

/* v1.18.0: pecahan barang dlm footer */
.tmbp-today-groups{margin-top:10px;border-top:1px solid rgba(255,255,255,.12);padding-top:8px}
.tmbp-today-grow{display:grid;grid-template-columns:1fr auto auto;gap:10px;align-items:baseline;font-size:13px;padding:3px 0}
.tmbp-today-grow small{color:#9ca3af;font-weight:400}
.tmbp-today-grow b{color:#fdba74;white-space:nowrap}
.tmbp-today-grm{color:#d1d5db;font-variant-numeric:tabular-nums;white-space:nowrap}
.tmbp-today-note{font-size:11px;color:#6b7280;margin-top:8px}

/* v1.19.0: Tutup Kaunter (Z) & Tukar Staf */
.tmbp-today-acts{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:12px}
.tmbp-act-z,.tmbp-act-sw{padding:12px 8px;border-radius:10px;font-weight:800;font-size:13px;cursor:pointer}
.tmbp-act-z{background:#ea580c;color:#fff;border:0}
.tmbp-act-sw{background:transparent;color:#f9fafb;border:1px solid rgba(255,255,255,.35)}
.tmbp-z-card{max-height:88vh;overflow-y:auto}
.tmbp-z-sub{font-size:12px;color:#6b7280;margin:-4px 0 10px}
.tmbp-z-box{border:1px solid #e5e7eb;border-radius:10px;padding:8px 10px;margin-bottom:10px}
.tmbp-z-row{display:flex;justify-content:space-between;gap:10px;font-size:14px;padding:3px 0}
.tmbp-z-row b{white-space:nowrap;font-variant-numeric:tabular-nums}
.tmbp-z-row.is-total{border-top:1px dashed #d1d5db;margin-top:4px;padding-top:6px;font-size:16px}
.tmbp-z-row.is-total b{color:#EA580C}
#tmbp-z-note{width:100%;padding:10px;border:1px solid #d1d5db;border-radius:10px;box-sizing:border-box;font-size:14px}
@media (max-width:380px){.tmbp-today-acts{grid-template-columns:1fr}}

/* v1.20.0: resit bercetak + QR tuntutan cabutan */
.tmbp-print-status { text-align: center; font-size: 15px; font-weight: 600; margin: 8px 0; min-height: 1.2em; overflow-wrap: anywhere; }
.tmbp-print-status.is-ok { color: #15803d; }
.tmbp-print-status.is-err { color: #b91c1c; }
.tmbp-claim-qr { display: flex; justify-content: center; margin: 10px 0; }
.tmbp-claim-qr svg { width: 220px; max-width: 100%; height: auto; background: #fff; border-radius: 8px; }
.tmbp-claim-hint { text-align: center; font-size: 14px; color: #374151; overflow-wrap: anywhere; }
.tmbp-reprint { width: 100%; margin-top: 14px; padding: 14px; background: #fff; color: #111827; border: 2px solid #111827; border-radius: 12px; font-size: 15px; font-weight: 800; cursor: pointer; }
.tmbp-reprint + .tmbp-again { margin-top: 10px; }
.tmbp-act-last, .tmbp-today-acts .tmbp-print-status { grid-column: 1 / -1; }
