/* Federation admin dashboard — spacious + container-responsive */
.fed-page {
    --fed-ink: #044464;
    --fed-ink-soft: #0a6a8f;
    --fed-muted: #64748b;
    --fed-line: rgba(4, 68, 100, .12);
    --fed-surface: #fff;
    --fed-ok: #15803d;
    --fed-warn: #a16207;
    --fed-err: #b91c1c;
    --fed-info: #0369a1;
    /*
     * Same clearance as .content__section--heading in mania.css (110px).
     * Fixed .toolbar / .toolbar__menu overlays the left edge (z-index 80).
     */
    --fed-toolbar-gap: 110px;
    direction: rtl;
    width: auto;
    max-width: 100%;
    margin: 0 0 0 var(--fed-toolbar-gap) !important;
    min-width: 0;
    padding: 6px 12px 36px 8px;
    box-sizing: border-box;
    overflow-x: clip;
    container-type: inline-size;
    container-name: fed;
    position: relative;
    z-index: 1;
}

@media (max-width: 1800px) {
    .fed-page {
        --fed-toolbar-gap: 100px;
    }
}

@media (max-width: 768px) {
    .fed-page {
        /* Bottom toolbar on mobile — no left rail */
        --fed-toolbar-gap: 0px;
        margin: 0 !important;
        padding: 8px 12px 120px 12px;
    }
}

.fed-page *,
.fed-page *::before,
.fed-page *::after {
    box-sizing: border-box;
}

/* ── Header ── */
.fed-hero {
    display: block;
    margin-bottom: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--fed-line);
    background:
        radial-gradient(ellipse 80% 120% at 100% 0%, rgba(10, 106, 143, .14), transparent 55%),
        linear-gradient(135deg, #e8f3f8 0%, #f7fafc 48%, #fff 100%);
    width: 100%;
    max-width: 100%;
}

/* RTL grid: first column = right (brand), second = left (toolbar) */
.fed-hero__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: start;
    width: 100%;
}

.fed-hero__brand {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.fed-hero__copy {
    min-width: 0;
    flex: 1 1 auto;
}

.fed-hero__mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #044464, #0a6a8f);
    color: #fff;
    font-size: 1.05rem;
    box-shadow: 0 6px 14px rgba(4, 68, 100, .18);
}

.fed-hero__title {
    margin: 0;
    font-size: clamp(1.05rem, 2.2cqi, 1.25rem);
    font-weight: 800;
    color: var(--fed-ink);
    letter-spacing: -.02em;
    word-break: break-word;
}

.fed-hero__sub {
    margin: 4px 0 0;
    font-size: .8rem;
    color: var(--fed-muted);
    line-height: 1.4;
    word-break: break-word;
}

.fed-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.fed-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 600;
    border: 1px solid var(--fed-line);
    background: rgba(255, 255, 255, .8);
    color: var(--fed-ink);
    max-width: 100%;
}

.fed-pill--url {
    max-width: min(100%, 280px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    direction: ltr;
    text-align: left;
}

.fed-pill--ok { color: var(--fed-ok); border-color: rgba(21, 128, 61, .25); background: #ecfdf3; }
.fed-pill--warn { color: var(--fed-warn); border-color: rgba(161, 98, 7, .28); background: #fffbeb; }
.fed-pill--off { color: #64748b; background: #f1f5f9; }
.fed-pill--hub { color: var(--fed-ink); border-color: rgba(4, 68, 100, .22); background: #eef6fb; }

/* Actions hug the outer (left) edge — not floating mid-card */
.fed-hero__toolbar {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end; /* RTL: inline-end = left edge */
    gap: 10px;
    flex-shrink: 0;
    align-self: start;
    padding-top: 4px;
}

.fed-hero__btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.fed-hero__refresh {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.fed-hero__stamp {
    font-size: .72rem;
    color: var(--fed-muted);
    white-space: nowrap;
}

/* ── KPI ── */
.fed-kpi {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
    gap: 8px;
    margin-bottom: 12px;
    width: 100%;
}

.fed-kpi__card {
    background: var(--fed-surface);
    border: 1px solid var(--fed-line);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 64px;
    width: 100%;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.fed-kpi__card:hover {
    border-color: rgba(4, 68, 100, .3);
    box-shadow: 0 4px 12px rgba(4, 68, 100, .06);
}

.fed-kpi__card.is-clickable {
    cursor: pointer;
}

.fed-kpi__icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, #eef6fb 0%, #f7fafc 100%);
    color: var(--fed-ink);
    font-size: .95rem;
}

.fed-kpi__icon.is-online { color: var(--fed-ok); background: #ecfdf3; }
.fed-kpi__icon.is-pending { color: var(--fed-info); background: #e0f2fe; }
.fed-kpi__icon.is-stale { color: var(--fed-warn); background: #fffbeb; }
.fed-kpi__icon.is-policy { color: #9a3412; background: #fff7ed; }
.fed-kpi__icon.is-xfer { color: #1d4ed8; background: #eff6ff; }
.fed-kpi__icon.is-fail { color: var(--fed-err); background: #fef2f2; }

.fed-kpi__label {
    font-size: .72rem;
    color: var(--fed-muted);
    line-height: 1.2;
    font-weight: 600;
}

.fed-kpi__value {
    font-size: clamp(1.1rem, 3cqi, 1.35rem);
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    margin-top: 1px;
}

.fed-kpi__hint {
    font-size: .65rem;
    color: #94a3b8;
    margin-top: 2px;
    word-break: break-word;
}

/* ── Panels ── */
.fed-panel {
    border: 1px solid var(--fed-line);
    border-radius: 12px;
    background: var(--fed-surface);
    overflow: hidden;
    margin-bottom: 0;
    height: auto;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 0;
}

.fed-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(4, 68, 100, .08);
    background: linear-gradient(135deg, #eef6fb 0%, #f8fbfd 100%);
    flex-shrink: 0;
}

.fed-panel__title {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: .9rem;
    font-weight: 700;
    color: var(--fed-ink);
    margin: 0;
    word-break: break-word;
    min-width: 0;
}

.fed-panel__title i {
    font-size: .9rem;
    flex-shrink: 0;
}

.fed-panel__body {
    padding: 12px 14px;
    flex: 0 0 auto;
    min-width: 0;
    width: 100%;
}

.fed-panel--fill > .fed-panel__body {
    flex: 1 1 auto;
    min-height: 0;
}

.fed-panel--flush > .fed-panel__body {
    padding: 0;
}

.fed-panel--flush > .fed-panel__body.fed-panel__body--pad {
    padding: 10px 12px;
}

.fed-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.fed-dash {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
    width: 100%;
}

.fed-dash__col-8,
.fed-dash__col-7,
.fed-dash__col-5,
.fed-dash__col-4,
.fed-dash__col-12 {
    min-width: 0;
    max-width: 100%;
    display: flex;
    flex-direction: column;
}

.fed-dash__col-8 { grid-column: span 6; }
.fed-dash__col-4 { grid-column: span 6; }
.fed-dash__col-7 { grid-column: span 6; }
.fed-dash__col-5 { grid-column: span 6; }
.fed-dash__col-12 { grid-column: span 12; }

.fed-dash__stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    height: 100%;
    width: 100%;
}

.fed-panel--fill {
    height: 100%;
    min-height: 0;
    max-height: 340px;
    display: flex;
    flex-direction: column;
}

.fed-panel__body--scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
}

.fed-panel__body--scroll::-webkit-scrollbar {
    width: 6px;
}

.fed-panel__body--scroll::-webkit-scrollbar-thumb {
    background: rgba(4, 68, 100, .25);
    border-radius: 999px;
}

.fed-xfer-item__side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    text-align: left;
}

.fed-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(260px, .8fr);
    gap: 10px;
    align-items: start;
    width: 100%;
}

.fed-layout > .fed-panel {
    min-height: 0;
    height: auto;
    align-self: start;
}

.fed-layout--single {
    display: block;
}

.fed-layout--single > .fed-panel {
    min-height: 0;
}

.fed-dist {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
    width: 100%;
}

.fed-dist__row {
    display: grid;
    grid-template-columns: minmax(64px, 88px) minmax(0, 1fr) 36px;
    gap: 10px;
    align-items: center;
    width: 100%;
}

.fed-dist__label {
    font-size: .8rem;
    font-weight: 600;
    color: #334155;
}

.fed-dist__track {
    height: 8px;
    border-radius: 999px;
    background: #eef2f6;
    overflow: hidden;
    min-width: 0;
}

.fed-dist__fill {
    height: 100%;
    border-radius: 999px;
    transition: width .35s ease;
    min-width: 0;
    max-width: 100%;
}

.fed-dist__fill.is-hub { background: linear-gradient(90deg, #044464, #0a6a8f); }
.fed-dist__fill.is-online { background: linear-gradient(90deg, #15803d, #22c55e); }
.fed-dist__fill.is-pending { background: linear-gradient(90deg, #0369a1, #38bdf8); }
.fed-dist__fill.is-stale { background: linear-gradient(90deg, #a16207, #f59e0b); }

.fed-dist__n {
    font-size: .85rem;
    font-weight: 800;
    color: #0f172a;
    text-align: left;
    font-variant-numeric: tabular-nums;
}

.fed-alerts {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fed-alert {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 9px 11px;
    border-radius: 10px;
    border: 1px solid var(--fed-line);
    background: #f8fafc;
    font-size: .8rem;
    line-height: 1.45;
    color: #334155;
    word-break: break-word;
}

.fed-alert i {
    margin-top: 2px;
    flex-shrink: 0;
    font-size: .9rem;
}

.fed-alert--ok { border-color: rgba(21, 128, 61, .22); background: #f0fdf4; color: #166534; }
.fed-alert--warn { border-color: rgba(161, 98, 7, .28); background: #fffbeb; color: #92400e; }
.fed-alert--info { border-color: rgba(3, 105, 161, .22); background: #f0f9ff; color: #075985; }
.fed-alert--err { border-color: rgba(185, 28, 28, .22); background: #fef2f2; color: #991b1b; }

.fed-alert strong { font-weight: 700; }

.fed-quick {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
}

.fed-quick__btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 12px;
    min-height: 0;
    border-radius: 10px;
    border: 1px solid var(--fed-line);
    background: #fff;
    cursor: pointer;
    text-align: right;
    transition: border-color .15s ease, background .15s ease;
    width: 100%;
    max-width: 100%;
    font: inherit;
    color: inherit;
}

.fed-quick__btn:hover {
    border-color: rgba(4, 68, 100, .35);
    background: #f4f9fc;
}

.fed-quick__btn i {
    color: var(--fed-ink);
    font-size: 1rem;
}

.fed-quick__btn span {
    font-size: .82rem;
    font-weight: 700;
    color: #0f172a;
}

.fed-quick__btn small {
    font-size: .68rem;
    color: var(--fed-muted);
    line-height: 1.35;
}

.fed-node-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
    gap: 8px;
    width: 100%;
}

.fed-node-card {
    border: 1px solid var(--fed-line);
    border-radius: 10px;
    padding: 10px 12px;
    background: #fafcfd;
    min-width: 0;
    min-height: 0;
    width: 100%;
}

.fed-node-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.fed-node-card__name {
    font-weight: 700;
    font-size: .88rem;
    color: #0f172a;
    word-break: break-word;
}

.fed-node-card__meta {
    font-size: .74rem;
    color: var(--fed-muted);
    line-height: 1.45;
    word-break: break-word;
}

.fed-node-card__meta span {
    display: block;
    direction: ltr;
    text-align: left;
    word-break: break-all;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    margin-top: 6px;
    font-size: .76rem;
}

.fed-hub-summary {
    display: grid;
    gap: 8px;
    font-size: .8rem;
    color: #334155;
    line-height: 1.45;
    word-break: break-word;
}

.fed-hub-summary strong {
    color: #0f172a;
}

.fed-hub-summary__mono {
    display: block;
    direction: ltr;
    text-align: left;
    word-break: break-all;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .8rem;
    color: var(--fed-muted);
    margin-top: 2px;
}

.fed-xfer-list {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.fed-xfer-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(4, 68, 100, .07);
    align-items: center;
    min-height: 0;
}

.fed-xfer-item:last-child { border-bottom: 0; }

.fed-xfer-item__name {
    font-weight: 700;
    font-size: .85rem;
    color: #0f172a;
    word-break: break-word;
}

.fed-xfer-item__path {
    font-size: .8rem;
    color: var(--fed-muted);
    margin-top: 4px;
    word-break: break-word;
}

.fed-xfer-item__time {
    font-size: .75rem;
    color: #94a3b8;
    text-align: left;
    white-space: nowrap;
    margin-top: 6px;
}

.fed-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
    width: 100%;
}

.fed-form-grid .fed-span-2 {
    grid-column: 1 / -1;
}

.fed-secret-row {
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.fed-secret-row .mud-input-control {
    flex: 1;
    min-width: 0;
}

.fed-secret-gen {
    margin-top: 8px;
    color: #044464;
}

.fed-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.fed-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    align-items: center;
    justify-content: flex-start;
    margin: 0;
    width: 100%;
}

.fed-toolbar .mud-input-control {
    flex: 0 1 260px;
    min-width: 180px;
    max-width: 320px;
    margin: 0 !important;
}

.fed-toolbar .mud-chipset {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
}

.fed-empty {
    text-align: center;
    padding: 20px 14px;
    color: var(--fed-muted);
}

.fed-empty i {
    font-size: 2.25rem;
    color: #94a3b8;
    margin-bottom: 14px;
    display: block;
}

.fed-empty__title {
    font-weight: 700;
    font-size: 1.05rem;
    color: #334155;
    margin-bottom: 6px;
}

.fed-empty__hint {
    font-size: .88rem;
    color: #94a3b8;
}

.fed-node-name {
    font-weight: 700;
    font-size: .95rem;
    color: #0f172a;
    word-break: break-word;
}

.fed-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .78rem;
    color: var(--fed-muted);
    word-break: break-all;
    direction: ltr;
    text-align: left;
}

.fed-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 20px;
    border-radius: 16px;
    border: 1px solid rgba(176, 106, 20, .28);
    background: linear-gradient(135deg, #fff7ea 0%, #f7fafc 100%);
    color: #7a4b0a;
    font-size: .92rem;
    line-height: 1.6;
    word-break: break-word;
}

.fed-banner a {
    color: #044464;
    font-weight: 700;
}

/* Tabs */
.fed-tabs.mud-tabs {
    background: transparent;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.fed-tabs .mud-tabs-toolbar {
    background: #fff;
    border: 1px solid var(--fed-line);
    border-radius: 10px;
    padding: 4px;
    min-height: auto;
    margin-bottom: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    width: 100%;
    max-width: 100%;
}

.fed-tabs .mud-tabs-toolbar-wrapper,
.fed-tabs .mud-tabs-tabbar,
.fed-tabs .mud-tabs-tabbar-wrapper {
    min-width: 0;
    max-width: 100%;
    padding: 6px 6px 5px 9px;
    margin-bottom: 15px;
    border-radius: 10px;
}

.fed-tabs .mud-tab {
    min-height: 40px;
    padding-inline: 12px;
    text-transform: none;
    font-weight: 600;
    font-size: .84rem;
    color: var(--fed-muted);
    border-radius: 10px;
    flex-shrink: 0;
    white-space: nowrap;
}

.fed-tabs .mud-tab.mud-tab-active {
    color: var(--fed-ink);
    background: #eef6fb;
}

.fed-tabs .mud-tabs-panels {
    padding: 0 !important;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

.fed-row-actions {
    display: inline-flex;
    gap: 4px;
    white-space: nowrap;
    flex-wrap: wrap;
}

.fed-status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
}

.fed-status-dot.is-hub { background: #044464; }
.fed-status-dot.is-online { background: #22c55e; }
.fed-status-dot.is-pending { background: #38bdf8; }
.fed-status-dot.is-stale { background: #f59e0b; }

.fed-settings-note {
    font-size: .78rem;
    color: var(--fed-muted);
    line-height: 1.45;
    margin: 0 0 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px dashed var(--fed-line);
}

.fed-settings-wrap {
    max-width: min(920px, 100%);
    width: 100%;
}

.fed-table-scroll {
    width: 100%;
    max-width: 100%;
    max-height: min(560px, 70vh);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

/* Tables */
.fed-table .mud-table-cell,
.fed-page .mud-table-cell {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
}

.fed-page .mud-table-head .mud-table-cell {
    font-weight: 700;
    color: var(--fed-ink);
    font-size: .85rem;
}

.fed-page .mud-table-container,
.fed-page .mud-table-root {
    width: 100%;
    max-width: 100%;
}

/* MudBlazor mobile card rows */
.fed-page .mud-table .mud-table-row {
    min-width: 0;
}

/* ═══════════════════════════════════════════
   Container queries — CONTENT width (sidebar)
   ═══════════════════════════════════════════ */

@container fed (max-width: 1100px) {
    .fed-dash__col-8,
    .fed-dash__col-7,
    .fed-dash__col-5,
    .fed-dash__col-4 {
        grid-column: span 12;
    }

    .fed-layout {
        grid-template-columns: 1fr;
    }

    .fed-layout > .fed-panel {
        min-height: 0;
    }
}

@container fed (max-width: 820px) {
    .fed-hero {
        padding: 18px 16px;
    }

    .fed-hero__row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .fed-hero__toolbar {
        width: 100%;
        justify-content: flex-start;
        padding-top: 10px;
        border-top: 1px solid rgba(4, 68, 100, .08);
    }

    .fed-hero__btns {
        flex: 1 1 auto;
    }

    .fed-panel__head,
    .fed-panel__body {
        padding-left: 16px;
        padding-right: 16px;
    }

    .fed-panel--flush > .fed-panel__body.fed-panel__body--pad {
        padding-left: 16px;
        padding-right: 16px;
    }

    .fed-form-grid {
        grid-template-columns: 1fr;
    }

    .fed-xfer-item {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 14px 16px;
    }

    .fed-xfer-item > div:last-child {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        text-align: right !important;
    }

    .fed-xfer-item__time {
        text-align: right;
        margin-top: 0;
    }

    .fed-tabs .mud-tabs-toolbar {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        overflow-x: visible;
    }

    .fed-tabs .mud-tab {
        flex: 1 1 calc(50% - 6px);
        min-width: calc(50% - 6px);
        justify-content: center;
        min-height: 44px;
        font-size: .82rem;
        padding-inline: 8px;
    }
}

@container fed (max-width: 560px) {
    .fed-kpi {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .fed-kpi__card {
        min-height: 76px;
        padding: 14px 16px;
    }

    .fed-kpi__icon {
        width: 44px;
        height: 44px;
        font-size: 1.05rem;
    }

    .fed-quick {
        grid-template-columns: 1fr;
    }

    .fed-quick__btn {
        min-height: 78px;
    }

    .fed-dist__row {
        grid-template-columns: 72px minmax(0, 1fr) 32px;
        gap: 8px;
    }

    .fed-node-grid {
        grid-template-columns: 1fr;
    }

    .fed-hero__mark {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
        border-radius: 12px;
    }

    .fed-tabs .mud-tab {
        flex: 1 1 100%;
        min-width: 100%;
    }

    .fed-pill--url {
        max-width: 100%;
    }

    .fed-empty {
        padding: 40px 16px;
    }
}

/* Viewport fallbacks */
@media (max-width: 1200px) {
    .fed-dash__col-8,
    .fed-dash__col-7,
    .fed-dash__col-5,
    .fed-dash__col-4 {
        grid-column: span 12;
    }

    .fed-layout {
        grid-template-columns: 1fr;
    }

    .fed-layout > .fed-panel {
        min-height: 0;
    }
}

@media (max-width: 960px) {
    .fed-hero__row {
        grid-template-columns: 1fr;
    }

    .fed-hero__toolbar {
        width: 100%;
        justify-content: flex-start;
        padding-top: 10px;
        border-top: 1px solid rgba(4, 68, 100, .08);
    }

    .fed-form-grid {
        grid-template-columns: 1fr;
    }

    .fed-tabs .mud-tabs-toolbar {
        flex-wrap: wrap;
        overflow-x: visible;
    }

    .fed-tabs .mud-tab {
        flex: 1 1 calc(50% - 6px);
        min-width: calc(50% - 6px);
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .fed-kpi {
        grid-template-columns: 1fr;
    }

    .fed-quick {
        grid-template-columns: 1fr;
    }

    .fed-node-grid {
        grid-template-columns: 1fr;
    }

    .fed-tabs .mud-tab {
        flex: 1 1 100%;
        min-width: 100%;
    }

    .fed-xfer-item {
        grid-template-columns: 1fr;
    }
}

/* ── Federation users directory (aligned with UserManagement um-*) ── */
.fed-users-page .fed-users-subtitle {
    margin-top: 4px;
    font-size: .78rem;
    color: var(--um-muted, #6b8290);
}

.fed-users-page .fed-node-filter-menu {
    flex: 0 0 auto;
}

.fed-users-page .fed-node-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 92px;
    max-width: 148px;
    height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(4, 68, 100, 0.22);
    border-radius: 20px;
    background: #044464;
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: none;
}

.fed-users-page .fed-node-filter-btn:hover {
    background: #06557d;
}

.fed-users-page .fed-node-filter-btn__text {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 96px;
    text-align: center;
}

.fed-users-page .fed-node-filter-btn i {
    font-size: 11px;
    opacity: .9;
    flex-shrink: 0;
}

.layout-theme.theme-dark .fed-users-page .fed-node-filter-btn,
body.app-dark-mode .fed-users-page .fed-node-filter-btn {
    background: #355B6D !important;
    border-color: #0B3043 !important;
    color: #AEBDC5 !important;
}

.layout-theme.theme-dark .fed-hero__mark {
    background: #0D3A50;
    border: 1px solid #5E7C8A;
    color: #AEBDC5;
}

.layout-theme.theme-dark .fed-node-chip.is-live em,
body.app-dark-mode .fed-node-chip.is-live em {
    color: #86efac;
}

.layout-theme.theme-dark .fed-node-chip.is-down em,
body.app-dark-mode .fed-node-chip.is-down em {
    color: #fca5a5;
}

.layout-theme.theme-dark .fed-panel__title {
    color: #AEBDC5 !important;
}

.fed-users-toolbar-row {
    align-items: center;
    gap: 12px;
}

.fed-users-list {
    margin-top: 4px;
}

/* Same compact row as UserManagement, without checkbox column */
.fed-users-list .fed-user-row {
    grid-template-columns:
        28px
        minmax(120px, 1.15fr)
        72px
        minmax(200px, 1.6fr)
        minmax(110px, .95fr)
        minmax(120px, 1fr)
        minmax(90px, .8fr)
        96px !important;
}

.fed-users-list .fed-user-card.is-node-down {
    opacity: .72;
}

.fed-users-list .fed-user-card.is-inactive::before {
    background: var(--um-err, #c0392b);
}

.fed-node-chip {
    gap: 5px !important;
}

.fed-node-chip em {
    font-style: normal;
    font-weight: 700;
    font-size: .68rem;
}

.fed-node-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #94a3b8;
}

.fed-node-chip.is-live .fed-node-dot {
    background: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, .18);
}

.fed-node-chip.is-live em {
    color: #15803d;
}

.fed-node-chip.is-down .fed-node-dot {
    background: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .16);
}

.fed-node-chip.is-down em {
    color: #b91c1c;
}

.fed-banner--warn {
    border-color: rgba(161, 98, 7, .28);
    background: rgba(161, 98, 7, .08);
}

a.fed-quick__btn {
    text-decoration: none;
    color: inherit;
}

@media (max-width: 1100px) {
    .fed-users-list .fed-user-row {
        grid-template-columns:
            28px
            minmax(0, 1fr)
            auto !important;
        grid-template-areas:
            "avatar name actions"
            "avatar status actions"
            "badges badges badges"
            "contact contact storage"
            "flags flags flags";
        row-gap: 8px;
    }

    .fed-users-list .um-avatar { grid-area: avatar; }
    .fed-users-list .um-name { grid-area: name; }
    .fed-users-list .um-user-row__status { grid-area: status; }
    .fed-users-list .um-user-row__badges {
        grid-area: badges;
        padding-inline-start: 0;
        border-inline-start: none;
    }
    .fed-users-list .um-user-row__contact {
        grid-area: contact;
        padding-inline-start: 0;
        border-inline-start: none;
    }
    .fed-users-list .um-user-row__storage {
        grid-area: storage;
        padding-inline-start: 0;
        border-inline-start: none;
    }
    .fed-users-list .um-user-row__flags {
        grid-area: flags;
        padding-inline-start: 0;
        border-inline-start: none;
    }
    .fed-users-list .um-card__actions {
        grid-area: actions;
        width: auto;
        padding-inline-start: 0;
        border-inline-start: none;
    }
}

/* ── Dark mode ── */
.layout-theme.theme-dark .fed-page,
body.app-dark-mode .fed-page {
    --fed-ink: #d7eef8;
    --fed-ink-soft: #7eb6d4;
    --fed-muted: #9db6c7;
    --fed-line: rgba(150, 191, 218, 0.22);
    --fed-surface: #1a2836;
    --fed-ok: #86efac;
    --fed-warn: #f0d48a;
    --fed-err: #fca5a5;
    --fed-info: #7dd3fc;
}

.layout-theme.theme-dark .fed-hero,
body.app-dark-mode .fed-hero {
    background: #092735;
    border: 1px solid #0B3043;
    color: #AEBDC5;
}

.layout-theme.theme-dark .fed-pill,
body.app-dark-mode .fed-pill {
    background: #355b6d33;
    border-color: #0d3a50;
    color: #AEBDC5;
}

.layout-theme.theme-dark .fed-pill--ok,
body.app-dark-mode .fed-pill--ok {
    background: #78a86166;
    color: #a5c596;
    border: none;
}

.layout-theme.theme-dark .fed-pill--warn,
body.app-dark-mode .fed-pill--warn {
    color: #f0d48a;
    border-color: rgba(245, 158, 11, .35);
    background: rgba(245, 158, 11, .14);
}

.layout-theme.theme-dark .fed-pill--off,
body.app-dark-mode .fed-pill--off {
    color: #9db6c7;
    background: rgba(100, 116, 139, .22);
}

.layout-theme.theme-dark .fed-pill--hub,
body.app-dark-mode .fed-pill--hub {
    background: #355b6d99;
    border-color: #0d3a50;
    color: #AEBDC5;
}

.layout-theme.theme-dark .fed-kpi__card,
body.app-dark-mode .fed-kpi__card {
    background: #355b6d66 !important;
    border-color: #5e7c8a4d;
}

    .layout-theme.theme-dark .fed-kpi__card:hover,
    body.app-dark-mode .fed-kpi__card:hover {
        border-color: #5E7C8A;
        box-shadow: 0 4px 12px rgba(0, 0, 0, .28);
    }

.layout-theme.theme-dark .fed-kpi__icon,
body.app-dark-mode .fed-kpi__icon {
    background: rgba(150, 191, 218, 0.12);
    color: #7eb6d4;
}

.layout-theme.theme-dark .fed-kpi__icon.is-online,
body.app-dark-mode .fed-kpi__icon.is-online {
    color: #4ade80;
    background: rgba(34, 197, 94, .16);
}

.layout-theme.theme-dark .fed-kpi__icon.is-pending,
body.app-dark-mode .fed-kpi__icon.is-pending {
    color: #7dd3fc;
    background: rgba(3, 105, 161, .28);
}

.layout-theme.theme-dark .fed-kpi__icon.is-stale,
body.app-dark-mode .fed-kpi__icon.is-stale {
    color: #f0d48a;
    background: rgba(245, 158, 11, .16);
}

.layout-theme.theme-dark .fed-kpi__icon.is-policy,
body.app-dark-mode .fed-kpi__icon.is-policy {
    color: #fdba74;
    background: rgba(154, 52, 18, .28);
}

.layout-theme.theme-dark .fed-kpi__icon.is-xfer,
body.app-dark-mode .fed-kpi__icon.is-xfer {
    color: #93c5fd;
    background: rgba(29, 78, 216, .28);
}

.layout-theme.theme-dark .fed-kpi__icon.is-fail,
body.app-dark-mode .fed-kpi__icon.is-fail {
    color: #fca5a5;
    background: rgba(185, 28, 28, .22);
}

.layout-theme.theme-dark .fed-kpi__value,
.layout-theme.theme-dark .fed-dist__n,
.layout-theme.theme-dark .fed-quick__btn span,
.layout-theme.theme-dark .fed-node-card__name,
.layout-theme.theme-dark .fed-hub-summary strong,
.layout-theme.theme-dark .fed-xfer-item__name,
.layout-theme.theme-dark .fed-node-name,
body.app-dark-mode .fed-kpi__value,
body.app-dark-mode .fed-dist__n,
body.app-dark-mode .fed-quick__btn span,
body.app-dark-mode .fed-node-card__name,
body.app-dark-mode .fed-hub-summary strong,
body.app-dark-mode .fed-xfer-item__name,
body.app-dark-mode .fed-node-name {
    color: #aebdc5;
}

.layout-theme.theme-dark .fed-kpi__hint,
.layout-theme.theme-dark .fed-xfer-item__time,
.layout-theme.theme-dark .fed-empty i,
.layout-theme.theme-dark .fed-empty__hint,
body.app-dark-mode .fed-kpi__hint,
body.app-dark-mode .fed-xfer-item__time,
body.app-dark-mode .fed-empty i,
body.app-dark-mode .fed-empty__hint {
    color: #7a8fa0;
}

.layout-theme.theme-dark .fed-panel,
body.app-dark-mode .fed-panel {
    background: #092735;
    border-color: #0B3043;
}

.layout-theme.theme-dark .fed-panel__head,
body.app-dark-mode .fed-panel__head {
    background: #0d3a50;
    border-bottom-color: rgba(150, 191, 218, 0.16);
}

.layout-theme.theme-dark .fed-panel__body--scroll::-webkit-scrollbar-thumb,
body.app-dark-mode .fed-panel__body--scroll::-webkit-scrollbar-thumb {
    background: rgba(150, 191, 218, .35);
}

.layout-theme.theme-dark .fed-dist__label,
.layout-theme.theme-dark .fed-hub-summary,
.layout-theme.theme-dark .fed-empty__title,
body.app-dark-mode .fed-dist__label,
body.app-dark-mode .fed-hub-summary,
body.app-dark-mode .fed-empty__title {
    color: #aebdc5;
}

.layout-theme.theme-dark .fed-dist__track,
body.app-dark-mode .fed-dist__track {
    background: rgba(150, 191, 218, 0.12);
}

.layout-theme.theme-dark .fed-alert,
body.app-dark-mode .fed-alert {
    background: rgba(150, 191, 218, 0.08);
    border-color: rgba(150, 191, 218, 0.18);
    color: #c5d4de;
}

.layout-theme.theme-dark .fed-alert--ok,
body.app-dark-mode .fed-alert--ok {
    background: #78a86166;
    color: #a5c596;
    border-color: #a5c596;
}

.layout-theme.theme-dark .fed-alert--warn,
body.app-dark-mode .fed-alert--warn {
    border-color: rgba(245, 158, 11, .35);
    background: rgba(245, 158, 11, .12);
    color: #f0d48a;
}

.layout-theme.theme-dark .fed-alert--info,
body.app-dark-mode .fed-alert--info {
    background: #355b6db3;
    color: #aebdc5;
    border-color: #aebdc5b3;
}

.layout-theme.theme-dark .fed-alert--err,
body.app-dark-mode .fed-alert--err {
    border-color: rgba(239, 68, 68, .35);
    background: rgba(239, 68, 68, .12);
    color: #fca5a5;
}

.layout-theme.theme-dark .fed-quick__btn,
body.app-dark-mode .fed-quick__btn {
    background: #355b6d66 !important;
    border-color: #26475D !important;
    color: #AEBDC5 !important;
}

.layout-theme.theme-dark .fed-quick__btn:hover,
body.app-dark-mode .fed-quick__btn:hover {
    border-color: #7eb6d4;
    background: rgba(150, 191, 218, 0.1);
}

.layout-theme.theme-dark .fed-node-card,
body.app-dark-mode .fed-node-card {
    background: #162230;
    border-color: rgba(150, 191, 218, 0.22);
}

.layout-theme.theme-dark .fed-xfer-item,
body.app-dark-mode .fed-xfer-item {
    border-bottom-color: rgba(150, 191, 218, 0.12);
}

.layout-theme.theme-dark .fed-secret-gen,
body.app-dark-mode .fed-secret-gen {
    color: #7eb6d4;
}

.layout-theme.theme-dark .fed-banner,
body.app-dark-mode .fed-banner {
    background: linear-gradient(135deg, rgba(245, 158, 11, .16) 0%, #1a2836 100%);
    border-color: rgba(245, 158, 11, .35);
    color: #f0d48a;
}

.layout-theme.theme-dark .fed-banner a,
body.app-dark-mode .fed-banner a {
    color: #7eb6d4;
}

.layout-theme.theme-dark .fed-banner--warn,
body.app-dark-mode .fed-banner--warn {
    border-color: rgba(245, 158, 11, .35);
    background: rgba(245, 158, 11, .12);
}

.layout-theme.theme-dark .fed-tabs .mud-tabs-toolbar,
body.app-dark-mode .fed-tabs .mud-tabs-toolbar {
    background: #1a2836;
    border-color: rgba(150, 191, 218, 0.22);
}

.layout-theme.theme-dark .fed-tabs .mud-tab,
body.app-dark-mode .fed-tabs .mud-tab {
    color: #9db6c7;
}

    .layout-theme.theme-dark .fed-tabs .mud-tab.mud-tab-active,
    body.app-dark-mode .fed-tabs .mud-tab.mud-tab-active {
        color: #d7eef8;
        background: #0d3a50;
    }

.layout-theme.theme-dark .fed-settings-note,
body.app-dark-mode .fed-settings-note {
    background: #355b6d66 !important;
    border-color: #26475D !important;
    color: #AEBDC5;
}

.layout-theme.theme-dark .fed-page .mud-table,
.layout-theme.theme-dark .fed-page .mud-table-container,
.layout-theme.theme-dark .fed-page .mud-paper,
body.app-dark-mode .fed-page .mud-table,
body.app-dark-mode .fed-page .mud-table-container,
body.app-dark-mode .fed-page .mud-paper {
    background-color: transparent;
    color: #d7eef8;
}

.layout-theme.theme-dark .fed-page .mud-table-head .mud-table-cell,
body.app-dark-mode .fed-page .mud-table-head .mud-table-cell {
    color: #7eb6d4;
    background: rgba(150, 191, 218, 0.08);
}

.layout-theme.theme-dark .fed-page .mud-table-body .mud-table-cell,
body.app-dark-mode .fed-page .mud-table-body .mud-table-cell {
    color: #c5d4de;
    border-color: rgba(150, 191, 218, 0.12);
}

.layout-theme.theme-dark .fed-page .mud-table-row:hover,
body.app-dark-mode .fed-page .mud-table-row:hover {
    background: rgba(150, 191, 218, 0.08);
}

@media (max-width: 820px) {
    .layout-theme.theme-dark .fed-hero__toolbar,
    body.app-dark-mode .fed-hero__toolbar {
        border-top-color: rgba(150, 191, 218, 0.16);
    }
}
