/* ===========================
   ADVANCED UGC — STYLESHEET
   =========================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

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

:root {
  --primary: #6c47ff;
  --primary-dark: #5535e0;
  --primary-light: #ede9ff;
  --bg: #0f0f13;
  --surface: #1a1a24;
  --surface2: #22222f;
  --border: #2e2e3e;
  --text: #f0f0f5;
  --text-muted: #8888aa;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --sidebar-width: 240px;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }

/* ===========================
   AUTH PAGE (LOGIN)
   =========================== */

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: radial-gradient(ellipse at top left, #1e1040 0%, #0f0f13 60%);
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
}

.logo h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

.logo h1 span,
.sidebar-logo h2 span {
  color: var(--primary);
}

.logo .tagline {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 32px;
}

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

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-primary {
  width: 100%;
  padding: 13px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  font-family: 'Inter', sans-serif;
}

.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:active { transform: scale(0.98); }

.error-msg {
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 12px;
  min-height: 18px;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-footer a { color: var(--primary); font-weight: 600; }

/* ===========================
   PORTAL LAYOUT
   =========================== */

.portal-page {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
}

.sidebar-logo {
  padding: 28px 24px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo h2 {
  font-size: 20px;
  font-weight: 800;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.15s;
}

.nav-item:hover {
  background: var(--surface2);
  color: var(--text);
}

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid var(--border);
}

.sidebar-footer p {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-logout {
  width: 100%;
  padding: 9px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.15s;
}

.btn-logout:hover {
  border-color: var(--danger);
  color: var(--danger);
}

/* MAIN CONTENT */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 36px 40px;
  max-width: calc(100vw - var(--sidebar-width));
}

/* PAGE HEADER */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 4px;
}

.page-header p {
  color: var(--text-muted);
  font-size: 14px;
}

.header-badge {
  background: var(--primary);
  border-radius: 12px;
  padding: 12px 20px;
  text-align: center;
}

.header-badge span {
  display: block;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 2px;
}

.header-badge small {
  font-size: 11px;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ===========================
   STATS GRID
   =========================== */

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

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-card.highlight {
  border-color: var(--primary);
  background: linear-gradient(135deg, #1e1040, var(--surface));
}

.stat-icon { font-size: 28px; }

.stat-info h3 {
  font-size: 22px;
  font-weight: 800;
}

.stat-info p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===========================
   SECTION CARDS & TABLES
   =========================== */

.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 24px;
}

.section-card h2 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
}

.section-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

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

.data-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface2); }

/* STATUS BADGES */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-success { background: rgba(34,197,94,0.15); color: var(--success); }
.badge-warning { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-danger  { background: rgba(239,68,68,0.15);  color: var(--danger); }
.badge-purple  { background: var(--primary-light);  color: var(--primary); }

/* ===========================
   PRODUCTS PAGE
   =========================== */

.filters-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filters-bar input,
.filters-bar select {
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
}

.filters-bar input { flex: 1; min-width: 200px; }
.filters-bar input:focus,
.filters-bar select:focus { outline: none; border-color: var(--primary); }

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  transition: border-color 0.2s, transform 0.15s;
}

.product-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.product-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.product-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.product-platform {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.product-commission {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 8px;
  white-space: nowrap;
}

.product-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.product-price {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 16px;
}

.product-actions {
  display: flex;
  gap: 8px;
}

.btn-secondary {
  flex: 1;
  padding: 9px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.15s;
  text-align: center;
}

.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

.btn-copy {
  padding: 9px 14px;
  background: var(--primary);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background 0.15s;
}

.btn-copy:hover { background: var(--primary-dark); }

/* ===========================
   CODES PAGE
   =========================== */

.codes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 8px;
}

.code-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.code-display {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--primary);
  margin-bottom: 8px;
}

.code-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.6;
}

.info-card { background: linear-gradient(135deg, #1a1a2e, var(--surface)); }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.info-item {
  background: var(--surface2);
  border-radius: 10px;
  padding: 16px;
}

.info-item h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}

.info-item p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===========================
   PAYOUTS PAGE
   =========================== */

.payout-request-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface2);
  border-radius: 12px;
  padding: 20px 24px;
  gap: 20px;
  flex-wrap: wrap;
}

.payout-request-info p {
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.payout-request-info strong { color: var(--text); }

.payout-request-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.payout-request-actions input {
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  width: 160px;
}

.payout-request-actions input:focus {
  outline: none;
  border-color: var(--primary);
}

.payout-request-actions .btn-primary {
  width: auto;
  padding: 10px 20px;
}

.payout-msg {
  margin-top: 14px;
  font-size: 13px;
  font-weight: 600;
  min-height: 20px;
}

.payment-settings-form {
  max-width: 480px;
}

.payment-settings-form .btn-primary {
  width: auto;
  padding: 11px 28px;
  margin-top: 8px;
}
