/* Base / Container */
.tsr-ce-container { max-width: 900px; margin: 0 auto; padding: 20px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif; }

/* Cards */
.tsr-ce-card { background: #fff; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06); padding: 24px; margin-bottom: 20px; border: 1px solid #e5e7eb; }

/* Wallet Summary */
.tsr-ce-wallet-card { background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff; border: none; }
.tsr-ce-wallet-card .tsr-ce-stat-value { color: #fff; font-size: 42px; font-weight: 800; }
.tsr-ce-wallet-card .tsr-ce-stat-label { color: rgba(255,255,255,0.8); }
.tsr-ce-wallet-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 20px; }
.tsr-ce-wallet-stats .tsr-ce-stat { text-align: center; padding: 12px; background: rgba(255,255,255,0.15); border-radius: 8px; }
.tsr-ce-wallet-stats .tsr-ce-stat-value { font-size: 24px; font-weight: 700; }
.tsr-ce-wallet-stats .tsr-ce-stat-label { font-size: 12px; color: rgba(255,255,255,0.8); }

/* Stats Grid */
.tsr-ce-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.tsr-ce-stat { text-align: center; padding: 16px; }
.tsr-ce-stat-value { font-size: 32px; font-weight: 700; color: #1f2937; }
.tsr-ce-stat-label { font-size: 13px; color: #6b7280; margin-top: 4px; }

/* Sections */
.tsr-ce-section { margin-bottom: 24px; }
.tsr-ce-section-title { font-size: 18px; font-weight: 600; color: #1f2937; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid #4f46e5; display: inline-block; }

/* Badges */
.tsr-ce-badge { display: inline-block; padding: 3px 12px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.tsr-ce-badge-success { background: #dcfce7; color: #166534; }
.tsr-ce-badge-warning { background: #fef3c7; color: #92400e; }
.tsr-ce-badge-danger { background: #fee2e2; color: #991b1b; }
.tsr-ce-badge-info { background: #dbeafe; color: #1e40af; }
.tsr-ce-badge-pending { background: #fef3c7; color: #92400e; }
.tsr-ce-badge-approved { background: #dcfce7; color: #166534; }
.tsr-ce-badge-rejected { background: #fee2e2; color: #991b1b; }

/* Tables */
.tsr-ce-table { width: 100%; border-collapse: collapse; }
.tsr-ce-table th { background: #f9fafb; padding: 12px; text-align: left; font-weight: 600; font-size: 13px; color: #374151; border-bottom: 2px solid #e5e7eb; }
.tsr-ce-table td { padding: 10px 12px; border-bottom: 1px solid #f3f4f6; font-size: 14px; color: #4b5563; }
.tsr-ce-table tr:hover { background: #f9fafb; }
.tsr-ce-table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tsr-ce-amount-positive { color: #16a34a; font-weight: 600; }
.tsr-ce-amount-negative { color: #dc2626; font-weight: 600; }

/* Buttons */
.tsr-ce-btn { display: inline-block; padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; border: none; text-decoration: none; transition: all 0.2s; text-align: center; }
.tsr-ce-btn-primary { background: #4f46e5; color: #fff; }
.tsr-ce-btn-primary:hover { background: #4338ca; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,70,229,0.3); }
.tsr-ce-btn-success { background: #16a34a; color: #fff; }
.tsr-ce-btn-success:hover { background: #15803d; }
.tsr-ce-btn-danger { background: #dc2626; color: #fff; }
.tsr-ce-btn-danger:hover { background: #b91c1c; }
.tsr-ce-btn-outline { background: transparent; color: #4f46e5; border: 2px solid #4f46e5; }
.tsr-ce-btn-outline:hover { background: #4f46e5; color: #fff; }
.tsr-ce-btn-sm { padding: 6px 14px; font-size: 12px; }
.tsr-ce-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* Forms */
.tsr-ce-form { max-width: 500px; }
.tsr-ce-form-group { margin-bottom: 20px; }
.tsr-ce-form-label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; color: #374151; }
.tsr-ce-form-input, .tsr-ce-form-select, .tsr-ce-form-textarea { width: 100%; padding: 10px 14px; border: 2px solid #e5e7eb; border-radius: 8px; font-size: 14px; transition: border-color 0.2s, box-shadow 0.2s; box-sizing: border-box; }
.tsr-ce-form-input:focus, .tsr-ce-form-select:focus, .tsr-ce-form-textarea:focus { outline: none; border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }
.tsr-ce-form-textarea { min-height: 100px; resize: vertical; }
.tsr-ce-form-help { font-size: 12px; color: #6b7280; margin-top: 4px; }
.tsr-ce-form-error { font-size: 12px; color: #dc2626; margin-top: 4px; }

/* Alerts */
.tsr-ce-alert { padding: 14px 18px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.tsr-ce-alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.tsr-ce-alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.tsr-ce-alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.tsr-ce-alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }

/* Referral Box */
.tsr-ce-referral-box { background: #f9fafb; border: 2px dashed #d1d5db; border-radius: 12px; padding: 20px; text-align: center; margin-bottom: 16px; }
.tsr-ce-referral-code { font-size: 24px; font-weight: 700; color: #4f46e5; letter-spacing: 2px; font-family: 'Courier New', monospace; }
.tsr-ce-referral-link { word-break: break-all; font-size: 13px; color: #6b7280; background: #fff; padding: 10px; border-radius: 6px; border: 1px solid #e5e7eb; margin: 10px 0; }
.tsr-ce-copy-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; background: #4f46e5; color: #fff; border: none; border-radius: 6px; cursor: pointer; font-size: 13px; transition: background 0.2s; }
.tsr-ce-copy-btn:hover { background: #4338ca; }
.tsr-ce-copy-btn.copied { background: #16a34a; }

/* Share buttons */
.tsr-ce-share-btns { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.tsr-ce-share-btn { padding: 8px 16px; border-radius: 6px; color: #fff; text-decoration: none; font-size: 13px; font-weight: 600; }
.tsr-ce-share-btn.whatsapp { background: #25d366; }
.tsr-ce-share-btn.telegram { background: #0088cc; }
.tsr-ce-share-btn.twitter { background: #1da1f2; }

/* Leaderboard */
.tsr-ce-leaderboard-rank { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.tsr-ce-rank-1 { background: #fef3c7; color: #92400e; }
.tsr-ce-rank-2 { background: #f3f4f6; color: #374151; }
.tsr-ce-rank-3 { background: #fed7aa; color: #9a3412; }

/* Toast Notifications */
.tsr-ce-toast { position: fixed; bottom: 20px; right: 20px; padding: 14px 24px; border-radius: 10px; color: #fff; font-size: 14px; font-weight: 600; z-index: 999999; transform: translateY(20px); opacity: 0; transition: all 0.3s ease; box-shadow: 0 10px 25px rgba(0,0,0,0.15); }
.tsr-ce-toast-show { transform: translateY(0); opacity: 1; }
.tsr-ce-toast-success { background: #16a34a; }
.tsr-ce-toast-info { background: #4f46e5; }
.tsr-ce-toast-warning { background: #f59e0b; color: #1f2937; }
.tsr-ce-toast-error { background: #dc2626; }

/* Visit Timer */
.tsr-ce-visit-timer { position: fixed; bottom: 20px; left: 20px; background: #1f2937; color: #fff; padding: 8px 16px; border-radius: 20px; font-size: 13px; z-index: 999998; display: flex; align-items: center; gap: 8px; }
.tsr-ce-timer-complete { background: #16a34a; }

/* Quick Actions */
.tsr-ce-quick-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

/* Pagination */
.tsr-ce-pagination { margin-top: 20px; display: flex; justify-content: center; gap: 4px; }
.tsr-ce-pagination a, .tsr-ce-pagination span { display: inline-block; padding: 8px 14px; border: 1px solid #d1d5db; border-radius: 6px; text-decoration: none; color: #374151; font-size: 13px; transition: all 0.2s; }
.tsr-ce-pagination a:hover { border-color: #4f46e5; color: #4f46e5; }
.tsr-ce-pagination .current { background: #4f46e5; color: #fff; border-color: #4f46e5; }

/* Responsive */
@media (max-width: 600px) {
    .tsr-ce-container { padding: 12px; }
    .tsr-ce-wallet-stats { grid-template-columns: 1fr; }
    .tsr-ce-wallet-card .tsr-ce-stat-value { font-size: 32px; }
    .tsr-ce-stats-grid { grid-template-columns: 1fr 1fr; }
    .tsr-ce-quick-actions { flex-direction: column; }
    .tsr-ce-quick-actions .tsr-ce-btn { width: 100%; }
}

/* Payment method toggle */
.tsr-ce-payment-fields { display: none; }
.tsr-ce-payment-fields.active { display: block; }

/* ===== Header Wallet Widget ===== */
.tsr-ce-hw{position:fixed;top:12px;right:12px;z-index:999999;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif}
.tsr-ce-hw-trigger{display:flex;align-items:center;gap:8px;background:linear-gradient(135deg,#4f46e5,#7c3aed);color:#fff;border:none;padding:8px 16px;border-radius:25px;cursor:pointer;font-size:14px;font-weight:600;box-shadow:0 2px 12px rgba(79,70,229,0.35);transition:all 0.2s}
.tsr-ce-hw-trigger:hover{transform:translateY(-1px);box-shadow:0 4px 16px rgba(79,70,229,0.45)}
.tsr-ce-hw-icon{display:flex;align-items:center}
.tsr-ce-hw-balance{font-weight:700;min-width:30px;text-align:right}
.tsr-ce-hw-earned-badge{font-size:11px;opacity:0.85;background:rgba(255,255,255,0.2);padding:2px 8px;border-radius:10px}
.tsr-ce-hw-dropdown{position:absolute;top:calc(100% + 8px);right:0;background:#fff;border-radius:12px;box-shadow:0 10px 40px rgba(0,0,0,0.15);min-width:240px;overflow:hidden;border:1px solid #e5e7eb}
.tsr-ce-hw-user{padding:14px 16px;background:#f9fafb;border-bottom:1px solid #e5e7eb}
.tsr-ce-hw-name{font-weight:600;font-size:14px;color:#1f2937}
.tsr-ce-hw-email{font-size:12px;color:#6b7280;margin-top:2px}
.tsr-ce-hw-stats{display:flex;padding:12px 16px;gap:12px;border-bottom:1px solid #f3f4f6}
.tsr-ce-hw-stat{flex:1;text-align:center}
.tsr-ce-hw-stat-val{display:block;font-size:18px;font-weight:700;color:#1f2937}
.tsr-ce-hw-stat-lbl{display:block;font-size:11px;color:#6b7280;margin-top:2px}
.tsr-ce-hw-earned{color:#16a34a}
.tsr-ce-hw-links{padding:8px}
.tsr-ce-hw-links a{display:block;padding:10px 16px;color:#374151;text-decoration:none;font-size:14px;transition:background 0.15s}
.tsr-ce-hw-links a:hover{background:#f3f4f6}
.tsr-ce-hw-links a:last-child{color:#dc2626;border-top:1px solid #f3f4f6}

/* Guest (non-logged-in) header widget */
.tsr-ce-hw-guest{top:auto;right:12px}
.tsr-ce-hw-guest-buttons{display:flex;align-items:center;gap:8px}
.tsr-ce-hw-login-btn{display:flex;align-items:center;gap:6px;background:linear-gradient(135deg,#4f46e5,#7c3aed);color:#fff!important;text-decoration:none;padding:8px 18px;border-radius:25px;font-size:14px;font-weight:600;box-shadow:0 2px 12px rgba(79,70,229,0.35);transition:all 0.2s}
.tsr-ce-hw-login-btn:hover{transform:translateY(-1px);box-shadow:0 4px 16px rgba(79,70,229,0.45);color:#fff!important}
.tsr-ce-hw-register-btn{display:flex;align-items:center;gap:6px;background:transparent;color:#4f46e5!important;text-decoration:none;padding:8px 18px;border-radius:25px;font-size:14px;font-weight:600;border:2px solid #4f46e5;transition:all 0.2s}
.tsr-ce-hw-register-btn:hover{background:#4f46e5;color:#fff!important}

@media(max-width:600px){.tsr-ce-hw{top:8px;right:8px}.tsr-ce-hw-trigger{padding:6px 12px;font-size:13px}.tsr-ce-hw-dropdown{right:-8px;min-width:220px}.tsr-ce-hw-earned-badge{display:none}.tsr-ce-hw-guest{top:auto;right:8px}.tsr-ce-hw-login-btn,.tsr-ce-hw-register-btn{padding:6px 12px;font-size:12px}}

/* Login/Register tabs */
.tsr-ce-auth-tabs{display:flex;border-bottom:2px solid #e5e7eb;margin-bottom:24px}
.tsr-ce-auth-tab{flex:1;padding:12px;text-align:center;cursor:pointer;font-weight:600;font-size:14px;color:#6b7280;border-bottom:2px solid transparent;margin-bottom:-2px;transition:all 0.2s}
.tsr-ce-auth-tab:hover{color:#4f46e5}
.tsr-ce-auth-tab.active{color:#4f46e5;border-bottom-color:#4f46e5}
.tsr-ce-tab-content{display:none}
.tsr-ce-tab-content.active{display:block}
.tsr-ce-google-btn{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;padding:12px;border:2px solid #e5e7eb;border-radius:8px;background:#fff;cursor:pointer;font-size:15px;font-weight:500;color:#374151;transition:all 0.2s;margin-bottom:16px}
.tsr-ce-google-btn:hover{background:#f9fafb;border-color:#4f46e5}
.tsr-ce-google-btn svg{width:20px;height:20px}
.tsr-ce-divider{text-align:center;margin:16px 0;position:relative;color:#9ca3af;font-size:13px}
.tsr-ce-divider::before,.tsr-ce-divider::after{content:'';position:absolute;top:50%;width:calc(50% - 30px);height:1px;background:#e5e7eb}
.tsr-ce-divider::before{left:0}
.tsr-ce-divider::after{right:0}
.tsr-ce-otp-row{display:flex;gap:8px}
.tsr-ce-otp-row .tsr-ce-form-input{flex:1}
.tsr-ce-otp-send-btn{white-space:nowrap;min-width:120px}
.tsr-ce-otp-timer{font-size:13px;color:#6b7280;margin-top:6px}
.tsr-ce-otp-verified{display:none;background:#f0fdf4;border:1px solid #bbf7d0;color:#166534;padding:12px;border-radius:8px;text-align:center;margin-bottom:16px}
.tsr-ce-otp-verified.active{display:block}