/* EdenPersona Admin Styles */
.edenpersona-wrap {
    max-width: 1200px;
}

.edenpersona-analytics {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #1f2937;
}

.edenpersona-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.edenpersona-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .edenpersona-charts {
        grid-template-columns: 1fr;
    }
    
    .edenpersona-metrics {
        grid-template-columns: 1fr;
    }
}

/* Navigation Tabs */
.nav-tab-wrapper {
    margin-bottom: 20px;
}

.edenpersona-subscription-banner {
    align-items: center;
    background: #f6f8ff;
    border: 1px solid #cfd8f6;
    border-left: 4px solid #4f46e5;
    border-radius: 7px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    display: grid;
    gap: 14px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    margin: 0 0 22px;
    padding: 15px 16px;
}

.edenpersona-subscription-banner__icon {
    align-items: center;
    background: #e7eafe;
    border-radius: 50%;
    color: #4338ca;
    display: flex;
    height: 38px;
    justify-content: center;
    width: 38px;
}

.edenpersona-subscription-banner__icon .dashicons {
    font-size: 21px;
    height: 21px;
    width: 21px;
}

.edenpersona-subscription-banner__content h2 {
    color: #1e293b;
    font-size: 15px;
    line-height: 1.3;
    margin: 0 0 4px;
}

.edenpersona-subscription-banner__content p {
    color: #526075;
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

.edenpersona-subscription-banner .edenpersona-subscription-banner__button {
    align-items: center;
    background: #4338ca;
    border-color: #4338ca;
    display: inline-flex;
    font-weight: 600;
    justify-content: center;
    min-height: 36px;
    white-space: nowrap;
}

.edenpersona-subscription-banner .edenpersona-subscription-banner__button:hover,
.edenpersona-subscription-banner .edenpersona-subscription-banner__button:focus {
    background: #3730a3;
    border-color: #3730a3;
}

/* Forms */
.edenpersona-form-row {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.edenpersona-form-row label {
    font-weight: 500;
    min-width: 120px;
}

/* Export Button Styles - Removed to avoid conflicts with inline CSS */

/* Customer Badge Styles */
.customer-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #fff;
}

.customer-badge.vip {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #8b6914;
    border: 1px solid #ffd700;
}

.customer-badge.regular {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #fff;
    border: 1px solid #bbdefb;
}

.edenpersona-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.edenpersona-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.edenpersona-card,
.edenpersona-metric,
.edenpersona-chart,
.customer-insights-section,
.journey-section {
    background: #fff;
    border: 1px solid #dfe3e8;
    border-radius: 8px;
    box-shadow: 0 2px 9px rgba(15, 23, 42, 0.08);
}

.edenpersona-metric {
    min-height: 108px;
    padding: 18px 16px;
    text-align: center;
}

.edenpersona-metric h3,
.edenpersona-chart h3,
.customer-insights-section h3,
.journey-section h3 {
    color: #1f2937;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.25;
    margin: 0;
    text-transform: none;
}

.edenpersona-metric h3 {
    margin-bottom: 10px;
    text-transform: uppercase;
}

.edenpersona-metric .value {
    color: #1267b1;
    font-size: clamp(26px, 3vw, 34px);
    font-weight: 800;
    line-height: 1.1;
    margin: 0;
}

.edenpersona-metric .change {
    font-size: 13px;
    font-weight: 700;
    margin: 8px 0 0;
}

.edenpersona-metric .change.positive {
    color: #43b760;
}

.edenpersona-metric .change.negative {
    color: #e05252;
}

.edenpersona-chart,
.customer-insights-section,
.journey-section {
    padding: 0;
    overflow: hidden;
}

.edenpersona-chart h3,
.customer-insights-section h3,
.journey-section h3 {
    align-items: center;
    border-bottom: 1px solid #e6e9ee;
    display: flex;
    justify-content: space-between;
    min-height: 48px;
    padding: 0 16px;
}

.edenpersona-chart-body,
.edenpersona-section-body {
    padding: 16px;
}

.customer-insights-section > h3 ~ *:not(script):not(form):not(.edenpersona-section-body),
.journey-section > h3 ~ *:not(script):not(form):not(.edenpersona-section-body) {
    margin-left: 16px;
    margin-right: 16px;
}

.customer-insights-section > h3 ~ .edenpersona-section-body,
.journey-section > h3 ~ .edenpersona-section-body {
    margin-left: 0;
    margin-right: 0;
}

.edenpersona-chart-canvas {
    height: 250px;
    position: relative;
}

.edenpersona-chart-canvas--tall {
    height: 310px;
}

.edenpersona-products-card .edenpersona-chart-body {
    min-height: 310px;
}

.edenpersona-products-card {
    overflow: visible;
}

.edenpersona-compact-note {
    color: #64748b;
    font-size: 12px;
    margin: 0 0 12px;
}

.edenpersona-help-text {
    color: #64748b;
    font-size: 13px;
    line-height: 1.45;
    margin: 0;
}

.edenpersona-help-text a {
    font-weight: 700;
}

.edenpersona-rfm-matrix {
    display: grid;
    grid-template-columns: 58px repeat(3, minmax(90px, 1fr));
    gap: 2px;
    margin: 0 auto;
    max-width: 620px;
    width: 100%;
}

.edenpersona-rfm-subtitle,
.edenpersona-rfm-note {
    color: #64748b;
    font-size: 13px;
    margin: 0;
    text-align: center;
}

.edenpersona-rfm-subtitle {
    margin-bottom: 12px;
}

.edenpersona-rfm-note {
    margin-top: 10px;
}

.edenpersona-rfm-layout {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: 28px minmax(0, 1fr);
}

.edenpersona-rfm-axis-title {
    color: #475569;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
}

.edenpersona-rfm-axis-title--top {
    margin: 0 auto 8px;
    max-width: 620px;
    padding-left: 58px;
    text-align: center;
}

.edenpersona-rfm-axis-title--left {
    justify-self: center;
    line-height: 1.1;
    text-align: center;
    transform: rotate(-90deg);
    white-space: nowrap;
}

.edenpersona-rfm-axis,
.edenpersona-rfm-corner,
.edenpersona-rfm-label {
    align-items: center;
    color: #64748b;
    display: flex;
    font-size: 12px;
    font-weight: 700;
    justify-content: center;
    min-height: 30px;
}

.edenpersona-rfm-cell {
    align-items: center;
    color: #fff;
    cursor: help;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 86px;
    padding: 10px;
    text-align: center;
}

.edenpersona-rfm-cell strong {
    display: block;
    font-size: 14px;
    line-height: 1.2;
}

.edenpersona-rfm-cell span {
    display: block;
    font-size: 13px;
    font-weight: 800;
    margin-top: 6px;
}

.edenpersona-rfm-cell small {
    font-size: 11px;
    font-weight: 600;
    margin-top: 3px;
    opacity: 0.85;
}

.edenpersona-rfm-at-risk {
    background: #fb5b71;
}

.edenpersona-rfm-loyal {
    background: #31b8bd;
}

.edenpersona-rfm-champions {
    background: #42ad53;
}

.edenpersona-rfm-hibernating {
    background: #7d57d6;
}

.edenpersona-rfm-potential {
    background: #ffbd35;
}

.edenpersona-rfm-promising {
    background: #3e9fe3;
}

.edenpersona-cohort-table {
    border-collapse: separate;
    border-spacing: 2px;
    min-width: 720px;
    width: 100%;
}

.edenpersona-cohort-table th,
.edenpersona-cohort-table td {
    border: 0;
    font-size: 12px;
    padding: 9px;
    text-align: center;
}

.edenpersona-cohort-table th {
    color: #475569;
    font-weight: 700;
}

.edenpersona-cohort-table td:first-child,
.edenpersona-cohort-table th:first-child {
    text-align: left;
}

.edenpersona-lost-revenue-card {
    display: grid;
    gap: 14px;
    padding: 16px;
}

.edenpersona-lost-revenue-value {
    color: #1f2937;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.1;
}

.edenpersona-lost-revenue-subtitle {
    color: #64748b;
    font-size: 13px;
    margin-top: 4px;
}

.edenpersona-sparkline {
    height: 86px;
    width: 100%;
}

.edenpersona-sparkline-title {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
}

.edenpersona-sparkline polyline {
    fill: none;
    stroke: #ff6868;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 3;
}

.edenpersona-dormant-periods {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.edenpersona-dormant-period {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: help;
    display: grid;
    gap: 2px;
    padding: 8px 10px;
}

.edenpersona-dormant-period span {
    color: #64748b;
    font-size: 12px;
}

.edenpersona-dormant-period strong {
    color: #1f2937;
    font-size: 13px;
}

.edenpersona-dormant-period small {
    color: #64748b;
    font-size: 11px;
}

.edenpersona-action-button {
    align-items: center;
    background: #0d91e8;
    border: 1px solid #0d91e8;
    border-radius: 5px;
    color: #fff;
    display: inline-flex;
    font-weight: 700;
    justify-content: center;
    min-height: 38px;
    padding: 0 16px;
    text-decoration: none;
}

.edenpersona-action-button:hover,
.edenpersona-action-button:focus {
    background: #0879c5;
    border-color: #0879c5;
    color: #fff;
}

.edenpersona-journey-funnel {
    display: grid;
    grid-template-columns: repeat(5, minmax(92px, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}

.edenpersona-funnel-step {
    align-items: center;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 108px;
    padding: 12px;
    position: relative;
    text-align: center;
}

.edenpersona-funnel-step:nth-child(1) {
    background: #0aa6e8;
}

.edenpersona-funnel-step:nth-child(2) {
    background: #199ed5;
}

.edenpersona-funnel-step:nth-child(3) {
    background: #2ebac3;
}

.edenpersona-funnel-step:nth-child(4) {
    background: #60d7c0;
}

.edenpersona-funnel-step:nth-child(5) {
    background: #99df7b;
}

.edenpersona-funnel-label {
    font-size: 12px;
    font-weight: 700;
}

.edenpersona-funnel-value {
    font-size: 20px;
    font-weight: 800;
    margin-top: 8px;
}

.edenpersona-funnel-meta {
    font-size: 12px;
    font-weight: 700;
    margin-top: 8px;
    opacity: 0.95;
}

@media (max-width: 1100px) {
    .edenpersona-kpi-grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }

    .edenpersona-journey-funnel {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
    }
}

@media (max-width: 640px) {
    .edenpersona-subscription-banner {
        align-items: start;
        grid-template-columns: auto minmax(0, 1fr);
    }

    .edenpersona-subscription-banner__button {
        grid-column: 1 / -1;
        width: 100%;
    }

    .edenpersona-kpi-grid,
    .edenpersona-journey-funnel {
        grid-template-columns: 1fr;
    }

    .edenpersona-rfm-matrix {
        grid-template-columns: 44px repeat(3, minmax(74px, 1fr));
    }

    .edenpersona-rfm-layout {
        grid-template-columns: 20px minmax(0, 1fr);
    }

    .edenpersona-rfm-axis-title--top {
        padding-left: 44px;
    }

    .edenpersona-rfm-cell {
        min-height: 76px;
        padding: 8px 5px;
    }
}
