/* ============================================================================
   Fulfillment: new order, customer payment page, mobile dropoff screen,
   signature pad, order drawer ledger
   ========================================================================== */
.input-lg { height: 48px; font-size: 18px; }
.ok-t { color: var(--success); display: inline-flex; align-items: center; gap: 6px; }

/* ---------- New order ---------- */
.neworder { max-width: 760px; }
.lines { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--r-lg); }
.line { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.line:last-child { border-bottom: 0; }
.line-qty { width: 64px; text-align: center; flex-shrink: 0; }
.line-price { width: 130px; flex-shrink: 0; }
.method-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.method-opt { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 10px; border: 1px solid var(--border-strong); border-radius: var(--r-lg); cursor: pointer; text-align: center; font-size: 14px; }
.method-opt input { position: absolute; opacity: 0; pointer-events: none; }
.method-ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); color: var(--ink-2); }
.method-opt:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: #FBFCFF; }
.method-opt:has(input:checked) .method-ic { background: var(--accent-tint); color: var(--accent); }
.method-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.sched { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sched-opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border-strong); border-radius: var(--r-lg); cursor: pointer; min-width: 0; }
.sched-opt input { margin-top: 3px; accent-color: var(--accent); flex-shrink: 0; }
.sched-opt:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.sched-opt.disabled { opacity: .5; cursor: not-allowed; }
.sched-opt > span { min-width: 0; }
.summary { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px 16px; background: var(--surface); }
.summary .totals dt .check { color: var(--muted); }
.due-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.due-split div { display: flex; flex-direction: column; gap: 2px; }
.due-split strong { font-size: 22px; letter-spacing: -0.02em; }
@media (max-width: 640px) {
  .sched, .method-pick { grid-template-columns: minmax(0, 1fr); }
  .method-opt { flex-direction: row; justify-content: flex-start; padding: 12px; }
  .line { flex-wrap: wrap; }
  .line .grow { flex-basis: calc(100% - 100px); }
}

/* ---------- Customer payment page ---------- */
.pay-frame { min-height: 100dvh; background: var(--surface); display: flex; justify-content: center; padding: 32px 16px 48px; }
.pay-card { width: 100%; max-width: 440px; align-self: flex-start; background: var(--bg); border: 1px solid var(--border); border-radius: 14px; padding: 24px; box-shadow: var(--shadow-xs); }
.handoff { display: flex; align-items: center; gap: 6px; margin: -24px -24px 20px; padding: 10px 16px; background: var(--ink); color: #fff; font-size: 12.5px; border-radius: 14px 14px 0 0; }
.pay-biz { display: flex; align-items: center; gap: 12px; }
.pay-logo { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 14px; }
.pay-status { display: flex; gap: 14px; align-items: flex-start; margin-top: 24px; }
.pay-status h1 { font-size: 22px; letter-spacing: -0.02em; }
.pay-status p { color: var(--muted); margin-top: 4px; font-size: 14px; }
.pay-status-ic { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--ink-2); flex-shrink: 0; }
.pay-status.ok .pay-status-ic { background: var(--success-tint, #ECFDF3); color: var(--success); }
.pay-status.accent .pay-status-ic { background: var(--accent-tint); color: var(--accent); }
.pay-sec { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.pay-line { display: flex; gap: 12px; align-items: baseline; padding: 4px 0; font-size: 14px; }
.pay-line.strong { font-weight: 600; margin-top: 6px; padding-top: 10px; border-top: 1px dashed var(--border); }
.pay-line.muted { color: var(--muted); }
.pay-money { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; }
.pay-money > div { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; }
.pay-money > div.big { padding: 14px 16px; border-radius: var(--r-lg); background: var(--surface); font-weight: 500; }
.pay-money > div.big strong { font-size: 24px; letter-spacing: -0.02em; }
.pay-box { margin-top: 16px; }
.card-mock { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: var(--r-lg); color: var(--ink-2); }
.paypal-btn { background: #FFC439; border-color: #FFC439; color: #111; font-weight: 600; }
.paypal-btn:hover { background: #F2B52E; }
.pay-foot { text-align: center; margin-top: 24px; }

/* ---------- Dropoff screen (mobile-first; centered column on desktop) ---------- */
.drop-app { min-height: 100dvh; background: var(--surface); }
.drop-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 8px; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); max-width: 560px; margin: 0 auto; }
.drop-body { max-width: 560px; margin: 0 auto; padding: 16px 16px 48px; display: flex; flex-direction: column; gap: 14px; }
.drop-cust { display: flex; align-items: center; gap: 14px; }
.drop-name { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; }
.drop-status { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.drop-status > div { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); }
.drop-money { padding: 18px 18px 16px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); }
.drop-remaining { font-size: 40px; font-weight: 650; letter-spacing: -0.03em; line-height: 1.1; margin-top: 4px; }
.drop-money-rows { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.drop-money-rows strong { color: var(--ink); font-weight: 500; margin-left: 4px; }
.drop-cta { height: 60px; font-size: 17px; border-radius: 12px; gap: 10px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 104px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); text-align: left; transition: border-color var(--t), transform 80ms; }
.tile:hover:not(:disabled) { border-color: var(--border-strong); }
.tile:active:not(:disabled) { transform: scale(.98); }
.tile-ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-tint); color: var(--accent); margin-bottom: 6px; }
.tile-l { font-weight: 600; font-size: 15px; }
.tile-s { font-size: 12.5px; color: var(--muted); }
.tile.ok .tile-ic { background: var(--success-tint, #ECFDF3); color: var(--success); }
.tile.ok .tile-s { color: var(--success); }
.tile.locked .tile-ic, .tile:disabled .tile-ic { background: var(--surface-2); color: var(--faint); }
.tile:disabled { opacity: .55; cursor: not-allowed; }
.drop-sec { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px 16px; }
.drop-sec h3 { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.drop-note { padding: 10px 12px; background: #FFFCF0; border: 1px solid #F5E7B8; border-radius: var(--r); font-size: 14px; }
.drop-note + .drop-note { margin-top: 8px; }
.up-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.up-row:last-child { border-bottom: 0; }
.proof-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.proof-grid figure { margin: 0; }
.proof-grid img, .proof-grid video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); display: block; }
.proof-grid figure.sig img { object-fit: contain; background: #fff; }
.proof-grid figcaption { font-size: 11.5px; color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proof-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--r-lg); }
.proof-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.proof-row:last-child { border-bottom: 0; }
.proof-ic { color: var(--faint); margin-top: 1px; }
.proof-row.ok .proof-ic { color: var(--success); }
.proof-row.bad .proof-ic { color: var(--warn); }
.rec-timer { position: absolute; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: 999px; background: rgba(11,18,32,.7); color: #fff; font-size: 13px; font-variant-numeric: tabular-nums; }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: #F04438; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.cam-shutter.rec span { background: #F04438; }
.cam-shutter.rec.on span { width: 26px; height: 26px; border-radius: 6px; }

/* ---------- Signature (customer-facing) ---------- */
.overlay.sig-overlay { background: #fff; overflow-y: auto; }
.sig-screen { width: 100%; max-width: 560px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }
.sig-body { flex: 1; padding: 28px 20px 16px; }
.sig-body h1 { font-size: 26px; letter-spacing: -0.02em; }
.sig-order { margin: 18px 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.sig-agree { font-size: 14.5px; line-height: 1.55; margin-bottom: 16px; }
.sig-pad-wrap { position: relative; margin-top: 16px; }
.sig-pad { display: block; width: 100%; height: 200px; border: 1.5px dashed var(--border-strong); border-radius: var(--r-lg); background: #fff; touch-action: none; cursor: crosshair; }
.sig-hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: var(--faint); pointer-events: none; font-size: 15px; transition: opacity .15s; }
.sig-err { color: var(--danger); font-size: 13.5px; margin-top: 10px; min-height: 1em; }
.sig-foot { position: sticky; bottom: 0; display: flex; gap: 10px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--border); }
.sig-foot .btn { height: 52px; }
.sig-cancel { align-self: center; margin: 4px 0 12px; border: 0; background: none; color: var(--faint); }
.sig-done { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 20px; }
.sig-done-ic { color: var(--success); margin-bottom: 14px; }
.sig-done h1 { font-size: 26px; }

/* ---------- Order drawer ---------- */
.status-pair { display: inline-flex; align-items: center; gap: 6px; }
.money-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.money-strip div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: var(--bg); font-size: 12px; color: var(--muted); }
.money-strip strong { font-size: 16px; color: var(--ink); }
.sched-list, .ledger { margin-top: 12px; border: 1px solid var(--border); border-radius: var(--r-lg); }
.sched-row, .ledger-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.sched-row:last-child, .ledger-row:last-child { border-bottom: 0; }
.ledger-ic { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--success-tint, #ECFDF3); color: var(--success); flex-shrink: 0; }
.ledger-row.refund .ledger-ic { background: var(--surface-2); color: var(--muted); }
.ledger-row.failed .ledger-ic { background: var(--danger-tint); color: var(--danger); }
.ledger-row.failed { color: var(--muted); }
.sig-record { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 16px; align-items: start; }
.sig-img { width: 100%; border: 1px solid var(--border); border-radius: var(--r); background: #fff; }
@media (max-width: 560px) { .sig-record { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Cancel dialog ---------- */
.refund-rows { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--r-lg); }
.refund-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.refund-row:last-child { border-bottom: 0; }
.refund-row .select { width: 140px; }

/* ---------- Roles: order actions ---------- */
.order-acts { border-top: 1px solid var(--border); }
.order-acts .settings-row { cursor: pointer; }
.pay-secure { display: flex; justify-content: center; align-items: flex-start; gap: 4px; text-align: center; }
.pay-secure svg { margin-top: 2px; }

/* ---------- Payment link ↔ inventory ---------- */
.linked-item { padding: 12px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.link-item { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 12px; color: var(--ink-2); max-width: 280px; }
.link-item img { width: 18px; height: 18px; border-radius: 4px; object-fit: cover; border: 1px solid var(--border); }
.link-item svg { color: var(--faint); }
.pay-item { display: flex; gap: 12px; align-items: center; margin-top: 20px; padding: 12px; border: 1px solid var(--border); border-radius: var(--r-lg); }
.pay-item img { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); }
