/* PuanWin — app.css */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:   #6366f1;
  --primary-d: #4f46e5;
  --success:   #10b981;
  --warning:   #f59e0b;
  --danger:    #ef4444;
  --text:      #111827;
  --text-muted:#6b7280;
  --border:    #e5e7eb;
  --bg:        #f9fafb;
  --white:     #ffffff;
  --radius:    10px;
  --shadow:    0 1px 3px rgba(0,0,0,.08);
}

body { font-family: system-ui, -apple-system, sans-serif; color: var(--text); background: var(--bg); line-height: 1.6; }
a { color: inherit; text-decoration: none; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* NAV */
.navbar { background: var(--white); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.nav-brand { font-size: 20px; font-weight: 700; color: var(--primary); }
.nav-links { display: flex; align-items: center; gap: 20px; font-size: 14px; }
.nav-links a { color: var(--text-muted); }
.nav-links a:hover { color: var(--text); }
.nav-pts { display: flex; align-items: center; gap: 5px; background: #ede9fe; color: var(--primary); padding: 5px 12px; border-radius: 20px; font-weight: 500; }
.btn-primary { background: var(--primary); color: #fff !important; padding: 7px 16px; border-radius: var(--radius); font-weight: 500; }
.btn-primary:hover { background: var(--primary-d); }

/* ALERTS */
.alert { padding: 12px 16px; font-size: 14px; text-align: center; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-error   { background: #fee2e2; color: #991b1b; }

/* AD TOP */
.ad-top { padding: 8px 0; }

/* MAIN */
.main-content { padding: 24px 0 40px; }

/* DASHBOARD GRID */
.dashboard-grid { display: grid; grid-template-columns: 320px 1fr; gap: 24px; }
@media(max-width:768px){ .dashboard-grid { grid-template-columns: 1fr; } }

/* POINTS CARD */
.points-card { background: var(--primary); color: #fff; border-radius: 16px; padding: 24px; margin-bottom: 16px; text-align: center; }
.points-greeting { font-size: 14px; opacity: .85; margin-bottom: 8px; }
.points-number { font-size: 52px; font-weight: 700; line-height: 1; }
.points-label { font-size: 14px; opacity: .8; margin-bottom: 12px; }
.level-badge { display: inline-block; padding: 4px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; margin-bottom: 16px; }
.level-bronze { background: #cd7f32; }
.level-silver { background: #9ca3af; }
.level-gold   { background: #f59e0b; color: #92400e; }

/* STREAK */
.streak-bar { display: flex; justify-content: center; gap: 6px; margin-bottom: 6px; }
.streak-day { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 600; background: rgba(255,255,255,.2); }
.streak-day.done  { background: rgba(255,255,255,.9); color: var(--primary); }
.streak-day.today { background: #fff; color: var(--primary); box-shadow: 0 0 0 2px #fff; }
.streak-label { font-size: 12px; opacity: .75; margin-bottom: 16px; }
.bonus-done { background: rgba(255,255,255,.2); border-radius: var(--radius); padding: 10px; font-size: 13px; }
.btn-bonus { display: block; background: #fff; color: var(--primary); font-weight: 600; padding: 12px; border-radius: var(--radius); font-size: 14px; }
.btn-bonus:hover { background: #ede9fe; }

/* AD REWARD CARD */
.ad-reward-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.ad-reward-title { font-weight: 600; margin-bottom: 4px; }
.ad-reward-sub   { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.btn-watch-ad { width: 100%; padding: 12px; background: var(--success); color: #fff; border: none; border-radius: var(--radius); font-size: 14px; font-weight: 600; cursor: pointer; }
.btn-watch-ad:hover { background: #059669; }
.btn-watch-ad:disabled { background: #9ca3af; cursor: not-allowed; }
.ad-timer { font-size: 13px; color: var(--text-muted); margin-top: 8px; text-align: center; }
.ad-limit-done { font-size: 13px; color: var(--text-muted); background: var(--bg); border-radius: var(--radius); padding: 10px; text-align: center; }

/* REFERRAL */
.referral-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.ref-title { font-weight: 600; margin-bottom: 4px; }
.ref-sub   { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
.ref-link-wrap { display: flex; gap: 8px; }
.ref-link-wrap input { flex: 1; padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; color: var(--text-muted); }
.ref-link-wrap button { padding: 7px 14px; background: var(--primary); color: #fff; border: none; border-radius: 6px; cursor: pointer; font-size: 13px; }

/* CAMPAIGN CARDS */
.section-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.campaign-card { display: block; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; position: relative; transition: box-shadow .15s; }
.campaign-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.sponsor-badge { position: absolute; top: 12px; right: 12px; background: var(--warning); color: #fff; font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 20px; }
.camp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.camp-biz  { font-size: 12px; color: var(--text-muted); }
.camp-pts-badge { background: #ede9fe; color: var(--primary); font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 20px; }
.camp-title { font-weight: 600; margin-bottom: 4px; }
.camp-desc  { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
.camp-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.camp-quota { flex: 1; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.quota-bar  { height: 4px; background: var(--warning); border-radius: 2px; }
.camp-expires { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.btn-all-camps { display: block; text-align: center; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; color: var(--primary); margin-top: 8px; }

/* LOGS */
.log-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.log-pts.pos { color: var(--success); font-weight: 600; }
.log-pts.neg { color: var(--danger); font-weight: 600; }

/* AUTH FORMS */
.auth-wrap { max-width: 400px; margin: 60px auto; }
.auth-card { background: var(--white); border-radius: 16px; padding: 32px; box-shadow: var(--shadow); }
.auth-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.auth-sub   { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 5px; }
.form-input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 15px; transition: border-color .15s; }
.form-input:focus { outline: none; border-color: var(--primary); }
.btn-submit { width: 100%; padding: 13px; background: var(--primary); color: #fff; border: none; border-radius: var(--radius); font-size: 16px; font-weight: 600; cursor: pointer; margin-top: 8px; }
.btn-submit:hover { background: var(--primary-d); }
.auth-link  { font-size: 14px; text-align: center; margin-top: 16px; color: var(--text-muted); }
.auth-link a { color: var(--primary); font-weight: 500; }

/* BUSINESS & ADMIN */
.panel-header { margin-bottom: 24px; }
.panel-title  { font-size: 22px; font-weight: 700; }
.stats-grid   { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 12px; margin-bottom: 24px; }
.stat-card    { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-align: center; }
.stat-val     { font-size: 28px; font-weight: 700; color: var(--primary); }
.stat-lbl     { font-size: 13px; color: var(--text-muted); }
table.data-table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.data-table th { background: var(--bg); padding: 12px 16px; font-size: 13px; font-weight: 600; text-align: left; border-bottom: 1px solid var(--border); }
table.data-table td { padding: 12px 16px; font-size: 14px; border-bottom: 1px solid var(--border); }
table.data-table tr:last-child td { border-bottom: none; }
.btn-sm { padding: 5px 12px; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; border: 1px solid; }
.btn-green { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.btn-red   { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }

/* FOOTER */
.footer { border-top: 1px solid var(--border); padding: 20px 0; text-align: center; font-size: 13px; color: var(--text-muted); }
.footer a { color: var(--primary); }
.empty-state { color: var(--text-muted); font-size: 14px; padding: 24px 0; }
