:root {
  --color-bg: #f4f5f7;
  --color-surface: #ffffff;
  --color-border: #dfe3e8;
  --color-text: #1c2430;
  --color-text-muted: #6b7684;
  --color-primary: #1d4ed8;
  --color-primary-dark: #1739a6;
  --color-success: #15803d;
  --color-success-bg: #dcfce7;
  --color-danger: #b91c1c;
  --color-danger-bg: #fee2e2;
  --color-warning-bg: #fef3c7;
  --color-warning-text: #92400e;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
}

h1, h2, h3 { margin: 0 0 0.5em 0; font-weight: 650; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; margin-top: 1.75rem; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--color-text-muted); }

.container {
  /* Wide enough for the Subcontractor, Shipping, Ordering and Job History
     tables to show their last column on a laptop screen (Oct 2026: 1200px
     cut their action buttons off); forms cap their own width. */
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

/* ---------- Top nav ---------- */

/* Spacing here is deliberately tight: with every link the Creator sees
   (Active, Inbox, New Job, Subcontractor, Shipping, Inventory, Ordering,
   Customer POs, Customers, Job History, Other) the bar has to fit an
   ordinary 1280-wide laptop without "Other" wrapping under the brand. It
   still wraps gracefully (flex-wrap) on genuinely narrow screens. */
.topnav {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0.75rem 1rem;
  flex-wrap: wrap;
}

.topnav-brand a {
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-text);
}

.topnav-links {
  display: flex;
  gap: 0.1rem;
  flex-wrap: wrap;
  flex: 1;
}

.nav-link {
  padding: 0.45rem 0.36rem;
  border-radius: var(--radius);
  color: var(--color-text-muted);
  font-weight: 550;
  font-size: 0.9rem;
  white-space: nowrap;
}

.nav-link:hover { background: var(--color-bg); text-decoration: none; }
.nav-link.active { background: #e9edfc; color: var(--color-primary-dark); }

/* "Other" dropdown (Users/Backups/All Jobs - see views/layout.js otherMenu)
   - a native <details>/<summary> so it opens on tap/click with no JS. */
.nav-dropdown { position: relative; }
.nav-dropdown > summary {
  cursor: pointer;
  list-style: none;
}
.nav-dropdown > summary::-webkit-details-marker { display: none; }
.nav-dropdown > summary::after {
  content: ' \25BE';
  font-size: 0.7em;
}
.nav-dropdown[open] > summary { background: var(--color-bg); }
.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-width: 9rem;
  margin-top: 0.25rem;
  padding: 0.35rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}
.nav-dropdown-menu .nav-link { padding: 0.45rem 0.65rem; }
/* The same menu as a page-header action ("Record…" on Shipping, Nov 2026). */
.action-dropdown > summary { display: inline-block; }
.action-dropdown > summary::after { content: ' \25BE'; }
.action-dropdown .nav-dropdown-menu { min-width: 13rem; white-space: nowrap; }
.action-dropdown .nav-dropdown-menu .nav-link { color: var(--color-text); text-decoration: none; }

.topnav-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.user-chip { font-size: 0.9rem; display: flex; align-items: center; gap: 0.4rem; }

.role-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #eef0f3;
  color: var(--color-text-muted);
  font-weight: 700;
}

.link-button {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0;
}
.link-button:hover { color: var(--color-danger); text-decoration: underline; }

/* ---------- Page header ---------- */

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.page-header-meta { color: var(--color-text-muted); font-size: 0.9rem; }
.page-header-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Subcontractor page's Action column - one "Print PO" link per vendor on
   the job (see views/subcontractor.js's poLinks), stacked above Mark
   Sent/Mark Returned rather than crowding them onto one line. */
/* Stretch rather than flex-start: the Inbound row carries four buttons
   (two print links, Mark Returned and its Not Sent undo), and letting them
   share one column width keeps the longest from pushing the Action column
   past the edge of the table. */
.subcontractor-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-start;
  min-width: 8.5rem;
}
.subcontractor-actions .btn {
  text-align: center;
  white-space: nowrap;
}
.po-print-link { display: inline-block; }
/* Nov 2026: Print PO and Print Label side by side, one line per vendor;
   Not Sent is a quiet text link under Mark Returned. */
.sub-print-row { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.sub-undo-link { font-size: 0.8rem; color: var(--color-text-muted); padding: 0; }
.sub-undo-link:hover { text-decoration: underline; }
/* The Subcontractor column: vendor, then each finish on its own line cut
   with an ellipsis (full name on hover). */
.sub-vendor + .sub-vendor { margin-top: 0.35rem; }
/* Inbound: a job to chase with the vendor (Nov 2026), reason on hover. */
.late-vendor-tag {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--color-danger-bg);
  color: var(--color-danger);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: help;
}
.sub-vendor-name { display: block; font-weight: 600; }
/* How the order's parts get to the vendor (Nov 24 2026). */
.sub-transport { font-style: italic; }
/* Part records and the PO price check (Nov 24 2026): the verdict pill used
   on the Parts page, a part's record and the Customer PO page, and the
   record's own card above its costing. */
.price-check {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text-muted);
}
.price-check-ok { background: var(--color-success-bg, #dcfce7); color: var(--color-success, #166534); border-color: transparent; }
.price-check-bad { background: var(--color-danger-bg); color: var(--color-danger); border-color: transparent; }
.price-check-warn { background: var(--color-warning-bg); color: var(--color-warning-text); border-color: transparent; }
.price-check-figures { font-size: 0.78rem; margin-top: 0.15rem; white-space: normal; }
.badge-part-record { background: var(--color-bg); border: 1px solid var(--color-border); color: var(--color-text-muted); }
.record-rev { font-weight: 400; color: var(--color-text-muted); font-size: 0.7em; }
.part-record-card h2 { font-size: 1rem; margin: 0 0 0.5rem; }
.part-record-card .record-at-title { margin-top: 1.1rem; }
.record-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); gap: 1.25rem 2rem; margin-bottom: 1rem; }
.record-sales td, .record-sales th { padding-top: 0.3rem; padding-bottom: 0.3rem; }
.record-last-quoted { margin: 0 0 0.25rem; }
.record-inline-form { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: 0.4rem 0; }
.record-inline-form input[type="number"] { width: 6.5rem; }
.record-inline-form input[type="date"] { width: 9.5rem; }
.record-inline-form input[type="text"] { width: 12rem; }
.record-at-result { margin-top: 0.4rem; }
.record-pointer { margin-bottom: 1rem; }
.po-checks-card h2 { margin-bottom: 0.25rem; }
.price-check-cell { min-width: 9rem; }

/* Parts sent back to a subcontractor for rework (Nov 24 2026): the tag on
   the Subcontractor page's row, the line under the vendor on the job page,
   and the Send back folder's list and form. */
.job-tag.sub-return-tag { display: block; width: fit-content; cursor: help; white-space: nowrap; }
.step-sub-return strong { color: var(--color-warning-text); }
.sub-returns-table td { vertical-align: top; }
.sub-return-cancelled td { color: var(--color-text-muted); text-decoration: line-through; }
.sub-return-cancelled td:last-child { text-decoration: none; }
.sub-return-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 0.75rem 1rem;
  align-items: end;
  margin-top: 1rem;
}
.sub-return-form .sub-return-reason { grid-column: 1 / -1; }
.sub-return-form textarea { width: 100%; }
.sub-return-form button { justify-self: start; }
.sub-finish {
  display: block;
  max-width: 18ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.85em;
  color: var(--color-text-muted);
}

/* Headings for a page carrying more than one queue (the Subcontractor
   page's Outbound and Inbound lists), each with a count beside it so the
   size of each is readable without counting rows. */
.queue-heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
}
.queue-heading:first-of-type { margin-top: 0.5rem; }
.queue-count {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-text-muted);
  background: #eef0f3;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
}
.queue-note { margin: -0.2rem 0 0.7rem; font-size: 0.85rem; max-width: 70ch; }

/* ---------- Flash ---------- */

.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-weight: 550;
}
/* A notice on a page that came back part-way down (app.js, "Keep your
   place after saving"): it floats at the top of the screen, since the top
   of the page is out of sight. */
.flash.flash-floating {
  position: fixed;
  top: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(46rem, calc(100vw - 2rem));
  margin: 0;
  z-index: 60;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(15, 23, 42, 0.08);
}
.flash.flash-floating:not(.flash-transient) { cursor: pointer; }
.flash-success { background: var(--color-success-bg); color: var(--color-success); }
.flash-error { background: var(--color-danger-bg); color: var(--color-danger); }
.flash-info { background: #e0ecff; color: var(--color-primary-dark); }
.flash-warning { background: var(--color-warning-bg); color: var(--color-warning-text); }

/* ---------- Cards ---------- */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.card-form { max-width: 720px; }
/* New Job / Edit Steps (Dec 3 2026): the steps need the room - the brake
   sheet alone is eight columns - and used to spill out of the 720px card. */
.card-form.card-form-wide { max-width: 1040px; }

.job-summary.card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem 1.5rem;
  max-width: none;
}
/* Grid items default to min-width:auto, so one long unbroken value (a
   comma-joined part description, a file path in Notes) widened its cell
   and spilled over the neighbouring one. Let values wrap inside their cell. */
.job-summary.card > * { min-width: 0; overflow-wrap: anywhere; }
/* Notes run the full width of the card instead of one tall thin column. */
.job-summary.card > .summary-wide { grid-column: 1 / -1; }
.job-summary.card > .summary-wide > span:last-child { max-width: 90ch; display: block; }
/* Production 9's short summary (views/jobDetail.js floorSummary): five
   fields on one line, wrapping only when the screen is too narrow. */
.job-summary.job-summary-floor.card { display: flex; flex-wrap: wrap; gap: 0.6rem 2.5rem; align-items: flex-start; }
.job-summary.job-summary-floor.card > * { flex: 0 1 auto; }
.job-summary .summary-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
  margin-bottom: 0.15rem;
}

/* ---------- Forms ---------- */

.stacked-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0.85rem 0 0.3rem;
}
.stacked-form label:first-child { margin-top: 0; }

input[type="text"],
input[type="search"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--color-surface);
  color: var(--color-text);
}
textarea { resize: vertical; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0 1.25rem;
}
/* Shear metal rows (Metal / Cut Length / Cut Width) want three narrower
   columns side by side rather than the wider auto-fit columns above. */
.form-grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500 !important;
}
.checkbox-label input { width: auto; }

.inline-form { display: inline-block; margin: 0; }

/* Users page: Name / Username / Role / Save all in one row per user,
   wrapping to multiple lines on a narrow screen rather than forcing the
   whole Users table to scroll sideways for this one row's sake. The role
   select is deliberately narrow (it only ever holds a short word like
   "Admin" or "Production") so the three fields comfortably share a line
   instead of the select stretching to fill it. */
.user-edit-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.user-edit-grid input[type="text"] { width: auto; min-width: 8rem; }
.role-select { width: auto; min-width: 0; max-width: 8rem; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn-block { width: 100%; text-align: center; }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-secondary { background: var(--color-surface); border-color: var(--color-border); color: var(--color-text); }
.btn-secondary:hover { background: var(--color-bg); }
.btn-success { background: var(--color-success); color: #fff; }
.btn-success:hover { background: #116531; }
.btn-ghost { background: none; border-color: var(--color-border); color: var(--color-text-muted); }
.btn-ghost:hover { background: var(--color-bg); }
.btn-danger { background: none; border-color: var(--color-danger); color: var(--color-danger); }
.btn-danger:hover { background: var(--color-danger-bg); }
.btn-small { padding: 0.32rem 0.65rem; font-size: 0.8rem; }

/* ---------- Attach Print File (New Job form + job detail page) ---------- */
/* The visible "Attach Print File" control is a <label for="..."> styled
   as a button - clicking it opens the file picker natively, no JS
   required for that part. .stacked-form label's block/margin rules would
   otherwise clobber the button look, so this re-asserts it. */
.file-attach-label-text {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0.85rem 0 0.3rem;
}
/* This one sits in a .form-grid cell alongside real <label>s (New Job's
   Print File field), and those get their top margin zeroed by
   .stacked-form label:first-child above. Being a <span> rather than a
   <label>, this didn't - so it and its button sat a line lower than the
   Rev./Priority fields beside it in the same grid row. */
.stacked-form .file-attach-label-text:first-child { margin-top: 0; }
.stacked-form label.file-attach-button,
label.file-attach-button {
  display: inline-block;
  margin: 0;
  font-weight: 600;
}
.file-attach-field {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.file-attach-input {
  /* Fully removed from rendering (rather than the usual clip-to-nothing
     visually-hidden trick) so no browser's own native file-input control
     ("Choose File" / "Browse") ever shows up next to the styled
     .file-attach-button label above - clicking a <label for="..."> still
     opens the picker for a display:none input in every real browser. */
  display: none;
}
.file-attach-filename { font-size: 0.85rem; }

.print-file-card { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem 1rem; }
.print-file-card .file-attach-field { margin-left: auto; }

/* The office's job summary as one card (Nov 2026, views/jobDetail.js
   summaryGroup): the summary grid on top, Admin notes and Print file in a
   second row attached underneath. */
.job-summary-group { margin-bottom: 1.5rem; }
.job-summary-group > .job-summary.card { margin-bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.job-summary-extras {
  /* Print File and the folders side by side on one row, each as wide as
     what it says (Nov 23 2026); an open folder takes a row of its own
     underneath. */
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.25rem;
  border: 1px solid var(--color-border);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--color-bg);
  box-shadow: var(--shadow);
}
/* An odd folder out at the end of the list takes the whole row. */
.job-summary-extras > .card { margin: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.job-summary-extras > .admin-notes { margin: 0; }
.job-summary-extras > .admin-notes-open { box-shadow: inset 3px 0 0 var(--color-warning-text); background: var(--color-warning-bg); }
/* Job documents (Nov 19 2026): a full-width row under Admin notes / Print
   file in the office's summary card; a small card of its own under the
   floor's short summary. */
.job-summary-extras > :first-child { border-top: 0; }
.job-docs-head { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem 1rem; }
.job-docs-head > div:first-child { flex: 1 1 16rem; }
.job-docs-attach select { width: auto; margin: 0; padding: 0.3rem 0.5rem; font-size: 0.85rem; }
.job-docs-list { list-style: none; margin: 0.5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.job-docs-list li { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.25rem 0.6rem; font-size: 0.9rem; }
.job-docs-list a { overflow-wrap: anywhere; }
.doc-kind {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  white-space: nowrap;
}
.job-docs-list .doc-remove { padding: 0.1rem 0.5rem; }
/* Certifications (Nov 23 2026): the job's metal, subcontractor and hardware
   certs - a documents card of its own that scans can be dropped onto. */
.job-certs-card { transition: background-color 0.12s, box-shadow 0.12s; }
/* Folders (Nov 23 2026): a block that is one line until it's opened - the
   job page's Certifications, an Inventory item's Lots. */
details.folder > summary, details.lots-folder > summary, .folder-head { display: flex; align-items: center; flex-wrap: wrap; gap: 0.35rem 0.6rem; cursor: pointer; list-style: none; }
details.folder > summary::-webkit-details-marker, details.lots-folder > summary::-webkit-details-marker, .folder-head::-webkit-details-marker { display: none; }
details.folder > summary:hover strong, .folder-head:hover .pack-heading { text-decoration: underline; }
details.folder { padding: 0.7rem 1rem; }
details.folder[open] > summary { margin-bottom: 0.1rem; }
.folder-body { margin-top: 0.6rem; }
.folder-note { font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.folder-flag { font-size: 0.8rem; color: #7a4b00; background: #fdf3df; border: 1px solid #f0d9a8; border-radius: 999px; padding: 0.05rem 0.5rem; }
/* The office's job page (Nov 23 2026): what a job carries besides its
   traveler is a short list of one-line folders - two across under the
   summary (an open one takes the whole row), and Charges / Edit Job as thin
   bars under the traveler. */
.job-summary-extras > details.folder { padding: 0.6rem 0.9rem; min-width: 0; }
.job-summary-extras > details.folder > summary { flex-wrap: nowrap; }
.job-summary-extras > details.folder:not([open]) .folder-note { overflow: visible; }
.job-summary-extras > details.folder > summary > strong, .job-summary-extras > details.folder > summary > .folder-flag { white-space: nowrap; }
.job-summary-extras > details.folder[open] { border-top: 1px solid var(--color-border); order: 2; }
.job-summary-extras > details.folder[open] > summary { flex-wrap: wrap; }
.job-summary-extras > details.folder[open] { flex: 1 1 100%; padding-bottom: 0.9rem; }
.job-summary-extras > .print-file-card { display: flex; flex-wrap: nowrap; align-items: center; gap: 0.3rem 0.5rem; padding: 0.45rem 1rem; min-width: 0; max-width: 100%; }
.job-summary-extras > .print-file-card > div:first-child { flex: 0 1 auto; min-width: 0; max-width: 30rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-summary-extras > .print-file-card .btn { padding: 0.15rem 0.5rem; font-size: 0.75rem; }
.job-summary-extras > .print-file-card .file-attach-field { margin-left: 0; }
.job-summary-extras > details.admin-notes-open { box-shadow: inset 3px 0 0 var(--color-warning-text); background: var(--color-warning-bg); }
.admin-notes-form textarea { width: 100%; }
details.charges-card, details.edit-job-folder, details.run-card-offer { margin: 0.75rem 0; }
details.edit-job-folder[open] { padding-bottom: 1.25rem; }
.pack-folder > summary .pack-heading { margin: 0; }
.pack-folder:not([open]) { padding: 0.1rem 0; }
.pack-folder[open] > summary { margin-bottom: 0.5rem; }
.job-summary.card > .summary-wide > span.summary-lines,
.job-summary.card > .summary-wide > .summary-lines-wrap > span.summary-lines { display: flex; flex-wrap: wrap; gap: 0.2rem 1.75rem; }
.job-summary .summary-line { display: inline-block; white-space: nowrap; }
.summary-line strong { font-weight: 600; margin-right: 0.3rem; }
.summary-line-shipped { color: var(--color-text-muted); }
.proven-cell .proven-actions { display: inline-flex; margin: 0 0 0 0.5rem; vertical-align: baseline; }
.proven-cell .proven-actions .btn { padding: 0.05rem 0.45rem; font-size: 0.75rem; }
.folder-icon { position: relative; display: inline-block; width: 1.15rem; height: 0.8rem; margin-top: 0.15rem; border: 1.5px solid var(--color-text-muted); border-radius: 2px; flex: none; }
.folder-icon::before { content: ''; position: absolute; left: -1.5px; top: -0.32rem; width: 0.5rem; height: 0.22rem; border: 1.5px solid var(--color-text-muted); border-bottom: 0; border-radius: 2px 2px 0 0; }
details[open] > summary .folder-icon { background: #e8eefc; }
.lots-folder-body { margin-top: 0.6rem; }
.lots-folder { padding: 0.8rem 1rem; }
.lots-table td { vertical-align: top; }
.lot-cert { display: inline-flex; align-items: center; gap: 0.15rem; margin-right: 0.5rem; }
.lot-x { padding: 0 0.35rem; line-height: 1.2; }
.lot-no-cert, .lot-over { color: #b45309; }
.lots-note { font-size: 0.82rem; margin: 0.4rem 0 0.8rem; }
.lot-form { display: flex; flex-direction: column; gap: 0.5rem; padding-top: 0.7rem; border-top: 1px solid var(--color-border); }
.lot-form-row { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: flex-end; }
.lot-form-row label { display: block; font-size: 0.8rem; margin-bottom: 0.2rem; }
.lot-form-row input[type="text"], .lot-form-row input[type="number"] { width: 9rem; }
.lot-form-source { display: flex; flex-direction: column; gap: 0.2rem; }
.lot-form button { align-self: flex-start; }
/* Receive with the lot (Ordering): the same lot boxes on a page of their
   own, extra lots folded away; and the small link to it beside a Lectro
   order's one-click Receive. */
.cert-from-batch { margin-top: 0.4rem; font-size: 0.9rem; }
/* Pick which batch a job's shelf pieces come from - folded under Batch. */
.batch-pick { display: inline-block; vertical-align: top; margin-left: 0.6rem; }
.batch-pick[open] { display: block; margin: 0.3rem 0 0; }
.batch-pick > summary { cursor: pointer; color: var(--color-text-muted); font-size: 0.8rem; width: fit-content; }
.batch-pick-form label strong { white-space: nowrap; }
.batch-pick-form { display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; align-items: center; margin-top: 0.35rem; font-size: 0.9rem; }
.batch-pick-form label { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 400; margin: 0; }
.batch-pick-form input.line-num { width: 4.5rem; }
.receive-form { border-top: 0; padding-top: 0.25rem; }
.lot-record > summary { cursor: pointer; color: var(--color-text-muted); font-size: 0.85rem; width: fit-content; }
.lot-record[open] > summary { margin-bottom: 0.5rem; }
.receive-more-lots > summary { cursor: pointer; color: var(--color-text-muted); font-size: 0.85rem; width: fit-content; }
.receive-more-lots[open] > summary { margin-bottom: 0.4rem; }
.receive-more-lots .receive-lot-row { margin-bottom: 0.5rem; }
.order-lot-link { font-size: 0.8rem; margin: 0 0.4rem 0 0.15rem; white-space: nowrap; }
.lot-nocount { align-self: end; padding-bottom: 0.35rem; }
.job-certs-card.cert-drop-over { background: #eef4ff !important; box-shadow: inset 0 0 0 2px var(--color-primary) !important; }
.job-certs-attach select { max-width: 17rem; }
.job-certs-attach select.cert-pick-needed { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.18); }
.cert-kind { min-width: 6.2rem; text-align: center; }
.cert-for { font-weight: 600; }
.cert-for.muted { font-weight: 400; }
.cert-missing { margin-top: 0.55rem; font-size: 0.85rem; color: #7a4b00; }
.cert-drop-status { margin-top: 0.5rem; padding: 0.45rem 0.65rem; border-radius: var(--radius); font-size: 0.88rem; background: #eef4ff; border: 1px solid #c7d7f8; }
.cert-drop-status[hidden] { display: none; }
.cert-drop-status-error { background: #fdecec; border-color: #f3b9b9; color: #8a1c1c; }
.cert-drop-status ul { margin: 0.25rem 0 0.25rem 1.1rem; padding: 0; }

/* ---------- Login ---------- */

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1rem;
  background: linear-gradient(160deg, #1d4ed8 0%, #14235c 100%);
}
.login-card {
  background: var(--color-surface);
  padding: 2.25rem;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
  width: 100%;
  max-width: 380px;
}
.login-card h1 { margin-bottom: 0.15rem; }

/* ---------- Filter bar ---------- */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 0.85rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
}
/* type="search" as well as "text" - the queue search boxes are search
   inputs, and without this they fall back to a default width too narrow to
   read their own placeholder. */
.filter-bar input[type="text"],
.filter-bar input[type="search"] { width: auto; flex: 1 1 260px; }
.filter-bar select { width: auto; }
/* The Shipping/Subcontractor search sits right above its own table, so it
   gets a lighter frame and a tighter gap than the Active/Inbox bar. */
.queue-search { padding: 0.6rem; margin-bottom: 0.75rem; }

/* Label kept for screen readers, hidden on screen (the placeholder says it). */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---------- Table ---------- */

.table-wrap {
  overflow-x: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th, .data-table td {
  text-align: left;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

/* Sortable columns (Oct 2026): every list heading sorts on click, again
   to flip; the arrow shows which way. */
.data-table.sortable th.sortable-th { cursor: pointer; user-select: none; position: relative; padding-right: 1.4rem; }
.data-table.sortable th.sortable-th:hover { color: var(--color-primary); }
.data-table.sortable th.sortable-th::after { content: '\25B4\25BE'; position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%); font-size: 0.65rem; color: var(--color-text-muted); opacity: 0.45; letter-spacing: -0.15em; }
.data-table.sortable th.sortable-th[aria-sort='ascending']::after { content: '\25B2'; opacity: 1; color: var(--color-primary); }
.data-table.sortable th.sortable-th[aria-sort='descending']::after { content: '\25BC'; opacity: 1; color: var(--color-primary); }
.data-table.sortable th.sortable-th:focus-visible { outline: 2px solid var(--color-primary); outline-offset: -2px; }
/* Eleven columns on the Subcontractor page's Inbound table, the widest of
   them a full timestamp, and four buttons in its Action cell. Tighter
   cells keep it on screen instead of scrolling sideways with those buttons
   off the edge. Has to sit after the .data-table rule above rather than
   with the rest of the subcontractor styles - same specificity, so it only
   wins by coming later. */
.subcontractor-table th,
.subcontractor-table td {
  padding-left: 0.45rem;
  padding-right: 0.45rem;
}

.data-table th {
  background: #fafbfc;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #fafbfc; }

/* Subcontractor queue: this table carries the most columns of any here
   (Job/Customer/Part/Step/Subcontractor/Priority/Final Count/Since/Action),
   and with the global `white-space: nowrap` above it grew wide enough to
   push its Action cell - Print PO / Print Label / Mark Sent - right out of
   the visible area on an ordinary laptop screen, where it read as "the
   buttons are missing" rather than "scroll sideways". The three free-text
   columns wrap instead, which is what keeps the whole row on screen; the
   short ones (Priority/Final Count/Since) stay nowrap so they don't break
   in awkward places. */
/* Columns 3/4/5 are Customer, Step and Subcontractor - the three that hold
   real words rather than a short code, so they wrap instead of forcing the
   table wider. Column 1 (Part #) and 2 (PO #) keep .data-table's nowrap:
   breaking an identifier across two lines makes it harder to read, not
   easier. Positions matter here - Customer moved from second to third when
   Part # took the lead - so this block and the header row in
   views/subcontractor.js have to be changed together. */
.subcontractor-table td:nth-child(3),
.subcontractor-table td:nth-child(4),
.subcontractor-table td:nth-child(5) {
  white-space: normal;
  min-width: 7rem;
}
.subcontractor-table td:nth-child(3) { max-width: 13rem; }
/* Sub PO # (column 6): the LE-#### number vendors quote back. Stays on one
   line like the other identifiers; a job split across vendors stacks one
   number per line with the vendor beside it. */
.subcontractor-table .sub-po-number { font-variant-numeric: tabular-nums; }
.subcontractor-table .sub-po-number + .sub-po-number { margin-top: 0.15rem; }
/* A searched sub PO whose job isn't in the list being searched. */
.sub-po-lookup { margin: -0.25rem 0 0.75rem; font-size: 0.85rem; }
.sub-po-lookup p { margin: 0 0 0.2rem; }
.sub-po-lookup ul { margin: 0; padding-left: 1.2rem; }
/* One PO for several jobs (Dec 2026): the Send together line above
   Outbound, and "with ..." under a shared number. */
.shared-po-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin: 0 0 0.5rem; font-size: 0.85rem; }
.sub-po-shared { font-size: 0.78rem; line-height: 1.3; margin-top: 0.1rem; }
.sub-po-shared .inline-form { display: block; }
/* Subcontractor PO numbers that open the PO itself (views/subPoLink.js) -
   Job History, the job page's Subcontractor step and the lookup above. */
.sub-po-link { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.step-sub-po { margin-left: 0.4rem; font-size: 0.85rem; white-space: nowrap; }
.history-sub-po { font-variant-numeric: tabular-nums; white-space: nowrap; }
.history-sub-po + .history-sub-po { margin-top: 0.3rem; }
.history-sub-po-vendor { font-size: 0.8rem; }
.row-overdue { background: #fff7f7; }
.empty-state { text-align: center; color: var(--color-text-muted); padding: 2rem !important; white-space: normal; }

/* Traveler table (job detail page): unlike every other data table here,
   this one must never scroll horizontally - a full shipping address in
   the Shipping step needs to read top-to-bottom, not side-to-side. Fixed
   column widths + normal wrapping (instead of the nowrap every other
   .data-table uses) let rows grow taller instead of the table growing
   wider. */
.traveler-wrap { overflow-x: visible; }
.traveler-table { table-layout: fixed; }
.traveler-table th, .traveler-table td {
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
  vertical-align: top;
}
/* Eight columns: Step, Status, Count, Started, Completed, Time, Notes,
   Actions. These have to add up to 100% and there has to be one per
   column - the table is table-layout: fixed, so a column with no rule
   gets no width at all. (That is exactly what happened when Time was
   added into the middle of a seven-column set: every later column
   inherited the width of the one before it and Actions fell off the end.) */
/* Step gets the most room: it carries the metal, hardware and finishes
   the floor reads off this table. Started/Completed/Time are mostly a
   dash until a step runs, so they give up the space. */
.traveler-table th:nth-child(1), .traveler-table td:nth-child(1) { width: 31%; }
.traveler-table th:nth-child(2), .traveler-table td:nth-child(2) { width: 9%; }
.traveler-table th:nth-child(3), .traveler-table td:nth-child(3) { width: 7%; }
.traveler-table th:nth-child(4), .traveler-table td:nth-child(4) { width: 11%; }
.traveler-table th:nth-child(5), .traveler-table td:nth-child(5) { width: 11%; }
.traveler-table th:nth-child(6), .traveler-table td:nth-child(6) { width: 7%; }
.traveler-table th:nth-child(7), .traveler-table td:nth-child(7) { width: 13%; }
.traveler-table th:nth-child(8), .traveler-table td:nth-child(8) { width: 11%; }
/* Production 9's six columns (no Started / Completed - views/jobDetail.js):
   Step, Status, Count, Time, Notes, Actions. Same rule: one per column,
   adding up to 100%. */
/* The office's traveler (Nov 23 2026): six columns too - Started and
   Completed read in small type under the time worked, and a step with no
   note shows "+ note" instead of an empty box. */
.traveler-table.traveler-table-office th:nth-child(1), .traveler-table.traveler-table-office td:nth-child(1) { width: 38%; }
.traveler-table.traveler-table-office th:nth-child(2), .traveler-table.traveler-table-office td:nth-child(2) { width: 10%; }
.traveler-table.traveler-table-office th:nth-child(3), .traveler-table.traveler-table-office td:nth-child(3) { width: 7%; }
.traveler-table.traveler-table-office th:nth-child(4), .traveler-table.traveler-table-office td:nth-child(4) { width: 17%; }
.traveler-table.traveler-table-office th:nth-child(5), .traveler-table.traveler-table-office td:nth-child(5) { width: 12%; }
.traveler-table.traveler-table-office th:nth-child(6), .traveler-table.traveler-table-office td:nth-child(6) { width: 16%; }
.step-when { font-size: 0.78rem; color: var(--color-text-muted); white-space: nowrap; }
.note-add > summary { cursor: pointer; list-style: none; font-size: 0.8rem; color: var(--color-text-muted); width: fit-content; }
.note-add > summary::-webkit-details-marker { display: none; }
.note-add > summary:hover { color: var(--color-primary); }
.note-add[open] > summary { display: none; }
.edit-job-delete { display: flex; align-items: center; gap: 0.6rem; margin-top: 1.25rem; padding-top: 0.75rem; border-top: 1px solid var(--color-border); font-size: 0.85rem; }
.traveler-table.traveler-table-floor th:nth-child(1), .traveler-table.traveler-table-floor td:nth-child(1) { width: 32%; }
.traveler-table.traveler-table-floor th:nth-child(2), .traveler-table.traveler-table-floor td:nth-child(2) { width: 12%; }
.traveler-table.traveler-table-floor th:nth-child(3), .traveler-table.traveler-table-floor td:nth-child(3) { width: 8%; }
.traveler-table.traveler-table-floor th:nth-child(4), .traveler-table.traveler-table-floor td:nth-child(4) { width: 9%; }
.traveler-table.traveler-table-floor th:nth-child(5), .traveler-table.traveler-table-floor td:nth-child(5) { width: 19%; }
.traveler-table.traveler-table-floor th:nth-child(6), .traveler-table.traveler-table-floor td:nth-child(6) { width: 20%; }
.traveler-table .note-form input { width: 100%; }
/* A full shipping address (entered as a multi-line textarea) should keep
   its line breaks here instead of collapsing to one run-on line. */
.shipping-destination-text { white-space: pre-wrap; display: inline-block; vertical-align: top; }

.job-link { font-weight: 650; }
.floor-card-part { font-size: 1.15rem; font-weight: 750; white-space: nowrap; }
.text-overdue { color: var(--color-danger); font-weight: 600; }
/* ASAP is urgent but not late - it reads as emphasis, deliberately not in
   the overdue red, so a permanent ASAP never dilutes a real overdue flag. */
.text-asap { color: var(--color-warning-text); font-weight: 700; letter-spacing: 0.02em; }
.tag-inprogress { color: var(--color-primary); font-size: 0.75rem; font-weight: 600; }

/* ---------- Badges ---------- */

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge-role-creator { background: #f3e8ff; color: #7e22ce; }
.badge-urgency-high { background: var(--color-warning-bg); color: var(--color-warning-text); }
.badge-urgency-rush { background: var(--color-danger-bg); color: var(--color-danger); }

.badge-status-active { background: #e0ecff; color: #1d4ed8; }
.badge-status-on_hold { background: var(--color-warning-bg); color: var(--color-warning-text); }
.badge-status-subcontractor { background: #f3e8ff; color: #7e22ce; }
/* Buy / Outside Machining (Nov 30 2026): a job waiting on a part a vendor
   makes complete, and where each bought line stands. */
.badge-status-buying { background: #fef3c7; color: #92400e; }
.buy-state { display: inline-block; padding: 0.05rem 0.45rem; font-size: 0.72rem; font-weight: 600; line-height: 1.5; border-radius: 4px; border: 1px solid #c9d2dc; background: #f6f8fa; color: #2b3440; white-space: nowrap; }
.buy-state-ready, .buy-state-received { background: #dcfce7; border-color: #86efac; color: #166534; }
.buy-state-on_order { background: #dbeafe; border-color: #93c5fd; color: #1e40af; }
.buy-state-partial, .buy-state-quoting { background: #fef3c7; border-color: #fcd34d; color: #92400e; }
.buy-state-not_ordered { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }
.buy-line + .buy-line { margin-top: 0.45rem; }
.buy-line-text, .buy-line-status { font-size: 0.85rem; margin-top: 0.1rem; }
.buy-step-note { font-size: 0.85rem; margin-top: 0.3rem; }
.buy-held { font-weight: 600; color: #92400e; }
.buy-more { margin-top: 0.6rem; }
.buy-more > summary { cursor: pointer; color: #4b5563; font-size: 0.9rem; }
.buy-input-row { margin-top: 0.5rem; }
.badge-status-shipping { background: #f3e8ff; color: #7e22ce; }
.badge-status-complete { background: var(--color-success-bg); color: var(--color-success); }
.badge-status-cancelled { background: #eef0f3; color: #6b7684; }
.badge-status-pending { background: #eef0f3; color: #4b5563; }
.badge-status-in_progress { background: #e0ecff; color: #1d4ed8; }
.badge-status-skipped { background: #eef0f3; color: #6b7684; }
/* Paused is amber like On Hold - both mean "stopped, will resume" - but it
   is a step-level state, not a job-level one. */
.badge-status-paused { background: var(--color-warning-bg); color: var(--color-warning-text); }
.badge-status-rts { background: var(--color-warning-bg); color: var(--color-warning-text); }

/* ---------- Job detail steps ---------- */

.step-in_progress td { background: #f5f8ff; }
/* The next step to work: one accent bar down the row's left edge. (It used
   to be drawn on every cell, which read as a blue line between each
   column.) */
.step-next-up td { background: #f7faff; }
.step-next-up td:first-child { box-shadow: inset 4px 0 0 var(--color-primary); }
/* A job page opened from a traveler QR code: the step that's up next
   flashes so it's easy to find (app.js's currentStepOnScan). */
@keyframes scan-landed { from { background: #fff3c4; } to { background: #f7faff; } }
.step-next-up.scan-landed td { animation: scan-landed 2.5s ease-out; }
@media (prefers-reduced-motion: reduce) { .step-next-up.scan-landed td { animation: none; background: #fff3c4; } }
/* Production 9 opening a job that isn't on Active (server.js's jobNotOnFloorPage). */
.job-not-on-floor { max-width: 32rem; margin: 2rem auto; text-align: center; }
.job-not-on-floor-where { font-size: 1.25rem; font-weight: 600; margin: 1rem 0 1.5rem; }
/* Users page: the Shared floor login tick. */
.shared-login-check { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.9rem; white-space: nowrap; }
.idle-logout-banner { position: sticky; top: 0; z-index: 50; margin: 0; text-align: center; }
.step-station { font-weight: 600; }
/* Actions wrap onto a second line in a narrow cell instead of running out
   of it (Join + Pause beside Complete, or a count box). Each button keeps
   its label on one line. */
.step-action-group { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; }
.step-action-group .inline-form { margin: 0; }
.step-action-group .btn, .step-after { white-space: nowrap; }
.step-action-group .step-complete-form { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; }
.step-action-group .step-count-input { width: 5.5em; }
.step-after { font-size: 0.85rem; font-style: italic; }

/* Tighter cells than the other tables, to make room for the Time column. */
.traveler-table th,
.traveler-table td {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}
.traveler-table .note-input { min-width: 0; width: 100%; }
.step-time-cell {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.step-time-running { font-size: 0.75rem; }
.assign-form select { width: auto; }
.note-form { display: flex; gap: 0.4rem; }
.note-form input { width: 180px; }

/* ---------- Activity log ---------- */

.activity-log { list-style: none; padding: 0; margin: 0; }
.activity-log li {
  display: flex;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.88rem;
  flex-wrap: wrap;
}
.activity-log li:last-child { border-bottom: none; }
.activity-time { color: var(--color-text-muted); min-width: 150px; }
.activity-user { font-weight: 600; min-width: 100px; }

/* ---------- Floor view ---------- */

.floor-section { margin-bottom: 2rem; }
.floor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.floor-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
}
.floor-card-overdue { border-color: var(--color-danger); }
/* Inbox cards shaded by urgency (from slack, same as the Live board's
   rows): Rush light red, High light yellow; Normal - most jobs - plain. */
.floor-card.floor-card-urgency-rush { background: #fde2e2; }
.floor-card.floor-card-urgency-high { background: #fdf0c2; }
/* On hold or waiting for review: gray, whatever the urgency - don't start
   these. The REVIEW stripe and badge stay magenta on top. */
.floor-card.floor-card-held { background: #d4d8de; border-color: #aeb4bd; }
.floor-card.floor-card-held .floor-card-part, .floor-card.floor-card-held .floor-card-qty-value { color: #374151; }
.floor-card.floor-card-held .muted, .floor-card.floor-card-held .floor-card-meta { color: #3f4652; }
.floor-card.floor-card-held.floor-card-review { border-left-color: #c8008f; }
/* Inbox toolbar: the search bar with the Group by metal type button
   beside it; grouped, one block per metal, the metal needed soonest on top. */
.queue-toolbar { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.6rem; margin-bottom: 1.25rem; }
.queue-toolbar .filter-bar { flex: 1 1 auto; margin-bottom: 0; }
.queue-group-btn { align-self: stretch; display: inline-flex; align-items: center; white-space: nowrap; }
.queue-group-btn-on { background: #1c2430; color: #fff; border-color: #1c2430; }
.queue-group-btn-on:hover { background: #2c3644; color: #fff; }
.metal-block { margin-bottom: 1.75rem; }
.metal-block-title { margin: 0 0 0.6rem; padding-bottom: 0.35rem; border-bottom: 2px solid var(--color-border); font-size: 1.15rem; }
.metal-block:first-of-type .metal-block-title { margin-top: 0.25rem; }
/* Job card (Nov 2026 - views/floor.js jobCard): part number and bubbles on
   the first row (the bubbles never drop; a long part number wraps at its
   dashes); Customer, PO and - for the office - Due down the left, QTY
   right-aligned beside Customer with the number under it; the step name
   and the buttons pinned to the bottom of the card, so Start / Complete
   sits in the bottom-right corner on every card in a row. */
.floor-card { display: flex; flex-direction: column; }
.floor-card-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  column-gap: 0.5rem;
  margin-bottom: 0.35rem;
}
/* Nov 12 2026: a long part number keeps its line - the bubbles drop under
   it on a narrow card rather than the number breaking at every dash
   ("CC09-" / "01757-" / "000"). It only wraps when it's wider than the
   whole card. Twelve characters and up print a little smaller. */
.floor-card-top .floor-card-part { flex: 0 1 auto; white-space: normal; overflow-wrap: anywhere; min-width: 0; }
.floor-card-top .floor-card-badges { margin-left: auto; }
.floor-card-part.floor-card-part-long { font-size: 1.02rem; }
.floor-card-station { font-weight: 700; font-size: 1.05rem; margin-bottom: 0.5rem; }
.floor-card-badges { display: flex; gap: 0.25rem; flex-wrap: nowrap; justify-content: flex-end; align-items: center; margin-top: 0.32rem; }
/* Card bubbles: smaller and all one height, kept on one row in the
   top-right corner; the Lectro / AFI bubble is last, so it's the one in
   the corner, and both are the same width. */
.floor-card-badges .badge { font-size: 0.56rem; line-height: 1; padding: 0.24rem 0.36rem; letter-spacing: 0.02em; }
.floor-card-badges .badge-company { width: 4.3em; padding-left: 0; padding-right: 0; text-align: center; letter-spacing: 0.02em; }
.floor-card-info { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; margin-bottom: 0.5rem; }
.floor-card-info-left { min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.floor-card-customer { font-size: 0.9rem; font-weight: 600; color: var(--color-text); overflow-wrap: anywhere; }
.floor-card-po { font-size: 0.82rem; color: var(--color-text-muted); }
.floor-card-due { font-size: 0.82rem; font-weight: 600; color: var(--color-text-muted); white-space: nowrap; }
.floor-card-due.floor-card-due-overdue { color: var(--color-danger); }
.floor-card-due.floor-card-due-asap { color: var(--color-warning-text); font-weight: 700; }
.floor-card-qty { display: flex; flex-direction: column; align-items: flex-end; text-align: right; flex-shrink: 0; }
.floor-card-qty-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
  line-height: 1.25rem;
}
.floor-card-qty-value { font-weight: 800; font-size: 1.35rem; line-height: 1.1; color: #000; font-variant-numeric: tabular-nums; }
.floor-card-also-metal { font-size: 0.78rem; margin-bottom: 0.4rem; }
/* Hold (office only) sits as a quiet link beside the bubbles. */
.floor-card-hold { margin: 0; }
.floor-card-hold-link { font-size: 0.7rem; color: var(--color-text-muted); padding: 0 0.3rem; line-height: 1; }
.floor-card-hold-link:hover { color: var(--color-text); }
/* Inbox: jobs on hold or waiting for review pinned to the top. */
.held-block .metal-block-title { border-bottom-color: #aeb4bd; }
.floor-card-bottom { margin-top: auto; padding-top: 0.5rem; }
.floor-card-count { display: flex; justify-content: flex-end; margin-bottom: 0.4rem; }
.floor-card-count .step-count-input { width: 9em; }
/* Nov 12 2026: when the buttons (Pause, Join, Complete) don't fit beside
   the step name they drop to their own line, still right-aligned, instead
   of running off the card. */
.floor-card-bottom-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.4rem 0.5rem; }
.floor-card-step-name { font-weight: 700; font-size: 0.95rem; line-height: 1.2; color: var(--color-text); flex: 1 1 auto; min-width: min-content; overflow-wrap: normal; word-break: normal; }
/* Surfacing / Finishing: the work (Grind → Vibrate) under the step name. */
.floor-card-step { display: flex; flex-direction: column; gap: 0.1rem; flex: 1 1 auto; min-width: min-content; }
.floor-card-step .floor-card-step-name { flex: none; }
.floor-card-step-ops { font-size: 0.78rem; font-weight: 600; color: var(--color-text-muted); white-space: nowrap; }
/* Running: Pause and Complete together, a little smaller than Start, so
   the step name keeps its words whole beside them. */
.floor-card-actions .floor-card-complete, .floor-card-actions .floor-card-pause { padding: 0.4rem 0.6rem; font-size: 0.84rem; }
.floor-card-actions .btn-small { padding-left: 0.6rem; padding-right: 0.6rem; }
.floor-card-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 0.4rem; flex-shrink: 0; margin-left: auto; max-width: 100%; }
.floor-card-actions .inline-form { margin: 0; }
.floor-card-actions .btn { margin: 0; }
.floor-card-status { font-size: 0.82rem; white-space: nowrap; }

/* ---------- Step picker (New Job) ---------- */

.steps-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  margin: 0.75rem 0 1.25rem;
}
.step-fieldset { min-width: 0; }
.step-fieldset .table-wrap, .step-fieldset .brake-bend-table { max-width: 100%; }
.step-count-note { font-weight: 500; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; border: 1px solid var(--color-border); border-radius: 999px; padding: 0 0.4rem; margin-left: 0.3rem; }
.suboptions-label { font-size: 0.8rem; }
/* The detail block under a step repeats the step's name ("Brake setup"
   under Brake) - a small label, not a second heading. */
.step-fieldset [data-step-panel] > h3 { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-text-muted); margin: 0 0 0.5rem; }
.step-fieldset .howto { margin-bottom: 0.5rem; }
/* Traveler note (Dec 3 2026): folded to "+ Traveler note" until it has
   something in it. */
.step-traveler-note { margin: 0.45rem 0 0 2.6rem; }
.step-traveler-note[hidden] { display: none; }
.step-traveler-note > summary { cursor: pointer; font-size: 0.8rem; color: var(--color-primary); width: fit-content; list-style: none; }
.step-traveler-note > summary::-webkit-details-marker { display: none; }
.step-traveler-note[open] > summary { color: var(--color-text-muted); }
.step-traveler-note textarea { margin-top: 0.3rem; max-width: 40rem; }
.step-traveler-note-text { margin-top: 0.25rem; font-size: 0.85rem; white-space: pre-line; }
.step-traveler-note-label { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-text-muted); margin-right: 0.25rem; }
.step-fieldset {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  background: var(--color-bg);
}
.step-checkbox { font-size: 0.95rem; }
.suboptions-group { margin: 0.6rem 0 0 1.6rem; }
.suboptions-list {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  max-width: 320px;
}
.suboption-label { font-weight: 500 !important; gap: 0.35rem; }

/* Drag-to-reorder sub-options list (Drill Press / Surfacing / Finishing) */
.suboptions-draglist {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  max-width: 320px;
}
.suboption-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.4rem 0.6rem;
  margin-bottom: 0.4rem;
}
.suboption-row .suboption-label { flex: 1; margin: 0; }
/* Drill Press's optional per-operation Qty/pc field (see jobNew.js's
   plainSubOptionField) - narrow and right-aligned in its row rather than
   the usual full-width input, since it only ever holds a small number.
   Qualified with the element/type selector (rather than the class alone)
   so it actually beats the generic `input[type="number"] { width: 100% }`
   rule above on specificity - without that, the 100% won and the box
   spilled out past the right edge of its own row. Same qualifying trick
   the Ordering/Inventory number fields below already use. */
.suboption-row input[type="number"].suboption-qty-input {
  width: 5.5rem;
  flex: 0 0 auto;
  padding: 0.32rem 0.5rem;
  text-align: right;
}
/* Secondary Operations' optional per-operation details box. */
.suboption-row input[type="text"].suboption-detail-input {
  flex: 2 1 14rem;
  min-width: 0;
  padding: 0.32rem 0.5rem;
}
.suboptions-list:has(.suboption-detail-input) { max-width: 560px; }
.suboptions-list .suboption-row:has(.suboption-detail-input) .suboption-label { flex: 0 0 7.5rem; }
/* Secondary Operations drag into order (Dec 2026): the same details box
   in a draggable row - wider list, a label column that fits "Source
   Inspection", and the AFI ink fields wrap under the row. */
.suboptions-draglist:has(.suboption-detail-input) { max-width: 600px; }
/* The DX / D4 quality-note reminder under Final QC's rows (Dec 2026). */
.qc-docs-hint { max-width: 560px; margin: 0.5rem 0; padding: 0.45rem 0.7rem; border-radius: var(--radius); background: var(--color-warning-bg); color: var(--color-warning-text); font-size: 0.9rem; }
.qc-docs-hint[hidden] { display: none; }
.suboptions-draglist .suboption-row:has(.suboption-detail-input) { flex-wrap: wrap; }
.suboptions-draglist .suboption-row:has(.suboption-detail-input) .suboption-label { flex: 0 0 9.5rem; }
.drag-handle {
  cursor: grab;
  color: var(--color-text-muted);
  font-size: 1rem;
  line-height: 1;
  user-select: none;
  touch-action: none;
}
.drag-handle-inline { font-size: 0.9rem; }
.suboption-row.dragging { opacity: 0.4; }

/* Every step fieldset on the New Job / Edit Steps picker can be dragged
   by its handle and duplicated (see views/jobNew.js's stepFieldset and
   public/js/app.js's steps-picker block). The title row holds the handle,
   the checkbox, a "1 of 2" tag when a step appears more than once, the
   step's status on Edit Steps, and Duplicate / Remove at the right. */
.step-fieldset-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
}
.step-fieldset-head .step-hint { font-size: 0.8rem; font-weight: 400; color: var(--color-text-muted); }
.step-fieldset-head .step-checkbox {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}
.step-drag-handle { padding: 0.15rem 0.1rem; }
.step-instance-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-primary);
  font-variant-numeric: tabular-nums;
}
.step-instance-tag:empty { display: none; }
.step-status-pill { font-size: 0.7rem; }
.step-fieldset-actions {
  display: flex;
  gap: 0.35rem;
  margin-left: auto;
}
.step-fieldset-actions .btn { padding: 0.2rem 0.6rem; font-size: 0.78rem; }
.step-fieldset.dragging { opacity: 0.45; }
/* While a step is being dragged, every step folds down to its title row. */
.steps-picker.is-sorting .step-fieldset > :not(.step-fieldset-head) { display: none; }
.steps-picker.is-sorting .step-fieldset { padding-block: 0.45rem; }
.step-fieldset.step-just-moved { animation: step-moved 0.9s ease-out; }
@keyframes step-moved {
  from { box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.35); }
  to { box-shadow: 0 0 0 3px rgba(29, 78, 216, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .step-fieldset.step-just-moved { animation: none; }
}
.step-fieldset .suboptions-group { margin-left: 2.6rem; }

/* Shear/Subcontractor/Assembly's own detail sections now render nested
   right inside that step's .step-fieldset (same background) rather than
   as separate cards further down the page - swap to the surface color so
   they still read as a distinct block, and tighten the margin to sit
   snugly under the step's checkbox/sub-options instead of the wider
   spacing those sections use when standalone. */
.step-fieldset .shear-metal,
.step-fieldset .subcontractor-details,
.step-fieldset .assembly-hardware,
.step-fieldset .punch-details {
  background: var(--color-surface);
  margin: 0.6rem 0 0;
}

/* Subcontractor details (New Job form) */
.subcontractor-details {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  padding: 1rem;
  margin: 0.5rem 0 1.25rem;
}
.subcontractor-details h3 { margin-top: 0; }
.sub-block {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.85rem;
  margin-bottom: 0.85rem;
}
.finish-list { margin-top: 0.5rem; }
/* A finish is just its name now; the subcontractor's one price for all of
   its finishes sits in .sub-price-row underneath. */
.finish-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.finish-row label, .sub-price-row label { font-size: 0.8rem; margin: 0 0 0.2rem; }
.finish-row input, .sub-price-row input { width: 100%; }
.finish-price-note { display: block; font-size: 0.76rem; }
.sub-price-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.5rem;
  align-items: end;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--color-border);
}
.sub-price-label { display: flex; flex-direction: column; gap: 0.1rem; font-size: 0.88rem; }
/* "Print price on the PO" (Nov 19 2026): its own line under the boxes. */
.sub-price-row .sub-price-print { grid-column: 1 / -1; margin: 0; font-size: 0.88rem; }
.sub-price-row .sub-price-print input { width: auto; }

@media (max-width: 640px) {
  .sub-price-row { grid-template-columns: 1fr; }
}

/* Assembly hardware / Shipping details (New Job form) */
.assembly-hardware {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  padding: 1rem;
  margin: 0.5rem 0 1.25rem;
}
.assembly-hardware h3 { margin-top: 0; }
.hardware-input-row {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.85rem;
  margin-bottom: 0.85rem;
}
/* Punch details (New Job form) */
.punch-details {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  padding: 1rem;
  margin: 0.5rem 0 1.25rem;
}
.punch-details h3 { margin-top: 0; }
/* Brake notes (Nov 2026): the box on the form, and the notes wherever
   they show (job page, floor card) keep the operator's line breaks. */
.brake-details textarea { width: 100%; min-height: 4.5rem; resize: vertical; }
/* Brake setup (Nov 19 2026): tooling fields in a row, then the bend table -
   the controller's parameters as columns in the handwritten sheets' order.
   The inputs are narrow and tabular so a row reads like the sheet. */
/* Punch over Die (Nov 19 2026): each a row of Size + its radius / V
   opening, on one grid so the Size boxes line up and so do the second
   boxes; the tooling note under both. */
.brake-tooling { display: grid; grid-template-columns: 4rem minmax(0, 14rem) minmax(0, 10rem); gap: 0.55rem 0.9rem; align-items: end; margin-bottom: 0.9rem; max-width: 34rem; }
.brake-tool { display: contents; }
.brake-tool-name { font-weight: 700; padding-bottom: 0.45rem; }
.brake-tooling-field { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.brake-tooling-field .pack-label { margin: 0; }
.brake-tooling-field input { width: 100%; padding: 0.35rem 0.5rem; font-size: 0.9rem; }
.brake-tooling-note { grid-column: 1 / -1; }
@media (max-width: 560px) { .brake-tooling { grid-template-columns: 3.4rem minmax(0, 1fr) minmax(0, 1fr); } }
/* More than one punch & die (Nov 30 2026): setups B-D under A, each its
   own tooling grid with a station. Setup A's heading and station, the
   "how they're used" choice and the bends' Set column only show once a
   second set is on (data-brake-multi on the section). */
.brake-details:not([data-brake-multi]) [data-brake-multi-only] { display: none !important; }
.brake-set-name { grid-column: 1 / -1; font-weight: 700; font-size: 0.95rem; margin-bottom: -0.2rem; }
.brake-toolset { border-top: 1px solid var(--color-border, #ddd); padding-top: 0.75rem; margin-bottom: 0.75rem; }
.brake-toolset .brake-tooling { margin-bottom: 0.5rem; }
.brake-set-remove { margin: 0 0 0.25rem; }
.brake-details [data-add-brake-set] { margin: 0 0 0.9rem; }
.brake-mode-field { max-width: 22rem; margin: 0 0 0.9rem; }
.brake-mode-field select { padding: 0.35rem 0.5rem; font-size: 0.9rem; }
.brake-bend-table select.brake-set-pick { width: 3.2rem; margin: 0; padding: 0.25rem 0.3rem; font-weight: 700; }
.brake-set-tag { display: inline-block; min-width: 1.15rem; padding: 0 0.25rem; margin-right: 0.4rem; border: 1px solid var(--color-text, #222); border-radius: 3px; font-size: 0.75rem; font-weight: 700; line-height: 1.25; text-align: center; }
.brake-bend-table th, .brake-bend-table td { padding: 0.3rem 0.35rem; text-align: center; vertical-align: middle; }
.brake-bend-table thead th { font-size: 0.8rem; line-height: 1.15; }
.brake-bend-table .brake-param-name { display: block; font-weight: 400; font-size: 0.68rem; color: var(--color-text-muted); text-transform: none; letter-spacing: 0; }
.brake-bend-table .brake-bend-num { font-weight: 700; width: 2rem; }
.brake-bend-table input.brake-val { width: 5.2rem; min-width: 0; margin: 0; padding: 0.3rem 0.35rem; text-align: center; font-variant-numeric: tabular-nums; }
.brake-bend-table input.brake-where { width: 11rem; min-width: 0; margin: 0; padding: 0.3rem 0.45rem; font-size: 0.88rem; }
.brake-details [data-add-brake-bend] { margin: 0.5rem 0 0.9rem; }
.brake-stamp { font-size: 0.82rem; margin: 0.5rem 0 0.75rem; }
/* The read-only setup on the job page (views/jobDetail.js brakeSetupHtml). */
.brake-setup-line { margin-top: 0.3rem; font-size: 0.9rem; line-height: 1.35; }
.brake-setup-line strong.brake-note { color: var(--color-danger); }
.brake-bend-lines { margin: 0.35rem 0 0; padding: 0 0 0 1.4rem; font-size: 0.86rem; line-height: 1.5; }
.brake-bend-lines li { padding-left: 0.15rem; }
.brake-bend-lines li::marker { font-weight: 700; }
.brake-bend-where { font-weight: 600; margin-right: 0.5rem; }
.brake-bend-where:empty { display: none; }
.brake-bend-val { display: inline-block; margin-right: 0.55rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.brake-bend-key { font-size: 0.72rem; font-weight: 700; color: var(--color-text-muted); }
.traveler-table-floor .brake-bend-lines { font-size: 1rem; }
.traveler-table-floor .brake-bend-key { font-size: 0.8rem; }
.brake-notes { white-space: pre-line; overflow-wrap: anywhere; }

/* Shear metal (New Job form) */
.shear-metal {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  padding: 1rem;
  margin: 0.5rem 0 1.25rem;
}
.shear-metal h3 { margin-top: 0; }
.metal-input-row {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.85rem;
  margin-bottom: 0.85rem;
}

/* Hardware/Metal "pick an existing item, or add a new one" control (see
   views/itemNamePicker.js) - the select and its always-present text box
   sit right on top of each other rather than the usual label-then-field
   gap, since the text box is really a second, alternate field for the
   same one piece of information rather than a field of its own. */
.item-name-picker select { margin-bottom: 0.35rem; }
.item-name-new { font-size: 0.85rem; }
.shipping-details {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  padding: 1rem;
  margin: 0.5rem 0 1.25rem;
}
.shipping-details h3 { margin-top: 0; }

/* Quantity / Due Date rows (New Job / Edit Job) */
.quantity-schedule {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  padding: 1rem;
  margin: 0.5rem 0 1.25rem;
}
.quantity-schedule h3 { margin-top: 0; }
.qty-row {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.85rem;
  margin-bottom: 0.85rem;
}
.qty-row-footer { display: flex; justify-content: flex-end; margin-top: 0.5rem; }
/* The ASAP tick sits under its row's Due Date box - ticking it clears and
   disables that box (see app.js), so the greyed-out date is the visual
   confirmation that this release has no calendar date. */
.qty-asap-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.4rem;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--color-text-muted);
  cursor: pointer;
}
.qty-asap-label input { margin: 0; }
.qty-due-input:disabled { background: var(--color-bg); color: var(--color-text-muted); }
.quantity-total {
  margin-top: 0.75rem;
  font-size: 0.95rem;
}
.quantity-total strong { font-size: 1.1rem; color: var(--color-primary-dark); }

/* ---------- Traveler step details (job detail page) ----------
   Step name, then the things the floor reads off the row - metal to cut,
   hardware to press, finishes going out - at full reading size in dark
   type, with the numbers beside each one in a quieter weight. */
.traveler-table .step-title { font-size: 1rem; font-weight: 700; color: var(--color-text); }
.traveler-table .step-items { list-style: none; margin: 0.4rem 0 0.1rem; padding: 0; display: grid; gap: 0.35rem; }
.traveler-table .step-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 0.6rem;
  font-size: 0.95rem;
  line-height: 1.35;
}
.traveler-table .step-item-name { font-weight: 650; color: var(--color-text); }
.traveler-table .step-item-meta { color: var(--color-text-muted); font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.traveler-table .step-vendor { display: block; }
.traveler-table .step-finishes { list-style: none; margin: 0.15rem 0 0; padding: 0 0 0 0.75rem; border-left: 2px solid var(--color-border); display: grid; gap: 0.2rem; }
.traveler-table .step-finish { font-size: 0.92rem; line-height: 1.35; color: var(--color-text); }
.traveler-table .step-detail-line { margin-top: 0.3rem; font-size: 0.9rem; color: var(--color-text); line-height: 1.35; }
.stock-chip {
  display: inline-block;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
}
.stock-chip-short { background: var(--color-danger-bg); color: var(--color-danger); }
a.stock-chip-short:hover { text-decoration: underline; }
.stock-chip-covered { background: var(--color-warning-bg); color: var(--color-warning-text); }
.stock-chip-bulk { background: #e6ecf3; color: #33475e; }
a.stock-chip-covered:hover { text-decoration: underline; }
.price-chip {
  display: inline-block;
  padding: 0 0.4rem;
  border-radius: 4px;
  background: #eef0f3;
  color: #4b5563;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Assembly hardware breakdown (job detail Traveler) */
.hardware-breakdown { margin-top: 0.3rem; }
.hardware-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  font-size: 0.78rem;
  padding: 0.1rem 0;
}
.hardware-row span:first-child { font-weight: 600; color: var(--color-text); }
.shortfall-note { flex-basis: 100%; font-weight: 600; }

/* ---------- Step count entry (Traveler / floor cards) ---------- */

.step-complete-form, .floor-complete-form {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.step-count-input {
  width: 5.5em;
  padding: 0.32rem 0.5rem;
}
.floor-complete-form { margin-top: 0.6rem; }
.floor-complete-form .btn { flex: 1; }
.step-suboptions, .floor-card-suboptions { font-size: 0.78rem; margin-top: 0.1rem; }

/* Ordering tab: the "Mark Ordered" quantity input sits inline inside a
   table cell, same narrow-input treatment as the step count field above -
   without it, the page-wide input{width:100%} rule would blow the column
   out to the full remaining table width. */
.ordering-mark-form {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.ordering-mark-form input[type="number"] { width: 5.5em; padding: 0.32rem 0.5rem; }

/* Ordering tab: per-category "Export ___ Needs (PDF)" links above the
   Needs Ordering table (see views/ordering.js's exportLinks). */
.ordering-export-links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }

/* ---------- Ordering: selection, vendor and pricing ---------- */

.ordering-actions {
  margin-bottom: 0.9rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
}
.ordering-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.ordering-actions-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-text-muted);
  margin-right: 0.35rem;
  min-width: 9em;
}
.ordering-promise {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--color-text-muted);
}
.ordering-promise input { width: auto; }
.ordering-actions-hint {
  margin: 0.6rem 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
}

.ordering-table .select-cell,
.subcontractor-table .select-cell {
  width: 2.2rem;
  text-align: center;
  vertical-align: middle;
}
.ordering-table .select-cell input[type="checkbox"],
.subcontractor-table .select-cell input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  cursor: pointer;
}
.ordering-vendor-cell { font-size: 0.85rem; }
.ordering-price-cell { font-size: 0.76rem; }

/* This list carries eleven columns. Tighter cell padding, a narrow
   quantity box and buttons that wrap under it keep the whole table on a
   laptop screen instead of scrolling sideways with the Action column off
   the edge. */
.ordering-table th,
.ordering-table td {
  padding-left: 0.45rem;
  padding-right: 0.45rem;
}
.ordering-table .ordering-mark-form {
  flex-wrap: wrap;
  gap: 0.25rem;
  max-width: 8.5rem;
}
.ordering-table .ordering-mark-form input {
  width: 100%;
  min-width: 0;
}
.ordering-table .ordering-mark-form .btn {
  flex: 1 1 auto;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
  white-space: nowrap;
}

/* Metal rows on the Ordering tab (and the Add/Remove and Order More forms
   on Inventory) take a sheet size next to the sheet count: two short
   length x width inputs on one line, so a 48" x 120" sheet can be ordered
   or received without it being read as a stock 36" x 96". */
.metal-size-fields {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  min-width: 0;
}
.metal-size-fields .muted { font-size: 0.8rem; }
.inventory-adjust-form .metal-size-fields input[type="number"],
.ordering-table .ordering-mark-form .metal-size-input,
.metal-size-fields .metal-size-input {
  width: 4.2em;
  min-width: 0;
  flex: 0 1 4.2em;
  padding: 0.32rem 0.35rem;
  font-size: 0.82rem;
}
.ordering-table .ordering-mark-form .metal-size-fields { width: 100%; }
.ordering-size-note { font-size: 0.74rem; margin-top: 0.1rem; }

/* The pricing editor sits in a full-width row under its item, so it can
   be open on several items at once without the table reflowing. */
.ordering-pricing-row > td { padding-top: 0; border-top: 0; }
.pricing-panel > summary {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-primary);
  padding: 0.25rem 0;
}
.pricing-vendor-pill {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 0.72rem;
}
.pricing-panel-body {
  padding: 0.75rem 0 1rem;
  max-width: 60rem;
}
.price-breaks { margin-top: 0.85rem; }
.price-break-heading { margin-bottom: 0.4rem; }
.price-break-labels,
.price-break-row {
  display: grid;
  grid-template-columns: 7rem 7rem minmax(8rem, 14rem) 10rem auto;
  gap: 0.5rem;
  align-items: center;
}
.price-break-labels {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--color-text-muted);
  margin-bottom: 0.2rem;
}
.price-break-row { margin-bottom: 0.4rem; }
.price-break-row input { width: 100%; }

/* Two vendors per item: one block each, the current one outlined so it's
   obvious at a glance which prices a PO would use. */
.vendor-block {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem 1rem;
  margin-bottom: 0.85rem;
  background: var(--color-surface);
}
.vendor-block-current {
  border-color: var(--color-primary);
  box-shadow: inset 3px 0 0 var(--color-primary);
}
.vendor-block-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1rem;
  margin-bottom: 0.5rem;
}
.vendor-current-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0;
  cursor: pointer;
}
.vendor-current-label input { margin: 0; }
.vendor-block-price { font-size: 0.82rem; font-variant-numeric: tabular-nums; margin-left: auto; }
/* The second vendor's name beside the current one in the panel's summary. */
.pricing-vendor-alt {
  display: inline-block;
  margin-left: 0.3rem;
  font-weight: 500;
  font-size: 0.72rem;
  color: var(--color-text-muted);
}
.ordering-price-alt { font-size: 0.78rem; }

.price-break-expired input { border-color: var(--color-warning-text); }
.price-break-expired-pill {
  display: inline-block;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.price-break-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}
.price-break-remove { white-space: nowrap; }

@media (max-width: 860px) {
  .price-break-labels { display: none; }
  .price-break-row {
    grid-template-columns: 1fr 1fr;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed var(--color-border);
  }
}

@media (max-width: 640px) {
  .price-break-labels,
  .price-break-row { grid-template-columns: 1fr 1fr; }
  .ordering-actions-label { min-width: 100%; }
}

/* ---------- Subcontractor / Shipping ---------- */

.final-count-cell { font-weight: 700; }
.inventory-cell { min-width: 12em; }
.inventory-total { font-size: 0.78rem; }
/* Leftover pieces this job will add to stock by itself once its last
   release ships - a heads-up, not an input (see views/shipping.js's
   stockLeftover and models.syncAutoStock). */
.stock-pending { font-size: 0.78rem; font-weight: 600; color: var(--color-success); margin-bottom: 0.15rem; }
.stock-short { font-size: 0.78rem; font-weight: 600; color: var(--color-danger, #b42318); margin-bottom: 0.15rem; }

/* ---------- Inventory page ---------- */

.inventory-qty-cell { font-weight: 700; }
.inventory-shortage { background: var(--color-danger-bg); }
.inventory-shortage .inventory-qty-cell { color: var(--color-danger); }
.inventory-adjust-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.85rem;
}
.inventory-adjust-form input[type="text"] { width: auto; flex: 1 1 220px; }
.inventory-adjust-form input[type="number"] { width: 9em; }
.inventory-adjust-form select { width: auto; }
.inventory-adjust-form .adjust-preview { font-size: 0.875rem; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.inventory-adjust-form .adjust-preview.text-overdue { color: var(--color-danger); font-weight: 600; }
.inventory-adjust-hint { margin-top: 0.5rem; }

/* Parts' "search existing parts, or add a new one" control (see
   views/inventory.js's partAdjustForm) sits inline with the rest of this
   form's fields rather than stacked full-width like the New Job form's
   version of the same control. The search box is a plain text input
   (datalist-backed, not a <select>) so it doesn't need the select-
   specific spacing the Hardware/Metal item-name-picker control does. */
.inventory-adjust-form .part-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  flex: 1 1 320px;
}
.inventory-adjust-form .part-picker .part-search { flex: 1 1 200px; }
/* The Parts form is the one adjust form whose first control is two rows
   tall (the search box, then "or add new:" underneath it). With the
   form's usual align-items:center, the Amount box and Receive/Adjust
   button floated halfway down that block, lining up with neither row;
   top-aligning this one form puts them level with the search box they
   actually go with. Hardware/Metal, being single-row, are unaffected and
   keep the centered alignment above. */
.parts-adjust-form { align-items: flex-start; }
.parts-adjust-form > input[type="number"],
.parts-adjust-form > .btn { margin-top: 0; }
.part-new-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; flex: 1 1 100%; }
.part-new-fields-label { font-size: 0.78rem; white-space: nowrap; }
.part-new-fields input { flex: 1 1 140px; }
.inventory-search-row { margin-bottom: 0.6rem; }
.inventory-search { max-width: 320px; }

/* ---------- Customers + shipping paperwork ---------- */

/* A short note under a field explaining what it feeds - used heavily on
   the Customers form, where "Vendor #" means nothing until you know it's
   the number that barcodes onto their carton labels. Block-level so it
   sits under the input rather than beside it, and dimmer/smaller than the
   label so the form still scans as label/input pairs. */
.field-hint {
  display: block;
  font-size: 0.76rem;
  line-height: 1.35;
  color: var(--color-text-muted);
  margin: 0.2rem 0 0.15rem;
}
.field-hint a { color: var(--color-primary); }

/* The Customer field is a dropdown with a free-text fallback underneath.
   The two are stacked rather than side by side so it reads as "pick one,
   or failing that type one" instead of two equal fields where it isn't
   obvious which wins. */
.customer-select { margin-bottom: 0.15rem; }
.customer-freetext .field-hint { margin-top: 0; }

.customers-table .customer-meta { font-size: 0.8rem; margin-top: 0.15rem; }
.customers-table .customer-missing {
  font-size: 0.78rem;
  margin-top: 0.25rem;
  color: var(--color-warning-text);
  background: var(--color-warning-bg);
  border-radius: var(--radius);
  padding: 0.15rem 0.4rem;
  display: inline-block;
}
.customers-table .customer-address {
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--color-text-muted);
  min-width: 14rem;
}

/* Shipping queue: one collapsed paperwork panel per job, in a full-width
   row directly under that job's own row. Kept out of the row itself
   because the queue already carries eight columns and a six-field form
   crammed into a ninth would push the whole table sideways. */
.ship-panel-row > td {
  padding-top: 0;
  border-top: none;
  /* .data-table td sets white-space: nowrap so short queue cells never
     break mid-value. That's right for a cell holding "PO-15455" and wrong
     for one holding a paragraph: without this, the readiness warnings ran
     off the side of the screen as one long line. The grid and button rows
     wrapped anyway (flex/grid wrapping ignores white-space), which is what
     made this look like it was working. */
  white-space: normal;
}
/* The Shipping queue is eight columns wide and scrolls sideways on a
   phone (.table-wrap). Without this the paperwork panel, living in a
   full-width cell of that table, would lay its six fields out across the
   table's full scroll width - so on a phone you'd be dragging the table
   left and right to reach the Tracking # box. Pinning the panel to the
   left edge of the scroll area and capping it at the viewport makes its
   fields wrap to what's actually on screen, while the row above it still
   scrolls normally. On a desktop the cap is wider than the table, so this
   changes nothing there. */
.ship-panel {
  position: sticky;
  left: 0;
  max-width: calc(100vw - 2.5rem);
}
.ship-panel summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-primary);
  padding: 0.25rem 0;
  list-style-position: inside;
}
.ship-panel summary:hover { text-decoration: underline; }
/* Count of things that will print blank on this job's documents. Sits in
   the summary so it's visible without opening the panel - the point being
   that you find out before the paper is in your hand, not after. */
.ship-warn-dot {
  display: inline-block;
  min-width: 1.1rem;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.05rem 0.35rem;
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
}
.ship-panel-body {
  padding: 0.6rem 0 0.9rem;
  border-top: 1px dashed var(--color-border);
  margin-top: 0.25rem;
}
.ship-problems {
  margin: 0 0 0.75rem;
  padding-left: 1.1rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--color-warning-text);
}
.ship-problems a { color: var(--color-primary); }
/* The invoice crib line: quantity x unit price = total, plus the part it's
   for. Set apart from the warnings above it and the buttons below with a
   tinted strip, because it's the one thing on this panel somebody reads
   and retypes somewhere else. */
.ship-invoice-line {
  margin: 0 0 0.85rem;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  font-size: 0.9rem;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.ship-invoice-label {
  font-weight: 600;
  margin-right: 0.2rem;
}
.ship-invoice-unpriced {
  font-size: 0.82rem;
  color: var(--color-text-muted);
}
.ship-invoice-unpriced a { color: var(--color-primary); }

.ship-docs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}
.ship-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.15rem 1rem;
}
.ship-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  margin: 0 0 0.2rem;
}
.ship-field input { margin-bottom: 0.1rem; }

/* Box size: three narrow boxes on one line, L × W × H. Shared by the
   Shipping page's release form and the row under the traveler's Shipping
   step. */
.pack-box {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: nowrap;
}
/* input.pack-dim, not .pack-dim: the global input[type="text"] rule sets
   width: 100% and would otherwise win on specificity. */
.pack-box input.pack-dim,
input.pack-dim {
  width: 4.2rem;
  min-width: 0;
  margin-bottom: 0.1rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.pack-x { color: var(--color-text-muted); font-size: 0.85rem; }
.traveler-table tr.pack-row > td,
.pack-row > td {
  background: var(--color-bg);
  padding: 0.6rem 0.85rem 0.75rem;
}
.pack-releases {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.pack-release { margin: 0; }
.pack-heading {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-bottom: 0.3rem;
}
.pack-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
}
.pack-weight { display: flex; align-items: center; gap: 0.4rem; }
.pack-label { font-size: 0.8rem; font-weight: 600; margin: 0 0.25rem 0 0; }
.pack-weight .pack-label { margin: 0; }
input.pack-dim.pack-dim-weight { width: 5.5rem; }
.pack-readout { display: flex; flex-wrap: wrap; gap: 0.35rem 1.5rem; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
/* Reship: new tracking # on a shipped release (Admin/Creator). */
.pack-tracking { margin-top: 0.45rem; }
.pack-tracking-current { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.8rem; font-size: 0.9rem; }
.pack-tracking-number { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.pack-tracking-change { margin-top: 0.3rem; }
.pack-tracking-change > summary { cursor: pointer; font-size: 0.8rem; color: var(--color-text-muted); width: fit-content; }
.pack-tracking-change[open] > summary { color: var(--color-text); }
.pack-tracking-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; margin-top: 0.45rem; }
.pack-tracking-input { width: 16ch; max-width: 100%; font-variant-numeric: tabular-nums; }
.pack-release .btn { margin: 0; }
.pack-note { font-size: 0.8rem; margin-top: 0.25rem; }
.pack-note a { color: var(--color-primary); }
#shipping-packaging { scroll-margin-top: 1.25rem; }
/* Packout labels (Nov 18 2026): one small GET form per open line. */
#packout-labels { scroll-margin-top: 1.25rem; }
.packout-form select { width: auto; margin: 0; padding: 0.3rem 0.5rem; }
/* One row per line (Nov 23 2026): pieces, per box, the boxes, Print. */
.packout-form { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.9rem; }
.packout-form > .pack-heading { margin: 0; min-width: 9.5rem; }
.packout-fill { display: flex; align-items: center; gap: 0.35rem; }
.packout-fill[hidden] { display: none; }
.packout-fill .pack-label { margin: 0 0 0 0.3rem; }
.packout-fill .pack-label:first-child { margin-left: 0; }
.packout-boxes { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.8rem; padding-left: 0.9rem; border-left: 1px solid var(--color-border); }
.packout-box { display: flex; align-items: center; gap: 0.3rem; }
.packout-box .pack-label { margin: 0; }
.packout-add { padding: 0.15rem 0.5rem; }
.packout-print { display: inline-flex; align-items: center; gap: 0.4rem; margin-left: auto; }
.packout-summary[hidden], .packout-remove[hidden], .packout-add[hidden] { display: none; }
.packout-remove { padding: 0.1rem 0.45rem; line-height: 1; }
.packout-summary { font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.packout-summary-off { color: var(--color-warning-text); font-weight: 600; }
/* Pack Out (Dec 2 2026): a line is a heading row - the line, a status
   pill, Save / Print on the right - over a small table of its boxes (one
   row a box, column heads once), then "+ box" and the fill. */
.packout-form.packout-form-sized { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 0.4rem; }
.pack-releases > .packout-form-sized + .packout-form-sized,
.packout-job-boxes > .packout-form-sized + .packout-form-sized { border-top: 1px dashed var(--color-border); padding-top: 0.65rem; margin-top: 0.6rem; }
.pack-releases > .packout-form-sized + .packout-form-sized { margin-top: 0; }
.packout-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.7rem; }
.packout-head > .pack-heading { margin: 0; }
.packout-status { display: inline-block; font-size: 0.78rem; font-weight: 600; line-height: 1.5; padding: 0 0.55rem; border-radius: 999px; font-variant-numeric: tabular-nums; }
.packout-status-none, .packout-status-changed, .packout-status-partial { background: var(--color-warning-bg); color: var(--color-warning-text); }
.packout-status-saved { background: var(--color-success-bg); color: var(--color-success); }
.packout-status-error { background: var(--color-danger-bg); color: var(--color-danger); border-radius: 0.6rem; }
.packout-table { display: inline-flex; flex-direction: column; gap: 0.25rem; align-self: flex-start; max-width: 100%; overflow-x: auto; }
.packout-cols, .packout-box-sized { display: grid; grid-template-columns: 3.4rem 3.6rem 10.6rem 3.6rem 1.9rem; align-items: center; column-gap: 0.5rem; }
.packout-cols { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-text-muted); }
.packout-form-sized .packout-boxes { display: flex; flex-direction: column; align-items: stretch; gap: 0.25rem; padding-left: 0; border-left: 0; }
.packout-box-sized input.pack-dim { width: 100%; margin: 0; padding: 0.25rem 0.3rem; }
.packout-box-sized .packout-box-size input.pack-dim { width: 3.1rem; }
.packout-box-size { display: inline-flex; align-items: center; gap: 0.2rem; flex-wrap: nowrap; }
.packout-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.9rem; font-size: 0.85rem; }
.packout-tools input.pack-dim { width: 3.6rem; margin: 0; padding: 0.2rem 0.3rem; }
.packout-tools .packout-fill .pack-label { font-weight: 500; color: var(--color-text-muted); }
/* Ship part of a line (Dec 2 2026): under the Shipping step on the job page. */
#ship-lines { scroll-margin-top: 1.25rem; }
.split-lines { display: flex; flex-direction: column; gap: 0.35rem; }
.split-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.8rem; font-size: 0.9rem; }
.split-line-name { min-width: 14rem; font-variant-numeric: tabular-nums; }
.split-line .inline-form { margin: 0; }
.split-line-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.5rem; margin: 0; }
.split-line-form label { margin: 0; font-weight: 600; font-size: 0.85rem; }
.split-line-form input[type="number"] { width: 5rem; min-width: 0; margin: 0; padding: 0.25rem 0.4rem; }
.split-lines-hint { margin-top: 0.45rem; }
.pack-unit { color: var(--color-text-muted); font-size: 0.8rem; margin-right: 0.3rem; }
.packout-saved { flex-basis: 100%; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.ship-cartons { margin: 0.4rem 0 0.6rem; font-size: 0.88rem; }
.ship-cartons-head { font-weight: 600; font-size: 0.8rem; }
.ship-cartons-change { font-weight: 400; margin-left: 0.5rem; color: var(--color-primary); }
.ship-cartons-list { margin: 0.25rem 0 0; padding-left: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 0.2rem 1.2rem; font-variant-numeric: tabular-nums; }
.ship-carton-n { color: var(--color-text-muted); margin-right: 0.25rem; }
/* Book with FedEx (Dec 2026), under a Shipping line. */
.ship-book { margin: 0.6rem 0; border: 1px solid var(--color-border); border-radius: 6px; padding: 0.4rem 0.7rem; }
.ship-book > summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; }
.ship-book-body { margin-top: 0.5rem; }
.ship-book-test { font-size: 0.85rem; color: var(--color-warning-text); margin: 0 0 0.5rem; }
.ship-test-badge { background: var(--color-warning-bg, #fff3cd); color: var(--color-warning-text); border: 1px solid currentColor; }
.ship-bookings { list-style: none; padding: 0; margin: 0 0 0.6rem; display: grid; gap: 0.35rem; }
.ship-booking { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.8rem; font-size: 0.9rem; }
.ship-booking .inline-form { margin: 0; }
.ship-booking-void { opacity: 0.6; text-decoration: line-through; }
.ship-booking-new { background: var(--color-success-bg, #e8f5e9); padding: 0.2rem 0.4rem; border-radius: 4px; }
.ship-booking-track { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.ship-book-head { font-weight: 600; font-size: 0.8rem; margin-bottom: 0.3rem; }
.ship-book-check { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; margin: 0.2rem 0 0.5rem; }
.ship-book-label { display: block; font-size: 0.78rem; font-weight: 600; margin-bottom: 0.2rem; }
.ship-book-boxes { font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.ship-book-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.4rem; }
input.ship-book-state { max-width: 5rem; text-transform: uppercase; }
.ship-book-cancelled { margin: 0 0 0.5rem; font-size: 0.85rem; }
.ship-book-cancelled > summary { cursor: pointer; }
.ship-book-to { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.8rem; font-size: 0.9rem; }
.ship-book-to .ship-book-label { margin: 0; }
.ship-book-oneline { overflow-wrap: anywhere; }
.ship-book-edit { margin: 0.3rem 0 0.4rem; font-size: 0.85rem; }
.ship-book-edit > summary { cursor: pointer; color: var(--color-primary); width: fit-content; }
.ship-book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 0.4rem 0.7rem; margin-top: 0.4rem; }
.ship-book-grid .ship-book-wide { grid-column: span 2; }
.ship-book-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem 1rem; margin-top: 0.4rem; }
.ship-book-row .ship-field { min-width: 11rem; }
.ship-book-row .ship-book-actions { margin: 0 0 0.15rem; }
.ship-line { display: grid; grid-template-columns: max-content 1fr; gap: 0.2rem 0.8rem; margin: 0.4rem 0 0.5rem; font-size: 0.9rem; }
.ship-line dt { font-weight: 600; color: var(--color-text-muted); font-size: 0.8rem; align-self: baseline; }
.ship-line dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ship-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0.6rem 0 0.4rem; }
.ship-actions .ship-send-form { margin: 0 0 0 auto; }
.ship-no-labels { font-size: 0.85rem; }
.ship-edit { margin-top: 0.5rem; font-size: 0.9rem; }
.ship-edit > summary { cursor: pointer; color: var(--color-primary); width: fit-content; }
.ship-edit > summary .muted { font-size: 0.8rem; }
.ship-edit .ship-form { margin-top: 0.5rem; }
@media (max-width: 640px) { .ship-book-grid .ship-book-wide { grid-column: span 1; } }
@media (max-width: 640px) {
  .packout-box { flex-wrap: wrap; }
  .packout-print { margin-left: 0; }
  .packout-cols, .packout-box-sized { grid-template-columns: 2.7rem 3rem 8.7rem 3rem 1.6rem; column-gap: 0.35rem; }
  .packout-box-sized .packout-box-size input.pack-dim { width: 2.55rem; }
}
.ship-form > label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  margin: 0.6rem 0 0.2rem;
}
.ship-form textarea {
  display: block;
  width: 100%;
  margin-bottom: 0.6rem;
}

/* Read-only customer details, for the Shipping & Receiving role - a
   definition list rather than a form, so nobody types into something they
   can't save. */
.customer-readonly {
  display: grid;
  grid-template-columns: minmax(10rem, 16rem) 1fr;
  gap: 0.45rem 1.25rem;
  margin: 0 0 0.9rem;
}
.customer-readonly dt { font-size: 0.82rem; font-weight: 600; }
.customer-readonly dd { margin: 0; font-size: 0.88rem; line-height: 1.4; }
@media (max-width: 560px) {
  .customer-readonly { grid-template-columns: 1fr; gap: 0.1rem 0; }
  .customer-readonly dd { margin-bottom: 0.6rem; }
}

/* ---------- Anchored return after a step action ---------- */
/* server.js sends the browser back to #job-<id> / #step-<id> after Start
   or Complete so the page doesn't jump to the top (see
   redirectAfterStepAction). Without a scroll margin the browser would put
   the target flush against the very top edge of the viewport, which reads
   as though the content above it is missing; a little room makes it look
   like the page simply stayed put. */
.floor-card[id],
.traveler-table tr[id] {
  scroll-margin-top: 1.25rem;
}

/* Releases: one paperwork panel per quantity line on the PO. */
.ship-release-summary {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
.ship-release-summary strong { color: var(--color-text); }
.ship-panel + .ship-panel { border-top: 1px dashed var(--color-border); }
/* Two or more shipped lines fold into one group (Nov 2026). */
.ship-shipped-group > summary { cursor: pointer; color: var(--color-success); font-weight: 600; padding: 0.35rem 0; }
.ship-shipped-group-body { padding-left: 0.75rem; border-left: 2px solid var(--color-border); margin-bottom: 0.35rem; }
.ship-shipped-group + .ship-panel { border-top: 1px dashed var(--color-border); }
/* A shipped release is a record rather than a form - dimmer summary, and a
   date pill so the queue reads at a glance as "this one's gone". */
.ship-panel-shipped summary { color: var(--color-success); }
.ship-shipped-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  background: var(--color-success-bg);
  color: var(--color-success);
}
.ship-record {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.2rem 0.9rem;
  margin: 0 0 0.85rem;
  font-size: 0.85rem;
}
.ship-record dt { font-weight: 600; }
.ship-record dd { margin: 0; font-variant-numeric: tabular-nums; }
.ship-send-form { margin-top: 0.6rem; }

/* Splitting a release into boxes: the offer on an unsplit release, then
   the per-box table on a split one. */
.ship-split-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.6rem; margin-top: 0.6rem; }
.ship-split-form .field-hint { margin: 0; }
.ship-boxes-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  background: #e0ecff;
  color: var(--color-primary);
}
.ship-invoice-box { display: inline-block; margin-right: 0.9rem; white-space: nowrap; }
.ship-grid-shared { max-width: 28rem; margin-bottom: 0.4rem; }
.box-table-wrap { margin: 0.2rem 0 0.6rem; }
.box-table { font-size: 0.88rem; }
.box-table th, .box-table td { padding: 0.4rem 0.5rem; vertical-align: middle; }
.box-table tbody th, .box-table tfoot th { text-align: left; white-space: nowrap; font-weight: 700; }
.box-table tfoot td, .box-table tfoot th { background: var(--color-bg); font-variant-numeric: tabular-nums; }
.box-table input.box-input { margin: 0; font-variant-numeric: tabular-nums; }
.box-table input.box-input-qty { width: 4.6rem; text-align: right; }
.box-table input.box-input-weight { width: 4.6rem; text-align: right; }
.box-table input.box-input-tracking { width: 11rem; }
.box-table input.box-input-invoice { width: 9rem; }
.box-table .pack-box input.pack-dim { margin: 0; width: 3.6rem; }
.box-invoice { display: flex; align-items: center; gap: 0.35rem; }
.box-invoice .btn { margin: 0; }
.box-invoice-assigned { font-weight: 700; font-variant-numeric: tabular-nums; }
.box-docs { white-space: nowrap; }
.box-docs .btn { margin: 0 0.2rem 0 0; }
.box-remove { padding: 0.15rem 0.5rem; font-size: 1rem; line-height: 1; }
.box-add { margin: 0 0 0.2rem; }
.box-total-off {
  margin-left: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
}
.ship-panel[id] { scroll-margin-top: 1.25rem; }

/* New Job: the part-number autofill offer lives in this hint, which swaps
   between a standing invitation and a live "Job X used this part" link. */
.part-autofill-hint a {
  color: var(--color-primary);
  font-weight: 600;
}
.template-clear {
  margin-left: 0.5rem;
  font-weight: 600;
  white-space: nowrap;
}
/* New Job filled from a job-card framework: what to double-check. */
.framework-notes {
  margin: 0.4rem 0 0.3rem 1.1rem;
  padding: 0;
}
.framework-notes li {
  margin: 0.15rem 0;
}

/* Ordering: the three-stage line under the page header. */
.ordering-stages {
  margin: 0 0 1rem;
  font-size: 0.88rem;
}
.ordering-stages strong { color: var(--color-text); }

/* New Job: finished stock for the part being entered, and the option to
   pack the order out of it instead of making anything. */
.stock-panel { border-left: 3px solid var(--color-primary); }
.stock-figure-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 2rem;
  margin-bottom: 0.6rem;
}
.stock-figure { display: flex; flex-direction: column; }
.stock-figure-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.stock-figure-value {
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.stock-verdict { margin: 0 0 0.5rem; font-size: 0.88rem; }
.stock-verdict-ok { color: var(--color-success); font-weight: 600; }
.stock-packout-label { margin-bottom: 0.3rem !important; }
.stock-packout-note { margin: 0; font-size: 0.83rem; }
.stock-partial { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.75rem; margin-top: 0.5rem; }
.stock-partial label { margin: 0; font-weight: 600; }
.stock-partial input { width: 6rem; }
.stock-partial .field-hint { flex-basis: 100%; }
.stock-pieces-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.4rem; margin-top: 0.35rem; font-size: 0.85rem; }
.stock-pieces-form label, .stock-pieces-form .btn { white-space: nowrap; }
.stock-pieces-form label { margin: 0; font-weight: normal; color: var(--color-text-muted); }
.stock-pieces-form input { width: 4.5rem; }
.stock-pieces-note { font-size: 0.85rem; }
.make-qty-value { font-weight: 700; }

/* A job packed out of stock rather than made - flagged wherever somebody
   would otherwise wonder why it has no production steps. */
.from-stock-value { color: var(--color-primary); font-weight: 600; }
.from-stock-tag,
.job-tag {
  display: inline-block;
  margin-top: 0.2rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
}

/* RMA returns - reworked parts going back to the customer, never counted
   against the PO they name. Tagged wherever they turn up, and the RMA form
   groups its QN #, RMA # and bill / no-charge choice in one fieldset. */
.job-tag-rma {
  background: var(--color-warning-bg);
  border-color: #f2c97a;
  color: var(--color-warning-text);
}
.rma-refs { font-size: 0.78rem; margin-top: 0.15rem; }
.rma-fieldset {
  border: 1px solid #f2c97a;
  background: #fffbeb;
  border-radius: var(--radius);
  padding: 0.75rem 1rem 1rem;
  margin: 0 0 1rem;
}
.rma-fieldset legend { font-weight: 700; padding: 0 0.35rem; color: var(--color-warning-text); }
.rma-billing { display: grid; gap: 0.4rem; margin-top: 0.75rem; }
.rma-billing-label { font-weight: 600; }
.rma-choice { display: flex; gap: 0.5rem; align-items: flex-start; font-weight: 400; }
.rma-choice input { margin-top: 0.25rem; }
.rma-card { border-left: 4px solid #f2c97a; }
.rma-card form { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }
.rma-card label { display: block; font-size: 0.8rem; font-weight: 600; }

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  .topnav { flex-direction: column; align-items: flex-start; }
  .topnav-user { margin-left: 0; }
  .data-table th, .data-table td { padding: 0.5rem; }
  .container { padding: 1rem 0.75rem 3rem; }
}

/* Print and Delete side by side on an issued PO's row. */
.po-row-actions {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  white-space: nowrap;
}

/* Final Count on a legacy subcontract job's page - one field and a save
   button on a line, the hint underneath. */
.legacy-count-card { padding: 1rem 1.25rem; }
.legacy-count-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.75rem;
}
.legacy-count-form label { display: block; font-size: 0.85rem; font-weight: 600; margin: 0 0 0.3rem; }
.legacy-count-form input { width: 12rem; }
.legacy-count-form .btn { margin-bottom: 0.1rem; }
.legacy-count-form .field-hint { flex-basis: 100%; margin: 0.2rem 0 0; }

/* Packing Notes under the Shipping step on the job page - regular text
   colour (it's an instruction to follow, not metadata), small label. */
.packing-notes { margin-top: 0.25rem; white-space: pre-line; }
.packing-notes-label { font-weight: 600; color: var(--color-text-muted); font-size: 0.85em; }

/* ---------- Job History: shipping detail ---------- */
/* Each job's releases fold under its row, so the table stays a list of
   jobs while the numbers somebody chases a delivery with are one click
   away. */
.history-shipped-cell { white-space: nowrap; }
.history-ship-main { font-variant-numeric: tabular-nums; }
.history-ship-releases { font-size: 0.8rem; }
/* Nov 2026: the Shipped cell is the expander - the summary line reads as
   a link, and the detail row under the job shows only while it is open. */
.history-ship-panel > summary {
  cursor: pointer;
  list-style: none;
  color: var(--color-primary);
}
.history-ship-panel > summary::-webkit-details-marker { display: none; }
.history-ship-panel > summary .history-ship-main { text-decoration: underline dotted; text-underline-offset: 0.15em; }
.history-ship-row > td { padding-top: 0; border-top: 0; background: var(--color-bg); }
@supports selector(tr:has(details)) {
  .history-ship-row { display: none; }
  tr:has(> td > .history-ship-panel[open]) + .history-ship-row { display: table-row; }
}
.history-ship-table { margin: 0.25rem 0 0.5rem; max-width: 60rem; }
.history-ship-table table { font-size: 0.85rem; }
.history-ship-table td { font-variant-numeric: tabular-nums; }

/* ---------- Customer POs ---------- */

.num-cell { text-align: right; font-variant-numeric: tabular-nums; }
.badge-status-inbox { background: #eef0f3; color: #374151; }
.po-stage-detail { font-size: 0.78rem; margin-top: 0.15rem; }
.po-doc-flag { font-size: 0.85rem; font-weight: 600; color: var(--color-primary-dark); }
.po-eyebrow { font-size: 0.8rem; margin-bottom: 0.15rem; }
.po-eyebrow a { color: var(--color-text-muted); text-decoration: none; }
.po-eyebrow a:hover { text-decoration: underline; }
.po-desc-cell { max-width: 22rem; white-space: normal; }
.po-job-complete td, .po-job-cancelled td { color: var(--color-text-muted); }
.po-job-cancelled .job-link { text-decoration: line-through; }

.po-document-card { margin-top: 1.5rem; }
.po-document-card h2 { margin-top: 0; }
.po-doc-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
}
.po-doc-head .muted { margin-left: 0.5rem; font-size: 0.85rem; }
.po-doc-actions { display: flex; gap: 0.4rem; align-items: center; }
.po-doc-list { list-style: none; margin: 0 0 0.75rem; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.9rem; }
.po-doc-list li { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.po-doc-list li.is-selected a { font-weight: 700; }
/* The browser's own PDF viewer, sized to read a PO page without leaving
   the tab. */
.po-viewer {
  display: block;
  width: 100%;
  height: min(85vh, 1100px);
  min-height: 520px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #f3f4f6;
  margin-bottom: 0.9rem;
}
.po-no-doc { padding: 1.25rem 0; }
.po-upload-new { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem; }
.po-upload-field { display: flex; flex-direction: column; gap: 0.25rem; min-width: 14rem; }
.po-upload-field label { font-weight: 600; font-size: 0.85rem; }
.po-file-card { margin-top: 1.5rem; }
.po-file-card h2 { margin-top: 0; }
/* Under the Start button on an Inbox card whose first step is a
   Subcontractor step - says where Start sends it. */
/* "Hardware released" checkbox on a job card with Assembly hardware -
   ticked once the job's hardware is pulled and packed in its container. */

/* ---------- Customer ship-to addresses ---------- */

.address-editor { margin: 1.25rem 0; }
.address-editor h3, .qb-customer-fields h3 { margin-bottom: 0.25rem; }
.address-row {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem 0.9rem;
  margin: 0 0 0.75rem;
  background: var(--color-surface);
}
.address-row legend { font-weight: 600; font-size: 0.85rem; padding: 0 0.35rem; }
.address-row-new { border-style: dashed; }
.address-row-options { display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; margin-top: 0.5rem; }
.qb-customer-fields { margin: 1.25rem 0; }
.ship-address-field { margin-bottom: 0.75rem; max-width: 32rem; }

/* ---------- QuickBooks invoices ---------- */

.invoice-setup h2, .invoice-help h2 { margin-top: 0; }
.invoice-steps { margin: 0.5rem 0 1rem 1.25rem; display: flex; flex-direction: column; gap: 0.35rem; max-width: 72ch; }
.invoice-numbering-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem; margin-bottom: 0.5rem; }
.invoice-numbering-form > div { display: flex; flex-direction: column; gap: 0.25rem; }
.invoice-numbering-form input { width: 10rem; }
.invoice-section { margin: 1.75rem 0; }
.invoice-table tfoot td { border-top: 2px solid var(--color-border); font-weight: 600; }
.invoice-export-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-top: 0.75rem; }
.invoice-problems { margin: 0; padding-left: 1rem; font-size: 0.85rem; color: var(--color-warning-text); }
.invoice-attention-actions { display: flex; flex-direction: column; gap: 0.3rem; align-items: flex-start; }
.invoice-file-void td { color: var(--color-text-muted); }
.invoice-void { margin-top: 1.25rem; }
.invoice-void summary { cursor: pointer; font-weight: 600; }
.ship-invoice-assigned { font-weight: 700; font-size: 1.05rem; padding: 0.35rem 0; font-variant-numeric: tabular-nums; }
.ship-field-label { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 0.25rem; }
/* "Assign" sets a flag on the form; the number is handed out on save. */
.ship-field .assign-invoice-btn { margin-top: 0.35rem; }
.assign-pending { font-size: 0.85rem; font-weight: 600; color: var(--color-primary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ship-field .assign-pending { margin-left: 0.5rem; }
.queue-count-pill { display: inline-block; margin-left: 0.35rem; padding: 0 0.45rem; border-radius: 999px; background: var(--color-primary); color: #fff; font-size: 0.75rem; }

/* ---------- Customer status update / anticipated ship dates ---------- */
.update-filters { align-items: flex-end; margin-bottom: 1rem; }
.update-filters > div { display: flex; flex-direction: column; gap: 0.2rem; }
.update-filters label { font-size: 0.78rem; font-weight: 600; color: var(--color-text-muted); }
.update-table input[type="date"] { width: auto; }
.update-table .due-cell { text-align: center; }
.update-actions { display: flex; gap: 0.75rem; align-items: center; margin: 0.75rem 0 1rem; }
.customer-actions { white-space: nowrap; }
.forecast-card h2 { margin-top: 0; }
.forecast-rows { display: grid; gap: 0.5rem; margin: 0.5rem 0 0.75rem; }
.forecast-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; justify-content: space-between; max-width: 32rem; }
.forecast-row input[type="date"] { width: auto; }

/* ---------- Inventory: Assembly hardware never taken out of stock ---------- */
.inventory-undeducted { border-color: #f59e0b; background: var(--color-warning-bg); }
.inventory-undeducted .data-table { background: var(--color-surface); }

/* ---------- Users: what each role can do ---------- */
.role-summary { margin: 0.75rem 0 1rem; padding-left: 1.1rem; font-size: 0.85rem; }
.role-summary li { margin: 0.15rem 0; }

/* The role badge next to the user's name is the first thing to go when the
   nav gets tight, so the links stay on one row on a 1280-wide laptop. */
@media (max-width: 1340px) {
  .topnav-user .role-badge { display: none; }
}

/* ---------- Customer POs: grouped by customer ---------- */
.po-customers { display: grid; gap: 0.6rem; margin-bottom: 1.5rem; }
.po-customer { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow); }
.po-customer > summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem;
  padding: 0.75rem 1rem; cursor: pointer; list-style: none;
}
.po-customer > summary::-webkit-details-marker { display: none; }
.po-customer > summary::before { content: '▸'; color: var(--color-text-muted); width: 0.8rem; }
.po-customer[open] > summary::before { content: '▾'; }
.po-customer[open] > summary { border-bottom: 1px solid var(--color-border); }
.po-customer-name { font-weight: 700; font-size: 1.02rem; }
.po-customer-meta { font-size: 0.88rem; }
.po-customer-next { font-size: 0.88rem; font-weight: 600; }
.po-customer-update { margin-left: auto; }
.po-customer .table-wrap { border: 0; border-radius: 0 0 var(--radius) var(--radius); box-shadow: none; margin: 0; }
.po-customer-quiet .po-customer-name { color: var(--color-text-muted); }
.po-row-closed td { color: var(--color-text-muted); }

/* ---------- Quoting ---------- */

/* Section tabs under the page heading: Quotes / Vendors / Price Library /
   Settings. Plain links, so the section reads as one place. */
.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  border-bottom: 1px solid var(--color-border);
  margin: -0.25rem 0 1.25rem;
}
.subnav-link {
  padding: 0.5rem 0.85rem;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}
.subnav-link:hover { color: var(--color-text); text-decoration: none; }
.subnav-link.active { color: var(--color-primary-dark); border-bottom-color: var(--color-primary); }
/* Quoting: the Pricing Source Data link is an outside document, pushed
   to the far end of the subnav so it reads as reference next to the
   section's own pages rather than one of them. */
.subnav-link-external { margin-left: auto; }

/* Quote page: the Similar parts panel folds away under the finish lines
   (views/quoteDetail.js similarPartsPanel) - reference, not fields. */
.quote-similar { margin: -0.5rem 0 1.25rem; }
.quote-similar > summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; color: var(--color-text-muted); }
.quote-similar > summary .muted { font-weight: 400; }
.quote-similar[open] > summary { color: var(--color-text); margin-bottom: 0.5rem; }
.quote-similar-body { font-size: 0.875rem; }
.quote-similar-target { margin: 0 0 0.5rem; font-size: 0.8rem; }
.quote-similar-table { font-size: 0.84rem; }
.quote-similar-table th, .quote-similar-table td { white-space: normal; vertical-align: top; }
.quote-similar-table th, .quote-similar-table td.num { white-space: nowrap; }
.quote-similar-why { color: var(--color-primary-dark); font-size: 0.78rem; }
.quote-similar-estimate { margin: 0.6rem 0 0; }

.badge-quote-draft { background: #eef0f3; color: #4b5563; }
.badge-quote-sent { background: #e0ecff; color: #1d4ed8; }
.badge-quote-won { background: var(--color-success-bg); color: var(--color-success); }
.badge-quote-lost { background: var(--color-danger-bg); color: var(--color-danger); }
.badge-quote-expired { background: var(--color-warning-bg); color: var(--color-warning-text); }
.badge-doc-rfq { background: #e0ecff; color: #1d4ed8; }
.badge-doc-print { background: #f3e8ff; color: #7e22ce; }
.badge-doc-other { background: #eef0f3; color: #4b5563; }

.filter-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.filter-chip {
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}
.filter-chip:hover { text-decoration: none; background: var(--color-bg); }
.filter-chip.active { background: #e9edfc; border-color: #c7d2fe; color: var(--color-primary-dark); }
.sub-vendor-chips { margin: -0.25rem 0 0.75rem; }
.library-tabs { margin-bottom: 1rem; }
.library-intro { max-width: 80ch; margin-top: 0; }

.quote-filter-bar { align-items: center; }
.quote-search-form { display: block; flex: 1 1 260px; }
.quote-search-form .queue-search { margin: 0; width: 100%; }
.quotes-table .num, .library-table .num, .data-table th.num, .data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.quote-row-desc { font-size: 0.82rem; white-space: normal; max-width: 28ch; }
.quote-new-card .form-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.form-actions { margin-top: 1rem; }
.row-archived td { color: var(--color-text-muted); }
.row-expired td:first-child { box-shadow: inset 3px 0 0 #f59e0b; }
.vendor-usage { white-space: normal; }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.vendor-housekeeping { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.5rem; margin-top: 0.9rem; }
.vendor-merge-form { display: inline-flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.vendor-merge-form select { width: auto; max-width: 16rem; padding: 0.3rem 0.5rem; font-size: 0.85rem; }
.stacked-form .vendor-merge-form label { display: inline; margin: 0; font-weight: 500; font-size: 0.85rem; }

.row-actions { white-space: nowrap; }
/* The editor sits in a full-width row under its item (the same pattern
   Ordering uses), so it can hold a whole form without the table having to
   scroll sideways. */
.library-editor-row > td { white-space: normal; }
.library-editor-row .pricing-panel-body { max-width: none; }
/* Hardware <-> Machined Parts (Nov 30 2026): a quiet button under the
   pricing form, apart from Save Pricing. */
/* A run's step details (Dec 2026): where another PO's own details differ
   from the lead's, on the run card and under the step. */
.run-differences { margin-top: 0.75rem; padding: 0.6rem 0.75rem; border-radius: 6px; background: var(--color-warning-bg); color: var(--color-warning-text); font-size: 0.85rem; }
.run-differences ul { margin: 0.3rem 0 0.5rem; padding-left: 1.2rem; }
.run-differences .muted { color: inherit; opacity: 0.85; }
.run-detail-differs { margin-top: 0.25rem; font-size: 0.78rem; color: var(--color-warning-text); }
.library-move-form { margin-top: 0.75rem; padding-top: 0.6rem; border-top: 1px dashed var(--color-border); }
/* Rename / Remove on a Price Library entry, and where its name is used (Dec 2026). */
.library-name-forms { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 0.5rem 1rem; margin-top: 0.75rem; padding-top: 0.6rem; border-top: 1px dashed var(--color-border); }
.library-rename-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.5rem; flex: 1 1 26rem; min-width: 0; }
.library-rename-form input[type="text"] { flex: 1 1 14rem; min-width: 0; max-width: 22rem; }
.library-rename-form .field-hint { flex-basis: 100%; }
.btn-danger-text { color: var(--color-danger); }
.btn-danger-text:hover { background: var(--color-danger-bg); }
.library-usage { font-size: 0.8rem; }
.library-unused { font-size: 0.8rem; line-height: 1.35; margin-top: 0.15rem; color: var(--color-warning-text); max-width: 22rem; }
.metal-spec-fields { margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px dashed var(--color-border); }
.metal-spec-fields > strong { display: block; margin-bottom: 0.15rem; }

/* Price breaks with a document column (Quoting's editor). */
.price-break-labels-docs,
.price-break-row-docs { grid-template-columns: 6rem 6.5rem minmax(7rem, 10rem) 9rem minmax(9rem, 1fr) auto; }
.price-break-row-docs select { width: 100%; }
@media (max-width: 860px) {
  .price-break-row-docs { grid-template-columns: 1fr 1fr; }
}

.input-suffix { display: flex; align-items: center; gap: 0.4rem; }
.input-suffix input { width: 7rem; }

/* ---------- The quote page ---------- */

.quote-header { align-items: flex-start; }
.quote-header > div:first-child { flex: 1 1 32rem; }
.quote-header h1 { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.quote-status-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: -0.5rem 0 1rem;
  font-size: 0.9rem;
}
.quote-status-bar form { display: inline-flex; align-items: center; gap: 0.35rem; }
.quote-status-bar .status-po { width: 9rem; padding: 0.3rem 0.5rem; font-size: 0.85rem; }
.quote-delete { margin-left: auto; }

.quote-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 23rem;
  gap: 1.25rem;
  align-items: start;
}
.quote-main, .quote-aside { min-width: 0; }
.quote-aside { position: sticky; top: 0.75rem; }
.quote-summary-card { padding: 1rem; }
.quote-summary-card h2 { margin: 0; }
.quote-card-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.quote-card-head h2 { margin-top: 0; }
.quote-card-total { font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.quote-unsaved { font-size: 0.8rem; font-weight: 600; color: var(--color-warning-text); margin: 0.35rem 0 0; }
.btn-attention { box-shadow: 0 0 0 3px #fde68a; }

.quote-summary-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin-top: 0.75rem; }
.qty-blocks { display: grid; gap: 0.5rem; margin-top: 0.75rem; }
.qty-block {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.55rem 0.7rem;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}
.qty-block-quoting { border-color: #c7d2fe; background: #f5f7ff; }
.qty-block-empty { opacity: 0.55; }
.qty-block-empty .qty-block-line:not(.qty-block-final) { display: none; }
.qty-block-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; margin-bottom: 0.2rem; }
.qty-block-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--color-text-muted); }
.qty-block-label strong { font-size: 0.95rem; color: var(--color-text); letter-spacing: 0; }
.qty-block-price { font-size: 1.15rem; font-weight: 750; color: var(--color-primary-dark); white-space: nowrap; }
.qty-block-price .muted { font-size: 0.75rem; font-weight: 500; }
.qty-block-line { line-height: 1.5; }
.qty-block-final { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.3rem; }
.stacked-form .qty-block-final label { display: inline; margin: 0; font-weight: 500; font-size: 0.82rem; }
.qty-block-final input { width: 5.2rem; padding: 0.25rem 0.4rem; font-size: 0.85rem; text-align: right; }
.qty-block-final-margin { font-size: 0.78rem; color: var(--color-success); font-weight: 600; }
.qty-block-po { font-size: 0.78rem; }
.qty-block-po:has(> span:empty) { display: none; }
.qty-block-costs { display: flex; flex-wrap: wrap; gap: 0.25rem 0.9rem; margin: 0.75rem 0 0; font-size: 0.8rem; font-variant-numeric: tabular-nums; }
/* Other fees: one-time charges, shown under the per-quantity blocks. */
.qty-block-fees { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.5rem; margin: 0.5rem 0 0; padding-top: 0.5rem; border-top: 1px solid var(--color-border); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.qty-block-fees[hidden] { display: none; }
.quote-lines-table.quote-fees-table td:first-child { width: 85%; }
.quote-form .quote-fees-table input[data-fee="description"] { width: 100%; max-width: none; font-weight: 600; }
.quote-fees-table .fee-remove { padding: 0.2rem 0.5rem; font-size: 1rem; line-height: 1; margin-top: 0.4rem; }

.quote-form .form-grid > div { margin-bottom: 0.4rem; }
.quote-qty-table th:first-child { width: 12rem; }
.quote-qty-table input { width: 6.2rem; padding: 0.38rem 0.5rem; font-size: 0.9rem; text-align: right; }
.quote-lines-table input.line-num, .task-table input.line-num { width: 4.6rem; padding: 0.38rem 0.45rem; font-size: 0.9rem; text-align: right; }
.quote-lines-table input.line-price { width: 5.4rem; }
.quote-lines-table th, .quote-lines-table td, .task-table th, .task-table td { padding: 0.55rem 0.5rem; }
.quote-lines-table td, .task-table td { vertical-align: top; white-space: normal; }
.quote-lines-table td:first-child { min-width: 14rem; width: 34%; }
.quote-lines-table .row-actions { width: 1%; }
.line-yield { font-size: 0.78rem; margin-top: 0.3rem; font-variant-numeric: tabular-nums; }
.quote-lines-table input[data-field="description"] { font-weight: 600; }
.line-sub { display: flex; gap: 0.4rem; margin-top: 0.3rem; }
.line-sub input { font-size: 0.82rem; padding: 0.28rem 0.45rem; }
.line-sub input[data-field="vendorName"] { flex: 1 1 8rem; }
.line-sub input.line-ref { flex: 0 1 8rem; }
.quote-lines-table td.computed, .task-table td.computed { font-variant-numeric: tabular-nums; padding-top: 0.95rem; color: var(--color-text); }
.quote-lines-table td.computed .muted { font-size: 0.78rem; }
.quote-lines-table .col-extended, .quote-lines-table td.computed[data-computed="extended"] { font-weight: 700; }
.quote-lines-table .line-remove { padding: 0.2rem 0.5rem; font-size: 1rem; line-height: 1; margin-top: 0.4rem; }
/* Metal sheet size: L x W under the vendor line, with the odd-sheet flag beside it. */
.line-sheet-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; margin-top: 0.3rem; }
.quote-lines-table input.line-sheet { width: 3.9rem; font-size: 0.82rem; padding: 0.28rem 0.4rem; text-align: right; }
.sheet-label { font-size: 0.78rem; }
.sheet-x { color: var(--color-text-muted); font-size: 0.85rem; }
.sheet-tag { display: inline-block; margin-left: 0.2rem; padding: 0.1rem 0.45rem; border-radius: 999px; background: var(--color-warning-bg); color: var(--color-warning-text); font-size: 0.72rem; font-weight: 600; white-space: nowrap; }
.sheet-tag[hidden] { display: none; }
.line-odd-sheet .line-sheet { border-color: var(--color-warning-text); }
.quote-lines-table input.price-scaled { background: var(--color-warning-bg); font-style: italic; }
.price-note { font-size: 0.72rem; margin-top: 0.2rem; white-space: nowrap; }
.price-note:empty { display: none; }
.text-danger { color: var(--color-danger); font-weight: 600; }
.line-empty td { white-space: normal; }
.hidden { display: none !important; }
.line-add { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.75rem; }
.line-add select { width: auto; max-width: 100%; flex: 1 1 22rem; }

.labor-inputs { margin-bottom: 0.75rem; }
.labor-inputs input { width: 7rem; }
.task-table th:first-child { min-width: 14rem; width: 45%; }
.task-group-row th { background: var(--color-bg); font-size: 0.72rem; letter-spacing: 0.04em; color: var(--color-text); }
.task-row .task-rule { font-size: 0.75rem; margin: 0.1rem 0 0 1.45rem; line-height: 1.3; }
.task-row input.task-note { width: 100%; min-width: 6rem; padding: 0.38rem 0.5rem; font-size: 0.85rem; }
.task-table td.computed { white-space: nowrap; }
.task-row:not(.task-on) input:not([type="checkbox"]) { opacity: 0.45; }
.task-row.task-on td:first-child { box-shadow: inset 3px 0 0 var(--color-primary); }
.task-table tfoot th, .task-table tfoot td { background: var(--color-bg); font-weight: 600; font-variant-numeric: tabular-nums; }
.task-table tfoot td.num { text-align: right; }
.quote-form-actions { display: flex; justify-content: flex-end; }

.prior-quotes { border-left: 4px solid var(--color-primary); }
.attachment-list { list-style: none; padding: 0; margin: 0 0 0.75rem; display: grid; gap: 0.4rem; }
.attachment-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.attach-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.attach-form select { width: auto; }

@media (max-width: 1000px) {
  .quote-layout { grid-template-columns: minmax(0, 1fr); }
  .quote-aside { position: static; order: -1; }
  .row-editor-body { width: min(92vw, 900px); }
}
@media (max-width: 640px) {
  .quote-lines-table td:first-child { min-width: 14rem; }
  .quote-summary-table { font-size: 0.8rem; }
  .quote-delete { margin-left: 0; }
}

/* A finish whose prices were filled from the Quoting price list (see
   public/js/app.js) - a faint tint on the two price boxes so it's clear
   they weren't typed; hovering either says which quote they came from. */
.finish-row-prefilled [data-sub-min-lot],
.finish-row-prefilled [data-sub-per-part] {
  background: #f0f6ff;
}

/* PO quotes: the Quotes list (one row per PO, parts inside) and a PO
   quote's page. A part above the PO price is the thing to catch, so it
   reads red on both. */
.po-quotes-table .po-parts-cell { white-space: normal; min-width: 30ch; }
.po-part { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; align-items: baseline; padding: 0.1rem 0; }
.po-part-price, .po-delta { font-variant-numeric: tabular-nums; white-space: nowrap; }
.po-delta-up { color: var(--color-danger, #b42318); font-weight: 600; }
.po-delta-down { color: var(--color-text-muted, #5b6472); }
.po-flag-note { font-size: 0.8rem; margin-top: 0.2rem; }
tr.po-quote-flagged > td:first-child { box-shadow: inset 3px 0 0 var(--color-danger, #b42318); }
.po-form-parts { margin: 0.75rem 0 0.25rem; }
.po-form-parts summary { cursor: pointer; font-weight: 500; }
.po-form-parts summary .muted { font-weight: 400; font-size: 0.85rem; }
.po-form-table { margin-top: 0.5rem; max-width: 46rem; }
.po-form-table input { width: 100%; }
.po-form-rev { max-width: 5rem; }
.po-form-qty { max-width: 6rem; }
.po-form-price { max-width: 8rem; }
.cq-items-table .cq-due { white-space: nowrap; }
.cq-hint { margin: 0.75rem 0 0; font-size: 0.85rem; }
.buyer-message { width: 100%; font: inherit; line-height: 1.45; resize: vertical; }
.qty-block-cq { display: flex; align-items: center; gap: 0.35rem; margin-top: 0.35rem; font-size: 0.8rem; color: var(--color-text-muted, #5b6472); }
.stacked-form .qty-block-cq { font-weight: 500; }
.qty-block-empty .qty-block-cq { display: none; }
.cq-items-table td { vertical-align: top; }
.cq-items-table .cq-breaks, .cq-items-table .cq-fees { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cq-items-table .cq-position { width: 3.2rem; text-align: right; }
.cq-warning { margin-top: 0.3rem; font-size: 0.8rem; color: var(--color-warning-text); }
.cq-add-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.75rem; }
.cq-add-form input, .cq-add-form select { width: auto; }
.cq-add-form select { max-width: 100%; }
.cq-add-form .po-form-pn { width: 14rem; }

/* Job tags. REVIEW (a job Claude or an agent built, waiting for Max) stands
   in for the On Hold badge, so it carries the colour on its own: solid
   magenta badge, a matching stripe down the tile, a banner on the job page. */
.badge-tag { font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.badge-tag-review { background: #c8008f; color: #ffffff; }
/* Production runs (Nov 12 2026): a PO made on another PO's run, or a run's lead. */
.badge-tag-run { background: #e8eefc; color: #1d3f8f; border: 1px solid #b9c9ef; font-weight: 600; }
.floor-card-run-waiting { font-size: 0.8rem; color: #7a4b00; }
.floor-card-run-waiting a { color: inherit; font-weight: 600; }
.live-run { margin-left: 4px; }
.floor-card-review { border-left: 5px solid #c8008f; }
.review-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; margin: 0 0 1rem; padding: 0.75rem 1rem; border-radius: 8px; background: #fdeef8; color: #5c0042; border: 1px solid #f3b6e0; border-left: 5px solid #c8008f; }
.review-banner strong { color: #c8008f; letter-spacing: 0.06em; margin-right: 0.35rem; }
.review-banner-btn { background: #c8008f; color: #ffffff; border: 0; font-weight: 600; }
.review-banner-btn:hover { background: #a00072; color: #ffffff; }

/* Proven setups (Nov 23 2026): the office's mark that a setup ran and made
   good parts, and how a later job compares with it. Green = known good,
   amber = something changed, gray = nothing proven yet. */
.badge-proven { background: #1f7a3d; color: #ffffff; font-weight: 700; letter-spacing: 0.05em; }
.proven-word { color: #1f7a3d; }
.proven-word-changed { color: #b45309; }
.proven-word-none { color: var(--color-text-muted); }
.proven-changes { margin: 0.3rem 0 0.2rem 1.1rem; padding: 0; }
.proven-changes li { margin: 0.1rem 0; overflow-wrap: anywhere; }
.proven-print-note { margin-top: 0.3rem; color: #b45309; }
.proven-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.45rem; }
.proven-btn { background: #1f7a3d; color: #ffffff; border: 0; font-weight: 600; }
.proven-btn:hover { background: #17602f; color: #ffffff; }
.review-proven { margin-top: 0.45rem; }
.review-banner .review-proven strong { letter-spacing: 0; margin-right: 0; }
.review-banner .review-proven .proven-word { color: #1f7a3d; }
.review-banner .review-proven .proven-word-changed { color: #b45309; }
.review-banner .review-proven .proven-word-none { color: #5c0042; }
.proven-note { margin-top: 0.4rem; }
.proven-note-ok strong { color: #1f7a3d; }

/* Lines (Oct 2026): the traveler prints Line 1, 2, 3 instead of due dates.
   A job whose lines changed after its traveler was printed is flagged
   until it's reprinted - amber, since it's a paperwork mismatch, not a
   hold. */
.badge-traveler-stale { background: #b45309; color: #ffffff; font-weight: 700; letter-spacing: 0.03em; }
.traveler-stale-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.traveler-printed-note { margin: -0.25rem 0 0.75rem; font-size: 0.85rem; }
.qty-row { position: relative; }
.qty-row-title { font-weight: 700; font-size: 0.9rem; color: var(--color-text-muted, #5b6472); margin-bottom: 0.25rem; letter-spacing: 0.03em; text-transform: uppercase; }
.qty-line-input { max-width: 9rem; }

/* Needs Ordering: why a row is short */
.why-panel { margin-bottom: 0.4rem; white-space: normal; }
.why-panel p { max-width: 70ch; }
.why-jobs { list-style: none; margin: 0.4rem 0 0; padding: 0; display: grid; gap: 0.3rem; }
.why-job { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.3rem 0.75rem; }
.why-stock { margin: 0 0 0.4rem; }

/* Bulk stock (metal not counted) - Ordering, Inventory */
.bulk-stock-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.6rem; padding-top: 0.6rem; border-top: 1px dashed var(--color-border); }
.bulk-stock-bar label { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; color: var(--color-text-muted); }
.bulk-stock-bar input[type="text"] { max-width: 16rem; }
.bulk-recheck-banner { background: var(--color-warning-bg); color: var(--color-warning-text); border-radius: 6px; padding: 0.55rem 0.8rem; margin: 0 0 0.8rem; font-size: 0.92rem; }
.bulk-recheck-banner a { color: inherit; font-weight: 700; }
.bulk-row-due td:first-child { box-shadow: inset 3px 0 0 var(--color-warning-text); }
.bulk-actions { display: flex; flex-direction: column; gap: 0.35rem; }
.bulk-actions form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin: 0; }
.bulk-actions input[type="number"] { width: 5.5rem; }
.bulk-pill { display: inline-block; padding: 0.05rem 0.45rem; border-radius: 999px; font-size: 0.72rem; font-weight: 700; background: #e6ecf3; color: #33475e; white-space: nowrap; }
.bulk-pill-due { background: var(--color-warning-bg); color: var(--color-warning-text); }
.inventory-qty-uncounted { color: var(--color-text-muted); }
.bulk-actions input[type="date"], .bulk-stock-bar input[type="date"] { width: auto; flex: 0 0 auto; }
.bulk-actions input[type="text"], .bulk-stock-bar input[type="text"] { width: 16rem; max-width: 100%; }
.bulk-stock-bar label { white-space: nowrap; }

/* ---------- Live Tracking (Oct 2026) ---------- */
.live-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 0.6rem; margin: 0.6rem 0 0.9rem; }
.live-tile { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 8px; padding: 0.55rem 0.7rem; }
.live-tile-value { font-size: 1.6rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.live-tile-label { color: var(--color-text-muted); font-size: 0.78rem; margin-top: 0.15rem; }
.live-tile-late { border-color: #fca5a5; background: var(--color-danger-bg); }
.live-tile-late .live-tile-value { color: var(--color-danger); }
.live-tile-tight { border-color: #fcd34d; background: var(--color-warning-bg); }
.live-tile-good .live-tile-value { color: var(--color-success); }
.live-legend { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: center; font-size: 0.85rem; margin: 0 0 0.6rem; }
.live-risk { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; font-weight: 600; font-size: 0.82rem; white-space: nowrap; }
.live-risk-ok { background: var(--color-success-bg); color: var(--color-success); }
.live-risk-tight { background: var(--color-warning-bg); color: var(--color-warning-text); }
.live-risk-late { background: var(--color-danger-bg); color: var(--color-danger); }

/* The toolbar: the step-column picker, the row color key, view switch
   and Full screen on one line. */
.live-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem; margin: 0.4rem 0 0.8rem; }
.live-toolbar-spacer { flex: 1 1 auto; }
.live-add-step select { min-width: 12rem; }
.live-key { display: inline-flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; font-size: 0.8rem; }
.live-key-swatch { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 4px; border: 1px solid rgba(0, 0, 0, 0.08); font-weight: 600; }

/* Rows are colored by urgency (Oct 2026), worked out from each job's
   slack - nothing anyone sets: Rush light red, High light yellow, Normal
   light blue. Painted on the cells so it wins over the table's hover shade. */
.live-urgency-rush, .live-table tr.live-urgency-rush > td { background: #fde2e2; }
.live-urgency-high, .live-table tr.live-urgency-high > td { background: #fdf0c2; }
.live-urgency-normal, .live-table tr.live-urgency-normal > td { background: #e0ecff; }
.live-table tr.live-urgency-rush:hover > td { background: #fbd3d3; }
.live-table tr.live-urgency-high:hover > td { background: #fbe7a8; }
.live-table tr.live-urgency-normal:hover > td { background: #d2e2fd; }

.live-table td { vertical-align: top; }
.live-table th, .live-table td { white-space: normal; }
.live-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.live-table .live-due, .live-table .live-projected { white-space: nowrap; }
.live-table .live-part { min-width: 11rem; }
.live-sub { font-size: 0.78rem; }
.live-slack { font-weight: 600; }
.live-steps { max-width: 30rem; min-width: 18rem; }
.live-step { display: inline-block; margin: 0 0.3rem 0.3rem 0; padding: 0.12rem 0.45rem; border-radius: 4px; background: #eef0f3; font-size: 0.8rem; white-space: nowrap; }
.live-step small { color: var(--color-text-muted); }
.live-step-now { background: #e0ecff; color: #1d4ed8; font-weight: 600; }
.live-step-wait { background: #f3e8ff; color: #7e22ce; }

/* Step blocks: one box per chosen step - its name on top, the jobs at it
   underneath. Every block is on the page; the picker shows the chosen
   ones and hides the all-jobs list. */
.live-hidden { display: none !important; }
/* Chosen blocks sit side by side, left to right in the order chosen, each
   a column of its own - always columns, never stacked: with more blocks
   than fit, the strip scrolls sideways rather than wrapping. A column is
   at least 340px in the simple view and 560px in the expanded view (six
   table columns), and the chosen columns share whatever width is left.
   A single block fills the page. */
.live-blocks { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(340px, 1fr); align-items: start; gap: 1rem; overflow-x: auto; padding-bottom: 0.4rem; }
body.live-expanded .live-blocks { grid-auto-columns: minmax(560px, 1fr); }
.live-block { min-width: 0; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 8px; overflow: hidden; }
.live-block .live-table th, .live-block .live-table td { white-space: normal; }
.live-block-head { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.9rem; background: #1c2430; color: #fff; cursor: grab; user-select: none; }
.live-block-head:active { cursor: grabbing; }
.live-block-grip { color: rgba(255, 255, 255, 0.45); font-size: 0.9rem; letter-spacing: -0.15em; }
/* Dragging a block: the carried one fades, the one under the pointer shows
   a bar on the side the drop will land. */
.live-block.live-dragging { opacity: 0.45; }
.live-block.live-drop-before { box-shadow: -5px 0 0 0 #1d4ed8; }
.live-block.live-drop-after { box-shadow: 5px 0 0 0 #1d4ed8; }
.live-col-move { border: none; background: transparent; color: rgba(255, 255, 255, 0.7); font-size: 1.25rem; line-height: 1; padding: 0 0.25rem; cursor: pointer; }
.live-col-move:hover { color: #fff; }
.live-col-move:disabled { color: rgba(255, 255, 255, 0.25); cursor: default; }
body.live-tv .live-col-move, body.live-tv .live-col-remove, body.live-tv .live-block-grip { display: none; }
.live-block-title { margin: 0; font-size: 1.05rem; font-weight: 700; letter-spacing: 0.01em; }
.live-block-count { display: inline-block; min-width: 1.6em; padding: 0.05rem 0.5rem; border-radius: 999px; background: rgba(255, 255, 255, 0.18); font-size: 0.85rem; font-weight: 700; text-align: center; }
.live-block .table-wrap { border: none; border-radius: 0; box-shadow: none; }
.live-block-empty { margin: 0; padding: 1.25rem 1rem; }
.live-col-remove { border: none; background: transparent; color: var(--color-text-muted); font-size: 1.1rem; line-height: 1; padding: 0 0.2rem; cursor: pointer; vertical-align: baseline; }
.live-block-head .live-col-remove { color: rgba(255, 255, 255, 0.7); }
.live-col-remove:hover { color: var(--color-danger); }
.live-block-head .live-col-remove:hover { color: #fff; }
.live-part-tag { margin-left: 0.3rem; white-space: nowrap; }
.live-detail { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; background: rgba(0, 0, 0, 0.06); font-size: 0.8rem; font-weight: 600; color: var(--color-text); }
.live-state { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; font-weight: 600; font-size: 0.8rem; white-space: nowrap; background: #fff; border: 1px solid rgba(0, 0, 0, 0.1); color: var(--color-text-muted); }
.live-state-done { background: var(--color-success-bg); color: var(--color-success); border-color: transparent; }
.live-state-now { background: #1d4ed8; color: #fff; border-color: transparent; }
.live-state-next { background: #fff; color: #1d4ed8; border-color: #1d4ed8; }
.live-state-wait { background: #f3e8ff; color: #7e22ce; border-color: transparent; }
.live-state-pending { }

.live-settings { margin-top: 1.2rem; }
.live-settings summary { cursor: pointer; }
.live-settings-form { margin-top: 0.8rem; }
.live-settings-form h3 { margin: 1rem 0 0.2rem; font-size: 1rem; }
.live-days { display: flex; flex-wrap: wrap; gap: 0.4rem 0.8rem; padding-top: 0.3rem; }
.live-day { display: inline-flex; gap: 0.3rem; align-items: center; font-weight: 400; }
.live-inline { display: flex; gap: 0.4rem; align-items: center; }
.live-num { width: 5.5rem; }
.live-defaults { max-width: 32rem; }
.live-howto { margin-top: 1rem; font-size: 0.85rem; max-width: 70rem; }

body.live-page .container { max-width: 1560px; }
/* Full screen (the button) and ?tv=1 (a kiosk): no menus, more room,
   bigger type for a screen across the shop. */
body.live-tv .topnav, body.live-fs .topnav, body.live-fs .flash { display: none; }
body.live-tv .container, body.live-fs .container { max-width: none; padding: 0.8rem 1.2rem; }
body.live-tv, body.live-fs { font-size: 1.15rem; }
body.live-tv .live-tile-value, body.live-fs .live-tile-value { font-size: 2.2rem; }
body.live-tv .live-table, body.live-fs .live-table { font-size: 1.05rem; }
body.live-tv .live-step, body.live-fs .live-step, body.live-tv .live-state, body.live-fs .live-state, body.live-tv .live-detail, body.live-fs .live-detail { font-size: 0.95rem; }
body.live-tv .live-block-title, body.live-fs .live-block-title { font-size: 1.35rem; }
body.live-tv .live-sub, body.live-fs .live-sub { font-size: 0.9rem; }
body.live-tv .live-legend, body.live-tv .page-header-meta, body.live-fs .live-legend, body.live-fs .page-header-meta { font-size: 1rem; }
/* The simple view on a big screen: the list is the point. */
body.live-simple.live-fs .live-table, body.live-simple.live-tv .live-table { font-size: 1.25rem; }
body.live-simple.live-fs .live-table th, body.live-simple.live-fs .live-table td, body.live-simple.live-tv .live-table th, body.live-simple.live-tv .live-table td { padding: 0.7rem 0.8rem; }
body.live-simple.live-fs .live-state, body.live-simple.live-tv .live-state, body.live-simple.live-fs .live-detail, body.live-simple.live-tv .live-detail { font-size: 1.05rem; }
body.live-simple.live-fs .live-sub, body.live-simple.live-tv .live-sub { font-size: 1rem; }

/* Shipping line: the "Shipping to" check at the bottom of the form (Oct 30
   2026) - what will print, read from the job, with a Change link. */
.ship-check { margin: 0.75rem 0; padding: 0.6rem 0.75rem; border: 1px solid var(--color-border, #d9dee5); border-radius: 6px; background: #f8fafc; }
.ship-check-title { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #5b6573; margin-bottom: 0.35rem; }
.ship-check-list { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 0.75rem; margin: 0; }
.ship-check-list dt { font-weight: 600; color: #5b6573; }
.ship-check-list dd { margin: 0; }
.ship-check-source { font-size: 0.78rem; }
.ship-check-missing { color: var(--color-danger); font-weight: 600; }
.ship-change { margin-top: 0.4rem; }
.ship-change > summary { cursor: pointer; font-size: 0.82rem; color: var(--color-primary, #1d4ed8); }
.ship-change-body { margin-top: 0.4rem; display: grid; gap: 0.35rem; max-width: 32rem; }

/* Ordering page: "Ordering as" Lectro Engineering / Aerospace Fabricators
   Inc. (views/ordering.js's orderingAsSwitch). A two-sided switch; the
   active side is filled so it reads at a glance which company the next
   PO goes out as. */
.ordering-as { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin: 0 0 1rem; }
.ordering-as-label { font-weight: 600; }
.ordering-as-options { display: inline-flex; border: 1px solid var(--color-primary); border-radius: 6px; overflow: hidden; }
.ordering-as-option { border: 0; background: #fff; color: var(--color-primary); padding: 0.4rem 0.9rem; font: inherit; font-weight: 600; cursor: pointer; }
.ordering-as-option + .ordering-as-option { border-left: 1px solid var(--color-primary); }
.ordering-as-option.is-active { background: var(--color-primary); color: #fff; cursor: default; }
.ordering-as-option:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* Sandbox mode (src/sandbox.js): a copy of the ERP people tinker on. The
   banner and the red header make it impossible to mistake for the real one. */
.sandbox-banner {
  background: repeating-linear-gradient(135deg, #b91c1c 0 14px, #7f1d1d 14px 28px);
  color: #fff; font-weight: 700; text-align: center; padding: 0.45rem 1rem;
  letter-spacing: 0.02em; position: sticky; top: 0; z-index: 60;
}
body.sandbox .topnav { background: #fee2e2; border-bottom-color: #b91c1c; }
body.sandbox .topnav-brand a::after { content: " (sandbox)"; color: #b91c1c; font-weight: 600; }

/* Lead-time work (Nov 3 2026): the board's lead estimate on a quote, and
   the measured columns in the Live settings. */
.quote-lead-estimate { grid-column: 1 / -1; padding: 0.6rem 0.8rem; border: 1px dashed var(--color-border); border-radius: 6px; background: var(--color-bg); }
.quote-lead-estimate label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.quote-lead-estimate .btn { margin-top: 0.4rem; }
.live-measured { font-size: 0.85rem; white-space: nowrap; }
.live-check { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 600; }
.live-settings-form textarea { width: 100%; font-family: inherit; font-size: 0.9rem; }


/* Metal request for quote (views/metalRfq.js) */
.badge-rfq-draft { background: var(--color-bg); color: var(--color-text-muted); border: 1px solid var(--color-border); }
.badge-rfq-sent { background: var(--color-warning-bg); color: var(--color-warning-text); }
.badge-rfq-ordered { background: var(--color-success-bg); color: var(--color-success); }
.badge-rfq-cancelled { background: var(--color-bg); color: var(--color-text-muted); text-decoration: line-through; }
.rfq-header h2 { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.2rem; }
.rfq-header-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  align-items: flex-end;
  margin-top: 0.8rem;
}
.rfq-header-form label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.8rem; color: var(--color-text-muted); }
.rfq-header-form label.rfq-notes { flex: 1 1 18rem; }
.rfq-header-form input, .rfq-header-form select { width: auto; min-width: 10rem; }
.rfq-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem 1.5rem;
  margin-top: 0.6rem;
}
.rfq-summary > * { min-width: 0; overflow-wrap: anywhere; }
.rfq-summary > .summary-wide { grid-column: 1 / -1; }
.rfq-summary .summary-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
  margin-bottom: 0.15rem;
}
.rfq-sheet-total { font-size: 0.85rem; font-weight: 400; margin-left: 0.5rem; }
.rfq-lines-table td { vertical-align: top; }
.rfq-lines-table .rfq-metal-picker { display: flex; flex-direction: column; gap: 0.3rem; min-width: 16rem; }
.rfq-lines-table .rfq-metal-picker select { margin-bottom: 0; width: 100%; }
.rfq-lines-table .rfq-metal-picker .item-name-new { width: 100%; }
.rfq-lines-table .metal-size-fields { display: inline-flex; align-items: center; gap: 0.3rem; }
.rfq-lines-table .rfq-qty-input { width: 6rem; }
.rfq-lines-table input[name^="note_"] { min-width: 12rem; }
.rfq-line-hint { font-size: 0.78rem; margin-top: 0.25rem; }
.rfq-lines-actions { display: flex; gap: 0.6rem; align-items: center; margin-top: 0.8rem; }
.rfq-actions-row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin: 0.4rem 0 0.8rem; }
.rfq-order-form { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--color-border); }
.rfq-order-form h3 { margin: 0 0 0.3rem; font-size: 1rem; }
.rfq-price-input { width: 7rem; }
/* No-quoted lines (models.placeMetalRfqOrder) */
.badge-rfq-noquote { background: var(--color-bg); color: var(--color-warning-text); border: 1px solid var(--color-warning-text); }
.rfq-price-table .rfq-qty-input { width: 5.5rem; }
.rfq-noquote-label { display: inline-flex; align-items: center; gap: 0.35rem; white-space: nowrap; font-size: 0.85rem; cursor: pointer; }
.rfq-noquote-label input { width: auto; margin: 0; }
tr.rfq-line-noquote td { color: var(--color-text-muted); }
tr.rfq-line-noquote td:not(.rfq-noquote-cell) strong, .rfq-price-table tr.rfq-line-noquote td:first-child { text-decoration: line-through; }
.rfq-asked { font-size: 0.74rem; }
.rfq-requote { margin: 0.6rem 0 0.9rem; padding: 0.7rem 0.9rem; border: 1px solid var(--color-border); border-radius: 6px; background: var(--color-bg); }
.rfq-requote p { margin: 0 0 0.5rem; }
.rfq-requote form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.ordering-no-quote-note { font-size: 0.74rem; margin-top: 0.15rem; color: var(--color-warning-text); }
.rfq-cancel-form { margin-top: 1rem; }
.rfq-new-form { margin: 0 0 0.8rem; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.ordering-new-po { margin: 0 0 0.8rem; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
/* Hardware RFQ (views/hardwareRfq.js) */
.rfq-copies { margin-top: 0.8rem; padding: 0.6rem 0.9rem; border: 1px solid var(--color-border); border-radius: 6px; background: var(--color-bg); }
.rfq-copies p { margin: 0 0 0.4rem; }
.rfq-copies .rfq-actions-row { margin-bottom: 0; }
.rfq-copy-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin: 0 0 0.6rem; }
.rfq-save-prices { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.88rem; cursor: pointer; }
.rfq-save-prices input { width: auto; margin: 0; }
.rfq-save-prices-note { font-size: 0.8rem; margin: 0; }
.hw-rfq-price-table input.rfq-price-input { width: 7rem; max-width: 100%; }
.hw-rfq-price-table td:nth-child(3) { width: 9rem; }
.btn-inline-link { background: none; border: none; padding: 0; font: inherit; color: var(--color-primary); cursor: pointer; }
.btn-inline-link:hover { text-decoration: underline; }
@media (max-width: 720px) {
  .rfq-lines-table .rfq-metal-picker select { min-width: 0; width: 100%; }
}

/* ---------- Quote page: labor as the routing (Nov 2026) ---------- */
.routing-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem 0.8rem; margin: 1rem 0 0.4rem; }
.routing-head-label { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.routing-source-text { font-size: 0.82rem; }
.routing-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--color-border); border-radius: 8px; overflow: hidden; }
.routing-step + .routing-step { border-top: 1px solid var(--color-border); }
.routing-details > summary { list-style: none; cursor: pointer; }
.routing-details > summary::-webkit-details-marker { display: none; }
.routing-row { display: grid; grid-template-columns: 2rem minmax(8rem, 1fr) 4.5rem 5.5rem minmax(0, 2fr) 6.6rem; align-items: center; gap: 0.6rem; padding: 0.55rem 0.75rem; min-height: 2.6rem; }
.routing-details > summary.routing-row:hover { background: var(--color-bg); }
.routing-details[open] > summary.routing-row { background: var(--color-bg); }
.routing-n { font-size: 0.78rem; font-weight: 700; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.routing-name { font-weight: 600; }
.routing-hours { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.routing-src { white-space: nowrap; }
.routing-note { font-size: 0.8rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.routing-tools { display: inline-flex; gap: 0.25rem; }
.routing-tools .btn { padding: 0.15rem 0.45rem; font-size: 0.8rem; line-height: 1.2; }
.routing-step-empty .routing-name { color: var(--color-text-muted); }
.routing-step-sub .routing-name { font-weight: 600; }
.routing-badge-rule { background: var(--color-bg); color: var(--color-text-muted); border: 1px solid var(--color-border); }
.routing-badge-typed { background: #e0ecff; color: #1d4ed8; }
.routing-badge-none { background: var(--color-warning-bg); color: var(--color-warning-text); }
.routing-badge-outside { background: #ede9fe; color: #6d28d9; }
.routing-details > summary .routing-name::after { content: '\25BE'; margin-left: 0.4rem; font-size: 0.7em; color: var(--color-text-muted); display: inline-block; transition: transform 0.15s; }
.routing-details[open] > summary .routing-name::after { transform: rotate(180deg); }
.routing-badge:empty { display: none; }
.routing-body { padding: 0 0.75rem 0.75rem 2.6rem; }
.routing-body .table-wrap { margin: 0; }
.routing-body.muted { padding-top: 0.2rem; font-size: 0.85rem; }
.routing-add { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin: 0.6rem 0 0.2rem; }
.routing-add select { max-width: 16rem; }
.routing-more { margin: 0.8rem 0 0.4rem; }
.routing-more > summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; }
.routing-more > summary .muted, .routing-more > summary .routing-more-warn { font-weight: 400; }
.routing-more-warn { color: var(--color-warning-text); }
.routing-more .table-wrap { margin-top: 0.5rem; }
.task-totals { margin-top: 0.6rem; }
.task-totals thead th { font-size: 0.72rem; }
.task-totals th:first-child { min-width: 14rem; width: 45%; }
.task-totals tfoot th, .task-totals tfoot td { background: var(--color-bg); font-weight: 600; font-variant-numeric: tabular-nums; }
.task-totals tfoot td.num { text-align: right; }
@media (max-width: 720px) {
  .routing-row { grid-template-columns: 1.6rem 1fr auto auto; }
  .routing-note { display: none; }
  .routing-tools { grid-column: 1 / -1; justify-content: flex-end; }
  .routing-body { padding-left: 0.75rem; }
}

/* ---------- Job page: admin notes (Nov 2026) ---------- */
/* Admin notes is a folder since Nov 23 2026 - the form inside it stacks. */
.admin-notes-form { display: flex; flex-direction: column; gap: 0.5rem; }
.admin-notes-who { margin-left: 0 !important; }
.admin-notes-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem 1rem; }
.admin-notes-title { font-weight: 700; margin: 0; }
.admin-notes-who { font-weight: 400; font-size: 0.8rem; margin-left: 0.4rem; }
.admin-notes-check { font-weight: 600; margin: 0; }
.admin-notes textarea { width: 100%; resize: vertical; font: inherit; }
.admin-notes-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem 1rem; font-size: 0.85rem; }
.admin-notes-open { box-shadow: inset 3px 0 0 var(--color-warning-text); background: var(--color-warning-bg); }
.admin-notes-reviewed textarea { color: var(--color-text-muted); background: var(--color-bg); }
.admin-notes-reviewed .admin-notes-check { color: var(--color-success); }

/* ---------- Live simple view (Nov 2026) ----------
   Part number, who's on it, quantity - nothing else. The operator's
   initials sit in a green circle right of center, just left of the
   quantity, vertically centered. Blocks are narrower now that Due and PO
   are gone, and nothing inside one scrolls sideways: the part cell wraps
   (a long Surfacing detail like "Edge → Sand" drops to its own line). */
/* The operator bubble: a flat green disc with the initials smaller and
   dead centre. The letters are their own block (.live-op-txt), trimmed to
   the capitals where the browser can (text-box) so they sit in the middle
   of the circle instead of riding high on the font's descender space; a
   small nudge down does the same where it can't. No letter-spacing - it
   adds space after the last letter and pulls the pair off centre. */
.live-op { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; width: 2.6em; height: 2.6em; border-radius: 50%; background: #16a34a; border: 1px solid #15803d; color: #fff; font-weight: 700; font-size: 0.7rem; letter-spacing: 0; line-height: 1; flex: none; vertical-align: middle; }
.live-op-txt { display: block; line-height: 1; letter-spacing: 0; text-align: center; transform: translateY(0.07em); }
@supports (text-box: trim-both cap alphabetic) {
  .live-op-txt { text-box: trim-both cap alphabetic; transform: none; }
}

.live-table-simple td { vertical-align: middle; }
.live-table-simple { width: 100%; }
.live-table-simple .live-op-cell { width: 1%; white-space: nowrap; text-align: center; padding-left: 0.3rem; padding-right: 0.3rem; }
.live-table-simple th.num, .live-table-simple td.num { width: 1%; white-space: nowrap; }
.live-table-simple .live-rev { white-space: nowrap; font-size: 0.85em; }
.live-table-simple .live-part { min-width: 0; width: auto; overflow-wrap: break-word; }
.live-table-simple .live-part-tag { margin: 0.25rem 0 0; white-space: normal; }
.live-table-simple .live-detail, .live-table-simple .live-state { white-space: normal; }
body.live-simple .live-blocks { grid-auto-columns: minmax(250px, 1fr); }
body.live-simple .live-block .table-wrap { overflow: visible; }
.live-block-more { margin: 0; padding: 0.45rem 0.9rem 0.6rem; font-size: 0.85rem; border-top: 1px solid var(--color-border); }
body.live-simple.live-fs .live-op, body.live-simple.live-tv .live-op { font-size: 0.8rem; }
body.live-simple.live-fs .live-block-more, body.live-simple.live-tv .live-block-more { font-size: 1rem; }
/* A part number never splits across lines; the Rev goes on the line
   under it. */
.live-table-simple .job-link { white-space: nowrap; }
.live-table-simple .live-rev { display: block; }
body.live-simple.live-fs .live-table-simple th, body.live-simple.live-fs .live-table-simple td, body.live-simple.live-tv .live-table-simple th, body.live-simple.live-tv .live-table-simple td { padding: 0.6rem 0.55rem; }
body.live-simple.live-fs .live-table-simple .live-op-cell, body.live-simple.live-tv .live-table-simple .live-op-cell { padding-left: 0.15rem; padding-right: 0.15rem; }

/* Metal price breaks (Nov 2026): the first column is a sheet size, L x W,
   priced per sheet of that size - a little wider than a quantity box. */
.price-break-size { display: flex; align-items: center; gap: 0.25rem; min-width: 0; }
.price-break-size input { width: 100%; min-width: 0; }
.price-break-x { color: var(--color-text-muted); font-size: 0.85rem; }
.price-break-labels-metal,
.price-break-row-metal { grid-template-columns: 9.5rem 7rem minmax(8rem, 14rem) 10rem auto; }
.price-break-labels-docs.price-break-labels-metal,
.price-break-row-docs.price-break-row-metal { grid-template-columns: 9.5rem 6.5rem minmax(7rem, 10rem) 9rem minmax(9rem, 1fr) auto; }
@media (max-width: 860px) {
  .price-break-row-metal, .price-break-row-docs.price-break-row-metal { grid-template-columns: 1fr 1fr; }
}
/* Drill Press tasks on a quote: holes per part under the task name. */
.task-row .task-per-part { display: inline-flex; align-items: center; gap: 0.4rem; margin: 0.3rem 0 0 1.45rem; font-size: 0.8rem; font-weight: 600; color: var(--color-text-muted); }
.task-row .task-per-part input.line-num { width: 4.2rem; }

/* ---------- Lectro / AFI (Nov 2026) ----------
   The New Job / Edit Job company switch (views/companySwitch.js): two
   radio cards, the picked one filled in and ringed in its company's color,
   so which company a job is being entered for is obvious at a glance.
   AFI's color is a deep teal - nothing else on the site uses it, so the
   AFI badge reads the same everywhere it appears. */
:root {
  --color-afi: #0b6b5c;
  --color-afi-dark: #084f44;
  --color-afi-bg: #e4f3ef;
  --color-lectro-bg: #eaf0fd;
}
.company-switch { border: 0; padding: 0; margin: 0 0 1.25rem; min-width: 0; }
.company-switch legend {
  padding: 0;
  margin-bottom: 0.45rem;
  font-size: 0.78rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}
.company-options { display: flex; flex-wrap: wrap; gap: 0.6rem; }
/* Qualified with the label element and .stacked-form so the form's own
   "label: block, bold, top margin" rule doesn't flatten the cards. */
.stacked-form label.company-option,
label.company-option {
  position: relative;
  display: flex;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 400;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.9rem;
  flex: 0 1 auto;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  cursor: pointer;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}
.company-option:hover { border-color: #b9c2cd; }
/* The real radio stays in the page for keyboards and screen readers;
   the round check beside the name is what shows its state. */
.company-option input[type="radio"] { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.company-option-check {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.12rem;
  border: 2px solid #aab3be;
  border-radius: 50%;
  background: var(--color-surface);
}
.company-option-text { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.company-option-name { font-weight: 650; font-size: 0.98rem; line-height: 1.25; }
.company-option-note { font-size: 0.8rem; color: var(--color-text-muted); line-height: 1.3; }
.company-option:has(input:focus-visible) { outline: 3px solid rgba(29, 78, 216, 0.35); outline-offset: 2px; }
.company-option-lectro:has(input:checked) { border-color: var(--color-primary); background: var(--color-lectro-bg); }
.company-option-lectro:has(input:checked) .company-option-check { border-color: var(--color-primary); background: radial-gradient(circle, var(--color-primary) 0 45%, var(--color-surface) 50%); }
.company-option-afi:has(input:checked) { border-color: var(--color-afi); background: var(--color-afi-bg); }
.company-option-afi:has(input:checked) .company-option-check { border-color: var(--color-afi); background: radial-gradient(circle, var(--color-afi) 0 45%, var(--color-surface) 50%); }
.company-option-afi:has(input:checked) .company-option-name { color: var(--color-afi-dark); }
.company-option:has(input:disabled) { cursor: not-allowed; opacity: 0.75; }

/* The form follows the pick: Lectro-only parts (price, Lectro shipping
   details, Parts stock) hide for AFI, AFI-only notes show for it, and an
   AFI form carries a teal edge so it never passes for a Lectro one. */
[data-company-form][data-company="afi"] [data-lectro-only] { display: none !important; }
[data-company-form]:not([data-company="afi"]) [data-afi-only] { display: none !important; }
.card-form:has([data-company-form][data-company="afi"]) { border-top: 4px solid var(--color-afi); }
[data-company-form][data-company="afi"] button.btn-primary[type="submit"] { background: var(--color-afi); border-color: var(--color-afi); }
[data-company-form][data-company="afi"] button.btn-primary[type="submit"]:hover { background: var(--color-afi-dark); border-color: var(--color-afi-dark); }
.afi-only-note {
  margin: 0.6rem 0 0;
  padding: 0.45rem 0.7rem;
  border-left: 3px solid var(--color-afi);
  background: var(--color-afi-bg);
  color: var(--color-afi-dark);
  font-size: 0.85rem;
  border-radius: 0 6px 6px 0;
}

/* Company bubbles (Nov 2026): Lectro light green, AFI light sky blue -
   pale fills with dark text, kept well clear of the blue Start button. */
.badge-company-afi { background: #d9eefc; color: #0b4a6f; box-shadow: inset 0 0 0 1px #9fcff0; letter-spacing: 0.04em; }
.badge-company-lectro { background: #dcf5e3; color: #17603a; box-shadow: inset 0 0 0 1px #a3dcb5; letter-spacing: 0.02em; }

/* Shipping page: AFI jobs at Mark Sent, apart from Lectro's queue. */
.afi-send { margin: 0 0 1.75rem; padding: 1rem 1.1rem 0.5rem; border: 1px solid #b7ddd4; border-left: 5px solid var(--color-afi); border-radius: var(--radius); background: var(--color-surface); }
.afi-send h2 { margin-top: 0; display: flex; align-items: center; gap: 0.5rem; }
.afi-send-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.6rem; padding: 0.3rem 0; }
.afi-send-line + .afi-send-line { border-top: 1px dashed var(--color-border); }
.afi-send-what { font-weight: 600; min-width: 9rem; }
.afi-send-form input[type="date"] { width: auto; }
.afi-send-form input[type="number"].line-num { width: 5.5rem; }
.afi-send-form input[type="text"].afi-send-note { flex: 1 1 14rem; min-width: 10rem; width: auto; }
.afi-send .btn-primary { background: var(--color-afi); border-color: var(--color-afi); }
.afi-send .btn-primary:hover { background: var(--color-afi-dark); border-color: var(--color-afi-dark); }

/* AFI job form extras (Nov 2026): "+ Quality check after" on each step,
   Punch's Inspect 1st Piece, Final QC's required documentation rows. */
.btn-qc-after { color: var(--color-afi-dark); border-color: #b7ddd4; }
.btn-qc-after:hover:not(:disabled) { background: var(--color-afi-bg); }
.punch-details .punch-inspect-first { margin-top: 0.75rem; font-weight: 600; }
.qc-docs { border-left: 4px solid var(--color-afi); }
.qc-doc-list { display: flex; flex-direction: column; gap: 0.4rem; margin: 0.5rem 0 0.75rem; max-width: 560px; }
.qc-doc-row { display: flex; align-items: center; gap: 0.5rem; }
.stacked-form .qc-doc-row label.qc-doc-num { margin: 0; flex: 0 0 1.6rem; text-align: right; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.qc-doc-row input[type="text"] { flex: 1 1 auto; }
/* Customer form: the folded "+ Add a CAGE code" for defense customers. */
.cage-code-add { margin: 0.85rem 0 0; }
.cage-code-add summary { cursor: pointer; color: var(--color-primary); font-size: 0.9rem; font-weight: 600; }
.cage-code-add[open] summary { margin-bottom: 0.3rem; }

/* Labor report (Nov 2026, /live/labor - Creator only). */
.labor-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin: 0 0 1rem; }
.labor-picker-periods, .labor-picker-nav { display: inline-flex; gap: 0.35rem; }
.labor-range { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin: 0; }
.labor-range label { font-size: 0.85rem; font-weight: 600; margin: 0; }
.labor-range input[type="date"] { width: auto; padding: 0.3rem 0.45rem; }
.labor-total-all { font-size: 0.95rem; font-weight: 500; margin-left: 0.4rem; }
.labor-table th[scope="row"] { text-align: left; font-weight: 600; white-space: nowrap; }
.labor-table td.num, .labor-table th.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.labor-table .labor-total { font-weight: 700; }
.labor-shared th[scope="row"] { font-weight: 500; }
.labor-sub { display: block; font-size: 0.78rem; font-weight: 400; }
/* Labor report: clocks stopped automatically, waiting to be checked
   (views/laborReport.js reviewCard). */
.labor-review-card { margin-bottom: 1.25rem; }
.labor-review-actions { white-space: normal; }
.labor-review-actions .inline-form { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin: 0 0.4rem 0.3rem 0; }
.labor-review-form input[type="time"] { width: auto; margin: 0; }
.labor-flags { min-width: 14rem; }
.labor-flag { display: inline-block; margin: 0.1rem 0.15rem 0.1rem 0; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.78rem; background: var(--color-warning-bg); color: var(--color-warning-text); white-space: nowrap; }
.labor-flag-bad { background: var(--color-danger-bg); color: var(--color-danger); }
.labor-flag-live { background: var(--color-success-bg); color: var(--color-success); }
.labor-detail { margin: 0 0 0.6rem; padding: 0.6rem 0.85rem; border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface); }
.labor-detail summary { cursor: pointer; }
.labor-detail[open] summary { margin-bottom: 0.6rem; }
.labor-detail-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1rem; }
@media (max-width: 900px) { .labor-detail-grid { grid-template-columns: 1fr; } }
.labor-table tbody th[scope="row"] { text-transform: none; letter-spacing: 0; font-size: 0.95rem; color: var(--color-text); background: transparent; }

/* Ordering: Outside POs (Nov 2026) - record a hand-made PO's number. */
.outside-po-form { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1rem; }
.outside-po-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.6rem 0.8rem; align-items: start; }
.outside-po-fields label { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 0.2rem; }
.outside-po-fields input { width: 100%; }
.outside-po-fields .outside-po-note { grid-column: 1 / -1; }
.outside-po-form > .btn { align-self: flex-start; }

/* Subcontractor page: Final Count fixed in place (views/subcontractor.js). */
.final-count-form { display: inline-flex; align-items: center; gap: 0.3rem; flex-wrap: nowrap; }
.final-count-form .final-count-input { width: 4.5rem; margin: 0; font-variant-numeric: tabular-nums; }
/* A run lead's Final Count is the whole run's (Nov 12 2026). */
.final-count-run { font-size: 0.72rem; margin-top: 0.15rem; white-space: nowrap; }

/* Job page, production roles: View Print grayed out when the job has no
   print attached (views/jobDetail.js). */
.view-print-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- "How this works" and page tabs (Nov 2026) ---------- */
/* The instructions a page used to open with, behind one small link
   (views/howTo.js). */
.howto { margin: 0 0 0.75rem; }
.howto-summary { display: inline-block; font-size: 0.82rem; color: var(--color-primary); cursor: pointer; list-style: none; }
.howto-summary::-webkit-details-marker { display: none; }
.howto-summary::before { content: '? '; font-weight: 700; }
.howto-summary:hover { text-decoration: underline; }
.howto-body { font-size: 0.85rem; color: var(--color-text-muted); margin-top: 0.4rem; max-width: 90ch; line-height: 1.45; }
.howto-body strong { color: var(--color-text); }
/* A whole card folded away behind its heading (Bulk Stock, Not Needed). */
details.card-folded > summary { cursor: pointer; list-style: none; }
details.card-folded > summary::-webkit-details-marker { display: none; }
details.card-folded > summary h2 { display: inline-flex; align-items: center; gap: 0.5rem; margin: 0; }
details.card-folded > summary h2::before { content: '▸'; font-size: 0.8em; color: var(--color-text-muted); transition: transform 0.15s; }
details.card-folded[open] > summary h2::before { transform: rotate(90deg); }
details.card-folded[open] > summary { margin-bottom: 0.75rem; }
.card-heading-link { font-size: 0.8rem; font-weight: 400; margin-left: 0.75rem; }
/* Ordering's two sections: Needs Ordering, and Orders (on order, POs
   issued, outside POs, received). app.js shows one at a time; with no
   script both show. */
.page-tabs { display: flex; gap: 0.25rem; border-bottom: 2px solid var(--color-border); margin: 0 0 1rem; }
.page-tab { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.55rem 0.9rem; margin-bottom: -2px; border-bottom: 2px solid transparent; color: var(--color-text-muted); font-weight: 600; text-decoration: none; }
.page-tab:hover { color: var(--color-text); text-decoration: none; }
.page-tab.is-active { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.page-tabs-ready [data-tab-panel]:not(.is-active) { display: none; }
/* One expander per Needs Ordering row. */
.row-panel-body { display: grid; gap: 0.75rem; }
.row-panel-heading { margin: 0 0 0.35rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--color-text-muted); }
/* Inventory: one Add / Remove card ahead of the lists. */
.inventory-adjust-pick { display: inline-flex; align-items: center; gap: 0.5rem; margin-bottom: 0.6rem; font-size: 0.9rem; }
.inventory-adjust-pick select { width: auto; margin: 0; }

/* Crews and overlapping steps (Nov 2026) - views/floor.js, jobDetail.js, liveTracking.js */
/* Crews (Nov 2026): one row above the step name - who's on the clock on
   the left, the helper buttons and "Start <next> early" on the right -
   wrapping only when it has to, so a crew doesn't stack the card taller
   (the cards in a row all grow to the tallest one). */
.floor-card-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.35rem 0.5rem; margin-bottom: 0.45rem; min-height: 1.6rem; }
.floor-card-meta-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.3rem; margin-left: auto; }
.floor-card-meta-actions .inline-form { margin: 0; }
.floor-card-mini { padding: 0.2rem 0.5rem; font-size: 0.78rem; white-space: nowrap; }
.floor-card-crew, .step-crew { display: flex; flex-wrap: wrap; gap: 0.2rem; align-items: center; }
.floor-crew-op { display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; flex: none; border-radius: 50%; background: #16a34a; border: 1px solid #15803d; color: #fff; font-weight: 700; font-size: 0.62rem; line-height: 1; }
.floor-crew-helpers { font-size: 0.76rem; font-weight: 700; color: var(--color-success); padding: 0 0.15rem; white-space: nowrap; }
.floor-card-overlap { font-size: 0.78rem; margin-bottom: 0.35rem; }
.floor-card-after { font-style: italic; }
.step-crew { margin-top: 0.3rem; }
.step-crew .floor-crew-op { width: 1.45rem; height: 1.45rem; font-size: 0.58rem; }
/* The traveler table's status badge may wrap ("In / progress") in a narrow
   column rather than run over the Count beside it. */
.traveler-table .step-status-cell .badge { white-space: normal; word-break: normal; overflow-wrap: normal; max-width: 100%; text-align: center; padding: 0.2rem 0.4rem; font-size: 0.66rem; }
.traveler-table th { word-break: normal; overflow-wrap: normal; }
/* Phones (a traveler QR scanned on the floor): each step is a stacked
   block - name, then status / count / time on one line with small labels,
   then the note and the buttons - instead of eight columns crushed into
   390px. */
@media (max-width: 640px) {
  .traveler-table thead { display: none; }
  .traveler-table, .traveler-table tbody { display: block; width: 100%; }
  .traveler-table tr { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.35rem 1rem; padding: 0.7rem 0.6rem; border-bottom: 1px solid var(--color-border); }
  .traveler-table td { display: block; width: auto !important; padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; }
  .traveler-table tr.step-in_progress { background: #f5f8ff; }
  .traveler-table tr.step-next-up { background: #f7faff; box-shadow: inset 4px 0 0 var(--color-primary); }
  .traveler-table td.step-station, .traveler-table td.step-notes, .traveler-table td.step-actions, .traveler-table td[colspan] { flex: 1 1 100%; }
  .traveler-table td[data-label]::before { content: attr(data-label); display: block; font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-muted); margin-bottom: 0.1rem; }
  .traveler-table td.step-notes:has(.muted:empty) { display: none; }
  .traveler-table td.step-actions:empty { display: none; }
  .traveler-table .note-form input { width: 100%; }
}
.live-crew { display: inline-flex; flex-wrap: wrap; gap: 0.15rem; align-items: center; vertical-align: middle; }
.live-op-more { font-size: 0.75rem; font-weight: 700; color: var(--color-success); padding-left: 0.1rem; }
.live-early { font-style: italic; white-space: nowrap; }
.inventory-onorder-note { font-size: 0.78rem; margin-top: 0.15rem; }
/* Removing a line from a request / PO (Nov 2026) */
.rfq-remove-cell { width: 1%; text-align: center; vertical-align: top; }
/* A received line on a PO being revised (Dec 2026): text, locked. */
.rfq-line-locked td { color: var(--color-text-muted); vertical-align: middle; }
.rfq-line-locked .rfq-remove-cell { font-size: 0.85em; white-space: nowrap; }
.data-table td.po-revision-changes { white-space: normal; min-width: 18rem; }
.rfq-remove-line { background: none; border: 1px solid transparent; border-radius: 4px; color: var(--color-text-muted); font-size: 1.15rem; line-height: 1; padding: 0.3rem 0.5rem; cursor: pointer; }
.rfq-remove-line:hover, .rfq-remove-line:focus-visible { color: var(--color-danger); border-color: var(--color-border); }
/* AFI lot traceability (Nov 2026) */
.lot-fields { margin-top: 0.4rem; }
.lot-line { font-size: 0.82rem; }
.lot-missing { color: var(--color-warning-text); font-weight: 600; }
.lot-expired { color: var(--color-danger); font-weight: 600; }
.item-type-tag { font-size: 0.75rem; padding: 0.05rem 0.4rem; border-radius: 999px; background: var(--color-bg); border: 1px solid var(--color-border); }
.item-type-fields { margin-top: 0.4rem; }
.item-asreq { display: flex; align-items: flex-end; padding-bottom: 0.45rem; }
.mark-ink-fields { display: inline-flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-left: 0.4rem; }
.mark-ink-fields input[type="text"] { width: 11rem; }
.mark-ink-exp { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.82rem; }
/* AFI quality - requirements and NCRs (Nov 2026) */
.qr-section { margin: 1.2rem 0; padding: 1rem 1.1rem; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-bg); }
.qr-section h2, .qr-card h2 { margin-top: 0; }
.qr-sub { font-size: 0.85rem; font-weight: 400; margin-left: 0.4rem; }
.qr-specs { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.8rem; }
.qr-spec-row { display: flex; gap: 0.4rem; }
.qr-spec-row input:first-child { flex: 1 1 auto; }
.qr-spec-row .qr-rev-input { width: 6rem; flex: none; }
.qr-flags { border: 1px solid var(--color-border); border-radius: 6px; padding: 0.6rem 0.9rem; margin: 0 0 0.8rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0.35rem 1rem; }
.qr-flags legend { font-weight: 600; font-size: 0.85rem; padding: 0 0.3rem; }
.qr-reviewed { margin: 0.6rem 0 0.8rem; padding: 0.55rem 0.7rem; border-radius: 6px; background: var(--color-surface, #fff); border: 1px solid var(--color-border); }
.qr-status { margin: 0 0 0.6rem; font-weight: 600; }
.qr-status-ok { color: var(--color-success); }
.qr-status-todo { color: var(--color-warning-text); }
.qr-flag { display: inline-block; font-size: 0.78rem; padding: 0.1rem 0.5rem; border-radius: 999px; border: 1px solid var(--color-border); margin: 0 0.25rem 0.25rem 0; }
.qr-edit { margin-top: 0.6rem; }
.qr-edit > summary { cursor: pointer; color: var(--color-primary); }
.qr-form { margin-top: 0.6rem; }
.qr-source-form { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: 0.4rem 0 0.6rem; }
.qr-source-form input[type="text"] { width: 14rem; }
.qr-print-note { font-size: 0.8rem; margin: 0.6rem 0 0; }
.ncr-suggest { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: 0 0 0.6rem; padding: 0.5rem 0.7rem; border-radius: 6px; background: var(--color-warning-bg); }
.ncr-suggest input[type="text"] { flex: 1 1 14rem; }
.ncr-disposition-form { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.ncr-disposition-form input[type="text"] { width: 12rem; }
.ncr-new { margin-top: 0.6rem; }
.ncr-new > summary { cursor: pointer; color: var(--color-primary); }
.badge-ncr-open { background: var(--color-warning-bg); color: var(--color-warning-text); }
.badge-ncr-closed { background: var(--color-bg); color: var(--color-text-muted); border: 1px solid var(--color-border); }
.qr-source-form input[type="date"] { width: auto; }

/* ---------- Production runs (Nov 2026) ----------
   Several POs for one part made together: one card and traveler up to
   Final QC (the lead), then each PO on its own. */
.floor-card-run { display: inline-block; margin-left: 0.3rem; padding: 0.05rem 0.4rem; border-radius: 999px; background: #e0ecff; color: #1d4ed8; font-size: 0.72rem; font-weight: 700; vertical-align: 1px; cursor: help; }
.floor-card-run-note { font-size: 0.78rem; margin-bottom: 0.35rem; }
.floor-card-run-hint { display: block; font-size: 0.78rem; margin-bottom: 0.35rem; }
.run-card { margin-bottom: 1.25rem; }
.run-card h3 { margin: 0; font-size: 1rem; }
.run-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.run-card-note { margin: 0.35rem 0 0.75rem; max-width: 70ch; }
.run-card-floor { padding: 0.75rem 1rem; }
.run-lead-tag { display: inline-block; margin-left: 0.3rem; padding: 0.05rem 0.4rem; border-radius: 999px; background: #e0ecff; color: #1d4ed8; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.run-table td.num { font-variant-numeric: tabular-nums; }
.run-table .run-row-this td { background: #f7faff; }
.run-candidates { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.6rem; }
.run-candidate { align-items: flex-start; }
.run-candidate-off { opacity: 0.55; }
.run-accept { font-size: 0.85rem; margin-bottom: 0.6rem; }
.step-run-note { font-size: 0.85rem; }

/* Job charges (Nov 12 2026) - job page card and the invoice notes. */
.charges-card h3 { margin-top: 0; }
.charges-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem 0.75rem; margin-top: 0.75rem; }
.charges-form > div { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.charges-form label { font-size: 0.8rem; font-weight: 600; }
.charges-form input, .charges-form select { margin: 0; }
.charges-form #charge_description { width: 12rem; }
.charges-form #charge_amount { width: 6.5rem; }
.charges-form #charge_item { width: 11rem; }
.charges-form #charge_po_line { width: 5rem; }
.invoice-charges { list-style: none; margin: 0.25rem 0 0; padding: 0; font-size: 0.82rem; }
.invoice-charges li { margin: 0.1rem 0; }

/* Where a subcontractor's price came from (Nov 2026 - quoting.subQuoteStatus):
   green current (6 months or newer), amber 6-12 months, red older, undated
   or with no quote behind it. On the job form under the price boxes, and on
   the job page under each vendor. */
.quote-chip {
  display: inline-block;
  padding: 0 0.45rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.quote-chip-current { background: var(--color-success-bg); color: var(--color-success); }
.quote-chip-aging { background: var(--color-warning-bg); color: var(--color-warning-text); }
.quote-chip-stale,
.quote-chip-none { background: var(--color-danger-bg); color: var(--color-danger); }
.sub-quote-age { font-size: 0.8rem; color: var(--color-text-muted); }
.sub-quote {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.4rem;
  font-size: 0.85rem;
}
.sub-quote ul { list-style: none; margin: 0.2rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.sub-quote li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.sub-quote-newer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
}
.step-sub-quote { margin-top: 0.2rem; font-size: 0.8rem; line-height: 1.6; }
.step-sub-quote .sub-quote-newer { margin-top: 0.25rem; font-size: 0.8rem; }
.sub-quote-form .sub-quote-wide { grid-column: 1 / -1; }
.sub-quote-form .checkbox-label { margin-top: 0.6rem; }
.sub-quote[hidden] { display: none; }

/* AFI jobs (Nov 2026): each process has its Specification beside it, and
   each subcontractor a note (printed on the PO and/or traveler) and a
   need-back-by date. Process + spec stack on a phone. */
/* Nov 23 2026: an AFI process is often a sentence or two, so each one is
   its own panel - the Process box grows to show everything typed, the
   Specification sits underneath it, and the vendor's past processes are
   offered as buttons below the box. */
[data-company-form][data-company="afi"] .finish-row {
  grid-template-columns: minmax(0, 1fr);
  gap: 0.45rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface, #fff);
}
.finish-row-name textarea.afi-process {
  display: block;
  width: 100%;
  min-height: 3.4em;
  resize: vertical;
  line-height: 1.4;
  font: inherit;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  field-sizing: content;
}
.afi-process-picks { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; margin-top: 0.35rem; font-size: 0.78rem; }
.afi-process-picks[hidden] { display: none; }
.afi-process-picks-lead { color: var(--color-text-muted); margin-right: 0.15rem; }
.afi-process-pick {
  max-width: 100%;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-bg, #f5f6f8);
  color: inherit;
  font: inherit;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.afi-process-pick:hover, .afi-process-pick:focus-visible { border-color: var(--color-primary, #2563eb); }
.finish-row-spec input { width: 100%; }
.sub-afi-extras {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 0.75rem;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--color-border);
}
@media (max-width: 600px) { .sub-afi-extras { grid-template-columns: minmax(0, 1fr); } }
.sub-afi-extras label { font-size: 0.8rem; margin: 0 0 0.2rem; }
.sub-afi-extras textarea { width: 100%; }
.sub-afi-note-where { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin-top: 0.3rem; }
.sub-afi-return { display: flex; flex-direction: column; gap: 0.3rem; }
.sub-afi-return input[type="date"] { width: 100%; }
.step-sub-note { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 0.15rem; }
.step-sub-note strong { color: var(--color-text); font-weight: 600; }

/* Parts stock promised to jobs (Nov 2026 - models.partStockPicture): what's
   free under Parts On Hand, and a warning when more is promised than is on
   the shelf. */
.badge-stock-short { background: var(--color-danger-bg); color: var(--color-danger); }
.stock-short-note {
  margin-top: 0.25rem;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  background: var(--color-danger-bg);
  color: var(--color-danger);
  font-size: 0.8rem;
}
.stock-pieces-free { font-size: 0.8rem; }

/* Place Balloons (Nov 19 2026, views/brakeBalloons.js): the bends down the
   side, the print filling the rest; balloons are absolutely positioned in
   percent over the print so they stay put at any window size. */
.balloon-page { display: flex; gap: 1rem; align-items: flex-start; }
.balloon-side { flex: 0 0 17rem; position: sticky; top: 0.5rem; }
.balloon-stage-wrap { flex: 1 1 auto; min-width: 0; padding: 0.5rem; }
.balloon-stage { position: relative; display: block; width: 100%; min-height: 12rem; cursor: crosshair; user-select: none; }
.balloon-print { display: block; width: 100%; height: auto; }
.balloon-loading { padding: 3rem 1rem; text-align: center; }
.balloon { position: absolute; width: 2rem; height: 2rem; margin: -1rem 0 0 -1rem; border-radius: 50%; border: 2px solid #c00; background: rgba(255, 255, 255, 0.92); color: #c00; font: 700 0.95rem/1 system-ui, sans-serif; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); }
.balloon:hover { background: #c00; color: #fff; }
.balloon-help { font-size: 0.85rem; margin: 0 0 0.6rem; }
.balloon-bend-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.balloon-bend { width: 100%; display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0.5rem; border: 1px solid var(--color-border); border-radius: 6px; background: var(--color-surface); color: var(--color-text); text-align: left; cursor: pointer; font: inherit; }
.balloon-bend[aria-pressed="true"] { border-color: var(--color-primary); box-shadow: 0 0 0 2px var(--color-primary); }
.balloon-bend-num { flex: 0 0 1.7rem; height: 1.7rem; border-radius: 50%; border: 2px solid #c00; color: #c00; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; }
.balloon-bend-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.balloon-bend-where { font-weight: 600; font-size: 0.9rem; }
.balloon-bend-vals { font-size: 0.78rem; }
.balloon-bend-count { font-size: 0.78rem; white-space: nowrap; }
.balloon-actions { display: flex; gap: 0.5rem; margin-top: 0.8rem; }
.balloon-status { margin: 0.6rem 0 0; font-size: 0.85rem; }
.balloon-step-picker { margin-bottom: 0.75rem; display: flex; gap: 0.5rem; }
@media (max-width: 800px) {
  .balloon-page { flex-direction: column; }
  .balloon-side { flex: none; position: static; width: 100%; }
}

/* The Lectro title block on the Place Balloons page (Nov 19 2026): a
   stand-in for what the Brake Sheet draws - same spot, same share of the
   print - laid out in container units so it scales with the print. Clicks
   pass through it to the print. */
.balloon-block-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; margin-top: 0.5rem; }
.balloon-block-pick .balloon-block-btn { flex: 1 1 100%; }
.balloon-block-pick [data-block-remove] { margin-left: auto; }
.balloon-block-icon { flex: 0 0 1.7rem; height: 1.1rem; border: 2px solid var(--color-text); border-radius: 2px; }
.balloon-tol-label { display: block; margin: 0.8rem 0 0.3rem; font-size: 0.85rem; font-weight: 600; }
.tol-tables { display: flex; flex-direction: column; gap: 0.5rem; }
.tol-title { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-text-muted); margin-bottom: 0.2rem; }
.tol-row { display: grid; grid-template-columns: minmax(0, 1fr) 2.3rem minmax(0, 1fr); align-items: center; gap: 0.25rem; margin-bottom: 0.25rem; }
.tol-row input { width: 100%; padding: 0.3rem 0.4rem; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.tol-row .tol-place { text-align: right; }
.tol-symbol { text-align: center; font-weight: 600; white-space: nowrap; }
/* Angles: a fixed degree sign after each box. */
.tol-row.tol-row-unit { grid-template-columns: minmax(0, 1fr) 0.6rem 1.6rem minmax(0, 1fr) 0.6rem; }
.tol-unit { font-weight: 600; margin-left: -0.15rem; }
.tol-hint { font-size: 0.75rem; margin: -0.1rem 0 0.3rem; }
.tol-add { margin-top: 0.1rem; }
.tol-add[hidden] { display: none; }
.title-block-preview { position: absolute; container-type: inline-size; pointer-events: none; background: #fff; border: 0.4cqw solid #000; display: grid; grid-template-columns: 42% 8% 33% 17%; grid-template-rows: 52% 48%; color: #000; font-family: system-ui, sans-serif; box-shadow: 0 0 0 1px rgba(204, 0, 0, 0.6); }
.title-block-preview > div { border-right: 0.2cqw solid #000; border-bottom: 0.2cqw solid #000; padding: 1.2cqw 1.6cqw; display: flex; flex-direction: column; overflow: hidden; }
.title-block-preview .tbp-logo { font-weight: 800; font-size: 4.6cqw; line-height: 1.02; justify-content: center; white-space: nowrap; }
.title-block-preview .tbp-label { font-size: 2.6cqw; color: #555; white-space: nowrap; }
.title-block-preview .tbp-pn { font-weight: 700; font-size: 5.2cqw; margin: auto; white-space: nowrap; }
.title-block-preview .tbp-rev { font-weight: 700; font-size: 4.8cqw; margin: auto; }
.title-block-preview > div:nth-child(2) { grid-column: 2 / 4; }
.title-block-preview > div:nth-child(3) { border-right: 0; }
.title-block-preview .tbp-tol { border-bottom: 0; }
.title-block-preview .tbp-tol:nth-child(4) { grid-column: 1 / 3; }
.title-block-preview .tbp-tol:nth-child(5) { grid-column: 3 / 5; border-right: 0; }
.title-block-preview .tbp-tolrow { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1cqw; font-weight: 600; font-size: 3.3cqw; line-height: 1.25; white-space: nowrap; }
.title-block-preview .tbp-place { text-align: right; }
.title-block-preview .tbp-resize { position: absolute; right: -6px; bottom: -6px; width: 12px; height: 12px; background: #fff; border: 2px solid #c00; border-radius: 2px; cursor: nwse-resize; pointer-events: auto; touch-action: none; padding: 0; }
.title-block-preview .tbp-tols { font-weight: 600; font-size: 3.8cqw; margin: auto; white-space: nowrap; }

/* Lectro stock and AFI stock (Nov 24 2026): the small tag that says which
   side of the hardware stock an order, a lot or a count is on. Light gray
   and outlined so it prints in black and white. */
.stock-for { display: inline-block; padding: 0.05rem 0.4rem; margin-left: 0.25rem; font-size: 0.72rem; font-weight: 600; line-height: 1.4; border: 1px solid #c9d2dc; border-radius: 4px; background: #f6f8fa; color: #2b3440; white-space: nowrap; vertical-align: middle; }
.stock-for-afi { background: #eef1f5; border-color: #8a96a3; }
.stock-for-form { margin: 0; }
.stock-for-switch { font-size: 0.78rem; margin-left: 0.3rem; }
.stock-for-switch-form { margin-top: -0.4rem; }
.receive-stock-for { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.receive-stock-for label { margin: 0; font-weight: 600; }
.receive-stock-for select { width: auto; }
.stock-move-form label { margin: 0; }
.stock-move-form select { width: auto; }
.inventory-adjust-form .stock-for { margin-left: 0; margin-right: 0.35rem; min-width: 3.4rem; text-align: center; }
.lot-auto { font-size: 0.82rem; }

/* Ordering: the line under Needs Ordering naming jobs waiting on review,
   whose hardware and metal aren't counted yet (Nov 25 2026). */
.ordering-review-note { margin: 10px 0 0; font-size: 0.9rem; }

/* A routing step with nothing ticked, priced from the part's clock or the
   shop's step rule (Nov 25 2026 - quoting.stepFills). */
.routing-badge-history { background: #dcfce7; color: #166534; }
.routing-badge-step-rule { background: var(--color-warning-bg); color: var(--color-warning-text); }

/* An AFI job's Part Marking step on the job forms (Nov 25 2026): a real
   box for the marking instructions, the ink's lot and date under it. */
.part-marking-details textarea { width: 100%; max-width: 640px; min-height: 5.5rem; }
.part-marking-ink { margin: 0.6rem 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; }
.part-marking-ink label { font-size: 0.85rem; margin: 0; }
.part-marking-ink input[type="text"] { width: 11rem; max-width: 100%; }
.part-marking-ink input[type="date"] { width: 11rem; max-width: 100%; }
/* Precut by vendor (Nov 30 2026) - under a Shear metal line's cut size. */
.metal-precut { display: inline-flex; align-items: center; gap: 0.35rem; margin: 0.15rem 0 0.6rem; font-size: 0.9rem; }
.metal-precut-tag { display: inline-block; margin-left: 0.4rem; padding: 0 0.35rem; border: 1px solid currentColor; border-radius: 3px; font-size: 0.75rem; font-weight: 700; }

/* Ordering, Nov 30 2026: the Outside PO entry form folds behind its button,
   and the RFQ list says how many cancelled / empty requests it left off. */
details.outside-po-new { margin-bottom: 1rem; }
details.outside-po-new > summary { display: inline-block; list-style: none; cursor: pointer; }
details.outside-po-new > summary::-webkit-details-marker { display: none; }
details.outside-po-new[open] > summary { margin-bottom: 0.75rem; }
.rfq-hidden-note { margin: 0.5rem 0 0; font-size: 0.85rem; }

/* Inventory list: the Available column (Nov 30 2026) and the item page's
   folded Remove section. */
.inventory-available-cell { white-space: nowrap; }
.inventory-held { font-size: 0.85em; font-weight: 400; margin-left: 0.25rem; }
.inventory-remove-card { margin-top: 1.5rem; }
.inventory-remove-warning { margin: 0 0 0.75rem; }

/* Price Library search (Nov 30 2026). */
.library-search { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0.75rem 0 1rem; }
.library-search input[type="search"] { flex: 1 1 20rem; max-width: 30rem; }
.library-search-hint { font-size: 0.9em; }
.filter-chip-count { display: inline-block; min-width: 1.4em; padding: 0 0.35em; margin-left: 0.25em; border-radius: 999px; background: var(--color-bg); border: 1px solid var(--color-border); font-size: 0.8em; text-align: center; }
.filter-chip-empty { opacity: 0.6; }
.afi-lot-note { font-size: 0.85em; }

/* Hardware RFQ price breaks (Nov 30 2026): the "Also quote at" boxes on a
   line, and the pick-one rows on Place order. */
.rfq-alt-cell { white-space: nowrap; }
.rfq-lines-table .rfq-alt-input { width: 5.4rem; margin-right: 0.25rem; }
.rfq-alt-row td { border-top: 0; padding-top: 0.15rem; }
.rfq-alt-label { padding-left: 1.5rem !important; }
.rfq-alt-qty { font-variant-numeric: tabular-nums; }
.rfq-pick { display: inline-flex; align-items: center; gap: 0.3rem; font-weight: 400; white-space: nowrap; }
.rfq-alt-summary { font-size: 0.85em; }
.rfq-duplicates { margin: 0.5rem 0 0.75rem; }
.rfq-duplicates .btn { margin-left: 0.5rem; }
/* AFI lot # (Nov 30 2026). */
.afi-lot-form { display: flex; align-items: center; gap: 0.3rem; margin-top: 0.3rem; }
.afi-lot-form input[type="text"] { width: 6.5rem; padding: 0.15rem 0.4rem; font-size: 0.85rem; }
.afi-lot-form label { font-size: 0.8rem; }
.receive-afi-lot-note { margin: 0.25rem 0 0.75rem; }

/* PO requirements (Nov 30 2026): the box on the PO forms and RFQ headers. */
.po-requirements { margin-top: 0.75rem; }
.po-requirements textarea, .rfq-requirements textarea { width: 100%; max-width: 46rem; min-height: 3.2rem; font: inherit; }
.po-requirements-save { margin-top: 0.3rem; font-weight: 400; }
.rfq-header-form .rfq-requirements { flex: 1 1 100%; }

/* ---------- Pack Out page (Dec 2026) ----------
   One row per job waiting to be boxed: part / customer / PO / qty on the
   left, the step's buttons on the right, the boxes underneath. Shaded by
   urgency like the floor cards (light red Rush, light yellow High). */
.packout-howto { margin: -0.25rem 0 1rem; }
.packout-job { margin-bottom: 0.85rem; padding: 0.85rem 1rem; }
.packout-job.packout-job-rush { background: #fde2e2; }
.packout-job.packout-job-high { background: #fdf0c2; }
.packout-job-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.packout-job-title { font-size: 1.15rem; font-weight: 750; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.packout-job-title .badge { font-size: 0.62rem; }
.packout-job-meta { margin-top: 0.15rem; }
.packout-job-lines { font-size: 0.85rem; margin-top: 0.15rem; }
.packout-job-actions { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.packout-job-boxes { margin-top: 0.6rem; border-top: 1px dashed var(--color-border); padding-top: 0.6rem; }

/* Outside POs: Edit folds a form open under the row; a voided one is struck
   through and greyed (Dec 2026). */
.outside-po-actions { white-space: nowrap; vertical-align: top; position: relative; }
.outside-po-actions .outside-po-edit { display: inline-block; }
/* The edit form opens as a panel over the rows below, so the PO's own row
   keeps its shape while it's being corrected. */
.outside-po-actions .outside-po-edit[open] > form { position: absolute; right: 0.5rem; top: 2.4rem; z-index: 20; width: 30rem; max-width: calc(100vw - 2rem); white-space: normal; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 8px; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14); padding: 0.85rem 1rem; text-align: left; }
.outside-po-voided td { color: #8a909a; }
.outside-po-voided td:nth-child(3), .outside-po-voided td:nth-child(5) { text-decoration: line-through; }

/* Ordering: search box and kind chips, and the kind headings inside the
   Needs Ordering table (Dec 2026). */
.ordering-filter-bar { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin: 0.5rem 0 0.75rem; }
.ordering-filter-bar .filter-chips { margin: 0; }
.ordering-search { flex: 0 1 22rem; min-width: 14rem; padding: 0.4rem 0.6rem; }
.ordering-filter-bar-orders { margin-top: 0; }
.ordering-kind-head th { background: var(--color-bg); text-align: left; font-size: 0.8rem; letter-spacing: 0.03em; text-transform: uppercase; color: #4b5563; padding-top: 0.45rem; padding-bottom: 0.45rem; }

/* Waiting on bought parts, folded at the foot of Active (Dec 2026). */
.bought-parts-section { margin-top: 1.5rem; }
.bought-parts-section > summary { cursor: pointer; list-style: none; }
.bought-parts-section > summary::-webkit-details-marker { display: none; }
.bought-parts-section > summary h2 { display: inline-flex; align-items: center; gap: 0.5rem; margin: 0; }
.bought-parts-section > summary h2::before { content: '\25B8'; font-size: 0.85em; }
.bought-parts-section[open] > summary h2::before { content: '\25BE'; }
.bought-parts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 0.75rem; margin-top: 0.75rem; }
.bought-parts-card { border: 1px solid var(--color-border, #d0d4da); border-radius: 6px; padding: 0.6rem 0.75rem; background: var(--color-surface, #fff); }
.bought-parts-job { font-size: 1.05em; }
.bought-parts-lines { list-style: none; margin: 0.4rem 0 0.2rem; padding: 0; }
.bought-parts-lines li { margin: 0.2rem 0; }
/* Don't clip the open outside PO edit panel. */
.table-wrap:has(.outside-po-edit[open]) { overflow: visible; }

/* Same-stock names (Dec 2026) - an item's other names, and the fold preview. */
.same-stock-list { list-style: none; padding: 0; margin: 0 0 0.75rem; display: flex; flex-direction: column; gap: 0.35rem; }
.same-stock-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.6rem; }
.same-stock-list li form { margin: 0; }
.same-stock-preview { border: 1px solid var(--color-border); border-radius: 6px; padding: 0.75rem; margin: 0.5rem 0 0.75rem; background: var(--color-surface-muted, #f7f7f7); }
.same-stock-preview h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.same-stock-table th { width: 9rem; text-align: left; vertical-align: top; }
.flash-inline { display: block; padding: 0.5rem 0.75rem; border-radius: 6px; margin: 0.5rem 0; }
.inventory-also-called { font-size: 0.8rem; }

/* Partial shipments and shipping from stock early (Dec 2026). */
.ship-split-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
}
.ship-partial { margin: 0.5rem 0; }
.ship-partial > summary { cursor: pointer; font-size: 0.85rem; color: var(--color-primary); }
.ship-partial-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; margin-top: 0.4rem; }
.ship-partial-form .field-hint { flex-basis: 100%; }
.ship-short {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  margin: 0 0 0.4rem;
  background: var(--color-warning-bg);
  font-size: 0.85rem;
}
.ship-short legend { font-weight: 700; color: var(--color-warning-text); padding: 0 0.25rem; }
.ship-short-option { display: inline-flex; align-items: center; gap: 0.3rem; }
.ship-short-reason { flex: 1 1 16rem; min-width: 0; }
.ship-send-form:has(.ship-short) { display: block; }
.ship-stock { margin: 0 0 1.5rem; }
.ship-stock h2 { margin-bottom: 0.25rem; }
.ship-stock-sub { font-size: 0.85rem; font-weight: 400; }
.ship-stock-later { margin: 0.35rem 0 0; font-size: 0.85rem; }
.summary-line-stock { font-weight: 600; }
.summary-early-note { margin-top: 0.35rem; font-size: 0.85rem; }
.qty-split-note { font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--color-warning-text); }
.ship-partial-form label { margin: 0; font-weight: 600; font-size: 0.85rem; }
.ship-partial-form input[type="number"] { width: auto; min-width: 0; max-width: 14rem; margin: 0; }
.ship-partial-form input[type="number"] { width: 6rem; }

/* Quantity columns past the fourth (Dec 2026): hidden until a quantity is
   in them or "+ Add quantity" opens them. */
.qty-block[hidden], .quote-qty-table [hidden] { display: none !important; }
.quote-add-qty { margin-top: 0.5rem; }

/* Assemblies (Dec 3 2026) */
.floor-card-parent { font-size: 0.82rem; margin-top: 0.1rem; font-weight: 600; }
.floor-card-parent a { color: var(--color-primary); }
.floor-card-components { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.35rem; margin: 0.35rem 0 0.1rem; font-size: 0.78rem; }
.floor-card-components-head { color: var(--color-text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.68rem; margin-right: 0.2rem; }
.floor-card-component { border: 1px solid var(--color-border); border-radius: 999px; padding: 0 0.45rem; line-height: 1.5; background: var(--color-surface); }
.floor-card-component a { color: inherit; }
.floor-card-component-ready { background: var(--color-success-bg); border-color: transparent; color: var(--color-success); }
.components-card { margin-bottom: 1.25rem; }
.components-body { margin-top: 0.6rem; }
.component-table td.num, .component-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.component-indent { display: inline-block; width: calc(var(--depth, 0) * 1.4rem); }
.component-row-nested td:first-child { color: var(--color-text); }
.component-desc { font-size: 0.78rem; padding-left: calc(var(--depth, 0) * 1.4rem); }
.component-state { display: inline-block; font-size: 0.8rem; padding: 0 0.5rem; border-radius: 999px; line-height: 1.55; background: var(--color-bg); border: 1px solid var(--color-border); }
.component-state-ready { background: var(--color-success-bg); color: var(--color-success); border-color: transparent; }
.component-state-working { background: #e0ecff; color: var(--color-primary-dark); border-color: transparent; }
.component-state-held { background: var(--color-warning-bg); color: var(--color-warning-text); border-color: transparent; }
.components-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.6rem; }
.components-actions .inline-form { margin: 0; }
.component-banner strong { font-weight: 700; }
.assembly-wait { font-weight: 500; }
.live-parent { display: inline-block; font-size: 0.7rem; border: 1px solid var(--color-border); border-radius: 999px; padding: 0 0.4rem; line-height: 1.5; color: var(--color-text-muted); vertical-align: middle; margin-left: 0.2rem; white-space: nowrap; }
.live-assembly { color: var(--color-primary-dark); border-color: var(--color-primary); }
.po-job-component td:first-child .job-tag-component { padding-left: calc(var(--depth, 0) * 1.4rem); }
.job-tag-component { color: var(--color-primary-dark); text-transform: none; letter-spacing: 0; font-weight: 600; }
.component-banner-add { margin-left: 0.5rem; font-weight: 500; white-space: nowrap; }
/* A field set by the assembly on the New Component form: shown, not typed. */
.card-form input[type="text"][readonly] { background: var(--color-bg); color: var(--color-text-muted); cursor: default; }
