/* ========================================
   AFFILIATE DASHBOARD STYLES
   ======================================== */

/* FontAwesome icon spacing */
.fas, .far, .fab, .fal, .fad {
  margin-right: 6px;
}

button .fas, button .far {
  margin-right: 4px;
}

.ref-dashboard-container {
  padding: 32px;
  min-height: 100vh;
  width: min(1200px, 100% - 32px);
  margin: 0 auto;
  box-sizing: border-box;
  overflow-x: hidden;
}

@media (min-width: 1320px) {
  .ref-dashboard-container {
    width: min(1320px, 100% - 64px);
  }
}

.ref-dashboard-container.glass {
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
}

/* Header */
.ref-dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.ref-dashboard-header__left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ref-back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: all 0.3s ease;
}

.ref-back-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(139, 92, 246, 0.5);
}

.ref-dashboard-title {
  font-size: 28px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  margin: 0;
}

/* Date Filters */
.ref-date-filters {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ref-date-input {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
}

.ref-date-input:focus {
  outline: none;
  border-color: rgba(139, 92, 246, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

.ref-filter-btn {
  padding: 10px 20px;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  border: none;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.ref-filter-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(139, 92, 246, 0.4);
}

.ref-quick-btn {
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.ref-quick-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(139, 92, 246, 0.5);
}

/* Loading */
.ref-loading {
  text-align: center;
  padding: 60px 20px;
  color: rgba(255, 255, 255, 0.7);
}

.ref-loading__spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: #8b5cf6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Metrics Grid */
.ref-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.ref-metric-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all 0.3s ease;
}

.ref-metric-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(139, 92, 246, 0.3);
  transform: translateY(-4px);
}

.ref-metric-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ref-metric-card__icon--clicks {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.ref-metric-card__icon--conversion {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.ref-metric-card__icon--deposit {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.ref-metric-card__icon--revenue {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* Highlighted metric card (for commission) */
.ref-metric-card--highlight {
  border-color: rgba(16, 185, 129, 0.4);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0.02) 100%);
}

.ref-metric-card--highlight:hover {
  border-color: rgba(16, 185, 129, 0.6);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.15);
}

.ref-metric-card--highlight .ref-metric-card__value {
  color: #10b981;
}

.ref-metric-card__content {
  flex: 1;
}

.ref-metric-card__value {
  font-size: 32px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.2;
  margin-bottom: 4px;
}

.ref-metric-card__label {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
}

.ref-metric-card__subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 4px;
}

.ref-metric-card__trend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.ref-trend-value {
  font-size: 18px;
  font-weight: 600;
  color: #10b981;
}

.ref-trend-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.ref-metric-card__mini {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

.ref-metric-card__mini strong {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.95);
}

.ref-metric-card__dot {
  font-size: 18px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.2);
}

.ref-metric-card__growth {
  margin-top: 8px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.ref-metric-card__chart {
  margin-top: 12px;
  height: 40px;
}

/* Charts Row */
.ref-charts-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.ref-chart-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
}

.ref-chart-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.ref-chart-card__header h3 {
  font-size: 18px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
}

.ref-chart-tabs {
  display: flex;
  gap: 8px;
}

.ref-chart-tab {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.ref-chart-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(139, 92, 246, 0.3);
}

.ref-chart-tab.active {
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(139, 92, 246, 0.5);
  color: rgba(255, 255, 255, 0.95);
}

.ref-tab-value {
  font-weight: 600;
  margin-left: 4px;
}

.ref-chart-card__body {
  position: relative;
  height: 280px;
}

.ref-chart-card__body canvas {
  max-height: 100%;
  width: 100% !important;
  height: 100% !important;
}

.ref-chart-card__body--center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  height: 280px;
}


/* Stats Row */
.ref-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

/* Activity Card */
.ref-activity-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
}

.ref-activity-card__title {
  font-size: 18px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 20px 0;
}

.ref-activity-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ref-activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ref-activity-item__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.ref-activity-item__icon--clicks {
  background: rgba(139, 92, 246, 0.2);
}

.ref-activity-item__icon--deposit {
  background: rgba(59, 130, 246, 0.2);
}

.ref-activity-item__icon--revenue {
  background: rgba(16, 185, 129, 0.2);
}

.ref-activity-item__icon--avg {
  background: rgba(245, 158, 11, 0.2);
}

.ref-activity-item__icon--commission {
  background: rgba(245, 158, 11, 0.2);
}

.ref-activity-item__icon--referral {
  background: rgba(239, 68, 68, 0.2);
}

.ref-activity-item__content {
  flex: 1;
}

.ref-activity-item__label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 6px;
}

.ref-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.ref-progress-bar__fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

.ref-progress-bar__fill--purple {
  background: linear-gradient(90deg, #8b5cf6, #7c3aed);
}

.ref-progress-bar__fill--blue {
  background: linear-gradient(90deg, #3b82f6, #2563eb);
}

.ref-progress-bar__fill--green {
  background: linear-gradient(90deg, #10b981, #059669);
}

.ref-progress-bar__fill--orange {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}

.ref-progress-bar__fill--red {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

.ref-activity-item__value {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
}

/* Growth Card */
.ref-growth-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
  position: relative;
}

.ref-growth-card__header {
  margin-bottom: 20px;
}

.ref-year-select {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
}

.ref-growth-card__body {
  position: relative;
  min-height: 200px;
}

.ref-growth-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.ref-growth-percentage {
  font-size: 42px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1;
}

.ref-growth-text {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 4px;
}

.ref-growth-card__footer {
  text-align: center;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 16px;
}

/* Revenue Card */
.ref-revenue-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
}

.ref-revenue-card__header {
  margin-bottom: 20px;
}

.ref-revenue-card__header h3 {
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 8px 0;
}

.ref-revenue-value {
  font-size: 36px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1;
}

.ref-revenue-change {
  font-size: 14px;
  color: #10b981;
  margin-top: 4px;
}

/* Top Links */
.ref-top-links {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
}

.ref-top-links__title {
  font-size: 18px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 20px 0;
}

.ref-top-links__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.ref-top-link-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  transition: all 0.3s ease;
}

.ref-top-link-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(139, 92, 246, 0.3);
  transform: translateY(-2px);
}

.ref-top-link-item__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.ref-top-link-item__name {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.ref-top-link-item__rank {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: white;
}

.ref-top-link-item__stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.ref-top-link-stat {
  text-align: center;
}

.ref-top-link-stat__value {
  font-size: 18px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
}

.ref-top-link-stat__label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
}

/* Payment History */
.ref-payment-history {
  margin-top: 32px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.ref-payment-history__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.ref-payment-history__title {
  font-size: 20px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ref-payment-history__summary {
  display: flex;
  gap: 24px;
}

.ref-summary-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ref-summary-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.ref-summary-value {
  font-size: 18px;
  font-weight: 600;
}

.ref-summary-value--success {
  color: #10b981;
}

.ref-summary-value--warning {
  color: #f59e0b;
}

.ref-payment-table-container {
  overflow-x: auto;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
}

.ref-payment-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

.ref-payment-table thead {
  background: rgba(255, 255, 255, 0.05);
}

.ref-payment-table th {
  padding: 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ref-payment-table td {
  padding: 16px;
  color: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ref-payment-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.ref-amount {
  font-family: 'Courier New', monospace;
  font-weight: 600;
}

.ref-amount--positive {
  color: #10b981;
}

.ref-amount--negative {
  color: #ef4444;
}

.ref-amount--large {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.95);
}

.ref-percent {
  color: #8b5cf6;
  font-weight: 600;
}

.ref-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.ref-status--paid {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.ref-status--approved {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.ref-status--pending {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.ref-status--cancelled {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.ref-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  margin-left: 8px;
}

.ref-badge--vip {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
}

.ref-text--muted {
  color: rgba(255, 255, 255, 0.3);
}

.ref-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: rgba(255, 255, 255, 0.4);
}

.ref-empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.ref-empty-state p {
  font-size: 16px;
  margin-bottom: 8px;
}

.ref-empty-state small {
  font-size: 12px;
  opacity: 0.6;
}

/* Responsive */
@media (max-width: 1024px) {
  .ref-charts-row {
    grid-template-columns: 1fr;
  }
  
  .ref-stats-row {
    grid-template-columns: 1fr;
  }
  
  .ref-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (max-width: 768px) {
  .ref-dashboard-container {
    padding: 20px 16px;
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    overflow-x: hidden;
    box-sizing: border-box;
  }
  
  .ref-dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
  }
  
  .ref-dashboard-header__left {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .ref-back-btn {
    padding: 8px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }
  
  /* Hide text, show only icon in mobile */
  .ref-back-btn svg {
    margin: 0;
  }
  
  .ref-back-btn__text {
    display: none;
  }
  
  .ref-dashboard-title {
    font-size: 22px;
  }
  
  .ref-date-filters {
    width: 100%;
    gap: 8px;
    flex-wrap: wrap;
  }
  
  .ref-date-input {
    flex: 1;
    min-width: 140px;
  }
  
  .ref-filter-btn {
    width: 100%;
  }
  
  /* Quick buttons horizontal in mobile */
  .ref-date-filters span {
    display: none; /* Hide the dash between dates */
  }
  
  .ref-quick-btn {
    flex: 1;
    min-width: 0;
  }
  
  .ref-metrics-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .ref-metric-card {
    padding: 16px;
  }
  
  .ref-metric-card__icon {
    width: 40px;
    height: 40px;
  }
  
  .ref-metric-card__value {
    font-size: 20px;
  }
  
  .ref-metric-card__label {
    font-size: 11px;
  }
  
  .ref-chart-card {
    padding: 16px;
  }
  
  .ref-chart-card__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .ref-chart-card__header h3 {
    font-size: 17px;
    font-weight: 700;
  }
  
  .ref-chart-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
  }
  
  .ref-chart-tab {
    padding: 10px 12px;
    font-size: 13px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .ref-chart-tab i {
    font-size: 12px;
    margin-right: 6px;
  }
  
  .ref-stats-row {
    gap: 16px;
  }
  
  .ref-activity-card,
  .ref-growth-card,
  .ref-revenue-card {
    padding: 16px;
  }
  
  .ref-activity-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .ref-activity-item__icon {
    width: 36px;
    height: 36px;
  }
  
  .ref-activity-item__content {
    flex: 1;
    width: 100%;
  }
  
  .ref-activity-item__value {
    font-size: 16px;
  }
  
  .ref-top-links {
    padding: 16px;
  }
  
  .ref-top-links__title {
    font-size: 17px;
    margin-bottom: 16px;
  }
  
  .ref-top-link-item {
    padding: 18px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.04));
    backdrop-filter: blur(10px);
  }
  
  .ref-top-link-item__header {
    margin-bottom: 16px;
  }
  
  .ref-top-link-item__name {
    font-size: 16px;
  }
  
  .ref-top-link-item__stats {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .ref-top-link-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
  }
  
  .ref-top-link-stat__label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  
  .ref-top-link-stat__value {
    font-size: 17px;
    font-weight: 700;
  }
}

@media (max-width: 480px) {
  .ref-dashboard-container {
    padding: 16px 12px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
  }
  
  .ref-dashboard-title {
    font-size: 19px;
  }
  
  .ref-back-btn {
    /* Already icon-only from 768px breakpoint */
    padding: 8px;
    width: 40px;
    height: 40px;
  }
  
  .ref-back-btn__text {
    display: none;
  }
  
  .ref-metric-card {
    padding: 14px;
  }
  
  .ref-metric-card__value {
    font-size: 20px;
  }
  
  .ref-metric-card__label {
    font-size: 11px;
  }
  
  .ref-metric-card__icon {
    width: 38px;
    height: 38px;
  }
  
  .ref-chart-card {
    padding: 16px 12px;
  }
  
  .ref-chart-card__header {
    margin-bottom: 16px;
  }
  
  .ref-chart-card__body {
    height: 240px;
  }
  
  .ref-chart-tab {
    padding: 10px 10px;
    font-size: 12px;
  }
  
  .ref-chart-tab i {
    font-size: 11px;
    margin-right: 5px;
  }
  
  .ref-activity-item {
    padding: 12px;
  }
  
  .ref-activity-item__label {
    font-size: 12px;
  }
  
  .ref-activity-item__value {
    font-size: 14px;
  }
  
  .ref-top-link-item {
    padding: 16px;
  }
  
  .ref-top-link-item__name {
    font-size: 15px;
  }
  
  .ref-top-link-stat {
    padding: 9px 10px;
  }
  
  .ref-top-link-stat__label {
    font-size: 11px;
  }
  
  .ref-top-link-stat__value {
    font-size: 16px;
  }
  
  /* Payment History Responsive */
  .ref-payment-history__header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .ref-payment-history__summary {
    width: 100%;
    justify-content: space-between;
  }
  
  .ref-payment-table-container {
    border-radius: 8px;
  }
  
  .ref-payment-table {
    min-width: 100%;
  }
  
  .ref-payment-table thead {
    display: none;
  }
  
  .ref-payment-row {
    display: block;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
  }
  
  .ref-payment-table td {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border: none;
  }
  
  .ref-payment-table td:before {
    content: attr(data-label);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
  }
  
  .ref-status {
    margin-left: auto;
  }
  
  /* Referrals table - mismo estilo que 768px pero más compacto */
  .ref-referrals-table {
    padding: 16px 10px;
  }
  
  .ref-referral-row {
    padding: 12px;
  }
  
  /* More compact mobile styles */
  .ref-referrals-table-grid td {
    padding: 9px 10px;
  }
  
  .mobile-ref-card__user .mobile-ref-label,
  .mobile-ref-stat .mobile-ref-label {
    font-size: 10px;
    letter-spacing: 0.4px;
  }
  
  .mobile-ref-avatar {
    width: 40px;
    height: 40px;
    font-size: 12px;
  }
  
  .mobile-ref-user-info {
    gap: 10px;
  }
  
  .mobile-ref-username {
    font-size: 15px;
  }
  
  .mobile-ref-value {
    font-size: 15px;
  }
}

/* ========================================
   REFSYSTEM PAGE STYLES (Main /refsystem page)
   ======================================== */

/* Hero Actions - 3 Buttons */
.ref-hero__actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.ref-hero__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.ref-hero__btn--copy {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: white;
  flex: 1;
  min-width: 150px;
}

.ref-hero__btn--copy:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(139, 92, 246, 0.3);
}

.ref-hero__btn--links {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
  flex: 1;
  min-width: 180px;
}

.ref-hero__btn--links:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: rgba(59, 130, 246, 0.5);
}

.ref-hero__btn--dashboard {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  flex: 1;
  min-width: 140px;
}

.ref-hero__btn--dashboard:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: rgba(16, 185, 129, 0.5);
}

.ref-hero__btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Spinning animation for loading */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.spinning {
  animation: spin 1s linear infinite;
}

/* Stats Widgets */
.ref-stats-widgets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 32px 0;
}

.ref-stat-widget {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
}

.ref-stat-widget:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.ref-stat-widget__icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ref-stat-widget__icon--green {
  background: linear-gradient(135deg, #10b981, #059669);
}

.ref-stat-widget__icon--blue {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.ref-stat-widget__icon--purple {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.ref-stat-widget__icon svg {
  color: white;
}

.ref-stat-widget__content {
  flex: 1;
}

.ref-stat-widget__label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ref-stat-widget__value {
  font-size: 22px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
}

/* Stat Widget Highlight (for Commission) */
.ref-stat-widget--highlight {
  border: 1px solid rgba(16, 185, 129, 0.3);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0.02) 100%);
}

.ref-stat-widget--highlight .ref-stat-widget__value {
  color: #10b981;
}

/* Stat Widget Value States */
.ref-stat-widget__value--positive {
  color: #10b981;
}

.ref-stat-widget__value--negative {
  color: #f87171;
}

/* Gold Icon (for Total Earned) */
.ref-stat-widget__icon--gold {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* Sub info under value */
.ref-stat-widget__sub {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

.ref-stat-widget__formula {
  font-style: italic;
  color: rgba(16, 185, 129, 0.8);
}

/* Carryover indicator */
.ref-stat-widget__carryover {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}

.ref-stat-widget__carryover--positive {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.ref-stat-widget__carryover--negative {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}

/* Program Header with Dashboard Button */
.ref-program__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.ref-program__title-section {
  flex: 1;
}

.ref-program__dashboard-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.ref-program__dashboard-btn:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: rgba(16, 185, 129, 0.5);
  transform: translateY(-1px);
}

/* Referrals Table (Dashboard) */
.ref-referrals-table {
  margin-top: 32px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.ref-referrals-table__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.ref-referrals-table__title {
  font-size: 20px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ref-referrals-table__count {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
}

.ref-referrals-table__count strong {
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
}

.ref-referrals-table-container {
  overflow-x: auto;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
}

.ref-referrals-table-grid {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

.ref-referrals-table-grid thead {
  background: rgba(255, 255, 255, 0.05);
}

.ref-referrals-table-grid th {
  padding: 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ref-referrals-table-grid td {
  padding: 14px;
  color: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Desktop referrals table hover */
.ref-referral-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.ref-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
  font-weight: 700;
}

.desktop-ref-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ref-referrals-mobile-list {
  display: none;
}

.ref-mobile-card {
  border-radius: 18px;
  padding: 16px 18px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(18px);
  margin-bottom: 16px;
}

.ref-mobile-card__section--user {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.ref-mobile-card__label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.55);
}

.ref-mobile-card__user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ref-mobile-card__avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
}

.ref-mobile-card__username {
  font-size: 17px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
}

.ref-mobile-card__stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ref-mobile-card__stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ref-mobile-card__value {
  font-size: 16px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  text-align: right;
}

.ref-mobile-card__value--positive {
  color: #10b981;
}

.ref-mobile-card__value--negative {
  color: #ef4444;
}

.ref-mobile-card__value--muted {
  color: rgba(255, 255, 255, 0.6);
}

.ref-badge--success {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.ref-badge--pending {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.ref-badge--info {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
  .ref-stats-widgets {
    grid-template-columns: 1fr;
  }
  
  .ref-hero__actions {
    flex-direction: column;
  }
  
  .ref-hero__btn {
    width: 100%;
  }
  
  .ref-program__header {
    flex-direction: column;
  }
  
  .ref-program__dashboard-btn {
    width: 100%;
  }
  
  .ref-referrals-table {
    padding: 16px 12px;
  }
  
  .ref-referrals-table__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 16px;
  }
  
  .ref-referrals-table__title {
    font-size: 18px;
  }
  
  /* HIDE desktop table, SHOW mobile cards */
  .ref-referrals-table-container {
    display: none !important;
  }
  
  .ref-referrals-mobile-list {
    display: block !important;
  }
  
}

/* ========================================
   Table Pagination Controls
   ======================================== */

.table-pagination {
  margin-top: 28px;
}

.history-pagination__status-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.history-pagination__status {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
}

.history-pagination__page-size {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.history-pagination__page-size label {
  font-weight: 500;
  white-space: nowrap;
}

.history-pagination__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.history-pagination__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 120px;
}

.history-pagination__btn:hover:not(.is-disabled) {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.25);
  color: #a78bfa;
}

.history-pagination__btn.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.history-pagination__btn:not(.is-disabled):active {
  transform: scale(0.98);
}

.history-pagination__page-info {
  padding: 12px 20px;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #a78bfa;
  min-width: 120px;
  text-align: center;
}

.page-size-select {
  padding: 10px 36px 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='rgba(255,255,255,0.7)' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px;
}

.page-size-select:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.page-size-select:focus {
  outline: none;
  border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.page-size-select option {
  background: #1a1a2e;
  color: rgba(255, 255, 255, 0.9);
}

@media (max-width: 768px) {
  .table-pagination {
    margin-top: 20px;
    padding: 20px 16px;
    background: rgba(15, 23, 42, 0.55);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
  }
  
  .history-pagination__status-group {
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: 100%;
    margin-bottom: 0;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }
  
  .history-pagination__status {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    order: 1;
  }
  
  .history-pagination__page-size {
    width: 100%;
    justify-content: center;
    gap: 12px;
    padding: 0;
    background: none;
    order: 2;
  }
  
  .history-pagination__page-size label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
  }
  
  .page-size-select {
    min-width: 70px;
    padding: 8px 30px 8px 12px;
    font-size: 13px;
  }
  
  .history-pagination__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    margin-top: 16px;
  }
  
  .history-pagination__btn {
    flex: 1;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 12px;
    min-width: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .history-pagination__page-info {
    flex: 1.2;
    padding: 14px 12px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    color: #a78bfa;
    min-width: 0;
  }
}
