.relationship-page-header {
    align-items: flex-start;
}

.relationship-access-denied,
.relationship-error-state {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: .65rem;
    justify-content: center;
    min-height: 320px;
    text-align: center;
}

.relationship-access-denied > i,
.relationship-error-state > i {
    align-items: center;
    background: #eef5f2;
    border-radius: 18px;
    color: #315f54;
    display: flex;
    font-size: 1.7rem;
    height: 62px;
    justify-content: center;
    width: 62px;
}

.relationship-error-state > i {
    background: #fee2e2;
    color: #b91c1c;
}

.relationship-summary-bar {
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-bottom: 1rem;
}

.relationship-summary-bar > div {
    background: #ffffff;
    border: 1px solid #dbe5e1;
    border-radius: 14px;
    box-shadow: 0 7px 18px rgba(15, 23, 42, .06);
    min-width: 0;
    padding: .75rem .85rem;
}

.relationship-summary-bar span,
.relationship-summary-bar strong {
    display: block;
}

.relationship-summary-bar span {
    color: #64748b;
    font-size: .67rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.relationship-summary-bar strong {
    color: #1f3f37;
    font-size: .84rem;
    margin-top: .2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.relationship-state-correct {
    color: #15803d !important;
}

.relationship-state-warning {
    color: #b45309 !important;
}

.relationship-state-inactive {
    color: #b91c1c !important;
}

.relationship-state-information {
    color: #0369a1 !important;
}

.relationship-map-workspace {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr) 330px;
    min-height: 650px;
}

.relationship-map-workspace:fullscreen {
    background: #eef4f1;
    box-sizing: border-box;
    height: 100vh;
    padding: 1rem;
    width: 100vw;
}

.relationship-map-main {
    display: flex;
    flex-direction: column;
    min-height: 650px;
    overflow: hidden;
    padding: 0;
}

.relationship-map-toolbar {
    align-items: center;
    border-bottom: 1px solid #dce6e2;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding: .85rem 1rem;
}

.relationship-map-toolbar > div:first-child {
    min-width: 0;
}

.relationship-map-toolbar strong,
.relationship-map-toolbar span {
    display: block;
}

.relationship-map-toolbar strong {
    color: #1f3f37;
    font-size: .92rem;
}

.relationship-map-toolbar span {
    color: #64748b;
    font-size: .7rem;
    margin-top: .15rem;
}

.relationship-map-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .42rem;
    justify-content: flex-end;
}

.relationship-map-actions button {
    align-items: center;
    background: #f7faf9;
    border: 1px solid #d5e1dd;
    border-radius: 9px;
    color: #315f54;
    cursor: pointer;
    display: inline-flex;
    font-size: .7rem;
    font-weight: 700;
    gap: .35rem;
    padding: .48rem .62rem;
}

.relationship-map-actions button:hover {
    background: #e8f2ee;
    border-color: #a8c5bb;
}

.relationship-map-canvas {
    background:
        radial-gradient(
            circle at 1px 1px,
            rgba(59, 101, 91, .12) 1px,
            transparent 0
        );
    background-color: #fbfdfc;
    background-size: 22px 22px;
    flex: 1 1 auto;
    min-height: 530px;
    position: relative;
}

.relationship-map-canvas::before {
    color: rgba(49, 95, 84, .05);
    content: "CONATRADEC";
    font-size: clamp(3rem, 9vw, 8rem);
    font-weight: 900;
    left: 50%;
    letter-spacing: .12em;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
}

.relationship-map-legend {
    align-items: center;
    border-top: 1px solid #dce6e2;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1rem;
    padding: .7rem .9rem;
}

.relationship-map-legend span {
    align-items: center;
    color: #64748b;
    display: inline-flex;
    font-size: .67rem;
    gap: .35rem;
}

.relationship-map-legend i {
    background: #e2e8f0;
    border: 2px solid #94a3b8;
    border-radius: 5px;
    height: 12px;
    width: 18px;
}

.relationship-map-legend i.correct {
    background: #dcfce7;
    border-color: #16a34a;
}

.relationship-map-legend i.information {
    background: #e0f2fe;
    border-color: #0284c7;
}

.relationship-map-legend i.offline {
    background: #f3e8ff;
    border-color: #9333ea;
}

.relationship-map-legend i.neutral {
    background: #f1f5f9;
    border-color: #94a3b8;
    border-style: dashed;
}

.relationship-map-legend i.warning {
    background: #fef3c7;
    border-color: #d97706;
}

.relationship-map-legend i.inactive {
    background: #fee2e2;
    border-color: #dc2626;
}

.relationship-node-detail {
    display: flex;
    flex-direction: column;
    min-height: 650px;
    overflow: hidden;
    padding: 0;
}

.relationship-detail-empty {
    align-items: center;
    color: #64748b;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.relationship-detail-empty > i {
    align-items: center;
    background: #e8f2ee;
    border-radius: 18px;
    color: #315f54;
    display: flex;
    font-size: 1.5rem;
    height: 58px;
    justify-content: center;
    margin-bottom: .65rem;
    width: 58px;
}

.relationship-detail-empty h2 {
    color: #1f3f37;
    font-size: 1rem;
    margin: 0;
}

.relationship-detail-empty p {
    font-size: .75rem;
    line-height: 1.5;
    margin: .4rem 0 0;
}

.relationship-node-detail-header {
    background: linear-gradient(135deg, #315f54, #3b655b);
    color: #ffffff;
    padding: 1rem;
}

.relationship-node-detail-header > span {
    color: #d8ebe4;
    display: block;
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.relationship-node-detail-header h2 {
    color: #ffffff;
    font-size: 1.05rem;
    margin: .25rem 0 .15rem;
}

.relationship-node-detail-header p {
    color: #e6f2ee;
    font-size: .72rem;
    margin: 0 0 .6rem;
}

.relationship-node-state {
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 999px;
    display: inline-flex;
    font-size: .64rem;
    padding: .28rem .5rem;
}

.relationship-node-state.correct {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

.relationship-node-state.information {
    background: #e0f2fe;
    border-color: #7dd3fc;
    color: #075985;
}

.relationship-node-state.offline {
    background: #f3e8ff;
    border-color: #d8b4fe;
    color: #6b21a8;
}

.relationship-node-state.warning {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #92400e;
}

.relationship-node-state.inactive {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

.relationship-node-state.neutral {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}

.relationship-node-detail-body {
    display: grid;
    gap: .42rem;
    overflow: auto;
    padding: .8rem;
}

.relationship-detail-row {
    background: #f6f9f8;
    border: 1px solid #e2ebe7;
    border-radius: 9px;
    padding: .55rem .62rem;
}

.relationship-detail-row span,
.relationship-detail-row strong {
    display: block;
}

.relationship-detail-row span {
    color: #64748b;
    font-size: .64rem;
}

.relationship-detail-row strong {
    color: #294c44;
    font-size: .76rem;
    line-height: 1.35;
    margin-top: .12rem;
    overflow-wrap: anywhere;
}

.relationship-detail-no-data {
    color: #64748b;
    font-size: .74rem;
    padding: 1rem;
    text-align: center;
}

.relationship-node-detail > footer {
    align-items: center;
    border-top: 1px solid #dce6e2;
    color: #64748b;
    display: flex;
    font-size: .65rem;
    gap: .35rem;
    margin-top: auto;
    padding: .65rem .8rem;
}

.relationship-map-action {
    color: #315f54;
}

@media (max-width: 1180px) {
    .relationship-summary-bar {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .relationship-map-workspace {
        grid-template-columns: minmax(0, 1fr) 290px;
    }
}

@media (max-width: 880px) {
    .relationship-summary-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .relationship-map-workspace {
        grid-template-columns: 1fr;
    }

    .relationship-node-detail {
        min-height: 330px;
    }
}

@media (max-width: 620px) {
    .relationship-summary-bar {
        grid-template-columns: 1fr;
    }

    .relationship-map-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .relationship-map-actions {
        justify-content: flex-start;
        width: 100%;
    }

    .relationship-map-actions button {
        flex: 1 1 auto;
        justify-content: center;
    }

    .relationship-map-canvas {
        min-height: 470px;
    }

    .relationship-map-main {
        min-height: 590px;
    }
}


.relationship-detail-toggle {
    align-items: center;
    background: #eef6f3;
    border: 0;
    border-bottom: 1px solid #dce8e3;
    color: #315f54;
    cursor: pointer;
    display: flex;
    font-size: .72rem;
    font-weight: 800;
    gap: .45rem;
    justify-content: center;
    padding: .72rem .85rem;
    width: 100%;
}

.relationship-detail-toggle:hover {
    background: #dfeee8;
    color: #21483f;
}

.relationship-detail-toggle:focus-visible {
    outline: 3px solid rgba(242, 201, 76, .55);
    outline-offset: -3px;
}
