/* Xonex Fidelity — Public Styles */
:root {
    --xonex-primary:   #1e40af;
    --xonex-secondary: #dbeafe;
    --xonex-accent:    #f59e0b;
    --xonex-font:      'Inter', sans-serif;
}

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

html, body {
    font-family: var(--xonex-font);
}

.xonex-wrap-public {
    font-family: var(--xonex-font);
    max-width: 520px;
    margin: 0 auto;
    padding: 16px;
}
/* Forziamo il font su elementi critici se il container non basta */
.xonex-wrap-public button, 
.xonex-wrap-public input, 
.xonex-wrap-public select, 
.xonex-wrap-public textarea,
.xonex-home-portal,
.xonex-home-portal * {
    font-family: var(--xonex-font) !important;
}
/* Forziamo anche titoli ed elementi di testo comuni nel portale */
.xonex-home-portal h1,
.xonex-home-portal h2,
.xonex-home-portal h3,
.xonex-home-portal h4,
.xonex-home-portal p,
.xonex-home-portal span {
    font-family: var(--xonex-font) !important;
}

/* ---- Header Card ---- */
.xonex-header-card {
    background: linear-gradient(135deg, var(--xonex-primary), color-mix(in srgb, var(--xonex-primary) 60%, #000));
    color: #fff;
    border-radius: 20px;
    padding: 28px 24px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.xonex-brand-logo { max-height: 48px; margin-bottom: 12px; filter: brightness(0) invert(1); }
.xonex-customer-name { font-size: 1.15rem; font-weight: 600; opacity: .9; }
.xonex-points-balance { font-size: 3rem; font-weight: 800; line-height: 1; margin: 8px 0 4px; }
.xonex-points-balance span { font-size: 1rem; font-weight: 400; opacity: .75; }
.xonex-header-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,.3);
    overflow: hidden;
    background: rgba(255,255,255,.1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.xonex-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---- Tabs ---- */
.xonex-tabs { display: flex; gap: 6px; margin-bottom: 20px; background: #f1f5f9; padding: 4px; border-radius: 12px; }
.xonex-tab {
    flex: 1;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px 6px;
    border: none;
    background: transparent;
    border-radius: 9px;
    font-size: .88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
    color: #64748b;
}
.xonex-tab-ico { line-height: 1; flex-shrink: 0; }
.xonex-tab-txt { line-height: 1.15; text-align: center; }
.xonex-tab.active { background: #fff; color: var(--xonex-primary); font-weight: 700; box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.xonex-tab-panel { display: none; }
.xonex-tab-panel.active { display: block; }

/* ---- Virtual Card / QR ---- */
.xonex-virtual-card { background: #fff; border-radius: 16px; padding: 32px 20px; text-align: center; box-shadow: 0 2px 12px rgba(0,0,0,.08); margin-bottom: 20px; }
#xonex-qr-container { display: inline-block; }
.xonex-qr-hint { font-size: .85rem; color: #94a3b8; margin-top: 12px; }

/* ---- Progress Bar ---- */
.xonex-progress-section { background: #fff; border-radius: 16px; padding: 20px; margin-bottom: 20px; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.xonex-progress-label { display: flex; justify-content: space-between; font-size: .88rem; color: #475569; margin-bottom: 10px; }
.xonex-progress-bar-track { background: var(--xonex-secondary); border-radius: 999px; height: 14px; overflow: hidden; }
.xonex-progress-bar-fill { background: var(--xonex-accent); height: 100%; border-radius: 999px; transition: width .8s ease; }
.xonex-progress-percent { text-align: right; font-size: .8rem; color: #94a3b8; margin-top: 6px; }
.xonex-progress-pct { text-align: center; font-size: .82rem; color: #94a3b8; margin-top: 6px; }

/* ---- Level Badge (nell'header) ---- */
.xonex-level-badge {
    display: inline-block;
    margin-top: 10px;
    background: rgba(255,255,255,.2);
    color: #fff;
    font-weight: 700;
    font-size: .85rem;
    padding: 4px 14px;
    border-radius: 999px;
    letter-spacing: .03em;
    backdrop-filter: blur(4px);
}

/* ---- Stats Grid ---- */
.xonex-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}
.xonex-stat-card {
    background: #fff;
    border-radius: 14px;
    padding: 16px 14px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.xonex-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.xonex-stat-icon svg { width: 20px; height: 20px; }
.xonex-stat-icon--earn   { background: #d1fae5; color: #059669; }
.xonex-stat-icon--redeem { background: #fee2e2; color: #dc2626; }
.xonex-stat-icon--days   { background: #e0f2fe; color: #0284c7; }
.xonex-stat-icon--tx     { background: #ede9fe; color: #7c3aed; }
.xonex-stat-value { font-size: 1.5rem; font-weight: 900; color: #1e293b; line-height: 1; }
.xonex-stat-label { font-size: .75rem; font-weight: 500; color: #94a3b8; text-transform: uppercase; letter-spacing: .04em; }

/* ---- Level Section ---- */
.xonex-level-section {
    background: #fff;
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.xonex-level-header { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.xonex-level-title  { font-size: 1rem; font-weight: 800; color: #1e293b; }
.xonex-level-sub    { font-size: .82rem; color: #64748b; margin-top: 4px; }
.xonex-level-fill   { background: linear-gradient(90deg, var(--xonex-accent), var(--xonex-primary)); }

/* ---- Chart ---- */
.xonex-chart-section {
    background: #fff;
    border-radius: 16px;
    padding: 18px 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.xonex-chart-title { font-size: .88rem; font-weight: 700; color: #475569; margin-bottom: 14px; }
.xonex-chart-wrap  { position: relative; }

/* ---- Banners ---- */
.xonex-banners { margin-bottom: 20px; }
.xonex-banner-link { display: block; margin-bottom: 12px; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.xonex-banner-img { width: 100%; height: auto; display: block; }

/* ---- Reward Cards ---- */
.xonex-reward-card { display: flex; align-items: center; gap: 14px; background: #fff; border-radius: 14px; padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 6px rgba(0,0,0,.07); border: 2px solid transparent; }
.xonex-reward-card.xonex-redeemable { border-color: #10b981; }
.xonex-reward-photo { width: 70px; height: 70px; object-fit: cover; border-radius: 10px; flex-shrink: 0; }
.xonex-reward-photo-placeholder { width: 70px; height: 70px; border-radius: 10px; flex-shrink: 0; background: #f1f5f9; display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.xonex-reward-points svg { vertical-align: middle; color: var(--xonex-accent); margin-right: 3px; }
.xonex-reward-info { flex: 1; }
.xonex-reward-name { font-weight: 700; color: #1e293b; margin-bottom: 4px; }
.xonex-reward-desc { font-size: .83rem; color: #64748b; margin-bottom: 6px; }
.xonex-reward-points { font-size: .88rem; font-weight: 600; color: var(--xonex-primary); }
.xonex-badge-green { background: #d1fae5; color: #065f46; font-size: .78rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.xonex-badge-gray  { background: #f1f5f9; color: #64748b; font-size: .78rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }

/* ---- Storico Transazioni ---- */
.xonex-tx-list { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.xonex-tx-row { display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; border-bottom: 1px solid #f1f5f9; }
.xonex-tx-row .xonex-tx-icon { margin-top: 2px; }
.xonex-tx-row:last-child { border-bottom: none; }
.xonex-tx-icon { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.xonex-tx-earn     { background: #d1fae5; color: #065f46; }
.xonex-tx-redeem   { background: #fee2e2; color: #991b1b; }
.xonex-tx-birthday { background: #fef3c7; color: #92400e; }
.xonex-tx-event    { background: #ede9fe; color: #5b21b6; }
.xonex-tx-manual   { background: #e0f2fe; color: #075985; }
.xonex-tx-details  { flex: 1; }
.xonex-tx-label    { font-size: .9rem; font-weight: 600; color: #1e293b; }
.xonex-tx-date     { font-size: .78rem; color: #94a3b8; margin-top: 2px; }
.xonex-tx-amount   { font-size: .82rem; font-weight: 600; color: #475569; margin-top: 4px; }
.xonex-tx-points   { font-size: 1.1rem; font-weight: 800; margin-top: 2px; flex-shrink: 0; }
.xonex-positive { color: #059669; }
.xonex-negative { color: #dc2626; }

/* ---- Forms ---- */
.xonex-form { background: #fff; border-radius: 16px; padding: 24px; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.xonex-profile-password-block {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid #e2e8f0;
}
.xonex-profile-password-title {
    margin: 0 0 8px;
    font-size: 1.05rem;
    font-weight: 800;
    color: #1e293b;
}
.xonex-profile-password-hint {
    margin: 0 0 16px;
    font-size: .86rem;
    color: #64748b;
    line-height: 1.45;
}
.xonex-form-group { margin-bottom: 16px; }
.xonex-form-group label { display: block; font-size: .88rem; font-weight: 600; color: #475569; margin-bottom: 6px; }
.xonex-form-group input,
.xonex-form-group select,
.xonex-form-group textarea { width: 100%; padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 10px; font-size: .95rem; font-family: var(--xonex-font); transition: border-color .2s; }
.xonex-form-group input:focus,
.xonex-form-group select:focus { outline: none; border-color: var(--xonex-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--xonex-primary) 20%, transparent); }
.xonex-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ── Password wrap + eye toggle ── */
.xonex-password-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.xonex-password-wrap input[type="password"],
.xonex-password-wrap input[type="text"] {
    width: 100%;
    padding-right: 46px !important;
}
.xonex-password-eye {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color .15s;
    line-height: 0;
    z-index: 2;
}
.xonex-password-eye:hover { color: var(--xonex-primary); }

/* ---- Google Login Button ---- */
.xonex-google-wrap { margin-bottom: 8px; }
.xonex-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 13px 20px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    color: #1e293b;
    font-size: .95rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s, border-color .2s, box-shadow .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    font-family: var(--xonex-font);
}
.xonex-google-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    color: #1e293b;
}
.xonex-google-icon { width: 22px; height: 22px; flex-shrink: 0; }
.xonex-auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: #94a3b8;
    font-size: .82rem;
    font-weight: 500;
}
.xonex-auth-divider::before,
.xonex-auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

/* ---- Phone Prefix Group ---- */
.xonex-phone-group { display: flex; gap: 0; border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; transition: border-color .2s; }
.xonex-phone-group:focus-within { border-color: var(--xonex-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--xonex-primary) 20%, transparent); }
.xonex-phone-group .xonex-phone-prefix { border: none; border-right: 1px solid #e2e8f0; border-radius: 0; width: auto; min-width: 110px; padding: 12px 10px; font-size: .88rem; background: #f8fafc; flex-shrink: 0; cursor: pointer; }
.xonex-phone-group .xonex-phone-prefix:focus { outline: none; box-shadow: none; }
.xonex-phone-group .xonex-phone-local { border: none; border-radius: 0; flex: 1; min-width: 0; padding: 12px 14px; }
.xonex-phone-group .xonex-phone-local:focus { outline: none; box-shadow: none; }
.xonex-form-group .xonex-phone-group input,
.xonex-form-group .xonex-phone-group select { border: none; box-shadow: none; }
.xonex-profile-avatar-box {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}
.xonex-avatar-photo-preview img {
    margin-top: 10px;
    width: 82px;
    height: 82px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Modern Upload Dropzone */
.xonex-upload-dropzone {
    position: relative;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 30px 20px;
    background: #fff;
    cursor: pointer;
    transition: all .2s;
    overflow: hidden;
}
.xonex-upload-dropzone:hover {
    border-color: var(--xonex-primary);
    background: #f8fafc;
}
.xonex-upload-dropzone.is-dragover {
    border-color: var(--xonex-primary);
    background: #eff6ff;
}
.xonex-upload-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
.xonex-upload-idle {
    pointer-events: none;
}

#xonex-cropper-instance {
    width: 100%;
    height: 300px;
}
/* Croppie overrides */
.cr-boundary { border-radius: 8px; background: #f1f5f9; }
.cr-slider-wrap { margin: 15px auto 0; width: 80%; }
.cr-slider { height: 6px; background: #e2e8f0; border-radius: 3px; }

/* Dashboard Card Avatar fix */
.xonex-header-avatar {
    width: 100px;
    height: 100px;
    margin: 0 auto 15px;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,.3);
    overflow: hidden;
    background: rgba(255,255,255,.1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0,0,0,.2);
}
.xonex-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}


/* Selector Modalità Avatar */
.xonex-avatar-mode-selector {
    display: flex;
    gap: 8px;
    margin: 15px 0;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 10px;
}
.xonex-avatar-mode-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: transparent;
    border-radius: 7px;
    font-size: .84rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all .2s;
}
.xonex-avatar-mode-btn.active {
    background: #fff;
    color: var(--xonex-primary);
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
.xonex-avatar-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}
.xonex-avatar-choice {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 4px;
    background: #fff;
    cursor: pointer;
}
.xonex-avatar-choice img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}
.xonex-avatar-choice.is-selected {
    border-color: var(--xonex-primary);
}

/* ---- Buttons ---- */
.xonex-btn { background: var(--xonex-primary); color: #fff; border: none; padding: 14px 28px; border-radius: 12px; font-size: 1rem; font-weight: 700; cursor: pointer; font-family: var(--xonex-font); transition: opacity .2s, transform .1s; }
.xonex-btn:hover { opacity: .9; }
.xonex-btn:active { transform: scale(.98); }
.xonex-btn-full { width: 100%; }

/* ---- Messages ---- */
.xonex-msg { padding: 10px 14px; border-radius: 10px; font-size: .88rem; margin-bottom: 14px; display: none; }
.xonex-msg.success { background: #d1fae5; color: #065f46; display: block; }
.xonex-msg.error   { background: #fee2e2; color: #991b1b; display: block; }

/* ---- Login Prompt ---- */
.xonex-login-prompt { text-align: center; padding: 40px 20px; background: #fff; border-radius: 16px; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.xonex-notice-green { background: #d1fae5; color: #065f46; padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: .9rem; }

/* ---- Auth Tabs (Login/Register) ---- */
.xonex-register-wrap { max-width: 560px; }
.xonex-register-logo { text-align: center; margin-bottom: 16px; }
.xonex-register-logo img { max-height: 56px; }
.xonex-register-title { text-align: center; font-size: 1.4rem; font-weight: 800; color: #1e293b; margin-bottom: 24px; }
.xonex-auth-tabs { display: flex; background: #f1f5f9; border-radius: 12px; padding: 4px; margin-bottom: 20px; }
.xonex-auth-tab { flex: 1; padding: 12px; border: none; background: transparent; border-radius: 9px; font-size: 1rem; font-weight: 600; cursor: pointer; font-family: var(--xonex-font); color: #64748b; transition: all .2s; }
.xonex-auth-tab.active { background: #fff; color: var(--xonex-primary); box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.xonex-auth-tab-register:not(.active) {
    font-size: 1rem;
    font-weight: 700;
    color: #334155 !important;
    background: #e8eaef !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: none !important;
}
.xonex-auth-tab-register.active {
    background: #fff !important;
    color: var(--xonex-primary) !important;
    border: 1px solid transparent !important;
    box-shadow: 0 1px 4px rgba(0,0,0,.1) !important;
}
.xonex-login-footer-links {
    text-align: center;
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    font-size: 0.95rem;
    width: 100%;
}
.xonex-login-footer-link { color: var(--xonex-primary); font-weight: 500; text-decoration: none; text-align: center; }
.xonex-login-footer-link:hover { text-decoration: underline; }
.xonex-login-register-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    min-height: 48px;
    padding: 12px 20px;
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #334155 !important;
    background: #e8eaef !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 10px;
    text-decoration: none !important;
    box-shadow: none !important;
}
.xonex-login-register-cta:hover {
    background: #dce0e8 !important;
    color: #1e293b !important;
    text-decoration: none !important;
}
.xonex-btn-register-submit {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--xonex-font);
    color: #334155;
    background: #e8eaef;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    cursor: pointer;
    transition: background .15s;
}
.xonex-btn-register-submit:hover { background: #dce0e8; color: #1e293b; }

/* Solo tab Registrati: CTA principale come pulsante primario */
.xonex-register-wrap.xonex-auth-start-register .xonex-btn-register-submit {
    color: #fff !important;
    background: var(--xonex-primary) !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.25);
}
.xonex-register-wrap.xonex-auth-start-register .xonex-btn-register-submit:hover {
    filter: brightness(1.06);
    color: #fff !important;
}
.xonex-legal-consent { margin: 16px 0; display: flex; flex-direction: column; gap: 12px; }
.xonex-legal-check { display: flex; align-items: flex-start; gap: 10px; font-size: .88rem; color: #475569; line-height: 1.45; cursor: pointer; }
.xonex-legal-check input { margin-top: 3px; flex-shrink: 0; width: auto; }
.xonex-legal-check-label a { color: var(--xonex-primary); font-weight: 600; }

.xonex-verify-pending-box {
    padding: 14px 16px;
    border-radius: 12px;
    background: #d1fae5;
    color: #065f46;
    font-size: .92rem;
    line-height: 1.5;
    text-align: left;
}
.xonex-verify-pending-text { margin: 0 0 10px; font-weight: 500; }
.xonex-verify-spam-hint {
    margin: 0 0 14px;
    padding: 10px 12px;
    background: rgba(255,255,255,.65);
    border-radius: 8px;
    font-size: .88rem;
    color: #047857;
}
.xonex-verify-pending-box .xonex-btn-resend-verify {
    width: 100%;
    margin-bottom: 10px;
    cursor: pointer;
}
.xonex-resend-verify-feedback { margin: 0; font-size: .85rem; min-height: 1.2em; }
.xonex-resend-verify-feedback.success { color: #047857; font-weight: 600; }
.xonex-resend-verify-feedback.error { color: #b91c1c; font-weight: 600; }
.xonex-complete-profile-lead { color: #64748b; text-align: center; font-size: 0.95rem; margin: 0 0 22px; line-height: 1.5; }
body.xonex-mobile-nav-open { overflow: hidden; touch-action: none; }

/* ================================================================
   OPERATOR DASHBOARD — Tablet / Fast-Track UI
   ================================================================ */
.xonex-footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px; /* Increased lateral padding */
}
.xonex-operator-wrap {
    font-family: var(--xonex-font);
    max-width: 700px;
    margin: 0 auto;
    padding: 12px;
}
.xonex-op-header { display: flex; align-items: center; gap: 14px; background: var(--xonex-primary); color: #fff; padding: 14px 20px; border-radius: 16px; margin-bottom: 20px; }
.xonex-brand-logo-sm { height: 36px; filter: brightness(0) invert(1); }
.xonex-op-store-name { font-size: 1.1rem; font-weight: 700; }

.xonex-op-state { animation: xonexFadeIn .25s ease; }
@keyframes xonexFadeIn { from { opacity:0; transform: translateY(6px); } to { opacity:1; transform:none; } }

.xonex-op-actions-row { display: flex; gap: 12px; justify-content: center; margin-bottom: 20px; }
.xonex-op-btn-primary { background: var(--xonex-primary); color: #fff; border: none; padding: 18px 32px; border-radius: 14px; font-size: 1.1rem; font-weight: 700; cursor: pointer; font-family: var(--xonex-font); width: 100%; transition: opacity .2s; }
.xonex-op-btn-primary:hover { opacity: .9; }
.xonex-op-btn-secondary { background: var(--xonex-secondary); color: var(--xonex-primary); border: none; padding: 12px 20px; border-radius: 10px; font-size: 1rem; font-weight: 700; cursor: pointer; font-family: var(--xonex-font); }
.xonex-op-btn-ghost { background: transparent; border: 2px solid #e2e8f0; color: #64748b; padding: 12px 24px; border-radius: 10px; font-size: .95rem; font-weight: 600; cursor: pointer; font-family: var(--xonex-font); width: 100%; margin-top: 16px; transition: border-color .2s; }
.xonex-op-btn-ghost:hover { border-color: var(--xonex-primary); color: var(--xonex-primary); }

/* Divider "oppure" — flexbox: la linea non sovrasta mai il testo */
.xonex-op-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #94a3b8;
    font-size: .85rem;
    font-weight: 500;
    margin: 18px 0;
    white-space: nowrap;
}
.xonex-op-divider::before,
.xonex-op-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.xonex-op-search-row { display: flex; gap: 10px; margin-bottom: 16px; }
.xonex-op-input { flex: 1; padding: 14px 16px; border: 2px solid #e2e8f0; border-radius: 12px; font-size: 1rem; font-family: var(--xonex-font); }
.xonex-op-input:focus { outline: none; border-color: var(--xonex-primary); }

#xonex-search-results { background: #fff; border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.1); overflow: hidden; }
.xonex-search-result-item { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; cursor: pointer; border-bottom: 1px solid #f1f5f9; transition: background .15s; }
.xonex-search-result-item:hover { background: var(--xonex-secondary); }
.xonex-search-result-item:last-child { border-bottom: none; }
.xonex-search-result-name { font-weight: 700; color: #1e293b; }
.xonex-search-result-meta { font-size: .83rem; color: #64748b; }
.xonex-search-result-pts { font-weight: 800; color: var(--xonex-primary); font-size: 1rem; }

.xonex-op-customer-card { background: linear-gradient(135deg, var(--xonex-primary), color-mix(in srgb, var(--xonex-primary) 70%, #000)); color: #fff; border-radius: 16px; padding: 24px; text-align: center; margin-bottom: 24px; }
.xonex-op-name    { font-size: 1.4rem; font-weight: 800; }
.xonex-op-balance { font-size: 3.5rem; font-weight: 900; margin: 8px 0 4px; }

/* Identità cliente */
.xonex-op-identity { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.25); }
.xonex-op-identity-item { display: flex; align-items: center; gap: 5px; font-size: .85rem; opacity: .9; background: rgba(255,255,255,.15); padding: 4px 10px; border-radius: 999px; }

.xonex-op-actions-section { background: #fff; border-radius: 16px; padding: 20px; margin-bottom: 16px; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.xonex-op-actions-section h3 { font-size: 1rem; font-weight: 700; color: #1e293b; margin: 0 0 14px; }

/* Earn — layout verticale su mobile */
.xonex-op-earn-stack { display: flex; flex-direction: column; gap: 12px; }
.xonex-op-earn-input-row { display: flex; align-items: center; gap: 10px; }
.xonex-op-currency { font-size: 1.4rem; font-weight: 800; color: #475569; flex-shrink: 0; }
.xonex-op-input-lg { flex: 1; padding: 16px 14px; border: 2px solid #e2e8f0; border-radius: 12px; font-size: 1.3rem; font-weight: 700; font-family: var(--xonex-font); text-align: center; width: 100%; }
.xonex-op-input-lg:focus { outline: none; border-color: var(--xonex-primary); }

.xonex-op-result { margin-top: 12px; padding: 12px 16px; border-radius: 10px; font-weight: 600; font-size: .95rem; display: none; }
.xonex-op-result.success { background: #d1fae5; color: #065f46; display: block; }
.xonex-op-result.error   { background: #fee2e2; color: #991b1b; display: block; }

.xonex-op-rewards-grid { display: grid; gap: 10px; }
.xonex-op-reward-item { display: flex; align-items: center; gap: 14px; background: #f8fafc; border-radius: 12px; padding: 12px; border: 2px solid transparent; transition: border-color .2s; }
.xonex-op-reward-item.can-redeem { border-color: #10b981; background: #f0fdf4; }
.xonex-op-reward-item img { width: 50px; height: 50px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.xonex-op-reward-placeholder { width: 50px; height: 50px; border-radius: 8px; background: #e2e8f0; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; }
.xonex-op-reward-name { font-weight: 700; color: #1e293b; font-size: .95rem; }
.xonex-op-reward-pts { font-size: .83rem; color: #64748b; }
.xonex-op-reward-badge { font-size: .78rem; font-weight: 600; }
.xonex-op-redeem-btn { margin-left: auto; background: #10b981; color: #fff; border: none; padding: 10px 18px; border-radius: 8px; font-size: .9rem; font-weight: 700; cursor: pointer; white-space: nowrap; font-family: var(--xonex-font); flex-shrink: 0; }
.xonex-op-redeem-btn:hover:not([disabled]) { background: #059669; }

/* Storico operazioni (cassa) */
.xonex-op-tx-section { padding-top: 16px; padding-bottom: 16px; }
.xonex-op-tx-panel {
    margin-top: 14px;
    border-top: 1px solid #e2e8f0;
    padding-top: 14px;
    max-height: min(55vh, 420px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.xonex-op-tx-loading,
.xonex-op-tx-empty,
.xonex-op-tx-err {
    text-align: center;
    color: #64748b;
    font-size: .9rem;
    padding: 12px 8px;
    margin: 0;
}
.xonex-op-tx-err { color: #b91c1c; }
.xonex-op-tx-list { display: flex; flex-direction: column; gap: 0; }
.xonex-op-tx-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
    font-family: var(--xonex-font);
}
.xonex-op-tx-row:last-child { border-bottom: none; }
.xonex-op-tx-main { flex: 1; min-width: 0; }
.xonex-op-tx-title { font-size: .88rem; font-weight: 700; color: #1e293b; line-height: 1.35; }
.xonex-op-tx-meta { font-size: .76rem; color: #94a3b8; margin-top: 4px; }
.xonex-op-tx-amt { font-size: .8rem; font-weight: 600; color: #475569; margin-top: 4px; }
.xonex-op-tx-pts {
    font-size: .95rem;
    font-weight: 800;
    flex-shrink: 0;
    margin-top: 2px;
}
.xonex-op-tx-pts--pos { color: #059669; }
.xonex-op-tx-pts--neg { color: #dc2626; }
.xonex-op-redeem-btn[disabled] { background: #cbd5e1; cursor: not-allowed; }
.xonex-op-register-note { font-size: .83rem; color: #64748b; background: #f8fafc; padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; }

.xonex-icon { font-size: 1.3rem; }
.xonex-btn-done { font-size: 1.1rem; padding: 16px; }

/* ---- Logout button ---- */
.xonex-logout-btn {
    display: inline-block;
    margin-top: 14px;
    padding: 7px 18px;
    border-radius: 20px;
    background: rgba(255,255,255,.18);
    color: #fff;
    text-decoration: none;
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .03em;
    transition: background .2s;
}
.xonex-logout-btn:hover { background: rgba(255,255,255,.32); color: #fff; }

/* ---- Brand Owner Report ---- */
.xonex-brand-report { max-width: 900px; }

.xnr-header {
    background: linear-gradient(135deg, var(--xonex-primary), color-mix(in srgb, var(--xonex-primary) 60%, #000));
    color: #fff;
    border-radius: 20px;
    padding: 28px 24px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.xnr-title { font-size: 1.5rem; font-weight: 800; margin-top: 6px; }
.xnr-subtitle { opacity: .75; font-size: .9rem; margin-top: 4px; }

.xnr-filter-form {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    background: #f8fafc;
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}
.xnr-filter-form label { font-size: .9rem; color: #374151; font-weight: 500; }
.xnr-filter-form input[type="date"] { margin-left: 8px; padding: 6px 10px; border: 1px solid #d1d5db; border-radius: 7px; font-size: .9rem; }
.xnr-reset { font-size: .85rem; color: #6b7280; text-decoration: none; }
.xnr-reset:hover { text-decoration: underline; }

/* KPI cards */
.xnr-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 24px; }
.xnr-kpi {
    background: #fff;
    border-radius: 14px;
    padding: 18px 16px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    border: 1px solid #f1f5f9;
}
.xnr-kpi-icon {
    width: 42px; height: 42px;
    border-radius: 10px;
    margin: 0 auto 10px;
    display: flex; align-items: center; justify-content: center;
}
.xnr-kpi-icon svg { width: 22px; height: 22px; stroke: #fff; }
.xnr-kpi-value { font-size: 1.6rem; font-weight: 800; color: #1e293b; line-height: 1; }
.xnr-kpi-label { font-size: .78rem; color: #64748b; margin-top: 5px; }

/* Sections */
.xnr-section { background: #fff; border-radius: 14px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,.06); border: 1px solid #f1f5f9; margin-bottom: 20px; }
.xnr-section-title { font-size: 1rem; font-weight: 700; color: #1e293b; margin: 0 0 16px; padding-bottom: 10px; border-bottom: 1px solid #f1f5f9; }
.xnr-chart-wrap { position: relative; max-height: 320px; }
.xnr-empty { color: #94a3b8; font-style: italic; }

/* Table */
.xnr-table-wrap { overflow-x: auto; }
.xnr-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.xnr-table th { background: #f8fafc; padding: 10px 12px; text-align: left; font-size: .82rem; color: #64748b; border-bottom: 2px solid #e2e8f0; white-space: nowrap; }
.xnr-table td { padding: 12px 12px; border-bottom: 1px solid #f1f5f9; color: #1e293b; vertical-align: middle; }
.xnr-table tr:hover td { background: #fafafa; }
.xnr-green { color: #16a34a; font-weight: 600; }
.xnr-red { color: #dc2626; font-weight: 600; }

/* Progress bar */
.xnr-bar-wrap { background: #f1f5f9; border-radius: 4px; height: 8px; width: 80px; overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 6px; }
.xnr-bar { background: var(--xonex-accent, #f59e0b); height: 100%; border-radius: 4px; transition: width .4s; }

/* Rewards list */
.xnr-rewards-list { display: flex; flex-direction: column; gap: 10px; }
.xnr-reward-row { display: flex; align-items: center; gap: 12px; }
.xnr-rank { font-weight: 700; color: #94a3b8; width: 26px; flex-shrink: 0; }
.xnr-reward-name { flex: 1; font-size: .92rem; color: #1e293b; }
.xnr-bar-inline { flex: 0 0 120px; }
.xnr-reward-count { font-weight: 700; color: #374151; font-size: .9rem; width: 28px; text-align: right; }

/* ---- Operator store badge (distinguishes from buttons) ---- */
.xonex-op-store-badge {
    text-align: center;
    padding: 14px 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    margin-bottom: 20px;
}
.xonex-op-store-label {
    font-size: .75rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 4px;
}
.xonex-op-store-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: -.01em;
}

/* ---- QR PDF button ---- */
.xonex-qr-pdf-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: .83rem;
    font-weight: 600;
    color: var(--xonex-primary);
    background: none;
    border: 1.5px solid var(--xonex-primary);
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    margin-top: 10px;
    font-family: var(--xonex-font);
    transition: background .15s, color .15s;
}
.xonex-qr-pdf-btn:hover { background: var(--xonex-primary); color: #fff; }
.xonex-qr-pdf-btn:disabled { opacity: .6; cursor: default; }

/* ---- Google review button ---- */
.xonex-review-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 18px;
    color: #1e293b;
    text-decoration: none;
    font-family: var(--xonex-font);
    margin: 16px 0;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    transition: box-shadow .15s, border-color .15s;
}
.xonex-review-btn:hover { border-color: var(--xonex-primary); box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.xonex-review-btn span { flex: 1; }
.xonex-review-btn span small { display: block; font-size: .78rem; color: #64748b; margin-top: 2px; }

/* ---- PWA install banner ---- */
.xonex-pwa-banner {
    background: linear-gradient(135deg, var(--xonex-primary), #3b82f6);
    color: #fff;
    padding: 14px 18px;
    border-radius: 14px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--xonex-font);
    font-size: .9rem;
    font-weight: 500;
}
.xonex-pwa-banner span { flex: 1; }
.xonex-pwa-banner--header {
    margin: 0;
    padding: 14px 18px;
    font-size: .95rem;
    border-radius: 0;
    background: linear-gradient(135deg, #0f766e, #14b8a6);
}
.xonex-pwa-actions { display: flex; align-items: center; gap: 8px; }
.xonex-pwa-btn-install {
    background: #fff;
    color: var(--xonex-primary);
    border: none;
    padding: 7px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: .82rem;
    cursor: pointer;
    font-family: var(--xonex-font);
    white-space: nowrap;
}
.xonex-pwa-btn-dismiss {
    background: rgba(255,255,255,.2);
    color: #fff;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: .8rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---- Referral card ---- */
.xonex-referral-card {
    background: #fff;
    border: 1.5px solid #e0e7ff;
    border-radius: 16px;
    padding: 20px;
    margin-top: 20px;
}
.xonex-referral-card-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.xonex-referral-icon { font-size: 2rem; line-height: 1; }
.xonex-referral-title { font-size: 1rem; font-weight: 700; color: #1e293b; }
.xonex-referral-sub { font-size: .85rem; color: #64748b; margin-top: 3px; }

.xonex-referral-toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    padding: 10px 0;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 14px;
    gap: 12px;
}
.xonex-referral-toggle-label input[type=checkbox] { display: none; }
.xonex-toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: #cbd5e1;
    border-radius: 24px;
    flex-shrink: 0;
    transition: background .2s;
}
.xonex-toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: left .2s;
}
.xonex-referral-toggle-label input:checked ~ .xonex-toggle-slider { background: var(--xonex-primary); }
.xonex-referral-toggle-label input:checked ~ .xonex-toggle-slider::after { left: 23px; }

.xonex-referral-status {
    font-size: .72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
    vertical-align: middle;
}
.xonex-referral-status.active  { background: #dcfce7; color: #15803d; }
.xonex-referral-status.inactive { background: #f1f5f9; color: #94a3b8; }
.xonex-referral-toggle-text { font-size: .9rem; font-weight: 600; color: #374151; }

.xonex-referral-link-group {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}
.xonex-referral-link-input {
    flex: 1;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: .82rem;
    color: #374151;
    background: #f8fafc;
    min-width: 0;
    font-family: var(--xonex-font);
}
.xonex-referral-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--xonex-primary);
    color: #fff;
    border: none;
    padding: 9px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: .82rem;
    cursor: pointer;
    font-family: var(--xonex-font);
    white-space: nowrap;
    transition: opacity .15s;
}
.xonex-referral-copy-btn:hover { opacity: .9; }
.xonex-referral-note { font-size: .78rem; color: #94a3b8; margin: 0; }

/* ---- Referral notice in registration ---- */
.xonex-referral-notice {
    background: #eff6ff;
    border: 1.5px solid #bfdbfe;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: .88rem;
    color: #1e40af;
    margin-bottom: 14px;
}

/* ══════════════════════════════════════════════════════════════════
   NAVBAR / HEADER — layout 3 colonne: logo | menu | account
   ══════════════════════════════════════════════════════════════════ */
.xonex-navbar {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
    padding: 0 24px;
    height: 64px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0 16px;
    font-family: var(--xonex-font);
    position: sticky;
    top: 0;
    z-index: 9999;
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 20px;
}

/* ── Logo / Brand ── */
.xonex-navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 1;
    min-width: 0;
    max-width: min(240px, 42vw);
}
.xonex-navbar-logo {
    max-height: 36px;
    max-width: 100%;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
    object-position: left center;
}
.xonex-navbar-title {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--xonex-primary);
    white-space: nowrap;
}

/* ── Center menu ── */
.xonex-navbar-nav { display: flex; align-items: center; justify-content: center; }
.xonex-navbar-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 2px;
}
.xonex-navbar-menu li { margin: 0; padding: 0; }
.xonex-navbar-link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .87rem;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 8px;
    transition: background .15s, color .15s;
    white-space: nowrap;
    border: none;
    background: transparent;
    cursor: pointer;
}
.xonex-navbar-link:hover,
.xonex-navbar-link.xnav-active {
    background: #f1f5f9;
    color: var(--xonex-primary);
}
.xonex-navbar-link svg { flex-shrink: 0; opacity: .8; }

/* ── Right: account area ── */
.xonex-navbar-account {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Avatar + name + role block */
.xonex-navbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}
.xonex-navbar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--xonex-primary);
    color: #fff;
    font-size: .95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}
.xonex-navbar-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}
.xonex-navbar-userinfo {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1;
}
.xonex-navbar-username {
    font-size: .85rem;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
}
.xonex-navbar-role {
    font-size: .68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .05em;
    width: fit-content;
}
.xnav-role--customer { background: #dbeafe; color: #1e40af; }
.xnav-role--operator { background: #dcfce7; color: #15803d; }
.xnav-role--brand    { background: #fef3c7; color: #92400e; }
.xnav-role--admin    { background: #f3e8ff; color: #6b21a8; }

/* Logout button */
.xonex-navbar-logout {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: .82rem;
    font-weight: 600;
    color: #ef4444;
    text-decoration: none;
    padding: 7px 13px;
    border-radius: 8px;
    border: 1px solid #fecaca;
    background: #fff5f5;
    transition: background .15s;
    white-space: nowrap;
}
.xonex-navbar-logout:hover { background: #fee2e2; color: #dc2626; text-decoration: none; }

/* Registrati (guest, accanto ad Accedi) */
.xonex-navbar-register {
    font-size: .85rem;
    font-weight: 600;
    color: var(--xonex-primary);
    text-decoration: none;
    padding: 8px 6px;
    white-space: nowrap;
}
.xonex-navbar-register:hover { text-decoration: underline; color: var(--xonex-primary); }

/* Login button (guest) */
.xonex-navbar-login {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .85rem;
    font-weight: 700;
    color: #fff;
    background: var(--xonex-primary);
    padding: 8px 18px;
    border-radius: 8px;
    text-decoration: none;
    transition: opacity .15s;
    white-space: nowrap;
}
.xonex-navbar-login:hover { opacity: .88; color: #fff; text-decoration: none; }

/* ── Account dropdown ── */
.xonex-acct-dropdown {
    position: relative;
}
.xonex-acct-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 5px 10px 5px 5px;
    cursor: pointer;
    font-family: var(--xonex-font);
    transition: background .15s, border-color .15s;
    line-height: 1;
}
.xonex-acct-btn:hover { background: #f8fafc; border-color: #cbd5e1; }
.xonex-acct-btn[aria-expanded="true"] { background: #f1f5f9; border-color: var(--xonex-primary); }
.xonex-acct-name {
    font-size: .85rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.xonex-acct-chevron {
    color: #94a3b8;
    transition: transform .2s;
    flex-shrink: 0;
}
.xonex-acct-btn[aria-expanded="true"] .xonex-acct-chevron { transform: rotate(180deg); }

/* Pulsante Account solo mobile (dopo hamburger) */
.xonex-acct-btn--mob {
    display: none;
    align-items: center;
    gap: 5px;
    border: 1.5px solid var(--xonex-primary);
    color: var(--xonex-primary);
    background: #fff;
    border-radius: 10px;
    padding: 6px 10px;
    font-size: .75rem;
    font-weight: 700;
    line-height: 1;
}
.xonex-acct-mob-label {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.xonex-acct-mob-photo {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
}

.xonex-bottom-nav {
    display: none;
}

@media (max-width: 680px) {
    .xonex-wrap-public {
        padding-bottom: 110px;
    }
    body:has(.xonex-bottom-nav) {
        padding-bottom: 92px;
    }
    .xonex-bottom-nav {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 10px;
        height: 68px;
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 20px;
        box-shadow: 0 10px 28px rgba(15, 23, 42, .18);
        display: grid;
        grid-template-columns: 1fr 1fr 82px 1fr 1fr;
        align-items: center;
        gap: 2px;
        z-index: 100050;
        padding: 0 6px;
    }
    .xonex-bottom-nav-btn {
        border: none;
        background: transparent;
        color: #64748b;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        font-family: var(--xonex-font);
        padding: 6px 2px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    .xonex-bottom-nav-btn.is-active {
        color: var(--xonex-primary);
        font-weight: 700;
    }
    .xonex-bottom-nav-ico { font-size: 1rem; line-height: 1; }
    .xonex-bottom-nav-txt { font-size: .66rem; line-height: 1; }
    .xonex-bottom-nav-qr {
        border: 2px solid #dbeafe;
        width: 68px;
        height: 68px;
        border-radius: 50%;
        margin: -26px auto 0;
        background: var(--xonex-primary);
        color: #ffffff;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        box-shadow: 0 10px 24px rgba(30, 64, 175, .32);
        cursor: pointer;
        font-family: var(--xonex-font);
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    .xonex-bottom-nav-qr-ico {
        width: 30px;
        height: 30px;
        border-radius: 9px;
        background: transparent;
        color: #ffffff;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
    }
    .xonex-bottom-nav-qr-ico svg { display: block; }
    .xonex-bottom-nav-qr-txt { font-size: .66rem; font-weight: 700; line-height: 1; margin-top: 2px; color: #ffffff; }
}
.xonex-acct-btn--mob:hover { background: #eff6ff; }
.xonex-acct-btn--mob[aria-expanded="true"] {
    background: #f1f5f9;
    border-color: var(--xonex-primary);
}
.xonex-acct-mob-ico { flex-shrink: 0; opacity: .95; }

.xonex-acct-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,.12);
    min-width: 200px;
    padding: 6px;
    z-index: 100000;
    animation: xonexDropIn .15s ease;
}
.xonex-acct-menu.xnav-open { display: block; }
@keyframes xonexDropIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }

.xonex-acct-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 9px;
    font-size: .87rem;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    transition: background .12s;
    cursor: pointer;
    white-space: nowrap;
}
.xonex-acct-item:hover { background: #f1f5f9; color: #374151; text-decoration: none; }
.xonex-acct-item svg { flex-shrink: 0; color: #64748b; }
.xonex-acct-separator { height: 1px; background: #f1f5f9; margin: 4px 0; }
.xonex-acct-logout { color: #ef4444 !important; }
.xonex-acct-logout:hover { background: #fff5f5 !important; color: #dc2626 !important; }
.xonex-acct-logout svg { color: #ef4444; }

/* ── Mobile hamburger ── */
.xonex-navbar-burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
}
.xonex-navbar-burger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #475569;
    border-radius: 2px;
    transition: transform .2s, opacity .2s;
}
.xonex-navbar-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.xonex-navbar-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.xonex-navbar-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile breakpoint ── */
@media (max-width: 680px) {
    .xonex-navbar {
        grid-template-columns: 1fr auto auto;
        grid-template-rows: 64px auto;
        height: auto;
        padding: 0 12px;
        gap: 0 8px;
    }
    .xonex-navbar-brand  { grid-row: 1; grid-column: 1; min-height: 64px; min-width: 0; align-self: center; max-width: min(200px, 38vw); }
    /* Logo | hamburger | Account */
    .xonex-navbar-burger { display: flex; grid-row: 1; grid-column: 2; align-self: center; }
    .xonex-navbar-account { grid-row: 1; grid-column: 3; display: flex; justify-self: end; }
    .xonex-acct-btn--desktop { display: none !important; }
    .xonex-acct-btn--mob { display: inline-flex !important; }
    /* Dropdown sotto il pulsante Account in alto a destra */
    .xonex-acct-menu { right: 0; left: auto; min-width: 200px; }
    /* Nav a pannello: sfondo pieno, larghezza intera, leggibile */
    .xonex-navbar-nav {
        display: none;
        grid-row: 2;
        grid-column: 1 / -1;
        justify-content: stretch;
        align-self: stretch;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        margin: 0;
        padding: 0;
        border-top: none;
        background: transparent;
    }
    .xonex-navbar-nav.xnav-open {
        display: flex !important;
        flex-direction: column;
        padding: 0;
        margin-top: 0;
        background: #fff !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: 0 8px 40px rgba(15, 23, 42, .12) !important;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        z-index: 100002;
        position: fixed;
        left: 0;
        right: 0;
        top: 64px;
        bottom: 0;
        max-height: none;
    }
    body.admin-bar .xonex-navbar-nav.xnav-open { top: 96px; }
    .xonex-navbar-menu {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0;
        padding: 8px 0 12px;
    }
    .xonex-navbar-menu li { width: 100%; }
    .xonex-navbar-link {
        width: 100%;
        box-sizing: border-box;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
        padding: 14px 16px !important;
        border-radius: 0 !important;
        border-bottom: 1px solid #f1f5f9 !important;
        font-size: .95rem !important;
        font-weight: 600 !important;
        color: #1e293b !important;
        background: #fff !important;
        white-space: normal !important;
    }
    .xonex-navbar-link:last-child { border-bottom: none !important; }
    .xonex-navbar-link svg {
        width: 26px !important;
        height: 26px !important;
        opacity: 1 !important;
        color: var(--xonex-primary) !important;
    }
    /* Tab dashboard: icona sopra testo */
    .xonex-tabs { gap: 4px; padding: 6px 4px; }
    .xonex-tab {
        flex-direction: column !important;
        padding: 8px 3px !important;
        gap: 4px !important;
        font-size: 0 !important;
    }
    .xonex-tab-txt {
        font-size: .65rem !important;
        font-weight: 600;
        max-width: 100%;
        word-break: break-word;
    }
    .xonex-tab.active .xonex-tab-txt { font-weight: 700 !important; }
    .xonex-tab-ico { font-size: 1.2rem !important; line-height: 1; }
}

/* ---- Google Review Card ---- */
.xonex-review-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
    transition: box-shadow .2s;
}
.xonex-review-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.10); }
.xonex-review-card-icon { flex-shrink: 0; }
.xonex-review-card-body { flex: 1; min-width: 0; }
.xonex-review-card-title { font-weight: 700; font-size: .95rem; color: #1e293b; }
.xonex-review-card-sub   { font-size: .82rem; color: #64748b; margin-top: 2px; }
.xonex-review-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    background: #1e40af;
    color: #fff;
    font-size: .82rem;
    font-weight: 700;
    border-radius: 10px;
    padding: 8px 14px;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s;
}
.xonex-review-card-btn:hover { background: #1e3a8a !important; color: #fff !important; text-decoration: none !important; }

/* ---- Popup Overlay ---- */
.xonex-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 2147483646;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0 0 0 0;
    animation: xonexFadeIn .25s ease;
}
@keyframes xonexFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes xonexSlideUp { from { transform: translateY(80px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.xonex-popup-box {
    background: #fff;
    border-radius: 24px 24px 0 0;
    padding: 32px 24px 36px;
    width: 100%;
    max-width: 500px;
    text-align: center;
    animation: xonexSlideUp .3s cubic-bezier(.34,1.56,.64,1);
    position: relative;
}
.xonex-popup-google-icon {
    width: 72px;
    height: 72px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}
.xonex-popup-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 8px;
}
.xonex-popup-text {
    font-size: .9rem;
    color: #64748b;
    margin: 0 0 14px;
    line-height: 1.5;
}
.xonex-popup-stars {
    font-size: 1.8rem;
    color: #f59e0b;
    letter-spacing: 4px;
    margin-bottom: 20px;
}
.xonex-popup-btn-primary {
    display: block;
    width: 100%;
    background: #1e40af;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    border-radius: 14px;
    padding: 14px;
    cursor: pointer;
    text-decoration: none;
    margin-bottom: 12px;
    transition: background .15s;
}
.xonex-popup-btn-primary:hover { background: #1e3a8a; color: #fff; }
.xonex-popup-divider { height: 1px; background: #f1f5f9; margin: 4px 0 12px; }
.xonex-popup-btn-later,
.xonex-popup-btn-never {
    display: block;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    font-size: .88rem;
    padding: 8px;
    border-radius: 10px;
    transition: background .15s;
}
.xonex-popup-btn-later { color: #475569 !important; font-weight: 600; }
.xonex-popup-btn-later:hover { background: #f1f5f9 !important; color: #475569 !important; }
.xonex-popup-btn-never { color: #94a3b8 !important; font-weight: 400; margin-top: 4px; }
.xonex-popup-btn-never:hover { background: #f8fafc !important; color: #64748b !important; }

/* ---- Operator Edit Form ---- */
.xonex-op-edit-form {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px;
}
.xonex-op-edit-form .xonex-form-group { margin-bottom: 12px; }
.xonex-op-edit-form .xonex-form-group label { display: block; font-size: .82rem; font-weight: 600; color: #475569; margin-bottom: 4px; }
.xonex-form-input {
    width: 100%;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: .95rem;
    font-family: inherit;
    background: #fff;
    transition: border-color .2s;
    appearance: none;
}
.xonex-form-input:focus { outline: none; border-color: var(--xonex-primary); }
select.xonex-form-input { padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }

/* ---- Login page ---- */
.xonex-login-page { max-width: 420px; }
.xonex-login-brand-name {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--xonex-primary);
    text-align: center;
    margin: 0 0 24px;
}
.xonex-register-logo { text-align: center; margin-bottom: 20px; }
.xonex-register-logo img { max-height: 56px; }

@media (max-width: 480px) {
    .xonex-form-row { grid-template-columns: 1fr; }
    .xonex-points-balance { font-size: 2.4rem; }
    .xonex-op-balance { font-size: 2.8rem; }
    .xnr-kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .xnr-filter-form { flex-direction: column; align-items: flex-start; }
    html body .xonex-navbar { border-radius: 0; margin-bottom: 10px; }
    html body .xonex-navbar-username { display: none !important; }
}

/* ==========================================================================
   ELEMENTOR COMPATIBILITY LAYER
   Questo blocco è l'ultimo a caricarsi e vince su qualsiasi stile di Elementor
   o tema. Usa solo !important dove Elementor sovrascrive i valori critici.
   ========================================================================== */

/* ── Navbar: sempre visibile, sempre in cima ── */
html body .xonex-navbar {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 9999 !important;
    background: #fff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 4px rgba(0,0,0,.06) !important;
    padding: 0 20px !important;
    height: 56px !important;
    align-items: center !important;
    justify-content: space-between !important;
    font-family: var(--xonex-font) !important;
    max-width: 900px !important;
    margin: 0 auto 16px !important;
    border-radius: 0 0 14px 14px !important;
    box-sizing: border-box !important;
}
html body .xonex-navbar-brand {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    text-decoration: none !important;
    min-width: 0 !important;
    max-width: min(240px, 46vw) !important;
    flex-shrink: 1 !important;
}
html body .xonex-navbar-right {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}
html body .xonex-navbar-title {
    font-weight: 800 !important;
    font-size: 1.05rem !important;
    color: var(--xonex-primary) !important;
    text-decoration: none !important;
}
html body .xonex-navbar-logo {
    max-height: 32px !important;
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    display: block !important;
    object-fit: contain !important;
    object-position: left center !important;
    filter: none !important;
}
html body .xonex-navbar-role {
    font-size: .72rem !important;
    font-weight: 700 !important;
    padding: 3px 9px !important;
    border-radius: 20px !important;
    text-transform: uppercase !important;
    letter-spacing: .04em !important;
}
html body .xonex-navbar {
    display: grid !important;
    grid-template-columns: auto 1fr auto !important;
    align-items: center !important;
    height: 64px !important;
    visibility: visible !important;
    opacity: 1 !important;
    overflow: visible !important;
}
html body .xonex-navbar-nav {
    display: flex !important;
    align-items: center !important;
    visibility: visible !important;
}
/* Mobile: la regola sopra batte @media (max-width:680px) senza html body — serve per il menu hamburger */
@media (max-width: 680px) {
    html body .xonex-navbar {
        grid-template-columns: 1fr auto auto !important;
        height: auto !important;
        align-items: center !important;
    }
    html body .xonex-navbar-nav:not(.xnav-open) {
        display: none !important;
    }
    html body .xonex-navbar-nav.xnav-open {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        background: #fff !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: 0 8px 40px rgba(15, 23, 42, .12) !important;
        padding: 0 !important;
        margin-top: 0 !important;
        z-index: 100002 !important;
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        top: 64px !important;
        bottom: 0 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    body.admin-bar .xonex-navbar-nav.xnav-open { top: 96px !important; }
    html body .xonex-navbar-menu {
        width: 100% !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }
    html body .xonex-navbar-link {
        flex-direction: column !important;
        align-items: flex-start !important;
        width: 100% !important;
        box-sizing: border-box !important;
        background: #fff !important;
        color: #1e293b !important;
        white-space: normal !important;
    }
    html body .xonex-tab {
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }
}
html body .xonex-navbar-menu {
    display: flex !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
html body .xonex-navbar-link {
    display: flex !important;
    align-items: center !important;
    text-decoration: none !important;
    visibility: visible !important;
    opacity: 1 !important;
}
html body .xonex-navbar-account {
    display: flex !important;
    align-items: center !important;
    visibility: visible !important;
}
html body .xonex-navbar-user {
    display: flex !important;
    align-items: center !important;
}
html body .xonex-navbar-avatar {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    visibility: visible !important;
}
html body .xonex-navbar-logout {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    font-size: .82rem !important;
    font-weight: 600 !important;
    color: #ef4444 !important;
    text-decoration: none !important;
    padding: 7px 13px !important;
    border-radius: 8px !important;
    border: 1px solid #fecaca !important;
    background: #fff5f5 !important;
}
html body .xonex-navbar-register {
    display: inline-flex !important;
    align-items: center !important;
    text-decoration: none !important;
    color: var(--xonex-primary) !important;
    font-weight: 600 !important;
    font-size: .85rem !important;
}
html body .xonex-navbar-login {
    display: flex !important;
    align-items: center !important;
    text-decoration: none !important;
    color: #fff !important;
    background: var(--xonex-primary) !important;
    padding: 8px 18px !important;
    border-radius: 8px !important;
}

/* ── Contenitori principali: font e box-model ── */
html body .xonex-wrap-public,
html body .xonex-operator-wrap,
html body .xonex-login-page,
html body .xonex-register-page {
    font-family: var(--xonex-font);
    box-sizing: border-box;
}
html body .xonex-wrap-public *,
html body .xonex-operator-wrap *,
html body .xonex-login-page * {
    box-sizing: border-box;
}

/* ── Bottoni plugin: Elementor non deve toccarli ── */
html body .xonex-btn,
html body .xonex-op-btn-primary,
html body .xonex-op-btn-secondary,
html body .xonex-op-btn-ghost {
    font-family: var(--xonex-font) !important;
    cursor: pointer !important;
    text-align: center !important;
    text-decoration: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1.2 !important;
}
html body .xonex-tab {
    font-family: var(--xonex-font) !important;
    cursor: pointer !important;
    border: none !important;
    background: transparent !important;
    outline: none !important;
}
html body .xonex-tab.active {
    background: #fff !important;
    color: var(--xonex-primary) !important;
    font-weight: 700 !important;
    box-shadow: 0 1px 4px rgba(0,0,0,.1) !important;
}

/* ── Input / Select: Elementor e temi li sovrascrivono sempre ── */
html body .xonex-wrap-public input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="hidden"]),
html body .xonex-wrap-public select,
html body .xonex-wrap-public textarea,
html body .xonex-operator-wrap input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="hidden"]),
html body .xonex-operator-wrap select,
html body .xonex-login-page input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="hidden"]),
html body .xonex-login-page select {
    font-family: var(--xonex-font) !important;
    font-size: .95rem !important;
    border-radius: 10px !important;
    border: 1.5px solid #e2e8f0 !important;
    padding: 10px 14px !important;
    background: #fff !important;
    color: #1e293b !important;
    box-shadow: none !important;
    outline: none;
    appearance: auto;
    width: 100%;
}
html body .xonex-wrap-public input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="hidden"]):focus,
html body .xonex-operator-wrap input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="hidden"]):focus,
html body .xonex-login-page input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="hidden"]):focus {
    border-color: var(--xonex-primary) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--xonex-primary) 15%, transparent) !important;
}

/* ── Cards e livello badge ── */
html body .xonex-header-card {
    background: linear-gradient(135deg, var(--xonex-primary), color-mix(in srgb, var(--xonex-primary) 60%, #000)) !important;
    color: #fff !important;
    border-radius: 20px !important;
}
html body .xonex-level-badge {
    display: inline-block !important;
    visibility: visible !important;
}

/* ── Popup overlay: sopra a tutto, incluso Elementor popup ── */
html body .xonex-popup-overlay {
    z-index: 999999 !important;
    position: fixed !important;
    inset: 0 !important;
}

/* ── QR PDF button ── */
html body .xonex-qr-pdf-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
}

/* ==========================================================================
   AUTO-HIDE TEMA HEADER su pagine con navbar Xonex
   Quando la pagina contiene il plugin, nasconde l'header del tema/Elementor
   e il titolo WP della pagina. Il footer di Elementor NON viene toccato.
   ========================================================================== */

/* Header Elementor Theme Builder */
body:has(.xonex-navbar) .elementor-location-header,
/* Header generico HTML5 */
body:has(.xonex-navbar) body > header,
body:has(.xonex-navbar) .site-header,
body:has(.xonex-navbar) #site-header,
body:has(.xonex-navbar) #header,
body:has(.xonex-navbar) #masthead,
/* Temi popolari */
body:has(.xonex-navbar) .ast-primary-header,
body:has(.xonex-navbar) .ast-above-header-bar,
body:has(.xonex-navbar) .ast-below-header,
body:has(.xonex-navbar) .generate-header,
body:has(.xonex-navbar) .kadence-header,
body:has(.xonex-navbar) .ocean-header,
body:has(.xonex-navbar) .hfeed .header-wrap,
body:has(.xonex-navbar) .page-header-wrap,
body:has(.xonex-navbar) .header-main,
body:has(.xonex-navbar) .wp-site-blocks > header {
    display: none !important;
}

/* Titolo WP della pagina (il "Cassa", "Area Cliente" ecc. generato dal tema) */
body:has(.xonex-navbar) .entry-header,
body:has(.xonex-navbar) .page-header,
body:has(.xonex-navbar) .wp-block-post-title,
body:has(.xonex-navbar) h1.entry-title,
body:has(.xonex-navbar) h1.page-title,
body:has(.xonex-navbar) .elementor-widget-post-title {
    display: none !important;
}

/* Annulla margin/padding top aggiunti dal tema quando l'header è fisso */
body:has(.xonex-navbar) {
    padding-top: 0 !important;
    margin-top: 0 !important;
}
/* Assicura che la nostra navbar parta dall'alto della viewport */
body:has(.xonex-navbar) .xonex-navbar {
    top: 0 !important;
}
/* Se è loggato e la WP admin bar è presente, abbassa sotto di essa */
body.admin-bar:has(.xonex-navbar) .xonex-navbar {
    top: 32px !important;
}

/* =====================================================================
   HOME PORTAL SHORTCODE
   ===================================================================== */
.xonex-home-portal {
    font-family: var(--xonex-font);
    width: 100%;
    margin: 0 auto;
    padding: 20px 0;
}

.xonex-home-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 32px;
}

.xonex-home-box {
    text-decoration: none;
    background: #fff;
    border-radius: 20px;
    padding: 24px 16px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    border: 1px solid #e2e8f0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.xonex-home-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    border-color: var(--xonex-primary);
}

.xonex-home-box-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.xonex-home-box-login .xonex-home-box-icon {
    background: rgba(30, 64, 175, 0.1);
    color: var(--xonex-primary);
}

.xonex-home-box-register .xonex-home-box-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--xonex-accent);
}

.xonex-home-box-icon svg {
    width: 26px;
    height: 26px;
}

.xonex-home-box-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
}

/* Sections */
.xonex-home-section {
    margin-bottom: 32px;
}

.xonex-home-section-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 16px 0;
    text-align: left;
}

.xonex-home-section-subtitle {
    font-size: 0.95rem;
    color: #64748b;
    margin: -12px 0 16px 0;
    line-height: 1.5;
    font-weight: 500;
}

.xonex-home-section-card {
    background: #f8fafc;
    border-radius: 24px;
    padding: 24px;
    border: 1px solid #f1f5f9;
}

/* Rewards Slider / Grid */
.xonex-home-rewards-slider {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 8px 4px 20px 4px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}
.xonex-home-rewards-slider::-webkit-scrollbar { display: none; }

.xonex-reward-mini-card {
    flex: 0 0 160px;
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #f1f5f9;
    text-align: left;
    scroll-snap-align: start;
    transition: transform 0.2s;
    background: linear-gradient(to bottom, #ffffff, #f8fafc);
}

.xonex-reward-mini-img {
    width: 68px !important;
    height: 68px !important;
    margin: 12px auto 0 !important;
    padding: 0 !important;
    background: transparent !important;
}

.xonex-reward-mini-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.xonex-reward-mini-placeholder {
    width: 100%;
    height: 100%;
    background: #f1f5f9;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.xonex-reward-mini-info {
    padding: 12px;
}

.xonex-reward-mini-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
    height: 2.6em; /* max 2 lines */
    overflow: hidden;
    margin-bottom: 6px;
}

.xonex-reward-mini-points {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--xonex-primary);
    background: var(--xonex-secondary);
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
}

/* Banners */
.xonex-home-banners {
    margin-bottom: 32px;
}
.xonex-home-banner-item {
    display: block;
    margin-bottom: 12px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.xonex-home-banner-item img {
    width: 100%;
    display: block;
}

/* Levels */
.xonex-home-levels-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.xonex-home-level-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    padding: 14px 20px;
    border-radius: 18px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    border: 1px solid #f1f5f9;
    margin-bottom: 4px;
    transition: background 0.2s;
}

.xonex-home-level-item:hover {
    background: #f8fafc;
}

.xonex-home-level-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}

.xonex-home-level-min {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
}
.xonex-home-level-min strong { color: #1e293b; }

/* Stores */
.xonex-home-stores-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.xonex-home-store-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    padding: 16px 20px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #f1f5f9;
}

.xonex-home-store-icon {
    width: 44px;
    height: 44px;
    background: rgba(30, 64, 175, 0.05);
    color: var(--xonex-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-shrink: 0;
}

.xonex-home-store-icon svg {
    width: 24px;
    height: 24px;
}

.xonex-home-store-name {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 2px;
}

.xonex-home-store-address {
    font-size: 0.88rem;
    color: #64748b;
}

@media (min-width: 640px) {
    .xonex-home-stores-list {
        grid-template-columns: 1fr 1fr;
    }
}

/* =====================================================================
   FOOTER MODERN
   ===================================================================== */
.xonex-footer-modern {
    background: #0f172a; /* Deeper dark blue */
    color: #f1f5f9;
    padding: 0;
    font-family: var(--xonex-font);
    line-height: 1.5;
    margin-top: 60px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

/* Compact Help Section inside Footer */
.xonex-footer-help-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 12px 24px;
    margin-bottom: 40px;
}

.xonex-footer-help-text {
    display: flex;
    align-items: center;
    gap: 12px;
}

.xonex-footer-help-text svg {
    width: 20px;
    height: 20px;
    color: var(--xonex-primary);
}

.xonex-footer-help-text span {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
}

.xonex-footer-help-btn-small {
    background: var(--xonex-primary);
    color: #fff;
    padding: 6px 18px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}

.xonex-footer-help-btn-small:hover {
    background: #1e3a8a;
    transform: translateY(-1px);
}

/* Footer Main Area */
.xonex-footer-main {
    padding: 50px 0 50px 0;
}

.xonex-footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr 1fr;
    gap: 60px;
}

.xonex-footer-logo {
    max-height: 64px;
    margin-bottom: 24px;
    display: block;
}

.xonex-footer-company-info {
    font-size: 0.88rem;
    color: #94a3b8;
    line-height: 1.7;
    margin-bottom: 24px;
}

.xonex-footer-title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0 0 24px 0;
}

.xonex-footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}
.xonex-footer-links li { margin-bottom: 12px; }
.xonex-footer-links a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s;
}
.xonex-footer-links a:hover {
    color: #fff;
    padding-left: 6px;
}

/* Vibrant Socials */
.xonex-socials-vibrant {
    display: flex;
    gap: 12px;
}
.xonex-v-social {
    width: 42px;
    height: 42px;
    background: rgba(255,255,255,0.05); /* Lighter background for better visibility */
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255,255,255,0.1);
}
.xonex-v-social svg { width: 22px; height: 22px; }
.xonex-v-social:hover {
    transform: translateY(-5px);
    background: var(--xonex-primary);
    border-color: var(--xonex-primary);
    box-shadow: 0 10px 20px rgba(30, 64, 175, 0.4);
}

/* Footer Bottom */
.xonex-footer-bottom {
    background: #020617;
    padding: 30px 0;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.xonex-footer-bottom-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #64748b;
    font-size: 0.88rem;
}
.xonex-footer-credits span { color: #fff; font-weight: 600; }

@media (max-width: 768px) {
    .xonex-footer-help-compact { flex-direction: column; gap: 16px; text-align: center; }
    .xonex-footer-grid { grid-template-columns: 1fr; text-align: center; gap: 40px; }
    .xonex-footer-logo { margin: 0 auto 24px auto; }
    .xonex-socials-vibrant { justify-content: center; }
    .xonex-footer-bottom-flex { flex-direction: column; gap: 10px; }
}

/* Navbar Avatar Circle */
.xonex-navbar-avatar {
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0;
}
.xonex-navbar-avatar img,
.xonex-navbar-avatar-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}
.xonex-acct-mob-photo {
    width: 22px !important;
    height: 22px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
}
.xonex-acct-btn {
    gap: 4px !important;
    padding: 4px 8px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    font-size: 0.82rem !important;
}
.xonex-home-portal {
    padding-left: 20px !important;
    padding-right: 20px !important;
}
.xonex-navbar {
    padding-left: 20px !important;
    padding-right: 20px !important;
}

/* Home Section CTAs */
.xonex-home-section-ctas {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
}
.xonex-home-cta {
    padding: 10px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.xonex-home-cta--register {
    background: var(--xonex-primary);
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.2);
}
.xonex-home-cta--register:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(30, 64, 175, 0.3);
}
.xonex-home-cta--login {
    background: #fff;
    color: var(--xonex-primary) !important;
    border: 1.5px solid var(--xonex-primary);
}
.xonex-home-cta--login:hover {
    background: var(--xonex-secondary);
}

@media (max-width: 480px) {
    .xonex-home-section-ctas { flex-direction: column; width: 100%; gap: 10px; }
    .xonex-home-cta { width: 100%; }
}

/* Home Portal Section Backgrounds */
.xonex-home-section-rewards {
    background: linear-gradient(135deg, #bfdbfe 0%, #eff6ff 100%) !important;
    border: 1.5px solid #3b82f6 !important;
}
.xonex-home-section-levels {
    background: linear-gradient(135deg, #fed7aa 0%, #fff7ed 100%) !important;
    border: 1.5px solid #f97316 !important;
}

/* ==========================================================================
   OPERATOR SUCCESS OVERLAY
   ========================================================================== */
.xonex-op-success-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: xonexOpFadeIn .3s ease forwards;
}

.xonex-op-success-box {
    background: #ffffff;
    width: 100%;
    max-width: 400px;
    border-radius: 32px;
    padding: 40px 24px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.9);
    opacity: 0;
    animation: xonexOpPopIn .4s cubic-bezier(.34,1.56,.64,1) forwards;
}

.xonex-op-success-icon {
    width: 80px;
    height: 80px;
    background: #d1fae5;
    color: #059669;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    position: relative;
}

.xonex-op-success-icon svg {
    width: 40px;
    height: 40px;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: xonexOpCheckmark 0.6s ease-out 0.3s forwards;
}

.xonex-op-success-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 8px;
}

.xonex-op-success-value {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--xonex-primary);
    margin-bottom: 16px;
    display: block;
}

.xonex-op-success-balance {
    font-size: 0.95rem;
    color: #64748b;
    background: #f1f5f9;
    padding: 8px 16px;
    border-radius: 999px;
    display: inline-block;
    font-weight: 600;
}

.xonex-op-success-close {
    margin-top: 32px;
    width: 100%;
    background: #1e293b;
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.xonex-op-success-close:active { transform: scale(0.98); }

/* Animazioni */
@keyframes xonexOpFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes xonexOpPopIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes xonexOpCheckmark { to { stroke-dashoffset: 0; } }

/* Saldo Highlight */
.xonex-op-balance-highlight {
    animation: xonexOpPulse 1s ease-out;
}
@keyframes xonexOpPulse {
    0% { transform: scale(1); color: var(--xonex-primary); }
    50% { transform: scale(1.1); color: #059669; text-shadow: 0 0 15px rgba(5,150,105,0.3); }
    100% { transform: scale(1); }
}
