/**
 * Loyalty Point — Customer Dashboard Stylesheet (Mobile-first)
 *
 * @package Loyalty_Point
 */

/* =====================================================
   Base
   ===================================================== */
.loyalty-dashboard {
    max-width: 640px;
    margin: 0 auto;
    padding: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: #333;
    -webkit-font-smoothing: antialiased;
}

.loyalty-dashboard *,
.loyalty-dashboard *::before,
.loyalty-dashboard *::after {
    box-sizing: border-box;
}

/* =====================================================
   Login / ID Input
   ===================================================== */
.loyalty-dash-login-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 32px 20px;
    text-align: center;
    color: #fff;
}

.loyalty-dash-login-card h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #fff;
}

.loyalty-dash-login-card p {
    font-size: 14px;
    opacity: 0.9;
    margin: 0 0 24px 0;
}

.loyalty-dash-login-form {
    display: flex;
    gap: 8px;
    max-width: 360px;
    margin: 0 auto;
}

.loyalty-dash-login-form input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.loyalty-dash-login-form input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.loyalty-dash-login-form input:focus {
    border-color: rgba(255, 255, 255, 0.6);
}

.loyalty-dash-login-form .loyalty-btn {
    margin-top: 0;
    white-space: nowrap;
    padding: 12px 24px;
    font-size: 14px;
}

/* =====================================================
   Dashboard Header
   ===================================================== */
.loyalty-dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}

.loyalty-dash-header h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    color: #333;
}

.loyalty-dash-customer-label {
    font-size: 13px;
    color: #666;
    margin: 4px 0 0 0;
}

.loyalty-dash-total-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 16px;
    padding: 12px 24px;
    text-align: center;
    min-width: 120px;
}

.loyalty-dash-total-number {
    display: block;
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    color: #ffd700;
}

.loyalty-dash-total-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
    margin-top: 4px;
    display: block;
}

/* =====================================================
   Stats Cards
   ===================================================== */
.loyalty-dash-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.loyalty-dash-stat-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: box-shadow 0.2s;
}

.loyalty-dash-stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.loyalty-dash-stat-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.loyalty-dash-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    line-height: 1.2;
}

.loyalty-dash-stat-label {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

/* =====================================================
   Tabs
   ===================================================== */
.loyalty-dash-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #eee;
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.loyalty-dash-tabs::-webkit-scrollbar {
    display: none;
}

.loyalty-dash-tab {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #888;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.loyalty-dash-tab:hover {
    color: #667eea;
}

.loyalty-dash-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

/* =====================================================
   Tab Content
   ===================================================== */
.loyalty-dash-section {
    margin-bottom: 24px;
}

.loyalty-dash-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: #333;
}

/* Loading / Empty / Error */
.loyalty-dash-loading,
.loyalty-dash-empty,
.loyalty-dash-error {
    text-align: center;
    padding: 24px;
    color: #888;
    font-size: 14px;
}

.loyalty-dash-error {
    color: #d63638;
}

/* =====================================================
   Recent Activity List
   ===================================================== */
.loyalty-dash-activity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f1;
}

.loyalty-dash-activity-item:last-child {
    border-bottom: none;
}

.loyalty-dash-activity-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.loyalty-dash-activity-source {
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.loyalty-dash-activity-note {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.loyalty-dash-activity-date {
    font-size: 11px;
    color: #aaa;
}

.loyalty-dash-activity-points {
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
    margin-left: 12px;
}

.loyalty-dash-activity-points.positive {
    color: #00a32a;
}

.loyalty-dash-activity-points.negative {
    color: #d63638;
}

/* =====================================================
   Source Bars
   ===================================================== */
.loyalty-dash-source-item {
    margin-bottom: 12px;
}

.loyalty-dash-source-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 4px;
    color: #555;
}

.loyalty-dash-source-bar-bg {
    width: 100%;
    height: 8px;
    background: #f0f0f1;
    border-radius: 4px;
    overflow: hidden;
}

.loyalty-dash-source-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.5s ease;
    min-width: 2px;
}

/* =====================================================
   History Table
   ===================================================== */
.loyalty-dash-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.loyalty-dash-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.loyalty-dash-table th {
    text-align: left;
    padding: 8px 10px;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #eee;
    font-size: 12px;
    white-space: nowrap;
}

.loyalty-dash-table td {
    padding: 10px;
    border-bottom: 1px solid #f0f0f1;
    vertical-align: middle;
}

.loyalty-dash-td-date {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
}

.loyalty-dash-td-note {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.loyalty-dash-td-points {
    font-weight: 700;
    white-space: nowrap;
}

.loyalty-dash-td-points.positive {
    color: #00a32a;
}

.loyalty-dash-td-points.negative {
    color: #d63638;
}

.loyalty-dash-source-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #f0f0f1;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

/* =====================================================
   Scratch History Items
   ===================================================== */
.loyalty-dash-scratch-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid #eee;
    border-radius: 10px;
    margin-bottom: 10px;
    transition: box-shadow 0.2s;
}

.loyalty-dash-scratch-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.loyalty-dash-scratch-item.winner {
    border-color: #d4edda;
    background: #f9fdf9;
}

.loyalty-dash-scratch-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.loyalty-dash-scratch-info {
    flex: 1;
    min-width: 0;
}

.loyalty-dash-scratch-campaign {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.loyalty-dash-scratch-prize {
    font-size: 13px;
    color: #00a32a;
    font-weight: 500;
    margin-top: 2px;
}

.loyalty-dash-scratch-result {
    font-size: 13px;
    color: #888;
    font-style: italic;
    margin-top: 2px;
}

.loyalty-dash-scratch-date {
    font-size: 11px;
    color: #aaa;
    margin-top: 2px;
}

.loyalty-dash-claimed-badge {
    display: inline-block;
    padding: 1px 6px;
    background: #d4edda;
    color: #155724;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    vertical-align: middle;
}

/* =====================================================
   Claim Items
   ===================================================== */
.loyalty-dash-claim-item {
    padding: 12px;
    border: 1px solid #eee;
    border-radius: 10px;
    margin-bottom: 10px;
}

.loyalty-dash-claim-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.loyalty-dash-claim-prize {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.loyalty-dash-claim-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.loyalty-dash-claim-status.status-pending {
    background: #fff3cd;
    color: #856404;
}

.loyalty-dash-claim-status.status-verified {
    background: #d1ecf1;
    color: #0c5460;
}

.loyalty-dash-claim-status.status-shipping {
    background: #e8f0fe;
    color: #2271b1;
}

.loyalty-dash-claim-status.status-completed {
    background: #edfaef;
    color: #00a32a;
}

.loyalty-dash-claim-status.status-rejected {
    background: #fcf0f1;
    color: #d63638;
}

.loyalty-dash-claim-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 12px;
    color: #888;
}

/* =====================================================
   Pagination
   ===================================================== */
.loyalty-dash-page-nav {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
}

.loyalty-dash-page-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    color: #555;
}

.loyalty-dash-page-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.loyalty-dash-page-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
}

/* =====================================================
   Buttons (shared)
   ===================================================== */
.loyalty-dashboard .loyalty-btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.loyalty-dashboard .loyalty-btn-primary {
    background: #fff;
    color: #667eea;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.loyalty-dashboard .loyalty-btn-primary:hover {
    background: #f0f0ff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* =====================================================
   Responsive — Small screens (< 400px)
   ===================================================== */
@media (max-width: 399px) {
    .loyalty-dashboard {
        padding: 12px;
    }

    .loyalty-dash-login-form {
        flex-direction: column;
    }

    .loyalty-dash-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .loyalty-dash-total-badge {
        width: 100%;
        padding: 10px 16px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .loyalty-dash-total-number {
        font-size: 22px;
    }

    .loyalty-dash-total-label {
        margin-top: 0;
    }

    .loyalty-dash-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .loyalty-dash-stat-value {
        font-size: 20px;
    }

    .loyalty-dash-tab {
        padding: 8px 12px;
        font-size: 12px;
    }

    .loyalty-dash-claim-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* =====================================================
   Gamification — Tier Progress
   ===================================================== */
.loyalty-tier-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 24px 20px;
    color: #fff;
    text-align: center;
}

.loyalty-tier-current {
    margin-bottom: 16px;
}

.loyalty-tier-icon {
    font-size: 48px;
    margin-bottom: 8px;
    line-height: 1;
}

.loyalty-tier-name {
    font-size: 22px;
    font-weight: 700;
}

.loyalty-tier-multiplier {
    font-size: 13px;
    opacity: 0.9;
    margin-top: 4px;
}

.loyalty-tier-progress-bar-wrap {
    margin: 16px 0;
}

.loyalty-tier-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 6px;
}

.loyalty-tier-bar-bg {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    overflow: hidden;
}

.loyalty-tier-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd700, #ffb347);
    border-radius: 5px;
    transition: width 0.8s ease;
}

.loyalty-tier-progress-text {
    font-size: 13px;
    opacity: 0.9;
    margin-top: 8px;
}

.loyalty-tier-max {
    font-size: 14px;
    margin-top: 8px;
    opacity: 0.9;
    font-style: italic;
}

.loyalty-tier-lifetime {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 13px;
    opacity: 0.8;
}

/* =====================================================
   Gamification — Badge Gallery
   ===================================================== */
.loyalty-badge-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
}

.loyalty-badge-item {
    text-align: center;
    padding: 16px 8px;
    border: 1px solid #eee;
    border-radius: 12px;
    transition: all 0.3s;
}

.loyalty-badge-item.earned {
    border-color: #d4edda;
    background: #f9fdf9;
}

.loyalty-badge-item.locked {
    opacity: 0.4;
    filter: grayscale(1);
}

.loyalty-badge-icon {
    font-size: 36px;
    line-height: 1;
    margin-bottom: 8px;
}

.loyalty-badge-name {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.loyalty-badge-desc {
    font-size: 10px;
    color: #888;
}

.loyalty-badge-date {
    font-size: 10px;
    color: #00a32a;
    margin-top: 4px;
}

/* =====================================================
   Gamification — Mini Leaderboard
   ===================================================== */
.loyalty-mini-lb-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f1;
}

.loyalty-mini-lb-row:last-child {
    border-bottom: none;
}

.loyalty-mini-lb-row.is-me {
    background: #f0f0ff;
    border-radius: 8px;
    padding: 10px 12px;
    margin: 0 -12px;
}

.loyalty-mini-lb-rank {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f0f0f1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #555;
    flex-shrink: 0;
}

.loyalty-mini-lb-rank.rank-1 { background: #fff3cd; color: #856404; }
.loyalty-mini-lb-rank.rank-2 { background: #e8e8e8; color: #555; }
.loyalty-mini-lb-rank.rank-3 { background: #f5e6cc; color: #8b6914; }

.loyalty-mini-lb-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.loyalty-mini-lb-points {
    font-size: 14px;
    font-weight: 700;
    color: #667eea;
    flex-shrink: 0;
}

.loyalty-mini-lb-empty {
    text-align: center;
    padding: 16px;
    color: #888;
    font-size: 13px;
}

.loyalty-mini-lb-me {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid #667eea;
    text-align: center;
    font-size: 14px;
    color: #667eea;
    font-weight: 600;
}

/* =====================================================
   Leaderboard Shortcode — Public
   ===================================================== */
.loyalty-leaderboard {
    max-width: 480px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.loyalty-leaderboard-header {
    text-align: center;
    margin-bottom: 20px;
}

.loyalty-leaderboard-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: #333;
}

.loyalty-leaderboard-tabs {
    display: inline-flex;
    gap: 4px;
    background: #f0f0f1;
    border-radius: 8px;
    padding: 3px;
}

.loyalty-lb-tab {
    padding: 6px 16px;
    border: none;
    background: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    transition: all 0.2s;
}

.loyalty-lb-tab.active {
    background: #667eea;
    color: #fff;
}

.loyalty-lb-tab:hover:not(.active) {
    color: #333;
}

/* Podium */
.loyalty-lb-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 20px;
    padding: 20px 0;
}

.loyalty-lb-podium-item {
    text-align: center;
    padding: 16px 12px;
    border-radius: 16px;
    background: #fff;
    border: 2px solid #eee;
    min-width: 100px;
    transition: transform 0.2s;
}

.loyalty-lb-podium-item:hover {
    transform: translateY(-4px);
}

.loyalty-lb-rank-1 {
    border-color: #ffd700;
    background: linear-gradient(180deg, #fffdf0, #fff);
    order: 2;
    transform: scale(1.05);
}

.loyalty-lb-rank-2 {
    border-color: #c0c0c0;
    order: 1;
}

.loyalty-lb-rank-3 {
    border-color: #cd7f32;
    order: 3;
}

.loyalty-lb-medal {
    font-size: 32px;
    line-height: 1;
    margin-bottom: 8px;
}

.loyalty-lb-podium-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 120px;
}

.loyalty-lb-podium-points {
    font-size: 20px;
    font-weight: 800;
    color: #667eea;
}

.loyalty-lb-podium-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Rest of leaderboard */
.loyalty-lb-rest {
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
}

.loyalty-lb-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f1;
}

.loyalty-lb-row:last-child {
    border-bottom: none;
}

.loyalty-lb-rank {
    width: 28px;
    font-size: 14px;
    font-weight: 700;
    color: #888;
    text-align: center;
    flex-shrink: 0;
}

.loyalty-lb-name {
    flex: 1;
    font-size: 14px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.loyalty-lb-points {
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
    flex-shrink: 0;
}

.loyalty-leaderboard-empty {
    text-align: center;
    padding: 32px;
    color: #888;
    font-size: 14px;
}

@media (max-width: 399px) {
    .loyalty-badge-gallery {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .loyalty-badge-icon {
        font-size: 28px;
    }

    .loyalty-lb-podium {
        gap: 8px;
    }

    .loyalty-lb-podium-item {
        min-width: 80px;
        padding: 12px 8px;
    }

    .loyalty-lb-podium-name {
        max-width: 80px;
        font-size: 12px;
    }

    .loyalty-lb-podium-points {
        font-size: 16px;
    }
}

/* =====================================================
   Referral — Dashboard Tab
   ===================================================== */
.loyalty-referral-code-wrap {
    text-align: center;
}

.loyalty-referral-code-card {
    background: linear-gradient(135deg, #00b09b 0%, #96c93d 100%);
    border-radius: 16px;
    padding: 24px 20px;
    color: #fff;
    text-align: center;
}

.loyalty-referral-code-display {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: 3px;
    margin: 12px 0;
    font-family: monospace;
}

.loyalty-referral-code-label {
    font-size: 13px;
    opacity: 0.9;
}

.loyalty-referral-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.loyalty-referral-stat {
    text-align: center;
}

.loyalty-referral-stat-value {
    font-size: 22px;
    font-weight: 700;
}

.loyalty-referral-stat-label {
    font-size: 11px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.loyalty-referral-copy-btn {
    margin-top: 16px;
    padding: 10px 24px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.loyalty-referral-copy-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
}

.loyalty-referral-copy-btn.copied {
    background: rgba(255, 255, 255, 0.3);
    border-color: #fff;
}

/* Share Buttons */
.loyalty-share-buttons-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.loyalty-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    transition: all 0.2s;
}

.loyalty-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.loyalty-share-wa { background: #25D366; color: #fff; }
.loyalty-share-fb { background: #1877F2; color: #fff; }
.loyalty-share-tw { background: #1DA1F2; color: #fff; }
.loyalty-share-tg { background: #0088cc; color: #fff; }

/* Referral History */
.loyalty-referral-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f1;
}

.loyalty-referral-history-item:last-child {
    border-bottom: none;
}

.loyalty-referral-history-info {
    font-size: 13px;
    color: #555;
}

.loyalty-referral-history-date {
    font-size: 12px;
    color: #aaa;
}

.loyalty-referral-history-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: #edfaef;
    color: #00a32a;
}

/* Apply Referral Form */
.loyalty-referral-apply-form {
    display: flex;
    gap: 8px;
    max-width: 360px;
}

.loyalty-referral-apply-form input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    text-transform: uppercase;
}

.loyalty-referral-apply-form input:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.loyalty-referral-apply-form .loyalty-btn {
    margin-top: 0;
    padding: 10px 20px;
    font-size: 14px;
}

#loyalty-referral-apply-result {
    margin-top: 8px;
    font-size: 13px;
}

#loyalty-referral-apply-result.success {
    color: #00a32a;
}

#loyalty-referral-apply-result.error {
    color: #d63638;
}

/* Share Widget (shortcode) */
.loyalty-share-widget {
    max-width: 400px;
    margin: 20px auto;
    text-align: center;
}

.loyalty-share-code-box {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    background: #f6f7f7;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.loyalty-share-label {
    font-size: 13px;
    color: #666;
}

.loyalty-share-code {
    font-size: 18px;
    font-weight: 700;
    font-family: monospace;
    letter-spacing: 2px;
    color: #667eea;
}

.loyalty-share-copy-btn {
    padding: 4px 12px;
    border: 1px solid #667eea;
    border-radius: 6px;
    background: none;
    color: #667eea;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.loyalty-share-copy-btn:hover {
    background: #667eea;
    color: #fff;
}

/* =====================================================
   Responsive — Tablet+ (>= 768px)
   ===================================================== */
@media (min-width: 768px) {
    .loyalty-dashboard {
        padding: 24px;
    }

    .loyalty-dash-stats {
        grid-template-columns: repeat(4, 1fr);
    }

    .loyalty-dash-header h2 {
        font-size: 26px;
    }

    .loyalty-dash-total-number {
        font-size: 32px;
    }

    .loyalty-badge-gallery {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }
}

@media (max-width: 399px) {
    .loyalty-share-buttons-wrap {
        flex-direction: column;
    }

    .loyalty-referral-apply-form {
        flex-direction: column;
    }

    .loyalty-referral-stats {
        gap: 16px;
    }
}

/* ===========================
   Notification Bell & Tab
   =========================== */

.loyalty-dash-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.loyalty-notification-bell {
    position: relative;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 50%;
    transition: background 0.2s;
}

.loyalty-notification-bell:hover {
    background: rgba(0, 0, 0, 0.05);
}

.loyalty-notification-count {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #e53e3e;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 8px;
    padding: 0 4px;
}

.loyalty-notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.loyalty-notifications-header h3 {
    margin: 0;
}

.loyalty-btn-sm {
    font-size: 12px;
    padding: 4px 10px;
}

.loyalty-notification-item {
    padding: 12px;
    border-bottom: 1px solid #eee;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.loyalty-notification-item:last-child {
    border-bottom: none;
}

.loyalty-notification-item.unread {
    background: #f0f7ff;
    border-left: 3px solid #3182ce;
}

.loyalty-notification-item .notif-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.loyalty-notification-item .notif-body {
    flex: 1;
}

.loyalty-notification-item .notif-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.loyalty-notification-item .notif-message {
    font-size: 13px;
    color: #555;
}

.loyalty-notification-item .notif-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

.loyalty-notification-pref-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.loyalty-notification-pref-row:last-child {
    border-bottom: none;
}

.loyalty-notification-pref-row label {
    font-size: 13px;
}

.loyalty-notification-pref-row .pref-toggles {
    display: flex;
    gap: 12px;
}

.loyalty-notification-pref-row .pref-toggles label {
    font-size: 12px;
    color: #666;
}

/* ===========================
   Marketplace Tab
   =========================== */

.loyalty-marketplace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.loyalty-marketplace-header h3 {
    margin: 0;
}

.loyalty-marketplace-balance {
    font-size: 14px;
    color: #555;
}

.loyalty-marketplace-balance strong {
    color: #2563eb;
    font-size: 18px;
}

.loyalty-marketplace-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.loyalty-marketplace-filter-btn {
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.loyalty-marketplace-filter-btn:hover,
.loyalty-marketplace-filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.loyalty-marketplace-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.loyalty-marketplace-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.loyalty-marketplace-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.loyalty-marketplace-item-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
}

.loyalty-marketplace-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.loyalty-marketplace-item-body {
    padding: 12px;
}

.loyalty-marketplace-item-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.loyalty-marketplace-item-category {
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 8px;
}

.loyalty-marketplace-item-cost {
    font-size: 16px;
    font-weight: 700;
    color: #2563eb;
    margin-bottom: 8px;
}

.loyalty-marketplace-item-stock {
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 8px;
}

.loyalty-marketplace-item-btn {
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 6px;
    background: #2563eb;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.loyalty-marketplace-item-btn:hover {
    background: #1d4ed8;
}

.loyalty-marketplace-item-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.loyalty-marketplace-item-btn.out-of-stock {
    background: #ef4444;
}

/* Marketplace Modal */
.loyalty-marketplace-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loyalty-marketplace-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.loyalty-marketplace-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    max-width: 480px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.loyalty-marketplace-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
}

.loyalty-marketplace-shipping {
    margin-top: 16px;
}

.loyalty-marketplace-shipping h4 {
    margin: 0 0 12px;
}

.loyalty-marketplace-modal-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.loyalty-marketplace-modal-actions .loyalty-btn {
    flex: 1;
}

/* Redemption history item */
.loyalty-marketplace-history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.loyalty-marketplace-history-item:last-child {
    border-bottom: none;
}

.loyalty-marketplace-history-item .mp-hist-img {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    background: #f3f4f6;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loyalty-marketplace-history-item .mp-hist-body {
    flex: 1;
}

.loyalty-marketplace-history-item .mp-hist-name {
    font-weight: 600;
    font-size: 13px;
}

.loyalty-marketplace-history-item .mp-hist-meta {
    font-size: 11px;
    color: #6b7280;
}

.loyalty-marketplace-history-item .mp-hist-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.mp-hist-status.status-pending { background: #fef3c7; color: #92400e; }
.mp-hist-status.status-approved { background: #dbeafe; color: #1e40af; }
.mp-hist-status.status-shipped { background: #d1fae5; color: #065f46; }
.mp-hist-status.status-completed { background: #d1fae5; color: #065f46; }
.mp-hist-status.status-rejected { background: #fee2e2; color: #991b1b; }

@media (max-width: 480px) {
    .loyalty-marketplace-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .loyalty-marketplace-modal-content {
        width: 95%;
        padding: 16px;
    }
}

/* =====================================================
   Profile Tab
   ===================================================== */
.loyalty-profile-form-group {
    margin-bottom: 16px;
}

.loyalty-profile-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.loyalty-profile-form-group input,
.loyalty-profile-form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.loyalty-profile-form-group input:focus,
.loyalty-profile-form-group textarea:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.loyalty-profile-feedback {
    display: inline-block;
    margin-left: 12px;
    font-size: 13px;
    font-weight: 500;
    vertical-align: middle;
}

.loyalty-profile-feedback.success {
    color: #00a32a;
}

.loyalty-profile-feedback.error {
    color: #d63638;
}

/* Transfer Section */
#loyalty-transfer-section {
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.loyalty-transfer-form-row {
    margin-bottom: 14px;
}

.loyalty-transfer-form-row label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.loyalty-transfer-form-row input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.loyalty-transfer-form-row input:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

/* Statement */
.loyalty-statement-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 16px;
}

.loyalty-statement-controls .loyalty-date-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.loyalty-statement-controls label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
}

.loyalty-statement-controls input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 13px;
}

.loyalty-statement-controls input[type="date"]:focus {
    border-color: #667eea;
    outline: none;
}

.loyalty-statement-controls .loyalty-btn {
    padding: 8px 20px;
    font-size: 13px;
    border-radius: 8px;
    background: #667eea;
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.loyalty-statement-controls .loyalty-btn:hover {
    background: #5a6fd6;
}

.loyalty-statement-summary {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.loyalty-statement-stat {
    flex: 1;
    min-width: 100px;
    text-align: center;
    padding: 12px;
    background: #f6f7f7;
    border-radius: 10px;
}

.loyalty-statement-stat span {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 4px;
}

.loyalty-statement-stat strong {
    font-size: 18px;
    color: #333;
}

@media (max-width: 480px) {
    .loyalty-statement-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .loyalty-statement-summary {
        flex-direction: column;
    }
}

/* =====================================================
   Point Expiry Banner
   ===================================================== */
.loyalty-dash-expiry-banner {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #92400e;
}

.loyalty-dash-expiry-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.loyalty-dash-expiry-text {
    line-height: 1.4;
}

/* Promo banner */
.loyalty-dash-promo-banner {
    background: linear-gradient(135deg, #ede9fe, #fae8ff);
    border: 1px solid #c084fc;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #581c87;
}

.loyalty-dash-promo-item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0;
}

.loyalty-dash-promo-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.loyalty-dash-promo-desc {
    color: #7c3aed;
    font-size: 12px;
}

.loyalty-dash-promo-ends {
    font-size: 11px;
    background: #c084fc;
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: auto;
}

/* Profile form description */
.loyalty-form-desc {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

/* Survey Popup */
.loyalty-survey-popup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    max-width: 380px;
    width: 100%;
    animation: loyaltySurveySlideIn 0.3s ease-out;
}

@keyframes loyaltySurveySlideIn {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.loyalty-survey-content {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
    position: relative;
}

.loyalty-survey-content h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    color: #1f2937;
}

.loyalty-survey-content p {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: #6b7280;
}

.loyalty-survey-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 20px;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
}

.loyalty-survey-close:hover {
    color: #1f2937;
}

.loyalty-survey-stars {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.loyalty-star {
    font-size: 32px;
    color: #f59e0b;
    cursor: pointer;
    transition: transform 0.15s;
    user-select: none;
}

.loyalty-star:hover {
    transform: scale(1.2);
}

.loyalty-nps-scale {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 8px;
    flex-wrap: wrap;
}

.loyalty-nps-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.loyalty-nps-btn:hover {
    border-color: #6366f1;
    color: #6366f1;
}

.loyalty-nps-btn.active {
    background: #6366f1;
    color: #fff;
    border-color: #6366f1;
}

@media (max-width: 480px) {
    .loyalty-survey-popup {
        bottom: 0;
        right: 0;
        left: 0;
        max-width: none;
    }
    .loyalty-survey-content {
        border-radius: 12px 12px 0 0;
    }
}
