/* Areas, the floor's racks through a tank group, loads and samples (views/floor.js, board.js, loads.js, customers.js, quotes.js,
   portal.js). The older floor and load rules (step panel, load items, unit steps) stay in app.css. */

/* Customers › Parts: All · Samples · Needs rebuild (n) · Needs pay (n). */
.list-chips { margin: 0 0 12px; }

/* A quote line's part cell: the Sample badge under the part. */
.quote-sample { display: inline-block; margin-top: 4px; }
.quote-sample[hidden] { display: none; }

/* Shop floor: the area this terminal works in, in the page head. */
.floor-area { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.floor-area select { min-width: 180px; max-width: 100%; }
.area-note { margin: 0 0 10px; padding: 8px 12px; border-left: 3px solid var(--warn); background: var(--warn-soft); color: var(--text); border-radius: var(--radius-sm); }

/* Work in <Area>: one row per step holding pieces; a row opens the step on this screen. */
.area-work { display: grid; }
.area-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; width: 100%; min-height: 52px; padding: 8px 16px; border: 0;
  border-top: 1px solid var(--border); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.area-row:first-child { border-top: 0; }
.area-row:hover, .area-row:focus-visible { background: var(--surface-2); }
.area-main { grid-column: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.area-step { grid-column: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.area-qty { grid-column: 2; grid-row: 1; text-align: right; color: var(--text-2); white-space: nowrap; }
.area-due { grid-column: 2; grid-row: 2; text-align: right; white-space: nowrap; }

/* Complete load (a tank group's rack) and a group step's Complete: a row per plating tank, the other tanks behind a disclosure. */
.st-runs { display: grid; gap: 8px; margin-bottom: 4px; }
.st-run { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.st-what { min-width: 0; overflow-wrap: anywhere; }
.st-inputs { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.st-inputs .field { flex: 0 1 120px; min-width: 96px; }
.st-inputs .field[hidden] { display: none; }
.st-inputs .st-more { height: 36px; }
.st-dwell { margin: 0 0 12px; }
.st-dwell > summary { cursor: pointer; font-weight: 600; padding: 6px 0; color: var(--link); }
.st-dwell[open] > summary { margin-bottom: 6px; }

/* A tank group load's stations on the load page, before Complete. */
.load-stations { margin: 0 0 12px; padding-left: 22px; } .load-stations li { padding: 2px 0; }

/* A load's area and amps (floor load card, Complete load, a step's amps): "1.83 ft² on this load (2 jobs)", then the amps per stage. */
.load-amps { display: grid; gap: 2px; margin: 0 0 10px; padding: 8px 10px; border: 1px solid var(--border); border-left: 3px solid var(--link); border-radius: var(--radius-sm);
  background: var(--surface); font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.load-amps .la-area { font-size: 15px; } .load-amps b { font-weight: 700; }
.la-why { color: var(--warn); font-size: 13px; } .la-none { color: var(--warn); }
.step-amps { margin-top: 6px; font-size: 16px; line-height: 1.45; overflow-wrap: anywhere; } .step-amps.small { font-size: 13px; } .step-amps.muted b { color: var(--text); }
.unit-steps .sub.step-amps { font-size: 13px; color: var(--text); }
.in-load { margin: 0 0 4px; overflow-wrap: anywhere; } .in-load + .in-load { margin-top: 2px; }
.load-links { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; } .load-links svg { width: 13px; height: 13px; vertical-align: -2px; }
/* Loads list on a phone: the status sits under the load number (its own column drops out). */
.ld-ph { display: none; }
/* Load page: the jobs table takes the wider column. Up to 1400px wide (a laptop, a phone) the part and step sit under the job number and
   the rejects under the status, and the customer, part, operation and rejects columns drop out: pieces, ft², share and status stay in view. */
@media (min-width: 861px) { .grid.ld-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }
.ld-md { display: none; }
@media (max-width: 1400px) {
  #ld-jobs th[data-key="customer_name"], #ld-jobs th[data-key="part_number"], #ld-jobs th[data-key="op_name"], #ld-jobs th[data-key="qty_reject"], #ld-jobs td.ld-wide { display: none; }
  #ld-jobs .ld-md { display: block; margin-top: 2px; }
}

/* The printable load sheet (#/loads/:id/sheet): a page per rack, Letter or A4. */
.ls-paper { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); } .ls-paper select { height: 32px; }
.doc.load-sheet .ls-jobs tfoot td { border-top: 2px solid #000; } .doc.load-sheet .ls-total { font-weight: 700; }
.doc.load-sheet .ls-note { margin: 6px 0 0; font-size: 10px; }
.doc.load-sheet .ls-amps td { vertical-align: middle; } .doc.load-sheet .ls-amps td.fill, .doc.load-sheet .ls-run td { height: .4in; }
.doc.load-sheet .ls-write { width: 13%; } .doc.load-sheet .ls-init { width: 7%; }
.doc.load-sheet .ls-run td { vertical-align: top; width: 14%; } .doc.load-sheet .ls-notes td { height: .7in; }
.doc.load-sheet table { break-inside: avoid; page-break-inside: avoid; } .doc.load-sheet tr { break-inside: avoid; page-break-inside: avoid; }
@media print { body .doc.load-sheet { font-size: 11px; padding: 0; overflow: visible; } } /* a printed page is under 860px wide: keep the phone padding off */

@media (max-width: 600px) {
  .ld-ph { display: block; margin-top: 2px; }
  .doc.load-sheet { padding: 12px; overflow-x: visible; } .doc.load-sheet .ls-opt { display: none; }
  .doc.load-sheet .ls-fields, .doc.load-sheet .ls-fields tbody, .doc.load-sheet .ls-fields tr { display: flex; flex-wrap: wrap; width: 100%; }
  .doc.load-sheet .ls-fields td { flex: 1 1 40%; min-width: 0; overflow-wrap: anywhere; }
  .doc.load-sheet .ls-run, .doc.load-sheet .ls-run tbody, .doc.load-sheet .ls-run tr { display: flex; flex-wrap: wrap; width: 100%; } .doc.load-sheet .ls-run thead { display: none; }
  .doc.load-sheet .ls-run td { flex: 1 1 30%; width: auto; }
  .doc.load-sheet .ls-amps th, .doc.load-sheet .ls-amps td { padding: 3px; font-size: 10px; }
  .floor-area { width: 100%; } .floor-area select { flex: 1; min-width: 0; }
  .st-inputs .field { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .st-inputs .field input { width: 100%; }
  .area-row { padding: 10px 12px; }
}

/* Portal › Samples: on a phone the Sample column carries the status, quotes and jobs (the other columns are hidden there). */
.ps-phone { display: none; }
.ps-sub { margin-top: 6px; } .ps-sub .label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; color: var(--text-3); }
@media (max-width: 600px) { .ps-phone { display: block; margin-top: 6px; } }
