/* Star South Warehouse - built for the floor: gloves, cold rooms, sunlight.
   Brand: Navy grounds the bar, Sky draws hairlines, Apple is the one accent (ready, saved).
   Numbers in Times, everything else in Helvetica. Pomegranate only says "refused". */
:root {
  --navy: #132041; --apple: #7BB856; --pom: #AD3150; --sky: #BCD8F0;
  --ground: #F4F6F8; --line: #E6EBF0; --ink: #132041; --muted: #4F5B73; --white: #FFFFFF;
  --serif: "Times New Roman", Times, "Liberation Serif", Georgia, serif;
  --sans: Helvetica, "Helvetica Neue", Arial, "Liberation Sans", system-ui, sans-serif;
  --tap: 56px; --r-lg: 28px; --r-md: 16px; --r-sm: 999px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ground); color: var(--ink); font: 17px/1.45 var(--sans); -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
:focus-visible { outline: 3px solid var(--apple); outline-offset: 2px; }
[hidden] { display: none !important; }

/* the bar: the one dark band */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--navy); color: #fff; }
.top-mark { height: 30px; width: auto; display: block; }
.top-app { font: 400 21px var(--serif); padding-left: 12px; border-left: 1px solid rgba(255,255,255,.14); }
.sync { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 14px; border-radius: var(--r-sm); border: 1px solid rgba(255,255,255,.14); background: transparent; color: #fff; font: 600 14px var(--sans); cursor: pointer; }
.sync i { width: 10px; height: 10px; border-radius: 50%; background: var(--apple); }
.sync.wait i { background: var(--sky); animation: pulse 1.2s ease-in-out infinite; }
.sync.off i { background: transparent; border: 2px solid var(--sky); }
@keyframes pulse { 50% { opacity: .35; } }
.banner { padding: 12px 16px; background: var(--sky); color: var(--navy); font-weight: 600; }
.banner a { color: var(--navy); }

.view { max-width: 720px; margin: 0 auto; padding: 20px 16px 32px; outline: none; }
h1 { font: 400 32px/1.15 var(--serif); margin: 4px 0 6px; }
h2 { font: 400 22px var(--serif); margin: 0 0 10px; }
h3 { font: 700 15px var(--sans); margin: 0 0 8px; }
.step { margin: 0 0 14px; font: 700 12px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--apple); }
.note { color: var(--muted); font-size: 15px; }
.label { font-weight: 700; margin: 16px 0 8px; }
.got { font-size: 16px; margin: 6px 0 12px; }
.num { font-family: var(--serif); font-variant-numeric: tabular-nums; }
.sscc { font: 600 17px var(--sans); letter-spacing: .02em; font-variant-numeric: tabular-nums; word-break: break-all; }

/* the scan field: the biggest thing on every screen */
.scan { display: grid; gap: 8px; margin: 0 0 16px; }
.scan-label { font-weight: 700; font-size: 16px; }
.scan-row { display: flex; gap: 10px; }
.scan-input { flex: 1; min-width: 0; height: 64px; padding: 0 18px; border: 2px solid var(--navy); border-radius: var(--r-md); background: var(--white); font: 600 20px var(--sans); color: var(--ink); letter-spacing: .02em; }
.scan-input:focus { border-color: var(--apple); box-shadow: 0 0 0 4px rgba(123,184,86,.25); outline: none; }
.scan-input.shake { animation: shake .35s; border-color: var(--pom); }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.btn.cam { width: 64px; height: 64px; padding: 0; justify-content: center; border-radius: var(--r-md); }

.field { display: grid; gap: 6px; margin: 0 0 14px; font-size: 14px; font-weight: 700; }
.field input, .field select { height: var(--tap); padding: 0 14px; border: 1px solid #B9C3D3; border-radius: 12px; background: var(--white); font: 18px var(--sans); color: var(--ink); min-width: 0; width: 100%; }
.check { display: flex; align-items: center; gap: 10px; min-height: var(--tap); font-weight: 600; }
.check input { width: 26px; height: 26px; accent-color: var(--navy); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: var(--r-sm); border: 1.5px solid var(--navy); background: var(--white); color: var(--navy); font: 700 15px var(--sans); text-decoration: none; cursor: pointer; }
.btn:disabled { opacity: .4; cursor: default; }
.btn-primary { background: var(--navy); color: #fff; }
.btn.big { min-height: var(--tap); padding: 0 28px; font-size: 17px; }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.chip { min-height: var(--tap); padding: 0 20px; border-radius: var(--r-sm); border: 1.5px solid var(--navy); background: var(--white); color: var(--navy); font: 700 16px var(--sans); cursor: pointer; }
.chip:active { background: var(--navy); color: #fff; }

/* a pallet */
.plate { background: var(--white); border-radius: var(--r-md) var(--r-md) var(--r-md) 4px; border-left: 6px solid var(--sky); padding: 14px 16px; margin: 0 0 14px; }
.plate.available { border-left-color: var(--apple); } .plate.on_hold, .plate.damaged { border-left-color: var(--pom); } .plate.shipped { border-left-color: var(--line); }
.plate-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.plate-where { margin: 6px 0 4px; }
.pill { flex: none; padding: 3px 12px; border-radius: var(--r-sm); background: var(--ground); font: 700 13px var(--sans); }
.pill.available { background: rgba(123,184,86,.18); } .pill.on_hold, .pill.damaged { background: rgba(173,49,80,.12); color: var(--pom); }
.lines { list-style: none; margin: 8px 0 0; padding: 0; }
.lines li { display: flex; gap: 12px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--line); }
.lines .num { font-size: 26px; min-width: 70px; }
.history { list-style: none; margin: 12px 0 0; padding: 0; }
.history li { padding: 8px 0 8px 14px; border-left: 2px solid var(--sky); margin-left: 4px; font-size: 15px; }
.history small { display: block; color: var(--muted); font-size: 13px; }

.block { background: var(--white); border-radius: var(--r-md); padding: 18px; margin: 0 0 16px; }
.form { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.att { list-style: none; margin: 0; padding: 0; }
.att li { display: grid; gap: 4px; padding: 12px 0 12px 14px; border-bottom: 1px solid var(--line); border-left: 4px solid var(--sky); }
.att li.refused { border-left-color: var(--pom); } .att li.conflict { border-left-color: #8C97AE; }
.att small { color: var(--muted); } .att .btn { justify-self: start; } .att .btns { display: flex; gap: 8px; flex-wrap: wrap; }
.okline { color: var(--navy); font-weight: 700; } .okline::before { content: '✓ '; color: var(--apple); }
.table-wrap { overflow-x: auto; margin-top: 12px; }
.table { border-collapse: collapse; width: 100%; font-size: 15px; }
.table th { text-align: left; font: 700 12px var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--sky); }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; } .table .r { text-align: right; }
.about p { margin: 4px 0; color: var(--muted); font-size: 14px; }

/* tabs along the bottom, where a thumb is */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--white); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs button { min-height: 64px; border: 0; background: none; font: 700 15px var(--sans); color: var(--muted); cursor: pointer; border-top: 3px solid transparent; }
.tabs button.on { color: var(--navy); border-top-color: var(--apple); }

/* the camera */
.camera { position: fixed; inset: 0; z-index: 50; background: #000; display: grid; place-items: center; }
.camera video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.camera-frame { position: relative; width: min(78vw, 420px); aspect-ratio: 1.6; border: 3px solid var(--apple); border-radius: var(--r-md); box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); }
.camera-hint { position: absolute; top: calc(18px + env(safe-area-inset-top)); left: 0; right: 0; text-align: center; color: #fff; font-weight: 700; }
.camera-close { position: absolute; bottom: calc(24px + env(safe-area-inset-bottom)); }

.toast { position: fixed; left: 16px; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 40; max-width: 560px; margin: 0 auto; padding: 14px 18px; border-radius: var(--r-md); background: var(--navy); color: #fff; font-weight: 600; }
.toast.bad { background: var(--pom); }

/* signed-out and refusal pages */
body.plain { padding: 0; display: grid; place-items: center; min-height: 100dvh; }
.plain-card { max-width: 460px; margin: 24px; padding: 32px; background: var(--white); border-radius: var(--r-lg) var(--r-lg) var(--r-lg) 4px; }
.plain-card h1 { margin-top: 18px; }

@media (min-width: 760px) { .tabs { left: 50%; right: auto; width: 720px; transform: translateX(-50%); border: 1px solid var(--line); border-bottom: 0; border-radius: var(--r-md) var(--r-md) 0 0; } }
@media (max-width: 380px) { .pair { grid-template-columns: 1fr; } h1 { font-size: 27px; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }

/* 0.2 */
.banner.warn { background: #F4E4C1; }
.links { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 0; }
.pair .btn { justify-content: center; }
