/* Conard WMS — visual identity
   Grounded in freight/warehouse signage: slate steel surfaces, one safety-amber
   accent (hazard-stripe yellow, used only for the active state and primary
   actions), Barlow (the DIN-descended transport face) with condensed headers
   like stencil placards, tabular numerals for all quantity columns. */

:root {
  --steel-900: #1b2430;   /* topbar */
  --steel-700: #2c3a4b;
  --steel-100: #eef1f4;   /* page background */
  --ink:       #1d2733;
  --ink-soft:  #5b6a7a;
  --line:      #c6cdd6;   /* card/table hairlines — a notch darker */
  --field:     #66788c;   /* form field borders — must survive washed-out monitors */
  --card:      #ffffff;
  --amber:     #f5a800;   /* safety amber — the one loud color */
  --amber-ink: #3d2e00;
  --ok:        #1e7f4f;
  --danger:    #b3372c;
  --radius:    4px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Barlow', system-ui, sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--steel-100);
}

/* ---- Top bar ---- */
.topbar {
  display: flex; align-items: center; gap: 18px;
  background: var(--steel-900);
  color: #fff;
  padding: 0 16px;
  min-height: 52px;
  flex-wrap: wrap;
  position: sticky; top: 0; z-index: 50;
  /* hazard stripe under the bar — the signature */
  border-bottom: 4px solid;
  border-image: repeating-linear-gradient(135deg, var(--amber) 0 12px, var(--steel-900) 12px 24px) 4;
}
.brand {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600; font-size: 19px; letter-spacing: .04em;
  display: flex; align-items: center; gap: 8px;
  white-space: nowrap;
}
.brand-mark { width: 10px; height: 22px; background: var(--amber); display: inline-block; }
.nav { display: flex; gap: 2px; flex-wrap: wrap; }
.nav a {
  color: #cfd6dd; text-decoration: none;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 500; font-size: 16px; letter-spacing: .03em;
  padding: 15px 11px 12px;
  border-bottom: 3px solid transparent;
}
.nav a:hover { color: #fff; }
.nav a.active { color: #fff; border-bottom-color: var(--amber); }
.userbox { margin-left: auto; font-size: 13px; color: #cfd6dd; white-space: nowrap; }
.userbox .logout { color: var(--amber); text-decoration: none; margin-left: 8px; }
.navtoggle { display: none; background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; }

/* ---- Page ---- */
.page { max-width: 1200px; margin: 0 auto; padding: 20px 16px 60px; }
.page-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600; font-size: 26px; letter-spacing: .02em;
  margin: 4px 0 16px;
}
h2 { font-family: 'Barlow Condensed', sans-serif; font-weight: 600; font-size: 19px; margin: 22px 0 10px; }

.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; font-weight: 500; }
.flash-success { background: #e2f3ea; color: var(--ok); border: 1px solid #b8dfc9; }
.flash-error   { background: #fbe9e7; color: var(--danger); border: 1px solid #efc4bf; }
.flash-warn    { background: #fff7e6; color: var(--amber-ink, #8a5a00); border: 1px solid #f3d999; }

/* ---- Cards / KPI ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--amber); border-radius: var(--radius); padding: 12px 14px; }
.kpi .n { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 12px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; }
a.kpi { display: block; text-decoration: none; color: inherit; transition: border-color .12s, transform .12s, box-shadow .12s; }
a.kpi:hover { border-left-color: var(--amber); box-shadow: 0 2px 10px rgba(20,30,45,.10); transform: translateY(-1px); }
.kpi-go { font-size: 11px; color: var(--amber); margin-top: 6px; font-weight: 600; opacity: 0; transition: opacity .12s; }
a.kpi:hover .kpi-go { opacity: 1; }
.kpi.kpi-alert { border-left-color: #a4262c; }
.kpi.kpi-alert .n { color: #a4262c; }
@media (hover: none) { .kpi-go { opacity: .8; } }

/* ---- Tables ---- */
.tablewrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th {
  text-align: left; padding: 9px 10px;
  font-family: 'Barlow Condensed', sans-serif; font-weight: 600; font-size: 14px;
  letter-spacing: .04em; text-transform: uppercase;
  background: var(--steel-100); color: var(--ink-soft);
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}
table.data td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: #f7f9fb; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-soft); }
.status { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; text-transform: capitalize; }
.status-draft     { background: #e8ecf1; color: var(--ink-soft); }
.status-approved  { background: #fdf3d7; color: #7a5d00; }
.status-picking   { background: #fdf3d7; color: #7a5d00; }
.status-filled    { background: #ddeafc; color: #1d4f91; }
.status-confirmed { background: #ddeafc; color: #1d4f91; }
.status-completed { background: #e2f3ea; color: var(--ok); }
.callout { border: 1px solid var(--line); border-left: 4px solid var(--amber);
  background: #fffaf0; border-radius: var(--radius); padding: 12px 14px; margin: 0 0 12px; line-height: 1.5; }
.callout-warn { border-left-color: var(--amber); }
.callout strong { color: var(--amber-ink); }
.callout a { font-weight: 600; }
.btn-amber { background: var(--amber); color: var(--amber-ink); border-color: var(--amber); font-weight: 600; }
.btn-amber:hover { filter: brightness(0.96); }
.status-cancelled { background: #fbe9e7; color: var(--danger); }

/* ---- Forms ---- */
form.stack label, .field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin: 10px 0 3px; text-transform: uppercase; letter-spacing: .04em; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=email], select, textarea {
  width: 100%; max-width: 420px;
  padding: 8px 10px; font: inherit;
  border: 1.5px solid var(--field); border-radius: var(--radius); background: #fff;
  box-shadow: inset 0 1px 2px rgba(27, 36, 48, .06);
}
input:hover:not(:focus):not(:disabled), select:hover:not(:focus):not(:disabled), textarea:hover:not(:focus) {
  border-color: var(--steel-700);
}
input:disabled, select:disabled { background: var(--steel-100); border-color: var(--line); color: var(--ink-soft); }
::placeholder { color: #93a0ae; opacity: 1; }
textarea { max-width: 640px; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--amber); outline-offset: 1px; border-color: var(--steel-700); }
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 22px; }
.actions { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-block; cursor: pointer; text-decoration: none;
  font: inherit; font-weight: 600; font-size: 14px;
  padding: 9px 16px; border-radius: var(--radius);
  border: 1px solid var(--steel-700); background: var(--steel-700); color: #fff;
}
.btn:hover { background: var(--steel-900); }
.btn-primary { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }
.btn-primary:hover { background: #ffbb1e; }
.btn-quiet { background: transparent; color: var(--steel-700); }
.btn-quiet:hover { background: var(--steel-100); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: #fbe9e7; }
.btn-sm { padding: 4px 10px; font-size: 13px; }

/* Search / filter bars */
.filterbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
.filterbar .field { min-width: 160px; }
.filterbar input, .filterbar select { max-width: 100%; }

/* Batch entry grid (receiving) */
table.entry input, table.entry select { max-width: none; padding: 6px 8px; }
table.entry td { padding: 4px 5px; }

.pager { display: flex; gap: 10px; align-items: center; margin: 14px 0; font-size: 14px; }
.pager a { text-decoration: none; color: var(--steel-700); font-weight: 600; padding: 3px 9px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }

/* NL report */
.sqlbox { background: var(--steel-900); color: #d8e0e8; padding: 12px 14px; border-radius: var(--radius); font-family: ui-monospace, Consolas, monospace; font-size: 13px; overflow-x: auto; white-space: pre-wrap; }

/* ---- Login ---- */
.login-wrap { min-height: 90vh; display: grid; place-items: center; }
.login-card { width: 340px; background: var(--card); border: 1px solid var(--line); border-top: 6px solid; border-image: repeating-linear-gradient(135deg, var(--amber) 0 12px, var(--steel-900) 12px 24px) 6; border-radius: var(--radius); padding: 28px; }
.login-card h1 { font-family: 'Barlow Condensed', sans-serif; margin: 0 0 4px; font-size: 24px; }
.login-card .sub { color: var(--ink-soft); font-size: 13px; margin-bottom: 16px; }

/* ---- Labels / print ---- */
.label-sheet { display: flex; flex-wrap: wrap; gap: 14px; }
.label {
  border: 1.5px solid #000; padding: 12px; width: 320px; background: #fff;
  page-break-inside: avoid;
}
.label .co { font-family: 'Barlow Condensed', sans-serif; font-weight: 600; font-size: 15px; letter-spacing: .05em; text-transform: uppercase; }
.label .item { font-size: 18px; font-weight: 600; margin: 4px 0; }
.label .meta { font-size: 12px; color: #222; }
@media print {
  .topbar, .page-title, .crumbs, .noprint, .flash { display: none !important; }
  body { background: #fff; }
  .page { padding: 0; max-width: none; }
}

/* ---- Mobile ---- */
/* hamburger below 1240px: the full toolbar needs ~1240px to stay on one row */
@media (max-width: 1240px) {
  .nav { display: none; width: 100%; flex-direction: column; }
  .nav.open { display: flex; }
  .nav a { padding: 11px 6px; border-bottom: 1px solid var(--steel-700); }
  .navtoggle { display: block; margin-left: auto; }
  .userbox { margin-left: 0; }
}
@media (max-width: 860px) {
  .page { padding: 14px 10px 60px; }
}

/* ---- Camera scanner ---- */
#scan-overlay {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(15, 21, 28, .82);
  align-items: center; justify-content: center; padding: 14px;
}
.scan-box { background: var(--card); border-radius: 6px; width: 420px; max-width: 96vw; overflow: hidden; }
.scan-head {
  display: flex; justify-content: space-between; align-items: center;
  font-family: 'Barlow Condensed', sans-serif; font-weight: 600; font-size: 17px;
  padding: 10px 14px; background: var(--steel-900); color: #fff;
}
.scan-close { background: none; border: 0; color: var(--amber); font-size: 24px; cursor: pointer; line-height: 1; }
#scan-viewport { min-height: 260px; background: #000; }
#scan-viewport video { width: 100% !important; }
.scan-hint { padding: 10px 14px; font-size: 13px; color: var(--ink-soft); }
.btn-scan { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); font-weight: 700; }

/* ---- Customer portal ---- */
.portal-topbar { background: var(--steel-900); }

/* ---- Mobile pass (iPhone portrait) ---- */
.tablewrap { position: relative; }
@media (max-width: 740px) {
  .hide-m { display: none !important; }
  table.data th, table.data td { padding: 10px 8px; font-size: 13.5px; }
  .btn-sm { padding: 8px 12px; }                 /* real touch targets */
  tr[data-href] { cursor: pointer; }
  tr[data-href]:active td { background: #fdf3d7; }
  /* scroll hint: right-edge fade when content overflows */
  .tablewrap::after {
    content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 22px;
    background: linear-gradient(to left, rgba(27,36,48,.14), transparent);
    pointer-events: none; border-radius: 0 4px 4px 0;
  }
  .tablewrap.at-end::after { display: none; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi .n { font-size: 21px; }
  .page-title { font-size: 22px; }
  input[type=text], input[type=password], input[type=number], input[type=date],
  input[type=email], input[type=month], select, textarea { font-size: 16px; } /* stops iOS auto-zoom on focus */
  .actions .btn { padding: 11px 16px; }
}

/* scan fields */
.scanfield-btn { margin-left: 6px; white-space: nowrap; }
.scanfield-info { font-size: .82em; margin-top: 3px; min-height: 1em; color: var(--muted, #888); }
.scanfield-ok { color: #2e7d32; }
.scanfield-bad { color: #c62828; font-weight: 600; }

/* breadcrumbs */
.crumbs { margin: 2px 0 -6px; font-size: .85em; }
.crumbs a { color: var(--muted, #667); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* ===================== MOBILE LAYOUT (body.mobile, UA-detected) ==============
   Dedicated phone treatment for portrait iPhones (~430-440px). Desktop is
   untouched — everything below keys off body.mobile, not viewport width.     */

body.mobile { font-size: 15px; }
body.mobile main.page { padding: 10px; }
body.mobile h1.page-title { font-size: 1.35em; margin: 8px 0 10px; }
body.mobile .card { padding: 12px; border-radius: 10px; }

/* top bar: hamburger menu (collapsed by default, toggle opens the list) */
body.mobile .topbar { flex-wrap: wrap; padding: 8px 10px; gap: 6px; }
body.mobile .topbar .brand { font-size: 1.05em; }
body.mobile .topbar .userbox { font-size: .85em; }
body.mobile .navtoggle { display: block; margin-left: auto; font-size: 1.3em; padding: 4px 10px; }
body.mobile .nav { display: none; order: 3; width: 100%; flex-direction: column; }
body.mobile .nav.open { display: flex; }
body.mobile .nav a { padding: 13px 8px; border-bottom: 1px solid var(--steel-700, #3a4a5a); }
body.mobile .nav a.active { color: var(--accent, #f5a623); }

/* KPI strip: two per row */
body.mobile .kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
body.mobile .kpi { padding: 10px; }
body.mobile .kpi .kpi-num { font-size: 1.5em; }

/* forms: single column, full-width, no iOS zoom-on-focus */
body.mobile .filterbar, body.mobile .actions { flex-direction: column; align-items: stretch; }
body.mobile .filterbar .field { min-width: 0; width: 100%; }
body.mobile .grid2 { display: block; }
body.mobile .grid2 > div { margin-bottom: 10px; }
body.mobile input[type=text], body.mobile input[type=number], body.mobile input[type=date],
body.mobile input[type=password], body.mobile input[type=file], body.mobile select,
body.mobile textarea { font-size: 16px; width: 100%; box-sizing: border-box; padding: 10px; }
body.mobile .btn { padding: 11px 16px; font-size: 15px; }
body.mobile .actions .btn, body.mobile .filterbar .btn { width: 100%; }
body.mobile .scanfield-btn { width: auto !important; margin-top: 6px; }

/* tables: wide ones become stacked label:value cards (see app.js cardify) */
body.mobile table.data.cardified, body.mobile .cardified tbody { display: block; }
body.mobile .cardified tr.card-head { display: none; }              /* header row (marked by app.js) */
body.mobile .cardified tr { display: block; border: 1px solid var(--line, #dfe3e8);
  border-radius: 10px; margin: 0 0 10px; padding: 8px 12px; background: #fff; }
body.mobile .cardified td { display: flex; justify-content: space-between; gap: 12px;
  border: 0; padding: 5px 0; align-items: center; }
body.mobile .cardified td::before { content: attr(data-l); color: var(--muted, #778);
  font-size: .82em; text-transform: uppercase; letter-spacing: .03em; flex: 0 0 auto; }
body.mobile .cardified td:not([data-l])::before { content: none; }
body.mobile .cardified td.cell-empty { display: none; }
body.mobile .cardified td .btn { margin-left: auto; }
body.mobile .cardified td:has(.smart-scan) { justify-content: flex-start; }
body.mobile .smart-scan { width: 100%; text-align: center; }
body.mobile .tablewrap { overflow-x: visible; }
/* narrow tables that stay tabular still get a safety scroll */
body.mobile .tablewrap:not(:has(.cardified)) { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* row-click targets breathe */
body.mobile tr[data-href] { cursor: pointer; }

/* brand crest in the topbar */
.brand-logo { height: 30px; width: auto; margin-right: 8px; vertical-align: middle; }
body.mobile .brand-logo { height: 26px; }

/* photo-scan busy overlay */
.busy-overlay { position: fixed; inset: 0; background: rgba(20,28,40,.65); z-index: 999;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.busy-overlay .spin { width: 46px; height: 46px; border: 5px solid rgba(255,255,255,.25);
  border-top-color: var(--amber, #f5a623); border-radius: 50%; animation: wmspin .8s linear infinite; }
.busy-overlay .msg { color: #fff; font-weight: 600; }
@keyframes wmspin { to { transform: rotate(360deg); } }
.scan-pages { background: #fff; border-radius: 12px; padding: 20px; width: min(90vw, 340px);
  display: flex; flex-direction: column; gap: 10px; box-shadow: 0 12px 40px rgba(0,0,0,.35); }
.scan-pages .pc { font-weight: 700; text-align: center; margin-bottom: 4px; }
.scan-pages .btn { width: 100%; justify-content: center; }

/* topbar scan chooser */
.scanmenu { position: relative; display: inline-block; }
.scanmenu-list { display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 500;
  background: #fff; border: 1px solid var(--line, #d8dde3); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(10,16,24,.25); min-width: 230px; overflow: hidden; }
.scanmenu.open .scanmenu-list { display: block; }
.scanmenu-list a { display: block; padding: 13px 16px; color: #1b2733; text-decoration: none;
  font-weight: 600; border-bottom: 1px solid var(--line, #eef1f4); }
.scanmenu-list a:last-child { border-bottom: 0; }
.scanmenu-list a:hover { background: #f4f6f8; }
body.mobile .scanmenu-list a { padding: 15px 18px; font-size: 1.05em; }


/* ---- smart scan button (receiving) ---- */
.smart-scan { white-space:nowrap; padding:6px 10px; }
body.mobile .smart-scan { padding:10px 14px; font-size:15px; }

/* ---- file inputs: make "Choose Files" a real button on every page ---- */
input[type=file] { font-size:14px; }
input[type=file]::file-selector-button {
  appearance:none; -webkit-appearance:none;
  background:var(--accent,#1d3557); color:#fff; border:none; border-radius:8px;
  padding:8px 16px; margin-right:10px; font:inherit; font-weight:600; cursor:pointer;
}
input[type=file]::file-selector-button:hover { filter:brightness(1.15); }
body.mobile input[type=file] { width:100%; font-size:15px; }
body.mobile input[type=file]::file-selector-button {
  display:block; width:100%; padding:13px 16px; margin:0 0 6px; text-align:center; font-size:16px;
}


/* ==========================================================================
   UX pass — July 2026
   Save always reachable, labels that don't wreck alignment, receiving that
   fits a scan-gun screen, and print documents that look like paperwork.
   ========================================================================== */

/* ---- sticky save bar: never scroll back up to save -------------------- */
.actions.sticky {
  position: sticky; bottom: 0; z-index: 40;
  margin: 18px -18px -18px; padding: 12px 18px;
  background: rgba(255,255,255,.96); backdrop-filter: blur(6px);
  border-top: 1px solid var(--line, #dfe3e8);
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.actions.sticky .spacer { flex: 1 1 auto; }
.actions.sticky .savehint { font-size: .85em; color: #5a6b7c; }
body.mobile .actions.sticky { margin: 14px -12px -12px; padding: 10px 12px; }
body.mobile .actions.sticky .btn { flex: 1 1 auto; text-align: center; }
body.mobile .actions.sticky .savehint { display: none; }
@media print { .actions.sticky { display: none; } }

/* ---- short labels + hover/tap help, so columns stay aligned ----------- */
label .hint {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; margin-left: 5px; border-radius: 50%;
  background: #8b9bab; color: #fff; font-size: 10px; font-weight: 700;
  cursor: help; vertical-align: 1px; font-style: normal;
}
label .hint:hover, label .hint:focus { background: var(--accent, #1d3557); }
.field label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.field.wide { flex: 1 1 320px; }

/* form rows that actually line up: equal columns, labels on one line */
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 14px; }
.formgrid .field { margin: 0; min-width: 0; }
.formgrid .field input, .formgrid .field select, .formgrid .field textarea { width: 100%; }
.formgrid .span2 { grid-column: span 2; }
@media (max-width: 700px) { .formgrid { grid-template-columns: 1fr 1fr; } .formgrid .span2 { grid-column: span 2; } }

/* ---- collapsible "more fields" so rare inputs stop crowding the page --- */
details.more { margin: 10px 0 0; }
details.more > summary {
  cursor: pointer; font-weight: 600; color: var(--accent, #1d3557);
  padding: 7px 0; list-style: none; user-select: none;
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: '▸ '; }
details.more[open] > summary::before { content: '▾ '; }
details.more > .morebody { padding-top: 8px; border-top: 1px dashed var(--line, #dfe3e8); }

/* ---- receiving: skid cards instead of a 12-column horizontal scroll --- */
.recv-skid {
  border: 1px solid var(--line, #dfe3e8); border-radius: 12px;
  margin: 0 0 12px; background: #fff; overflow: hidden;
}
.recv-skid > header {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 12px; background: #f4f6f8; border-bottom: 1px solid var(--line, #dfe3e8);
}
.recv-skid > header .sk-no { font-weight: 700; font-size: 1.05em; }
.recv-skid > header .sk-sp { flex: 1 1 auto; }
.recv-tag { padding: 11px 12px; border-bottom: 1px dashed var(--line, #e6eaee); }
.recv-tag:last-child { border-bottom: 0; }
.recv-tag.cont { background: #fbfcfd; }
.recv-tag .tagno { font-size: .82em; color: #5a6b7c; font-weight: 600; margin-bottom: 6px; }
.recv-row { display: grid; gap: 10px; grid-template-columns: 2fr 72px 96px 96px 1.5fr; align-items: end; }
.recv-row .f label { display: block; font-size: .74em; letter-spacing: .04em; text-transform: uppercase;
  color: #5a6b7c; font-weight: 700; margin-bottom: 3px; white-space: nowrap; }
.recv-row .f input { width: 100%; }
.recv-row .f.acts { display: flex; gap: 6px; align-items: center; }
@media (max-width: 900px) { .recv-row { grid-template-columns: 1fr 1fr; } .recv-row .f.sku, .recv-row .f.tag { grid-column: span 2; } }
body.mobile .recv-row { grid-template-columns: 1fr 1fr; }
body.mobile .recv-row .f.sku, body.mobile .recv-row .f.tag { grid-column: span 2; }
body.mobile .recv-row .f input { font-size: 16px; padding: 12px 10px; }   /* no iOS zoom, big targets */
body.mobile .recv-skid > header { padding: 12px; }
.recv-btns { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 12px; background: #fafbfc; }
body.mobile .recv-btns .btn { flex: 1 1 auto; text-align: center; padding: 12px 10px; }

/* ---- pick list: readable at arm's length on a forklift ---------------- */










@media print {





  /* the app's page heading is hidden on paper, so the document prints its own */

}

/* ---- Bill of Lading document ----------------------------------------- */
.doc.bol { background: #fff; color: #000; font-family: Arial, Helvetica, sans-serif;
  font-size: 10.5px; line-height: 1.26; max-width: 8.1in; margin: 0 auto; padding: 12px;
  border: 1px solid #000; }
.doc.bol table { border-collapse: collapse; width: 100%; }
.doc.bol .bol-head td { vertical-align: top; padding: 0 0 4px; }
.doc.bol .bol-logo { width: 96px; }
.doc.bol .bol-logo img { width: 66px; height: auto; display: block; }
.doc.bol .bol-date { font-weight: bold; font-size: 10.5px; margin-top: 3px; white-space: nowrap; }
.doc.bol .bol-title { text-align: center; padding-bottom: 4px; }
.doc.bol .bol-co { font-size: 18px; letter-spacing: .01em; }
.doc.bol .bol-sub { font-weight: bold; font-size: 11.5px; margin-top: 5px; }
.doc.bol .bol-grid > tbody > tr > td { vertical-align: top; }
.doc.bol .bol-col-l { width: 50%; }
.doc.bol .bol-col-r { width: 50%; }
.doc.bol .bol-box { border: 1px solid #000; margin-bottom: -1px; }
.doc.bol .bol-box th { background: #d9d9d9; border-bottom: 1px solid #000; text-align: center;
  font-size: 11px; padding: 1px 4px; }
.doc.bol .bol-box td { padding: 3px 6px; height: 42px; vertical-align: top; }
.doc.bol .bol-instr { height: 30px; }
.doc.bol .bol-fields { border: 1px solid #000; border-left: 0; margin-bottom: -1px; }
.doc.bol .bol-fields td { padding: 3px 6px; }
.doc.bol .bol-fields .k { font-weight: bold; }
.doc.bol .bol-check { font-size: 9.5px; padding-top: 5px; }
.doc.bol .bol-items { border: 1px solid #000; border-top: 0; }
.doc.bol .bol-items-head th { background: #d9d9d9; border-bottom: 1px solid #000; text-align: center;
  font-size: 11px; padding: 1px 4px; }
.doc.bol .bol-items-sub th { border-bottom: 1px solid #000; text-align: left; padding: 2px 5px; font-size: 10.5px; }
.doc.bol .bol-items td { padding: 2px 5px; border-bottom: 1px solid #cfcfcf; }
.doc.bol .bol-items .num { text-align: right; }
.doc.bol .bol-items .ctr { text-align: center; }
.doc.bol .bol-items .rt { text-align: right; }
.doc.bol .bol-blank td { height: 14px; }
.doc.bol .bol-totals td { border-top: 1px solid #000; border-bottom: 0; padding: 3px 5px; }
.doc.bol .bol-legal { border: 1px solid #000; border-top: 0; }
.doc.bol .bol-legal td { padding: 4px 6px; vertical-align: top; font-size: 8.5px; line-height: 1.22; }
.doc.bol .bol-legal-l { width: 50%; border-right: 1px solid #000; }
.doc.bol .bol-legal-r { font-size: 10px; }
.doc.bol .bol-note { border: 1px solid #000; border-top: 0; }
.doc.bol .bol-note td { text-align: center; font-weight: bold; font-size: 9.5px; padding: 2px; }
.doc.bol .bol-sign { border: 1px solid #000; border-top: 0; }
.doc.bol .bol-sign th { border-bottom: 1px solid #000; border-right: 1px solid #000;
  text-align: center; font-size: 11.5px; padding: 3px; }
.doc.bol .bol-sign th:last-child { border-right: 0; }
.doc.bol .bol-sign td { width: 50%; padding: 5px 8px 8px; border-right: 1px solid #000; vertical-align: top; }
.doc.bol .bol-sign td:last-child { border-right: 0; }
.doc.bol .bol-sign p { margin: 0 0 8px; font-size: 8.5px; line-height: 1.22; }
.doc.bol .bol-rule { border-top: 2px solid #000; width: 76%; margin: 14px 0 3px; }
.doc.bol .bol-sigline { font-size: 10px; }
.doc.bol .muted { color: #555; }
/* keep logical blocks from splitting when a long BOL does run over */
.doc.bol .bol-grid, .doc.bol .bol-legal, .doc.bol .bol-note, .doc.bol .bol-sign { page-break-inside: avoid; }
.doc.bol .bol-items tr { page-break-inside: avoid; }

@media print {
  .doc.bol { border: 0; padding: 0; max-width: none; font-size: 8.2pt; }
  .doc.bol .bol-co { font-size: 15pt; }
  .doc.bol .bol-sub { font-size: 9.5pt; }
  .doc.bol .bol-logo img { height: 52px; }
  .doc.bol .bol-box th, .doc.bol .bol-items-head th { font-size: 9pt; }
  .doc.bol .bol-sign th { font-size: 9.5pt; }
  .doc.bol .bol-legal td, .doc.bol .bol-sign p { font-size: 7.2pt; }
  /* keep a row group from splitting across the fold on long orders */
  .doc.bol tr, .doc.bol .bol-sign, .doc.bol .bol-legal { page-break-inside: avoid; }
  @page { margin: .38in; }
}

/* receiving: rarely-used columns hide until "Extra fields" is ticked */
#recv-table .x-extra { display: none; }
#recv-table.show-extra .x-extra { display: table-cell; }
body.mobile #recv-table.cardified .x-extra { display: none; }
body.mobile #recv-table.cardified.show-extra .x-extra { display: flex; }


/* ---- PICK LIST: sized for reading at arm's length on a forklift ---------
   Screen keeps generous spacing; print keeps the big type but spends no paper
   on padding, so a normal order still lands on one sheet. */
.picklist { font-size: 16px; }
.picklist h1 { font-size: 26px; margin: 0 0 4px; }
.pick-meta { display: flex; gap: 26px; flex-wrap: wrap; font-size: 16px; margin: 0 0 14px; }
.pick-meta b { display: block; font-size: .72em; text-transform: uppercase; letter-spacing: .05em; color: #5a6b7c; }
table.pick { width: 100%; border-collapse: collapse; font-size: 18px; }
table.pick th { background: #eef1f4; text-align: left; padding: 9px 10px; border: 1px solid #c9d2da;
  font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
table.pick td { padding: 13px 10px; border: 1px solid #c9d2da; vertical-align: middle; }
table.pick .big { font-size: 22px; font-weight: 700; }
table.pick .tick { width: 54px; text-align: center; font-size: 26px; color: #9aa8b5; }
table.pick tr:nth-child(even) td { background: #fafbfc; }
@media print {
  .picklist { font-size: 12pt; }
  .picklist h1 { font-size: 17pt; margin: 0 0 3pt; }
  .pick-meta { gap: 15pt; font-size: 10.5pt; margin: 0 0 7pt; }
  table.pick { font-size: 13pt; }
  table.pick .big { font-size: 15.5pt; }
  table.pick th { font-size: 8.5pt; padding: 3pt 5pt; }
  table.pick td { padding: 4.5pt 5pt; }
  table.pick tr { page-break-inside: avoid; }
  table.pick tr:nth-child(even) td { background: transparent; }
}

/* ---- Nav drop-downs (Reports, Admin) ----
   Desktop: a panel under the button, opened by click (and hover on mouse
   devices). Phone / hamburger: the children expand inline under the button;
   the group holding the current page starts expanded. */
.navgroup { position: relative; display: flex; }
.navgroup-btn {
  background: none; border: 0; cursor: pointer;
  color: #cfd6dd;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 500; font-size: 16px; letter-spacing: .03em;
  padding: 15px 11px 12px;
  border-bottom: 3px solid transparent;
}
.navgroup-btn:hover, .navgroup.open > .navgroup-btn { color: #fff; }
.navgroup.active > .navgroup-btn { color: #fff; border-bottom-color: var(--amber); }
.navgroup-caret { font-size: 11px; opacity: .75; }
.navgroup-list {
  display: none; position: absolute; left: 0; top: 100%; z-index: 500;
  min-width: 210px; padding: 4px 0;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(20,30,45,.18);
}
.navgroup.open > .navgroup-list { display: block; }
@media (hover: hover) and (min-width: 1241px) {
  body:not(.mobile) .navgroup:hover > .navgroup-list,
  body:not(.mobile) .navgroup:focus-within > .navgroup-list { display: block; }
}
.nav .navgroup-list a {
  display: block; padding: 9px 16px; border-bottom: 0;
  color: #1b2733; font-family: 'Barlow', system-ui, sans-serif;
  font-size: 14px; font-weight: 500; letter-spacing: 0; white-space: nowrap;
}
.nav .navgroup-list a:hover { background: #f4f6f8; color: #1b2733; }
.nav .navgroup-list a.active { font-weight: 600; box-shadow: inset 3px 0 0 var(--amber); background: #fffbea; }
.navgroup-sep { display: block; height: 1px; background: var(--line); margin: 4px 0; }

@media (max-width: 1240px) {
  .navgroup { flex-direction: column; width: 100%; }
  .navgroup-btn { text-align: left; width: 100%; padding: 11px 6px; border-bottom: 1px solid var(--steel-700); }
  .navgroup.active > .navgroup-btn { border-bottom-color: var(--steel-700); color: var(--amber); }
  .navgroup-list { position: static; min-width: 0; padding: 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
  .navgroup.active > .navgroup-list { display: block; }
  .nav .navgroup-list a { color: #cfd6dd; padding: 11px 6px 11px 24px; border-bottom: 1px solid var(--steel-700); font-size: 15px; }
  .nav .navgroup-list a:hover { background: transparent; color: #fff; }
  .nav .navgroup-list a.active { background: transparent; color: var(--amber); box-shadow: none; }
  .navgroup-sep { display: none; }
}
body.mobile .navgroup { flex-direction: column; width: 100%; }
body.mobile .navgroup-btn { text-align: left; width: 100%; padding: 13px 8px; border-bottom: 1px solid var(--steel-700, #3a4a5a); font-size: 1.05em; }
body.mobile .navgroup.active > .navgroup-btn { border-bottom-color: var(--steel-700, #3a4a5a); color: var(--accent, #f5a623); }
body.mobile .navgroup-list { position: static; min-width: 0; padding: 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
body.mobile .navgroup.active > .navgroup-list { display: block; }
body.mobile .nav .navgroup-list a { color: #cfd6dd; padding: 13px 8px 13px 26px; border-bottom: 1px solid var(--steel-700, #3a4a5a); font-size: 1em; }
body.mobile .nav .navgroup-list a.active { background: transparent; color: var(--accent, #f5a623); box-shadow: none; }
body.mobile .navgroup-sep { display: none; }

/* Tighter toolbar between the hamburger breakpoint and full HD, so the nav
   stays on one row on 1366/1280-wide screens (or 1080p at 150% scaling). */
@media (min-width: 1241px) and (max-width: 1500px) {
  .topbar { gap: 10px; padding: 0 10px; }
  .brand { font-size: 17px; }
  .nav a, .navgroup-btn { padding: 15px 7px 12px; font-size: 15px; }
  .userbox { font-size: 12px; }
}
