/* Future Forward portal — layered on Bootstrap 5, no other CSS frameworks.
 *
 * The look is ported from the mobile app's theme (lib/core/theme): a
 * "softmorphism with a glass edge" pass over the `futureForward` palette —
 * a gently graded page wash, translucent surfaces floating on one soft
 * downward shadow, and a hairline light border along each surface edge.
 * Real backdrop blur is reserved for chrome that overlaps scrolling content
 * (the sticky topbar and the off-canvas sidebar).
 */

/* ── Brand tokens ──────────────────────────────────────────────────
 * Straight from lib/core/theme/color_palettes.dart → ColorPalette.futureForward,
 * which is also where the app icon's colours come from.
 */

:root {
    --ff-blue: #0057D9;        /* lightPrimary   */
    --ff-navy: #001B5E;        /* lightOnBackground / darkBackground */
    --ff-navy-700: #0A2D7A;    /* lightOnSurface / darkSurface       */
    --ff-gold: #F5C242;        /* lightSecondary */
    --ff-green: #7ED321;       /* darkSecondary  */

    --ff-sidebar-w: 260px;

    /* Radii — AppTheme.radiusSmall / Medium / Large. */
    --ff-radius-sm: 12px;
    --ff-radius: 16px;
    --ff-radius-lg: 22px;

    /* Light mode: SoftTheme.derive(background: #EEF3FC, accent: #0057D9). */
    --ff-page: #EEF3FC;
    --ff-page-a: #F7FAFE;      /* lerp(bg, white, .55) */
    --ff-page-b: #EEF3FC;
    --ff-page-c: #D6E3F9;      /* lerp(bg, accent, .10) */

    --ff-surface: rgba(255, 255, 255, .72);
    --ff-surface-strong: rgba(255, 255, 255, .90);
    --ff-stroke: rgba(255, 255, 255, .75);
    --ff-stroke-strong: rgba(255, 255, 255, .95);
    /* Hairline that separates rather than highlights (table rows, dividers). */
    --ff-rule: rgba(0, 27, 94, .09);

    /* lerp(black, accent, .35) — a blue-tinted shadow, never neutral grey. */
    --ff-shadow-rgb: 0, 30, 76;
    --ff-shadow-sm: 0 4px 12px rgba(var(--ff-shadow-rgb), .085),
                    0 1px 3px rgba(var(--ff-shadow-rgb), .045);
    --ff-shadow-md: 0 10px 24px rgba(var(--ff-shadow-rgb), .11),
                    0 2px 6px rgba(var(--ff-shadow-rgb), .05);

    --ff-accent: var(--ff-blue);
    --ff-accent-strong: var(--ff-navy-700);
    --ff-accent-soft: rgba(0, 87, 217, .10);
    --ff-accent-rgb: 0, 87, 217;
    --ff-on-accent: #fff;
    --ff-accent-gradient: linear-gradient(135deg, #0057D9, #0A2D7A);

    --ff-text: var(--ff-navy);
    /* AppTheme derives #6B7CA5 here; darkened for the web, where secondary
     * labels are small and sit on a near-white wash (3.8:1 → 5.6:1). */
    --ff-muted: #4E5F8A;

    /* Bootstrap inherits the palette so untouched components follow along. */
    --bs-body-bg: var(--ff-page);
    --bs-body-color: var(--ff-text);
    --bs-emphasis-color: var(--ff-navy);
    --bs-heading-color: var(--ff-navy);
    --bs-secondary-color: var(--ff-muted);
    --bs-tertiary-color: rgba(78, 95, 138, .72);
    --bs-secondary-bg: rgba(0, 27, 94, .05);
    --bs-tertiary-bg: rgba(255, 255, 255, .55);
    --bs-border-color: var(--ff-rule);
    --bs-border-radius: var(--ff-radius-sm);
    --bs-primary: var(--ff-blue);
    --bs-primary-rgb: 0, 87, 217;
    --bs-link-color: var(--ff-blue);
    --bs-link-color-rgb: 0, 87, 217;
    --bs-link-hover-color: var(--ff-navy-700);
    --bs-focus-ring-color: rgba(0, 87, 217, .22);
    --bs-body-font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

[data-bs-theme="dark"] {
    /* Dark mode: SoftTheme.derive(background: #001B5E) — navy base, the same
     * blue accent lifted so it stays legible against it. */
    --ff-page: #001B5E;
    --ff-page-a: #00256E;      /* lerp(bg, accent, .16) */
    --ff-page-b: #001B5E;
    --ff-page-c: #001342;      /* lerp(bg, black, .30)  */

    --ff-surface: rgba(255, 255, 255, .07);
    --ff-surface-strong: rgba(255, 255, 255, .11);
    --ff-stroke: rgba(255, 255, 255, .11);
    --ff-stroke-strong: rgba(255, 255, 255, .20);
    --ff-rule: rgba(255, 255, 255, .09);

    --ff-shadow-rgb: 0, 0, 0;
    --ff-shadow-sm: 0 4px 12px rgba(0, 0, 0, .25), 0 1px 3px rgba(0, 0, 0, .13);
    --ff-shadow-md: 0 10px 24px rgba(0, 0, 0, .34), 0 2px 6px rgba(0, 0, 0, .16);

    --ff-accent: #3D8BFD;
    --ff-accent-strong: #0057D9;
    --ff-accent-soft: rgba(61, 139, 253, .16);
    --ff-accent-rgb: 61, 139, 253;
    --ff-accent-gradient: linear-gradient(135deg, #3D8BFD, #0057D9);

    --ff-text: #FFFFFF;
    --ff-muted: #94A0BB;       /* lerp(text, bg, .42) */

    --bs-body-color: var(--ff-text);
    --bs-emphasis-color: #fff;
    --bs-heading-color: #fff;
    --bs-secondary-color: var(--ff-muted);
    --bs-tertiary-color: rgba(148, 160, 187, .75);
    --bs-secondary-bg: rgba(255, 255, 255, .07);
    --bs-tertiary-bg: rgba(255, 255, 255, .05);
    --bs-primary: #3D8BFD;
    --bs-primary-rgb: 61, 139, 253;
    --bs-link-color: #7FB2FF;
    --bs-link-color-rgb: 127, 178, 255;
    --bs-link-hover-color: #A8CBFF;
    --bs-focus-ring-color: rgba(61, 139, 253, .28);
}

/* ── Page wash ─────────────────────────────────────────────────────
 * AppTheme paints this once app-wide so it runs unbroken behind the
 * transparent chrome; `fixed` is the browser equivalent.
 */

body {
    font-family: var(--bs-body-font-family);
    color: var(--ff-text);
    background: var(--ff-page);
    background-image: linear-gradient(135deg, var(--ff-page-a) 0%, var(--ff-page-b) 50%, var(--ff-page-c) 100%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    letter-spacing: -.02em;     /* AppTheme runs negative tracking on headings */
}

/* ── Shell ─────────────────────────────────────────────────────── */

.ff-shell { display: flex; min-height: 100vh; }

.ff-main {
    flex: 1 1 auto;
    min-width: 0;                 /* lets wide tables scroll instead of pushing the layout */
    display: flex;
    flex-direction: column;
}

.ff-content { flex: 1 0 auto; padding: 1.5rem; }

.ff-footer {
    display: flex;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    font-size: .8rem;
    color: var(--bs-secondary-color);
    border-top: 1px solid var(--ff-rule);
}

/* ── Sidebar ───────────────────────────────────────────────────── */

.ff-sidebar {
    width: var(--ff-sidebar-w);
    flex: 0 0 var(--ff-sidebar-w);
    background: var(--ff-surface);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-right: 1px solid var(--ff-stroke);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.ff-brand {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid var(--ff-rule);
    text-decoration: none;
}

/* Holds the app icon; keeps the accent fill as a fallback for the icon-font
 * version used before the artwork existed. */
.ff-brand-mark {
    width: 38px; height: 38px;
    border-radius: var(--ff-radius-sm);
    background: var(--ff-accent-gradient);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1.05rem;
    flex: 0 0 auto;
    overflow: hidden;
    box-shadow: var(--ff-shadow-sm);
}

.ff-brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ff-brand-text { font-weight: 800; letter-spacing: -.3px; color: var(--ff-text); line-height: 1.1; }
.ff-brand-role {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .6px;
    font-weight: 700;
    color: var(--ff-gold-ink, #9A7413);
}

[data-bs-theme="dark"] .ff-brand-role { color: var(--ff-gold); }

.ff-nav { padding: .75rem .75rem 1.5rem; }
.ff-nav-group { margin-bottom: .35rem; }

.ff-nav-label {
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .7px;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
    padding: .75rem .75rem .35rem;
}

.ff-nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .55rem .75rem;
    border-radius: var(--ff-radius-sm);
    color: var(--ff-text);
    text-decoration: none;
    font-size: .875rem;
    font-weight: 500;
    margin-bottom: 2px;
    transition: background-color .15s ease, color .15s ease;
}

.ff-nav-link:hover { background: var(--bs-secondary-bg); color: var(--ff-text); }
.ff-nav-link i { font-size: 1.05rem; width: 1.2rem; text-align: center; color: var(--bs-secondary-color); }

.ff-nav-link.active { background: var(--ff-accent-soft); color: var(--ff-accent); font-weight: 700; }
.ff-nav-link.active i { color: var(--ff-accent); }

/* Gold rail on the active entry — the icon's accent, used sparingly. */
.ff-nav-link.active::before {
    content: '';
    position: absolute;
    left: 0; top: 20%; bottom: 20%;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--ff-gold);
}

/* ── Topbar ────────────────────────────────────────────────────── */

.ff-topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .75rem 1.5rem;
    border-bottom: 1px solid var(--ff-stroke);
    background: var(--ff-surface);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.ff-topbar-spacer { flex: 1 1 auto; }

.ff-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--ff-accent-soft);
    color: var(--ff-accent);
    display: inline-grid;
    place-items: center;
    font-weight: 700;
    font-size: .8rem;
    flex: 0 0 auto;
    border: 1px solid var(--ff-stroke);
    box-shadow: 0 1px 3px rgba(var(--ff-shadow-rgb), .10);
}

.ff-avatar-lg { width: 72px; height: 72px; font-size: 1.5rem; }

/* ── Page head ─────────────────────────────────────────────────── */

.ff-page-head {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.ff-page-title { font-size: 1.4rem; font-weight: 800; letter-spacing: -.5px; margin: 0; color: var(--ff-text); }
.ff-page-sub { color: var(--bs-secondary-color); font-size: .85rem; margin: .25rem 0 0; }
.ff-page-actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }

/* ── Cards & stats ─────────────────────────────────────────────── */

.ff-card {
    background: var(--ff-surface);
    border: 1px solid var(--ff-stroke);
    border-radius: var(--ff-radius-lg);
    box-shadow: var(--ff-shadow-sm);
}

.ff-card-pad { padding: 1.1rem 1.25rem; }

/* Internal rules use the separating hairline, not the light rim. */
.ff-card .border-bottom { border-bottom-color: var(--ff-rule) !important; }
.ff-card .border-top { border-top-color: var(--ff-rule) !important; }

.ff-stat {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: 1.1rem 1.25rem;
    border: 1px solid var(--ff-stroke);
    border-radius: var(--ff-radius-lg);
    background: var(--ff-surface);
    box-shadow: var(--ff-shadow-sm);
    text-decoration: none;
    color: inherit;
    height: 100%;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

a.ff-stat:hover {
    border-color: rgba(var(--ff-accent-rgb), .45);
    box-shadow: var(--ff-shadow-md);
    transform: translateY(-2px);
    color: inherit;
}

.ff-stat-icon {
    width: 44px; height: 44px;
    border-radius: var(--ff-radius-sm);
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    flex: 0 0 auto;
}

.ff-stat-value { font-size: 1.5rem; font-weight: 800; line-height: 1.1; letter-spacing: -.5px; color: var(--ff-text); }
.ff-stat-label { font-size: .78rem; color: var(--bs-secondary-color); }

/* Tinted icon chips, reused by stat tiles and list rows — re-keyed to the
 * icon's palette: brand blue, growth green, gold, and supporting hues. */
.ff-tint-primary { background: rgba(0,87,217,.13);  color: #0057D9; }
.ff-tint-success { background: rgba(90,168,20,.15); color: #4E9412; }
.ff-tint-warning { background: rgba(245,194,66,.20); color: #9A7413; }
.ff-tint-danger  { background: rgba(211,47,47,.13); color: #D32F2F; }
.ff-tint-info    { background: rgba(10,45,122,.13); color: #0A2D7A; }
.ff-tint-purple  { background: rgba(124,77,255,.13); color: #6A3DE8; }

[data-bs-theme="dark"] .ff-tint-primary { background: rgba(61,139,253,.18); color: #7FB2FF; }
[data-bs-theme="dark"] .ff-tint-success { background: rgba(126,211,33,.18);  color: #A6E85C; }
[data-bs-theme="dark"] .ff-tint-warning { background: rgba(245,194,66,.20);  color: #F5C242; }
[data-bs-theme="dark"] .ff-tint-danger  { background: rgba(239,83,80,.20);   color: #FF8A87; }
[data-bs-theme="dark"] .ff-tint-info    { background: rgba(127,178,255,.16); color: #A8CBFF; }
[data-bs-theme="dark"] .ff-tint-purple  { background: rgba(167,139,250,.18); color: #C4B5FD; }

/* ── Tables ────────────────────────────────────────────────────── */

.ff-table-wrap { overflow-x: auto; }        /* wide tables scroll, page never does */

.ff-table { width: 100%; margin: 0; --bs-table-bg: transparent; --bs-table-color: var(--ff-text); }
.ff-table th {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--bs-secondary-color);
    font-weight: 700;
    white-space: nowrap;
    border-bottom-color: var(--ff-rule);
}
.ff-table td { vertical-align: middle; font-size: .875rem; border-bottom-color: var(--ff-rule); }
.ff-table > tbody > tr:last-child > td { border-bottom-width: 0; }
.ff-table > tbody > tr:hover > td { background: rgba(var(--ff-accent-rgb), .045); }

.ff-group-head td {
    background: var(--bs-secondary-bg);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--ff-accent);
}

.ff-group-head:hover td { background: var(--bs-secondary-bg); }

/* ── Binary tree ───────────────────────────────────────────────── */

.ff-tree { overflow-x: auto; padding: 1.5rem .5rem; }
.ff-tree ul { display: flex; justify-content: center; padding-top: 1.4rem; position: relative; margin: 0; list-style: none; }
.ff-tree li {
    position: relative;
    padding: 1.4rem .35rem 0;
    text-align: center;
    list-style: none;
}
/* Connector lines, drawn with borders only — no SVG, no JS. */
.ff-tree li::before, .ff-tree li::after {
    content: '';
    position: absolute;
    top: 0;
    right: 50%;
    border-top: 2px solid var(--ff-rule);
    width: 50%;
    height: 1.4rem;
}
.ff-tree li::after { right: auto; left: 50%; border-left: 2px solid var(--ff-rule); }
.ff-tree li:only-child::after, .ff-tree li:only-child::before { display: none; }
.ff-tree li:only-child { padding-top: 0; }
.ff-tree li:first-child::before, .ff-tree li:last-child::after { border: 0 none; }
.ff-tree li:last-child::before { border-right: 2px solid var(--ff-rule); border-radius: 0 6px 0 0; }
.ff-tree li:first-child::after { border-radius: 6px 0 0 0; }
.ff-tree ul ul::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    border-left: 2px solid var(--ff-rule);
    width: 0;
    height: 1.4rem;
}

.ff-node {
    display: inline-block;
    min-width: 130px;
    padding: .6rem .75rem;
    border: 1px solid var(--ff-stroke);
    border-radius: var(--ff-radius);
    background: var(--ff-surface-strong);
    box-shadow: var(--ff-shadow-sm);
    text-decoration: none;
    color: inherit;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.ff-node:hover {
    border-color: rgba(var(--ff-accent-rgb), .5);
    box-shadow: var(--ff-shadow-md);
    transform: translateY(-2px);
    color: inherit;
}
.ff-node-name { font-weight: 700; font-size: .82rem; color: var(--ff-text); }
.ff-node-meta { font-size: .68rem; color: var(--bs-secondary-color); }
.ff-node-empty {
    border-style: dashed;
    border-color: var(--ff-rule);
    background: transparent;
    box-shadow: none;
    color: var(--bs-secondary-color);
}

/* ── Auth ──────────────────────────────────────────────────────── */

.ff-auth {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}
.ff-auth-card { width: 100%; max-width: 400px; }

/* The sign-in mark is the app icon at full size — no accent plate behind it. */
.ff-auth-mark {
    width: 84px; height: 84px;
    border-radius: var(--ff-radius-lg);
    display: block;
    margin: 0 auto 1rem;
    box-shadow: var(--ff-shadow-md);
}

/* ── Bootstrap component alignment ─────────────────────────────────
 * Bootstrap bakes its palette into per-component custom properties at build
 * time, so re-pointing --bs-primary alone does not reach them. These map the
 * handful of components the portal actually uses onto the brand.
 */

.btn {
    --bs-btn-border-radius: var(--ff-radius-sm);
    --bs-btn-font-weight: 600;
}

.btn-primary {
    --bs-btn-bg: var(--ff-accent);
    --bs-btn-border-color: var(--ff-accent);
    --bs-btn-hover-bg: var(--ff-accent-strong);
    --bs-btn-hover-border-color: var(--ff-accent-strong);
    --bs-btn-active-bg: var(--ff-accent-strong);
    --bs-btn-active-border-color: var(--ff-accent-strong);
    --bs-btn-disabled-bg: var(--ff-accent);
    --bs-btn-disabled-border-color: var(--ff-accent);
    --bs-btn-color: var(--ff-on-accent);
    --bs-btn-hover-color: var(--ff-on-accent);
    --bs-btn-active-color: var(--ff-on-accent);
    box-shadow: 0 4px 12px rgba(var(--ff-accent-rgb), .28);
}

.btn-primary:hover { box-shadow: 0 6px 16px rgba(var(--ff-accent-rgb), .34); }

.btn-outline-primary {
    --bs-btn-color: var(--ff-accent);
    --bs-btn-border-color: rgba(var(--ff-accent-rgb), .45);
    --bs-btn-hover-bg: var(--ff-accent);
    --bs-btn-hover-border-color: var(--ff-accent);
    --bs-btn-hover-color: var(--ff-on-accent);
    --bs-btn-active-bg: var(--ff-accent-strong);
    --bs-btn-active-border-color: var(--ff-accent-strong);
}

.btn-outline-secondary {
    --bs-btn-color: var(--bs-secondary-color);
    --bs-btn-border-color: var(--ff-rule);
    --bs-btn-bg: var(--ff-surface);
    --bs-btn-hover-bg: var(--bs-secondary-bg);
    --bs-btn-hover-border-color: rgba(var(--ff-accent-rgb), .35);
    --bs-btn-hover-color: var(--ff-text);
    --bs-btn-active-bg: var(--bs-secondary-bg);
    --bs-btn-active-color: var(--ff-text);
    --bs-btn-active-border-color: rgba(var(--ff-accent-rgb), .45);
}

.btn-link { --bs-btn-color: var(--ff-accent); --bs-btn-hover-color: var(--ff-accent-strong); }

/* Fields: light translucent fill and a hairline rim, matching SoftField. */
.form-control, .form-select, .input-group-text {
    background-color: var(--ff-surface-strong);
    border-color: var(--ff-rule);
    color: var(--ff-text);
    border-radius: var(--ff-radius-sm);
}

.form-control::placeholder { color: var(--bs-tertiary-color); }

.form-control:focus, .form-select:focus {
    background-color: var(--ff-surface-strong);
    border-color: rgba(var(--ff-accent-rgb), .65);
    box-shadow: 0 0 0 .2rem var(--bs-focus-ring-color);
    color: var(--ff-text);
}

.input-group-text { color: var(--bs-secondary-color); }

.form-check-input { background-color: var(--ff-surface-strong); border-color: var(--ff-rule); }
.form-check-input:checked { background-color: var(--ff-accent); border-color: var(--ff-accent); }
.form-check-input:focus { border-color: rgba(var(--ff-accent-rgb), .65); box-shadow: 0 0 0 .2rem var(--bs-focus-ring-color); }

.dropdown-menu {
    --bs-dropdown-bg: var(--ff-surface-strong);
    --bs-dropdown-border-color: var(--ff-stroke);
    --bs-dropdown-border-radius: var(--ff-radius);
    --bs-dropdown-link-color: var(--ff-text);
    --bs-dropdown-link-hover-bg: var(--ff-accent-soft);
    --bs-dropdown-link-hover-color: var(--ff-accent);
    --bs-dropdown-link-active-bg: var(--ff-accent);
    --bs-dropdown-link-active-color: var(--ff-on-accent);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    box-shadow: var(--ff-shadow-md);
}

.alert {
    --bs-alert-border-radius: var(--ff-radius);
    border-color: var(--ff-stroke);
    box-shadow: var(--ff-shadow-sm);
}

.badge { border-radius: 999px; font-weight: 700; letter-spacing: .02em; }
.text-bg-primary { background-color: var(--ff-accent) !important; color: var(--ff-on-accent) !important; }

.progress { background-color: var(--bs-secondary-bg); border-radius: 999px; }
.progress-bar { background: var(--ff-accent-gradient); }

.modal-content, .offcanvas {
    background: var(--ff-surface-strong);
    border: 1px solid var(--ff-stroke);
    border-radius: var(--ff-radius-lg);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

.card { background: var(--ff-surface); border-color: var(--ff-stroke); border-radius: var(--ff-radius-lg); }

/* Pagination — the portal paginates every list, so this is high-traffic. */
.pagination {
    --bs-pagination-bg: transparent;
    --bs-pagination-color: var(--ff-text);
    --bs-pagination-border-color: var(--ff-rule);
    --bs-pagination-border-radius: var(--ff-radius-sm);
    --bs-pagination-hover-bg: var(--ff-accent-soft);
    --bs-pagination-hover-color: var(--ff-accent);
    --bs-pagination-hover-border-color: rgba(var(--ff-accent-rgb), .35);
    --bs-pagination-focus-bg: var(--ff-accent-soft);
    --bs-pagination-focus-color: var(--ff-accent);
    --bs-pagination-active-bg: var(--ff-accent);
    --bs-pagination-active-border-color: var(--ff-accent);
    --bs-pagination-active-color: var(--ff-on-accent);
    --bs-pagination-disabled-bg: transparent;
    --bs-pagination-disabled-color: var(--bs-tertiary-color);
    --bs-pagination-disabled-border-color: var(--ff-rule);
    gap: .25rem;
    margin-bottom: 0;
}

.page-link { border-radius: var(--ff-radius-sm); }

/* ── Responsive ────────────────────────────────────────────────── */

.ff-backdrop { display: none; }

@media (max-width: 991.98px) {
    .ff-sidebar {
        position: fixed;
        z-index: 1045;
        left: 0; top: 0;
        transform: translateX(-100%);
        transition: transform .2s ease;
        background: var(--ff-surface-strong);
        box-shadow: var(--ff-shadow-md);
    }
    body.ff-sidebar-open .ff-sidebar { transform: translateX(0); }
    body.ff-sidebar-open .ff-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 12, 42, .5);
        -webkit-backdrop-filter: blur(2px);
        backdrop-filter: blur(2px);
        z-index: 1040;
    }
    .ff-content { padding: 1rem; }
}

@media (min-width: 992px) {
    #ffSidebarToggle { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .ff-nav-link, .ff-stat, .ff-node, .ff-sidebar { transition: none; }
    a.ff-stat:hover, .ff-node:hover { transform: none; }
}

@media print {
    .ff-sidebar, .ff-topbar, .ff-footer, .ff-page-actions { display: none !important; }
    .ff-content { padding: 0; }
    body { background: #fff; }
    .ff-card, .ff-stat, .ff-node { box-shadow: none; border-color: #ccc; background: #fff; }
}
