/* Purchase order pages. */

.cp-po-lines {
  & .cp-po-number-input {
    max-width: 7rem;
    margin-left: auto;
  }
}

/* The summary cards: a fixed width, wrapping as the page narrows. Wider than
   the prototype's 320px, which left Placed By's label too little room beside
   a role and location.

   Each row's label never wraps; a long value does, against the right edge.
   Without that, the row squeezes whichever side is narrower, and a two-word
   label like Placed By breaks onto two lines. */
.cp-cd-card {
  flex: 0 0 380px;

  & .cp-detail-dl > div > :first-child { white-space: nowrap; }
  & .cp-detail-dl > div > :last-child { text-align: end; }
}

/* The mockup's inline max-width on its date inputs, as a class: the New
   Purchase Order dialog's date and the Expected row's. */
.cp-po-expected-input {
  max-width: 180px;
}

/* The printed purchase order: the invoice's sheet (invoice.css, which has
   the title, figure column and banner it shares with the store order pick
   list) with the blocks the client's legacy PO adds. Ported from the design
   prototype's purchase order sheet rules, renamed to this page's prefix. */
.cp-po-sheet {
  & .cp-po-sheet-from {
    margin-top: .35rem;
    font-style: normal;
    line-height: 1.5;
  }

  & .cp-po-sheet-parties {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2.25rem;
  }

  & .cp-po-sheet-label {
    margin-bottom: .2rem;
    font-weight: 700;
  }

  & .cp-po-sheet-site {
    margin-top: .35rem;
    font-weight: 600;
  }

  & .cp-po-sheet-notes { margin-top: 1.75rem; }
  & .cp-po-sheet-lines { margin-top: 1.75rem; }
}

.cp-po-sheet-terms {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 2rem;
  margin: 1.75rem 0 0;

  & dt {
    display: inline;
    font-weight: 700;
  }

  & dd {
    display: inline;
    margin: 0;
  }
}

/* Eight columns on a 760px sheet: the vendor's code, the size and the unit
   stay on one line and the description takes the wrapping. */
.cp-po-sheet-lines {
  & td:nth-child(1),
  & td:nth-child(3),
  & td:nth-child(4) {
    white-space: nowrap;
  }
}
