/*
 * The warehouse floor, on a handheld.
 *
 * Lifted from the <style> block in picker_header.php, which is why it looks
 * nothing like app.css: this is one column, 17px base, and every control at
 * least 52px tall because it is tapped with a thumb while the other hand is
 * holding a box. Nothing here is shared with the office screens on purpose --
 * the two are used in different postures and the day one changes should not be
 * the day the other does.
 */

:root {
    --ink: #1f2933;
    --muted: #6b7280;
    --line: #d8dde3;
    --bg: #f3f4f6;
    --accent: #2563eb;
    --good: #047857;
    --bad: #b91c1c;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 17px/1.45 -apple-system, "Segoe UI", Roboto, sans-serif;
}

header {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 14px;
    background: #111827;
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 2;
}

header .branch { font-weight: 600; }

header .who { margin-left: auto; font-size: 14px; opacity: .85; }

header form { margin: 0; }

header button {
    min-height: 40px;
    padding: 6px 12px;
    border: 1px solid #374151;
    border-radius: 8px;
    background: transparent;
    color: #fff;
    font: inherit;
}

main { padding: 14px; max-width: 720px; margin: 0 auto 64px; }

h1 { font-size: 20px; margin: 0 0 14px; }

.flash {
    padding: 14px;
    border-radius: 10px;
    margin-bottom: 14px;
    border: 1px solid;
    font-weight: 500;
}

.flash.success { background: #ecfdf5; border-color: #a7f3d0; color: var(--good); }

.flash.error { background: #fef2f2; border-color: #fecaca; color: var(--bad); }

.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
}

.card.done { border-color: #a7f3d0; background: #f6fefb; }

.card.short { border-color: #fecaca; background: #fffafa; }

/* The shelf, bigger than anything else on the line: it is what somebody reads
   while walking, from arm's length, before they look at the name. */
.card .shelf { font-size: 26px; font-weight: 700; letter-spacing: .5px; }

.card .sku { color: var(--muted); font-size: 14px; }

.card .count { font-size: 20px; font-weight: 600; float: right; }

.muted { color: var(--muted); font-size: 14px; }

/*
 * The job, at the top of the pick list. Read from arm's length between aisles,
 * so the count is large and the bar is there to be understood without reading
 * the count at all.
 */
.summary .progress { font-size: 20px; font-weight: 600; }

.summary .bar {
    height: 10px;
    border-radius: 999px;
    background: var(--line);
    overflow: hidden;
    margin: 10px 0 8px;
}

.summary .bar span {
    display: block;
    height: 100%;
    background: var(--good);
    /* Only ever grows, and only on a page load, so this is cheap and honest. */
    transition: width .2s ease-out;
}

/* Where a line has got to, as a word rather than only a colour: the cards are
   already tinted, and a tint alone is not something everybody can read. */
.state { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }

.badge {
    font-size: 13px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--muted);
}

.badge.partially { border-color: #fde68a; background: #fffbeb; color: #92400e; }

.badge.completed { border-color: #a7f3d0; background: #ecfdf5; color: var(--good); }

/* A button that is off should look off, and should not invite a thumb. */
button[disabled], .button[disabled] {
    opacity: .5;
    cursor: not-allowed;
}

label { display: block; margin: 10px 0 4px; font-size: 14px; color: var(--muted); }

input, select, button, .button {
    font: inherit;
    min-height: 52px;
    border-radius: 10px;
    border: 1px solid var(--line);
    padding: 10px 14px;
    background: #fff;
    color: var(--ink);
}

input, select { width: 100%; }

button, .button {
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

button.danger { border-color: #fecaca; color: var(--bad); }

button.wide, .button.wide { width: 100%; margin-top: 10px; }

/*
 * The scan box. Bigger than everything else because it is the only control
 * anybody touches while walking, and a handheld scanner types into whatever has
 * focus -- so it also has to be obvious when it has lost it.
 */
.scan input {
    font-size: 22px;
    min-height: 60px;
    border-width: 2px;
    border-color: var(--accent);
}

.row { display: flex; gap: 8px; align-items: center; }

.row > * { flex: 1; }

.row .grow2 { flex: 2; }
