.portal-tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--color-border); margin: 0 0 32px; }
.portal-tabs button { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 52px; padding: 12px 2px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--color-muted); font-size: 13px; }
.portal-tabs button[aria-selected="true"] { color: var(--color-text); border-bottom-color: var(--color-lavender); }
.portal-tabs button[aria-selected="true"] .icon { color: var(--color-lavender); }
.portal-tabs button:hover { color: var(--color-text); }
.portal-tabs .icon { width: 17px; height: 17px; }
.history-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.history-heading h2 { font-size: 25px; }
.history-heading p { font-size: 13px; color: var(--color-muted); margin-top: 12px; }
.history-unit { font-size: 11px; color: var(--color-muted); padding-top: 6px; white-space: nowrap; }
.history-filters { display: grid; grid-template-columns: 190px 210px minmax(180px, 1fr); gap: 20px; align-items: end; }
.history-field { min-width: 0; }
.history-field label { display: block; font-size: 12px; margin-bottom: 9px; }
.history-field select, .history-field input { min-height: 48px; width: 100%; border: 1px solid #766384; border-radius: 10px; color: var(--color-text); background: #201c26; padding: 10px 12px; font-size: 13px; }
.history-field select { cursor: pointer; padding-right: 24px; }
.history-field input::placeholder { color: #aaa0b4; opacity: 1; }
.history-search { grid-column: 3; }
#payment-state-field[hidden] + .history-search { grid-column: 2 / -1; }
.history-results-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 20px 0 12px; min-height: 36px; }
.history-results-bar p { font-size: 12px; color: var(--color-muted); }
.history-reset { background: transparent; border: 0; padding: 8px 0 8px 12px; min-height: 36px; font-size: 11px; color: var(--color-lavender); text-decoration: underline; text-underline-offset: 4px; }
.history-table-container { border: 1px solid #49404f; border-radius: 16px; overflow: hidden; background: #1d1b20; }
.history-table { width: 100%; border-collapse: collapse; text-align: left; table-layout: fixed; }
.history-table thead { background: #241f2b; }
.history-table th, .history-table td { padding: 24px 12px; font-size: 12px; font-weight: 400; vertical-align: middle; overflow-wrap: anywhere; }
.history-table thead th { padding-top: 15px; padding-bottom: 15px; color: var(--color-muted); font-size: 10px; }
.history-table thead th:first-child { width: 23%; }
.history-table thead th:nth-child(2) { width: 19%; }
.history-table thead th:nth-child(3) { width: 15%; }
.history-table thead th:nth-child(4) { width: 14%; }
.history-table thead th:nth-child(5) { width: 14%; }
.history-table thead th:nth-child(6) { width: 15%; }
.history-table th:first-child { padding-left: 24px; }
.history-table td:last-child { padding-right: 20px; }
.history-table tbody tr { border-top: 1px solid var(--color-border); }
.record-id { display: block; color: var(--color-lavender); font-size: 10px; margin-bottom: 6px; }
.record-name { font-size: 13px; }
.history-table td > span, .history-table td time { font-variant-numeric: tabular-nums; }
.history-table small { display: block; font-size: 10px; color: var(--color-muted); margin-top: 6px; }
.history-amount { font-size: 14px; }
.history-rate { color: var(--color-lavender); }
.history-table time { font-size: 11px; color: var(--color-muted); }
.loan-state { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 6px; font-size: 10px; white-space: nowrap; }
.state-al-dia { color: #dbc6ff; background: #34284a; }
.state-en-retraso { color: #f4cd8a; background: #3b3022; }
.state-pagado { color: #dfdbe6; background: #303035; }
.state-sin-firma { color: var(--color-muted); border: 1px solid #554963; }
.history-help { color: var(--color-muted); font-size: 11px; line-height: 1.7; margin-top: 18px; max-width: 80ch; }
.history-empty { padding: 48px 24px; border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); text-align: center; }
.history-empty > .icon { width: 28px; height: 28px; color: var(--color-lavender); }
.history-empty h3 { font-size: 22px; margin-top: 18px; }
.history-empty p { font-size: 13px; color: var(--color-muted); margin: 12px auto 24px; max-width: 440px; }
.history-empty .button { font-size: 12px; }
@media (max-width: 1200px) {
  .history-filters { grid-template-columns: 170px 190px minmax(160px, 1fr); gap: 16px; }
  .history-table th, .history-table td { padding-left: 10px; padding-right: 10px; }
  .history-table th:first-child { padding-left: 18px; }
  .history-table td:last-child { padding-right: 14px; }
}
@media (max-width: 1100px) {
  .history-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .history-search { grid-column: 1 / -1; }
  .history-table, .history-table tbody { display: block; }
  .history-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  .history-table tbody tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 18px; padding: 22px; }
  .history-table tbody tr:first-child { border-top: 0; }
  .history-table th, .history-table td, .history-table th:first-child, .history-table td:last-child { display: block; padding: 0; }
  .history-table th[scope="row"] { grid-column: 1 / 3; grid-row: 1; }
  .history-table td:last-child { grid-column: 3; grid-row: 1; text-align: right; align-self: center; }
  .history-table td::before { content: attr(data-label); display: block; font-size: 10px; color: var(--color-muted); margin-bottom: 8px; }
  .history-table td:last-child::before { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  .record-name { font-size: 14px; }
}
@media (max-width: 700px) {
  .portal-tabs { gap: 24px; margin-bottom: 28px; }
  .portal-tabs button { font-size: 12px; gap: 7px; }
  .history-heading { flex-direction: column; gap: 10px; margin-bottom: 22px; }
  .history-heading h2 { font-size: 24px; }
  .history-heading p { font-size: 12px; line-height: 1.7; }
  .history-unit { font-size: 10px; padding-top: 0; }
  .history-filters { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .history-search { grid-column: auto; }
  #payment-state-field[hidden] + .history-search { grid-column: auto; }
  .history-field label { font-size: 11px; }
  .history-field select, .history-field input { font-size: 16px; }
  .history-table tbody tr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 20px 18px; gap: 22px 14px; }
  .history-table th[scope="row"] { grid-column: 1; }
  .history-table td:last-child { grid-column: 2; }
  .history-amount { font-size: 16px; }
  .history-results-bar p, .history-reset { font-size: 11px; }
  .history-help { font-size: 10px; }
  .history-empty { padding: 32px 18px; }
}


.response-hint { display: inline-flex; align-items: baseline; gap: 6px; max-width: 100%; margin-top: 8px; color: var(--color-muted); font-size: 10px; line-height: 1.5; text-align: left; overflow-wrap: normal; }
.response-hint::before { content: ""; flex: 0 0 4px; width: 4px; height: 4px; border-radius: 50%; background: var(--color-lavender); transform: translateY(-2px); }
