.partners-account-page {
  --dashboard-gap: 0;
}

.account-content {
  display: grid;
  gap: 0;
  min-height: 100%;
}

.account-shell.is-loading .account-section,
.account-shell.is-loading .account-page-status {
  display: none;
}

.account-shell.is-loading .account-loading-state {
  display: grid;
}

.account-section--overview {
  padding-top: 0;
}

.account-section + .account-section {
  padding-top: 0;
  border-top: 0;
}

.account-page-status {
  margin-bottom: 16px;
}

.overview-grid,
.account-metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.overview-actions {
  gap: 8px;
}

.account-form {
  margin-top: 0;
}

.partner-form > button {
  justify-self: start;
  width: auto;
}

.settings-actions,
.checkout-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

#account-color-status {
  margin-top: 8px;
}

.credit-package-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  width: 100%;
  margin: 0;
}

.credit-package-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "badge price"
    "title price"
    "copy period";
  column-gap: var(--space-4);
  row-gap: 4px;
  align-items: start;
  min-height: 112px;
  padding: var(--space-5) var(--space-6);
  border: 0;
  border-bottom: 1px solid var(--partner-divider);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 120ms ease, box-shadow 120ms ease;
}

.credit-package-card:nth-child(even) {
  border-left: 1px solid var(--partner-divider);
}

.credit-package-card:hover,
.credit-package-card:focus-visible {
  transform: none;
  background: var(--partner-surface-subtle);
  box-shadow: none;
}

.credit-package-card:focus-visible {
  position: relative;
  z-index: 1;
  outline: 2px solid var(--app-focus);
  outline-offset: -2px;
}

.credit-package-card.is-active {
  background: color-mix(in srgb, var(--partner-accent-soft) 78%, var(--partner-surface));
  box-shadow: inset 3px 0 0 var(--partner-accent);
}

.credit-package-badge {
  grid-area: badge;
  width: fit-content;
  min-width: 0;
  height: 20px;
  padding: 1px 8px;
  border: 0;
  border-radius: 10px;
  background: var(--partner-surface-subtle);
  color: var(--color-champagne-strong);
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.credit-package-card strong {
  grid-area: title;
  color: var(--partner-text);
  font-size: 16px;
  font-weight: 700;
  line-height: 22px;
  letter-spacing: -0.02em;
}

.credit-package-copy {
  grid-area: copy;
  color: var(--partner-text-secondary);
  font-size: 13px;
  line-height: 18px;
}

.credit-package-price {
  grid-area: price;
  justify-self: end;
  color: var(--partner-accent-strong);
  font-size: 16px;
  font-weight: 750;
  line-height: 22px;
  white-space: nowrap;
}

.credit-package-period {
  grid-area: period;
  align-self: end;
  justify-self: end;
  color: var(--partner-text-muted);
  font-size: 12px;
  line-height: 16px;
  white-space: nowrap;
}

.credits-section-form {
  padding-top: var(--space-5);
}

.devices-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.devices-page-size {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--partner-text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.devices-page-size select {
  width: 72px;
}

.payments-table-wrap {
  width: 100%;
  margin: 0;
  overflow-x: auto;
  border: 0;
  border-top: 1px solid var(--partner-divider);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.payments-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.payments-table th,
.payments-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--partner-divider-soft);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.payments-table tbody tr {
  transition: background-color 120ms ease;
}

.payments-table tbody tr:hover {
  background: var(--partner-surface-subtle);
}

.payments-table th {
  background: transparent;
  color: var(--partner-text-muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.payments-table td {
  color: var(--partner-text);
  font-size: 14px;
  line-height: 20px;
}

#devices-section .payments-table th:nth-child(1),
#devices-section .payments-table td:nth-child(1) {
  width: 28%;
}

#devices-section .payments-table th:nth-child(2),
#devices-section .payments-table td:nth-child(2) {
  width: 18%;
}

.payments-empty,
.device-meta {
  color: var(--partner-text-muted);
}

.device-label {
  margin-bottom: 2px;
  font-weight: 700;
}

.device-meta {
  font-size: 12px;
  line-height: 18px;
}

.payment-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--partner-surface-subtle);
  color: var(--partner-text-secondary);
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  text-transform: capitalize;
}

.devices-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
  margin-top: 16px;
}

.devices-page-button {
  min-width: 88px;
}

.devices-page-indicator {
  color: var(--partner-text-muted);
  font-size: 12px;
  line-height: 16px;
}

.devices-page-button:disabled,
.checkout-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 1120px) {
  .overview-grid,
  .account-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-grid .info-card:nth-child(odd),
  .account-metric-grid .info-card:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }
}

@media (max-width: 760px) {
  .credit-package-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .credit-package-card:nth-child(even) {
    border-left: 0;
  }

  .devices-pagination {
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .overview-grid,
  .account-metric-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .partner-form > button {
    width: 100%;
  }

  .credit-package-price,
  .credit-package-period {
    justify-self: start;
  }
}
