/* ============================================================
 * Cash Link 全局公共样式
 * 黑金奢华风 · 全站统一主题
 * ============================================================ */

/* ============================================================
 * 1. 主题变量
 * ============================================================ */
:root {
    --font-family:
        -apple-system, BlinkMacSystemFont,
        "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei",
        "Helvetica Neue", "Helvetica", "Arial",
        "Noto Sans CJK SC", "Source Han Sans",
        sans-serif;

    --font-mono:
        "SF Mono", "JetBrains Mono", "Cascadia Code",
        Consolas, "Menlo", "Courier New", monospace;

    --font-size-xs: 12px;
    --font-size-sm: 13px;
    --font-size-base: 14px;
    --font-size-lg: 16px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
    --font-size-3xl: 32px;

    /* ---- 背景层次 ---- */
    --color-bg:         #08080a;
    --color-card:       #101013;
    --color-elevated:   #1a1a1e;

    /* ---- 边框 ---- */
    --color-border:        #1e1e22;
    --color-border-strong: #2e2e34;

    /* ---- 文字（暖米白） ---- */
    --color-text:  #ece5d3;
    --color-dim:   #a09887;
    --color-muted: #5e5a52;

    /* ---- 主色：香槟金 ---- */
    --color-green:       #d4af6a;
    --color-green-hover: #c79d52;
    --color-green-soft:  rgba(212, 175, 106, 0.12);

    /* ---- 语义色 ---- */
    --color-blue:   #c9b88c;
    --color-red:    #d97a6c;
    --color-yellow: #e6c770;

    /* ---- 间距 ---- */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;

    /* ---- 圆角 / 阴影 ---- */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.7);
}

/* ============================================================
 * 2. 全局重置
 * ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

a { color: var(--color-green); text-decoration: none; }
a:hover { color: var(--color-green-hover); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--color-border-strong);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--color-dim); }

::selection {
    background: rgba(212, 175, 106, 0.3);
    color: var(--color-text);
}

/* ============================================================
 * 3. 容器 / 页面骨架
 * ============================================================ */
.page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px 80px;
}

#page-content {
    padding-top: 56px;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: #e6c98d;
    margin: 0 0 24px;
    letter-spacing: -0.3px;
    text-align: center;
    text-shadow: 0 0 20px rgba(212, 175, 106, 0.2);
}

/* ============================================================
 * 4. 导航栏
 * ============================================================ */
.navbar {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(180deg,
        rgba(8, 8, 10, 0.96) 0%,
        rgba(8, 8, 10, 0.78) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    padding: 14px 32px 0;
    height: 74px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-text);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.navbar .nav-logo img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: contain;
}

.navbar .menu {
    display: flex;
    align-items: center;
    gap: 4px;
}

.navbar .menu a {
    color: var(--color-dim);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    transition: all 0.15s ease;
    white-space: nowrap;
}

.navbar .menu a:hover {
    color: var(--color-text);
    background: var(--color-elevated);
}

.navbar .menu a.active {
    color: #08080a;
    background: linear-gradient(135deg, #e6c98d 0%, #c79d52 100%);
    font-weight: 600;
    box-shadow: 0 0 20px rgba(212, 175, 106, 0.25);
}

.navbar .user-area {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: auto;
}

.navbar .user-info {
    text-align: right;
    line-height: 1.2;
}

.navbar .user-info .username {
    font-size: 13px;
    font-weight: 600;
    color: #e6c98d;
}

.navbar .user-info .role {
    font-size: 11px;
    color: var(--color-muted);
}

.navbar .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e6c98d 0%, #c79d52 100%);
    color: #08080a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 0 12px rgba(212, 175, 106, 0.3);
}

.navbar .logout {
    background: transparent;
    border: 1px solid var(--color-border-strong);
    color: var(--color-dim);
    border-radius: var(--radius-md);
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.navbar .logout:hover {
    border-color: var(--color-red);
    color: var(--color-red);
}

/* ============================================================
 * 5. 卡片
 * ============================================================ */
.card {
    background:
        linear-gradient(180deg, #14120e 0%, #0e0c09 100%),
        radial-gradient(ellipse at top, rgba(212, 175, 106, 0.06) 0%, transparent 60%);
    border: 1px solid rgba(212, 175, 106, 0.12);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 28px;
    transition: all 0.2s ease;
    box-shadow:
        inset 0 1px 0 rgba(212, 175, 106, 0.08),
        0 2px 12px rgba(0, 0, 0, 0.5);
}

.card:hover {
    border-color: rgba(212, 175, 106, 0.28);
    box-shadow:
        inset 0 1px 0 rgba(212, 175, 106, 0.12),
        0 8px 32px rgba(212, 175, 106, 0.08),
        0 4px 16px rgba(0, 0, 0, 0.6);
}

.card-title {
    font-family: inherit;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    color: #e6c98d;
    margin: 0 0 4px;
    letter-spacing: 0;
    text-shadow: 0 0 20px rgba(212, 175, 106, 0.15);
}

.page-heading {
    margin: 0;
    font-family: inherit;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0;
    color: #e6c98d;
    text-shadow: 0 0 20px rgba(212, 175, 106, 0.18);
}

.card-desc {
    font-size: 13px;
    color: var(--color-dim);
    line-height: 1.6;
    margin: 0 0 16px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

/* ============================================================
 * 6. 统计卡片
 * ============================================================ */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
    margin-bottom: 32px;
}

.stat-cards .card {
    padding: 22px 24px;
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(180deg, #14120e 0%, #0e0c09 100%),
        radial-gradient(ellipse at top right, rgba(212, 175, 106, 0.08) 0%, transparent 70%);
    border: 1px solid rgba(212, 175, 106, 0.12);
}

.stat-cards .card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(212, 175, 106, 0.3) 20%,
        #e6c98d 50%,
        rgba(212, 175, 106, 0.3) 80%,
        transparent 100%);
    opacity: 1;
}

.stat-cards .card:nth-child(1)::before { opacity: 0.5; }
.stat-cards .card:nth-child(2)::before { opacity: 0.85; }
.stat-cards .card:nth-child(3)::before { opacity: 0.65; }
.stat-cards .card:nth-child(4)::before { opacity: 0.5; }
.stat-cards .card:nth-child(5)::before { opacity: 1; }

.stat-cards .card:hover {
    transform: translateY(-3px);
    border-color: rgba(212, 175, 106, 0.35);
    box-shadow:
        inset 0 1px 0 rgba(212, 175, 106, 0.15),
        0 12px 32px rgba(212, 175, 106, 0.15),
        0 8px 24px rgba(0, 0, 0, 0.7);
}

.stat-cards .label {
    font-size: 13px;
    color: var(--color-dim);
    font-weight: 500;
    margin-bottom: 12px;
    letter-spacing: 0.2px;
}

.stat-cards .value {
    color: #e6c98d;
    font-size: 28px;
    font-weight: 700;
    font-family: var(--font-mono);
    letter-spacing: -0.5px;
    line-height: 1.1;
    text-shadow:
        0 0 12px rgba(212, 175, 106, 0.3),
        0 0 32px rgba(212, 175, 106, 0.12);
}

.stat-cards .card.income .value,
.stat-cards .card:nth-child(5) .value {
    color: #f5d78e;
    text-shadow:
        0 0 16px rgba(212, 175, 106, 0.6),
        0 0 40px rgba(212, 175, 106, 0.25);
}

/* ============================================================
 * 7. 按钮
 * ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1;
}

.btn-primary {
    background: linear-gradient(135deg, #e6c98d 0%, #c79d52 100%);
    color: #08080a;
    border-color: rgba(212, 175, 106, 0.5);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 24px rgba(212, 175, 106, 0.4);
}
.btn-primary:disabled {
    background: var(--color-elevated);
    color: var(--color-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    border-color: var(--color-border-strong);
}

.btn-secondary {
    background: transparent;
    color: var(--color-dim);
    border-color: var(--color-border-strong);
}
.btn-secondary:hover {
    color: var(--color-text);
    border-color: var(--color-green);
}

.btn-danger {
    background: transparent;
    color: var(--color-red);
    border-color: rgba(217, 122, 108, 0.35);
}
.btn-danger:hover {
    background: rgba(217, 122, 108, 0.1);
    border-color: var(--color-red);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.btn-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ============================================================
 * 8. 表格
 * ============================================================ */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead th {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(212, 175, 106, 0.15);
    background: transparent;
    white-space: nowrap;
}

tbody td {
    padding: 16px;
    color: var(--color-text);
    border-bottom: 1px solid rgba(212, 175, 106, 0.06);
    vertical-align: middle;
}

tbody tr {
    transition: background 0.15s;
}

tbody tr:hover {
    background: rgba(212, 175, 106, 0.04);
}

tbody tr:last-child td {
    border-bottom: none;
}

.mono {
    font-family: var(--font-mono);
    font-size: 12px;
    word-break: break-all;
}

.empty-row td {
    text-align: center;
    color: rgba(212, 175, 106, 0.5);
    padding: 48px;
}

/* ============================================================
 * 9. 徽章 / 状态
 * ============================================================ */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.badge-active,
.badge-green { background: var(--color-green-soft); color: var(--color-green); }

.badge-inactive,
.badge-gray { background: rgba(110,118,129,0.15); color: var(--color-dim); }

.badge-yellow { background: rgba(230, 199, 112, 0.12); color: var(--color-yellow); }
.badge-red { background: rgba(217, 122, 108, 0.12); color: var(--color-red); }
.badge-blue { background: rgba(201, 184, 140, 0.12); color: var(--color-blue); }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.pill-green  { background: var(--color-green-soft); color: var(--color-green); border: 1px solid rgba(212, 175, 106, 0.3); }
.pill-yellow { background: rgba(230, 199, 112, 0.12); color: var(--color-yellow); border: 1px solid rgba(230, 199, 112, 0.3); }
.pill-gray   { background: rgba(110,118,129,0.12); color: var(--color-dim); border: 1px solid rgba(110,118,129,0.3); }
.pill-dark   { background: var(--color-elevated); color: var(--color-dim); border: 1px solid var(--color-border-strong); }

.dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
}

/* ============================================================
 * 10. 表单
 * ============================================================ */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

.form-group label {
    font-size: 13px;
    color: var(--color-dim);
    font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
    background: var(--color-bg);
    border: 1px solid var(--color-border-strong);
    color: var(--color-text);
    padding: 11px 14px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    width: 100%;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--color-green);
    box-shadow: 0 0 0 3px rgba(212, 175, 106, 0.15);
}

.form-group textarea {
    min-height: 120px;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.6;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ============================================================
 * 11. Tabs
 * ============================================================ */
.tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--color-border);
}

.tab {
    padding: 8px 18px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: var(--color-dim);
    border: 1px solid var(--color-border-strong);
    transition: all 0.15s;
    white-space: nowrap;
    font-family: inherit;
}

.tab.active {
    background: linear-gradient(135deg, #e6c98d 0%, #c79d52 100%);
    color: #08080a;
    border-color: transparent;
    box-shadow: 0 0 16px rgba(212, 175, 106, 0.25);
}

.tab:hover:not(.active) {
    background: var(--color-elevated);
    color: var(--color-text);
}

/* ============================================================
 * 12. 弹窗
 * ============================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: var(--color-card);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--color-dim);
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
}

.modal-close:hover {
    color: var(--color-text);
    background: var(--color-elevated);
}

/* ============================================================
 * 13. 工具类
 * ============================================================ */
.text-green   { color: var(--color-green); }
.text-blue    { color: var(--color-blue); }
.text-red     { color: var(--color-red); }
.text-yellow  { color: var(--color-yellow); }
.text-dim     { color: var(--color-dim); }
.text-muted   { color: var(--color-muted); }
.text-mono    { font-family: var(--font-mono); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

/* ============================================================
 * 14. ⭐ 全局数字字体：系统字体（最高优先级覆盖）
 * ============================================================ */

html body .stat-value,
html body .stat-cards .value,
html body .card-value,
html body [class*="stat-"] .value,
html body #stat-accounts,
html body #stat-paid,
html body #stat-pending,
html body #stat-expired,
html body #stat-income,
html body #overview-total,
html body .ov-bar-amount,
html body .ov-bar-user,
html body .dash-table .amount-usd,
html body .dash-table .amount-sats,
html body .dash-table .trunc,
html body .col-number,
html body .if-table .col-number,
html body .invoices-frag .col-number,
html body .users-frag .col-number,
html body .uf-table .col-number,
html body .bc-value,
html body .bc-usd,
html body .bc-btc,
html body .mc-value,
html body .mc-sub,
html body .wf-dist-row .val,
html body .wf-pill,
html body .wf-rate-info .value,
html body .wf-rate-stat .num,
html body .wf-merchant-row .price,
html body .wf-merchant-row .amount .top,
html body .wf-merchant-row .amount .bot,
html body .overview-y-axis,
html body .overview-y-axis span,
html body .dash-recent-summary,
html body .dash-recent-summary #summary-time,
html body .uf-counter,
html body .uf-page-num,
html body .dash-pagination,
html body .if-pagination {
    font-family: -apple-system, BlinkMacSystemFont,
                 'Segoe UI', 'PingFang SC', 'Microsoft YaHei',
                 'Hiragino Sans GB', 'Helvetica Neue', Arial,
                 sans-serif !important;
    font-variant-numeric: tabular-nums;
}

/* ⭐ 地址 / 哈希 / 公钥：等宽字体（前台页面） */
html body .mono,
html body .wf-info-item .value.mono,
html body .wf-channel-table .mono,
html body .wf-channel-table .green,
html body .wf-channel-table .yellow {
    font-family: 'SF Mono', 'JetBrains Mono', Consolas, 'Menlo', monospace !important;
    font-variant-numeric: tabular-nums;
}

/* 后台页面：英文与其余文字统一为系统无衬线字体 */
html body #page-content,
html body #page-content * {
    font-family: var(--font-family) !important;
}

/* ============================================================
 * 15. 手机端适配
 * ============================================================ */
@media (max-width: 1100px) {
    .stat-cards { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    html, body {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    html::-webkit-scrollbar,
    body::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }
    .page-container { padding: 0 12px 16px; overflow-x: hidden; }
    #page-content { padding-top: 12px; overflow-x: hidden; }

    .navbar { padding: 0 12px; height: 56px; gap: 8px; }
    .navbar .menu { display: none; }
    .navbar .user-info { display: none; }
    .navbar .nav-logo span { font-size: 15px; }

    .stat-cards { grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 24px; }
    .stat-cards .card { padding: 16px; }
    .stat-cards .value { font-size: 22px; }
    .stat-cards .label { font-size: 12px; margin-bottom: 8px; }

    .card { padding: 14px; border-radius: var(--radius-md); margin-bottom: 12px; }
    .card-header { margin-bottom: 12px; flex-wrap: wrap; }
    .form-row { grid-template-columns: 1fr; }
    .btn-row { flex-direction: column; }
    .btn-row .btn { width: 100%; }

    .tabs { overflow-x: auto; flex-wrap: nowrap; }
    .tab { padding: 6px 14px; font-size: 13px; }

    .table-wrapper,
    .dash-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table:has(td[data-label]) thead { display: none; }
    table:has(td[data-label]),
    table:has(td[data-label]) tbody,
    table:has(td[data-label]) tr,
    table:has(td[data-label]) td { display: block; width: 100%; }
    table:has(td[data-label]) tbody tr {
        background: var(--color-card);
        border: 1px solid var(--color-border);
        border-radius: 12px;
        padding: 4px 12px;
        margin-bottom: 10px;
    }
    table:has(td[data-label]) td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid var(--color-border);
        text-align: right;
        gap: 10px;
        font-size: 13px;
        white-space: normal;
    }
    table:has(td[data-label]) td:last-child { border-bottom: none; }
    table:has(td[data-label]) td::before {
        content: attr(data-label);
        color: var(--color-dim);
        font-weight: 600;
        font-size: 12px;
        text-align: left;
        flex-shrink: 0;
        max-width: 40%;
    }
    .modal-content { padding: 20px; }
}

@media (max-width: 900px) {
    html body .invoices-frag .if-pagination,
    html body .users-frag .uf-pagination,
    html body .wr-frag .wr-pager,
    html body .wd-frag .wd-pager,
    html body .wwh-frag .wwh-pager,
    html body .fn-dash .dash-pagination {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px 12px;
        width: 100%;
        max-width: 100%;
        margin-top: 12px;
        padding: 10px 0 2px;
        box-sizing: border-box;
    }
    html body .invoices-frag .if-pagination > :nth-child(1),
    html body .users-frag .uf-pagination > :nth-child(1),
    html body .wr-frag .wr-pager > :nth-child(1),
    html body .wd-frag .wd-pager > :nth-child(1),
    html body .wwh-frag .wwh-pager > :nth-child(1),
    html body .fn-dash .dash-pagination > :nth-child(1) {
        grid-column: 1;
        grid-row: 1;
        min-width: 0;
        font-size: 12px;
        line-height: 1.4;
    }
    html body .invoices-frag .if-pagination > :nth-child(3),
    html body .users-frag .uf-pagination > :nth-child(3),
    html body .wr-frag .wr-pager > :nth-child(3),
    html body .wd-frag .wd-pager > :nth-child(3),
    html body .wwh-frag .wwh-pager > :nth-child(3),
    html body .fn-dash .dash-pagination > :nth-child(3) {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
        width: auto;
        margin: 0;
        white-space: nowrap;
        font-size: 12px;
    }
    html body .invoices-frag .if-page-controls,
    html body .users-frag .uf-page-controls,
    html body .wr-frag .wr-pager-btns,
    html body .wd-frag .wd-pager-btns,
    html body .wwh-frag .wwh-pager-btns,
    html body .fn-dash .page-btns {
        grid-column: 1 / -1;
        grid-row: 2;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 6px;
        width: 100%;
        min-width: 0;
    }
    html body .invoices-frag .if-page-btn,
    html body .users-frag .uf-page-btn,
    html body .wr-frag .wr-page-btn,
    html body .wd-frag .wd-page-btn,
    html body .wwh-frag .wwh-page-btn,
    html body .fn-dash .page-btns button {
        width: 100%;
        height: 36px;
        margin: 0;
        padding: 0 2px;
        font-size: 13px;
        line-height: 1;
        white-space: nowrap;
        box-sizing: border-box;
    }
    html body .invoices-frag .if-page-btn[data-page=""],
    html body .users-frag .uf-page-btn[data-page=""],
    html body .wr-frag .wr-page-btn[data-page=""],
    html body .wd-frag .wd-page-btn[data-page=""],
    html body .wwh-frag .wwh-page-btn[data-page=""],
    html body .fn-dash .page-btns button[data-page=""],
    html body .invoices-frag .if-page-btn:not([data-page="first"]):not([data-page="prev"]):not([data-page="next"]):not([data-page="last"]):not(.active),
    html body .users-frag .uf-page-btn:not([data-page="first"]):not([data-page="prev"]):not([data-page="next"]):not([data-page="last"]):not(.active),
    html body .wr-frag .wr-page-btn:not([data-page="first"]):not([data-page="prev"]):not([data-page="next"]):not([data-page="last"]):not(.active),
    html body .wd-frag .wd-page-btn:not([data-page="first"]):not([data-page="prev"]):not([data-page="next"]):not([data-page="last"]):not(.active),
    html body .wwh-frag .wwh-page-btn:not([data-page="first"]):not([data-page="prev"]):not([data-page="next"]):not([data-page="last"]):not(.active),
    html body .fn-dash .page-btns button:not([data-page="first"]):not([data-page="prev"]):not([data-page="next"]):not([data-page="last"]):not(.active) {
        display: none;
    }
}

@media (max-width: 400px) {
    .stat-cards { grid-template-columns: 1fr; }
}