/* Boss HQ demo: vendors screen styles. Owned by the vendors screen builder; shared classes live in demo.css. */
.vd .vd-top {
  margin-bottom: 14px;
}
.vd .vd-st {
  margin-bottom: 0;
  border-bottom: 1px solid var(--hair);
}
.vd-intro {
  margin: 4px 0 14px;
}
.vd-p {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 8px;
}
.vd-st + .card,
.vd-st + .vd-bulk {
  margin-top: 18px;
}
.vd .card-head .right {
  flex-wrap: wrap;
}
.vd input.mini.vd-q {
  width: 270px;
  min-width: 270px;
  margin-left: auto;
}
.vd-trade {
  width: 140px;
}
.vd-abt {
  display: none;
}
@media (max-width: 768px) {
  .vd-abt {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 44px;
    padding: 0;
    background: none;
    border: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
  }
  .vd-intro .vd-p {
    display: none;
  }
  .vd-intro.open .vd-p {
    display: block;
  }
  .vd-intro {
    margin: 0 0 6px;
  }
}
.vd-c {
  width: 36px;
  padding-right: 0 !important;
}
.vd-n b {
  font-weight: 600;
}
.vd-why {
  max-width: 300px;
  margin-top: 5px;
  line-height: 1.5;
}
.vd-blk {
  margin-top: 3px;
  color: var(--warn);
}
.vd-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 190px;
}
.vd-chip {
  padding: 3px 7px;
  font-size: 11px;
}
.vd-tbl td {
  vertical-align: top;
}
.vd-bulk {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 18px;
  background: var(--info-bg);
  border-bottom: 1px solid var(--hair);
  font-size: 13px;
}
.vd-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.vd-sp {
  flex: 1;
}
.vd-warn {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  margin-bottom: 18px;
  background: var(--warn-bg);
  border: 1px solid var(--hair);
  border-left: 4px solid var(--warn);
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.5;
}
.vd-warn > .ms {
  color: var(--warn);
  margin-top: 1px;
}
.vd-warn > div:first-of-type {
  flex: 1;
  min-width: 0;
}
.vd-warn.info {
  background: var(--info-bg);
  border-left-color: var(--accent);
}
.vd-warn.info > .ms {
  color: var(--info-fg);
}
.vd-wa {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.vd-two {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.vd-kv {
  display: flex;
  gap: 14px;
  padding: 7px 0;
  font-size: 13px;
  align-items: baseline;
}
.vd-kv > span {
  width: 110px;
  flex-shrink: 0;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--muted);
}
.vd-kv > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
.vd-tot {
  margin-top: 12px;
  border-top: 1px solid var(--hair);
}
.vd-tot > div {
  display: flex;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--hair);
  font-size: 13px;
}
.vd-tot > div:last-child {
  border-bottom: 0;
}
.vd-tot b {
  font-family: var(--mono);
  font-weight: 600;
}
.vd-cb {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--hair);
}
.vd-sub td {
  background: var(--sunk);
}
.vd-sub td:first-child {
  padding-left: 28px;
}
.vd-ct > div {
  font-size: 13px;
}
.vd-ct span {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--muted);
  margin-bottom: 3px;
}
.vd-ul {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.7;
}
@media (max-width: 768px) {
  .vd-two {
    grid-template-columns: minmax(0, 1fr);
  }
  .vd input.mini.vd-q {
    width: 100%;
    min-width: 0;
    flex: 1 1 100%;
  }
  .vd-trade {
    flex: 1 1 100%;
    width: 100%;
  }
  .vd-warn {
    flex-wrap: wrap;
  }
  .vd-kv > span {
    width: 90px;
  }
}
.vd-pick {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.vd-pick .ms {
  font-size: 18px;
  color: var(--muted);
}
.field .vd-pick {
  width: 100%;
}
.vd-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}
.vd-pad {
  padding: 12px 18px 0;
  margin: 0 0 10px;
}
.vd-oc {
  cursor: pointer;
  border: 1px solid var(--hair);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  padding: 5px 10px;
}
.vd-oc.on {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}
.vd-ocs {
  max-width: none;
}
.vd .card + .card {
  margin-top: 18px;
}
.vd-two > div > .card + .card {
  margin-top: 18px;
}
@media (max-width: 768px) {
  .vd-pick {
    width: 100%;
  }
  .vd-head .btn {
    flex: 0 0 auto;
  }
}

/* phone: registers are cards (HQ.ui.table cards:true), actions are thumb-size */
@media (max-width: 768px) {
  .vd .tbl-cards tr {
    position: relative;
  }
  /* a cell with nothing in it (no request needed, no added-by on a missing document) drops its label row too */
  .vd .tbl-cards td:empty {
    display: none;
  }
  .vd .tbl-cards td.vd-c {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 44px;
    height: 44px;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    border: 0;
  }
  .vd .tbl-cards td.vd-c::before {
    content: none;
  }
  .vd .tbl-cards td.vd-c input {
    width: 24px;
    height: 24px;
  }
  .vd .tbl-cards td:nth-child(2) {
    display: block;
    text-align: left;
    font-size: 15px;
    font-weight: 600;
    padding: 0 48px 8px 0;
    margin: 0 0 4px;
    border-bottom: 1px solid var(--hair);
  }
  .vd .tbl-cards td:nth-child(2)::before {
    content: none;
  }
  .vd .tbl-cards td.vd-c + td {
    padding-top: 0;
  }
  .vd .tbl-cards td {
    flex-wrap: wrap;
    text-align: right;
  }
  .vd .tbl-cards td:nth-child(4) {
    display: block;
    text-align: left;
  }
  .vd .tbl-cards td:nth-child(4)::before {
    display: block;
    margin-bottom: 3px;
  }
  /* the title-cell and stacked-value rules above are for registry rows only (they carry data-go); detail tables (documents, POs, waivers) keep the shared label-left, value-right row */
  .vd .tbl-cards tr:not([data-go]) td:nth-child(2),
  .vd .tbl-cards tr:not([data-go]) td:nth-child(4) {
    display: flex;
    text-align: right;
    font-size: inherit;
    font-weight: inherit;
    padding: 5px 0;
    margin: 0;
    border-bottom: 0;
  }
  .vd .tbl-cards tr:not([data-go]) td:nth-child(2)::before,
  .vd .tbl-cards tr:not([data-go]) td:nth-child(4)::before {
    content: attr(data-label);
    display: inline;
    margin-bottom: 0;
  }
  .vd .tbl-cards .vd-why {
    max-width: none;
  }
  .vd .tbl-cards .vd-chips {
    max-width: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }
  .vd .tbl-cards .vd-chip {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
  }
  .vd .btn,
  .vd .vd-oc,
  .vd .tabs .tab {
    min-height: 44px;
  }
  .vd .tabs.vd-top .tab,
  .vd .tabs.vd-st .tab {
    min-height: 44px;
  }
  .vd .mini,
  .vd .sel,
  .vd input[type='search'],
  .vd input[type='text'] {
    font-size: 16px;
    min-height: 44px;
  }
  .vd-bulk {
    position: sticky;
    bottom: 76px;
    z-index: 5;
    padding: 10px 14px;
    box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.12);
  }
  /* F19A2: two buttons to a row so the sticky bar stays short and leaves the list in view */
  .vd-bulk b {
    flex: 1 1 0;
  }
  .vd-bulk .btn {
    flex: 1 1 calc(50% - 5px);
    min-height: 44px;
    padding-left: 8px;
    padding-right: 8px;
    order: 2;
  }
  .vd-bulk [data-act='vd-bulk-req'] {
    flex-basis: 100%;
  }
  /* Clear selection sits beside the count on the first row, so it never drops under the tab bar */
  .vd-bulk [data-act='vd-bulk-clear'] {
    flex: 0 0 auto;
    order: 1;
  }
  .vd-kv {
    flex-direction: column;
    gap: 2px;
  }
  .vd-kv > span {
    width: auto;
  }
  .vd-head .btn,
  .vd .card-head .right .btn {
    flex: 1 1 auto;
  }
  .vd .card-head .right {
    width: 100%;
  }
  .vd-cb {
    padding: 12px 14px;
  }
}

/* phone: vdm modals fill the sheet with 16px inputs and thumb-size actions */
@media (max-width: 768px) {
  .modal.vdm {
    max-height: 94vh;
  }
  .modal.vdm .mini,
  .modal.vdm .field input,
  .modal.vdm .field textarea,
  .modal.vdm .sel,
  .modal.vdm input[type='text'],
  .modal.vdm textarea {
    font-size: 16px;
    min-height: 44px;
  }
  .modal.vdm .modal-foot {
    position: sticky;
    bottom: 0;
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }
  .modal.vdm .modal-foot .btn,
  .modal.vdm .modal-head .btn {
    min-height: 44px;
    min-width: 44px;
  }
  .modal.vdm .modal-foot {
    flex-wrap: wrap;
  }
  .modal.vdm .modal-foot .btn {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
    white-space: normal;
  }
  .modal.vdm input[type='checkbox'] {
    width: 22px;
    height: 22px;
  }
  .modal.vdm .modal-body {
    -webkit-overflow-scrolling: touch;
  }
}
@media (max-width: 768px) {
  .vd .tbl-cards tr[data-go^='#/vendors/'] {
    display: flex;
    flex-direction: column;
  }
  .vd .tbl-cards tr[data-go^='#/vendors/'] > td:nth-child(2) {
    order: -3;
  }
  .vd .tbl-cards tr[data-go^='#/vendors/'] > td:nth-child(4) {
    order: -2;
  }
  .vd .tbl-cards tr[data-go^='#/vendors/'] > td:nth-child(7) {
    order: -1;
    font-weight: 600;
  }
  .vd .tbl-cards tr[data-go^='#/vendors/'] {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 42%);
    column-gap: 10px;
    align-items: start;
  }
  .vd .tbl-cards tr[data-go^='#/vendors/'] > td {
    order: 0;
    padding: 2px 0;
    text-align: left;
    justify-content: flex-start;
  }
  .vd .tbl-cards tr[data-go^='#/vendors/'] > td::before {
    content: none;
    display: none;
  }
  .vd .tbl-cards tr[data-go^='#/vendors/'] > td:nth-child(2) {
    grid-column: 1;
    grid-row: 1;
    border-bottom: 0;
    margin: 0;
    padding-bottom: 2px;
  }
  .vd .tbl-cards tr[data-go^='#/vendors/'] > td:nth-child(3) {
    grid-column: 1;
    grid-row: 2;
    flex-wrap: wrap;
    gap: 4px;
  }
  .vd .tbl-cards tr[data-go^='#/vendors/'] > td:nth-child(5) {
    grid-column: 1;
    grid-row: 3;
  }
  .vd .tbl-cards tr[data-go^='#/vendors/'] > td:nth-child(4) {
    grid-column: 2;
    grid-row: 2;
    justify-content: flex-end;
    text-align: right;
  }
  .vd .tbl-cards tr[data-go^='#/vendors/'] > td:nth-child(7) {
    grid-column: 2;
    grid-row: 3;
    justify-content: flex-end;
    text-align: right;
    width: auto;
  }
  /* the real phone card shows name, contact, trades, status, document chips and the committed amount only (app.js:53682-53695) */
  .vd .tbl-cards tr[data-go^='#/vendors/'] > td[data-label='Jobs'],
  .vd .tbl-cards tr[data-go^='#/vendors/'] > td[data-label='Open invoices'],
  .vd .tbl-cards tr[data-go^='#/vendors/'] > td[data-label='Paid YTD'] {
    display: none;
  }
}

/* Upload certificate drop zone (connection pass B1) */
.vd-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 22px 14px;
  margin-bottom: 12px;
  text-align: center;
  cursor: pointer;
  min-height: 44px;
  border: 2px dashed var(--line, #c9c9c9);
  border-radius: 12px;
  position: relative;
}
.vd-drop.on {
  border-color: var(--accent, #2b6cb0);
  background: rgba(43, 108, 176, 0.08);
}
.vd-drop .vd-file {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 16px;
}
.vd-drop .ms {
  font-size: 28px;
}
@media (max-width: 768px) {
  .vd-sortbar {
    display: flex;
    margin: 8px 12px;
  }
  .vd-sortbar .sel {
    min-height: 44px;
    flex: 1;
  }
}
@media (min-width: 769px) {
  .vd-sortbar {
    display: none;
  }
}

@media (max-width: 768px) {
  .vd .tbl-cards td.vd-c input {
    appearance: none;
    -webkit-appearance: none;
    width: 44px;
    height: 44px;
    margin: 0;
    background: none;
    border: 0;
    cursor: pointer;
  }
  .vd .tbl-cards td.vd-c input::before {
    content: '';
    display: block;
    width: 22px;
    height: 22px;
    margin: 11px;
    border: 2px solid var(--faint);
    border-radius: 5px;
    box-sizing: border-box;
  }
  .vd .tbl-cards td.vd-c input:checked::before {
    background: var(--ok);
    border-color: var(--ok);
  }
}

.vd-sortbar {
  gap: 10px;
  align-items: center;
}

@media (pointer: coarse) and (min-width: 769px) {
  .vd td.vd-c input {
    appearance: none;
    -webkit-appearance: none;
    width: 44px;
    height: 44px;
    margin: 0;
    background: none;
    border: 0;
    cursor: pointer;
  }
  .vd td.vd-c input::before {
    content: '';
    display: block;
    width: 22px;
    height: 22px;
    margin: 11px;
    border: 2px solid var(--faint);
    border-radius: 5px;
    box-sizing: border-box;
  }
  .vd td.vd-c input:checked::before {
    background: var(--ok);
    border-color: var(--ok);
  }
}
/* F14D2: on phones the top bar already names the vendor or merchant, so the page heading is not repeated under it */
@media (max-width: 768px) {
  .vd .vd-head .vd-title {
    display: none;
  }
}
