/**
 * VPM — shared data table layout and alignment
 */

.vpm-table {
  table-layout: fixed;
}

.vpm-table th,
.vpm-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.vpm-table thead th.num,
.vpm-table th.num {
  text-align: right;
}

.vpm-table td.vpm-num,
.vpm-table td.num,
.vpm-table th.num,
.vpm-table td.vpm-num.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.vpm-table th.vpm-table__actions,
.vpm-table td.vpm-table__actions {
  width: 7.5rem;
  min-width: 7.5rem;
  max-width: 7.5rem;
  text-align: right;
  white-space: nowrap;
}

.vpm-col-action {
  width: 7.5rem;
}

.vpm-col-num {
  width: 9rem;
}

.vpm-col-date {
  width: 11rem;
}

.vpm-col-status {
  width: 8.5rem;
}

/* Expandable rows inside tables */
.vpm-table-expand-cell {
  padding: 0 !important;
  border-bottom: 1px solid var(--vpm-border);
}

.vpm-table .vpm-wallet-row {
  width: 100%;
}

.vpm-table .vpm-wallet-row > summary {
  display: grid;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 12px 16px;
  list-style: none;
  cursor: pointer;
  border-radius: 0;
}

.vpm-table--layout-6 .vpm-wallet-row > summary {
  grid-template-columns:
    minmax(0, 1.2fr)
    minmax(0, 1.5fr)
    9rem
    8.5rem
    11rem
    7.5rem;
}

.vpm-table--layout-7 .vpm-wallet-row > summary {
  grid-template-columns:
    minmax(0, 1.5fr)
    9rem
    9rem
    9rem
    9rem
    8.5rem
    7.5rem;
}

.vpm-table--layout-wallets .vpm-wallet-row > summary {
  grid-template-columns:
    minmax(0, 1.1fr)
    minmax(0, 0.75fr)
    minmax(0, 0.85fr)
    minmax(0, 1.6fr)
    8.5rem
    7.5rem;
}

.vpm-table-summary__cell {
  min-width: 0;
  padding-right: 12px;
}

.vpm-table-summary__cell--num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.vpm-table-summary__cell--truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vpm-table-summary__cell--action {
  padding-right: 0;
}

.vpm-table .vpm-wallet-row > summary::after {
  grid-column: -1;
  justify-self: end;
  padding-right: 0;
}

.vpm-table .vpm-wallet-row[open] > summary {
  margin-bottom: 0;
  background: var(--vpm-surface-elevated);
}

.vpm-table .vpm-wallet-form,
.vpm-table .vpm-inline-expand-form {
  padding: 0 16px 16px;
}

/* Tables inside collapsible read sections — align with section edges */
.vpm-read-section__body > .vpm-table-wrap {
  margin-inline: calc(-1 * var(--vpm-space-3));
}

.vpm-read-section__body > .vpm-table-wrap .vpm-table th:first-child,
.vpm-read-section__body > .vpm-table-wrap .vpm-table td:first-child,
.vpm-read-section__body > .vpm-table-wrap .vpm-table .vpm-wallet-row > summary {
  padding-left: var(--vpm-space-3);
}

.vpm-read-section__body > .vpm-table-wrap .vpm-table th:last-child,
.vpm-read-section__body > .vpm-table-wrap .vpm-table td:last-child,
.vpm-read-section__body > .vpm-table-wrap .vpm-table .vpm-wallet-row > summary {
  padding-right: var(--vpm-space-3);
}

@media (min-width: 768px) {
  .vpm-read-section__body > .vpm-table-wrap {
    margin-inline: calc(-1 * var(--vpm-space-4));
  }

  .vpm-read-section__body > .vpm-table-wrap .vpm-table th:first-child,
  .vpm-read-section__body > .vpm-table-wrap .vpm-table td:first-child,
  .vpm-read-section__body > .vpm-table-wrap .vpm-table .vpm-wallet-row > summary {
    padding-left: var(--vpm-space-4);
  }

  .vpm-read-section__body > .vpm-table-wrap .vpm-table th:last-child,
  .vpm-read-section__body > .vpm-table-wrap .vpm-table td:last-child,
  .vpm-read-section__body > .vpm-table-wrap .vpm-table .vpm-wallet-row > summary {
    padding-right: var(--vpm-space-4);
  }
}

.vpm-deposit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
