.cashback-ledger-container {
  padding: 20px;

  // ── Toolbar ──────────────────────────────────────────────────────────────────
  .ledger-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;

    h3 {
      margin: 0;
      font-size: 18px;
      color: #212121;
    }

    .btn-refresh {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 7px 14px;
      border: 1px solid #bdbdbd;
      border-radius: 4px;
      background: #fff;
      cursor: pointer;
      font-size: 13px;
      transition: background 0.15s;

      &:hover:not(:disabled) { background: #f5f5f5; }
      &:disabled { opacity: 0.5; cursor: not-allowed; }

      .spinning {
        display: inline-block;
        animation: spin 0.7s linear infinite;
      }
    }
  }

  // ── Layout ───────────────────────────────────────────────────────────────────
  .ledger-layout {
    display: flex;
    gap: 16px;

    .ledger-grid-panel {
      flex: 1;
      min-width: 0;
      position: relative;
    }

    .ledger-detail-panel {
      width: 320px;
      flex-shrink: 0;
      background: #fff;
      border: 1px solid #e0e0e0;
      border-radius: 6px;
      padding: 16px;
      height: fit-content;
    }
  }

  // ── Loading overlay ───────────────────────────────────────────────────────────
  .loading-overlay {
    display: flex;
    justify-content: center;
    padding: 32px;
  }

  .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); }
  }

  // ── Table ─────────────────────────────────────────────────────────────────────
  .ledger-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);

    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 {
      cursor: pointer;
      transition: background 0.1s;
    }

    tr:hover { background: #f5f5f5; }
    tr.selected { background: #e3f2fd; }
  }

  // ── Status badges ─────────────────────────────────────────────────────────────
  .status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
  }

  .status--amber { background: #fff8e1; color: #f57f17; }
  .status--green { background: #e8f5e9; color: #2e7d32; }
  .status--blue  { background: #e3f2fd; color: #1565c0; }
  .status--red   { background: #ffebee; color: #c62828; }
  .status--grey  { background: #f5f5f5; color: #616161; }

  // ── Pagination ────────────────────────────────────────────────────────────────
  .pagination-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 12px 0;
    border-top: 1px solid #f5f5f5;
    font-size: 13px;

    .btn-page {
      padding: 5px 12px;
      border: 1px solid #bdbdbd;
      border-radius: 4px;
      background: #fff;
      cursor: pointer;

      &:disabled { opacity: 0.4; cursor: not-allowed; }
      &:hover:not(:disabled) { background: #f5f5f5; }
    }
  }

  // ── Detail panel ──────────────────────────────────────────────────────────────
  .detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;

    h4 { margin: 0; font-size: 15px; }

    .btn-close {
      background: none;
      border: none;
      cursor: pointer;
      color: #757575;
      font-size: 16px;
      &:hover { color: #212121; }
    }
  }

  .detail-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .detail-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 13px;

    .field-label {
      font-size: 11px;
      color: #9e9e9e;
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }

    .failure-reason {
      color: #c62828;
      font-size: 12px;
    }
  }

  .bg-job-notice {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    background: #e8f5e9;
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 12px;
    color: #2e7d32;
    margin-top: 16px;
  }

  // ── Empty state ───────────────────────────────────────────────────────────────
  .empty-state {
    text-align: center;
    padding: 40px;
    color: #9e9e9e;
    background: #fff;
    border-radius: 6px;
    font-size: 14px;
  }

  // ── RTL ───────────────────────────────────────────────────────────────────────
  [dir="rtl"] & {
    .ledger-toolbar { flex-direction: row-reverse; }
    .ledger-layout { flex-direction: row-reverse; }
    .ledger-table th,
    .ledger-table td { text-align: right; }
    .detail-header { flex-direction: row-reverse; }
    .pagination-bar { flex-direction: row-reverse; }
    .bg-job-notice { flex-direction: row-reverse; }
  }
}
