/* Finance > Payments > Payment Details (Fully Applied / Credit Available /
   Draft variants) — reuses Manage Bookings' stat-card body
   (.plx-mb-stat-*) and Booking Ledger's info note (.plx-bl-formula-note). */
.plx-fin-pd-card {
  border-color: var(--border-default);
  margin-bottom: var(--space-4);
  padding: var(--space-4);
}

.plx-fin-pd-heading {
  color: var(--pm-primary);
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  margin: 0 0 var(--space-4);
}

.plx-fin-pd-info-grid {
  display: grid;
  gap: var(--space-4) var(--space-6);
  grid-template-columns: repeat(4, 1fr);
}

.plx-fin-pd-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.plx-fin-pd-label {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.plx-fin-pd-value {
  color: var(--text-primary);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
}

.plx-fin-pd-stat-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(3, 1fr);
}

/* Section cards hold their own border, so the table inside is bordered
   too, with a tinted header row per Figma. */
.plx-fin-pd-table-wrap {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

.plx-fin-pd-table {
  margin: 0;
  width: 100%;
}

/* Base table recipe (same as #plxRoomsTableJs / .plx-bcn-table — properties.css,
   finance-billing-*-generate.css): --bg-thead band, neutral rules, inset
   ::before column dividers in --border-medium. Font sizes and cell padding
   are left to tables.css. */
.plx-fin-pd-table thead th {
  background: var(--bg-thead);
  border-bottom-color: var(--border-default);
  position: relative;
}

.plx-fin-pd-table tbody td {
  border-bottom-color: var(--border-default);
  position: relative;
}

.plx-fin-pd-table thead th:not(:last-child)::before,
.plx-fin-pd-table tbody td:not(:last-child)::before {
  background: var(--border-medium);
  bottom: var(--space-2);
  content: '';
  position: absolute;
  right: 0;
  top: var(--space-2);
  width: 1px;
}

.plx-fin-pd-table tfoot td {
  background: var(--bg-surface-muted);
  border-top: 1px solid var(--border-default);
  padding: var(--space-3);
}

.plx-fin-pd-table .plx-fin-pd-center {
  text-align: center;
}

.plx-fin-pd-table .plx-fin-pd-end {
  text-align: right;
}

.plx-fin-pd-strong {
  font-weight: var(--weight-semibold);
}

.plx-fin-pd-total {
  color: var(--color-info);
  font-weight: var(--weight-bold);
}

.plx-fin-pd-unallocated {
  color: var(--color-danger);
  font-weight: var(--weight-bold);
}

.plx-fin-pd-totals {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding-right: var(--space-4);
}

.plx-fin-pd-totals-row {
  display: flex;
  gap: var(--space-8);
  justify-content: flex-end;
}

.plx-fin-pd-totals-row > :last-child {
  min-width: 80px;
  text-align: right;
}

.plx-fin-pd-footer-bar {
  gap: var(--space-3);
}

@media (max-width: 991.98px) {
  .plx-fin-pd-info-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .plx-fin-pd-stat-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575.98px) {
  .plx-fin-pd-card {
    padding: var(--space-3);
  }

  .plx-fin-pd-info-grid {
    grid-template-columns: 1fr;
  }

  .plx-fin-pd-totals {
    padding-right: 0;
  }

  .plx-fin-pd-totals-row {
    gap: var(--space-4);
  }
}

.plx-fin-pay-stat-sub {
  color: var(--text-muted);
  font-size: var(--text-xs);
}

/* Same stat-card recipe as the Security Deposit pages
   (finance-deposit-details.css): small rounded-square icon box, icon
   centred beside label + value, navy label. */
.plx-fin-pd-stat-grid .plx-mb-stat-card {
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
}

.plx-fin-pd-stat-grid .plx-mb-stat-label {
  color: var(--pm-primary);
  font-weight: var(--weight-medium);
}

.plx-fin-pd-stat-grid .plx-mb-stat-value {
  margin-top: 0;
}

/* Lease/Invoice/Booking ID column is bold + dark in Figma; tables.css's
   .plx-table tbody td (higher specificity) otherwise mutes it. */
.plx-fin-pd-table tbody td.plx-fin-pd-strong {
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}

/* Footer buttons wrap on narrow screens (Draft details has four), so the
   content needs a larger bottom reserve than the standard 96px. */
@media (max-width: 767.98px) {
  .plx-fin-pd-footer-bar {
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-3);
    justify-content: flex-end;
  }

  .plx-page-has-sticky-footer {
    padding-bottom: 140px;
  }
}
