/* ================================================================
   EasyRSVP Shared Design System — ersvp-shared.css
   Used across: Dashboard, Edit Event wizard
   ================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ─── Design Tokens ───────────────────────────────────────────── */
:root {
    --ersvp-accent:       #4f46e5;
    --ersvp-accent-light: #eef2ff;
    --ersvp-accent-hover: #4338ca;
    --ersvp-bg:           #f1f5f9;
    --ersvp-surface:      #ffffff;
    --ersvp-border:       #e2e8f0;
    --ersvp-border-focus: #4f46e5;
    --ersvp-text:         #0f172a;
    --ersvp-muted:        #64748b;
    --ersvp-subtle:       #94a3b8;
    --ersvp-success:      #10b981;
    --ersvp-danger:       #f43f5e;
    --ersvp-warning:      #f59e0b;
    --ersvp-radius:       14px;
    --ersvp-radius-sm:    8px;
    --ersvp-radius-lg:    20px;
    --ersvp-shadow-sm:    0 1px 4px rgba(0,0,0,0.06);
    --ersvp-shadow-md:    0 4px 16px rgba(0,0,0,0.08);
    --ersvp-shadow-lg:    0 12px 40px rgba(0,0,0,0.12);
    --ersvp-font:         'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --ersvp-transition:   0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Base Reset for App Shell ────────────────────────────────── */
.ersvp-app, .ersvp-wizard {
    font-family: var(--ersvp-font);
    color: var(--ersvp-text);
    background: var(--ersvp-bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    box-sizing: border-box;
}

.ersvp-app *, .ersvp-wizard * {
    box-sizing: border-box;
}

/* ─── Shared App Header ───────────────────────────────────────── */
.ersvp-app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--ersvp-surface);
    border-bottom: 1px solid var(--ersvp-border);
    position: sticky;
    top: 0;
    z-index: 50;
    gap: 12px;
}

.ersvp-app-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.ersvp-app-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ─── Avatar ──────────────────────────────────────────────────── */
.ersvp-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0;
    user-select: none;
}

/* ─── Header Info ─────────────────────────────────────────────── */
.ersvp-header-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.ersvp-header-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--ersvp-accent);
    letter-spacing: 0.8px;
    font-size: 11px;
    font-weight: 500;
    color: var(--ersvp-subtle);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
}

.ersvp-header-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--ersvp-text);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
    line-height: 1.3;
}

/* ─── Icon Button ─────────────────────────────────────────────── */
.ersvp-icon-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 14px;
    border-radius: var(--ersvp-radius-sm);
    border: 1px solid var(--ersvp-border);
    background: #f8fafc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--ersvp-muted);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--ersvp-transition);
    flex-shrink: 0;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    box-shadow: none;
    text-transform: none;
    letter-spacing: normal;
}

.ersvp-icon-btn:hover {
    background: var(--ersvp-border);
    color: var(--ersvp-text);
    border-color: #cbd5e1;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.04);
}

/* ─── Primary / Secondary Buttons ───────────────────────────────  */
.ersvp-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    background: var(--ersvp-accent);
    color: #fff;
    border: none;
    border-radius: var(--ersvp-radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--ersvp-transition);
    text-decoration: none;
    letter-spacing: 0;
    text-transform: none;
    box-shadow: none;
    min-height: 44px;
}

.ersvp-btn-primary:hover {
    background: var(--ersvp-accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79,70,229,0.3);
    color: #fff;
    text-decoration: none;
}

.ersvp-btn-primary:active { transform: translateY(0); }

.ersvp-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: #f8fafc;
    color: var(--ersvp-muted);
    border: 1.5px solid var(--ersvp-border);
    border-radius: var(--ersvp-radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--ersvp-transition);
    text-decoration: none;
    letter-spacing: 0;
    text-transform: none;
    box-shadow: none;
    min-height: 44px;
}

.ersvp-btn-secondary:hover {
    background: var(--ersvp-border);
    color: var(--ersvp-text);
    text-decoration: none;
}

/* ─── Badges ──────────────────────────────────────────────────── */
.ersvp-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.6;
}

.badge-attending { background: #d1fae5; color: #065f46; }
.badge-not       { background: #ffe4e6; color: #9f1239; }

/* ─── Section Header ──────────────────────────────────────────── */
.ersvp-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 24px 0 12px;
}

.ersvp-section-header h2 {
    font-size: 13px;
    font-weight: 600;
    color: var(--ersvp-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin: 0;
}

/* ─── Form Inputs — Shared Style ─────────────────────────────── */
.ersvp-field {
    margin-bottom: 18px;
}

.ersvp-field label,
.ersvp-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--ersvp-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.ersvp-field input,
.ersvp-field select,
.ersvp-field textarea,
.ersvp-input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--ersvp-border);
    border-radius: var(--ersvp-radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--ersvp-text);
    background: #f8fafc;
    transition: all var(--ersvp-transition);
    outline: none;
    appearance: none;
}

.ersvp-field input:focus,
.ersvp-field select:focus,
.ersvp-field textarea:focus,
.ersvp-input:focus {
    border-color: var(--ersvp-border-focus);
    background: var(--ersvp-surface);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.ersvp-field select,
select.ersvp-input,
.ersvp-input select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 14px !important;
    padding-right: 38px !important;
}

.ersvp-field textarea { resize: vertical; min-height: 80px; }

.ersvp-field-hint {
    margin-top: 6px;
    font-size: 12px;
    color: var(--ersvp-subtle);
    line-height: 1.4;
}

/* ─── Toast (shared across all pages) ────────────────────────── */
.easyrsvp-toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 11000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    width: calc(100% - 40px);
    max-width: 400px;
}

.easyrsvp-toast {
    background: #1e293b;
    color: #fff;
    padding: 12px 18px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--ersvp-font);
    opacity: 0;
    transform: translateY(16px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
}

.easyrsvp-toast.show { opacity: 1; transform: translateY(0); }
.easyrsvp-toast svg  { color: var(--ersvp-success); flex-shrink: 0; }

/* ─── Color Icon Backgrounds ─────────────────────────────────── */
.ersvp-icon-blue   { background: #eff6ff; color: #2563eb; }
.ersvp-icon-purple { background: #f5f3ff; color: #7c3aed; }
.ersvp-icon-green  { background: #f0fdf4; color: #16a34a; }
.ersvp-icon-teal   { background: #f0fdfa; color: #0d9488; }
.ersvp-icon-orange { background: #fff7ed; color: #ea580c; }
.ersvp-icon-red    { background: #fff1f2; color: #e11d48; }

/* ─── Step Progress ───────────────────────────────────────────── */
.ersvp-progress-track {
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
    margin-bottom: 32px;
}

.ersvp-progress-track::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 20px;
    right: 20px;
    height: 2px;
    background: var(--ersvp-border);
    transform: translateY(-50%);
    z-index: 0;
}

.ersvp-progress-step {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.ersvp-progress-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--ersvp-border);
    background: var(--ersvp-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--ersvp-subtle);
    transition: all var(--ersvp-transition);
}

.ersvp-progress-step.active .ersvp-progress-circle {
    border-color: var(--ersvp-accent);
    color: var(--ersvp-accent);
    box-shadow: 0 0 0 4px rgba(79,70,229,0.12);
}

.ersvp-progress-step.done .ersvp-progress-circle {
    border-color: var(--ersvp-accent);
    background: var(--ersvp-accent);
    color: #fff;
}

.ersvp-progress-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--ersvp-subtle);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.ersvp-progress-step.active .ersvp-progress-label { color: var(--ersvp-accent); }
.ersvp-progress-step.done   .ersvp-progress-label { color: var(--ersvp-muted); }

/* ─── Responsive: Mobile (< 768px) ──────────────────────────── */
@media (max-width: 767px) {
    .ersvp-header-title  { font-size: 15px; max-width: 180px; }
    .ersvp-header-label  { max-width: 180px; }
    .ersvp-progress-label { display: none; } /* hide labels on mobile for space */
    .ersvp-progress-track::before { left: 16px; right: 16px; }
    .ersvp-progress-circle { width: 28px; height: 28px; font-size: 11px; }

    .easyrsvp-toast-container {
        bottom: 80px; /* above mobile nav */
    }
}

/* ─── Adaptive Wizard Layout ──────────────────────────────────── */
.ersvp-wizard-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--ersvp-bg);
}

@media (min-width: 768px) {
    .ersvp-wizard-shell {
        display: grid;
        grid-template-columns: 1fr 1fr;
        height: 100vh;
        overflow: hidden;
    }
}

.ersvp-wizard-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--ersvp-surface);
    overflow-y: auto;
    position: relative;
    z-index: 10;
}

@media (min-width: 768px) {
    .ersvp-wizard-main {
        width: 100%;
        box-shadow: 10px 0 30px rgba(0,0,0,0.04);
        border-right: 1px solid var(--ersvp-border);
    }
}

/* Wizard Specific Body Container */
.ersvp-wizard-content-wrap {
    padding: 32px 24px 100px;
    margin: 0 auto;
    width: 100%;
}

@media (min-width: 768px) {
    .ersvp-wizard-content-wrap {
        padding: 40px 40px 60px;
    }
}

.ersvp-wizard-preview {
    display: none; /* Mobile: hidden by default, accessible via floating btn maybe? */
    flex: 1;
    background: var(--ersvp-bg);
    position: relative;
    overflow: visible;
}

@media (min-width: 768px) {
    .ersvp-wizard-preview {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 40px;
        padding-top: 60px;
        background: #f1f5f9;
        background-image: radial-gradient(#e2e8f0 1.5px, transparent 1.5px);
        background-size: 24px 24px;
    }
}


/* Device Toggles Positioning */
.ersvp-preview-controls {
    position: relative;
    display: flex;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    padding: 6px;
    border-radius: 14px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 1px solid rgba(255,255,255,0.5);
    gap: 4px;
    z-index: 10;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.ersvp-preview-controls .ersvp-icon-btn {
    border: none;
    background: transparent;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    cursor: pointer;
}

#easyrsvp-preview-refresh {
    cursor: pointer;
}

.ersvp-preview-controls .ersvp-icon-btn.active {
    background: var(--ersvp-accent);
    color: #fff;
    box-shadow: 0 4px 10px rgba(79,70,229,0.2);
}

.ersvp-preview-controls-divider {
    width: 1px;
    height: 24px;
    background: var(--ersvp-border);
    margin: 0 4px;
    opacity: 0.6;
}

#easyrsvp-preview-refresh:hover {
    background: var(--ersvp-success);
    border-color: var(--ersvp-success);
    color: #fff;
    transform: rotate(90deg);
    box-shadow: 0 4px 10px rgba(16,185,129,0.2);
}

#easyrsvp-preview-refresh svg {
    transition: transform 0.3s ease;
}

#easyrsvp-preview-refresh:hover svg {
    transform: rotate(180deg);
}

#easyrsvp-preview-refresh.refreshing {
    animation: spin 1s linear infinite;
    pointer-events: none;
}

#easyrsvp-preview-refresh.refreshing svg {
    transform: rotate(0deg);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Preview Refresh Toast */
.easyrsvp-preview-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    background: var(--ersvp-success);
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--ersvp-font);
    box-shadow: 0 4px 12px rgba(16,185,129,0.3);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.easyrsvp-preview-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Preview Frame System */
.ersvp-preview-frame-wrap {
    width: 100%;
    height: 100%;
    max-height: 840px;
    background: #0f172a;
    border-radius: 48px;
    padding: 12px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.15);
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255,255,255,0.1);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 1;
    min-height: 0;
}

.ersvp-preview-frame-wrap.mobile { max-width: 375px; }
.ersvp-preview-frame-wrap.tablet { max-width: 768px; }
.ersvp-preview-frame-wrap.desktop { max-width: 100%; border-radius: 12px; padding: 0; border: none; }

.ersvp-preview-frame-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 28px;
    background: #0f172a;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
    z-index: 2;
}

.ersvp-preview-frame-wrap.desktop::after { display: none; }

.ersvp-preview-iframe {
    width: 100%;
    height: 100%;
    border-radius: 36px;
    border: none;
    background: #fff;
    transition: border-radius 0.4s;
}

.ersvp-preview-frame-wrap.desktop .ersvp-preview-iframe { border-radius: 12px; }

/* Style Panel (Floating Appearance) */
.style-panel {
    position: absolute;
    width: 280px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.12);
    padding: 20px;
    z-index: 100;
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.1);
}

.style-panel.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.style-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.style-panel-header h3 {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    color: var(--ersvp-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.style-panel .close-panel {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--ersvp-muted);
    cursor: pointer;
}

.style-option label {
    font-size: 11px;
    font-weight: 700;
    color: var(--ersvp-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
    display: block;
}

.color-picker-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1.5px solid var(--ersvp-border);
}

.color-picker-wrap input[type="color"] {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    overflow: hidden;
}

.color-picker-wrap .color-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--ersvp-text);
    font-family: monospace;
}

/* Mobile Navigation Bar */
.ersvp-wizard-mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: var(--ersvp-surface);
    border-top: 1px solid var(--ersvp-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 100;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
    gap: 12px;
}

.ersvp-wizard-mobile-nav.hidden {
    display: none;
}

@media (min-width: 768px) {
    .ersvp-wizard-mobile-nav {
        display: none;
    }
}

/* ─── Dashboard Responsive Shell ──────────────────────────────── */
.ersvp-sidebar {
    display: none; /* Hidden on mobile */
}

.ersvp-app-main {
    flex: 1;
    min-width: 0;
}

@media (min-width: 1024px) {
    .ersvp-app {
        display: flex;
        flex-direction: row;
        background: var(--ersvp-bg);
        width: 100%;
        min-height: 100vh;
    }
    
    .ersvp-sidebar {
        display: flex;
        flex-direction: column;
        width: 280px;
        flex-shrink: 0;
        height: 100vh;
        background: var(--ersvp-surface);
        border-right: 1px solid var(--ersvp-border);
        position: sticky;
        top: 0;
        z-index: 100;
        padding: 32px 24px;
    }

    .ersvp-app-main {
        flex: 1;
        max-width: none;
        padding: 40px 60px;
        width: 100%;
    }

    .ersvp-bottom-nav {
        display: none !important;
    }
    
    /* Hide mobile headers when sidebar is present */
    .ersvp-app-main .ersvp-app-header {
        display: none !important;
    }

    .ersvp-screen-body {
        padding: 0;
    }
}

/* ─── Sidebar Components ───────────────────────────────────────── */
.ersvp-sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.ersvp-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.ersvp-sidebar-nav .ersvp-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: var(--ersvp-radius-sm);
    color: var(--ersvp-muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--ersvp-transition);
    text-align: left;
    width: 100%;
}

.ersvp-sidebar-nav .ersvp-nav-item:hover {
    background: var(--ersvp-accent-light);
    color: var(--ersvp-accent);
}

.ersvp-sidebar-nav .ersvp-nav-item.active {
    background: var(--ersvp-accent);
    color: #fff;
}

.ersvp-sidebar-nav .ersvp-nav-item svg {
    opacity: 0.7;
}

.ersvp-sidebar-nav .ersvp-nav-item.active svg {
    opacity: 1;
}

.ersvp-sidebar-footer {
    padding-top: 24px;
    border-top: 1px solid var(--ersvp-border);
}

.ersvp-support-ref {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 16px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid var(--ersvp-border);
    border-radius: 8px;
}
.ersvp-support-ref-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
}
.ersvp-support-ref-sku {
    font-family: monospace;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: 1px;
}
.ersvp-support-ref-hint {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

.ersvp-btn-full {
    width: 100%;
}

/* ─── Dashboard Content Enhancements ───────────────────────────── */
@media (min-width: 768px) {
    /* Multi-column Stats on Desktop */
    .ersvp-quick-stats {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
        margin-bottom: 32px;
    }

    .ersvp-analytics-row {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    @media (min-width: 1280px) {
        .ersvp-analytics-row {
            grid-template-columns: repeat(4, 1fr);
        }
    }

    .ersvp-qr-card {
        display: flex;
        align-items: center;
        gap: 32px;
        padding: 32px;
    }
}

/* ─── Stat Pills (Desktop Version) ─────────────────────────────── */
.ersvp-stat-pill {
    background: var(--ersvp-surface);
    border: 1px solid var(--ersvp-border);
    padding: 24px;
    border-radius: var(--ersvp-radius);
    text-align: center;
    box-shadow: var(--ersvp-shadow-sm);
    transition: all var(--ersvp-transition);
}

.ersvp-stat-pill:hover {
    transform: translateY(-2px);
    box-shadow: var(--ersvp-shadow-md);
}

.ersvp-stat-pill-value {
    display: block;
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 4px;
}

.ersvp-stat-pill-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ersvp-muted);
}

/* Color Variants for Stat Pills */
.ersvp-stat-green { background: #f0fdf4 !important; }
.ersvp-stat-green .ersvp-stat-pill-value { color: #16a34a; }
.ersvp-stat-red   { background: #fff1f2 !important; }
.ersvp-stat-red   .ersvp-stat-pill-value { color: #e11d48; }
.ersvp-stat-blue  { background: #eff6ff !important; }
.ersvp-stat-blue  .ersvp-stat-pill-value { color: #2563eb; }

/* ─── Enhanced Color Picker Component ─────────────────────────── */
.ersvp-cpicker {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 1.5px solid var(--ersvp-border, #e2e8f0);
    border-radius: 10px;
    background: var(--ersvp-surface, #fff);
    overflow: hidden;
    height: 38px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.ersvp-cpicker:focus-within {
    border-color: var(--ersvp-border-focus, #4f46e5);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}
.ersvp-cpicker--full { width: 100%; }

.ersvp-cpicker__swatch-btn {
    position: relative;
    width: 38px;
    height: 100%;
    flex-shrink: 0;
    cursor: pointer;
    border: none;
    border-right: 1.5px solid var(--ersvp-border, #e2e8f0);
    background: transparent;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
}
.ersvp-cpicker__swatch-btn input[type="color"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    border: none;
    padding: 0;
    margin: 0;
}
.ersvp-cpicker__swatch {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 1.5px solid rgba(0,0,0,0.1);
    pointer-events: none;
    transition: transform 0.1s;
}
.ersvp-cpicker__swatch-btn:hover .ersvp-cpicker__swatch {
    transform: scale(1.1);
}
.ersvp-cpicker__hex {
    flex: 1;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 13px;
    font-weight: 600;
    color: var(--ersvp-text, #1e293b);
    padding: 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 90px;
    min-width: 0;
}
.ersvp-cpicker__hex::placeholder {
    color: var(--ersvp-muted, #94a3b8);
    font-weight: 400;
}
.ersvp-cpicker--sm {
    height: 30px;
}
.ersvp-cpicker--sm .ersvp-cpicker__swatch-btn {
    width: 30px;
}
.ersvp-cpicker--sm .ersvp-cpicker__swatch {
    width: 16px;
    height: 16px;
}
.ersvp-cpicker--sm .ersvp-cpicker__hex {
    font-size: 11px;
    width: 72px;
}

/* ─── Step 1 Header (Headline + Event Link & Title button) ────── */
.ersvp-step1-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.ersvp-step1-header h2 {
    flex: 1;
    min-width: 0;
}

.ersvp-link-title-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ersvp-accent, #4f46e5);
    background: rgba(79,70,229,0.07);
    border: 1.5px solid rgba(79,70,229,0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
    letter-spacing: 0.01em;
    flex-shrink: 0;
}
.ersvp-link-title-btn:hover {
    background: rgba(79,70,229,0.13);
    border-color: rgba(79,70,229,0.4);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(79,70,229,0.15);
}
.ersvp-link-title-btn svg {
    flex-shrink: 0;
    opacity: 0.85;
}

/* ─── Event Link & Title Popup ──────────────────────────────────── */
.ersvp-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15,23,42,0.45);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    /* Hidden by default via visibility — avoids jQuery display issues */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, visibility 0.18s ease;
}
.ersvp-popup-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.ersvp-popup-box {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(15,23,42,0.18), 0 4px 16px rgba(15,23,42,0.08);
    width: 100%;
    max-width: 460px;
    overflow: hidden;
    transform: scale(0.93) translateY(8px);
    transition: transform 0.18s cubic-bezier(0.34,1.56,0.64,1);
}
.ersvp-popup-overlay.is-open .ersvp-popup-box {
    transform: scale(1) translateY(0);
}
.ersvp-popup-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 22px 24px 16px;
    border-bottom: 1px solid var(--ersvp-border, #e2e8f0);
}
.ersvp-popup-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ersvp-text, #0f172a);
    margin: 0 0 4px;
}
.ersvp-popup-copy {
    font-size: 12px;
    color: var(--ersvp-muted, #64748b);
    margin: 0;
    line-height: 1.5;
}
.ersvp-popup-close {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    border-radius: 6px;
    color: var(--ersvp-muted, #64748b);
    cursor: pointer;
    transition: all 0.15s;
    padding: 0;
    margin-top: 2px;
}
.ersvp-popup-close:hover {
    background: #f1f5f9;
    color: var(--ersvp-text, #0f172a);
}
.ersvp-popup-body {
    padding: 20px 24px;
}
.ersvp-popup-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 24px 20px;
    border-top: 1px solid var(--ersvp-border, #e2e8f0);
    flex-wrap: wrap;
}
.ersvp-popup-msg {
    flex: 1;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 6px;
    min-width: 0;
}
.ersvp-popup-msg--success {
    color: #15803d;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}
.ersvp-popup-msg--error {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
}
.ersvp-popup-title-hint {
    font-size: 11px;
    font-weight: 400;
    color: var(--ersvp-muted, #64748b);
    margin-left: 4px;
}

/* ─── Ghost / Cancel Button ─────────────────────────────────────── */
.ersvp-btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ersvp-muted, #64748b);
    background: transparent;
    border: 1.5px solid var(--ersvp-border, #e2e8f0);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 40px;
    text-decoration: none;
}
.ersvp-btn-ghost:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--ersvp-text, #0f172a);
}
