/* Dashboard analytics — charts + recent conversions */

.dash-analytics {
    display: grid;
    gap: 16px;
    max-width: 100%;
    min-width: 0;
}

.dash-analytics-grid {
    display: grid;
    grid-template-columns: 1.45fr 1fr;
    gap: 16px;
    max-width: 100%;
    min-width: 0;
}

.dash-chart-card,
.dash-conversions-card {
    border: 1px solid var(--line, #e5e7eb);
    border-radius: 16px;
    background: #fff;
    padding: 20px 22px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

.dash-chart-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.dash-chart-head h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 650;
}

.dash-chart-period {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--line, #e5e7eb);
    background: #f8fafc;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
}

.dash-chart-canvas-wrap {
    position: relative;
    height: 260px;
    max-width: 100%;
    overflow: hidden;
}

.dash-chart-canvas-wrap canvas {
    max-width: 100% !important;
}

.dash-donut-wrap {
    position: relative;
    height: 220px;
    margin: 0 auto 12px;
    max-width: 240px;
}

.dash-donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    text-align: center;
}

.dash-donut-center strong {
    font-size: 22px;
    line-height: 1.1;
    color: #202b3c;
}

.dash-donut-center span {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}

.dash-donut-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.dash-donut-legend li {
    display: grid;
    grid-template-columns: 12px 1fr auto;
    gap: 10px;
    align-items: center;
    font-size: 14px;
}

.dash-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dash-legend-label {
    color: #334155;
    font-weight: 600;
}

.dash-legend-value {
    color: #64748b;
    font-weight: 650;
}

.dash-chart-empty {
    margin: 0;
    text-align: center;
    padding: 12px 0 4px;
}

.dash-view-all {
    font-size: 13px;
    font-weight: 650;
    color: var(--brand, #006d3d);
}

.dash-conversions-table-wrap {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

.dash-conversions-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

.dash-conversions-table th,
.dash-conversions-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--line, #e5e7eb);
    vertical-align: middle;
}

.dash-conversions-table th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.dash-conversions-table tbody tr:last-child td {
    border-bottom: 0;
}

.dash-customer-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dash-customer-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e8faf1;
    color: #006d3d;
    font-size: 12px;
    font-weight: 700;
    flex: 0 0 auto;
}

body.partner-stitch .dash-customer-avatar {
    background: var(--brand-soft, #e8faf1);
    color: var(--brand-dark, #00502b);
}

.dash-dest-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(58, 134, 255, 0.12);
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 650;
}

.dash-commission-cell {
    color: #059669;
    font-weight: 700;
    white-space: nowrap;
}

.dash-esim-cell {
    max-width: 220px;
    font-size: 13px;
    color: #475569;
    line-height: 1.45;
}

.dash-conversions-empty {
    text-align: center;
    color: #64748b;
    padding: 28px 12px !important;
}

.dash-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-size: 11px;
    font-weight: 700;
    text-transform: lowercase;
}

.dash-conversions-table td .dash-status-badge {
    margin-top: 6px;
}

.dash-status-badge.pending { background: #fff7ed; color: #c2410c; }
.dash-status-badge.payable { background: #eff6ff; color: #1d4ed8; }
.dash-status-badge.paid { background: #ecfdf5; color: #047857; }
.dash-status-badge.needs_review { background: #fef2f2; color: #b91c1c; }

.dash-cell-sub {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
}

.dash-cell-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    color: #475569;
}

.dash-reports-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.dash-reports-filter {
    margin-bottom: 16px;
}

.dash-reports-filter summary {
    cursor: pointer;
    font-weight: 650;
    list-style: none;
}

.dash-reports-filter summary::-webkit-details-marker { display: none; }

.dash-date-cell {
    white-space: nowrap;
    width: 1%;
    color: #334155;
    font-weight: 600;
}

.dash-landing-url-cell {
    min-width: 220px;
    max-width: 360px;
    font-size: 12px;
    color: #475569;
    line-height: 1.45;
    word-break: break-all;
}

@media (max-width: 1000px) {
    .dash-analytics-grid,
    .dash-reports-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 899px) {
    .dash-chart-card,
    .dash-conversions-card {
        padding: 14px 12px;
        border-radius: 14px;
    }

    .dash-chart-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .dash-chart-canvas-wrap {
        height: 220px;
    }

    .dash-conversions-table {
        min-width: 520px;
    }
}
