/* Cuenta corriente / saldo a favor de clientes */
.client-credit-notice {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid rgba(87, 143, 101, .24);
  border-radius: 16px;
  background: #edf6ed;
  color: var(--cocoa);
}
.client-credit-notice[hidden] { display: none; }
.client-credit-notice > span { font-size: 1.45rem; }
.client-credit-notice b, .client-credit-notice small { display: block; }
.client-credit-notice b { margin-bottom: 3px; }
.client-credit-notice strong { color: var(--sage-deep, #52755a); }
.client-credit-notice small { color: var(--muted); line-height: 1.35; }

.client-credit-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  border-color: rgba(87, 143, 101, .22);
  background: linear-gradient(145deg, #f6fbf4, #edf6ed);
}
.client-credit-card-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(255,255,255,.8);
  font-size: 1.55rem;
}
.client-credit-card-main h2 { margin: 2px 0 6px; color: var(--sage-deep, #52755a); }
.client-credit-card-main p:not(.eyebrow) { margin: 0 0 12px; color: var(--muted); line-height: 1.4; }
.client-credit-card-main form { margin: 0; }
.credit-used-line strong, .credit-generated-line strong { color: var(--sage-deep, #52755a); }
.credit-history-lock { width: 32px; text-align: center; opacity: .7; }
.credit-protection-note {
  margin: 8px 0 14px;
  padding: 11px 13px;
  border-radius: 14px;
  background: #f4f0ea;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.35;
}

.client-card.has-client-credit {
  border-color: rgba(87, 143, 101, .25);
  box-shadow: 0 8px 26px rgba(87, 143, 101, .10);
}
.client-credit-badge {
  display: inline-flex;
  width: fit-content;
  margin-top: 7px;
  padding: 6px 9px;
  border-radius: 999px;
  background: #e5f2e5;
  color: var(--sage-deep, #52755a);
  font-size: .72rem;
  font-weight: 900;
}

.client-balance-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}
.client-balance-badges .client-credit-badge { margin-top: 0; }
.client-debt-badge {
  display: inline-flex;
  width: fit-content;
  padding: 6px 9px;
  border-radius: 999px;
  background: #f8e4e4;
  color: #a44747;
  font-size: .72rem;
  font-weight: 900;
}
.client-card.has-client-debt {
  border-color: rgba(164, 71, 71, .25);
  box-shadow: 0 8px 26px rgba(164, 71, 71, .08);
}
.client-net-balance {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: .66rem;
  font-weight: 750;
  line-height: 1.3;
}

.client-account-card { overflow: hidden; }
.client-account-card.has-credit {
  border-color: rgba(87, 143, 101, .24);
  background: linear-gradient(145deg, #fff, #f4faf2);
}
.client-account-balance {
  font-size: 1.35rem;
  color: var(--sage-deep, #52755a);
  white-space: nowrap;
}
.client-credit-history { display: grid; gap: 0; }
.client-credit-history-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 0;
  border-top: 1px solid #f0e8e2;
}
.credit-history-sign {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-weight: 900;
}
.credit-history-sign.is-credit { background: #e6f3e7; color: #477452; }
.credit-history-sign.is-debit { background: #f8e9dd; color: var(--terracotta-deep); }
.client-credit-history-row span:nth-child(2) { min-width: 0; }
.client-credit-history-row b, .client-credit-history-row small, .client-credit-history-row em { display: block; }
.client-credit-history-row small { margin-top: 2px; color: var(--muted); font-size: .68rem; }
.client-credit-history-row em { margin-top: 3px; color: var(--muted); font-size: .68rem; font-style: normal; overflow-wrap: anywhere; }
.client-credit-history-row > strong { white-space: nowrap; font-size: .82rem; }
.client-account-empty { margin: 0; color: var(--muted); font-size: .82rem; }

.kpi-client-credit {
  background: linear-gradient(145deg, #e8f4e7, #f3f8e9);
}
.client-credit-statistics { scroll-margin-top: 84px; }
.credit-total-label { color: var(--sage-deep, #52755a); white-space: nowrap; }
.credit-stat-note { display: block; margin-top: 12px; color: var(--muted); line-height: 1.4; }

@media (max-width: 560px) {
  .client-credit-card { grid-template-columns: 1fr; }
  .client-credit-card-icon { width: 42px; height: 42px; }
  .client-credit-history-row { grid-template-columns: auto minmax(0, 1fr); }
  .client-credit-history-row > strong { grid-column: 2; justify-self: start; }
}
