/* ============================================================
 * Стили пагинации .hist-* (общие для всех историй)
 * ============================================================
 * Используются:
 *   - modules/history/history.php                 (глобальная история)
 *   - modules/history/history_from_users.php      (личная история)
 *   - modules/history/historyUpdateRequests.php   (история начислений)
 */

.hist-pagination {
    --hist-accent: #0d6efd;
    --hist-accent-hover: #0b5ed7;
    --hist-border: #dee2e6;
    --hist-text: #495057;
    --hist-muted: #adb5bd;
    --hist-bg-hover: #f1f3f5;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.hist-pages {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.hist-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--hist-border);
    border-radius: 10px;
    background: #fff;
    color: var(--hist-text);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
    user-select: none;
}

.hist-btn:hover {
    background: var(--hist-bg-hover);
    border-color: #c9ced3;
    color: var(--hist-text);
    text-decoration: none;
}

.hist-btn:active { transform: scale(0.96); }

.hist-btn.is-active,
span.hist-btn.is-active,
a.hist-btn.is-active {
    background: var(--hist-accent) !important;
    border-color: var(--hist-accent) !important;
    color: #fff !important;
    box-shadow: 0 2px 6px rgba(13, 110, 253, .35);
    cursor: default;
    pointer-events: none;
}

.hist-btn.is-active:hover,
span.hist-btn.is-active:hover,
a.hist-btn.is-active:hover {
    background: var(--hist-accent) !important;
    border-color: var(--hist-accent) !important;
    color: #fff !important;
}

.hist-btn:disabled,
.hist-btn.is-disabled {
    opacity: .45;
    cursor: not-allowed;
    background: #fff;
    color: var(--hist-muted);
}
.hist-btn:disabled:hover,
.hist-btn.is-disabled:hover {
    background: #fff;
    border-color: var(--hist-border);
    transform: none;
}

.hist-btn.hist-nav { padding: 0 14px; gap: 6px; }

.hist-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 38px;
    color: var(--hist-muted);
    font-size: 14px;
    user-select: none;
}

.hist-btn.hist-all {
    margin-left: 6px;
    padding: 0 14px;
    border-color: var(--hist-accent);
    color: var(--hist-accent);
    background: transparent;
    gap: 6px;
}
.hist-btn.hist-all:hover {
    background: var(--hist-accent);
    color: #fff;
    border-color: var(--hist-accent);
}

/* КРИТИЧНО: фиксированный размер SVG-иконок */
.hist-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    display: inline-block;
}

.hist-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 14px;
    font-size: 13px;
    color: #6c757d;
}
.hist-counter strong { color: var(--hist-text); font-weight: 600; }

.hist-per-page { display: inline-flex; align-items: center; gap: 6px; }
.hist-per-page-label { color: #6c757d; margin-right: 2px; }

.hist-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid var(--hist-border);
    background: #fff;
    color: var(--hist-text);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.hist-pill:hover {
    background: var(--hist-bg-hover);
    border-color: #c9ced3;
    color: var(--hist-text);
    text-decoration: none;
}
.hist-pill.is-active {
    background: var(--hist-accent);
    border-color: var(--hist-accent);
    color: #fff;
    cursor: default;
    pointer-events: none;
}

@media (max-width: 576px) {
    .hist-btn {
        min-width: 34px;
        height: 34px;
        padding: 0 10px;
        font-size: 13px;
        border-radius: 9px;
    }
    .hist-btn.hist-nav { padding: 0 10px; }
    .hist-btn.hist-nav span { display: none; }
    .hist-pages { gap: 4px; }
    .hist-meta { gap: 10px; font-size: 12px; }
}
.hist-table { min-width: 640px; }
.hist-table.users-table { min-width: 820px; }