:root {
    --bg: #050810;
    --surface: #090e1b;
    --surface-2: #0c1222;
    --surface-3: #101728;

    --border: rgba(148, 163, 184, .15);
    --border-strong: rgba(148, 163, 184, .22);

    --text: #f8fafc;
    --muted: #94a3b8;
    --muted-2: #64748b;

    --accent: #d7ae58;
    --accent-soft: rgba(215, 174, 88, .13);

    --healthy: #22c55e;
    --healthy-soft: rgba(34, 197, 94, .12);

    --degraded: #f59e0b;
    --degraded-soft: rgba(245, 158, 11, .12);

    --failed: #ef4444;
    --failed-soft: rgba(239, 68, 68, .12);

    --unknown: #64748b;

    --radius: 16px;
    --radius-small: 10px;

    --shadow: 0 20px 60px rgba(0, 0, 0, .18);
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg);
}

body {
    margin: 0;
    background:
        radial-gradient(circle at 18% 0%, rgba(64, 74, 160, .10), transparent 31rem),
        var(--bg);
    color: var(--text);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    font-size: 14px;
}

button,
input {
    font: inherit;
}

.page-shell {
    width: min(1320px, calc(100% - 40px));
    margin: 0 auto;
}

.topbar {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: grid;
    place-items: center;

    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid rgba(215, 174, 88, .30);

    font-size: 15px;
    font-weight: 900;
    letter-spacing: .04em;
}

.brand-name {
    color: var(--text);
    font-size: 16px;
    font-weight: 800;
}

.brand-subtitle {
    color: var(--muted);
    font-size: 11px;
    margin-top: 2px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.top-status {
    display: flex;
    align-items: center;
    gap: 8px;

    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .05em;
}

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--healthy);
    box-shadow: 0 0 12px rgba(34, 197, 94, .75);
}

main {
    padding: 30px 0 56px;
}

.page-title-row {
    margin: 2px 0 22px;
}

.page-title-row h1 {
    margin: 0;
    font-size: 27px;
    line-height: 1.2;
    font-weight: 850;
    letter-spacing: -.025em;
}

.page-title-row p,
.section-heading p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

.kpi-card {
    position: relative;
    min-height: 108px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    background: linear-gradient(145deg, rgba(13, 19, 35, .96), rgba(8, 13, 25, .96));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.kpi-card::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 2px;
    background: rgba(215, 174, 88, .50);
}

.kpi-value {
    color: #fff;
    font-size: 31px;
    line-height: 1;
    font-weight: 850;
    letter-spacing: -.035em;
}

.kpi-label {
    margin-top: 11px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .055em;
}

.skeleton {
    opacity: .45;
}

.live-bar {
    width: fit-content;
    min-width: 420px;
    margin: 28px auto 32px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;

    padding: 10px 17px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(9, 14, 27, .82);
}

.live-left,
.live-clock {
    display: flex;
    align-items: center;
    gap: 7px;
}

.live-left {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .035em;
}

.live-clock,
.live-meta {
    color: var(--muted);
    font-size: 10px;
}

.live-meta {
    padding-left: 14px;
    border-left: 1px solid var(--border);
}

.status-dot {
    display: inline-block;
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.status-dot.healthy {
    background: var(--healthy);
    box-shadow: 0 0 10px rgba(34, 197, 94, .65);
}

.status-dot.degraded {
    background: var(--degraded);
    box-shadow: 0 0 10px rgba(245, 158, 11, .55);
}

.status-dot.failed {
    background: var(--failed);
    box-shadow: 0 0 10px rgba(239, 68, 68, .55);
}

.status-dot.neutral,
.status-dot.not_monitored,
.status-dot.unknown {
    background: var(--unknown);
}

section + section {
    margin-top: 34px;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 13px;
}

.section-heading h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -.01em;
}

.panel,
.balancer-card {
    background: rgba(9, 14, 27, .94);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.balancer-list {
    display: grid;
    gap: 18px;
}

.balancer-card {
    padding: 20px 22px 22px;
}

.balancer-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.balancer-title {
    font-size: 17px;
    font-weight: 850;
}

.balancer-meta {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 7px 14px;
    color: var(--muted);
    font-size: 11px;
}

.strategy-badge,
.role-badge,
.protocol-badge,
.state-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .035em;
}

.strategy-badge {
    padding: 7px 10px;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid rgba(215, 174, 88, .24);
}

.members-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.member-row {
    min-width: 0;
    padding: 13px 14px;
    border-radius: 11px;
    border: 1px solid var(--border);
    background: rgba(14, 21, 38, .68);
}

.member-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.member-name {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 750;
}

.member-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-rtt {
    flex: 0 0 auto;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
}

.member-bottom {
    margin-top: 9px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.transport-line {
    min-width: 0;
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-samples {
    flex: 0 0 auto;
    color: #fff;
    font-size: 10px;
}

.state-badge {
    padding: 5px 8px;
}

.state-badge.healthy {
    color: var(--healthy);
    background: var(--healthy-soft);
}

.state-badge.degraded {
    color: var(--degraded);
    background: var(--degraded-soft);
}

.state-badge.failed {
    color: var(--failed);
    background: var(--failed-soft);
}

.state-badge.not_monitored,
.state-badge.unknown {
    color: var(--muted);
    background: rgba(100, 116, 139, .12);
}

.fallback-block {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.fallback-label {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .045em;
}

.outbound-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.outbound-card {
    padding: 15px;
    border-radius: 13px;
    border: 1px solid var(--border);
    background: rgba(9, 14, 27, .94);
    cursor: pointer;
    transition:
        border-color .16s ease,
        background .16s ease,
        transform .16s ease;
}

.outbound-card:hover {
    border-color: var(--border-strong);
    background: rgba(13, 20, 37, .98);
    transform: translateY(-1px);
}

.outbound-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.outbound-name {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    font-weight: 800;
}

.outbound-name span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.outbound-protocol {
    margin-top: 7px;
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-top: 15px;
}

.metric {
    min-width: 0;
    padding: 9px 8px;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, .55);
}

.metric-label {
    color: var(--muted-2);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

.metric-value {
    margin-top: 4px;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
}

.outbound-extra {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.outbound-card.expanded .outbound-extra {
    display: block;
}

.extra-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 5px 0;
    color: var(--muted);
    font-size: 10px;
}

.extra-row strong {
    color: #fff;
    font-weight: 700;
    text-align: right;
}

.filters input {
    width: 240px;
    height: 36px;
    padding: 0 12px;
    outline: none;

    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.filters input:focus {
    border-color: rgba(215, 174, 88, .42);
}

.filters input::placeholder {
    color: var(--muted-2);
}

.loading-panel,
.empty-state,
.error-state {
    grid-column: 1 / -1;
    padding: 28px;
    color: var(--muted);
    text-align: center;
}

.error-state {
    color: var(--failed);
}

footer {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    color: var(--muted-2);
    font-size: 10px;

    border-top: 1px solid var(--border);
}

@media (max-width: 1050px) {
    .kpi-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .members-grid,
    .outbound-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .page-shell {
        width: min(100% - 24px, 1320px);
    }

    .topbar {
        min-height: 68px;
    }

    main {
        padding-top: 22px;
    }

    .page-title-row h1 {
        font-size: 22px;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 9px;
    }

    .kpi-card {
        min-height: 94px;
    }

    .kpi-value {
        font-size: 27px;
    }

    .live-bar {
        width: 100%;
        min-width: 0;
        flex-wrap: wrap;
        margin: 20px 0 28px;
    }

    .live-meta {
        border-left: 0;
        padding-left: 0;
    }

    .section-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .filters input {
        width: 100%;
    }

    .balancer-card {
        padding: 16px;
    }

    .balancer-header {
        flex-direction: column;
        gap: 10px;
    }

    .metric-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    footer {
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        padding: 15px 0;
    }
}

/* Карточки outbounds имеют независимую высоту внутри grid-строки */
.outbound-grid {
    align-items: start;
}

.outbound-card {
    align-self: start;
}


/* =========================================================
   СПИСОК ИСХОДЯЩИХ ПОДКЛЮЧЕНИЙ
   Спокойное табличное представление без вложенной сетки
   ========================================================= */

.outbound-grid {
    display: block;
    overflow: hidden;

    background: rgba(9, 14, 27, .94);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.outbound-card {
    padding: 0;
    margin: 0;

    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;

    background: transparent;
    box-shadow: none;

    cursor: pointer;
    transform: none;
}

.outbound-card:last-child {
    border-bottom: 0;
}

.outbound-card:hover {
    border-color: var(--border);
    background: rgba(255, 255, 255, .025);
    transform: none;
}

.outbound-card.expanded {
    background: rgba(255, 255, 255, .018);
}

.outbound-summary {
    min-height: 66px;
    display: grid;
    grid-template-columns:
        minmax(280px, 1fr)
        150px
        110px
        26px;

    align-items: center;
    gap: 18px;

    padding: 11px 16px;
}

.outbound-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.outbound-identity {
    min-width: 0;
}

.outbound-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: var(--text);
    font-size: 13px;
    font-weight: 800;
}

.outbound-transport {
    margin-top: 5px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .025em;
}

.outbound-state-column {
    display: flex;
    justify-content: flex-start;
}

.outbound-rtt {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.outbound-rtt-value {
    color: #fff;
    font-size: 14px;
    font-weight: 800;
}

.outbound-rtt-label {
    margin-top: 3px;
    color: var(--muted-2);
    font-size: 9px;
    text-transform: uppercase;
}

.outbound-chevron {
    color: var(--muted);
    font-size: 18px;
    line-height: 1;
    text-align: center;

    transition: transform .16s ease;
}

.outbound-card.expanded .outbound-chevron {
    transform: rotate(180deg);
}


/* Раскрытая часть */

.outbound-extra {
    display: none;

    margin: 0 16px;
    padding: 15px 0 17px 21px;

    border-top: 1px solid rgba(148, 163, 184, .10);
}

.outbound-card.expanded .outbound-extra {
    display: block;
}

.outbound-detail-metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(90px, 1fr));
    gap: 0;

    max-width: 760px;
}

.detail-metric {
    padding: 2px 18px;
    border-left: 1px solid var(--border);
}

.detail-metric:first-child {
    padding-left: 0;
    border-left: 0;
}

.detail-metric span {
    display: block;

    color: var(--muted-2);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.detail-metric strong {
    display: block;
    margin-top: 5px;

    color: #fff;
    font-size: 13px;
    font-weight: 800;
}

.outbound-detail-info {
    max-width: 760px;
    margin-top: 16px;
    padding-top: 12px;

    border-top: 1px solid rgba(148, 163, 184, .10);
}

.detail-info-row {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 16px;

    padding: 4px 0;

    font-size: 10px;
}

.detail-info-row span {
    color: var(--muted);
}

.detail-info-row strong {
    min-width: 0;

    overflow-wrap: anywhere;

    color: #fff;
    font-weight: 700;
}


/* У старой сетки метрик больше нет визуального влияния */

.outbound-card .metric-grid {
    display: none;
}


/* Планшет */

@media (max-width: 900px) {
    .outbound-summary {
        grid-template-columns:
            minmax(200px, 1fr)
            130px
            90px
            22px;

        gap: 12px;
    }

    .outbound-detail-metrics {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px 0;
    }

    .detail-metric:nth-child(4) {
        padding-left: 0;
        border-left: 0;
    }
}


/* Телефон */

@media (max-width: 620px) {
    .outbound-summary {
        min-height: 70px;

        grid-template-columns:
            minmax(0, 1fr)
            auto
            18px;

        gap: 10px;

        padding: 11px 12px;
    }

    .outbound-state-column {
        display: none;
    }

    .outbound-rtt {
        grid-column: 2;
    }

    .outbound-chevron {
        grid-column: 3;
    }

    .outbound-extra {
        margin: 0 12px;
        padding-left: 21px;
    }

    .outbound-detail-metrics {
        grid-template-columns: repeat(2, 1fr);
    }

    .detail-metric,
    .detail-metric:first-child,
    .detail-metric:nth-child(4) {
        padding: 6px 12px;
        border-left: 0;
    }

    .detail-metric:nth-child(odd) {
        padding-left: 0;
    }

    .detail-info-row {
        grid-template-columns: 1fr;
        gap: 3px;
        padding: 6px 0;
    }
}


/* =========================================================
   Общие сворачиваемые панели
   ========================================================= */

.collapsible-heading > div:first-child {
    min-width: 0;
}

.collapsible-heading > div:first-child > h2 {
    display: inline;
}

.section-toggle {
    margin-left: 10px;
    padding: 4px 8px;

    display: inline-flex;
    align-items: center;
    gap: 5px;

    vertical-align: 2px;

    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 7px;

    font-size: 10px;
    font-weight: 700;

    cursor: pointer;
}

.section-toggle:hover {
    color: var(--text);
    background: rgba(255, 255, 255, .04);
}

.section-toggle-icon {
    width: 12px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1;
    text-align: center;
}

.section-collapsed .balancer-list,
.section-collapsed .outbound-grid {
    display: none;
}

.section-collapsed .section-heading {
    margin-bottom: 0;
}

.section-collapsed {
    padding-bottom: 3px;
}


/* На телефоне оставляем только стрелку */

@media (max-width: 620px) {
    .section-toggle-text {
        display: none;
    }

    .section-toggle {
        margin-left: 6px;
        padding: 4px;
    }
}


/* =========================================================
   Группы исходящих подключений
   ========================================================= */

.outbound-grid {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

.outbound-group {
    overflow: hidden;

    background: rgba(9, 14, 27, .94);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.outbound-group + .outbound-group {
    margin-top: 14px;
}

.outbound-group-header {
    width: 100%;
    min-height: 48px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    padding: 0 16px;

    color: var(--text);
    background: rgba(255, 255, 255, .018);

    border: 0;
    border-bottom: 1px solid var(--border);

    cursor: pointer;
    text-align: left;
}

.outbound-group-header:hover {
    background: rgba(255, 255, 255, .03);
}

.outbound-group-title {
    min-width: 0;

    display: flex;
    align-items: center;
    gap: 9px;

    font-size: 12px;
    font-weight: 800;
}

.outbound-group-icon {
    font-size: 13px;
}

.outbound-group-count {
    min-width: 25px;
    height: 20px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 7px;

    color: #fff;
    background: rgba(255, 255, 255, .055);

    border: 1px solid var(--border);
    border-radius: 999px;

    font-size: 10px;
    font-weight: 800;
}

.outbound-group-toggle {
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    gap: 7px;

    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}

.outbound-group-chevron {
    width: 13px;

    color: var(--muted);
    font-size: 15px;
    line-height: 1;
    text-align: center;
}

.outbound-group-body {
    display: block;
}

.outbound-group.collapsed .outbound-group-body {
    display: none;
}

.outbound-group.collapsed .outbound-group-header {
    border-bottom: 0;
}

.outbound-group-empty {
    padding: 20px;

    color: var(--muted);
    font-size: 11px;
    text-align: center;
}


/*
 * Outbound-строки внутри каждой группы.
 */

.outbound-group .outbound-card:last-child {
    border-bottom: 0;
}


@media (max-width: 620px) {
    .outbound-group-header {
        min-height: 46px;
        padding: 0 12px;
    }

    .outbound-group-toggle-text {
        display: none;
    }
}


/* =========================================================
   Компактный режим панелей
   ========================================================= */

/* Балансировщики */

.balancer-card {
    padding: 11px 13px 12px;
    border-radius: 11px;
}

.balancer-header {
    gap: 10px;
    padding-bottom: 8px;
}

.balancer-title {
    font-size: 13px;
}

.balancer-meta {
    margin-top: 3px;
    gap: 4px 9px;
    font-size: 9px;
}

.strategy-badge {
    padding: 4px 7px;
    font-size: 8px;
}

.members-grid {
    gap: 5px;
    margin-top: 8px;
}

.member-row {
    padding: 7px 8px;
    border-radius: 7px;
}

.member-name {
    gap: 6px;
    font-size: 10px;
}

.member-rtt {
    font-size: 11px;
}

.member-bottom {
    margin-top: 4px;
    gap: 6px;
}

.transport-line,
.member-samples {
    font-size: 8px;
}

.state-badge {
    padding: 3px 6px;
    font-size: 8px;
}

.status-dot {
    width: 7px;
    height: 7px;
}

.fallback-block {
    margin-top: 7px;
    padding-top: 7px;
}

.fallback-label {
    margin-bottom: 5px;
    font-size: 8px;
}


/* Группы исходящих подключений */

.outbound-group + .outbound-group {
    margin-top: 8px;
}

.outbound-group {
    border-radius: 11px;
}

.outbound-group-header {
    min-height: 34px;
    padding: 0 10px;
}

.outbound-group-title {
    gap: 6px;
    font-size: 10px;
}

.outbound-group-icon {
    font-size: 10px;
}

.outbound-group-count {
    min-width: 20px;
    height: 16px;
    padding: 0 5px;
    font-size: 8px;
}

.outbound-group-toggle {
    gap: 4px;
    font-size: 8px;
}

.outbound-group-chevron {
    font-size: 12px;
}


/* Строки серверов */

.outbound-summary {
    min-height: 43px;

    grid-template-columns:
        minmax(250px, 1fr)
        125px
        85px
        18px;

    gap: 10px;
    padding: 6px 10px;
}

.outbound-main {
    gap: 7px;
}

.outbound-name-text {
    font-size: 10px;
}

.outbound-transport {
    margin-top: 2px;
    font-size: 8px;
}

.outbound-rtt-value {
    font-size: 10px;
}

.outbound-rtt-label {
    margin-top: 1px;
    font-size: 7px;
}

.outbound-chevron {
    font-size: 13px;
}


/* Раскрытая диагностика */

.outbound-extra {
    margin: 0 10px;
    padding: 9px 0 10px 14px;
}

.detail-metric {
    padding: 1px 11px;
}

.detail-metric span {
    font-size: 7px;
}

.detail-metric strong {
    margin-top: 3px;
    font-size: 10px;
}

.outbound-detail-info {
    margin-top: 9px;
    padding-top: 7px;
}

.detail-info-row {
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 10px;
    padding: 2px 0;
    font-size: 8px;
}


/* Общие заголовки секций */

.section-heading {
    margin-bottom: 8px;
}

.section-heading h2 {
    font-size: 14px;
}

.section-heading p {
    margin-top: 3px;
    font-size: 9px;
}

.section-toggle {
    margin-left: 6px;
    padding: 2px 5px;
    font-size: 8px;
}

.filters input {
    width: 210px;
    height: 29px;
    padding: 0 9px;
    font-size: 9px;
}


@media (max-width: 620px) {
    .outbound-summary {
        min-height: 46px;
        grid-template-columns: minmax(0, 1fr) auto 16px;
        padding: 6px 9px;
    }

    .outbound-group-header {
        min-height: 34px;
        padding: 0 9px;
    }

    .outbound-extra {
        margin: 0 9px;
        padding-left: 12px;
    }
}


/* =========================================================
   Compact UI +25%
   ========================================================= */

/* Балансировщики */

.balancer-card {
    padding: 14px 16px 15px;
    border-radius: 14px;
}

.balancer-header {
    gap: 13px;
    padding-bottom: 10px;
}

.balancer-title {
    font-size: 16px;
}

.balancer-meta {
    margin-top: 4px;
    gap: 5px 11px;
    font-size: 11px;
}

.strategy-badge {
    padding: 5px 9px;
    font-size: 10px;
}

.members-grid {
    gap: 6px;
    margin-top: 10px;
}

.member-row {
    padding: 9px 10px;
    border-radius: 9px;
}

.member-name {
    gap: 8px;
    font-size: 13px;
}

.member-rtt {
    font-size: 14px;
}

.member-bottom {
    margin-top: 5px;
    gap: 8px;
}

.transport-line,
.member-samples {
    font-size: 10px;
}

.state-badge {
    padding: 4px 8px;
    font-size: 10px;
}

.status-dot {
    width: 9px;
    height: 9px;
}

.fallback-block {
    margin-top: 9px;
    padding-top: 9px;
}

.fallback-label {
    margin-bottom: 6px;
    font-size: 10px;
}


/* Группы исходящих */

.outbound-group + .outbound-group {
    margin-top: 10px;
}

.outbound-group {
    border-radius: 14px;
}

.outbound-group-header {
    min-height: 43px;
    padding: 0 13px;
}

.outbound-group-title {
    gap: 8px;
    font-size: 13px;
}

.outbound-group-icon {
    font-size: 13px;
}

.outbound-group-count {
    min-width: 25px;
    height: 20px;
    padding: 0 6px;
    font-size: 10px;
}

.outbound-group-toggle {
    gap: 5px;
    font-size: 10px;
}

.outbound-group-chevron {
    font-size: 15px;
}


/* Строки серверов */

.outbound-summary {
    min-height: 54px;

    grid-template-columns:
        minmax(250px, 1fr)
        156px
        106px
        23px;

    gap: 13px;
    padding: 8px 13px;
}

.outbound-main {
    gap: 9px;
}

.outbound-name-text {
    font-size: 13px;
}

.outbound-transport {
    margin-top: 3px;
    font-size: 10px;
}

.outbound-rtt-value {
    font-size: 13px;
}

.outbound-rtt-label {
    margin-top: 1px;
    font-size: 9px;
}

.outbound-chevron {
    font-size: 16px;
}


/* Раскрытая диагностика */

.outbound-extra {
    margin: 0 13px;
    padding: 11px 0 13px 18px;
}

.detail-metric {
    padding: 1px 14px;
}

.detail-metric span {
    font-size: 9px;
}

.detail-metric strong {
    margin-top: 4px;
    font-size: 13px;
}

.outbound-detail-info {
    margin-top: 11px;
    padding-top: 9px;
}

.detail-info-row {
    grid-template-columns: 188px minmax(0, 1fr);
    gap: 13px;
    padding: 3px 0;
    font-size: 10px;
}


/* Общие заголовки */

.section-heading {
    margin-bottom: 10px;
}

.section-heading h2 {
    font-size: 18px;
}

.section-heading p {
    margin-top: 4px;
    font-size: 11px;
}

.section-toggle {
    margin-left: 8px;
    padding: 3px 6px;
    font-size: 10px;
}

.filters input {
    width: 263px;
    height: 36px;
    padding: 0 11px;
    font-size: 11px;
}


@media (max-width: 620px) {
    .outbound-summary {
        min-height: 58px;
        grid-template-columns: minmax(0, 1fr) auto 20px;
        padding: 8px 11px;
    }

    .outbound-group-header {
        min-height: 43px;
        padding: 0 11px;
    }

    .outbound-extra {
        margin: 0 11px;
        padding-left: 15px;
    }
}


/* =========================================================
   XRayVless site navigation
   ========================================================= */

.site-nav {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    margin: 0 0 26px;
    padding: 8px;
    background: rgba(10, 15, 27, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 14px;
}

.site-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 13px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    transition:
        color .18s ease,
        background .18s ease,
        border-color .18s ease;
}

.site-nav a:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.035);
    border-color: rgba(148, 163, 184, 0.14);
}

.site-nav a.active {
    color: #f8fafc;
    background: rgba(212, 175, 55, 0.08);
    border-color: rgba(212, 175, 55, 0.42);
}

@media (max-width: 760px) {
    .site-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: thin;
        padding: 7px;
    }

    .site-nav a {
        flex: 0 0 auto;
    }
}
