/**
 * PEM Organiser Dashboard Styles
 * A premium, modern dashboard for event organisers.
 */

/* ===========================
   Dashboard Layout
   =========================== */
.pem-organiser-dashboard {
    max-width: 1100px;
    margin: 2rem auto;
    font-family: var(--pem-font-family, 'Inter', system-ui, -apple-system, sans-serif);
    color: var(--pem-text-main, #1F2937);
}

/* Login / No-Access Notice */
.pem-dashboard-login-notice {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--pem-bg-white, #fff);
    border: 1px solid var(--pem-border, #E5E7EB);
    border-radius: 1rem;
    box-shadow: var(--pem-shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.05));
}

.pem-login-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.pem-dashboard-login-notice h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.pem-dashboard-login-notice p {
    color: var(--pem-text-muted, #6B7280);
    margin-bottom: 1.5rem;
}

/* ===========================
   Header
   =========================== */
.pem-dash-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.pem-dash-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0;
    line-height: 1.3;
}

.pem-dash-greeting {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--pem-text-muted, #6B7280);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pem-dash-subtitle {
    color: var(--pem-text-muted, #6B7280);
    margin: 0.25rem 0 0;
    font-size: 0.95rem;
}

.pem-btn-create {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    background: linear-gradient(135deg, #4F46E5 0%, #6366F1 100%);
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.pem-btn-create:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.4);
}

.pem-btn-icon {
    font-size: 1.25rem;
    font-weight: 300;
    line-height: 1;
}

/* ===========================
   Stats Cards
   =========================== */
.pem-dash-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.pem-stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--pem-bg-white, #fff);
    border: 1px solid var(--pem-border, #E5E7EB);
    border-radius: 0.75rem;
    box-shadow: var(--pem-shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.05));
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.pem-stat-card:hover {
    box-shadow: var(--pem-shadow, 0 4px 6px -1px rgba(0, 0, 0, 0.1));
    transform: translateY(-2px);
}

.pem-stat-icon {
    font-size: 1.75rem;
    line-height: 1;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pem-bg-light, #F3F4F6);
    border-radius: 0.625rem;
}

.pem-stat-info {
    display: flex;
    flex-direction: column;
}

.pem-stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--pem-text-main, #1F2937);
    line-height: 1.2;
}

.pem-stat-label {
    font-size: 0.8125rem;
    color: var(--pem-text-muted, #6B7280);
    font-weight: 500;
}

.pem-stat-pop {
    animation: pemStatPop 0.3s ease;
}

@keyframes pemStatPop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
    }
}

/* ===========================
   Toolbar (Search & Filters)
   =========================== */
.pem-dash-toolbar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.pem-dash-search {
    flex: 1;
    min-width: 200px;
}

.pem-search-input {
    width: 100%;
    padding: 0.625rem 1rem;
    border: 1px solid var(--pem-border, #E5E7EB);
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    background: var(--pem-bg-white, #fff);
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.pem-search-input:focus {
    outline: none;
    border-color: var(--pem-primary, #4F46E5);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.pem-dash-filters {
    display: flex;
    gap: 0.5rem;
}

.pem-filter-select {
    padding: 0.625rem 2rem 0.625rem 0.75rem;
    border: 1px solid var(--pem-border, #E5E7EB);
    border-radius: 0.5rem;
    background: var(--pem-bg-white, #fff);
    font-size: 0.9375rem;
    cursor: pointer;
    appearance: auto;
    font-family: inherit;
}

.pem-filter-select:focus {
    outline: none;
    border-color: var(--pem-primary, #4F46E5);
}

/* ===========================
   Events Table
   =========================== */
.pem-events-table-wrap {
    background: var(--pem-bg-white, #fff);
    border: 1px solid var(--pem-border, #E5E7EB);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--pem-shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.05));
}

.pem-events-table {
    width: 100%;
}

.pem-table-header {
    display: flex;
    padding: 0.75rem 1.25rem;
    background: var(--pem-bg-light, #F3F4F6);
    border-bottom: 1px solid var(--pem-border, #E5E7EB);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--pem-text-muted, #6B7280);
}

.pem-th-event {
    flex: 2;
}

.pem-th-date {
    flex: 1.2;
}

.pem-th-venue {
    flex: 1;
}

.pem-th-status {
    flex: 0.6;
}

.pem-th-actions {
    flex: 0.8;
    text-align: right;
}

.pem-table-row {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--pem-border, #E5E7EB);
    transition: background 0.15s ease;
}

.pem-table-row:last-child {
    border-bottom: none;
}

.pem-table-row:hover {
    background: rgba(79, 70, 229, 0.02);
}

.pem-td-event {
    flex: 2;
}

.pem-td-date {
    flex: 1.2;
}

.pem-td-venue {
    flex: 1;
    font-size: 0.9rem;
}

.pem-td-status {
    flex: 0.6;
}

.pem-td-actions {
    flex: 0.8;
    display: flex;
    gap: 0.4rem;
    justify-content: flex-end;
}

.pem-event-info {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.pem-event-thumb {
    width: 44px;
    height: 44px;
    border-radius: 0.5rem;
    background-size: cover;
    background-position: center;
    background-color: var(--pem-bg-light, #F3F4F6);
    flex-shrink: 0;
}

.pem-event-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.pem-event-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--pem-text-main, #1F2937);
    line-height: 1.3;
}

.pem-event-tickets {
    font-size: 0.8rem;
    color: var(--pem-text-muted, #6B7280);
    margin-top: 2px;
}

.pem-date-display {
    font-size: 0.875rem;
    font-weight: 500;
}

.pem-upcoming-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.125rem 0.5rem;
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border-radius: 1rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Status Pills */
.pem-status-pill {
    display: inline-block;
    padding: 0.2rem 0.625rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.pem-status-publish {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.pem-status-draft {
    background: rgba(245, 158, 11, 0.1);
    color: #D97706;
}

.pem-status-pending {
    background: rgba(79, 70, 229, 0.1);
    color: #4F46E5;
}

/* Action Buttons */
.pem-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--pem-border, #D1D5DB);
    border-radius: 0.375rem;
    background: var(--pem-bg-white, #fff);
    color: var(--pem-text-main, #374151);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
}

.pem-action-btn svg {
    flex-shrink: 0;
    color: var(--pem-text-muted, #6B7280);
    transition: color 0.15s ease;
}

.pem-action-btn:hover {
    border-color: var(--pem-primary, #4F46E5);
    color: var(--pem-primary, #4F46E5);
    background: rgba(79, 70, 229, 0.04);
}

.pem-action-btn:hover svg {
    color: var(--pem-primary, #4F46E5);
}

/* ===========================
   Loading & Empty States
   =========================== */
.pem-dash-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    gap: 1rem;
}

.pem-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--pem-border, #E5E7EB);
    border-top: 3px solid var(--pem-primary, #4F46E5);
    border-radius: 50%;
    animation: pemSpin 0.8s linear infinite;
}

@keyframes pemSpin {
    to {
        transform: rotate(360deg);
    }
}

.pem-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.pem-empty-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.pem-empty-state h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.pem-empty-state p {
    color: var(--pem-text-muted, #6B7280);
    margin-bottom: 1.5rem;
    max-width: 400px;
}

/* ===========================
   Modal
   =========================== */
.pem-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pemFadeIn 0.2s ease;
}

@keyframes pemFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.pem-modal {
    background: var(--pem-bg-white, #fff);
    border-radius: 0.875rem;
    width: 700px;
    max-width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
    animation: pemSlideUp 0.25s ease;
}

.pem-modal-sm {
    width: 450px;
}

@keyframes pemSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pem-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--pem-border, #E5E7EB);
    flex-shrink: 0;
}

.pem-modal-header-danger {
    background: #FEF2F2;
}

.pem-modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
}

.pem-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 1.5rem;
    color: var(--pem-text-muted, #6B7280);
    cursor: pointer;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.pem-modal-close:hover {
    background: var(--pem-bg-light, #F3F4F6);
}

.pem-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.pem-modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.pem-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--pem-border, #E5E7EB);
    flex-shrink: 0;
    gap: 0.75rem;
}

.pem-modal-footer-left {
    flex: 1;
}

.pem-modal-footer-right {
    display: flex;
    gap: 0.5rem;
}

/* ===========================
   Modal Tabs
   =========================== */
.pem-modal-tabs {
    display: flex;
    gap: 0.25rem;
    background: var(--pem-bg-light, #F3F4F6);
    padding: 0.25rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.pem-modal-tab {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--pem-text-muted, #6B7280);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.pem-modal-tab:hover {
    color: var(--pem-text-main, #1F2937);
}

.pem-modal-tab.active {
    background: var(--pem-bg-white, #fff);
    color: var(--pem-primary, #4F46E5);
    box-shadow: var(--pem-shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.05));
    font-weight: 600;
}

.pem-modal-tab-content {
    display: none;
}

.pem-modal-tab-content.active {
    display: block;
    animation: pemFadeIn 0.2s ease;
}

/* ===========================
   Form Elements
   =========================== */
.pem-form-group {
    margin-bottom: 1.25rem;
}

.pem-form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--pem-text-main, #1F2937);
    margin-bottom: 0.375rem;
}

.pem-form-group label .required {
    color: #EF4444;
}

.pem-form-control {
    width: 100%;
    padding: 0.5625rem 0.75rem;
    border: 1px solid var(--pem-border, #E5E7EB);
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    color: var(--pem-text-main, #1F2937);
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    background: var(--pem-bg-white, #fff);
    box-sizing: border-box;
}

.pem-form-control:focus {
    outline: none;
    border-color: var(--pem-primary, #4F46E5);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

textarea.pem-form-control {
    resize: vertical;
    min-height: 100px;
}

select.pem-form-control {
    appearance: auto;
    cursor: pointer;
}

.pem-form-row {
    display: flex;
    gap: 1rem;
}

.pem-form-half {
    flex: 1;
}

.pem-form-quarter {
    flex: 0.5;
    min-width: 100px;
}

.pem-form-hint {
    font-size: 0.8125rem;
    color: var(--pem-text-muted, #6B7280);
    margin-top: 0.375rem;
}

.pem-hint-warning {
    color: #D97706;
}

/* ===========================
   Tickets Section
   =========================== */
.pem-tickets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.pem-tickets-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.pem-btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.pem-ticket-row {
    background: var(--pem-bg-light, #F3F4F6);
    border: 1px solid var(--pem-border, #E5E7EB);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.pem-ticket-row:hover {
    border-color: var(--pem-primary, #4F46E5);
}

.pem-ticket-removing {
    opacity: 0;
    transform: translateX(20px);
    max-height: 0;
    overflow: hidden;
    padding: 0;
    margin: 0;
    border: none;
}

.pem-ticket-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.pem-ticket-row-title {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--pem-primary, #4F46E5);
}

.pem-ticket-remove-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #9CA3AF;
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.pem-ticket-remove-btn:hover {
    color: #EF4444;
    background: #FEE2E2;
}

.pem-ticket-eb-toggle {
    margin-top: 0.5rem;
}

.pem-ticket-eb-toggle label {
    font-size: 0.8125rem;
    color: var(--pem-text-muted, #6B7280);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.pem-ticket-eb-fields {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--pem-border, #E5E7EB);
}

/* ===========================
   Buttons
   =========================== */
.pem-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    background: var(--pem-primary, #4F46E5);
    color: #fff;
    font-weight: 600;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: inherit;
}

.pem-btn:hover {
    background: var(--pem-primary-hover, #4338CA);
    transform: translateY(-1px);
}

.pem-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.pem-btn-secondary {
    background: var(--pem-bg-white, #fff);
    color: var(--pem-text-main, #1F2937);
    border: 1px solid var(--pem-border, #E5E7EB);
}

.pem-btn-secondary:hover {
    background: var(--pem-bg-light, #F3F4F6);
}

.pem-btn-danger {
    background: #EF4444;
}

.pem-btn-danger:hover {
    background: #DC2626;
}

.pem-text-danger {
    color: #EF4444;
    font-weight: 600;
}

.pem-text-muted {
    color: var(--pem-text-muted, #6B7280);
}

/* ===========================
   Toast Notification
   =========================== */
.pem-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    z-index: 200000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    animation: pemSlideInRight 0.3s ease;
    font-family: var(--pem-font-family, 'Inter', system-ui, -apple-system, sans-serif);
}

.pem-toast-success {
    background: #059669;
    color: #fff;
}

.pem-toast-error {
    background: #DC2626;
    color: #fff;
}

.pem-toast-info {
    background: var(--pem-primary, #4F46E5);
    color: #fff;
}

.pem-toast-hide {
    animation: pemSlideOutRight 0.3s ease forwards;
}

@keyframes pemSlideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pemSlideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 768px) {
    .pem-dash-header {
        flex-direction: column;
        align-items: stretch;
    }

    .pem-dash-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .pem-dash-toolbar {
        flex-direction: column;
    }

    .pem-dash-filters {
        width: 100%;
    }

    .pem-filter-select {
        flex: 1;
    }

    /* Table becomes card layout */
    .pem-table-header {
        display: none;
    }

    .pem-table-row {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 1rem;
    }

    .pem-td-event {
        flex: 1 1 100%;
    }

    .pem-td-date {
        flex: 1 1 40%;
    }

    .pem-td-venue {
        flex: 1 1 40%;
    }

    .pem-td-status {
        flex: 0 0 auto;
    }

    .pem-td-actions {
        flex: 0 0 auto;
    }

    .pem-modal {
        width: 100%;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }

    .pem-form-row {
        flex-direction: column;
        gap: 0;
    }

    .pem-form-quarter {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .pem-dash-stats {
        grid-template-columns: 1fr;
    }
}

/* TinyMCE Editor Refinement */
.pem-editor-container {
    border: 1px solid var(--pem-border, #D1D5DB);
    border-radius: 0.5rem;
    overflow: hidden;
    background: #fff;
    margin-top: 0.5rem;
}

.pem-editor-container .wp-editor-container {
    border: none !important;
}

.pem-editor-container .wp-editor-area {
    border: none !important;
    padding: 1rem !important;
    font-family: inherit;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.pem-editor-container .mce-toolbar-grp {
    background: #F9FAFB !important;
    border-bottom: 1px solid var(--pem-border, #E5E7EB) !important;
}

.pem-editor-container .mce-edit-area {
    border-top: none !important;
}

.pem-editor-container .quicktags-toolbar {
    background: #F9FAFB !important;
    border-bottom: 1px solid var(--pem-border, #E5E7EB) !important;
    padding: 5px !important;
}

/* Ensure media buttons look consistent */
.pem-editor-container .wp-media-buttons {
    padding: 0.5rem 0.75rem !important;
    background: #F9FAFB;
    border-bottom: 1px solid var(--pem-border, #E5E7EB);
    margin: 0 !important;
}

.pem-editor-container .add_media {
    border: 1px solid var(--pem-border, #D1D5DB) !important;
    border-radius: 0.375rem !important;
    padding: 0.25rem 0.75rem !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    color: var(--pem-text-main, #374151) !important;
    background: #fff !important;
    box-shadow: none !important;
}

.pem-editor-container .add_media:hover {
    border-color: var(--pem-primary, #4F46E5) !important;
    color: var(--pem-primary, #4F46E5) !important;
}

#wp-pem_description_editor-editor-container {
    border: none !important;
}

/* ===========================
   Recurrence Info (Event List)
   =========================== */
.pem-featured-star {
    color: #F59E0B;
    margin-left: 6px;
    font-size: 0.9em;
}

.pem-recurrence-badge {
    margin-left: 6px;
    font-size: 0.85em;
}

.pem-event-recurrence-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 4px;
    font-size: 0.75rem;
}

.pem-rec-freq {
    background: linear-gradient(135deg, #7C3AED, #6D28D9);
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.3px;
}

.pem-rec-count {
    color: #4B5563;
    font-weight: 500;
}

.pem-rec-remaining {
    color: #059669;
    font-weight: 600;
}

.pem-rec-end {
    color: #9CA3AF;
    font-style: italic;
}

/* ===========================
   Recurrence Summary Panel (Edit Modal)
   =========================== */
.pem-recurrence-summary-panel {
    margin-top: 16px;
    padding: 16px;
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    border: 1px solid #ddd6fe;
    border-radius: 10px;
}

.pem-recurrence-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    text-align: center;
}

.pem-recurrence-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.pem-recurrence-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4c1d95;
}

.pem-recurrence-stat-label {
    font-size: 0.7rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Form thirds layout for recurrence row */
.pem-form-third {
    flex: 1 1 30%;
    min-width: 140px;
}

/* ===========================
   Variants Badge (Event List)
   =========================== */
.pem-event-variants-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    font-size: 0.72rem;
    color: #7C3AED;
    font-weight: 600;
    background: #f5f3ff;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid #ede9fe;
}

/* ===========================
   Create Variant Row (Modal)
   =========================== */
.pem-create-variant-row {
    padding: 14px 16px;
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    border: 1px solid #ddd6fe;
    border-radius: 10px;
    margin-bottom: 12px;
}

.pem-create-variant-row label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #4c1d95;
}

.pem-create-variant-row .pem-btn-sm {
    white-space: nowrap;
}

/* ===========================
   Variant List Rows (Dashboard Event List)
   =========================== */
.pem-variant-list-row {
    background: #faf8ff !important;
    border-left: 3px solid #8b5cf6 !important;
    margin-left: 20px;
    position: relative;
}

.pem-variant-list-row:hover {
    background: #f3eeff !important;
}

.pem-variant-connector {
    display: flex;
    align-items: center;
    margin-right: 4px;
}

.pem-variant-connector-icon {
    font-size: 1.2rem;
    color: #8b5cf6;
    font-weight: 700;
    line-height: 1;
}

.pem-event-variant-of {
    font-size: 0.75rem;
    color: #7c3aed;
    margin-top: 2px;
}

.pem-variant-badge {
    font-size: 0.8rem;
    margin-left: 4px;
}

.pem-event-thumb-sm {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    border-radius: 6px !important;
}

/* Bulk Email Specific Styles */
.pem-email-composition {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pem-email-warning strong {
    color: #92400e;
    font-weight: 700;
}

#pem-email-sending {
    padding: 2.5rem 1.5rem;
}

.pem-progress-bar-wrap {
    margin-top: 1.5rem;
    height: 12px;
    background: #f3f4f6;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

#pem-email-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4f46e5 0%, #6366f1 100%);
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#pem-email-progress-msg {
    margin-top: 1rem;
    font-weight: 600;
    color: #4b5563;
}

.pem-field-hint {
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #6b7280;
}