/* Sihate Affiliate Pro — Dashboard CSS v1.4.0 */
:root {
  --sah-primary:    #6366f1;
  --sah-primary-dk: #4f46e5;
  --sah-accent:     #fdef06;   /* Module 20: active tab color */
  --sah-accent-txt: #1a1a1a;
  --sah-success:    #10b981;
  --sah-danger:     #ef4444;
  --sah-warning:    #f59e0b;
  --sah-bg:         #f5f7ff;
  --sah-card:       #fff;
  --sah-border:     #e5e7eb;
  --sah-muted:      #6b7280;
  --sah-shadow:     0 1px 8px rgba(99,102,241,.08);
  --sah-radius:     12px;
}

*, *::before, *::after { box-sizing: border-box; }

.sah-dash-wrap {
  max-width: 900px; margin: 0 auto; padding: 0 1rem 3rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #111827;
}

/* ── Header ─────────────────────────────────────────────────────── */
.sah-dash-header {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  border-radius: var(--sah-radius); padding: 1.5rem 1.75rem;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 1rem; margin-bottom: 1.25rem; color: #fff;
}
.sah-dash-profile { display: flex; align-items: center; gap: 1rem; }
.sah-dash-profile h2 { margin: 0 0 .25rem; font-size: 1.15rem; color: #fff; }
.sah-dash-profile p  { margin: 0; font-size: .85rem; color: rgba(255,255,255,.85); }
.sah-header-actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.sah-dash-balance span { font-size: .78rem; color: rgba(255,255,255,.75); display: block; }
.sah-dash-balance h3   { margin: 0; font-size: 1.4rem; color: #fff; }

/* Module 2: Avatar */
.sah-avatar-wrap { position: relative; flex-shrink: 0; }
.sah-avatar-img  { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; border: 3px solid rgba(255,255,255,.5); display: block; }
.sah-avatar-edit {
  position: absolute; bottom: 0; right: 0;
  background: #fff; border-radius: 50%; width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.2);
}

/* ── Module 21: Tabs with scroll arrows ─────────────────────────── */
.sah-tabs-container { position: relative; display: flex; align-items: center; margin-bottom: 1.25rem; }
.sah-tab-arrow {
  flex-shrink: 0; width: 28px; height: 32px; background: var(--sah-card);
  border: 1px solid var(--sah-border); border-radius: 6px; cursor: pointer;
  font-size: 1.1rem; color: var(--sah-primary); transition: opacity .2s;
  display: flex; align-items: center; justify-content: center; z-index: 2;
}
.sah-tab-arrow-left  { margin-right: 4px; }
.sah-tab-arrow-right { margin-left: 4px; }
.sah-tab-arrow.sah-arrow-hidden { opacity: 0; pointer-events: none; }

.sah-tabs {
  display: flex; gap: 4px; overflow-x: auto; scroll-behavior: smooth;
  scrollbar-width: none; -ms-overflow-style: none; flex: 1;
  background: var(--sah-card); border: 1px solid var(--sah-border);
  border-radius: 10px; padding: 4px;
}
.sah-tabs::-webkit-scrollbar { display: none; }

/* Module 20: Active tab color */
.sah-tab {
  flex-shrink: 0; padding: .5rem 1rem; border: none; background: transparent;
  border-radius: 7px; cursor: pointer; font-size: .85rem; font-weight: 500;
  color: var(--sah-muted); transition: background .15s, color .15s; white-space: nowrap;
  font-family: inherit;
}
.sah-tab:hover { background: #f0f0f0; color: #374151; }
.sah-tab.active { background: var(--sah-accent); color: var(--sah-accent-txt); font-weight: 700; }

/* ── Cards ──────────────────────────────────────────────────────── */
.sah-card {
  background: var(--sah-card); border: 1px solid var(--sah-border);
  border-radius: var(--sah-radius); padding: 1.4rem 1.5rem;
  box-shadow: var(--sah-shadow); margin-bottom: 1.25rem;
}
.sah-card h3 { margin: 0 0 1rem; font-size: 1rem; font-weight: 700; color: #1e1b4b; }
.sah-card h4 { margin: 1.1rem 0 .6rem; font-size: .9rem; color: #374151; }

/* ── Stats grid ─────────────────────────────────────────────────── */
.sah-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-bottom: 1.25rem; }
@media (max-width: 600px) { .sah-stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 380px) { .sah-stats-grid { grid-template-columns: 1fr; } }
.sah-stat-card {
  background: var(--sah-card); border: 1px solid var(--sah-border); border-radius: 10px;
  padding: 1rem; text-align: center; box-shadow: var(--sah-shadow);
  border-top: 3px solid var(--sah-primary);
}
.sah-stat-card.sah-stat-blue    { border-top-color: #3b82f6; }
.sah-stat-card.sah-stat-indigo  { border-top-color: #6366f1; }
.sah-stat-card.sah-stat-violet  { border-top-color: #8b5cf6; }
.sah-stat-card.sah-stat-amber   { border-top-color: #f59e0b; }
.sah-stat-card.sah-stat-green   { border-top-color: #10b981; }
.sah-stat-card.sah-stat-red     { border-top-color: #ef4444; }
.sah-stat-card.sah-stat-orange  { border-top-color: #f97316; }
.sah-stat-card.sah-stat-emerald { border-top-color: #059669; }
.sah-stat-card.sah-stat-teal    { border-top-color: #14b8a6; }
.sah-stat-icon  { font-size: 1.4rem; margin-bottom: .35rem; }
.sah-stat-value { font-size: 1.25rem; font-weight: 800; color: #1e1b4b; }
.sah-stat-label { font-size: .72rem; color: var(--sah-muted); margin-top: .2rem; }

/* ── Commission ─────────────────────────────────────────────────── */
.sah-commission-display { display: flex; align-items: baseline; gap: .5rem; margin-bottom: .4rem; }
.sah-commission-num  { font-size: 2rem; font-weight: 800; color: #1e1b4b; }
.sah-commission-unit { font-size: .85rem; color: var(--sah-muted); }
.sah-commission-label  { color: #374151; font-size: .9rem; margin: 0 0 .3rem; }
.sah-commission-source { font-size: .78rem; color: #7c3aed; background: #ede9fe; display: inline-block; padding: .2rem .6rem; border-radius: 99px; }

/* ── Links ──────────────────────────────────────────────────────── */
.sah-link-row { margin-bottom: .9rem; }
.sah-link-row label { display: block; font-size: .82rem; font-weight: 600; color: var(--sah-muted); margin-bottom: .3rem; }
.sah-link-input-wrap { display: flex; gap: .4rem; }
.sah-link-input-wrap input { flex: 1; font-size: .82rem; padding: .45rem .6rem; border: 1px solid var(--sah-border); border-radius: 7px; background: #f9fafb; }

/* Module 13: TinyURL section */
.sah-tinyurl-section { margin-top: 1rem; padding-top: .85rem; border-top: 1px solid var(--sah-border); }
.sah-antispam-tips { margin-top: .65rem; }
.sah-antispam-tips strong { font-size: .78rem; color: #374151; }
.sah-antispam-tips ul { font-size: .78rem; color: var(--sah-muted); margin: .3rem 0 0; padding-left: 1.2rem; line-height: 1.7; }

/* ── Module 3: Withdrawal Fee ───────────────────────────────────── */
.sah-fee-notice { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; padding: .6rem 1rem; border-radius: 8px; font-size: .85rem; margin-bottom: 1rem; }
.sah-fee-none   { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.sah-fee-preview { background: #f9fafb; border: 1px solid var(--sah-border); border-radius: 8px; padding: .75rem 1rem; margin: .65rem 0 1rem; }
.sah-fee-row    { display: flex; justify-content: space-between; font-size: .88rem; padding: .2rem 0; }
.sah-fee-net    { border-top: 1px solid var(--sah-border); margin-top: .3rem; padding-top: .4rem; font-weight: 700; }

/* Module 4: Payout notices */
.sah-payout-notice { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; padding: .6rem 1rem; border-radius: 8px; font-size: .85rem; margin: .5rem 0; }

/* ── Buttons ────────────────────────────────────────────────────── */
.sah-btn { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; padding: .55rem 1.1rem; border: 1px solid transparent; border-radius: 8px; font-size: .875rem; font-weight: 600; cursor: pointer; font-family: inherit; text-decoration: none; transition: opacity .15s, background .15s; }
.sah-btn:hover { opacity: .9; }
.sah-btn-primary   { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; border-color: transparent; }
.sah-btn-ghost     { background: rgba(255,255,255,.2); color: #fff; border: 1px solid rgba(255,255,255,.4); }
.sah-btn-whatsapp  { background: #25d366; color: #fff; border-color: transparent; }
.sah-btn-sm        { padding: .3rem .7rem; font-size: .78rem; border-radius: 6px; }
.sah-btn-full      { width: 100%; }

/* ── Quick actions ──────────────────────────────────────────────── */
.sah-actions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: .55rem; }
.sah-action-btn { padding: .65rem .9rem; background: #f5f7ff; border: 1px solid #e0e7ff; border-radius: 8px; cursor: pointer; font-size: .82rem; font-weight: 600; color: #374151; font-family: inherit; text-align: left; transition: background .12s; text-decoration: none; display: block; }
.sah-action-btn:hover { background: #e0e7ff; }

/* ── Tables ─────────────────────────────────────────────────────── */
.sah-table-wrap { overflow-x: auto; }
.sah-data-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.sah-data-table th { background: #f9fafb; color: var(--sah-muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .5rem .75rem; text-align: left; border-bottom: 1px solid var(--sah-border); }
.sah-data-table td { padding: .6rem .75rem; border-bottom: 1px solid #f3f4f6; vertical-align: top; }
.sah-products-cell { font-size: .78rem; max-width: 160px; }

/* ── Badges ─────────────────────────────────────────────────────── */
.sah-badge { display: inline-block; padding: .15rem .55rem; border-radius: 99px; font-size: .72rem; font-weight: 700; }
.sah-badge-pending   { background: #fef9c3; color: #854d0e; }
.sah-badge-approved  { background: #dcfce7; color: #166534; }
.sah-badge-active    { background: #dcfce7; color: #166534; }
.sah-badge-rejected  { background: #fee2e2; color: #991b1b; }
.sah-badge-paid      { background: #d1fae5; color: #065f46; }

/* ── News ───────────────────────────────────────────────────────── */
.sah-news-badge { background: #ef4444; color: #fff; font-size: .62rem; font-weight: 700; padding: .1rem .4rem; border-radius: 99px; vertical-align: middle; margin-left: 4px; }
.sah-news-item { border: 1px solid var(--sah-border); border-radius: 10px; padding: 1rem; margin-bottom: .85rem; }
.sah-news-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
.sah-news-title { font-size: .95rem; font-weight: 700; color: #1e1b4b; margin: 0; }
.sah-news-date  { font-size: .75rem; color: var(--sah-muted); white-space: nowrap; }
.sah-news-poster { margin: .6rem 0; border-radius: 8px; overflow: hidden; }
.sah-news-poster img { width: 100%; max-height: 260px; object-fit: cover; display: block; }
.sah-news-excerpt { color: var(--sah-muted); font-size: .85rem; margin: .4rem 0 .5rem; }
.sah-news-content { font-size: .88rem; color: #374151; line-height: 1.7; padding-top: .65rem; border-top: 1px solid #f3f4f6; margin-top: .5rem; }
.sah-news-toggle { background: none; border: none; color: var(--sah-primary); cursor: pointer; font-size: .8rem; font-weight: 600; padding: 0; font-family: inherit; }
.sah-news-new-badge { background: #ef4444; color: #fff; font-size: .62rem; font-weight: 700; padding: .1rem .4rem; border-radius: 99px; vertical-align: middle; margin-left: 4px; text-transform: uppercase; }

/* ── Tutorial ───────────────────────────────────────────────────── */
.sah-tutorial-item { border: 1px solid var(--sah-border); border-radius: 10px; padding: 1.1rem; margin-bottom: 1rem; }
.sah-tutorial-title { font-size: 1rem; font-weight: 700; color: #1e1b4b; margin: .65rem 0 .5rem; }
.sah-tutorial-content { font-size: .87rem; color: #374151; line-height: 1.7; }
.sah-video-wrap { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 8px; background: #000; margin-bottom: .75rem; }
.sah-video-wrap iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.sah-tut-thumb img { width: 100%; max-height: 200px; object-fit: cover; border-radius: 8px; display: block; margin-bottom: .65rem; }

/* ── Marketing ──────────────────────────────────────────────────── */
.sah-mkt-item { display: flex; gap: 1rem; border: 1px solid var(--sah-border); border-radius: 10px; padding: 1rem; margin-bottom: .85rem; }
.sah-mkt-img { flex-shrink: 0; width: 110px; }
.sah-mkt-img img { width: 110px; height: 82px; object-fit: cover; border-radius: 8px; }
.sah-mkt-body { flex: 1; min-width: 0; }
.sah-mkt-title { font-size: .95rem; font-weight: 700; color: #1e1b4b; margin: 0 0 .4rem; }
.sah-mkt-cat { font-size: .7rem; font-weight: 700; background: #ede9fe; color: #5b21b6; padding: .15rem .5rem; border-radius: 99px; text-transform: uppercase; margin-bottom: .4rem; display: inline-block; }
.sah-mkt-caption { font-size: .83rem; color: var(--sah-muted); margin: .35rem 0; }
.sah-mkt-cta { font-size: .85rem; margin: .25rem 0; }
@media (max-width: 500px) { .sah-mkt-item { flex-direction: column; } .sah-mkt-img { width: 100%; } .sah-mkt-img img { width: 100%; height: 160px; } }

/* ── Tracking result ────────────────────────────────────────────── */
.sah-tracking-result { font-size: .75rem; color: var(--sah-muted); min-height: 16px; }

/* ── Balance display ────────────────────────────────────────────── */
.sah-balance-display { display: flex; align-items: center; gap: .75rem; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: .75rem 1rem; margin-bottom: 1rem; }
.sah-balance-display span { font-size: .85rem; color: var(--sah-muted); }
.sah-balance-display strong { font-size: 1.3rem; color: #166534; font-weight: 800; }

/* ── Forms ──────────────────────────────────────────────────────── */
.sah-form-group { margin-bottom: .9rem; }
.sah-form-group label { display: block; font-size: .82rem; font-weight: 600; color: #374151; margin-bottom: .3rem; }
.sah-form-group input, .sah-form-group select, .sah-form-group textarea {
  width: 100%; padding: .5rem .75rem; border: 1px solid var(--sah-border); border-radius: 8px;
  font-size: .88rem; font-family: inherit; color: #111827;
  background: #fff; transition: border-color .15s;
}
.sah-form-group input:focus, .sah-form-group select:focus, .sah-form-group textarea:focus {
  outline: none; border-color: var(--sah-primary); box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.sah-form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 480px) { .sah-form-row-2 { grid-template-columns: 1fr; } }

/* ── Messages ───────────────────────────────────────────────────── */
.sah-msg { padding: .65rem 1rem; border-radius: 8px; font-size: .88rem; background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.sah-msg.success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.sah-alert { padding: .75rem 1rem; border-radius: 8px; font-size: .88rem; }
.sah-alert-warning { background: #fef9c3; border: 1px solid #fde68a; color: #92400e; }
.sah-empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--sah-muted); }
.sah-empty-state p { margin: .5rem 0 0; font-size: .9rem; }

/* ── Login card ─────────────────────────────────────────────────── */
.sah-login-card { max-width: 400px; margin: 3rem auto; background: var(--sah-card); border: 1px solid var(--sah-border); border-radius: var(--sah-radius); padding: 2rem; box-shadow: var(--sah-shadow); }
.sah-login-header { text-align: center; margin-bottom: 1.5rem; }
.sah-login-header h2 { margin: 0; color: #1e1b4b; }

/* ── Chart ──────────────────────────────────────────────────────── */
.sah-chart-card canvas { display: block; }

/* ── Tracking links (Module 1) ──────────────────────────────────── */
.sah-tracking-link {
  color: var(--sah-primary); font-weight: 600; font-size: .82rem;
  text-decoration: none; border-bottom: 1px dashed currentColor;
  transition: opacity .15s;
}
.sah-tracking-link:hover { opacity: .8; }
.sah-tracking-nolink { font-family: monospace; font-size: .82rem; color: #374151; }

/* ── Leaderboard (Module 3) ─────────────────────────────────────── */
.sah-leaderboard { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1.25rem; }
.sah-lb-row {
  display: flex; align-items: center; gap: .75rem;
  background: #f9fafb; border: 1px solid var(--sah-border);
  border-radius: 10px; padding: .65rem 1rem;
  transition: background .12s;
}
.sah-lb-row.sah-lb-mine { background: #eff6ff; border-color: #bfdbfe; }
.sah-lb-rank { width: 32px; text-align: center; font-size: 1.1rem; flex-shrink: 0; }
.sah-lb-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 2px solid var(--sah-border); }
.sah-lb-info { flex: 1; min-width: 0; }
.sah-lb-name { display: block; font-weight: 700; font-size: .88rem; color: #1e1b4b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sah-lb-refs { display: block; font-size: .72rem; color: var(--sah-muted); }
.sah-lb-you  { font-size: .7rem; background: #dbeafe; color: #1e40af; padding: .1rem .4rem; border-radius: 99px; font-weight: 600; }
.sah-lb-commission { font-size: .95rem; font-weight: 800; color: #166534; flex-shrink: 0; }

.sah-my-stats { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px; padding: 1rem 1.25rem; }
.sah-my-rank  { font-size: .9rem; color: #166534; font-weight: 600; margin-bottom: .65rem; }
.sah-my-summary { display: flex; gap: 1rem; flex-wrap: wrap; }
.sah-my-stat { text-align: center; flex: 1; min-width: 80px; }
.sah-my-stat span { display: block; font-size: .72rem; color: var(--sah-muted); }
.sah-my-stat strong { display: block; font-size: 1rem; font-weight: 800; color: #1e1b4b; }
