:root {
  --history-line: rgba(160, 188, 216, 0.24);
  --history-text: #f7fbff;
  --history-muted: #b3c5d8;
}

body[data-page-id="tenant-payment-history"] {
  background: linear-gradient(180deg, #071421 0%, #0a1826 50%, #0d1721 100%);
  color: var(--history-text);
  min-height: 100vh;
}

body[data-page-id="tenant-payment-history"] *,
body[data-page-id="tenant-payment-history"] *::before,
body[data-page-id="tenant-payment-history"] *::after {
  box-sizing: border-box;
  letter-spacing: 0;
}

body[data-page-id="tenant-payment-history"] [hidden] { display: none !important; }

.tenant-history-shell {
  display: grid;
  gap: 15px;
  margin: 28px auto 52px;
  max-width: 1240px;
  padding: 0 22px;
}

.tenant-history-header {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.tenant-history-header h1 {
  color: var(--history-text);
  font-size: 2.35rem;
  margin: 2px 0 7px;
}

.tenant-history-copy {
  color: var(--history-muted);
  line-height: 1.5;
  margin: 0;
  max-width: 700px;
}

.tenant-history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tenant-history-actions a,
.tenant-history-receipt,
.tenant-history-pagination button {
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--history-line);
  border-radius: 8px;
  color: var(--history-text);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 850;
  justify-content: center;
  min-height: 38px;
  padding: 7px 11px;
  text-decoration: none;
}

.tenant-history-actions a.is-primary {
  background: linear-gradient(135deg, #2fc7a1, #4ba3ff);
  border-color: transparent;
  color: #03101c;
}

.tenant-history-status,
.tenant-history-auth-status {
  color: var(--history-muted);
  font-weight: 750;
  margin: 0;
}

.tenant-history-auth-status {
  margin: 92px auto;
  text-align: center;
}

.tenant-history-status[data-tone="danger"] { color: #ffc3bd; }
.tenant-history-status[data-tone="success"] { color: #b9f8e7; }

.tenant-history-metrics {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tenant-history-metrics article {
  background: rgba(14, 36, 56, 0.86);
  border: 1px solid var(--history-line);
  border-radius: 8px;
  min-width: 0;
  padding: 12px;
}

.tenant-history-metrics span {
  color: var(--history-muted);
  display: block;
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.tenant-history-metrics strong {
  color: var(--history-text);
  display: block;
  font-size: 1.3rem;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.tenant-history-workspace {
  background: linear-gradient(180deg, rgba(16, 40, 63, 0.95), rgba(9, 25, 40, 0.98));
  border: 1px solid var(--history-line);
  border-radius: 8px;
  min-width: 0;
  padding: 16px;
}

.tenant-history-toolbar {
  align-items: flex-end;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.tenant-history-toolbar h2 {
  color: var(--history-text);
  font-size: 1.15rem;
  margin: 0;
}

.tenant-history-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.tenant-history-filters label {
  color: var(--history-muted);
  display: grid;
  font-size: 0.72rem;
  font-weight: 850;
  gap: 5px;
  min-width: 150px;
  text-transform: uppercase;
}

.tenant-history-filters select {
  background: #091a2a;
  border: 1px solid var(--history-line);
  border-radius: 7px;
  color: var(--history-text);
  min-height: 38px;
  padding: 6px 9px;
}

.tenant-history-table-wrap {
  border: 1px solid var(--history-line);
  border-radius: 8px;
  overflow-x: auto;
}

.tenant-history-table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 800px;
  width: 100%;
}

.tenant-history-table th,
.tenant-history-table td {
  border-bottom: 1px solid var(--history-line);
  padding: 11px 12px;
  text-align: left;
}

.tenant-history-table th {
  background: #102d4a;
  color: var(--history-text);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.tenant-history-table td {
  color: #e6eef7;
}

.tenant-history-table td.is-numeric {
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}

.tenant-history-table tbody tr:hover { background: rgba(75, 163, 255, 0.08); }
.tenant-history-table td:last-child { text-align: right; }
.tenant-history-receipt { min-height: 32px; padding: 5px 9px; }
.tenant-history-receipt:hover,
.tenant-history-receipt:focus-visible { background: rgba(75, 163, 255, 0.18); outline: none; }

.tenant-history-empty {
  border: 1px dashed var(--history-line);
  border-radius: 8px;
  color: var(--history-muted);
  margin: 12px 0 0;
  padding: 16px;
  text-align: center;
}

.tenant-history-pagination {
  align-items: center;
  color: var(--history-muted);
  display: flex;
  font-size: 0.8rem;
  font-weight: 750;
  gap: 12px;
  justify-content: space-between;
  margin-top: 12px;
}

.tenant-history-pagination div { display: flex; gap: 8px; }
.tenant-history-pagination button:disabled { cursor: not-allowed; opacity: 0.45; }

@media (max-width: 760px) {
  .tenant-history-shell { margin-top: 20px; padding: 0 12px; }
  .tenant-history-header,
  .tenant-history-toolbar { align-items: stretch; flex-direction: column; }
  .tenant-history-header h1 { font-size: 2rem; }
  .tenant-history-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tenant-history-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tenant-history-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tenant-history-filters label { min-width: 0; }
  .tenant-history-workspace { overflow-x: hidden; }
  .tenant-history-table-wrap { border: 0; overflow: visible; }
  .tenant-history-workspace .tenant-history-table {
    display: block;
    min-width: 0;
    width: 100%;
  }
  .tenant-history-table thead { display: none; }
  .tenant-history-table tbody { display: grid; gap: 10px; }
  .tenant-history-table tr {
    border: 1px solid var(--history-line);
    border-radius: 8px;
    display: grid;
    overflow: hidden;
  }
  .tenant-history-table td {
    align-items: start;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(88px, 0.45fr) minmax(0, 1fr);
    overflow-wrap: anywhere;
    padding: 10px 12px;
  }
  .tenant-history-table td::before {
    color: var(--history-muted);
    content: attr(data-label);
    font-size: 0.68rem;
    font-weight: 850;
    text-transform: uppercase;
  }
  .tenant-history-table td:last-child { border-bottom: 0; text-align: left; }
  .tenant-history-receipt { justify-self: start; }
}

@media (max-width: 430px) {
  .tenant-history-metrics,
  .tenant-history-filters,
  .tenant-history-actions { grid-template-columns: 1fr; }
  .tenant-history-workspace { padding: 12px; }
  .tenant-history-pagination { align-items: stretch; flex-direction: column; }
  .tenant-history-pagination div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
