:root {
    --pg-border: #d1d5db;
    --pg-bg: #ffffff;
    --pg-fg: #334155;
    --pg-active-bg: #1d4ed8;
    --pg-active-fg: #ffffff;
    --pg-muted: #94a3b8;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
}

.pagination .page-item {
    list-style: none;
}

.pagination .page-link,
.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.15rem;
    min-height: 2.15rem;
    padding: 0.34rem 0.62rem;
    border: 1px solid var(--pg-border);
    border-radius: 0.5rem;
    background: var(--pg-bg);
    color: var(--pg-fg);
    text-decoration: none;
    line-height: 1.1;
    font-size: 0.9rem;
}

.pagination .page-link:hover,
.pagination a:hover {
    background: #f8fafc;
    color: #0f172a;
    text-decoration: none;
}

.pagination .active .page-link,
.pagination .page-item.active .page-link,
.pagination .active span,
.pagination [aria-current="page"] .page-link,
.pagination [aria-current="page"] span {
    background: var(--pg-active-bg);
    border-color: var(--pg-active-bg);
    color: var(--pg-active-fg);
    font-weight: 700;
}

.pagination .disabled .page-link,
.pagination .page-item.disabled .page-link,
.pagination .disabled span {
    color: var(--pg-muted);
    background: #f8fafc;
    border-color: #e2e8f0;
    cursor: not-allowed;
}

/* Fix oversized SVG arrows from mixed pagination templates */
.pagination svg {
    width: 1rem !important;
    height: 1rem !important;
    max-width: 1rem;
    max-height: 1rem;
    display: inline-block;
    vertical-align: middle;
}

@media (max-width: 480px) {
    .pagination {
        gap: 0.3rem;
    }
    .pagination .page-link,
    .pagination a,
    .pagination span {
        min-width: 1.95rem;
        min-height: 1.95rem;
        padding: 0.26rem 0.48rem;
        font-size: 0.84rem;
    }
}
