/**
 * Webisport Dashboard — Memberships Section
 */

.memberships-section-shell .webisport-tab-content {
    padding-top: 1rem;
}

/* Tarifs — toolbar + feedback */
.memberships-pricing-card {
    position: relative;
    padding: 0;
    overflow: hidden;
}

.memberships-pricing-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--webisport-border, #e5e7eb);
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--webisport-surface-card, #fff);
}

.memberships-pricing-toolbar-text {
    flex: 1 1 220px;
    min-width: 0;
}

.memberships-pricing-toolbar-title {
    margin: 0 0 0.35rem 0;
    font-size: 1.05rem;
    font-weight: 600;
}

.memberships-pricing-filter-count {
    margin: 0 0 0.35rem 0;
    font-size: 0.875rem;
    color: var(--ws-color-text-muted, #646970);
}

.memberships-pricing-toolbar-hint {
    margin: 0;
    font-size: 0.85rem;
    color: var(--webisport-text-muted, #6b7280);
    line-height: 1.4;
}

.memberships-pricing-toolbar-hint-secondary {
    margin-top: 0.4rem;
}

.memberships-save-all-pricing-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.memberships-pricing-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-shrink: 0;
}

.memberships-pricing-toolbar-actions .webisport-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.memberships-pricing-toolbar-actions .dashicons {
    font-size: 1.1rem;
    width: 1.1rem;
    height: 1.1rem;
}

.memberships-save-all-pricing-btn .dashicons {
    font-size: 1.1rem;
    width: 1.1rem;
    height: 1.1rem;
}

.memberships-save-row-caption {
    font-size: 0.82rem;
    font-weight: 500;
}

.memberships-save-row-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    white-space: nowrap;
}

#memberships-pricing-wrapper.is-saving-pricing .memberships-save-all-pricing-btn .dashicons:first-child {
    animation: memberships-spin-toolbar 1s linear infinite;
}

@keyframes memberships-spin-toolbar {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.memberships-pricing-table-wrap {
    padding: 0 1.25rem 1.25rem;
}

.memberships-pricing-row-saved td {
    animation: memberships-row-saved-highlight 1.15s ease-out;
}

@keyframes memberships-row-saved-highlight {
    0% {
        background-color: rgba(34, 197, 94, 0.22);
    }

    100% {
        background-color: transparent;
    }
}

/* Pricing table — inline edit */
.memberships-pricing-table input[type="number"] {
    width: 100px;
    padding: 0.4rem 0.6rem;
    text-align: right;
}

.memberships-installments {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.memberships-installment-check {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.memberships-installment-check input[type="checkbox"] {
    margin: 0;
}

.memberships-pricing-rules-card {
    padding: 0;
}

.memberships-pricing-rules-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--webisport-border, #e5e7eb);
    flex-wrap: wrap;
}

.memberships-pricing-rules-header h3 {
    margin: 0 0 0.35rem 0;
}

.memberships-pricing-rule-list {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.memberships-pricing-rule-list.is-order-locked .pr-drag-handle {
    opacity: 0.35;
    cursor: not-allowed;
}

.memberships-pricing-rule-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    min-width: 0;
}

.memberships-pricing-rule-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    justify-content: flex-end;
}

.memberships-pricing-rules-empty {
    padding: 1rem 1.25rem;
}

/* Legacy rule form (kept for safety) */
.memberships-pricing-rule-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.memberships-pricing-rule-checks {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.memberships-pricing-rule-checks label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* ── Guided pricing rule modal ────────────────────────────────── */

.webisport-dashboard #memberships-pricing-rule-modal .webisport-modal-content.webisport-modal-large {
    max-width: min(52rem, calc(100vw - 2rem));
    width: 100%;
}

.webisport-dashboard #memberships-pricing-rule-modal .webisport-modal-body {
    max-height: min(75vh, 44rem);
    padding: 1rem 1.25rem;
}

.memberships-pr-rule-form {
    max-width: 46rem;
    margin: 0 auto;
}

.pr-inline-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--webisport-text, #374151);
}

/* Two-column grid inside the modal */
.pr-two-col-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem 1rem;
    align-items: start;
}

@media (max-width: 640px) {
    .pr-two-col-grid {
        grid-template-columns: 1fr;
    }
}

/* Numbered sections */
.pr-section {
    border-top: 1px solid var(--webisport-border, #e5e7eb);
    padding-top: 1.25rem;
    margin-top: 1.25rem;
}

.pr-section:first-of-type {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}

.pr-section-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.pr-section-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: var(--webisport-primary);
    color: var(--ws-on-primary);
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.pr-section-title {
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--webisport-text-muted, #6b7280);
}

.pr-section-body {
    padding-left: clamp(0rem, 2vw + 0.35rem, 1.35rem);
}

@media (min-width: 640px) {
    .pr-section-body {
        padding-left: 1.6rem;
    }
}

/* Required asterisk */
.pr-required {
    color: #ef4444;
}

/* Field hint */
.pr-field-hint {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.82rem;
    color: var(--webisport-text-muted, #6b7280);
    line-height: 1.4;
}

.pr-field-hint code {
    background: rgba(0, 0, 0, 0.06);
    padding: 0.05rem 0.3rem;
    border-radius: 3px;
    font-size: 0.82rem;
}

/* Type radio cards */
.pr-type-cards {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.pr-type-card {
    position: relative;
    flex: 1 1 min(160px, 45%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.85rem 0.65rem;
    border: 2px solid var(--webisport-border, #e5e7eb);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    text-align: center;
    box-sizing: border-box;
}

.pr-type-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pr-type-card:hover {
    border-color: var(--ws-primary-border);
    background: rgba(37, 99, 235, 0.03);
}

.pr-type-card.is-selected {
    border-color: var(--ws-primary-border);
    background: rgba(37, 99, 235, 0.06);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.pr-type-card-icon {
    font-size: 1.5rem;
    width: 1.5rem;
    height: 1.5rem;
    color: var(--ws-primary-ink);
}

.pr-type-card-label {
    font-weight: 600;
    font-size: 0.95rem;
}

.pr-type-card-hint {
    font-size: 0.78rem;
    color: var(--webisport-text-muted, #6b7280);
    line-height: 1.3;
}

/* Amount type radio cards (fixed vs percentage) */
.pr-amount-type-cards {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.pr-amount-type-card {
    position: relative;
    flex: 1 1 min(160px, 45%);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    padding: 0.75rem 0.85rem;
    border: 2px solid var(--webisport-border, #e5e7eb);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.pr-amount-type-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pr-amount-type-card:hover {
    border-color: var(--ws-primary-border);
    background: rgba(37, 99, 235, 0.03);
}

.pr-amount-type-card.is-selected {
    border-color: var(--ws-primary-border);
    background: rgba(37, 99, 235, 0.06);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.pr-amount-type-card-label {
    font-weight: 600;
    font-size: 0.9rem;
}

.pr-amount-type-card-hint {
    font-size: 0.78rem;
    color: var(--webisport-text-muted, #6b7280);
    line-height: 1.3;
}

/* Amount field with unit */
.pr-amount-wrap {
    display: flex;
    align-items: stretch;
    min-width: 0;
    max-width: 100%;
}

.pr-amount-wrap .webisport-input {
    border-radius: 0.375rem 0 0 0.375rem;
    flex: 1;
    min-width: 0;
    width: auto;
}

.pr-amount-unit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.85rem;
    min-height: var(--ws-control-height, 2.5rem);
    box-sizing: border-box;
    background: var(--webisport-border, #e5e7eb);
    border: 1px solid var(--ws-form-border, #d1d5db);
    border-left: none;
    border-radius: 0 0.375rem 0.375rem 0;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--webisport-text-muted, #6b7280);
    white-space: nowrap;
}

/* Choice-picker grid lives in components.css (.webisport-choice-* / .pr-subcategory-*).
 * Keep installment checkbox sizing aligned with that shared control chrome. */
.webisport-dashboard #memberships-bulk-pricing-modal .memberships-modal-installment-input {
    appearance: auto;
    -webkit-appearance: checkbox;
    -moz-appearance: checkbox;
    display: inline-block;
    flex: 0 0 auto;
    width: 1rem !important;
    height: 1rem !important;
    min-width: 1rem !important;
    min-height: 1rem !important;
    max-width: 1rem !important;
    max-height: 1rem !important;
    margin: 0.125rem 0 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    accent-color: var(--ws-primary);
    cursor: pointer;
    vertical-align: top;
}

.webisport-dashboard #memberships-bulk-pricing-modal .memberships-modal-installment-check,
.webisport-dashboard #memberships-pricing-rule-modal .memberships-modal-installment-check {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.2;
    color: var(--webisport-text, #374151);
    cursor: pointer;
}

.webisport-dashboard #memberships-bulk-pricing-modal .memberships-modal-installments {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin-top: 0.15rem;
}

/* Chips (shared: tag-input postcodes) */
.pr-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.2rem 0.4rem 0.2rem 0.6rem;
    background: rgba(37, 99, 235, 0.1);
    color: var(--ws-primary-ink);
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pr-chip-prefix {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
}

.pr-chip-remove {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    padding: 0;
    color: inherit;
    opacity: 0.6;
    flex-shrink: 0;
}

.pr-chip-remove:hover {
    opacity: 1;
}

/* Tag input for postcodes */
.pr-tag-input {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: flex-start;
    border: 1px solid var(--ws-form-border, #d1d5db);
    border-radius: 0.375rem;
    min-height: var(--ws-control-height, 2.5rem);
    padding: 0.35rem 0.5rem;
    cursor: text;
    background: #fff;
    transition: border-color 0.15s;
}

.pr-tag-input:focus-within {
    border-color: var(--ws-primary-border);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.pr-tag-chips {
    display: contents;
}

.pr-tag-input-field {
    flex: 1 1 120px;
    min-width: 80px;
    border: none;
    outline: none;
    font-size: 0.9375rem;
    line-height: 1.5;
    padding: 0.35rem 0.35rem;
    background: transparent;
    min-height: 1.75rem;
}

/* Target option radios */
.pr-target-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pr-target-option {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--webisport-border, #e5e7eb);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.pr-target-option input[type="radio"] {
    flex: 0 0 auto;
    flex-shrink: 0;
    align-self: flex-start;
    margin: 0.2rem 0 0;
    /* WP admin / themes often set input { width: 100% } — radios must stay intrinsic */
    width: 1rem;
    height: 1rem;
    min-width: 1rem;
    max-width: 1.125rem;
    box-sizing: border-box;
    accent-color: var(--webisport-primary);
}

/* Higher specificity than generic WP/theme input { width: 100% } */
.webisport-dashboard #memberships-pricing-rule-modal .pr-target-option input[type="radio"] {
    width: 1rem !important;
    height: 1rem !important;
    min-width: 1rem !important;
    max-width: 1.125rem !important;
}

.pr-target-option:hover {
    border-color: var(--ws-primary-border);
    background: rgba(37, 99, 235, 0.025);
}

.pr-target-option--selected {
    border-color: var(--ws-primary-border);
    background: rgba(37, 99, 235, 0.06);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.12);
}

.pr-target-option-body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.pr-target-option-body strong {
    font-size: 0.875rem;
    line-height: 1.35;
    font-weight: 600;
}

.pr-target-option-body span {
    font-size: 0.8125rem;
    color: var(--webisport-text-muted, #6b7280);
    line-height: 1.45;
}

.pr-nth-wrap {
    margin-top: 0.75rem;
    padding: 0.75rem 0.9rem;
    background: rgba(37, 99, 235, 0.04);
    border-left: 3px solid var(--ws-primary-border);
    border-radius: 0 0.5rem 0.5rem 0;
}

.pr-nth-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.pr-nth-input {
    width: 4.5rem;
    max-width: 100%;
}

.pr-nth-hint {
    margin: 0;
}

/* Advanced accordéon */
.pr-advanced {
    margin-top: 1.25rem;
    border: 1px solid var(--webisport-border, #e5e7eb);
    border-radius: 8px;
    overflow: hidden;
}

.pr-advanced-summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--webisport-text-muted, #6b7280);
    user-select: none;
    list-style: none;
}

.pr-advanced-summary::-webkit-details-marker {
    display: none;
}

.pr-advanced-arrow {
    font-size: 1rem;
    width: 1rem;
    height: 1rem;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.pr-advanced[open] .pr-advanced-arrow {
    transform: rotate(90deg);
}

.pr-advanced-summary:hover {
    background: rgba(0, 0, 0, 0.02);
}

.pr-advanced-body {
    padding: 1rem;
    border-top: 1px solid var(--webisport-border, #e5e7eb);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Options section toggles */
.pr-options-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pr-toggle-row {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    cursor: pointer;
}

.pr-toggle-wrap {
    position: relative;
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.pr-toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.pr-toggle-thumb {
    display: block;
    width: 2.4rem;
    height: 1.35rem;
    border-radius: 999px;
    background: #d1d5db;
    transition: background 0.2s;
    position: relative;
}

.pr-toggle-thumb::after {
    content: '';
    position: absolute;
    top: 0.17rem;
    left: 0.17rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.pr-toggle-input:checked~.pr-toggle-thumb {
    background: var(--webisport-primary);
}

.pr-toggle-input:checked~.pr-toggle-thumb::after {
    transform: translateX(1.05rem);
}

.pr-toggle-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.pr-toggle-text strong {
    font-size: 0.92rem;
}

.pr-toggle-text span {
    font-size: 0.82rem;
    color: var(--webisport-text-muted, #6b7280);
    line-height: 1.4;
}

/* Preview block */
.pr-preview-block {
    margin-top: 1.25rem;
    padding: 1rem 1.1rem;
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.05);
    border: 1px solid rgba(37, 99, 235, 0.2);
    transition: border-color 0.2s, background 0.2s;
}

.pr-preview-block.is-ready {
    background: rgba(34, 197, 94, 0.06);
    border-color: rgba(34, 197, 94, 0.3);
}

.pr-preview-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--webisport-text-muted, #6b7280);
    margin-bottom: 0.4rem;
}

.pr-preview-text {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--webisport-text, #111827);
    font-style: italic;
}

/* Rule list drag-and-drop */
.pr-drag-handle {
    cursor: grab;
    color: var(--webisport-text-muted, #9ca3af);
    flex-shrink: 0;
    font-size: 1.1rem;
    width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.25rem;
    align-self: center;
    touch-action: none;
}

.pr-drag-handle:active {
    cursor: grabbing;
}

.memberships-pricing-rule-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 0.65rem 0.85rem;
    align-items: center;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--webisport-border, #e5e7eb);
    border-radius: 8px;
    background: #fff;
    transition: box-shadow 0.15s, opacity 0.15s;
}

@media (max-width: 600px) {
    .memberships-pricing-rule-item {
        gap: 0.45rem 0.5rem;
        padding: 0.65rem 0.55rem;
    }

    .memberships-pricing-rule-meta {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
}

.memberships-pricing-rule-item.is-dragging {
    opacity: 0.45;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.14);
    border-style: dashed;
}

.pr-rule-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pr-rule-description {
    display: block;
    margin-top: 0.2rem;
    color: var(--webisport-text-muted, #6b7280);
    font-size: 0.82rem;
    line-height: 1.4;
}

/* ── Bulk pricing modal ───────────────────────────────────────── */

.webisport-dashboard #memberships-bulk-pricing-modal .webisport-modal-content.webisport-modal-large {
    max-width: min(44rem, calc(100vw - 2rem));
    width: 100%;
}

.webisport-dashboard #memberships-bulk-pricing-modal .webisport-modal-body {
    max-height: min(75vh, 40rem);
    padding: 1rem 1.25rem;
    overflow-x: hidden;
}

.webisport-dashboard .memberships-bulk-pricing-form {
    max-width: 100%;
    margin: 0 auto;
    min-width: 0;
}

.webisport-dashboard #memberships-bulk-pricing-modal .pr-two-col-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.webisport-dashboard #memberships-bulk-pricing-modal .pr-two-col-grid .webisport-form-group,
.webisport-dashboard #memberships-bulk-pricing-modal .pr-amount-wrap {
    min-width: 0;
    max-width: 100%;
}

.webisport-dashboard #memberships-bulk-pricing-modal .pr-amount-wrap {
    position: relative;
}

.webisport-dashboard #memberships-bulk-pricing-modal .pr-bulk-price-input {
    font-size: 0.9375rem;
    font-weight: 500;
    text-align: right;
}

.webisport-dashboard #memberships-bulk-pricing-modal .memberships-bulk-base-price-wrap {
    background: rgba(var(--ws-primary-rgb), 0.06);
    border-radius: 0.375rem;
    min-width: 0;
    max-width: 100%;
}

.webisport-dashboard #memberships-bulk-pricing-modal .memberships-bulk-base-price-wrap .webisport-input {
    background: transparent;
}

.webisport-dashboard #memberships-bulk-pricing-modal .pr-amount-wrap .webisport-input {
    width: 100%;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    border-radius: 0.375rem;
    padding-right: 2rem;
}

.webisport-dashboard #memberships-bulk-pricing-modal .pr-amount-unit {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    display: block;
    padding: 0;
    min-height: auto;
    background: none;
    border: none;
    border-radius: 0;
    font-weight: 500;
    font-size: 0.9375rem;
    color: var(--webisport-text-muted, #6b7280);
    pointer-events: none;
}

.webisport-dashboard #memberships-bulk-pricing-modal .pr-section-body {
    min-width: 0;
}

.webisport-dashboard #memberships-bulk-pricing-modal .pr-subcategory-grid {
    min-width: 0;
    max-width: 100%;
}

.webisport-dashboard #memberships-bulk-pricing-modal .memberships-bulk-installments-group {
    margin-top: 1rem;
}

.webisport-dashboard #memberships-bulk-pricing-modal .webisport-form-group {
    margin-bottom: 0;
}

.webisport-dashboard #memberships-bulk-pricing-modal .pr-section-body .webisport-form-group--choice-list {
    margin-bottom: 0;
}

.webisport-dashboard #memberships-bulk-pricing-modal .pr-field-hint {
    margin-top: 0.45rem;
}

.webisport-dashboard #footclub-edit-profile-modal .pr-section-body {
    min-width: 0;
}

.webisport-dashboard #footclub-manual-member-modal .pr-section-body {
    min-width: 0;
}

.webisport-dashboard #footclub-edit-profile-modal .pr-subcategory-grid {
    min-width: 0;
    max-width: 100%;
}

.webisport-dashboard #footclub-manual-member-modal .pr-subcategory-grid {
    min-width: 0;
    max-width: 100%;
}

.webisport-dashboard #footclub-edit-profile-modal .webisport-form-group--choice-list {
    margin-bottom: 0;
}

.webisport-dashboard #footclub-manual-member-modal .webisport-form-group--choice-list {
    margin-bottom: 0;
}

.webisport-dashboard #footclub-edit-profile-modal .webisport-form-group--choice-list .pr-field-hint {
    margin-top: 0.45rem;
}

.webisport-dashboard #footclub-manual-member-modal .webisport-form-group--choice-list .pr-field-hint {
    margin-top: 0.45rem;
}

/* Stats grid */
.memberships-stats-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.memberships-stats-section-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--webisport-text-primary, #2f3349);
}

.memberships-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.memberships-method-stat .webisport-stat-content {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    min-width: 0;
}

a.memberships-method-stat {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: box-shadow var(--ws-transition, 0.2s ease), transform var(--ws-transition, 0.2s ease);
}

a.memberships-method-stat:hover,
a.memberships-method-stat:focus-visible {
    box-shadow: 0 0.25rem 0.75rem rgba(47, 51, 73, 0.12);
    outline: none;
}

a.memberships-method-stat:focus-visible {
    box-shadow: 0 0 0 2px var(--ws-primary, #7367f0);
}

.memberships-method-stat-title {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.memberships-method-stat-title .webisport-stripe-indicator {
    margin-left: 0;
    font-size: 0.6875rem;
    line-height: 1;
    vertical-align: middle;
}

.memberships-method-stat-line {
    display: inline-block;
    width: fit-content;
    max-width: 100%;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.05em;
    line-height: 1.35;
    white-space: nowrap;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}

.memberships-method-stat-line.is-collected {
    color: var(--ws-success, #28c76f);
    background: var(--ws-success-light, rgba(40, 199, 111, 0.16));
}

.memberships-method-stat-line.is-scheduled {
    color: var(--ws-info, #00cfe8);
    background: var(--ws-info-light, rgba(0, 207, 232, 0.16));
}

/* Stats charts */
.memberships-stats-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.memberships-stats-charts .webisport-card {
    margin: 0;
    height: 100%;
}

/* Donut chart */
.webisport-donut-chart {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.webisport-donut-figure {
    width: 180px;
    max-width: 100%;
}

.webisport-donut-figure svg {
    width: 100%;
    height: auto;
    display: block;
}

.webisport-donut-track {
    stroke: var(--ws-gray-200, #e6e4e8);
}

.webisport-donut-segment {
    stroke-linecap: butt;
    transition: stroke-dasharray 0.4s ease;
}

.webisport-donut-center-value {
    font-size: 2rem;
    font-weight: 700;
    fill: var(--ws-text, #2f2b3d);
}

.webisport-donut-center-label {
    font-size: 0.85rem;
    fill: var(--ws-text-secondary, #6d6b77);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Shared legend */
.webisport-chart-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.webisport-chart-legend-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.875rem;
}

.webisport-chart-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.webisport-chart-legend-label {
    color: var(--ws-text-secondary, #6d6b77);
}

.webisport-chart-legend-value {
    margin-left: auto;
    font-weight: 600;
    color: var(--ws-text, #2f2b3d);
    white-space: nowrap;
}

.webisport-chart-legend-value small {
    font-weight: 500;
    color: var(--ws-text-secondary, #6d6b77);
}

/* Bar chart */
.webisport-bar-chart {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.webisport-bar-chart-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.webisport-bar-chart-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.875rem;
}

.webisport-bar-chart-label {
    color: var(--ws-text-secondary, #6d6b77);
}

.webisport-bar-chart-value {
    font-weight: 700;
    color: var(--ws-text, #2f2b3d);
}

.webisport-bar-chart-track {
    height: 10px;
    border-radius: 999px;
    background: var(--ws-gray-200, #e6e4e8);
    overflow: hidden;
}

.webisport-bar-chart-fill {
    height: 100%;
    border-radius: 999px;
    min-width: 2px;
    transition: width 0.4s ease;
}

/* Funnel chart */
.webisport-funnel-chart {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.webisport-funnel-step {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.webisport-funnel-step-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.875rem;
}

.webisport-funnel-step-label {
    color: var(--ws-text-secondary, #6d6b77);
}

.webisport-funnel-step-value {
    font-weight: 700;
    color: var(--ws-text, #2f2b3d);
}

.webisport-funnel-step-value small {
    font-weight: 500;
    color: var(--ws-text-secondary, #6d6b77);
}

.webisport-funnel-step-track {
    height: 12px;
    border-radius: 999px;
    background: var(--ws-gray-200, #e6e4e8);
    overflow: hidden;
}

.webisport-funnel-step-fill {
    height: 100%;
    border-radius: 999px;
    min-width: 2px;
    background: var(--ws-primary, #7367f0);
    transition: width 0.4s ease;
}

.webisport-funnel-step-0 .webisport-funnel-step-fill {
    background: var(--ws-primary, #7367f0);
    opacity: 1;
}

.webisport-funnel-step-1 .webisport-funnel-step-fill {
    background: var(--ws-primary, #7367f0);
    opacity: 0.82;
}

.webisport-funnel-step-2 .webisport-funnel-step-fill {
    background: var(--ws-info, #00bad1);
    opacity: 0.9;
}

.webisport-funnel-step-3 .webisport-funnel-step-fill {
    background: var(--ws-warning, #ff9f43);
    opacity: 0.9;
}

.webisport-funnel-step-4 .webisport-funnel-step-fill {
    background: var(--ws-success, #28c76f);
    opacity: 1;
}

/* Payment installments */
.memberships-installment-bulk-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.875rem 1rem;
    border: 1px solid var(--ws-border, #e6e6e8);
    border-radius: var(--ws-radius, 0.5rem);
    background: var(--ws-surface, #fff);
}

.memberships-installment-bulk-hint {
    margin-left: 0.35rem;
    color: var(--ws-text-secondary, #6d6b77);
    font-size: 0.8125rem;
}

.memberships-installment-bulk-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.memberships-installment-select-col {
    width: 2.75rem;
    min-width: 2.75rem;
    text-align: center !important;
    vertical-align: middle;
}

.memberships-installments-table tr.is-selected-installment {
    background: color-mix(in srgb, var(--ws-primary, #7367f0) 6%, transparent);
}

.memberships-installments-table tr.is-readonly-installment {
    background: color-mix(in srgb, var(--ws-info, #00bad1) 3%, transparent);
}

.memberships-installments-table tr.is-clickable-installment {
    cursor: pointer;
}

.memberships-installments-table tr.is-clickable-installment:hover {
    background: color-mix(in srgb, var(--ws-primary, #7367f0) 4%, transparent);
}

.memberships-installments-table tr.is-readonly-installment td:first-child {
    border-left: 3px solid color-mix(in srgb, var(--ws-info, #00bad1) 45%, transparent);
}

.memberships-installment-date {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.625rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
}

.memberships-installment-date .dashicons {
    width: 1rem;
    height: 1rem;
    font-size: 1rem;
}

.memberships-installment-date-success {
    color: var(--ws-success, #28c76f);
    background: color-mix(in srgb, var(--ws-success, #28c76f) 12%, transparent);
}

.memberships-installment-date-scheduled {
    color: var(--ws-info, #00bad1);
    background: color-mix(in srgb, var(--ws-info, #00bad1) 12%, transparent);
}

.memberships-installment-date-failed {
    color: var(--ws-danger, #ea5455);
    background: color-mix(in srgb, var(--ws-danger, #ea5455) 12%, transparent);
}

.memberships-installment-unpaid-btn:not(:disabled) {
    color: var(--ws-danger, #ea5455);
    border-color: color-mix(in srgb, var(--ws-danger, #ea5455) 45%, transparent);
}

.memberships-installment-modal-summary {
    margin-top: 0;
    font-weight: 600;
}

.memberships-installment-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    border: 1px solid color-mix(in srgb, var(--ws-warning, #ff9f43) 35%, transparent);
    border-radius: var(--ws-radius, 0.5rem);
    color: var(--ws-text, #2f2b3d);
    background: color-mix(in srgb, var(--ws-warning, #ff9f43) 10%, transparent);
}

.memberships-installment-warning .dashicons {
    flex: 0 0 auto;
    color: var(--ws-warning, #ff9f43);
}

@media (max-width: 782px) {
    .memberships-installment-bulk-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .memberships-installment-bulk-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .memberships-installment-bulk-actions .webisport-btn {
        justify-content: center;
        width: 100%;
    }
}