/*
 * A disbursed loan's page (assets/platform/js/loan-detail.js): the loan's letters in the
 * header, between the loan's heading and ← Back — the sanction letter, and once the
 * loan is fully repaid the clearance letter under it.
 */
.ld-letter {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  padding: .55rem .7rem;
  border: 1px solid rgba(201, 168, 76, .45);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(201, 168, 76, .1), var(--white, #fff));
  min-width: 0;
}

.ld-letter__row {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-width: 0;
}

.ld-letter__row + .ld-letter__row {
  padding-top: .45rem;
  border-top: 1px dashed rgba(201, 168, 76, .45);
}

.ld-letter__icon {
  font-size: 20px;
  line-height: 1;
}

.ld-letter__text {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12.5px;
  line-height: 1.3;
}

.ld-letter__text strong {
  color: var(--text);
}

.ld-letter__text span {
  font-size: 11px;
  color: var(--muted);
}

.ld-letter__actions {
  display: flex;
  gap: .35rem;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  margin-left: auto;
}

.ld-letter__actions .btn {
  text-decoration: none;
}

/* On its own (staff loan screens), not in a header: a sensible width, with room below. */
.ld-letter--block {
  max-width: 560px;
  margin: 0 0 .85rem;
}

/* Letters in a table cell (Closed Loans, the member profile's Loan tab). */
.loan-letter-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: .3rem;
}

/* The member profile's Loan tab: the letters under the loan's code. */
.loan-code-letters .loan-letter-links {
  margin-top: .3rem;
}

.loan-code-letters .emi-receipt-link {
  padding: .12rem .45rem;
  font-size: 11px;
}

/* Closed Loans: the member and type wrap, so the Letters column fits beside them. */
.closed-loans-table {
  width: 100%;
}

.closed-loans-table td:nth-child(3),
.closed-loans-table td:nth-child(4),
.closed-loans-table th:nth-child(5) {
  white-space: normal !important;
}

.closed-loans-table td:last-child {
  width: 1%;
}

.closed-loans-table .loan-letter-links {
  flex-direction: column;
  align-items: stretch;
  flex-wrap: nowrap;
}

.closed-loans-table .emi-receipt-link {
  padding: .15rem .5rem;
  font-size: 11px;
}

/* Loan Disburse: the confirmation after a payout, with the sanction letter. */
.ld-disbursed {
  margin: 0 0 1rem;
  padding: .75rem .85rem;
  border: 1px solid rgba(5, 150, 105, .35);
  border-radius: 10px;
  background: rgba(5, 150, 105, .06);
}

.ld-disbursed__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  font-size: 13px;
  color: #047857;
}

.ld-disbursed p {
  margin: .25rem 0 .6rem;
  font-size: 12px;
  color: var(--text2);
}

.ld-disbursed .ld-letter--block {
  margin: 0;
  background: var(--white, #fff);
}

.ld-disbursed__close {
  border: 0;
  background: transparent;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: .2rem .35rem;
}

/* Phones: the header is a grid there (mobile-two-col.css); the card takes a row of its
   own under the loan's heading. */
@media (max-width: 899px) {
  #app .closure-member-page > div > .ld-letter {
    grid-column: 1 / -1;
    grid-row: auto;
    margin-top: .55rem;
  }
}

@media (max-width: 420px) {
  .ld-letter__icon {
    display: none;
  }
}
