* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f3f4f6;
  color: #1f2937;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  padding: 16px 0;
  margin-bottom: 32px;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

header h1 {
  font-size: 1.5rem;
  color: #2563eb;
}

nav {
  display: flex;
  gap: 20px;
}

nav a {
  text-decoration: none;
  color: #4b5563;
  transition: color 0.2s;
}

nav a:hover {
  color: #2563eb;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-primary {
  background: #2563eb;
  color: white;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-secondary {
  background: #9ca3af;
  color: white;
}

.btn-secondary:hover {
  background: #6b7280;
}

.btn-success {
  background: #10b981;
  color: white;
}

.btn-success:hover {
  background: #059669;
}

.btn-danger {
  background: #ef4444;
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin: 24px 0;
}

.product-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.product-card h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.product-card p {
  color: #6b7280;
  margin-bottom: 16px;
}

.product-price {
  font-size: 1.5rem;
  font-weight: bold;
  color: #10b981;
  margin-bottom: 16px;
}

.product-card .btn {
  width: 100%;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-card h3 {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 2rem;
  font-weight: bold;
  color: #2563eb;
}

/* Cards */
.card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.card h3 {
  margin-bottom: 16px;
  font-size: 1.25rem;
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
}

.form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.form-row input {
  flex: 1;
  min-width: 150px;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
}

/* Auth Container */
.auth-container {
  max-width: 400px;
  margin: 40px auto;
  background: white;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.auth-container h2 {
  margin-bottom: 24px;
  text-align: center;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

th {
  background: #f9fafb;
  font-weight: 600;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 1px solid #e5e7eb;
}

.tab-btn {
  padding: 10px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  transition: all 0.2s;
}

.tab-btn.active {
  color: #2563eb;
  border-bottom: 2px solid #2563eb;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Referral Box */
.referral-box {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.referral-box input {
  flex: 1;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #f9fafb;
}

/* Message */
.message {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.message.success {
  background: #d1fae5;
  color: #065f46;
}

.message.error {
  background: #fee2e2;
  color: #991b1b;
}

.message.hidden {
  display: none;
}

/* Info Note */
.info-note {
  background: #dbeafe;
  border-left: 4px solid #2563eb;
  padding: 16px;
  border-radius: 8px;
  margin: 32px 0;
}

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

/* Text utilities */
.text-center {
  text-align: center;
  margin-top: 16px;
}

/* Footer */
footer {
  background: white;
  margin-top: 48px;
  padding: 24px 0;
  text-align: center;
  color: #6b7280;
  border-top: 1px solid #e5e7eb;
}

/* Responsive */
@media (max-width: 768px) {
  .products-grid {
    grid-template-columns: 1fr;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .referral-box {
    flex-direction: column;
  }
  
  table {
    font-size: 12px;
  }
  
  th, td {
    padding: 8px;
  }
}

/* Data Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.data-table th {
  background: #f9fafb;
  font-weight: 600;
}

/* Submissions Table */
.submissions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.submissions-table th,
.submissions-table td {
  padding: 10px;
  text-align: left;
  border: 1px solid #e5e7eb;
}

.submissions-table th {
  background: #f3f4f6;
  font-weight: 600;
}

.transaction-id {
  font-family: monospace;
  font-size: 12px;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.status-pending {
  background: #fef3c7;
  color: #92400e;
}

.status-paid {
  background: #d1fae5;
  color: #065f46;
}

.status-rejected {
  background: #fee2e2;
  color: #991b1b;
}

/* Buttons */
.btn-sm {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
}

.btn-success {
  background: #10b981;
  color: white;
}

.btn-danger {
  background: #ef4444;
  color: white;
}

/* Error Message */
.error-message {
  background: #fee2e2;
  border-left: 4px solid #ef4444;
  padding: 16px;
  border-radius: 8px;
  margin: 16px 0;
}

.error-message ul {
  margin: 8px 0 0 20px;
}

/* Form Controls */
.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  color: white;
  text-align: center;
  padding: 48px 24px;
  border-radius: 16px;
  margin-bottom: 40px;
}

.hero h2 {
  font-size: 2rem;
  margin-bottom: 12px;
}

.hero p {
  font-size: 1.2rem;
  opacity: 0.9;
}

/* Product Icons */
.product-icon {
  font-size: 48px;
  text-align: center;
  margin-bottom: 12px;
}

/* Product Commission Badge */
.product-commission {
  font-size: 12px;
  color: #10b981;
  text-align: center;
  margin: 8px 0;
  font-weight: 500;
}

/* Info Card */
.info-card {
  background: white;
  border-radius: 16px;
  padding: 32px;
  margin: 40px 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.info-card h3 {
  text-align: center;
  margin-bottom: 24px;
  font-size: 1.5rem;
}

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  text-align: center;
}

.step {
  text-align: center;
}

.step-number {
  width: 40px;
  height: 40px;
  background: #2563eb;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: bold;
  margin: 0 auto 12px;
}

/* Level Badges */
.level-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

.level-1 {
  background: #d1fae5;
  color: #065f46;
}

.level-2 {
  background: #dbeafe;
  color: #1e40af;
}

/* User Name in Dashboard */
.user-name {
  font-size: 1.2rem;
  color: #2563eb;
  font-weight: 600;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h2 {
    font-size: 1.5rem;
  }
  
  .steps {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}