:root {
  --bg: #08080f;
  --bg-card: rgba(255,255,255,0.03);
  --border: rgba(255,255,255,0.05);
  --text: #f5f5f7;
  --text-secondary: #98989d;
  --violet: #7c3aed;
  --violet-light: #a78bfa;
  --green: #34c759;
  --red: #ff3b30;
  --orange: #ff9500;
  --blue: #0071e3;
  --radius: 16px;
  --radius-sm: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
.container { max-width: 1100px; margin: 0 auto; padding: 0 28px; }

/* Header */
.header { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); background: rgba(8,8,15,0.9); backdrop-filter: blur(20px); position: sticky; top: 0; z-index: 50; }
.logo { font-size: 18px; font-weight: 800; color: #409cff; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.logo:hover { transform: scale(1.03); }
.logo img { width: 26px; height: 26px; border-radius: 6px; }
.logo-sub { font-size: 8px; color: var(--text-secondary); text-transform: uppercase; font-weight: 500; letter-spacing: 0.05em; }
.header-right { display: flex; align-items: center; gap: 12px; }
.partner-name { font-weight: 600; font-size: 14px; }
.btn-logout { padding: 8px 16px; border-radius: 9999px; border: 1px solid rgba(255,255,255,0.12); background: transparent; color: var(--text-secondary); cursor: pointer; font-size: 13px; font-weight: 600; font-family: inherit; transition: all 0.3s; }
.btn-logout:hover { border-color: var(--red); color: var(--red); }

/* Support header button */
.btn-support-header {
  position: relative; padding: 8px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.08);
  background: var(--bg-card); color: var(--text); cursor: pointer; font-size: 16px; font-family: inherit; transition: all 0.3s;
}
.btn-support-header:hover { border-color: var(--violet-light); }
.support-badge {
  position: absolute; top: -6px; right: -6px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700;
  width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
}

/* Login */
.login-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 40px; max-width: 440px; margin: 60px auto; }
.login-card h2 { font-size: 24px; font-weight: 800; margin-bottom: 8px; text-align: center; }
.login-card .subtitle { color: var(--text-secondary); font-size: 14px; margin-bottom: 24px; text-align: center; }
.form-input { width: 100%; padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.03); color: #fff; font-size: 14px; margin-bottom: 10px; font-family: inherit; outline: none; transition: all 0.3s; }
.form-input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(124,58,237,0.12); }
.btn-primary { width: 100%; padding: 14px; border-radius: var(--radius-sm); border: none; background: linear-gradient(135deg, var(--violet), var(--violet-light)); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit; transition: all 0.3s; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(124,58,237,0.4); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-secondary { width: 100%; padding: 14px; border-radius: var(--radius-sm); border: 1px solid rgba(255,255,255,0.1); background: transparent; color: var(--text); font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.3s; margin-top: 8px; }
.btn-secondary:hover { border-color: var(--violet-light); color: var(--violet-light); }
.error-msg { color: var(--red); font-size: 13px; text-align: center; margin-top: 8px; display: none; }
.error-msg.show { display: block; }
.toggle-link { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-secondary); }
.toggle-link a { color: var(--violet-light); text-decoration: none; font-weight: 600; cursor: pointer; }

/* Dashboard */
.dashboard { display: none; padding: 30px 0; }
.dashboard.active { display: block; }
.dashboard-header { margin-bottom: 20px; }
.dashboard-header h1 { font-size: 26px; font-weight: 800; margin-bottom: 4px; }
.dashboard-header p { color: var(--text-secondary); font-size: 14px; }

/* Quick actions */
.quick-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.quick-btn { padding: 10px 18px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.08); background: var(--bg-card); color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.3s; white-space: nowrap; }
.quick-btn:hover { border-color: var(--violet-light); background: rgba(124,58,237,0.08); }

/* Widgets grid */
.widgets-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.widget-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; transition: all 0.3s; }
.widget-card:hover { border-color: rgba(124,58,237,0.2); transform: translateY(-2px); }
.widget-value { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.widget-value.green { color: var(--green); }
.widget-value.violet { color: var(--violet-light); }
.widget-value.orange { color: var(--orange); }
.widget-value.blue { color: var(--blue); }
.widget-label { font-size: 11px; color: var(--text-secondary); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.04em; }

/* Forecast & Payout progress row */
.info-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.info-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.info-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.forecast-amount { font-size: 30px; font-weight: 900; color: var(--green); }
.forecast-detail { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.payout-progress-bar { width: 100%; height: 8px; background: rgba(255,255,255,0.06); border-radius: 4px; overflow: hidden; margin: 10px 0; }
.payout-progress-fill { height: 100%; background: linear-gradient(90deg, var(--violet), var(--violet-light)); border-radius: 4px; transition: width 0.5s; }
.payout-progress-text { font-size: 12px; color: var(--text-secondary); }

/* Ref link */
.ref-link-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--bg-card); border: 1px solid rgba(124,58,237,0.15); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 20px; }
.ref-label { font-weight: 600; font-size: 13px; color: var(--violet-light); white-space: nowrap; }
.ref-url { flex: 1; font-size: 13px; color: var(--text); word-break: break-all; background: rgba(255,255,255,0.03); padding: 10px 14px; border-radius: 10px; font-family: monospace; min-width: 200px; }
.btn-copy { padding: 10px 18px; border-radius: 10px; border: 1px solid var(--violet); background: rgba(124,58,237,0.08); color: var(--violet-light); font-weight: 600; font-size: 13px; cursor: pointer; font-family: inherit; transition: all 0.3s; white-space: nowrap; }
.btn-copy:hover { background: rgba(124,58,237,0.18); }

/* Chart + Levels */
.chart-levels-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.chart-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.chart-box h3 { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.chart-bars { display: flex; align-items: flex-end; gap: 6px; height: 110px; }
.chart-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.chart-bar { width: 100%; background: linear-gradient(to top, var(--violet), var(--violet-light)); border-radius: 4px 4px 0 0; transition: height 0.5s; min-height: 3px; }
.chart-day { font-size: 10px; color: var(--text-secondary); }
.chart-total { text-align: center; font-size: 13px; font-weight: 700; color: var(--green); margin-top: 10px; }

.levels-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.levels-box h3 { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.level-bar-wrap { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.level-progress { width: 100%; height: 8px; background: rgba(255,255,255,0.06); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.level-fill { height: 100%; background: linear-gradient(90deg, var(--violet), var(--violet-light)); border-radius: 4px; transition: width 0.5s; }
.level-next { font-size: 11px; color: var(--text-secondary); margin-top: 6px; text-align: center; }
.levels-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.level-tier { background: rgba(255,255,255,0.02); border: 1px solid var(--border); border-radius: 10px; padding: 12px; text-align: center; }
.level-tier.active { border-color: var(--violet); background: rgba(124,58,237,0.06); }
.level-tier .tier-icon { font-size: 24px; }
.level-tier .tier-name { font-size: 12px; font-weight: 700; margin-top: 4px; }
.level-tier .tier-pct { font-size: 10px; color: var(--text-secondary); }

/* Events + Tips */
.events-tips-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.notif-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.notif-box h3 { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.notif-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 12px; align-items: center; }
.notif-item:last-child { border-bottom: none; }
.notif-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.notif-dot.payment { background: var(--green); }
.notif-dot.click { background: var(--violet-light); }
.notif-dot.reg { background: var(--blue); }
.notif-time { color: var(--text-secondary); font-size: 10px; margin-left: auto; }

.tips-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.tips-box h3 { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.tip-item { display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.tip-item:last-child { border-bottom: none; }
.tip-num { width: 22px; height: 22px; border-radius: 50%; background: rgba(124,58,237,0.15); color: var(--violet-light); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 11px; flex-shrink: 0; }

/* Promo materials */
.promo-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; }
.promo-box h3 { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.promo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.promo-item { background: rgba(255,255,255,0.02); border: 1px solid var(--border); border-radius: 10px; padding: 16px; text-align: center; transition: all 0.3s; cursor: pointer; }
.promo-item:hover { border-color: var(--violet-light); background: rgba(124,58,237,0.05); }
.promo-item-icon { font-size: 28px; margin-bottom: 8px; }
.promo-item-name { font-size: 13px; font-weight: 600; }
.promo-item-desc { font-size: 10px; color: var(--text-secondary); margin-top: 4px; }

/* Tables */
.section-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.table-wrap { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 14px; text-align: left; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary); background: rgba(255,255,255,0.02); border-bottom: 1px solid var(--border); }
td { padding: 10px 14px; font-size: 12px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
.badge-status { display: inline-block; padding: 3px 9px; border-radius: 9999px; font-size: 10px; font-weight: 600; }
.badge-status.pending { background: rgba(255,149,0,0.12); color: var(--orange); }
.badge-status.paid { background: rgba(52,199,89,0.12); color: var(--green); }
.empty-row td { text-align: center; padding: 36px; color: var(--text-secondary); font-size: 12px; }

/* Modals */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 1000; justify-content: center; align-items: center; backdrop-filter: blur(4px); }
.modal-overlay.show { display: flex; }
.modal-box { background: #12121a; border: 1px solid rgba(124,58,237,0.2); border-radius: var(--radius); padding: 0; width: 420px; max-width: 92vw; overflow: hidden; }
.modal-box h3 { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; margin-top: 16px; }
.btn-cancel { flex: 1; padding: 11px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.1); background: transparent; color: var(--text); font-weight: 600; cursor: pointer; font-family: inherit; }
.btn-submit { flex: 1; padding: 11px; border-radius: 10px; border: none; background: linear-gradient(135deg, var(--violet), var(--violet-light)); color: #fff; font-weight: 700; cursor: pointer; font-family: inherit; }

/* Support modal */
.support-modal-box { background: #12121a; border: 1px solid rgba(124,58,237,0.2); border-radius: 20px; width: 560px; max-width: 94vw; max-height: 85vh; display: flex; flex-direction: column; overflow: hidden; }
.support-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; background: linear-gradient(135deg, rgba(124,58,237,0.12), rgba(124,58,237,0.04)); border-bottom: 1px solid rgba(124,58,237,0.1); }
.support-modal-close { background: rgba(255,255,255,0.05); border: none; color: var(--text-secondary); font-size: 18px; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; }
.support-modal-close:hover { background: rgba(255,59,48,0.12); color: var(--red); }
.support-tabs { display: flex; gap: 3px; padding: 10px 14px; background: rgba(0,0,0,0.15); border-bottom: 1px solid var(--border); }
.support-tab { flex: 1; padding: 8px 6px; border-radius: 8px; border: none; background: transparent; color: var(--text-secondary); font-size: 11px; font-weight: 600; cursor: pointer; font-family: inherit; display: flex; align-items: center; justify-content: center; gap: 4px; }
.support-tab.active { background: rgba(124,58,237,0.15); color: var(--violet-light); }
.support-tab-count { background: var(--violet); color: #fff; font-size: 9px; padding: 1px 5px; border-radius: 6px; }
.support-content { flex: 1; overflow-y: auto; padding: 18px; min-height: 180px; }
.support-footer { padding: 12px 18px; border-top: 1px solid var(--border); background: rgba(0,0,0,0.1); }

/* Toast */
.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: #1a1a2e; color: #fff; padding: 12px 24px; border-radius: 12px; font-size: 13px; font-weight: 600; z-index: 2000; opacity: 0; transition: opacity 0.3s; border: 1px solid var(--violet); }
.toast.show { opacity: 1; }

/* Loading */
.loading { text-align: center; padding: 60px; color: var(--text-secondary); }
.spinner { width: 36px; height: 36px; border: 3px solid rgba(255,255,255,0.08); border-top-color: var(--violet); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 768px) {
  .widgets-row { grid-template-columns: repeat(2, 1fr); }
  .info-row, .chart-levels-row, .events-tips-row, .promo-grid { grid-template-columns: 1fr; }
}