/* ==========================================
   DASHBOARD IMPROVEMENTS - Enhanced UI/UX
   ========================================== */

/* Dashboard Header */
.dashboard-header {
  margin-bottom: 40px;
  padding: 20px 0;
  border-bottom: 2px solid var(--color-border);
}

.dashboard-header h2 {
  font-size: 32px;
  margin-bottom: 8px;
  font-weight: 700;
  color: var(--color-text);
}

.dashboard-subtitle {
  font-size: 16px;
  color: var(--color-text-secondary);
  margin: 0;
}

/* ==========================================
   STATS SECTION - Modern Card Design
   ========================================== */

.stats-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all 0.3s ease;
  cursor: default;
}

.stat-card:hover {
  border-color: var(--color-text-secondary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}

.stat-card-primary .stat-icon {
  background: #e8f4f8;
  color: #0070f3;
}

.stat-card-warning .stat-icon {
  background: #fef3e2;
  color: #f5a623;
}

.stat-card-info .stat-icon {
  background: #f0f4ff;
  color: #0070f3;
}

.stat-card-success .stat-icon {
  background: #ecfdf5;
  color: #13a538;
}

.stat-content h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin: 0 0 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

/* ==========================================
   SERVICES SECTION - Grid Layout
   ========================================== */

.services-section {
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 40px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 20px 0;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.service-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  transition: all 0.2s ease;
  cursor: default;
}

.service-card:hover {
  border-color: var(--color-text-secondary);
  background: var(--color-surface-secondary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.service-icon {
  font-size: 32px;
  color: #0070f3;
  margin-bottom: 12px;
}

.service-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 6px 0;
}

.service-count {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin: 0;
}

/* ==========================================
   DASHBOARD GRID - Activity & Actions
   ========================================== */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.dashboard-column {
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 24px;
}

.column-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 20px 0;
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 12px;
}

/* ==========================================
   ACTIVITY LIST
   ========================================== */

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: var(--color-surface);
  transition: all 0.2s ease;
}

.activity-item:hover {
  background: var(--color-surface-secondary);
}

.activity-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: #ecfdf5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #13a538;
  font-size: 16px;
}

.activity-content {
  flex: 1;
}

.activity-type {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin: 0 0 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.activity-link {
  font-size: 14px;
  font-weight: 600;
  color: #0070f3;
  text-decoration: none;
  transition: color 0.2s ease;
}

.activity-link:hover {
  text-decoration: underline;
  color: #0058cc;
}

.activity-date {
  font-size: 12px;
  color: var(--color-text-tertiary);
  margin: 4px 0 0 0;
}

/* ==========================================
   QUICK ACTIONS GRID
   ========================================== */

.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--color-text);
  gap: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.action-btn:hover {
  background: var(--color-foreground);
  color: var(--color-background);
  border-color: var(--color-foreground);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.action-btn i {
  font-size: 20px;
}

.action-btn span {
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

/* ==========================================
   REFERRAL SECTION - Enhanced Design
   ========================================== */

.referral-section {
  background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
  border: 2px solid var(--color-border);
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 40px;
}

.referral-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
}

.referral-badge {
  font-size: 32px;
  min-width: 48px;
  height: 48px;
  background: var(--color-surface);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.referral-header h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

.section-subtitle {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin: 4px 0 0 0;
}

/* Referral Link */
.referral-link-container {
  margin-bottom: 28px;
}

.referral-link-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin: 0 0 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.referral-link-box {
  display: flex;
  gap: 8px;
}

.referral-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--color-border-dark);
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  background: var(--color-background);
  color: var(--color-text);
  transition: all 0.2s ease;
}

.referral-input:focus {
  outline: none;
  border-color: var(--color-text);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.copy-btn {
  padding: 12px 16px;
  background: var(--color-foreground);
  color: var(--color-background);
  border: 1px solid var(--color-foreground);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  background: var(--color-background);
  color: var(--color-foreground);
}

/* Referral Stats */
.referral-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.referral-stat {
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  transition: all 0.2s ease;
}

.referral-stat:hover {
  border-color: var(--color-text-secondary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.stat-badge {
  font-size: 24px;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin: 0 0 6px 0;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.stat-num {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

/* Payout Section */
.referral-payout {
  background: var(--color-surface);
  border-radius: 10px;
  padding: 20px;
}

.payout-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.payout-btn {
  padding: 12px 24px;
  background: #13a538;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.payout-btn:hover {
  background: #0d8c2e;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(19, 165, 56, 0.3);
}

.payout-hint {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin: 0;
  text-align: center;
}

/* Payout Threshold */
.payout-threshold {
  padding: 16px;
  background: var(--color-background);
  border-radius: 8px;
  border: 1px solid var(--color-border);
}

.threshold-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin: 0 0 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.threshold-amount {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 12px 0;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--color-border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0070f3, #13a538);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.threshold-text {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin: 0;
  text-align: center;
}

/* Last Payout Info */
.last-payout-info {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
  font-size: 12px;
  color: var(--color-text-secondary);
}

.last-payout-info p {
  margin: 4px 0;
}

.status-badge {
  display: inline-block;
  padding: 2px 8px;
  background: var(--color-success);
  color: white;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}

/* ==========================================
   EMPTY STATES
   ========================================== */

.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--color-text-secondary);
}

.empty-state i {
  font-size: 48px;
  color: var(--color-border-dark);
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 14px;
  margin: 0;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

@media (max-width: 768px) {
  .dashboard-header {
    padding: 16px 0;
  }

  .dashboard-header h2 {
    font-size: 24px;
    margin-bottom: 6px;
  }

  .dashboard-subtitle {
    font-size: 14px;
  }

  .stats-section {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
  }

  .stat-card {
    padding: 16px;
    flex-direction: column;
    text-align: center;
  }

  .stat-icon {
    width: 48px;
    height: 48px;
    font-size: 24px;
  }

  .services-section {
    padding: 20px;
    margin-bottom: 24px;
  }

  .services-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
  }

  .service-card {
    padding: 12px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 24px;
  }

  .dashboard-column {
    padding: 16px;
  }

  .column-title {
    font-size: 16px;
    margin-bottom: 16px;
  }

  .actions-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
  }

  .action-btn {
    padding: 12px 8px;
    font-size: 11px;
  }

  .action-btn i {
    font-size: 18px;
  }

  .referral-section {
    padding: 20px;
  }

  .referral-header {
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
  }

  .referral-link-box {
    flex-direction: column;
  }

  .referral-input {
    font-size: 12px;
  }

  .referral-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
  }

  .stat-num {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .dashboard-header h2 {
    font-size: 20px;
  }

  .stats-section {
    grid-template-columns: 1fr;
  }

  .stat-card {
    flex-direction: row;
    text-align: left;
  }

  .referral-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .actions-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
