/* POS, customer order, login & install polish (extends app.css) */
.pos-search .form-control { border-color: #f0b999; font-size: 1.1rem; padding-top: .8rem; padding-bottom: .8rem; background: #fffdfb; }
.pos-search .input-group-text { background: var(--brand-soft); border-color: #f0b999; color: var(--brand-dark); border-radius: 12px 0 0 12px; font-size: 1.2rem; }
.pos-search .input-group > .form-control:not(:first-child) { border-radius: 0; }
.pos-search .input-group > .btn { border-color: #f0b999; }
.pos-search .hint { font-size: .78rem; color: var(--muted); margin-top: .5rem; }
.pos-results { box-shadow: 0 14px 40px rgba(20, 24, 40, .18) !important; margin-top: .4rem; }
.pos-result { padding: .7rem .95rem; gap: .75rem; }
.pos-result .pr-no { display: inline-block; min-width: 2.2rem; text-align: center; background: #f1f3f8; color: var(--ink-2); border-radius: 6px; font-size: .75rem; font-weight: 700; padding: .1rem .4rem; margin-right: .35rem; }
.pos-result.active .pr-no { background: #fff; }
.pos-result .pr-price { font-weight: 700; margin-right: .4rem; }

.section-title { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: .95rem; margin: 0; }
.section-title i { color: var(--brand); }
.cart-head { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1.1rem; border-bottom: 1px solid var(--line); }
.cart-table .qty-box .btn { padding: .25rem .6rem; font-weight: 700; }
.cart-table tbody tr:last-child td { border-bottom: 0; }
.cart-empty { text-align: center; color: var(--muted); padding: 2.4rem 1rem; }
.cart-empty i { display: block; font-size: 2.4rem; opacity: .45; margin-bottom: .4rem; color: var(--brand); }
.cart-empty strong { display: block; color: var(--ink-2); }

.totals-box .grand { align-items: baseline; }
.totals-box .grand .money { background: linear-gradient(90deg, var(--brand-dark), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 1.9rem; }
.totals-box .btn-primary { background-image: linear-gradient(135deg, var(--brand), #f08c00); border: 0; }
.totals-box .btn-primary:disabled { opacity: .5; }
.disc-pill { display: inline-flex; align-items: center; gap: .4rem; background: var(--brand-soft); color: var(--brand-dark); border-radius: 999px; padding: .3rem .8rem; font-weight: 600; font-size: .8rem; }

/* payment modal */
.pay-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-bottom: 1rem; }
.mode-tile.btn { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .85rem .4rem; font-size: .88rem; border-radius: 14px; border: 2px solid var(--line); background: #fff; color: var(--ink-2); box-shadow: none; line-height: 1.2; }
.mode-tile.btn i { font-size: 1.7rem; color: var(--brand); }
.mode-tile.btn:hover { border-color: #f0b999; background: var(--brand-soft); color: var(--ink); }
.mode-tile.btn.btn-primary { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); box-shadow: 0 0 0 3px rgba(232, 89, 12, .12); }
.mode-tile.btn:disabled { opacity: .45; }
.pay-panel { border: 1px solid var(--line); border-radius: 14px; padding: 1rem; margin-bottom: 1rem; background: #fcfcfe; }
.pay-panel h6 { display: flex; align-items: center; gap: .4rem; margin-bottom: .75rem; }
.pay-panel h6 i { color: var(--brand); }
.qr-panel { background: #fff; border: 1px dashed #f0b999; border-radius: 14px; padding: 1rem; text-align: center; }
.qr-panel:empty { display: none; }
.change-line { background: #e6f7ee; color: #0b6b36; border-radius: 10px; padding: .55rem .8rem; margin-top: .7rem; display: flex; justify-content: space-between; align-items: center; }
.done-check { width: 92px; height: 92px; border-radius: 50%; background: #e6f7ee; color: var(--ok); display: inline-flex; align-items: center; justify-content: center; font-size: 3.4rem; margin-bottom: .6rem; animation: pop .4s ease; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.inv-chip { display: inline-block; background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; border-radius: 999px; padding: .25rem .9rem; }

/* auth / install */
.login-card .card-body { padding: 2rem 1.75rem; }
.auth-logo { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 1.4rem; }
.auth-logo .brand-mark { width: 56px; height: 56px; font-size: 1.7rem; border-radius: 16px; margin-bottom: .75rem; }
.auth-logo h1 { font-size: 1.35rem; margin: 0 0 .15rem; }
.auth-logo p { margin: 0; color: var(--muted); }
.auth-hint { text-align: center; color: var(--muted); font-size: .78rem; margin-top: 1.1rem; }
.login-card .btn-primary { padding: .7rem; font-size: 1rem; }

/* customer order page */
.order-body { background: var(--bg); padding-bottom: 6.5rem; }
.order-hero { background: linear-gradient(135deg, var(--brand-dark), var(--brand) 55%, var(--gold)); color: #fff; padding: 1.6rem 1rem 3.2rem; text-align: center; }
.order-hero .brand-mark { background: rgba(255, 255, 255, .22); box-shadow: none; width: 52px; height: 52px; font-size: 1.5rem; border-radius: 16px; margin-bottom: .6rem; }
.order-hero h1 { color: #fff; font-size: 1.4rem; margin: 0 0 .2rem; }
.order-hero p { margin: 0; opacity: .9; font-size: .9rem; }
.order-wrap { max-width: 640px; margin: -2rem auto 0; padding: 0 .85rem; }
.step-head { display: flex; align-items: center; gap: .6rem; padding: .85rem 1.1rem; border-bottom: 1px solid var(--line); font-weight: 700; }
.step-no { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--gold), var(--brand)); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; flex-shrink: 0; }
#cartList .list-group-item { padding: .8rem 1.1rem; }
.cart-empty-s { text-align: center; color: var(--muted); padding: 1.6rem 1rem; }
.cart-empty-s i { display: block; font-size: 1.9rem; opacity: .45; color: var(--brand); }
.order-total { display: flex; justify-content: space-between; align-items: baseline; font-weight: 800; font-size: 1.4rem; border-top: 2px dashed var(--line); margin-top: .6rem; padding-top: .6rem; }
.order-total span:last-child { color: var(--brand-dark); }
.pay-choice { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: .75rem; }
.pay-choice .btn { display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .85rem .4rem; font-size: .92rem; border-radius: 14px; border: 2px solid var(--line); background: #fff; color: var(--ink-2); box-shadow: none; }
.pay-choice .btn i { font-size: 1.6rem; color: var(--brand); }
.pay-choice .btn.btn-primary { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); box-shadow: 0 0 0 3px rgba(232, 89, 12, .12); }
.pay-choice .btn:disabled { opacity: .45; }
.sticky-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(20, 24, 40, .08); padding: .65rem 1rem calc(.65rem + env(safe-area-inset-bottom)); }
.sticky-bar .inner { max-width: 640px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.sticky-bar .lbl { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.sticky-bar .amt { font-size: 1.35rem; font-weight: 800; line-height: 1.1; color: var(--brand-dark); }
.thanks-check { width: 96px; height: 96px; border-radius: 50%; background: #e6f7ee; color: var(--ok); display: inline-flex; align-items: center; justify-content: center; font-size: 3.6rem; animation: pop .4s ease; }

/* invoice screen toolbar */
.inv-toolbar { background: #fff; padding: 10px 14px; border-bottom: 1px solid #e6e9f0; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; box-shadow: 0 1px 3px rgba(20, 24, 40, .06); font-family: 'Inter', Arial, sans-serif; }
.inv-toolbar a, .inv-toolbar button { padding: 7px 14px; border: 1px solid #d9dde8; background: #fff; border-radius: 10px; text-decoration: none; color: #1f2430; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; }
.inv-toolbar a:hover { background: #fff1e6; border-color: #f0b999; }
.inv-toolbar .primary { background: linear-gradient(135deg, #e8590c, #f08c00); color: #fff; border-color: #e8590c; }
.inv-toolbar a.on { background: #fff1e6; border-color: #e8590c; color: #c2410c; }
.inv-toolbar .tb-hint { margin-left: auto; }
@media print { .inv-toolbar { display: none !important; } }

@media (max-width: 575px) {
  .pay-modes { gap: .4rem; }
  .mode-tile.btn { font-size: .78rem; padding: .7rem .2rem; }
  .pos-result { flex-wrap: wrap; }
  .auth-logo h1 { font-size: 1.2rem; }
}
#addBtn { white-space: nowrap; }

/* inline panels (no popups) */
.disc-box { background: #fff8f0; border: 1px dashed #f0b999; border-radius: 12px; padding: .75rem; margin: .5rem 0; }
.pay-panel { border-color: #f0b999; box-shadow: 0 6px 24px rgba(232, 89, 12, .12); }

/* ===== mobile POS: compact bill rows + sticky pay bar ===== */
.pay-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .65rem 1rem calc(.65rem + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(20, 24, 40, .12); }
.pay-bar .pb-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.pay-bar .pb-total { font-size: 1.45rem; font-weight: 800; line-height: 1.1; }
.pay-bar .btn { min-width: 150px; font-weight: 700; }
@media (max-width: 767px) {
  body { padding-bottom: 84px; }
  .cart-table tr { display: flex !important; flex-wrap: wrap; align-items: center; gap: .15rem .5rem; padding: .7rem .85rem !important; }
  .cart-table td { display: block !important; padding: 0 !important; border: 0 !important; text-align: left !important; }
  .cart-table td::before { content: none !important; }
  .cart-table td.cart-name { order: 1; flex: 1 1 55%; min-width: 55%; font-weight: 700; font-size: .98rem; }
  .cart-table td.cart-total { order: 2; flex: 0 0 auto; margin-left: auto; font-size: 1.02rem; }
  .cart-table td.cart-qty { order: 3; }
  .cart-table td.cart-del { order: 4; margin-left: .15rem; flex: 1 1 auto; text-align: left !important; }
  .cart-table td.cart-no, .cart-table td.cart-price, .cart-table td.cart-disc { order: 5; font-size: .78rem; color: var(--muted); font-weight: 500 !important; }
  .cart-table td.cart-no::before { content: '#' !important; }
  .cart-table td.cart-price::after { content: ' each'; }
  .cart-table td.cart-disc::before { content: 'disc ' !important; }
  .cart-table td.cart-disc.is-zero { display: none !important; }
  .cart-table td.cart-no::after, .cart-table td.cart-price::after { margin-right: .25rem; }
  .cart-table td[colspan] { flex: 1 1 100%; text-align: center !important; }
  .cart-table .qty-box { width: 118px; }
  .totals-box .btn#proceedBtn { display: none; }
  .content { padding-bottom: 1rem; }
}

/* dropdown list: scrolls by itself, never drags the page */
.pos-results { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
@media (max-width: 767px) {
  /* on phones the list opens in the page flow (pushes the bill down) instead of floating over it */
  #results { position: static !important; margin-top: .5rem; max-height: 45vh !important; box-shadow: none !important; }
}
