/* Partner dashboard */

.endo-dashboard-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 22px;
    padding: 30px;
    border: 1px solid rgba(0, 61, 196, .18);
    border-radius: 34px;
    background: var(--blue);
    color: var(--white);
    box-shadow: 0 20px 50px rgba(0, 61, 196, .16);
}

.endo-dashboard-hero > div:first-child {
    min-width: 0;
}

.endo-dashboard-hero span,
.endo-dashboard-section-top > div > span {
    display: block;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.endo-dashboard-hero span {
    color: rgba(255, 255, 255, .72);
}

.endo-dashboard-hero h2 {
    margin: 0;
    color: var(--white);
    font-size: clamp(34px, 4vw, 58px);
    line-height: .96;
    letter-spacing: -.065em;
}

.endo-dashboard-hero p {
    max-width: 560px;
    margin: 13px 0 0;
    color: rgba(255, 255, 255, .76);
    font-size: 15px;
    line-height: 1.65;
}

.endo-dashboard-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.endo-dashboard-hero .endo-partner-button {
    background: var(--white);
    color: var(--blue);
    box-shadow: none;
}

.endo-dashboard-hero .endo-editor-secondary {
    border-color: rgba(255, 255, 255, .28);
    background: rgba(255, 255, 255, .1);
    color: var(--white);
}

.endo-dashboard-hero-pending {
    background:
        radial-gradient(circle at top left, rgba(0, 61, 196), transparent 80%),
        radial-gradient(circle at bottom right, rgba(228, 45, 150), transparent 60%);
}

.endo-dashboard-hero-approved {
    background: linear-gradient(135deg, #0b7551, #16845b);
    border-color: rgba(22, 132, 91, .2);
    box-shadow: 0 20px 50px rgba(22, 132, 91, .14);
}

.endo-dashboard-hero-draft,
.endo-dashboard-hero-empty {
    background: linear-gradient(135deg, #151515, #303030);
    border-color: rgba(0, 0, 0, .14);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .12);
}

.endo-dashboard-sections {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.endo-dashboard-section-card {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 34px;
    background: var(--white);
}

.endo-dashboard-section-card:nth-child(1) {
    border-color: rgba(0, 61, 196, .13);
    background: rgba(0, 61, 196, .035);
}

.endo-dashboard-section-card:nth-child(2) {
    border-color: rgba(228, 45, 150, .14);
    background: rgba(228, 45, 150, .035);
}

.endo-dashboard-section-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.endo-dashboard-section-top > div > span {
    color: var(--blue);
}

.endo-dashboard-section-card:nth-child(2) .endo-dashboard-section-top > div > span {
    color: var(--pink);
}

.endo-dashboard-section-top h2 {
    margin: 0;
    color: var(--text);
    font-size: 26px;
    line-height: 1.05;
    letter-spacing: -.05em;
}

.endo-dashboard-section-top p {
    max-width: 620px;
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.endo-dashboard-section-action {
    flex: 0 0 auto;
    border-color: rgba(0, 61, 196, .18);
    background: var(--white);
    color: var(--blue);
}

.endo-dashboard-section-card:nth-child(2) .endo-dashboard-section-action {
    border-color: rgba(228, 45, 150, .2);
    color: var(--pink);
}

.endo-dashboard-section-action:hover {
    transform: translateY(-1px);
}

.endo-dashboard-metrics-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.endo-dashboard-metric {
    min-height: 116px;
    padding: 18px;
    border: 1px solid rgba(0, 0, 0, .055);
    border-radius: 26px;
    background: var(--white);
}

.endo-dashboard-metric span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.endo-dashboard-metric strong {
    display: block;
    margin-top: 10px;
    color: var(--blue);
    font-size: 34px;
    line-height: 1;
    letter-spacing: -.06em;
}

.endo-dashboard-section-card:nth-child(2) .endo-dashboard-metric strong {
    color: var(--pink);
}

.endo-dashboard-metric small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.endo-dashboard-section-card .endo-dashboard-metric:first-child {
    border-color: transparent;
    background: var(--blue);
}

.endo-dashboard-section-card:nth-child(2) .endo-dashboard-metric:first-child {
    background: var(--pink);
}

.endo-dashboard-section-card .endo-dashboard-metric:first-child span,
.endo-dashboard-section-card .endo-dashboard-metric:first-child strong,
.endo-dashboard-section-card .endo-dashboard-metric:first-child small {
    color: var(--white);
}

.endo-dashboard-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 22px;
    margin-top: 22px;
}

.endo-recent-list {
    display: flex;
    flex-direction: column;
}

.endo-recent-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.endo-recent-item:first-child {
    padding-top: 0;
}

.endo-recent-item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.endo-recent-item strong {
    display: block;
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
}

.endo-recent-item span,
.endo-recent-item small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

/* Legacy dashboard blocks retained for current markup compatibility. */

.endo-partner-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.endo-partner-card span {
    color: var(--muted);
    font-size: 14px;
}

.endo-partner-card strong {
    display: block;
    margin-top: 12px;
    color: var(--text);
    font-size: 34px;
    letter-spacing: -.04em;
}

.endo-dashboard-overview {
    display: grid;
    grid-template-columns: .95fr 1.55fr;
    gap: 22px;
    margin-bottom: 24px;
}

.endo-dashboard-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.endo-stat-card,
.endo-dashboard-performance {
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--white);
    box-shadow: var(--shadow-soft);
}

.endo-stat-card {
    min-height: 118px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 22px;
}

.endo-stat-card span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.endo-stat-card strong {
    color: var(--blue);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -.04em;
}

.endo-stat-ring {
    width: 62px;
    height: 62px;
    flex: 0 0 62px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(
        var(--blue) var(--progress),
        rgba(0, 61, 196, .12) 0
    );
}

.endo-stat-ring span {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    margin: 0;
    border-radius: 50%;
    background: var(--white);
    color: var(--blue);
    font-size: 10px;
    font-weight: 700;
    text-transform: none;
}

.endo-dashboard-performance {
    min-height: 252px;
    padding: 22px;
}

.endo-dashboard-section-head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 18px;
}

.endo-dashboard-section-head span {
    color: var(--blue);
    font-size: 13px;
    font-weight: 700;
}

.endo-dashboard-section-head small {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
}

.endo-performance-chart {
    position: relative;
    height: 210px;
}

.endo-chart-lines {
    position: absolute;
    inset: 0 0 34px;
    display: grid;
    grid-template-rows: repeat(5, 1fr);
}

.endo-chart-lines span {
    display: block;
    border-top: 1px solid rgba(0, 0, 0, .06);
    color: var(--muted);
    font-size: 11px;
}

.endo-chart-bars {
    position: absolute;
    inset: 22px 20px 48px 48px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: end;
    gap: 22px;
}

.endo-chart-group {
    position: relative;
    height: 100%;
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 6px;
}

.endo-chart-bar {
    width: 24px;
    min-height: 4px;
    border-radius: 9px 9px 0 0;
}

.endo-chart-views {
    border: 2px solid #2A9DF4;
    background: rgba(42, 157, 244, .14);
}

.endo-chart-clicks {
    border: 2px solid #46C1D9;
    background: rgba(70, 193, 217, .14);
}

.endo-chart-redirects {
    background: rgba(228, 45, 150, .12);
}

.endo-chart-dot {
    position: absolute;
    left: 50%;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text);
    transform: translateX(-50%);
}

.endo-chart-legend {
    position: absolute;
    right: 0;
    bottom: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    color: var(--muted);
    font-size: 11px;
}

.endo-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.endo-chart-legend i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.endo-legend-products {
    background: var(--text);
}

.endo-legend-pending,
.endo-legend-redirects {
    background: var(--pink);
}

.endo-legend-views {
    background: #2A9DF4;
}

.endo-legend-clicks {
    background: #46C1D9;
}

@media (max-width: 1100px) {
    .endo-dashboard-metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .endo-dashboard-overview {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .endo-dashboard-hero,
    .endo-dashboard-section-top {
        align-items: flex-start;
        flex-direction: column;
    }

    .endo-dashboard-grid,
    .endo-partner-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .endo-dashboard-metrics-grid,
    .endo-dashboard-stats {
        grid-template-columns: 1fr;
    }

    .endo-dashboard-hero,
    .endo-dashboard-section-card {
        padding: 22px;
        border-radius: 26px;
    }

    .endo-dashboard-hero-actions,
    .endo-dashboard-hero-actions > * {
        width: 100%;
    }

    .endo-chart-bars {
        left: 36px;
        gap: 12px;
    }

    .endo-chart-bar {
        width: 18px;
    }
}
