/* ============================================================
   SPLIIIT AFFILIATE PLATFORM — Design System
   Based on app.spliiit.com visual identity
   Font: Roboto | Brand: #131313 | Gradient: teal→purple→pink
   ============================================================ */

:root {
  /* Brand */
  --brand-black:   #131313;
  --brand-white:   #FFFFFF;
  --brand-teal:    #53DBE7;
  --brand-purple:  #432786;
  --brand-pink:    #FF438B;
  --brand-gold:    #CF8845;
  --brand-violet:  #7B61FF;

  /* Functional */
  --success:  #10B981;
  --warning:  #F59E0B;
  --danger:   #EF4444;

  /* Neutrals */
  --gray-50:  #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #C8CCD4;
  --gray-500: #6B7280;
  --gray-700: #374151;
  --gray-900: #131313;

  /* Gradients */
  --gradient-hero: linear-gradient(90deg, #53DBE7, #432786, #FF438B);
}

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

body {
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--gray-50);
  color: var(--brand-black);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ================================================================
   AUTH PAGES
   ================================================================ */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  position: relative;
  overflow: hidden;
}

.auth-page::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--gradient-hero);
}

.auth-page::after {
  content: '';
  position: absolute;
  width: 700px; height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(83,219,231,0.05) 0%, transparent 70%);
  top: -300px; right: -200px;
  pointer-events: none;
}

.auth-card {
  background: white;
  border-radius: 16px;
  padding: 44px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.08);
  border: 2px solid var(--gray-100);
  position: relative;
  z-index: 1;
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo h1 {
  font-size: 28px;
  font-weight: 900;
  color: var(--brand-black);
  letter-spacing: -0.5px;
}

.auth-logo .gradient-tag {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 14px;
  border-radius: 1000px;
  background: var(--gray-100);
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.auth-logo p {
  color: var(--gray-500);
  font-size: 14px;
  margin-top: 8px;
}

.auth-tabs {
  display: flex;
  background: var(--gray-100);
  border-radius: 1000px;
  padding: 4px;
  margin-bottom: 28px;
}

.auth-tab {
  flex: 1;
  text-align: center;
  padding: 10px 16px;
  border-radius: 1000px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  transition: all 0.2s;
  color: var(--gray-500);
}

.auth-tab.active {
  background: var(--brand-black);
  color: white;
}

/* ================================================================
   FORMS
   ================================================================ */

.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-black);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--gray-200);
  border-radius: 10px;
  font-size: 14px;
  font-family: 'Roboto', sans-serif;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  background: white;
  color: var(--brand-black);
}

.form-input:focus {
  border-color: var(--brand-black);
  box-shadow: 0 0 0 3px rgba(19,19,19,0.07);
}

.form-input.error { border-color: var(--danger); }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-500);
  margin: 24px 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gray-100);
}

/* ================================================================
   BUTTONS
   ================================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 1000px;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Roboto', sans-serif;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--brand-black);
  color: white;
  width: 100%;
}

.btn-primary:hover {
  background: #2A2A2A;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(19,19,19,0.2);
}

.btn-outline {
  background: transparent;
  color: var(--brand-black);
  border: 2px solid var(--gray-200);
}

.btn-outline:hover {
  border-color: var(--brand-black);
  background: var(--gray-100);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16,185,129,0.3);
}

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #DC2626; }

.btn-sm  { padding: 8px 16px; font-size: 13px; }
.btn-xs  { padding: 5px 12px; font-size: 12px; border-radius: 1000px; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ================================================================
   APP LAYOUT & SIDEBAR
   ================================================================ */

.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 252px;
  background: white;
  border-right: 2px solid var(--gray-100);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 2px solid var(--gray-100);
}

.sidebar-logo .logo-bar {
  height: 3px;
  background: var(--gradient-hero);
  border-radius: 99px;
  margin-bottom: 14px;
}

.sidebar-logo .logo-img {
  height: 28px;
  width: auto;
  display: block;
  margin-bottom: 2px;
}

.sidebar-logo span {
  font-size: 11px;
  color: var(--gray-500);
  display: block;
  margin-top: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 1000px;
  color: var(--gray-500);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  margin-bottom: 3px;
}

.nav-item:hover {
  background: var(--gray-100);
  color: var(--brand-black);
}

.nav-item.active {
  background: var(--brand-black);
  color: white;
  font-weight: 700;
}

.nav-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 12px 10px;
  border-top: 2px solid var(--gray-100);
}

.main-content {
  margin-left: 252px;
  flex: 1;
  padding: 36px;
  background: var(--gray-50);
}

.page-header {
  margin-bottom: 28px;
}

.page-header h1 {
  font-size: 24px;
  font-weight: 900;
  color: var(--brand-black);
  letter-spacing: -0.5px;
}

.page-header p {
  color: var(--gray-500);
  font-size: 14px;
  margin-top: 4px;
}

/* ================================================================
   STATS CARDS
   ================================================================ */

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

.stat-card {
  background: white;
  border-radius: 10px;
  padding: 22px;
  border: 2px solid var(--gray-100);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}

.stat-card.purple::before  { background: var(--brand-violet); }
.stat-card.gold::before    { background: var(--brand-gold); }
.stat-card.green::before   { background: var(--success); }
.stat-card.blue::before    { background: var(--brand-teal); }
.stat-card.gradient::before{ background: var(--gradient-hero); }

.stat-icon  { font-size: 26px; margin-bottom: 12px; }

.stat-value {
  font-size: 28px;
  font-weight: 900;
  color: var(--brand-black);
  line-height: 1;
  letter-spacing: -0.5px;
}

.stat-label {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 6px;
  font-weight: 500;
}

.stat-sub {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 4px;
}

/* ================================================================
   CHARTS GRID & CARDS
   ================================================================ */

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

.card {
  background: white;
  border-radius: 10px;
  padding: 24px;
  border: 2px solid var(--gray-100);
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--brand-black);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ================================================================
   TABLES
   ================================================================ */

.table-wrapper {
  overflow-x: auto;
  border-radius: 8px;
  border: 2px solid var(--gray-100);
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }

th {
  background: var(--gray-100);
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-500);
  border-bottom: 2px solid var(--gray-200);
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #FAFAFA; }

/* ================================================================
   BADGES
   ================================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 1000px;
  font-size: 12px;
  font-weight: 700;
}

.badge-pending   { background: rgba(245,158,11,0.1);   color: #92400E; }
.badge-eligible  { background: rgba(16,185,129,0.1);   color: #065F46; }
.badge-paid      { background: rgba(123,97,255,0.1);   color: #432786; }
.badge-approved  { background: rgba(16,185,129,0.1);   color: #065F46; }
.badge-rejected  { background: rgba(239,68,68,0.1);    color: #991B1B; }
.badge-processed { background: rgba(83,219,231,0.15);  color: #0E7490; }

/* ================================================================
   REFERRAL LINK BOX
   ================================================================ */

.link-box {
  background: var(--gray-100);
  border: 2px solid var(--gray-200);
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  transition: border-color 0.2s;
}

.link-box:hover { border-color: var(--brand-black); }

.link-box code {
  flex: 1;
  font-size: 14px;
  color: var(--brand-black);
  word-break: break-all;
  font-family: 'Roboto Mono', monospace;
  font-weight: 600;
}

/* ================================================================
   ALERTS
   ================================================================ */

.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 16px;
  font-weight: 500;
}

.alert-info    { background: rgba(83,219,231,0.08);   color: #0E7490; border: 1.5px solid rgba(83,219,231,0.25); }
.alert-success { background: rgba(16,185,129,0.07);   color: #065F46; border: 1.5px solid rgba(16,185,129,0.2); }
.alert-warning { background: rgba(245,158,11,0.07);   color: #92400E; border: 1.5px solid rgba(245,158,11,0.2); }
.alert-error   { background: rgba(239,68,68,0.07);    color: #991B1B; border: 1.5px solid rgba(239,68,68,0.2); }

/* ================================================================
   PENDING BANNER
   ================================================================ */

.pending-banner {
  background: white;
  border: 2px solid var(--gray-100);
  border-radius: 10px;
  padding: 48px 32px;
  text-align: center;
  margin-top: 40px;
  position: relative;
  overflow: hidden;
}

.pending-banner::before {
  content: '';
  display: block;
  height: 4px;
  width: 80px;
  margin: 0 auto 28px;
  background: var(--gradient-hero);
  border-radius: 99px;
}

.pending-banner h2 { font-size: 20px; font-weight: 900; color: var(--brand-black); }
.pending-banner p  { color: var(--gray-500); margin-top: 8px; font-size: 14px; }

/* ================================================================
   PROGRESS BAR
   ================================================================ */

.progress-bar { height: 6px; background: var(--gray-200); border-radius: 99px; overflow: hidden; }

.progress-fill {
  height: 100%;
  background: var(--gradient-hero);
  border-radius: 99px;
  transition: width 0.6s ease;
}

/* ================================================================
   LOADING / SPINNER
   ================================================================ */

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--gray-500);
}

.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--brand-black);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 10px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ================================================================
   MODAL
   ================================================================ */

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
  backdrop-filter: blur(4px);
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: white;
  border-radius: 16px;
  padding: 32px;
  max-width: 520px;
  width: 90%;
  border: 2px solid var(--gray-100);
  box-shadow: 0 24px 60px rgba(0,0,0,0.12);
  transform: translateY(16px);
  transition: transform 0.2s;
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal-title {
  font-size: 18px;
  font-weight: 900;
  margin-bottom: 20px;
  color: var(--brand-black);
}

/* ================================================================
   GRADIENT UTILS
   ================================================================ */

.gradient-bar {
  height: 4px;
  background: var(--gradient-hero);
  border-radius: 99px;
  margin-bottom: 20px;
}

.gradient-text {
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding: 20px; }
  .charts-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
