/* ═══════════════════════════════════════════════════
   MY INCOME STREAMS v2 — Main Stylesheet
═══════════════════════════════════════════════════ */
:root {
  --bg:          #0a0c10;
  --surface:     #111318;
  --surface2:    #181b22;
  --border:      rgba(255,255,255,0.07);
  --border2:     rgba(255,255,255,0.13);
  --text:        #f0f0f0;
  --text2:       #8a8f9e;
  --text3:       #555a6a;
  --accent:      #4ade80;
  --accent2:     #22c55e;
  --accent-dim:  rgba(74,222,128,0.12);
  --accent-dim2: rgba(74,222,128,0.05);
  --blue:        #60a5fa;
  --blue-dim:    rgba(96,165,250,0.12);
  --amber:       #fbbf24;
  --amber-dim:   rgba(251,191,36,0.12);
  --red:         #f87171;
  --red-dim:     rgba(248,113,113,0.12);
  --purple:      #a78bfa;
  --purple-dim:  rgba(167,139,250,0.12);
  --radius:      10px;
  --radius-lg:   14px;
  --font-head:   'Syne', sans-serif;
  --font-body:   'DM Sans', sans-serif;
}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body { background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 14px; min-height: 100vh; line-height: 1.6; }
a { color: inherit; text-decoration: none; }

/* ── AUTH ──────────────────────────────────────────────── */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border2); border-radius: var(--radius-lg); padding: 40px; }
.auth-logo { font-family: var(--font-head); font-size: 22px; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.auth-tagline { color: var(--text2); font-size: 13px; margin-bottom: 28px; }
.auth-card h2 { font-family: var(--font-head); font-size: 20px; font-weight: 600; margin-bottom: 24px; }
.referral-badge { background: var(--accent-dim2); border: 1px solid rgba(74,222,128,0.15); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 20px; font-size: 13px; color: var(--accent); }
.auth-switch { text-align: center; margin-top: 18px; color: var(--text2); font-size: 13px; }
.auth-switch a { color: var(--accent); }
.subdomain-preview { font-size: 11px; color: var(--text3); margin-top: 5px; }

/* ── FORMS ─────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 11px; color: var(--text2); margin-bottom: 6px; letter-spacing: .05em; text-transform: uppercase; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border2); border-radius: var(--radius);
  padding: 10px 14px; color: var(--text); font-family: var(--font-body); font-size: 14px;
  outline: none; transition: border-color .2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--accent); }
.form-group textarea { resize: vertical; min-height: 90px; }
.form-group select { background: var(--bg); cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.error-msg { background: var(--red-dim); border: 1px solid rgba(248,113,113,0.25); border-radius: var(--radius); padding: 10px 14px; color: var(--red); font-size: 13px; margin-bottom: 16px; }
.success-msg { background: var(--accent-dim); border: 1px solid rgba(74,222,128,0.25); border-radius: var(--radius); padding: 10px 14px; color: var(--accent); font-size: 13px; margin-bottom: 16px; }

/* ── BUTTONS ───────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: var(--radius); border: none; cursor: pointer; font-family: var(--font-body); font-size: 14px; font-weight: 500; transition: all .15s; text-decoration: none; }
.btn-primary  { background: var(--accent); color: #0a0c10; }
.btn-primary:hover { background: var(--accent2); }
.btn-ghost    { background: transparent; color: var(--text2); border: 1px solid var(--border2); }
.btn-ghost:hover  { background: var(--surface2); color: var(--text); }
.btn-danger   { background: var(--red-dim); color: var(--red); border: 1px solid rgba(248,113,113,0.2); }
.btn-danger:hover { background: rgba(248,113,113,0.2); }
.btn-full  { width: 100%; justify-content: center; padding: 12px; }
.btn-sm    { padding: 6px 14px; font-size: 13px; }
.btn-xs    { padding: 4px 10px; font-size: 12px; }

/* ── LAYOUT ────────────────────────────────────────────── */
.app-wrap   { display: flex; min-height: 100vh; width: 100%; overflow: hidden; }
.sidebar    { width: 230px; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: fixed; left: 0; top: 0; bottom: 0; z-index: 10; overflow-y: auto; }
.sidebar-logo   { padding: 22px 20px 18px; font-family: var(--font-head); font-size: 17px; font-weight: 700; color: var(--accent); border-bottom: 1px solid var(--border); }
.sidebar-domain { font-size: 11px; color: var(--text3); font-weight: 400; display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav        { flex: 1; padding: 10px 8px; }
.nav-section { font-size: 10px; color: var(--text3); letter-spacing: .08em; text-transform: uppercase; padding: 8px 12px 4px; }
.nav-item   { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius); color: var(--text2); font-size: 13px; font-weight: 500; transition: all .15s; text-decoration: none; margin-bottom: 2px; cursor: pointer; }
.nav-item:hover  { background: var(--surface2); color: var(--text); }
.nav-item.active { background: var(--accent-dim); color: var(--accent); }
.nav-item svg { width: 15px; height: 15px; flex-shrink: 0; }
.sidebar-user { padding: 14px 16px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.avatar     { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-dim); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--accent); flex-shrink: 0; font-family: var(--font-head); }
.user-info  { flex: 1; min-width: 0; }
.user-name  { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role  { font-size: 11px; color: var(--text3); }
.main-content { margin-left: 230px; flex: 1; padding: 28px 32px; min-height: 100vh; width: calc(100% - 230px); overflow-x: hidden; }
/* ── PAGE HEADER ───────────────────────────────────────── */
.page-header { margin-bottom: 24px; display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.page-title  { font-family: var(--font-head); font-size: 22px; font-weight: 700; }
.page-sub    { color: var(--text2); font-size: 13px; margin-top: 4px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* ── CARDS ─────────────────────────────────────────────── */
.card       { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.card-title { font-size: 11px; font-weight: 600; color: var(--text2); letter-spacing: .05em; text-transform: uppercase; margin-bottom: 16px; }

/* ── STATS ─────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.stat-card  { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; }
.stat-label { font-size: 12px; color: var(--text2); margin-bottom: 8px; }
.stat-value { font-family: var(--font-head); font-size: 26px; font-weight: 700; line-height: 1; }
.stat-change { font-size: 11px; color: var(--text3); margin-top: 5px; }
.c-green  { color: var(--accent); }
.c-blue   { color: var(--blue); }
.c-amber  { color: var(--amber); }
.c-purple { color: var(--purple); }
.c-red    { color: var(--red); }

/* ── GRIDS ─────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1300px) { .grid-3 { grid-template-columns: 1fr 1fr; } .stats-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px)  { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ── BADGES ────────────────────────────────────────────── */
.badge        { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 500; }
.badge-green  { background: var(--accent-dim);  color: var(--accent); }
.badge-blue   { background: var(--blue-dim);    color: var(--blue); }
.badge-amber  { background: var(--amber-dim);   color: var(--amber); }
.badge-red    { background: var(--red-dim);     color: var(--red); }
.badge-purple { background: var(--purple-dim);  color: var(--purple); }
.badge-gray   { background: rgba(255,255,255,.06); color: var(--text2); }

/* ── OFFER CARDS ───────────────────────────────────────── */
.offer-card  { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; display: flex; flex-direction: column; gap: 12px; transition: border-color .2s; }
.offer-card:hover { border-color: var(--border2); }
.offer-card.active { border-color: rgba(74,222,128,0.3); background: var(--accent-dim2); }
.offer-card.sponsor { border-color: rgba(167,139,250,0.3); background: rgba(167,139,250,0.04); }
.offer-header    { display: flex; align-items: flex-start; gap: 12px; }
.offer-icon      { width: 42px; height: 42px; border-radius: 10px; background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.offer-title     { font-family: var(--font-head); font-size: 15px; font-weight: 600; }
.offer-commission { font-size: 12px; color: var(--accent); font-weight: 500; }
.offer-desc      { font-size: 13px; color: var(--text2); line-height: 1.55; }
.offer-link-box  { background: var(--bg); border: 1px solid var(--border2); border-radius: var(--radius); padding: 8px 12px; display: flex; align-items: center; gap: 8px; }
.offer-link-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--accent); font-size: 12px; font-family: monospace; }
.toggle-row      { display: flex; align-items: center; justify-content: space-between; }
.toggle          { position: relative; width: 40px; height: 22px; cursor: pointer; display: inline-block; flex-shrink: 0; }
.toggle input    { opacity: 0; width: 0; height: 0; }
.toggle-slider   { position: absolute; inset: 0; background: var(--surface2); border: 1px solid var(--border2); border-radius: 20px; transition: .2s; }
.toggle-slider:before { content: ''; position: absolute; left: 3px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; background: var(--text3); border-radius: 50%; transition: .2s; }
.toggle input:checked + .toggle-slider { background: var(--accent-dim); border-color: rgba(74,222,128,.4); }
.toggle input:checked + .toggle-slider:before { transform: translate(18px, -50%); background: var(--accent); }
.aff-form .form-group input { font-size: 12px; }

/* ── COPY BUTTON ───────────────────────────────────────── */
.copy-btn { background: var(--accent-dim); color: var(--accent); border: none; border-radius: 6px; padding: 5px 12px; font-size: 11px; cursor: pointer; font-family: var(--font-body); font-weight: 500; flex-shrink: 0; transition: all .15s; }
.copy-btn:hover { background: var(--accent); color: #0a0c10; }

/* ── TABLE ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table       { width: 100%; border-collapse: collapse; font-size: 13px; }
th          { text-align: left; padding: 10px 14px; font-size: 10px; color: var(--text3); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; border-bottom: 1px solid var(--border); }
td          { padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text2); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface2); }
.td-strong  { color: var(--text); font-weight: 500; }

/* ── TRAINING ──────────────────────────────────────────── */
.module-card  { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: border-color .2s; cursor: pointer; text-decoration: none; display: block; color: inherit; }
.module-card:hover { border-color: var(--border2); }
.module-card.done  { border-color: rgba(74,222,128,.25); }
.module-thumb { height: 110px; background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: 38px; position: relative; }
.module-prog-bar  { height: 3px; background: var(--border); position: absolute; bottom: 0; left: 0; right: 0; }
.module-prog-fill { height: 100%; background: var(--accent); }
.module-body  { padding: 16px; }
.module-title { font-family: var(--font-head); font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.module-meta  { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text2); }

/* ── LESSON ────────────────────────────────────────────── */
.video-frame  { background: var(--surface2); border-radius: var(--radius-lg); aspect-ratio: 16/9; overflow: hidden; border: 1px solid var(--border); margin-bottom: 20px; }
.video-frame iframe { width: 100%; height: 100%; border: none; }
.video-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; color: var(--text3); }
.play-circle  { width: 64px; height: 64px; background: var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.lesson-content h3 { font-family: var(--font-head); font-size: 16px; color: var(--text); margin: 20px 0 8px; }
.lesson-content p  { color: var(--text2); font-size: 14px; margin-bottom: 12px; line-height: 1.7; }
.resource-row { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.back-link    { display: inline-flex; align-items: center; gap: 6px; color: var(--text2); font-size: 13px; margin-bottom: 20px; }
.back-link:hover { color: var(--text); }

/* ── COMMISSIONS ───────────────────────────────────────── */
.wallet-card    { background: linear-gradient(135deg, rgba(74,222,128,.1), rgba(74,222,128,.03)); border: 1px solid rgba(74,222,128,.25); border-radius: var(--radius-lg); padding: 24px; }
.wallet-balance { font-family: var(--font-head); font-size: 34px; font-weight: 700; color: var(--accent); }
.wallet-label   { font-size: 12px; color: var(--text2); margin-bottom: 6px; }
.wallet-addr    { background: var(--bg); border: 1px solid var(--border2); border-radius: var(--radius); padding: 8px 12px; font-size: 12px; color: var(--text2); word-break: break-all; font-family: monospace; margin-top: 8px; }

/* ── REFERRAL LINK ─────────────────────────────────────── */
.referral-card { background: var(--accent-dim2); border: 1px solid rgba(74,222,128,.15); border-radius: var(--radius-lg); padding: 18px; }
.referral-url  { background: var(--bg); border: 1px solid rgba(74,222,128,.2); border-radius: var(--radius); padding: 10px 14px; font-family: monospace; font-size: 13px; color: var(--accent); display: flex; align-items: center; gap: 12px; margin-top: 10px; }

/* ── CHECKLIST ─────────────────────────────────────────── */
.checklist-item  { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); cursor: pointer; text-decoration: none; color: inherit; }
.checklist-item:last-child { border-bottom: none; }
.checklist-check { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--border2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.checklist-check.done { background: var(--accent-dim); border-color: rgba(74,222,128,.4); }
.checklist-label { font-size: 13px; }
.checklist-label.done { color: var(--text2); text-decoration: line-through; }

/* ── TOAST ─────────────────────────────────────────────── */
#toast { position: fixed; bottom: 24px; right: 24px; background: var(--surface); border: 1px solid var(--accent); border-radius: var(--radius); padding: 12px 18px; color: var(--accent); font-size: 13px; display: flex; align-items: center; gap: 8px; transform: translateY(80px); opacity: 0; transition: all .3s; z-index: 1000; pointer-events: none; }
#toast.show { transform: translateY(0); opacity: 1; }

/* ── MISC ──────────────────────────────────────────────── */
.divider  { height: 1px; background: var(--border); margin: 20px 0; }
.flex     { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-8    { gap: 8px; }
.gap-12   { gap: 12px; }
.mt-8     { margin-top: 8px; }
.mt-12    { margin-top: 12px; }
.mt-16    { margin-top: 16px; }
.mt-20    { margin-top: 20px; }
.mb-20    { margin-bottom: 20px; }
