/* Boss HQ demo: purchase orders and change orders. Shared classes live in demo.css. */
.pc-vcell {
  display: block;
  min-width: 0;
  text-align: left;
}
.pc-cannot {
  color: var(--risk);
  font-size: 11.5px;
  margin-top: 2px;
}
.pc-strip {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid var(--warn);
  border-radius: 4px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 12.5px;
}
.pc-stat {
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
.pc-comp {
  margin: 4px 0 14px;
}
.pc-lbl {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
}
.pc-comp-box {
  border: 1px solid var(--hair);
  border-radius: 4px;
  padding: 10px 12px;
  background: var(--sunk);
  display: grid;
  gap: 6px;
}
.pc-comp-h {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.pc-comp-f {
  border-top: 1px solid var(--hair);
  padding-top: 6px;
}
.pc-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.pc-tabs {
  margin-bottom: 12px;
}
.pc-err {
  color: var(--risk);
  font-size: 12.5px;
  margin: 6px 0;
}
.pc-paper {
  border: 1px solid var(--hair);
  background: var(--card);
  padding: 16px;
  border-radius: 4px;
  display: grid;
  gap: 8px;
}
.pc-paper-h {
  display: flex;
  justify-content: space-between;
  letter-spacing: 0.1em;
}
.pc-paper-t {
  text-align: right;
  font-weight: 600;
}
.pc-kvs {
  margin-bottom: 14px;
}
.pc-kv {
  display: flex;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--hair);
  align-items: flex-start;
}
.pc-k {
  flex: 0 0 130px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding-top: 3px;
}
.pc-v {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.pc-v textarea {
  width: 100%;
}
.pc-mail {
  display: block;
  white-space: pre-wrap;
  background: var(--sunk);
  border: 1px solid var(--hair);
  border-radius: 4px;
  padding: 10px;
  margin-top: 10px;
  font-size: 12px;
  max-height: 180px;
  overflow: auto;
}
.pc-note {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}
.pc-dec {
  color: var(--muted);
  margin-top: 3px;
}
.pc-tog {
  display: inline-flex;
  border: 1px solid var(--input);
  border-radius: 4px;
  overflow: hidden;
}
.pc-tog button {
  padding: 6px 14px;
  background: transparent;
  border: 0;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}
.pc-tog button.on {
  background: var(--accent);
  color: var(--on-accent);
}
.pc-tog button:disabled {
  color: var(--faint);
  cursor: not-allowed;
}
.pc-chk {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}
@media (max-width: 640px) {
  .pc-two {
    grid-template-columns: 1fr;
  }
  .pc-kv {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }
  .pc-k {
    flex: none;
  }
}
.pc-read {
  display: grid;
  gap: 4px;
  justify-items: start;
  margin: -4px 0 14px;
}
.pc-linked {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--hair);
  font-size: 12.5px;
}
.pc-linkpick {
  margin: 8px 0 14px;
}
.pc-sline {
  display: grid;
  grid-template-columns: 1fr 80px auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

/* phone: PO and CO registers are cards, forms fill the sheet */
@media (max-width: 768px) {
  .pc-stat {
    min-height: 44px;
    padding: 0 14px;
    font-size: 13px;
  }
  .pc-strip {
    font-size: 13px;
  }
  .pc-tog button {
    min-height: 44px;
    padding: 0 18px;
  }
  .pc-chk {
    min-height: 44px;
  }
  .pc-chk input {
    width: 22px;
    height: 22px;
  }
  .pc-sline {
    grid-template-columns: minmax(0, 1fr) 80px auto;
  }
  .pc-linked {
    min-height: 44px;
  }
  .pc-mail {
    max-height: 140px;
  }
  .pc-paper-h {
    flex-direction: column;
    gap: 4px;
  }
  .pc-k {
    padding-top: 0;
  }
  .pc-v textarea,
  .pc-v input {
    font-size: 16px;
  }
  .tbl-cards .pc-stat {
    margin-left: auto;
  }
  .tbl-cards .pc-cannot {
    text-align: left;
    margin-top: 4px;
  }
}
@media (max-width: 768px) {
  .card-head .right [data-act^='pc-'],
  .card-head .right [data-go='#/documents'] {
    min-height: 44px;
  }
  .pop.sheet .pop-row[data-act^='pc-'] {
    min-height: 48px;
    font-size: 15px;
  }
  .modal .mini[data-inp='cf-typed'] {
    font-size: 16px;
    min-height: 44px;
  }
}

/* phone: pcm modals fill the sheet with 16px inputs and thumb-size actions */
@media (max-width: 768px) {
  .modal.pcm {
    max-height: 94vh;
  }
  .modal.pcm .mini,
  .modal.pcm .field input,
  .modal.pcm .field textarea,
  .modal.pcm .sel,
  .modal.pcm input[type='text'],
  .modal.pcm textarea {
    font-size: 16px;
    min-height: 44px;
  }
  .modal.pcm .modal-foot {
    position: sticky;
    bottom: 0;
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }
  .modal.pcm .modal-foot .btn,
  .modal.pcm .modal-head .btn {
    min-height: 44px;
    min-width: 44px;
  }
  .modal.pcm .modal-foot {
    flex-wrap: wrap;
  }
  .modal.pcm .modal-foot .btn {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
    white-space: normal;
  }
  .modal.pcm input[type='checkbox'] {
    width: 22px;
    height: 22px;
  }
  .modal.pcm .modal-body {
    -webkit-overflow-scrolling: touch;
  }
}
@media (max-width: 768px) {
  .tbl-cards tr[data-act^='pc-'] {
    display: flex;
    flex-direction: column;
  }
  .tbl-cards tr[data-act^='pc-'] > td:first-child {
    order: -3;
  }
  .tbl-cards tr[data-act^='pc-'] > td[data-label='Amount'] {
    order: -2;
    font-size: 17px;
    font-weight: 600;
  }
  .tbl-cards tr[data-act^='pc-'] > td[data-label='Status'] {
    order: -1;
  }
  /* compact phone rows, as the real app's two-line list: number and amount, then status, with the sheet holding the rest */
  .tbl-cards tr[data-act^='pc-'] > td[data-label='Added by'],
  .tbl-cards tr[data-act^='pc-'] > td[data-label='Source'],
  .tbl-cards tr[data-act^='pc-'] > td[data-label='Days'],
  .tbl-cards tr[data-act^='pc-'] > td[data-label='Issued'] {
    display: none;
  }
  .tbl-cards tr[data-act^='pc-'] {
    padding: 8px 12px;
  }
  .tbl-cards tr[data-act^='pc-'] > td {
    padding: 2px 0;
  }
}

.pc-id,
.pc td:first-child b {
  white-space: nowrap;
}
