/* The System - the one stylesheet for every page (no inline styles: the
   Content-Security-Policy forbids them). The look follows Lookout Ahead:
   a light gray page, white rounded panels with a faint border and shadow,
   blue buttons. Every value is described in docs/style-guide.md; change
   both together. Rules: system fonts only, light theme only, nothing
   loaded from anywhere but our own /static/ (tests/test_style.py checks
   this; it also trips on those words in comments), text contrast at
   least 4.5:1, and
   every button and form field at least 44px tall. The scanner pages
   (body.scanner) are bigger and bolder and fit the Zebra TC21's screen
   (about 360 CSS pixels wide). */

:root {
    /* Page and panels */
    --page-bg: #f9fafb;
    --surface: #ffffff;
    --surface-muted: #f9fafb;
    --border: #f3f4f6;
    --border-strong: #e5e7eb;
    --input-border: #d1d5db;

    /* Text */
    --text: #111827;
    --text-body: #374151;
    --text-muted: #4b5563;

    /* Actions */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-text: #ffffff;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --danger-text: #ffffff;
    --sign-out: #374151;
    --sign-out-hover: #1f2937;
    --sign-out-text: #ffffff;
    --focus-ring: #3b82f6;
    --link: #2563eb;

    /* Messages */
    --error-bg: #fef2f2;
    --error-border: #fecaca;
    --error-text: #b91c1c;
    --done-bg: #f0fdf4;
    --done-border: #bbf7d0;
    --done-text: #166534;
    --warning-bg: #fffbeb;
    --warning-border: #fde68a;
    --warning-text: #92400e;

    /* The scanner's status strip, "sending" and "waiting" (plain gray) */
    --strip-plain-bg: #f3f4f6;
    --strip-plain-text: #374151;

    /* The scanner home's four buttons (CLAUDE.md Section 9) */
    --scan-check-bg: #2563eb;
    --scan-check-hover: #1d4ed8;
    --scan-check-text: #ffffff;
    --scan-truck-bg: #facc15;
    --scan-truck-hover: #eab308;
    --scan-truck-text: #111827;
    --scan-floor-bg: #15803d;
    --scan-floor-hover: #166534;
    --scan-floor-text: #ffffff;
    --scan-delivery-bg: #f97316;
    --scan-delivery-hover: #ea580c;
    --scan-delivery-text: #111827;

    /* The desktop layout's left menu (Master and Admin pages, Build 4b) */
    --menu-bg: #1e293b;
    --menu-text: #e2e8f0;
    --menu-hover: #334155;
    --menu-current-bg: #2563eb;
    --menu-current-text: #ffffff;

    /* Shape */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);

    /* Type */
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --control-height: 44px;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-body);
    background: var(--page-bg);
}

/* Top bar */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border-strong);
    padding: 1rem;
}

.topbar-inner { max-width: 70rem; margin: 0 auto; }

.brand { font-size: 1.125rem; font-weight: 600; color: var(--text); }

/* Page width: narrow for sign-in and short forms, wide for the Master lists */
.page { max-width: 28rem; margin: 0 auto; padding: 1.5rem 1rem 3rem; }

.page.wide { max-width: 72rem; }

/* On a laptop, a button straight inside a wide page's panel (Add a person,
   Clear all) or in the Newer/Older row is only as wide as it needs to
   be; on a phone it stays full width */
@media (min-width: 640px) {
    .page.wide .panel > .button, .page.wide .paging .button {
        display: inline-flex;
        width: auto;
        min-width: 14rem;
        margin-right: 0.5rem;
        vertical-align: middle;
    }

    .page.wide .paging .button { flex: none; }
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 2rem;
}

/* Text */
h1 { font-size: 1.5rem; font-weight: 700; line-height: 1.25; color: var(--text); margin: 0 0 1.25rem; }

h2 { font-size: 1.125rem; font-weight: 600; line-height: 1.4; color: var(--text); margin: 1.75rem 0 0.75rem; }

p { margin: 0 0 1rem; }

strong { color: var(--text); font-weight: 600; }

a { color: var(--link); }

.device-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    margin: 0 0 0.25rem;
}

/* Forms */
label { display: block; font-size: 0.875rem; font-weight: 500; color: var(--text-body); margin: 1rem 0 0.25rem; }

input[type="password"], input[type="text"], input[type="date"], input[type="search"], select {
    display: block;
    width: 100%;
    min-height: var(--control-height);
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text);
    background: var(--surface);
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
}

input:focus, select:focus {
    outline: none;
    border-color: var(--focus-ring);
    box-shadow: 0 0 0 2px var(--focus-ring);
}

input.pin {
    min-height: 3.5rem;
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: 0.3em;
    text-align: center;
}

fieldset {
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    margin: 1.25rem 0;
    padding: 0.5rem 1rem 0.75rem;
}

legend { font-size: 0.875rem; font-weight: 500; color: var(--text-body); padding: 0 0.25rem; }

label.choice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: var(--control-height);
    margin: 0;
    font-size: 1rem;
    font-weight: 400;
    color: var(--text);
    cursor: pointer;
}

label.choice input { width: 1.25rem; height: 1.25rem; margin: 0; flex: none; accent-color: var(--primary); }

/* Log filters: one row on a laptop, stacked on a phone */
.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 0 1rem;
    align-items: end;
    margin: 0 0 1.5rem;
}

.filters .button { margin: 1rem 0 0; }

/* Buttons */
.button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: var(--control-height);
    margin: 0.75rem 0;
    padding: 0.625rem 1.25rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    color: var(--primary-text);
    background: var(--primary);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}

.button:hover { background: var(--primary-hover); }

.button.big { min-height: 3.25rem; font-size: 1.0625rem; border-radius: var(--radius-md); }

.button.danger { color: var(--danger-text); background: var(--danger); }

.button.danger:hover { background: var(--danger-hover); }

/* Sign out: dark gray, not red (red is only for removing or deactivating) */
.button.sign-out-button { color: var(--sign-out-text); background: var(--sign-out); }

.button.sign-out-button:hover { background: var(--sign-out-hover); }

.button.secondary { color: var(--text-body); background: var(--surface); border-color: var(--input-border); }

.button.secondary:hover { background: var(--surface-muted); border-color: var(--text-muted); }

.button:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* The scanner home's four colors as plain buttons (the home itself uses the tiles below) */
.button.scan-check { color: var(--scan-check-text); background: var(--scan-check-bg); }

.button.scan-check:hover { background: var(--scan-check-hover); }

.button.scan-truck { color: var(--scan-truck-text); background: var(--scan-truck-bg); }

.button.scan-truck:hover { background: var(--scan-truck-hover); }

.button.scan-floor { color: var(--scan-floor-text); background: var(--scan-floor-bg); }

.button.scan-floor:hover { background: var(--scan-floor-hover); }

.button.scan-delivery { color: var(--scan-delivery-text); background: var(--scan-delivery-bg); }

.button.scan-delivery:hover { background: var(--scan-delivery-hover); }

/* The scanner home: four big tiles, two by two, each with a large icon
   above a large bold label (docs/style-guide.md) */
.scan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 0.75rem 0 0; }

.scan-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 150px;
    padding: 1rem 0.5rem;
    text-align: center;
    text-decoration: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
}

.scan-tile:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }

.scan-icon { display: block; width: 56px; height: 56px; flex: none; }

.scan-tile-label { font-size: 20px; font-weight: 700; line-height: 1.2; }

.scan-tile.scan-check { color: var(--scan-check-text); background: var(--scan-check-bg); }

.scan-tile.scan-check:hover { background: var(--scan-check-hover); }

.scan-tile.scan-truck { color: var(--scan-truck-text); background: var(--scan-truck-bg); }

.scan-tile.scan-truck:hover { background: var(--scan-truck-hover); }

.scan-tile.scan-floor { color: var(--scan-floor-text); background: var(--scan-floor-bg); }

.scan-tile.scan-floor:hover { background: var(--scan-floor-hover); }

.scan-tile.scan-delivery { color: var(--scan-delivery-text); background: var(--scan-delivery-bg); }

.scan-tile.scan-delivery:hover { background: var(--scan-delivery-hover); }

/* Hidden on screen, still read by screen readers (the scanner home's title) */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Check status: the box's codes big, then its status as tags */
.status-message { font-size: 1.25rem; }

.status-box {
    background: var(--surface-muted);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin: 0 0 1rem;
}

.status-ids { margin: 0 0 0.75rem; }

.status-ids dt { font-size: 0.875rem; font-weight: 600; color: var(--text-muted); }

.status-ids dd {
    margin: 0 0 0.5rem;
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text);
    overflow-wrap: anywhere;
}

.status-facts { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }

.status-facts li {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.75rem;
}

.status-facts li.status-damaged { color: var(--error-text); background: var(--error-bg); border-color: var(--error-border); }

.status-description { margin: 0.75rem 0 0; font-size: 1.125rem; color: var(--text); }

/* A grid of menu buttons (the home pages): two or three across on a laptop */
.menu {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 0.75rem;
    margin: 1.25rem 0;
}

.menu .button { margin: 0; }

.paging { display: flex; gap: 0.75rem; }

.paging .button { flex: 1; }

/* Messages */
.error, .done, .warning {
    font-weight: 500;
    border: 1px solid;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
}

.error { color: var(--error-text); background: var(--error-bg); border-color: var(--error-border); }

.done { color: var(--done-text); background: var(--done-bg); border-color: var(--done-border); }

.warning { color: var(--warning-text); background: var(--warning-bg); border-color: var(--warning-border); }

/* Sign-out at the bottom of every signed-in page */
.sign-out { margin-top: 1.5rem; padding: 1.5rem 2rem; }

.sign-out .button { margin-top: 0; }

.sign-out p { margin: 0; font-size: 0.875rem; color: var(--text-muted); text-align: center; }

/* Cards inside a panel (devices, lockouts) */
.card {
    background: var(--surface-muted);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin: 0.75rem 0;
}

.card h2 { margin: 0 0 0.75rem; }

.card p:last-of-type { margin-bottom: 0.5rem; }

.card .button { margin-bottom: 0; }

/* Several cards side by side on a laptop, one under another on a phone */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 0.75rem; margin: 0 0 1.25rem; }

.cards .card { margin: 0; }

/* Facts list (a person, a device) */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1.5rem; margin: 0 0 1.25rem; }

.facts dt { font-size: 0.875rem; font-weight: 500; color: var(--text-muted); }

.facts dd { margin: 0; color: var(--text); }

/* Tables (people, sign-in log, wrong PINs): clean, Zoho-like */
.table-wrap {
    overflow-x: auto;
    margin: 0 0 1.25rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--surface);
}

table { border-collapse: collapse; width: 100%; font-size: 0.875rem; }

th, td { padding: 0.75rem 1rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border-strong); }

tbody tr:last-child td { border-bottom: none; }

th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--surface-muted);
    white-space: nowrap;
}

td { color: var(--text-body); }

tbody tr:hover td { background: var(--surface-muted); }

th.number, td.number { text-align: right; font-variant-numeric: tabular-nums; }

td:first-child { white-space: nowrap; }

table.log td { white-space: nowrap; }

table a { font-weight: 500; color: var(--link); text-decoration: none; }

table a:hover { text-decoration: underline; }

/* A person's PIN, shown to the Master */
.pin-shown {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.3em;
    text-align: center;
    font-variant-numeric: tabular-nums;
    margin: 1.5rem 0;
}

/* The Back button: top left, above the page title, only as wide as its text */
.button.back { display: inline-flex; width: auto; min-width: 6rem; margin: 0 0 1rem; }

.page.wide .panel > .button.back { min-width: 6rem; }

/* The scanner's Scan test page: every character of a scan made visible */
.scan-raw {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    background: var(--surface-muted);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    margin: 0 0 0.5rem;
}

.marker {
    display: inline-block;
    font-size: 0.875em;
    font-weight: 700;
    color: var(--warning-text);
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    border-radius: 4px;
    padding: 0 0.25em;
    margin: 0 0.1em;
}

.scan-count, .scan-note { font-size: 0.875rem; color: var(--text-muted); }

.scan-parts { list-style: none; margin: 0 0 1.5rem; padding: 0; }

.scan-parts li {
    background: var(--surface-muted);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    margin: 0 0 0.5rem;
}

.scan-parts li.scan-separator { background: var(--surface); border-style: dashed; padding: 0.25rem 1rem; }

.scan-parts p { margin: 0; }

.scan-kind { font-weight: 700; color: var(--text); }

.scan-data { font-size: 1.25rem; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }

.scan-prefix { color: var(--text-muted); }

input.scan-input { min-height: 3.5rem; font-size: 1.25rem; }

/* Every scan screen: the whole screen area is the label for a hidden scan box.
   The box is see-through but still focusable (never display: none or
   visibility: hidden), so DataWedge can type into it and its Enter submits. */
label.scan-screen {
    position: relative;
    display: block;
    min-height: 40vh;
    margin: 0;
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-body);
    cursor: pointer;
}

.scan-screen input.scan-hidden {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    min-height: 0;
    padding: 0;
    margin: 0;
    border: 0;
    opacity: 0;
    caret-color: transparent;
}

/* The message follows the box's focus: "Scan a box" while it can take a scan,
   "Tap the screen, then scan" when it can't */
.scan-ready, .scan-tap {
    display: none;
    font-size: 1.75rem;
    font-weight: 800;
    text-align: center;
    margin: 1.5rem 0 0;
    padding: 1.5rem 1rem;
    border-radius: var(--radius-md);
}

.scan-ready { color: var(--text); }

.scan-tap { color: var(--warning-text); background: var(--warning-bg); border: 2px solid var(--warning-border); }

.scan-hidden:focus ~ .scan-ready { display: block; }

.scan-hidden:not(:focus) ~ .scan-tap { display: block; }

/* A small, plain text-style button, out of the way ("Type a serial") */
.text-button {
    display: block;
    min-height: var(--control-height);
    margin: 1.5rem 0 0;
    padding: 0.625rem 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--link);
    text-align: center;
    text-decoration: underline;
    background: none;
    border: 0;
}

.text-button:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* A quiet gray text link, centered (the scanner home's temporary
   "Scan test" link; it comes off before real use) */
.quiet-link {
    display: block;
    min-height: var(--control-height);
    margin: 0.5rem 0 0;
    padding: 0.625rem 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    color: var(--text-muted);
    text-align: center;
}

.quiet-link:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* The desktop layout (Master and Admin pages, Build 4b; docs/style-guide.md
   "Desktop layout"): a slim top bar, a dark left menu, and the page filling
   the rest of the width. Below 900px the menu folds into the Menu button: a
   checkbox (see-through but focusable) and its label, no script. */
.desk-menu-toggle {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
}

.desk-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    padding: 8px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border-strong);
}

.desk-menu-button {
    display: none;
    align-items: center;
    gap: 8px;
    min-height: var(--control-height);
    margin: 0;
    padding: 0 12px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-body);
    background: var(--surface);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.desk-menu-toggle:focus-visible + .desk-top .desk-menu-button { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

.desk-search { flex: 1 1 18rem; max-width: 32rem; margin: 0; }

.desk-search input { margin: 0; }

.desk-user { display: flex; align-items: center; gap: 12px; margin-left: auto; }

.desk-user form { margin: 0; }

.desk-name { font-size: 0.875rem; font-weight: 500; color: var(--text-body); }

.button.desk-sign-out { width: auto; margin: 0; padding: 0.5rem 1rem; }

.desk { display: grid; grid-template-columns: 15rem minmax(0, 1fr); min-height: calc(100vh - 61px); }

.desk-menu { padding: 12px 8px; background: var(--menu-bg); }

.desk-menu ul { list-style: none; margin: 0; padding: 0; }

.desk-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: var(--control-height);
    margin: 0 0 2px;
    padding: 8px 12px;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.3;
    color: var(--menu-text);
    text-decoration: none;
    border-radius: var(--radius-sm);
}

.desk-menu a:hover { background: var(--menu-hover); }

.desk-menu a.current { color: var(--menu-current-text); background: var(--menu-current-bg); }

.desk-menu a:focus-visible { outline: 2px solid var(--menu-text); outline-offset: -2px; }

.desk-icon { display: block; width: 20px; height: 20px; flex: none; }

.desk-main { min-width: 0; margin: 24px; padding: 2rem; }

/* On a laptop, a button straight inside the page, in a form or in the
   Newer/Older row is only as wide as it needs to be; on a phone it stays
   full width */
@media (min-width: 640px) {
    .desk-main > .button, .desk-main > p > .button, .desk-main form > .button, .desk-main .paging .button {
        display: inline-flex;
        width: auto;
        min-width: 14rem;
        margin-right: 0.5rem;
        vertical-align: middle;
    }

    .desk-main .paging .button { flex: none; }

    .desk-main form input[type="text"], .desk-main form input[type="password"], .desk-main form input[type="date"],
    .desk-main form select, .desk-main form textarea { max-width: 32rem; }
}

@media (max-width: 899px) {
    .desk { display: block; min-height: 0; }

    .desk-menu { display: none; }

    .desk-menu-toggle:checked ~ .desk .desk-menu { display: block; }

    .desk-menu-button { display: inline-flex; }

    .desk-search { order: 3; flex-basis: 100%; max-width: none; }

    .desk-main { margin: 16px; padding: 1.25rem; }
}

/* The Products pages (Build 4b; docs/style-guide.md "Products"): the list's
   title row, its Active / Inactive / All switch, a product's head (the SKU
   large, Edit and the close X), its tabs, and its Overview's two columns */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 1rem; }

.page-head h1 { margin: 0; }

.page-head .button { width: auto; margin: 0; }

.switch { display: inline-flex; flex-wrap: wrap; gap: 4px; margin: 0 0 1rem; padding: 4px; background: var(--surface-muted); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }

.switch a, .tabs a {
    display: inline-flex;
    align-items: center;
    min-height: var(--control-height);
    padding: 0 16px;
    font-weight: 600;
    color: var(--text-body);
    text-decoration: none;
    border-radius: 6px;
}

.switch a.current { color: var(--primary-text); background: var(--primary); }

.tabs { display: flex; gap: 8px; margin: 0 0 1.5rem; border-bottom: 1px solid var(--border-strong); }

.tabs a { border-radius: 0; border-bottom: 3px solid transparent; }

.tabs a.current { color: var(--link); border-bottom-color: var(--link); }

.switch a:focus-visible, .tabs a:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

table.products td.description { white-space: normal; }

th a { color: inherit; text-decoration: none; }

th a:hover { text-decoration: underline; }

.button.small { display: inline-flex; width: auto; margin: 0; padding: 0.5rem 1rem; }

.product-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 0 0 1rem; }

.product-label { margin: 0; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }

.product-sku { margin: 0; font-size: 2rem; overflow-wrap: anywhere; }

.product-actions { display: flex; gap: 8px; }

.button.icon-button { display: inline-flex; gap: 8px; width: auto; min-width: var(--control-height); margin: 0; padding: 0.5rem 0.875rem; }

/* A box's More button (Build 4e): a plain details menu, no script */
.more-menu { position: relative; }

.more-menu > summary { list-style: none; cursor: pointer; }

.more-menu > summary::-webkit-details-marker { display: none; }

.more-menu ul {
    position: absolute;
    right: 0;
    z-index: 10;
    min-width: 15rem;
    margin: 4px 0 0;
    padding: 4px;
    list-style: none;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}

.more-menu a {
    display: flex;
    align-items: center;
    min-height: var(--control-height);
    padding: 0 12px;
    border-radius: var(--radius-sm);
    color: var(--text);
    text-decoration: none;
}

.more-menu a:hover { background: var(--surface-muted); }

.more-menu a:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* The Products list's + New and its product files menu (Build 4f) */
.page-actions { display: flex; gap: 8px; align-items: center; }

/* The product files' upload pages and preview (Build 4f) */
.file-form input[type="file"] { display: block; max-width: 100%; margin: 0 0 0.5rem; }

.file-preview { margin: 1.5rem 0 0; }

.file-preview h3 { margin: 1.5rem 0 0.5rem; }

.file-summary { font-weight: 600; }

table.file-changes ul { margin: 0; padding: 0; list-style: none; }

.file-save .button { width: auto; }

.product-overview { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem); gap: 1.5rem; align-items: start; }

.product-stock { margin: 0; }

.on-hand { margin: 0 0 1rem; font-size: 2.5rem; font-weight: 700; line-height: 1.1; color: var(--text); font-variant-numeric: tabular-nums; }

.history { list-style: none; margin: 0; padding: 0; }

.history .facts { margin-bottom: 0.5rem; }

@media (max-width: 899px) {
    .product-overview { grid-template-columns: minmax(0, 1fr); }
}

/* Phones */
@media (max-width: 480px) {
    .page { padding: 1rem 1rem 2rem; }
    .panel { padding: 1.25rem; }
    .sign-out { padding: 1.25rem; }
    th, td { padding: 0.625rem 0.75rem; }
}

/* Scanner pages: bigger and bolder, easy to hit with gloves, readable in a
   dim warehouse; the whole screen of a 360px-wide Zebra TC21 */
body.scanner { font-size: 1.125rem; color: var(--text); }

body.scanner .topbar { padding: 0.75rem 1rem; }

body.scanner .page { max-width: 30rem; padding: 0.75rem 0.75rem 2rem; }

body.scanner .panel { padding: 1.25rem 1rem; }

body.scanner h1 { font-size: 1.75rem; font-weight: 800; }

body.scanner p { font-size: 1.125rem; }

body.scanner .device-name { font-size: 1rem; font-weight: 600; }

body.scanner label { font-size: 1.125rem; font-weight: 700; color: var(--text); }

body.scanner input.pin { min-height: 4.5rem; font-size: 2.5rem; font-weight: 700; border-width: 2px; }

body.scanner .button { min-height: 3.5rem; font-size: 1.25rem; font-weight: 700; }

body.scanner .button.big { min-height: 4.5rem; font-size: 1.5rem; }

body.scanner .error, body.scanner .done, body.scanner .warning { font-weight: 700; border-width: 2px; }

body.scanner .button.back { min-height: 3.5rem; }

body.scanner .scan-raw, body.scanner .scan-data { font-size: 1.375rem; }

body.scanner .scan-count, body.scanner .scan-note { font-size: 1rem; color: var(--text-body); }

body.scanner input.scan-input { min-height: 4.5rem; font-size: 1.375rem; border-width: 2px; }

body.scanner .sign-out { padding: 1.25rem 1rem; }

body.scanner .sign-out p { font-size: 1rem; color: var(--text-body); }

body.scanner .status-message { font-size: 1.375rem; }

body.scanner label.scan-screen { font-size: 1.125rem; font-weight: 400; color: var(--text); }

/* The scanner home fits the TC21's screen: tiles and Sign out together */
body.scanner .page.scanner-home .sign-out { margin-top: 0.75rem; }

body.scanner .page.scanner-home .device-name { margin: 0; }

/* The scanner's status strip (built 2026-10-06): a slim space always kept
   at the very top of every scanner screen, so nothing moves when it fills
   in; blank when all is well. Only the scanner's script fills it in:
   amber when offline, plain gray while sending (or waiting to send), red
   while any scan couldn't be sent (tap it for the list), and red while
   the server keeps refusing whole requests ("stuck", its message). */
.status-strip { display: flex; min-height: var(--control-height); font-size: 14px; font-weight: 600; line-height: 1.3; }
.status-strip-text, .status-strip-button {
    display: flex;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: 6px 16px;
}
.status-strip.status-offline { color: var(--warning-text); background: var(--warning-bg); border-bottom: 1px solid var(--warning-border); }
.status-strip.status-sending, .status-strip.status-waiting { color: var(--strip-plain-text); background: var(--strip-plain-bg); border-bottom: 1px solid var(--border-strong); }
.status-strip.status-refused, .status-strip.status-stuck { color: var(--error-text); background: var(--error-bg); border-bottom: 1px solid var(--error-border); }
.status-strip-button {
    min-height: var(--control-height);
    font: inherit;
    color: inherit;
    text-align: left;
    text-decoration: underline;
    background: transparent;
    border: 0;
    cursor: pointer;
}
.status-strip-button:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: -3px; }

/* The list of scans that couldn't be sent (tapping the red strip): over the whole screen */
.failed-list {
    position: fixed;
    inset: 0;
    z-index: 20;
    overflow-y: auto;
    margin: 0;
    padding: 20px 16px;
    border-radius: 0;
}
.failed-list[hidden] { display: none; }
.failed-items { list-style: none; margin: 0 0 16px; padding: 0; }
.failed-item {
    margin: 0 0 12px;
    padding: 12px 16px;
    background: var(--surface-muted);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
}
.failed-item p { margin: 0; }
.failed-time { font-size: 14px; color: var(--text-muted); }
.failed-scan { margin: 4px 0; font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.failed-reason { color: var(--error-text); }

/* The lock (15 minutes without use, or 03:00): covers the whole scan screen */
.scan-lock {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: var(--surface);
}
.scan-lock[hidden] { display: none; }
.scan-lock-text { margin: 0; font-size: 24px; font-weight: 800; color: var(--text); text-align: center; }

/* The scanner's sign-out screen: scans still waiting to send */
.waiting-note {
    padding: 12px 16px;
    font-weight: 600;
    color: var(--strip-plain-text);
    background: var(--strip-plain-bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
}
.waiting-note[hidden] { display: none; }

/* The Scan test page: whether the browser agreed to keep the scanner's stored scans */
.storage-kept { margin: 16px 0 0; font-size: 14px; color: var(--text-muted); }
.storage-kept[hidden] { display: none; }

/* The "A scan wasn't accepted" notice (Build 3b): red, at the top of every
   scanner screen until someone taps OK */
.refused-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    color: var(--error-text);
    background: var(--error-bg);
    border-bottom: 2px solid var(--error-border);
}
.refused-notice[hidden] { display: none; }
.refused-notice-text { flex: 1; margin: 0; font-size: 18px; font-weight: 800; }
.refused-notice .button.refused-notice-ok { width: auto; min-width: 5rem; margin: 0; }

/* Truck unloading (Build 3b; CLAUDE.md Section 9, "Truck screens") */
.truck-list { list-style: none; margin: 0; padding: 0; }
.truck-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: var(--control-height);
    margin: 0 0 12px;
    padding: 14px 16px;
    color: var(--scan-truck-text);
    text-decoration: none;
    background: var(--scan-truck-bg);
    border-radius: var(--radius-md);
}
.truck-item:hover { background: var(--scan-truck-hover); }
.truck-item:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.truck-item.truck-elsewhere { color: var(--text-body); background: var(--strip-plain-bg); border: 1px solid var(--border-strong); }
.truck-day { font-size: 22px; font-weight: 800; }
.truck-today { color: inherit; font-weight: 800; letter-spacing: 0.05em; }
.truck-status { font-size: 18px; font-weight: 600; }
.truck-question { font-size: 1.375rem; font-weight: 700; }
.truck-count { font-size: 2rem; font-weight: 800; color: var(--text); margin: 0 0 0.5rem; }
.truck-big { font-size: 1.5rem; font-weight: 800; }
/* Anything the truck script hides stays hidden, whatever its own display
   (a .button is display: flex) */
.truck-panel[hidden], .truck-result[hidden], .truck-off-list[hidden], #truck-scanning[hidden],
.truck-result-note[hidden], .button[hidden], .text-button[hidden], .error[hidden], .warning[hidden],
.done[hidden] { display: none; }

/* One scan's result: big, in its color, until the next pull */
.truck-result { margin: 0 0 0.5rem; padding: 16px; border: 2px solid; border-radius: var(--radius-md); }
.truck-result p { margin: 0; }
.truck-result-title { font-size: 1.75rem; font-weight: 800; line-height: 1.2; }
.truck-result .truck-result-text { margin-top: 6px; font-size: 1.25rem; font-weight: 700; }
.truck-result .truck-result-note { margin-top: 6px; font-size: 1.125rem; font-weight: 600; overflow-wrap: anywhere; }
.truck-result.truck-green { color: var(--done-text); background: var(--done-bg); border-color: var(--done-border); }
.truck-result.truck-gray { color: var(--strip-plain-text); background: var(--strip-plain-bg); border-color: var(--border-strong); }
.truck-result.truck-amber { color: var(--warning-text); background: var(--warning-bg); border-color: var(--warning-border); }
.truck-result.truck-red { color: var(--error-text); background: var(--error-bg); border-color: var(--error-border); }
.truck-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.truck-answers .button { margin: 0; }
.truck-actions { display: flex; justify-content: space-between; gap: 12px; }
.truck-actions .text-button { margin: 0.75rem 0 0; }
.truck-missing-list { margin: 0 0 1rem; padding: 0; list-style: none; max-height: 50vh; overflow-y: auto; }
.truck-missing-list li {
    display: flex;
    flex-direction: column;
    margin: 0 0 8px;
    padding: 10px 14px;
    background: var(--surface-muted);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
}
.truck-missing-code { font-size: 1.25rem; font-weight: 800; color: var(--text); }
.truck-missing-description, .truck-missing-serial { font-size: 1rem; color: var(--text-body); }

textarea {
    display: block;
    width: 100%;
    min-height: 12rem;
    padding: 0.625rem 0.75rem;
    font: inherit;
    font-size: 1rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
}
textarea:focus { outline: 2px solid var(--focus-ring); outline-offset: 1px; border-color: var(--focus-ring); }
.truck-problems { margin: 0 0 1rem; padding-left: 1.25rem; color: var(--error-text); }

/* Trucks, Holden's side (Build 3c): the warning mark, small gray lines,
   and a refused scan's escaped text */
.attention-mark {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.875rem;
    font-weight: 700;
    white-space: nowrap;
    color: var(--warning-text);
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    border-radius: var(--radius-sm);
}
.muted { font-size: 0.875rem; color: var(--text-muted); }
.scanned-text { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.8125rem; overflow-wrap: anywhere; }

/* Inventory adjustments (Build 4c; docs/style-guide.md "Inventory
   adjustments"): the list's Voided mark, the form's fields and item table,
   the "Add items in bulk" dialog, and an adjustment's "Only N was in stock" */
tr.voided td { color: var(--text-muted); }
.voided-mark, .short-mark {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 999px;
    white-space: nowrap;
}
.voided-mark { color: var(--strip-plain-text); background: var(--strip-plain-bg); border: 1px solid var(--border-strong); }
.short-mark { color: var(--warning-text); background: var(--warning-bg); border: 1px solid var(--warning-border); }
.adjust-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0 1rem; }
.adjust-items td { vertical-align: top; }
.adjust-items .adjust-qty { width: 7rem; min-width: 5rem; text-align: right; }
.adjust-items .adjust-type { width: auto; min-width: 11rem; }
.adjust-items .adjust-search { min-width: 14rem; }
.adjust-item { min-width: 14rem; white-space: normal; }
.adjust-sku { font-weight: 600; color: var(--text); }
.adjust-desc { display: block; font-size: 0.875rem; color: var(--text-muted); }
.adjust-on-hand, .adjust-new { padding-top: 1.375rem; }
.adjust-warning { margin: 8px 0 0; padding: 6px 10px; font-size: 0.875rem; }
.adjust-results, .bulk-results, .bulk-entries, .shortfalls { list-style: none; margin: 0; padding: 0; }
.adjust-results[hidden] { display: none; }
.adjust-note { margin: 4px 0 0; font-size: 0.875rem; color: var(--text-muted); }
.adjust-choice, .bulk-choice {
    display: block;
    width: 100%;
    min-height: var(--control-height);
    margin: 4px 0 0;
    padding: 8px 12px;
    font: inherit;
    font-size: 0.875rem;
    text-align: left;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.adjust-choice:hover, .bulk-choice:hover { background: var(--surface-muted); }
.adjust-choice:focus-visible, .bulk-choice:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.adjust-add, .adjust-buttons, .bulk-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin: 1rem 0 0; }
.adjust-add .button, .adjust-buttons .button, .bulk-buttons .button { width: auto; min-width: 14rem; margin: 0; }
.shortfalls li { margin: 0 0 8px; }
.bulk-dialog {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(17, 24, 39, 0.5);
}
.bulk-dialog[hidden] { display: none; }
.bulk-box {
    width: 100%;
    max-width: 56rem;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 24px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
.bulk-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bulk-head h2 { margin: 0; }
.bulk-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.bulk-chosen h3 { margin: 1rem 0 0.25rem; font-size: 0.875rem; font-weight: 600; color: var(--text-body); }
.bulk-entry { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border-strong); }
.bulk-entry-name { flex: 1 1 8rem; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.bulk-stepper { display: inline-flex; align-items: center; gap: 4px; }
.bulk-stepper .button.bulk-step { width: var(--control-height); margin: 0; padding: 0; }
.bulk-stepper .bulk-quantity { width: 5rem; text-align: right; }
@media (max-width: 699px) {
    .bulk-columns { grid-template-columns: minmax(0, 1fr); }
    .bulk-box { padding: 16px; }
}

/* The drop box around an upload page's file input (Build 5b; static/drop.js) */
.drop-box {
    max-width: 32rem;
    margin: 0 0 1rem;
    padding: 1rem;
    background: var(--surface-muted);
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-md);
}
.drop-box.drop-over { border-color: var(--focus-ring); }
.drop-box label { margin-top: 0; }
.drop-box .muted { margin: 0 0 0.5rem; }
.drop-message:empty { display: none; }
.drop-message { margin: 0.5rem 0 0; font-weight: 600; }

/* The Upload truck preview (Build 5b) */
.truck-upload-summary input[type="date"] { display: inline-block; width: auto; margin: 0 0 0 0.25rem; }
.truck-upload-summary label { display: inline; margin: 0; }
.truck-upload-items { margin: 1.5rem 0 0; }
.truck-upload-items summary { cursor: pointer; font-weight: 600; }

/* A replacement serial label (Build 5d-3d; templates/box_label.html): one
   label 4 in by 2 in inside a dashed cut border, sized in inches and the
   barcode in mm so it prints at its true size at 100% scale. On a narrow
   screen it scrolls inside its own box. */
.label-wrap { overflow-x: auto; margin: 1rem 0 0; }
.serial-label {
    box-sizing: border-box;
    width: 4in;
    height: 2in;
    padding: 0.1in 0.15in;
    overflow: hidden;
    color: var(--text);
    text-align: center;
    background: var(--surface);
    border: 1px dashed var(--text);
}
.label-barcode { display: block; margin: 0 auto; }
.serial-label p { margin: 1mm 0 0; color: var(--text); }
.serial-label .label-serial { font-size: 20pt; font-weight: 700; line-height: 1.1; letter-spacing: 0.05em; }
.serial-label .label-product { max-height: 2.5em; overflow: hidden; font-size: 10pt; line-height: 1.25; overflow-wrap: anywhere; }
.serial-label .label-small { font-size: 7pt; line-height: 1.2; }

/* Printing the label page ONLY (its body has class label-page): everything
   but the label is hidden (the left menu, the top bar with its search and
   Sign out, a Back button, and anything marked no-print, like the label
   page's heading and instruction line), so a replacement label prints alone
   near the top of the page. Every selector here starts with body.label-page,
   so printing any other page is unchanged; there is no @page rule (it can't
   be limited to one page), so the browser's own paper size and margins
   apply. tests/test_label_print.py fails on any selector here not tied to
   the label page. */
@media print {
    body.label-page { background: var(--surface); }
    body.label-page .desk-top, body.label-page .desk-menu,
    body.label-page .desk-menu-toggle:checked ~ .desk .desk-menu, body.label-page .desk-menu-toggle,
    body.label-page .desk-menu-button, body.label-page .topbar, body.label-page .sign-out, body.label-page .back,
    body.label-page .no-print { display: none; }
    body.label-page .desk { display: block; min-height: 0; }
    body.label-page .desk-main, body.label-page .panel {
        margin: 0; padding: 0; border: 0; box-shadow: none; background: var(--surface);
    }
    body.label-page .label-wrap { margin: 0; overflow: visible; }
}
