.section-consulta-saldos{
  background: radial-gradient(1100px 480px at 10% -10%, var(--asefh-blue-soft), transparent 60%),
              radial-gradient(900px 420px at 95% 0%, var(--asefh-gold-soft), transparent 60%),
              linear-gradient(180deg, var(--surface), var(--bg));
  padding: 24px 0 48px;
}

.saldos-wrap{
  width: min(1100px, 100%);
  margin: 0 auto;
}

.saldos-header{
  max-width: 860px;
  margin-bottom: 18px;
}

.saldos-header .badge{
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--asefh-blue-dark);
  background: var(--asefh-blue-soft);
  margin-bottom: 10px;
}

.saldos-header h2{
  margin: 0 0 8px 0;
  font-size: clamp(24px, 3vw, 38px);
  color: var(--text);
}

.saldos-header p{
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.saldos-grid{
  display: grid;
  grid-template-columns: .95fr 1.25fr;
  gap: 16px;
  margin-top: 14px;
  align-items: start;
}

.saldos-form-card{
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.saldos-form-card::before{
  content:"";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--asefh-blue-dark), var(--asefh-gold));
}

.saldos-form-top{
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.saldos-form-card .pill{
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 900;
  color: var(--asefh-blue-dark);
  background: rgba(214,162,26,.16);
  border: 1px solid rgba(214,162,26,.28);
}

.saldos-form-title{
  margin: 0 0 6px 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  font-family: inherit;
}

.saldos-form-text{
  margin: 0 0 16px 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 14px;
}

.saldos-fields{
  display: grid;
  gap: 12px;
}

.saldos-field{
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
  background: var(--field-bg);
}

.saldos-field label{
  display: block;
  font-weight: 800;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.saldos-value{
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  word-break: break-word;
}

.saldos-money{
  font-size: clamp(18px, 4.5vw, 22px);
  color: var(--asefh-blue-dark);
}

/* A favor: verde sobrio */
.saldos-field-favor{
  background: linear-gradient(180deg, var(--money-favor-bg), var(--bg));
  border-color: rgba(46, 110, 72, .35);
}

.saldos-money-favor{
  color: var(--money-favor);
}

/* Por pagar: rojo apagado */
.saldos-field-deuda{
  background: linear-gradient(180deg, var(--money-deuda-bg), var(--bg));
  border-color: rgba(140, 64, 64, .35);
}

.saldos-money-deuda{
  color: var(--money-deuda);
}

.saldos-table td.saldos-table-saldo,
.saldos-table td.saldos-table-saldo strong{
  color: var(--money-deuda);
  font-weight: 700;
}

.saldos-sub{
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
}

.saldos-sub strong{
  color: var(--money-favor);
  font-weight: 800;
}

.saldos-details{
  border: 1px solid rgba(140, 64, 64, .35);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--money-deuda-bg), var(--bg));
  overflow: hidden;
}

.saldos-summary{
  list-style: none;
  cursor: pointer;
  display: grid;
  gap: 4px;
  padding: 12px 14px;
}

.saldos-summary::-webkit-details-marker{
  display: none;
}

.saldos-summary-label{
  display: block;
  font-weight: 800;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.saldos-hint{
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.saldos-details[open] .saldos-hint::after{
  content: " (ocultar)";
}

.saldos-detail-body{
  padding: 0 14px 14px;
  border-top: 1px solid var(--border);
}

.saldos-empty{
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.saldos-table{
  width: 100%;
  margin-top: 12px;
  border-collapse: collapse;
  font-size: 13px;
}

.saldos-table th,
.saldos-table td{
  padding: 8px 6px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text);
}

.saldos-plan-fila td{
  padding-top: 0;
  border-bottom: 1px solid var(--border);
}

.saldos-plan{
  margin: 0 0 8px;
}

.saldos-plan summary{
  cursor: pointer;
  font-weight: 800;
  color: var(--text);
  padding: 8px 0;
}

.saldos-plan-tabla{
  min-width: 720px;
  margin-top: 0;
}

.saldos-cuota-pagada td{
  color: var(--muted);
}

.saldos-check{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 2px solid var(--muted);
  border-radius: 4px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.saldos-check-ok{
  background: #15803d;
  border-color: #15803d;
}

.saldos-check-ok::after{
  content: "✓";
}

.saldos-table th{
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 800;
}

.saldos-muted{
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.saldos-prestamo-cell{
  min-width: 140px;
}

.saldos-prestamo-tipo{
  display: block;
  line-height: 1.35;
}

.saldos-prestamo-num{
  display: block;
  margin-top: 4px;
  white-space: nowrap;
}

.saldos-prestamo-fecha{
  margin-left: 6px;
  font-weight: 600;
  color: var(--muted);
}

.saldos-fields-seguimiento{
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  gap: 12px;
}

.saldos-fields-seguimiento > .saldos-form-title{
  margin-top: 0;
  margin-bottom: 8px;
}

.saldos-fields-seguimiento > .saldos-form-text{
  margin-bottom: 12px;
}

.saldos-field-proceso{
  border-color: rgba(11, 61, 145, .28) !important;
  background: linear-gradient(180deg, var(--asefh-blue-soft), var(--bg)) !important;
}

.saldos-proceso-count{
  color: var(--asefh-blue-dark);
  font-size: clamp(16px, 4vw, 20px);
}

.saldos-estado{
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(11, 61, 145, 0.12);
  color: var(--asefh-blue-dark);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

[data-bs-theme="dark"] .saldos-field-proceso{
  border-color: rgba(110, 168, 254, .35) !important;
  background: linear-gradient(180deg, rgba(11, 61, 145, .28), var(--bg)) !important;
}

[data-bs-theme="dark"] .saldos-proceso-count{
  color: #9ec5fe;
}

[data-bs-theme="dark"] .saldos-estado{
  background: rgba(110, 168, 254, 0.18);
  color: #9ec5fe;
}

.section-consulta-saldos .side-card{
  top: 90px;
}

.section-consulta-saldos .side-card h3{
  color: var(--text);
}

@media (max-width: 940px){
  .saldos-grid{
    grid-template-columns: 1fr;
  }

  .saldos-side{
    order: 2;
  }

  .saldos-form-card{
    order: 1;
  }

  .section-consulta-saldos .side-card{
    position: relative;
    top: 0;
  }

  .section-consulta-saldos{
    padding: 12px 0 32px;
  }

  .saldos-header{
    max-width: none;
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
  }

  .saldos-form-card,
  .section-consulta-saldos .side-card{
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    padding: 18px 16px;
    overflow: hidden;
    box-sizing: border-box;
  }

  .saldos-details{
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .saldos-table,
  .saldos-plan-tabla{
    min-width: 0;
    width: 100%;
  }

  .saldos-table th,
  .saldos-table td{
    padding: 8px 4px;
  }

  .saldos-table td:not(:first-child),
  .saldos-table th:not(:first-child){
    white-space: nowrap;
  }

  .section-consulta-saldos .table-responsive{
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

