.loyalty-balance-page {
  padding: 20px;

  // ── Balance summary card ──────────────────────────────────────────
  .balance-summary-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
  }

  .expiry-alert {
    background: #fff8e1;
    border-left: 4px solid #ffca28;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    color: #e65100;
    margin-bottom: 16px;
  }

  .balance-summary-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
  }

  .balance-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 120px;

    .stat-value {
      font-size: 24px;
      font-weight: 700;
      color: #1976d2;

      &.tier-name   { text-transform: uppercase; font-size: 18px; }
      &.expiry-soon { color: #e65100; }
    }

    .stat-label {
      font-size: 12px;
      color: #757575;
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }
  }

  // ── Ledger ───────────────────────────────────────────────────────
  .ledger-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;

    h4 { margin: 0 0 16px; font-size: 16px; color: #212121; }
  }

  .expiring-notice {
    background: #fff3e0;
    border: 1px solid #ffcc80;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 13px;
    color: #e65100;
    margin-bottom: 12px;
  }

  .ledger-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;

    th,
    td {
      padding: 10px 12px;
      text-align: left;
      border-bottom: 1px solid #f5f5f5;
    }

    th {
      background: #f8f9fa;
      color: #616161;
      font-weight: 600;
      font-size: 12px;
    }

    tr:hover { background: #fafafa; }

    .positive    { color: #2e7d32; font-weight: 600; }
    .negative    { color: #c62828; font-weight: 600; }
    .expiry-soon { color: #e65100; font-weight: 600; }
  }

  .entry-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;

    &.entry--earn    { background: #e8f5e9; color: #2e7d32; }
    &.entry--redeem  { background: #e3f2fd; color: #1565c0; }
    &.entry--expire  { background: #ffebee; color: #c62828; }
    &.entry--adjust  { background: #fff8e1; color: #f57f17; }
    &.entry--refund  { background: #f3e5f5; color: #6a1b9a; }
    &.entry--default { background: #f5f5f5; color: #616161; }
  }

  // ── Pagination ───────────────────────────────────────────────────
  .pagination-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #f5f5f5;

    .btn-page {
      padding: 6px 14px;
      border: 1px solid #bdbdbd;
      border-radius: 4px;
      background: #fff;
      cursor: pointer;
      font-size: 13px;

      &:disabled           { opacity: 0.4; cursor: not-allowed; }
      &:hover:not(:disabled) { background: #f5f5f5; }
    }

    .page-number { font-size: 14px; color: #424242; font-weight: 500; }
  }

  // ── Spinner ──────────────────────────────────────────────────────
  .loading-state,
  .ledger-loading {
    display: flex;
    justify-content: center;
    padding: 24px;
  }

  .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e0e0e0;
    border-top-color: #1976d2;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
  }

  @keyframes spin {
    to { transform: rotate(360deg); }
  }

  // ── Empty state ──────────────────────────────────────────────────
  .empty-state {
    text-align: center;
    padding: 32px;
    color: #9e9e9e;
    font-size: 14px;
  }

  // ── RTL ──────────────────────────────────────────────────────────
  [dir='rtl'] & {
    .expiry-alert { border-left: none; border-right: 4px solid #ffca28; }

    .ledger-table th,
    .ledger-table td { text-align: right; }

    .pagination-bar { flex-direction: row-reverse; }
  }
}
