/* Case stats analytics modal */
.analytics-modal {
    position: fixed;
    inset: 0;
    z-index: 10020;
    display: none;
    align-items: center;
    justify-content: center;
}

.analytics-modal.is-open {
    display: flex;
}

.analytics-modal__overlay {
    position: absolute;
    inset: 0;
    background: transparent;
}

.analytics-modal__container {
    position: relative;
    z-index: 1;
    width: min(920px, 92vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--analytics-modal-tint, #FFFBE6);
    border-radius: 16px;
    box-shadow: var(--analytics-shadow, 0 22px 60px rgba(2, 6, 23, 0.35));
}

.analytics-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 20px 26px;
    background: linear-gradient(135deg, var(--analytics-brand, #F0B90B) 0%, var(--analytics-brand-soft, #FFCA28) 100%);
}

.analytics-modal__title {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--analytics-brand-text, #1E2329);
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 0.2px;
}

.analytics-modal__body {
    padding: 16px;
    overflow: auto;
}

.analytics-modal__body::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.analytics-panel {
    background: var(--analytics-surface, #FFFFFF);
    border: 1px solid var(--analytics-border, #E5E7EB);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    padding: 16px;
    margin-bottom: 14px;
}

.analytics-panel:last-child {
    margin-bottom: 0;
}

.analytics-panel__title {
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 800;
    color: var(--analytics-title, #1F2937);
}

.analytics-panel__title i {
    color: var(--analytics-brand, #F0B90B);
}

.analytics-overview {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    align-items: center;
    gap: 12px;
}

.analytics-overview--two {
    grid-template-columns: 1fr auto 1fr;
}

.analytics-overview__item {
    text-align: center;
}

.analytics-overview__label {
    color: var(--analytics-muted, #6B7280);
    font-size: 13px;
    margin-bottom: 6px;
}

.analytics-overview__value {
    color: var(--analytics-brand, #F0B90B);
    font-size: 36px;
    line-height: 1;
    font-weight: 900;
}

.analytics-overview__divider {
    width: 1px;
    height: 52px;
    background: var(--analytics-border, #E5E7EB);
}

.analytics-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.analytics-status-card {
    border: 1px solid var(--analytics-border, #E5E7EB);
    border-radius: 12px;
    background: var(--analytics-surface, #FFFFFF);
    padding: 12px;
    min-width: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.analytics-status-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.analytics-status-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.analytics-status-card__value {
    color: var(--analytics-brand, #F0B90B);
    font-size: 30px;
    line-height: 1;
    font-weight: 900;
}

.analytics-status-card__icon {
    color: rgba(240, 185, 11, 0.33);
    font-size: 19px;
}

.analytics-status-card__name {
    color: var(--analytics-title, #1F2937);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.analytics-status-card__meta {
    display: flex;
    justify-content: space-between;
    color: var(--analytics-muted, #9CA3AF);
    font-size: 12px;
}

.analytics-rank-list {
    border: 1px solid var(--analytics-border, #E5E7EB);
    border-radius: 12px;
    padding: 14px 16px;
}

.analytics-rank-item {
    margin-bottom: 14px;
}

.analytics-rank-item:last-child {
    margin-bottom: 0;
}

.analytics-rank-item__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.analytics-rank-item__left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.analytics-rank-item__badge {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: rgba(240, 185, 11, 0.14);
    color: var(--analytics-brand, #F0B90B);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    flex: 0 0 auto;
}

.analytics-rank-item__name {
    color: var(--analytics-title, #374151);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.analytics-rank-item__count {
    color: var(--analytics-brand, #F0B90B);
    font-size: 16px;
    font-weight: 800;
    flex: 0 0 auto;
}

.analytics-rank-item__bar {
    height: 8px;
    background: color-mix(in srgb, var(--analytics-border, #E5E7EB) 70%, transparent);
    border-radius: 999px;
    overflow: hidden;
}

.analytics-rank-item__fill {
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--analytics-brand, #F0B90B), var(--analytics-brand-soft, #FFCA28));
    transition: width 0.35s ease;
}

.analytics-empty {
    color: var(--analytics-muted, #9CA3AF);
    font-size: 13px;
    text-align: center;
    padding: 18px 10px;
}

@media (max-width: 768px) {
    .analytics-modal__container {
        width: 94vw;
        max-height: 92vh;
        border-radius: 12px;
    }

    .analytics-modal__header {
        padding: 16px;
    }

    .analytics-modal__title {
        font-size: 20px;
    }

    .analytics-modal__body {
        padding: 12px;
    }

    .analytics-overview {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .analytics-overview__divider {
        display: none;
    }
}
