/* Article + GSC stats */
.article-stats-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.article-stats-window {
    min-width: 116px;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: linear-gradient(145deg, var(--bg-secondary), var(--bg-primary));
    box-shadow: var(--shadow-sm);
}

.article-stats-window span,
.article-stats-window strong {
    display: block;
}

.article-stats-window span {
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.article-stats-window strong {
    margin-top: 2px;
    color: var(--text-primary);
    font-size: 1rem;
}

.article-stats-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 20px;
}

.article-stats-notice {
    margin: 0 0 16px;
    align-items: flex-start;
    line-height: 1.5;
}

.article-stats-filters-card {
    padding: 18px;
}

.article-stats-filters {
    align-items: flex-end;
}

.article-stats-filters .form-group {
    flex: 0 1 250px;
}

.article-stats-filters .article-stats-search-field {
    flex-grow: 1;
}

.article-stats-table {
    min-width: 720px;
    table-layout: fixed;
}

.article-stats-table th:first-child { width: 52%; }
.article-stats-table th:nth-child(2) { width: 12%; }
.article-stats-table th:nth-child(3) { width: 18%; }
.article-stats-table th:nth-child(4) { width: 18%; }

.article-stats-table th:not(:first-child),
.article-stats-table td:not(:first-child) {
    text-align: right;
}

.article-stats-table td {
    vertical-align: middle;
}

.article-stats-title-cell > a {
    color: var(--text-primary);
    font-weight: 650;
    line-height: 1.35;
    text-decoration: none;
}

.article-stats-title-cell > a:hover {
    color: var(--accent-blue);
    text-decoration: underline;
}

.article-stats-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 0.76rem;
}

.article-stats-meta a {
    color: var(--text-link);
    text-decoration: none;
}

.article-stats-separator {
    opacity: 0.65;
}

.article-stats-number {
    color: var(--text-primary);
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
    font-weight: 650;
}

.article-stats-empty {
    padding: 36px 12px;
}

.article-stats-footnote {
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 0.78rem;
}

@media (max-width: 900px) {
    .article-stats-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .article-stats-header {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .article-stats-window {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        min-width: 0;
        padding: 9px 12px;
    }

    .article-stats-window strong {
        margin-top: 0;
    }

    .article-stats-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-bottom: 16px;
    }

    .article-stats-kpis .stat-card {
        min-width: 0;
        padding: 13px 12px;
        gap: 9px;
    }

    .article-stats-kpis .stat-icon {
        flex: 0 0 34px;
        width: 34px;
        height: 34px;
        font-size: 1.25rem;
    }

    .article-stats-kpis .stat-value {
        font-size: 1.35rem;
    }

    .article-stats-kpis .stat-label {
        font-size: 0.72rem;
        line-height: 1.25;
    }

    .article-stats-notice {
        padding: 12px;
        font-size: 0.8rem;
    }

    .article-stats-filters-card {
        padding: 14px;
    }

    .article-stats-filters .form-group {
        flex: 1 1 100%;
        width: 100%;
    }

    .article-stats-filters .btn {
        flex: 1 1 calc(50% - 6px);
        min-height: 44px;
    }

    .article-stats-table-container {
        overflow: visible;
        border: 0;
        border-radius: 0;
    }

    .article-stats-table {
        display: block;
        min-width: 0;
    }

    .article-stats-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
        border: 0;
    }

    .article-stats-table tbody {
        display: grid;
        gap: 12px;
    }

    .article-stats-table tr {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        padding: 14px;
        overflow: hidden;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-lg);
        background: var(--bg-primary);
        box-shadow: var(--shadow-sm);
    }

    .article-stats-table td,
    .article-stats-table tr:hover td {
        padding: 11px 0 0;
        border: 0;
        background: transparent;
    }

    .article-stats-table .article-stats-title-cell {
        grid-column: 1 / -1;
        padding: 0 0 12px;
        border-bottom: 1px solid var(--border-color);
        overflow-wrap: anywhere;
    }

    .article-stats-title-cell > a {
        display: inline-block;
        font-size: 0.92rem;
    }

    .article-stats-meta {
        line-height: 1.35;
    }

    .article-stats-table .article-stats-number {
        display: flex;
        min-width: 0;
        flex-direction: column;
        gap: 4px;
        padding-right: 8px;
        text-align: left;
        font-size: 0.95rem;
    }

    .article-stats-table .article-stats-number::before {
        content: attr(data-label);
        color: var(--text-muted);
        font-size: 0.65rem;
        font-weight: 500;
        line-height: 1.2;
        text-transform: uppercase;
        letter-spacing: 0.035em;
        overflow-wrap: anywhere;
    }

    .article-stats-table .article-stats-empty-row {
        display: block;
        padding: 0;
    }

    .article-stats-empty-row td {
        display: block;
        padding: 0;
    }

    .article-stats-empty {
        padding: 30px 14px;
    }

    .article-stats-footnote {
        margin-top: 14px;
        line-height: 1.45;
    }
}

@media (max-width: 340px) {
    .article-stats-kpis .stat-card {
        align-items: flex-start;
        flex-direction: column;
    }
}
