/* Inventory screens in FieldHub's Office Dashboard look (owner Oct 16 2026).
   Base styles come from /style.css (buttons, form controls, cards, the Office Back button), the Office widgets
   from /office-widgets.css (copied verbatim from office.html), the frame (header, tabs, location cards) from
   frame.css. This file has only what the inventory screens need on top, one rule per class.
   Every control a finger can hit has min-height set on its own class (44px on phones). */

:root {
  --tap: 44px;
  --surface: #FFFFFF;
  --text: var(--dark);
  --muted: var(--gray-500);
  --line: var(--gray-100);
  --line-strong: var(--gray-300);
  --danger: #B3261E;
  --danger-bg: #FCEBEA;
  --ok: #1E6B34;
  --ok-bg: #E7F4EA;
  --warn-bg: #FFF1E6;
  --focus: #F47920;
  --bar-h: 0px;
  color-scheme: light;
}

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overflow-x: hidden; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 12px; }
h1 { font-size: 18px; }
h2 { font-size: 16px; }
h3 { font-size: 15px; }
p { margin: 0 0 12px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ── Layout: the Office page-wrap ─────────────────────────────── */
.app-body { display: block; }
.app-main { max-width: 1200px; margin: 0 auto; padding: 24px 20px 48px; color: var(--text); }
body.is-loading .app-main > .page { visibility: hidden; }
.page { min-width: 0; }

/* ── Building blocks ────────────────────────────────────────── */
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
/* A row of page tools (search, buttons) above a list: the title is in the header. */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.page-head h1, .page-head h2 { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.stack > * + * { margin-top: 12px; }
.row-gap { display: flex; flex-wrap: wrap; gap: 8px; }
.gap-bottom { margin-bottom: 16px; }
.flush { margin: 0; }

/* Buttons: style.css .btn; a plain .btn is the Office secondary button */
.btn { justify-content: center; min-height: 38px; padding: 8px 16px; background: var(--gray-100); color: var(--dark); border: 1px solid var(--gray-300); font-family: var(--font); line-height: 1.2; -webkit-tap-highlight-color: transparent; }
.btn:hover { background: var(--gray-300); }
.btn-primary { background: var(--orange); border-color: var(--orange); color: var(--white); }
.btn-primary:hover { background: var(--orange-dark); }
.btn-danger { background: var(--red); border-color: var(--red); color: var(--white); }
.btn-dark { background: var(--dark); border-color: var(--dark); color: var(--white); }
.btn-sm { min-height: 32px; padding: 6px 12px; font-size: 13px; }
.btn-block { display: flex; width: 100%; }
.btn:disabled, .btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn.is-busy { opacity: .7; cursor: progress; }
@media (max-width: 768px) { .btn, .btn-sm { min-height: 44px; } }

/* Big tiles (crew Home): Office Dashboard cards with the orange card title */
.action-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
@media (min-width: 900px) { .action-bar { grid-template-columns: repeat(5, 1fr); } }

/* Forms */
.field { margin: 0 0 16px; }
.field > label, .field > .label { display: block; font-weight: 700; margin-bottom: 6px; }
.field .hint { font-size: 14px; color: var(--muted); margin-top: 4px; }
.input, select.input, textarea.input {
  display: block; width: 100%;
  min-height: var(--tap); padding: 10px 12px;
  color: var(--text); line-height: 1.3;
}
@media (max-width: 768px) { .input, select.input, textarea.input { font-size: 16px; } }   /* 16px stops iPhone zooming in */
textarea.input { min-height: 96px; resize: vertical; }
select.input { -webkit-appearance: none; appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, #555 50%), linear-gradient(135deg, #555 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; }
.input[aria-invalid="true"] { border-color: var(--danger); }

/* Role choice: big radio cards */
.choice-list { display: grid; gap: 8px; }
.choice {
  display: flex; gap: 12px; align-items: flex-start;
  min-height: var(--tap); padding: 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); cursor: pointer;
}
.choice input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--orange); }
.choice .choice-title { font-weight: 700; }
.choice .choice-help { font-size: 14px; color: var(--muted); }
.choice:has(input:checked) { border-color: var(--orange); box-shadow: inset 0 0 0 1px var(--orange); }

/* Permission toggles */
.toggle-list { display: grid; gap: 8px; }
.toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 64px; padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); cursor: pointer;
}
.toggle-text { min-width: 0; }
.toggle-title { font-weight: 700; }
.toggle-help { font-size: 14px; color: var(--muted); }
.toggle-state { font-size: 14px; font-weight: 700; min-width: 28px; text-align: right; color: var(--muted); }
.switch { position: relative; flex: none; width: 56px; height: 32px; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch .track { position: absolute; inset: 0; border-radius: 16px; background: #BDBDBA; transition: background .15s; pointer-events: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: var(--white); transition: transform .15s; }
.switch input:checked + .track { background: var(--orange); }
.switch input:checked + .track::after { transform: translateX(24px); }
.switch input:focus-visible + .track { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Lists of records (one layout for every width) */
.list { list-style: none; margin: 0; padding: 0; }
.list > li + li { border-top: 1px solid var(--line); }
.list-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px; padding: 10px 14px; text-decoration: none; color: inherit;
}
a.list-row:hover { background: var(--gray-50); }
.list-main { min-width: 0; }
.list-title { font-weight: 700; overflow-wrap: anywhere; }
.list-sub { display: block; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.list-side { flex: none; text-align: right; font-size: 14px; color: var(--muted); }
.list-empty { padding: 20px 14px; color: var(--muted); }


.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

.segmented { display: inline-flex; border: 1px solid var(--gray-300); border-radius: var(--radius-sm); overflow: hidden; }
.segmented button { min-height: var(--tap); padding: 0 16px; border: 0; background: var(--surface); font: inherit; font-weight: 600; cursor: pointer; }
.segmented button + button { border-left: 1px solid var(--gray-300); }
.segmented button[aria-pressed="true"] { background: var(--orange); color: var(--white); }

/* Messages */
.notice { padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); margin: 0 0 16px; }
.notice-error { border-color: var(--danger); background: var(--danger-bg); color: var(--danger); font-weight: 600; }
.notice-ok { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.notice-none { border-color: var(--line, #d1d5db); background: #f3f4f6; color: #4b5563; font-weight: 600; }
.notice-warn { border-color: var(--orange); background: var(--warn-bg); }
.save-status { margin-top: 10px; }
/* A save line made next to a button in a flex row: on its own line under the buttons */
.save-status.btn-status { flex-basis: 100%; width: 100%; }
.retry-btn {
  display: flex; align-items: center; justify-content: center; width: 100%;
  min-height: var(--tap); padding: 8px 14px;
  border: 2px solid var(--danger); border-radius: var(--radius);
  background: var(--danger-bg); color: var(--danger); font: inherit; font-weight: 800; cursor: pointer;
}
.temp-password { font: 700 26px/1.2 ui-monospace, Menlo, monospace; letter-spacing: .06em; padding: 12px; background: #F7F7F5; border: 1px dashed var(--black); border-radius: var(--radius); text-align: center; user-select: all; -webkit-user-select: all; }

/* Collapsible History */
details.history { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 16px; }
details.history > summary { min-height: var(--tap); display: flex; align-items: center; padding: 0 16px; font-weight: 700; cursor: pointer; list-style: none; }
details.history > summary::-webkit-details-marker { display: none; }
details.history > summary::after { content: "Show"; margin-left: auto; font-weight: 600; color: var(--muted); font-size: 14px; }
details.history[open] > summary::after { content: "Hide"; }
details.history > .history-body { padding: 0 16px 16px; }

.log-list { list-style: none; margin: 0; padding: 0; }
.log-list > li { padding: 10px 0; border-top: 1px solid var(--line); }
.log-list > li:first-child { border-top: 0; }
.log-when { font-size: 13px; color: var(--muted); }
.log-what { overflow-wrap: anywhere; }

/* Tables (desktop screens) */
.table-wrap { overflow-x: auto; }
table.data th.num, table.data td.num { text-align: right; }
table.data tr.clickable { cursor: pointer; }
table.data tr.detail-row td { background: var(--gray-50); }
.nowrap { white-space: nowrap; }
table.data td.rec { min-width: 160px; }
table.data.changes { width: auto; min-width: 50%; background: var(--surface); }
table.data.changes th { position: static; }
pre.details { margin: 0; white-space: pre-wrap; font-size: 13px; font-family: ui-monospace, Menlo, monospace; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.filters .field { margin: 0; }

/* Confirmation sheet */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(12,12,12,.55); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  background: var(--surface); width: 100%; max-width: 560px; max-height: 90vh; overflow: auto;
  border-radius: 14px 14px 0 0; padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
  border-top: 4px solid var(--orange);
}
.sheet h2 { font-size: 20px; }
.sheet-lines { list-style: none; margin: 0 0 16px; padding: 0; }
.sheet-lines li { padding: 8px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.sheet-lines li:first-child { border-top: 0; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.sheet-error { margin-top: 10px; }

/* Desktop-only screen notice on phones */
.desktop-only-note { display: none; }

@media (max-width: 899.98px) {
  .desktop-only { display: none !important; }
  .desktop-only-note { display: block; }
}

/* ── Desktop ────────────────────────────────────────────────── */
@media (min-width: 900px) {
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: 12px; }
  .two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
}

@media print {
  .sidebar, .office-topbar, .sidebar-toggle, .crumbs, .btn, .no-print { display: none !important; }
  body { background: #fff; }
  .app-main { --text: #161616; --muted: #5A5A5A; --line: #D9D9D6; --line-strong: #B8B8B4; }
}

/* Location picker sheet */
.picker-list { max-height: 50vh; overflow: auto; margin-bottom: 12px; }
.picker-row { width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; min-height: 56px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.photo-btn { position: relative; }
.photo-btn:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.item-photo { padding: 8px; }
.item-photo img { display: block; width: 100%; max-height: 360px; object-fit: contain; background: #F7F7F5; border-radius: 6px; }
.parts { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.part-row { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); }
@media (min-width: 600px) { .part-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: center; } }
.edit-panel { border-left: 4px solid var(--orange); }
.loc-picker { border: 1px solid var(--line); border-radius: var(--radius); max-height: 420px; overflow: auto; }
.loc-check { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 12px; border-top: 1px solid var(--line); cursor: pointer; }
.loc-check:first-child { border-top: 0; }
.loc-check input { width: 22px; height: 22px; flex: none; accent-color: var(--orange); }
.loc-check.is-included { color: var(--muted); cursor: default; }
.loc-name { font-weight: 600; }
.plain-list { margin: 0 0 8px; padding-left: 20px; }
.plain-list li { padding: 4px 0; }

.list + h2, .list + .page-head, details + h2 { margin-top: 24px; }

/* Stock flow */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.chip { min-height: 48px; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.chip.is-on { background: var(--orange); color: var(--white); border-color: var(--orange); }
.place-list { display: grid; gap: 8px; }
.place { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 56px; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.place.is-on { border-color: var(--orange); box-shadow: inset 0 0 0 2px var(--orange); }
.place-qty { font-weight: 700; white-space: nowrap; color: var(--muted); }
.place.is-on .place-qty { color: var(--text); }
.qty-row { display: flex; gap: 8px; align-items: center; }
.qty-input { flex: 1 1 auto; font-size: 24px; font-weight: 700; min-height: 56px; }
.qty-unit { font-size: 20px; font-weight: 700; min-width: 48px; }
.qty-row select.input { width: auto; flex: 0 0 auto; }
.sticky-actions { position: sticky; bottom: calc(var(--bar-h) + env(safe-area-inset-bottom)); background: var(--bg); padding: 10px 0; z-index: 5; }
.sticky-actions.two { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.sticky-actions .btn { min-height: 56px; }
.line-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.lead { font-size: 19px; font-weight: 600; }
.stock-table td.num, .stock-table th.num { text-align: right; white-space: nowrap; }
.pill-warn { border-color: var(--orange); background: var(--warn-bg); }
@media (min-width: 900px) { .sticky-actions { bottom: 0; } }

.qty-trio { display: grid; gap: 2px; text-align: right; color: var(--text); }
.qty-trio .qlabel { color: var(--muted); font-size: 13px; }
.qty-trio .qavail { font-weight: 800; font-size: 16px; }
.alert-link { display: block; text-decoration: none; color: var(--text); min-height: 48px; }
.line-note { margin: 0 14px 12px; }

/* Dashboard */
.value-cards { display: grid; gap: 12px; margin-bottom: 4px; }
@media (min-width: 900px) { .value-cards { grid-template-columns: repeat(3, 1fr); } }
.value-card { margin-bottom: 0; }
.value-label { font-size: 14px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.value-big { font-size: 30px; font-weight: 800; margin: 4px 0; }
.value-cards + .card { margin-top: 16px; }
.value-table td.num, .value-table th.num { text-align: right; white-space: nowrap; }
.value-table tr.group-row td { background: #F7F7F5; font-weight: 700; }
.value-table tr.total-row td { font-weight: 800; border-top: 2px solid var(--black); }
@media (max-width: 899.98px) {
  .value-table { font-size: 14px; }
  .value-table th, .value-table td { padding: 8px 6px; }
}
.place-billed { display: block; font-size: 13px; font-weight: 700; color: var(--orange-dark); }
.pill-billed { border-color: var(--orange-dark); color: var(--orange-dark); background: var(--warn-bg); }

/* Reports: tables that become stacked cards on a phone (one DOM, no sideways scroll). */
.rtable td.num, .rtable th.num { text-align: right; white-space: nowrap; }
.rtable tr.row-billed td { background: #FFF8F1; }
.report-notes p + p { margin-top: 6px; }
.print-header, .print-only { display: none; }
@media (max-width: 899.98px) {
  .table-wrap:has(.rtable) { overflow: visible; border: 0; background: none; }
  .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; width: 100%; }
  .rtable thead { display: none; }
  .rtable tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; padding: 6px 0; }
  .rtable td { border: 0; padding: 4px 12px; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .rtable td::before { content: attr(data-l); color: var(--muted); font-size: 13px; text-align: left; flex: none; }
  .rtable td:empty { display: none; }
  .rtable td.num { white-space: normal; }
}
@media print {
  .sidebar, .office-topbar, .sidebar-toggle, .crumbs, .no-print, .btn { display: none !important; }
  .app-body { display: block !important; }
  .app-main { padding: 0 !important; max-width: none; }
  body { background: #fff; font-size: 11pt; }
  .print-header { display: flex; align-items: center; gap: 12px; border-bottom: 3px solid #F47920; padding-bottom: 8px; margin-bottom: 12px; }
  .print-header img { width: 48px; height: 48px; }
  .ph-name { font-weight: 800; font-size: 16pt; letter-spacing: .04em; }
  .ph-tag { font-weight: 700; font-size: 8pt; color: #C1380A; letter-spacing: .06em; }
  .print-only { display: block; }
  .card, .table-wrap { border: 0; padding: 0; }
  table.data { font-size: 9pt; }
  table.data th { position: static; }
  table.data tr { break-inside: avoid; }
  .value-cards { display: grid; grid-template-columns: 1fr 1fr; }
  .value-big { font-size: 16pt; }
  a { text-decoration: none; color: inherit; }
}
@media (max-width: 899.98px) {
  .value-table tr.group-row { background: #F7F7F5; }
  .value-table tr.group-row td::before, .value-table tr.total-row td:first-child::before { content: none; }
  .value-table tr.total-row { border: 2px solid var(--black); }
  .value-table tr.total-row td { border-top: 0; }
}

/* Opening stock entry */
.op-lines { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.op-line { display: grid; grid-template-columns: 28px 1fr; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; align-items: start; }
.op-no { font-weight: 800; color: var(--muted); padding-top: 12px; }
.op-item { position: relative; grid-column: 2; }
.op-code { display: block; margin-top: 2px; }
.op-qty, .op-cost { grid-column: 2; display: flex; align-items: center; gap: 8px; }
.op-qty .input { font-weight: 700; }
.op-unit { min-width: 40px; font-weight: 700; color: var(--muted); }
.op-value { grid-column: 2; font-weight: 700; }
.op-rm { grid-column: 2; justify-self: start; }
.ac-list { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px 0; list-style: none; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 6px 20px rgba(0,0,0,.15); max-height: 320px; overflow: auto; }
.ac-opt { min-height: 48px; padding: 10px 12px; cursor: pointer; }
.ac-opt.is-hi, .ac-opt:hover { background: #F2F2EF; }
.ac-add { border-top: 1px solid var(--line); font-weight: 700; color: var(--orange-dark); }
.ac-none { padding: 10px 12px; }
.op-new { grid-column: 1 / -1; margin-top: 8px; }
.op-total { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.op-total .btn { flex: none; }
.op-head { display: none; }
@media (min-width: 900px) {
  .op-head, .op-line { grid-template-columns: 32px minmax(0, 1fr) 170px 100px; align-items: center; }
  .op-head.priced, .op-lines.priced .op-line { grid-template-columns: 32px minmax(0, 1fr) 170px 150px 110px 100px; }
  .op-head { display: grid; gap: 8px; padding: 0 10px 4px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
  .op-item, .op-qty, .op-cost, .op-value, .op-rm { grid-column: auto; }
  .op-no { padding-top: 0; }
  .op-value { text-align: right; }
  .op-new { grid-column: 2 / -1; }
}

.op-lbl { min-width: 72px; font-size: 14px; font-weight: 700; color: var(--muted); }
@media (min-width: 900px) { .op-lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }
.guide ol { margin: 0 0 8px; padding-left: 22px; }
.guide li { margin: 4px 0; }
@media (min-width: 900px) { .guide { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; } }
@media print {
  .guide { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; font-size: 10pt; }
  .guide .card { margin-bottom: 8px; break-inside: avoid; }
  .guide h2 { font-size: 12pt; margin-bottom: 4px; }
}
.mk-table .input { min-height: 44px; }
.mk-min { max-width: 130px; }
.mk-pct { max-width: 90px; display: inline-block; margin-right: 4px; }

/* Catalog import (desktop only) */
.imp-steps { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 16px; counter-reset: s; }
.imp-steps li { counter-increment: s; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--muted); font-weight: 600; }
.imp-steps li::before { content: counter(s) ". "; }
.imp-steps li.is-on { background: var(--orange); border-color: var(--orange); color: var(--white); }
.imp-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 12px; }
.imp-map .field { margin: 0; }
.check { display: flex; gap: 8px; align-items: center; min-height: 48px; cursor: pointer; }
.check input { width: 20px; height: 20px; }
.imp-table th, .imp-table td { vertical-align: top; font-size: 14px; padding-left: 8px; padding-right: 8px; }
.imp-table input[type=checkbox] { width: 20px; height: 20px; }
.imp-name { min-width: 200px; max-width: 280px; overflow-wrap: anywhere; }
.imp-notes span { display: block; }
.imp-code { width: 92px; min-height: 40px; font-size: 15px; }
.imp-cat { width: 120px; min-height: 40px; font-size: 15px; }
.imp-diff { color: var(--orange-dark); font-weight: 700; }
.imp-table tr.is-muted td { color: var(--muted); }
.text-danger { color: var(--danger); }
.imp-go { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px 0; margin-bottom: 12px; }

/* Count rows, coil fields, price dates */
.coil-fields { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.count-row { display: grid; grid-template-columns: minmax(0, 1fr) 140px; gap: 10px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); }
.count-row:first-child { border-top: 0; }
.count-row .input { min-height: 44px; }
.count-diff { grid-column: 1 / -1; font-weight: 700; }
.count-diff.short { color: var(--danger); }
.count-diff.over { color: var(--ok); }
.count-tare { grid-column: 2; display: block; }
.count-tare .input { min-height: 44px; }
.price-date { display: block; font-size: 13px; color: var(--muted); }
.price-date.is-stale { color: var(--orange-dark); font-weight: 700; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.tag-big { font: 900 56px/1.1 ui-monospace, Menlo, monospace; letter-spacing: .04em; color: var(--dark); text-align: center; padding: 18px; border: 3px solid var(--orange); border-radius: var(--radius); background: #fff; margin: 12px 0; }
.filters-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
@media (max-width: 600px) { .filters-row { grid-template-columns: 1fr; } }
.stock-row { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); }
.stock-row:first-child { border-top: 0; }
.stock-row > .list-row { flex: 1; min-width: 0; border-top: 0; }
.row-move { min-height: 40px; margin-right: 10px; flex: none; }
@media (max-width: 768px) { .row-move { min-height: 44px; } }

/* ══ Office Dashboard look (owner Oct 16 2026) ══════════════════════════════════════════════════
   Inventory cards, tiles, tables and badges look like the Office Dashboard widgets, with the same values
   (from /office-widgets.css and /style.css). No new colours: test/inventory-look.test.js checks every
   colour below is FieldHub's.
     card            = .home-card        (white, var(--radius), var(--shadow), 20px 22px)
     card heading    = .home-card-title  (13px, 800, uppercase, .07em, orange)
     tables          = .po-table th/td
     badges          = .po-status: Setup / Pending = Open (yellow), Live / Approved = Entered (green),
                       others = Archived (grey); Rejected / errors = the dashboard's red (var(--red)). */
.card { background: #fff; border: none; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 16px; color: var(--dark); overflow: visible; }
.card h2, .card > h3 { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--orange); margin-bottom: 14px; line-height: 1.3; }
.card .muted, .card .list-sub, .muted { color: var(--gray-500); }
.list, .table-wrap { background: #fff; border: 1px solid var(--gray-100); border-radius: var(--radius); }
.list-row { border-top: 1px solid var(--gray-100); }
.action-btn { display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-start; min-height: 64px; padding: 16px 18px; cursor: pointer; text-decoration: none; font-family: var(--font);
  background: #fff; color: var(--orange); border: none; border-radius: var(--radius); box-shadow: var(--shadow); text-transform: uppercase; font-weight: 800; letter-spacing: .07em; font-size: 13px; text-align: left; }
.action-btn:hover { box-shadow: var(--shadow-lg); }
.action-btn .sub { color: var(--gray-500); text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 13px; margin-top: 6px; }
.action-btn[disabled], button.action-btn[disabled] { background: var(--gray-100); color: var(--gray-500); box-shadow: none; border: 1.5px dashed var(--gray-300); cursor: not-allowed; }
.pill { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase;
  white-space: nowrap; border: none; background: var(--gray-100); color: var(--gray-500); vertical-align: middle; }
.pill-warn, .pill-billed { background: #fff3cd; color: #856404; }
.pill-ok { background: #d4edda; color: #155724; }
.pill-danger { background: #fff; color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.pill-dark { background: var(--dark); color: var(--white); }
.input, select.input, textarea.input { border: 1.5px solid var(--gray-300); border-radius: var(--radius-sm); font-family: var(--font); font-size: 15px; background: var(--white); }
.input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(244,121,32,0.15); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-500); padding: 8px 12px; background: var(--gray-50); border-bottom: 1px solid var(--gray-100); text-align: left; white-space: nowrap; }
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tr.clickable:hover td, table.data tbody tr:hover td { background: var(--gray-50); }
details.spot { background: #fff; border: 1px solid var(--gray-100); border-radius: var(--radius); margin-bottom: 10px; }
details.spot > summary { display: flex; justify-content: space-between; align-items: center; min-height: 44px; padding: 8px 14px; cursor: pointer; font-weight: 800; color: var(--dark); list-style: none; }
details.spot > summary::-webkit-details-marker { display: none; }
details.spot > summary::before { content: "\25B8"; margin-right: 8px; color: var(--orange); transition: transform .15s; }
details.spot[open] > summary::before { transform: rotate(90deg); }
details.spot .spot-name { flex: 1; }
details.spot .spot-count { font-size: 13px; color: var(--gray-500); font-weight: 600; }
details.spot .list { border-radius: 0 0 var(--radius) var(--radius); border-left: 0; border-right: 0; border-bottom: 0; }

/* "+ Add" on a location and the new-item sheet (owner Oct 17 2026): big rows, 44px+ taps */
.add-choices { display: grid; gap: 10px; margin: 6px 0 12px; }
.add-choice { width: 100%; min-height: 64px; text-align: left; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); }
.add-wide { width: 100%; min-height: 48px; margin: 4px 0 8px; }
.add-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.add-check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; cursor: pointer; }
.add-check input { width: 22px; height: 22px; flex: 0 0 auto; accent-color: var(--orange); }
.add-h3 { font-size: 15px; margin: 14px 0 4px; }
.add-cats { max-height: 40vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 4px 12px; }
.add-preview { margin: 10px 0; }
.add-sheet .input, .add-sheet select.input { min-height: 44px; }
.add-btn { min-height: 44px; font-weight: 800; }
.loc-nest { padding-left: 22px; }
.loc-nest .list-title::before { content: "– "; color: var(--gray-500); }
.coil-line { color: var(--gray-700); font-weight: 600; }
@media (max-width: 420px) { .add-grid { grid-template-columns: 1fr; } }

/* "No items yet. Load a custom catalog" (a new location left empty) */
.empty-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.empty-banner .btn { min-height: 44px; }
.status-key { margin: 8px 2px 14px; font-size: 15px; line-height: 1.45; }
.status-key[hidden] { display: none; }
/* Markup policy (owner Oct 17 2026) */
.mp-rules { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 12px; }
.mp-rule { border: 1px solid var(--gray-200, #e5e7eb); border-radius: 12px; padding: 12px 14px; background: #fff; }
.mp-rule-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mp-rule-head .input { flex: 1; min-width: 180px; min-height: 44px; font-size: 16px; font-weight: 700; }
.mp-prio { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--orange, #F47920); color: #fff; font-weight: 800; }
.mp-move .btn { min-height: 44px; }
.mp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 14px; margin-top: 10px; }
.mp-grid .input { min-height: 44px; font-size: 16px; }
.mp-grid select[multiple] { min-height: 110px; }
.mp-rule-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.mp-rule-foot .btn { min-height: 44px; }
.mp-tiers .input { min-height: 44px; font-size: 16px; max-width: 140px; }
.mp-tiers .btn { min-height: 44px; }
.mp-save { margin: 16px 0 40px; }
.mp-save .btn { min-height: 52px; font-size: 17px; }
.add-check { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; }
/* Catalog: Below policy list */
.bp-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 18px; border-bottom: 1px solid var(--gray-100, #f3f4f6); }
.bp-bar .btn, .bp-bar .check { min-height: 44px; }
.bp-row { display: flex; align-items: stretch; }
.bp-row .list-row { flex: 1; min-width: 0; }
.bp-tick { display: flex; align-items: center; justify-content: center; min-width: 48px; min-height: 44px; }
.bp-tick input { width: 22px; height: 22px; }

/* Custom catalogs (owner Oct 18 2026): the list with who uses each, and the ways to add from the Price list */
.cc-intro { font-size: 16px; line-height: 1.5; margin: 0 2px 14px; }
.cc-table td { font-size: 16px; }
.cc-used a { display: inline-block; min-height: 44px; line-height: 44px; }
.cc-add h2 { margin-bottom: 10px; }
.cc-ways { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.cc-way[hidden] { display: none; }
.cc-way .field { margin-bottom: 10px; }
.cc-way .input { min-height: 48px; font-size: 16px; }
.cc-way .btn { min-height: 48px; font-size: 16px; }
.cc-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 2px 18px; margin-bottom: 12px; }
.cc-cat { font-size: 16px; }
.cc-all { font-size: 16px; margin: 4px 0; }
.cc-browse { max-height: 50vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; margin: 6px 0 12px; }
.cc-browse .sl-pick { min-height: 48px; }
.cc-find { padding: 10px 18px 0; }
.cc-find .input { min-height: 48px; font-size: 16px; width: 100%; }

/* The load sheet and the Price list load (owner Oct 18 2026) */
.load-head { font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 14px 0 6px; }
.add-build { border-style: dashed; }
.load-copy { margin-top: 12px; }
.load-copy .input { min-height: 48px; font-size: 16px; }
.lm-lead { font-size: 16px; line-height: 1.45; }
.lm-all { font-size: 16px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.lm-cats { max-height: 46vh; overflow: auto; margin: 4px 0 8px; }
.lm-cat { display: flex; justify-content: space-between; font-size: 16px; min-height: 48px; border-bottom: 1px solid var(--line); }
.lm-cat .lm-name { flex: 1; }
.lm-cat .lm-n { text-align: right; }
.lm-cat input:disabled + .lm-name { color: var(--muted); }
.lm-total { font-size: 17px; margin: 10px 0 4px; }
.lm-bar { width: 100%; height: 22px; accent-color: var(--orange); }
.lm-summary p { font-size: 17px; margin: 6px 0; }

/* The Wire tab (owner Oct 18 2026): every wire item, its coils underneath, Move (whole coil or cut a length) */
.wire-search { margin: 0 0 14px; }
.wire-search .input { min-height: 50px; font-size: 17px; width: 100%; }
.wire-item { padding: 12px 18px; border-top: 1px solid var(--line); }
.wire-item.is-empty .wire-name strong, .wire-item.is-empty .wire-name .small { color: var(--muted); }
.wire-item.is-empty { background: var(--gray-50); }
.wire-head { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; }
.wire-name strong { font-size: 17px; }
.wire-qty { text-align: right; font-size: 18px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.wire-qty .btn { min-height: 44px; }
.wire-check { margin-top: 4px; font-size: 14px; color: var(--orange-dark); background: var(--orange-light); border-radius: 6px; padding: 4px 8px; display: inline-block; }
.wire-coils { list-style: none; margin: 8px 0 0; padding: 0; }
.wire-coil { display: flex; align-items: stretch; gap: 6px; margin-top: 6px; }
.wire-tick { display: flex; align-items: center; justify-content: center; min-width: 48px; min-height: 48px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.wire-tick input { width: 22px; height: 22px; accent-color: var(--orange); }
.wire-coilbtn { flex: 1; display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font: inherit; font-size: 16px; text-align: left; cursor: pointer; }
.wire-coilbtn:hover { border-color: var(--line-strong); }
.wire-len { font-weight: 700; min-width: 80px; }
.wire-spot { flex: 1; color: var(--muted); }
.wire-move { color: var(--orange); font-weight: 700; }
.wire-loose { margin: 6px 0 0; }
.wire-other { padding: 12px 18px; }
.wire-other summary { min-height: 44px; display: flex; align-items: center; font-size: 16px; font-weight: 600; cursor: pointer; }
.wire-bar { position: sticky; bottom: 0; display: flex; gap: 10px; align-items: center; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 -2px 12px rgba(0,0,0,.08); font-size: 16px; font-weight: 600; margin-top: 12px; }
.wire-bar[hidden] { display: none; }
.wire-bar span { flex: 1; }
.wire-bar .btn { min-height: 48px; }
.wire-sheet .lead { font-size: 16px; }
.wire-sheet .input { min-height: 48px; font-size: 16px; }
.wire-cut[hidden] { display: none; }

/* Price list: Change category and Units to check (owner Oct 18 2026) */
.ct-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 12px; font-size: 16px; font-weight: 600; }
.ct-bar span { flex: 1 1 200px; }
.ct-bar .btn { min-height: 44px; }
.unit-check { color: var(--orange-dark); font-weight: 600; }
/* Catalog import result (owner Oct 19 2026) */
.imp-result h2 { text-align: center; margin: 4px 0 10px; }
.imp-result-mark { display: flex; justify-content: center; }
.imp-result-counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 12px; }
.imp-result-counts div { background: var(--ok-bg); border-radius: 8px; padding: 10px 6px; text-align: center; }
.imp-result-counts dt { font-size: 13px; color: var(--muted, #555); }
.imp-result-counts dd { margin: 2px 0 0; font-size: 22px; font-weight: 800; }
.imp-result-problems { margin: 6px 0 0; padding-left: 18px; max-height: 180px; overflow-y: auto; }
.imp-result-actions { grid-template-columns: 1fr; }
.imp-result-actions .btn { min-height: 48px; font-size: 17px; }
@media (max-width: 480px) { .imp-result-counts { grid-template-columns: repeat(2, 1fr); } }
.imp-result-reasons { margin: 6px 0; padding-left: 18px; }
.imp-result-all summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
/* Markup at a glance (owner Oct 19 2026): Cost, Sell, Markup %, Policy % on the Price list */
.mk-grid { display: grid; grid-template-columns: repeat(4, minmax(64px, auto)); gap: 2px 14px; text-align: right; font-variant-numeric: tabular-nums; }
.mk-cell { display: flex; flex-direction: column; font-size: 14px; }
.mk-k { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.mk-grid.is-below { background: #fff7ed; border-radius: 8px; padding: 4px 6px; }
.mk-flag { display: block; font-size: 11px; font-weight: 800; color: var(--orange-dark); }
@media (max-width: 600px) { .mk-grid { grid-template-columns: repeat(2, minmax(64px, auto)); } }

/* ── Loads, ticked items, Catalogs used here (owner Oct 19 2026) ── */
.ll-card { margin-top: 16px; }
.ll-pad { padding: 10px 18px 14px; margin: 0; }
.ll-list, .ll-items { list-style: none; margin: 0; padding: 0; }
.ll-list > li { padding: 12px 18px; border-top: 1px solid var(--gray-100, #eee); }
.ll-items > li { padding: 6px 0; border-top: 1px solid var(--gray-100, #eee); }
.ll-items > li:first-child { border-top: 0; }
.ll-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ll-load-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ll-why { display: block; font-size: 0.85em; color: var(--gray-600, #666); }
.ll-nums { margin-top: 4px; font-size: 0.92em; }
.ll-skipped, .ll-group { margin-top: 6px; }
.ll-skipped > summary, .ll-group > summary, .ll-hidden > summary { cursor: pointer; padding: 6px 0; font-weight: 600; }
.ll-group > .ll-items { padding-left: 14px; }
.ll-hidden { padding: 12px 18px; }
.ll-just { border-left: 4px solid var(--primary, #1d4ed8); }
.ll-bulk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 18px; background: var(--gray-50, #f7f7f7); border-bottom: 1px solid var(--gray-100, #eee); }
.ll-bulk-n { font-weight: 600; margin-right: 4px; }
.ll-tick-cell { width: 36px; }
.ll-tick { width: 20px; height: 20px; }
.ll-result .ll-items { max-height: 55vh; overflow: auto; margin-bottom: 12px; }
@media (max-width: 768px) {
  .ll-btn, .ll-bulk .btn { min-height: 44px; }
  .ll-skipped > summary, .ll-group > summary, .ll-hidden > summary { min-height: 44px; display: list-item; padding: 12px 0; box-sizing: border-box; }
  .ll-tick { min-height: 44px; min-width: 28px; }
  .ll-tick-cell { width: 44px; }
  .ll-row .ll-btn { width: 100%; }
}

/* Removing a location (owner Oct 19 2026) */
.loc-remove { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--gray-100, #eee); }
.loc-remove-btn { min-height: 44px; }
.loc-remove-note { margin: 6px 0 0; }
.loc-remove-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.loc-remove-link { min-height: 44px; display: inline-flex; align-items: center; }
.loc-archived-btn { min-height: 44px; }
.loc-arch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 18px; border-top: 1px solid var(--gray-100, #eee); }
.loc-arch-main { flex: 1 1 240px; min-width: 0; }
.loc-arch-name { min-height: 44px; display: inline-flex; align-items: center; font-weight: 600; }
.loc-arch-why { display: block; font-size: 0.85em; color: var(--gray-600, #666); }
.loc-restore-btn { min-height: 44px; }
@media (max-width: 768px) { .loc-restore-btn, .loc-remove-btn { width: 100%; } }

/* Wire by weight (owner Oct 19 2026) */
.op-coil { flex-wrap: wrap; }
.op-coil .js-reel, .op-coil .js-tare { min-height: 44px; flex: 1 1 140px; min-width: 0; max-width: 100%; }
.op-coil .wt-out { font-weight: 800; }
.cs-reel select { min-height: 44px; }
.po-wt { margin-top: 6px; }
.po-wt .chip { min-height: 44px; }
.lbm-sug-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; padding: 8px 12px; border: 1px solid #fed7aa; background: #fff7ed; border-radius: 10px; }
.lbm-sug-row .btn { min-height: 44px; }
.po-recv-row.is-wire { grid-template-columns: 1fr; align-items: start; }
.po-recv-row.is-wire .js-rqty { max-width: 220px; }

/* Reset price list, Archived items, Delete a custom catalog (owner Oct 19 2026) */
.pl-btn { min-height: 44px; }
.ai-row { align-items: center; }
.ai-one { min-height: 44px; margin: 0 10px; flex: 0 0 auto; }
.ai-all { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; }
.ai-all input { width: 22px; height: 22px; }
.pl-stock-sheet .po-table-wrap { max-height: 50vh; overflow: auto; }
.pl-stock-table td a { min-height: 44px; display: inline-flex; align-items: center; }
.sheet textarea.input[autocapitalize="characters"] { min-height: 44px; font-size: 16px; }
.cc-del { min-height: 44px; }
.cc-actions { text-align: right; white-space: nowrap; }
.load-explain { margin: 0 0 10px; }

/* Item photos in search results and the "Added in FieldHub, not in Jobber yet" filter (round 3 item 7) */
.list-row .pl-photo { width: 44px; height: 44px; object-fit: cover; border-radius: var(--radius-sm); margin-right: 10px; flex: none; border: 1px solid var(--gray-300); }
.pl-fh-bar { margin-top: -4px; }
.pl-fh-bar .js-fh { min-height: 44px; }
.list-row .pl-photo + .list-main, .picker-row .po-res-photo + .list-main { flex: 1; }
.ni-photo-link { flex: none; display: inline-flex; min-height: 44px; align-items: center; }
.ni-photo-link + .list-main { flex: 1; }
/* Phone: a row with a photo keeps room for its name; the prices go under it when it is narrow */
@media (max-width: 480px) {
  .list-row .pl-photo + .list-main { flex: 1 1 150px; }
  .list-row:has(> .pl-photo) { flex-wrap: wrap; }
  .list-row:has(> .pl-photo) > .list-side { margin-left: auto; }
}
