/* BtoolPagination — shared list footer (summary + rows-per-page + smart page numbers) */

.btool-pagination-host:empty {
    display: none;
}

.btool-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 20px;
    padding: 12px 2px 6px;
    font-size: 0.8125rem;
    color: #64748b;
    line-height: 1.4;
}

.btool-pagination--summary-only {
    justify-content: flex-start;
}

/* Secondary: result range */
.btool-pagination__summary {
    flex: 0 1 auto;
    min-width: 0;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    font-weight: 400;
    color: #64748b;
}

/* Right cluster: page-size control + navigation */
.btool-pagination__meta {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px 18px;
    margin-left: auto;
}

.btool-pagination__pagesize {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    color: #64748b;
    white-space: nowrap;
}

.btool-pagination__pagesize-label {
    flex: 0 0 auto;
    white-space: nowrap;
    font-weight: 400;
    color: #64748b;
}

/*
 * Compact native select — matches bTool finance field chrome
 * (border, radius, hover/focus) at table-footer density.
 * Explicit width overrides global `select { width: 100% }` from style.css.
 */
.btool-pagination__pagesize-select {
    box-sizing: border-box;
    width: auto;
    min-width: 3.25rem;
    max-width: 4.25rem;
    height: 28px;
    padding: 0 22px 0 8px;
    border-radius: 6px;
    border: 1px solid #dfe6f0;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M3 4.5L6 8l3-3.5'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 12px 12px;
    color: #334155;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background-color 0.15s ease;
}

.btool-pagination__pagesize-select:hover {
    border-color: #c9d4e8;
}

.btool-pagination__pagesize-select:focus {
    outline: none;
    border-color: #c9d4e8;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.22);
}

.btool-pagination__pagesize-select:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background-color: #f8fafc;
    color: #94a3b8;
}

/* Primary interaction: page navigation */
.btool-pagination__pages {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    flex: 0 0 auto;
}

.btool-pagination__page,
.btool-pagination__nav {
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #475569;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    transition:
        background-color 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease;
}

.btool-pagination__page:hover,
.btool-pagination__nav:hover:not(:disabled) {
    background: rgba(148, 163, 184, 0.16);
    color: #0f172a;
}

.btool-pagination__page.is-active {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
    cursor: default;
}

.btool-pagination__page.is-active:hover {
    background: #1d4ed8;
    color: #fff;
}

.btool-pagination__nav:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btool-pagination__ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 28px;
    padding: 0 4px;
    text-align: center;
    color: #94a3b8;
    user-select: none;
}

@media (max-width: 720px) {
    .btool-pagination {
        gap: 10px 14px;
    }

    .btool-pagination__meta {
        width: 100%;
        margin-left: 0;
        justify-content: space-between;
    }
}

@media (max-width: 640px) {
    .btool-pagination {
        justify-content: center;
    }

    .btool-pagination__summary {
        width: 100%;
        text-align: center;
    }

    .btool-pagination__meta {
        width: 100%;
        justify-content: center;
        gap: 10px 14px;
    }

    .btool-pagination__pages {
        width: 100%;
        justify-content: center;
    }
}
