/* RandM WMS scanner UI - plain CSS on top of Tailwind utilities (phone-first, high contrast). */
:root {
  --sb-h: 112px;
}
html, body { height: 100%; -webkit-tap-highlight-color: transparent; }
body { font-size: 17px; }
body.has-scanbar main { padding-bottom: calc(var(--sb-h) + 16px); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 56px; padding: .75rem 1rem; border-radius: .75rem; font-weight: 700; font-size: 1.05rem;
  border: 2px solid transparent; width: 100%; text-align: center; line-height: 1.2; cursor: pointer;
  user-select: none; touch-action: manipulation;
}
.btn:active { transform: translateY(1px); filter: brightness(.95); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: #0f766e; color: #fff; }
.btn-ok { background: #15803d; color: #fff; }
.btn-sec { background: #fff; color: #0f172a; border-color: #cbd5e1; }
.btn-dark { background: #1e293b; color: #fff; }
.btn-danger { background: #fff; color: #b91c1c; border-color: #fca5a5; }
.btn-danger-solid { background: #b91c1c; color: #fff; }
.btn-warn { background: #d97706; color: #fff; }
.btn-sm { min-height: 44px; font-size: .95rem; padding: .5rem .75rem; width: auto; }
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border-radius: .5rem; color: #fff;
}
.btn-icon:active { background: rgba(255,255,255,.15); }

.card { background: #fff; border-radius: 1rem; padding: 1rem; box-shadow: 0 1px 2px rgba(15,23,42,.08); border: 1px solid #e2e8f0; }
.card-tap { cursor: pointer; }
.card-tap:active { background: #f1f5f9; }

.tile {
  display: flex; flex-direction: column; justify-content: space-between; min-height: 110px; padding: 1rem;
  border-radius: 1rem; background: #fff; border: 1px solid #e2e8f0; color: #0f172a; font-weight: 700;
  box-shadow: 0 1px 2px rgba(15,23,42,.08); position: relative;
}
.tile:active { background: #f1f5f9; }
.tile .count {
  position: absolute; top: .6rem; right: .6rem; min-width: 32px; height: 32px; padding: 0 .5rem; border-radius: 999px;
  background: #0f766e; color: #fff; font-size: .95rem; display: inline-flex; align-items: center; justify-content: center;
}
.tile .count.zero { background: #cbd5e1; color: #334155; }
.tile svg { width: 32px; height: 32px; color: #0f766e; }

.chip { display: inline-flex; align-items: center; padding: .15rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.chip-slate { background: #e2e8f0; color: #334155; }
.chip-green { background: #dcfce7; color: #166534; }
.chip-amber { background: #fef3c7; color: #92400e; }
.chip-red { background: #fee2e2; color: #991b1b; }
.chip-blue { background: #dbeafe; color: #1e40af; }

.loc-big { font-size: 2.6rem; font-weight: 900; letter-spacing: .02em; line-height: 1.05; word-break: break-all; }
.qty-big { font-size: 3rem; font-weight: 900; line-height: 1; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.step { display: flex; align-items: center; gap: .5rem; font-size: .85rem; font-weight: 700; color: #475569; }
.step .dot { width: 26px; height: 26px; border-radius: 999px; background: #e2e8f0; color: #334155; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; }
.step.active .dot { background: #0f766e; color: #fff; }
.step.done .dot { background: #15803d; color: #fff; }

/* bottom scan bar */
#scanbar { box-shadow: 0 -2px 10px rgba(15,23,42,.12); }
#scanfield {
  flex: 1; min-width: 0; height: 56px; border: 2px solid #94a3b8; border-radius: .75rem; padding: 0 .9rem; font-size: 1.15rem;
  background: #f8fafc; color: #0f172a;
}
#scanfield:focus { outline: none; border-color: #0f766e; box-shadow: 0 0 0 3px rgba(15,118,110,.25); background: #fff; }
.sb-btn { height: 56px; min-width: 56px; padding: 0 .6rem; border-radius: .75rem; border: 2px solid #cbd5e1; background: #fff; font-weight: 700; font-size: .85rem; }
.sb-btn.active { background: #0f766e; color: #fff; border-color: #0f766e; }
.sb-btn:active { filter: brightness(.95); }

#camera-view { width: 100%; height: 100%; }
#camera-view video { width: 100% !important; height: 100% !important; object-fit: cover; }

/* numpad */
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.numpad button { min-height: 58px; font-size: 1.5rem; font-weight: 700; border-radius: .75rem; background: #fff; border: 2px solid #cbd5e1; color: #0f172a; }
.numpad button:active { background: #e2e8f0; }
.numpad button.fn { background: #f1f5f9; font-size: 1.1rem; }
.qty-display { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .6rem; }
.qty-display .val { flex: 1; text-align: center; font-size: 2.8rem; font-weight: 900; line-height: 1; }
.qty-display .pm { width: 64px; height: 64px; border-radius: .75rem; border: 2px solid #cbd5e1; background: #fff; font-size: 2rem; font-weight: 800; }
.qty-display .pm:active { background: #e2e8f0; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--sb-h) + 12px); transform: translateX(-50%); z-index: 50;
  max-width: calc(100% - 24px); padding: .8rem 1.1rem; border-radius: .9rem; color: #fff; font-weight: 700; font-size: 1rem;
  box-shadow: 0 6px 20px rgba(15,23,42,.25); text-align: center;
}
body:not(.has-scanbar) .toast { bottom: 20px; }
.toast-ok { background: #15803d; }
.toast-error { background: #b91c1c; }
.toast-info { background: #1e293b; }
.toast-warn { background: #b45309; }

.banner { border-radius: .9rem; padding: .9rem 1rem; font-weight: 700; }
.banner-ok { background: #dcfce7; color: #14532d; border: 1px solid #86efac; }
.banner-error { background: #fee2e2; color: #7f1d1d; border: 1px solid #fca5a5; }
.banner-warn { background: #fef3c7; color: #78350f; border: 1px solid #fcd34d; }
.banner-info { background: #e0f2fe; color: #0c4a6e; border: 1px solid #7dd3fc; }

.flash { padding: .75rem 1rem; font-weight: 700; }
.flash-ok { background: #dcfce7; color: #14532d; }
.flash-error { background: #fee2e2; color: #7f1d1d; }

.input {
  width: 100%; min-height: 56px; border: 2px solid #94a3b8; border-radius: .75rem; padding: 0 .9rem; font-size: 1.1rem; background: #fff;
}
.input:focus { outline: none; border-color: #0f766e; box-shadow: 0 0 0 3px rgba(15,118,110,.25); }
label.lbl { display: block; font-size: .85rem; font-weight: 700; color: #475569; margin-bottom: .3rem; }

.line-row { display: flex; align-items: center; gap: .75rem; padding: .7rem .9rem; border-radius: .75rem; border: 1px solid #e2e8f0; background: #fff; }
.line-row.done { opacity: .55; }
.line-row.current { border-color: #0f766e; box-shadow: 0 0 0 2px rgba(15,118,110,.3); }

/* print station choice + quarantine reasons (end of the turbo pick) */
.station {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem; width: 100%; text-align: left;
  min-height: 64px; padding: .7rem .9rem; border-radius: .9rem; border: 2px solid #cbd5e1; background: #fff; color: #0f172a;
}
.station:active { background: #f1f5f9; }
.station.selected { border-color: #0f766e; box-shadow: 0 0 0 3px rgba(15,118,110,.25); background: #ecfdf5; }
.reason {
  min-height: 48px; padding: .5rem .9rem; border-radius: 999px; border: 2px solid #cbd5e1; background: #fff; color: #0f172a;
  font-weight: 700; font-size: .95rem;
}
.reason.selected { background: #0f766e; border-color: #0f766e; color: #fff; }

.pulse { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

.hidden { display: none !important; }
