/**
 * Unified Views Stylesheet
 *
 * Consistent styling for all entity views (capabilities, applications, processes)
 * REDESIGNED: Modern SaaS aesthetic with entity-specific colors
 */

/* ============================================
   CSS CUSTOM PROPERTIES (Entity Colors)
   ============================================ */
:root {
    --entity-capability: #10B981;
    --entity-capability-bg: #D1FAE5;
    --entity-application: #8B5CF6;
    --entity-application-bg: #EDE9FE;
    --entity-process: #06B6D4;
    --entity-process-bg: #CFFAFE;
    --entity-interface: #F59E0B;
    --entity-interface-bg: #FEF3C7;
}

/* ============================================
   UNIFIED LIST VIEW
   ============================================ */

.unified-list {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #f8fafc;
}

.unified-list__header {
    padding: 1.5rem;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.unified-list__header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.unified-list__title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.unified-list__title-icon {
    width: 1.5rem;
    height: 1.5rem;
    color: #3b82f6;
}

.unified-list__count {
    padding: 0.25rem 0.75rem;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.unified-list__controls {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.unified-list__search {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.unified-list__search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    color: #64748b;
    pointer-events: none;
}

.unified-list__search-input {
    width: 100%;
    padding: 0.625rem 0.75rem 0.625rem 2.5rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.unified-list__search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.unified-list__filter,
.unified-list__sort {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 0.625rem 2.5rem 0.625rem 0.875rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #334155;
    background-color: white;
    background-image:
        linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(248,250,252,0.6) 100%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2364748b'%3E%3Cpath fill-rule='evenodd' d='M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat, no-repeat;
    background-position: 0 0, right 0.625rem center;
    background-size: 100% 100%, 1.125rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 140px;
}

.unified-list__filter:hover,
.unified-list__sort:hover {
    border-color: #93c5fd;
    background-color: #f8fafc;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.08);
}

.unified-list__filter:focus,
.unified-list__sort:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
    background-image:
        linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(248,250,252,0.6) 100%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%233b82f6'%3E%3Cpath fill-rule='evenodd' d='M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z' clip-rule='evenodd'/%3E%3C/svg%3E");
}

.unified-list__filter option,
.unified-list__sort option {
    padding: 0.5rem 0.75rem;
    font-weight: 450;
    background-color: white;
}

.unified-list__container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.unified-list__item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    transition: all 0.2s;
    cursor: pointer;
}

.unified-list__item:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.unified-list__item-checkbox {
    display: flex;
    align-items: center;
}

.unified-list__checkbox {
    width: 1.125rem;
    height: 1.125rem;
    cursor: pointer;
}

.unified-list__item-icon {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 0.5rem;
    color: white;
}

.unified-list__item-icon svg {
    width: 1.5rem;
    height: 1.5rem;
}

.unified-list__item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.unified-list__item-main {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.unified-list__item-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.unified-list__item-subtitle {
    font-size: 0.8125rem;
    color: #64748b;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.unified-list__item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.unified-list__badge {
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    background: #e0f2fe;
    color: #0369a1;
}

.unified-list__badge--success {
    background: #dcfce7;
    color: #15803d;
}

.unified-list__badge--info {
    background: #dbeafe;
    color: #1d4ed8;
}

.unified-list__badge--warning {
    background: #fef3c7;
    color: #b45309;
}

.unified-list__badge--danger {
    background: #fee2e2;
    color: #b91c1c;
}

.unified-list__badge--neutral {
    background: #f1f5f9;
    color: #475569;
}

.unified-list__tag {
    padding: 0.1875rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 500;
    background: #f1f5f9;
    color: #475569;
}

.unified-list__tag--more {
    background: #e2e8f0;
    color: #64748b;
}

.unified-list__stat {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #64748b;
}

.unified-list__stat svg {
    width: 0.875rem;
    height: 0.875rem;
}

.unified-list__item-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
    flex-shrink: 0;
}

.unified-list__item-action {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 0.375rem;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.unified-list__item-action:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    background: #eff6ff;
}

.unified-list__item-action svg {
    width: 1.125rem;
    height: 1.125rem;
}

.unified-list__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.unified-list__empty-icon {
    width: 4rem;
    height: 4rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
}

.unified-list__empty-text {
    font-size: 1rem;
    color: #64748b;
    margin: 0;
}

.unified-list__bulk-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: #eff6ff;
    border-bottom: 1px solid #bfdbfe;
}

.unified-list__bulk-info {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1e40af;
}

.unified-list__bulk-buttons {
    display: flex;
    gap: 0.5rem;
}

.unified-list__bulk-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #3b82f6;
    background: #3b82f6;
    color: white;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.unified-list__bulk-btn:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.unified-list__bulk-btn--danger {
    background: #ef4444;
    border-color: #ef4444;
}

.unified-list__bulk-btn--danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

/* ============================================
   RELATIONS EXPLORER - Compact LeanIX Style
   ============================================ */

.rel-explorer {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
}

.rel-explorer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.rel-explorer__title {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
}

.rel-explorer__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: #3b82f6;
    color: white;
    border-radius: 11px;
    font-size: 11px;
    font-weight: 600;
}

.rel-explorer__grid {
    display: flex;
    flex-direction: column;
}

.rel-explorer__empty {
    padding: 24px;
    text-align: center;
}

.rel-explorer__empty-text {
    font-size: 12px;
    color: #94a3b8;
}

/* Relation Row - Each entity type group */
.rel-explorer__row {
    display: flex;
    flex-direction: column;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
}

.rel-explorer__row:last-child {
    border-bottom: none;
}

.rel-explorer__row-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.rel-explorer__row-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--rel-bg);
    color: var(--rel-color);
}

.rel-explorer__row-icon svg {
    width: 14px;
    height: 14px;
}

.rel-explorer__row-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--rel-color);
    flex: 1;
}

.rel-explorer__row-count {
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 10px;
}

/* Chips container */
.rel-explorer__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Individual clickable chip */
.rel-explorer__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--rel-bg);
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    max-width: 180px;
}

.rel-explorer__chip:hover {
    border-color: var(--rel-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.rel-explorer__chip-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.rel-explorer__chip-name {
    font-size: 11px;
    font-weight: 500;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rel-explorer__chip-rating {
    font-size: 9px;
    font-weight: 700;
    color: white;
    padding: 1px 4px;
    border-radius: 3px;
    flex-shrink: 0;
}

.rel-explorer__chip-protocol {
    font-size: 9px;
    font-weight: 600;
    color: #64748b;
    background: white;
    padding: 1px 5px;
    border-radius: 3px;
    flex-shrink: 0;
}

.rel-explorer__more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    background: #f1f5f9;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.rel-explorer__more:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    background: #eff6ff;
}

/* Responsive */
@media (max-width: 640px) {
    .rel-explorer__chip {
        max-width: 100%;
        flex: 1 1 calc(50% - 3px);
    }
}

/* ============================================
   RELATIONS EXPLORER - Flat Badge Style
   ============================================ */

.rel-flat {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 0;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

/* Center Node - Current Entity */
.rel-flat__center {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--center-bg);
    border: 2px solid var(--center-color);
    border-radius: 10px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.rel-flat__center-icon {
    width: 18px;
    height: 18px;
    color: var(--center-color);
    flex-shrink: 0;
}

.rel-flat__center-name {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Badges Container */
.rel-flat__badges {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}

/* Badge Wrapper (contains badge + dropdown) */
.rel-flat__badge-wrapper {
    position: relative;
}

/* Badge Button */
.rel-flat__badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.rel-flat__badge:hover {
    border-color: var(--badge-color);
    background: var(--badge-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.rel-flat__badge-icon {
    width: 16px;
    height: 16px;
    color: var(--badge-color);
    flex-shrink: 0;
}

.rel-flat__badge-label {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}

.rel-flat__badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--badge-bg);
    color: var(--badge-color);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

.rel-flat__badge-arrow {
    width: 14px;
    height: 14px;
    color: #94a3b8;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

/* Dropdown (Hidden by default) */
.rel-flat__dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 100;
    min-width: 220px;
    max-width: 280px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    background: white;
    border: 1.5px solid var(--badge-color, #e2e8f0);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Expanded State */
.rel-flat__badge-wrapper.expanded .rel-flat__badge {
    border-color: var(--badge-color);
    background: var(--badge-bg);
}

.rel-flat__badge-wrapper.expanded .rel-flat__badge-arrow {
    transform: rotate(180deg);
}

.rel-flat__badge-wrapper.expanded .rel-flat__dropdown {
    max-height: 300px;
    overflow-y: auto;
    opacity: 1;
    padding: 8px;
}

/* Individual Item in Dropdown */
.rel-flat__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.rel-flat__item:hover {
    background: white;
    border-color: var(--badge-color, #e2e8f0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.rel-flat__item-name {
    font-size: 12px;
    font-weight: 500;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.rel-flat__item-status {
    font-size: 9px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 640px) {
    .rel-flat {
        flex-direction: column;
        align-items: stretch;
    }

    .rel-flat__center {
        width: 100%;
        justify-content: center;
    }

    .rel-flat__badges {
        justify-content: center;
    }

    .rel-flat__dropdown {
        left: 50%;
        transform: translateX(-50%);
    }

    .rel-flat__badge-wrapper.expanded .rel-flat__dropdown {
        transform: translateX(-50%);
    }
}

/* ============================================
   RELATIONS EXPLORER - Horizontal LeanIX Style (Legacy)
   ============================================ */

.rel-h {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 0;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.rel-h__center {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--center-bg);
    border: 2px solid var(--center-color);
    border-radius: 10px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.rel-h__center-icon {
    width: 18px;
    height: 18px;
    color: var(--center-color);
    flex-shrink: 0;
}

.rel-h__center-name {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rel-h__groups {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}

.rel-h__group {
    position: relative;
}

.rel-h__connector {
    display: none;
}

.rel-h__trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.rel-h__trigger:hover {
    border-color: var(--group-color);
    background: var(--group-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.rel-h__trigger-icon {
    width: 16px;
    height: 16px;
    color: var(--group-color);
    flex-shrink: 0;
}

.rel-h__trigger-label {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}

.rel-h__trigger-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--group-bg);
    color: var(--group-color);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

.rel-h__trigger-arrow {
    width: 14px;
    height: 14px;
    color: #94a3b8;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.rel-h__items {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 100;
    min-width: 220px;
    max-width: 280px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    background: white;
    border: 1.5px solid var(--group-color, #e2e8f0);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rel-h__group.expanded .rel-h__trigger {
    border-color: var(--group-color);
    background: var(--group-bg);
}

.rel-h__group.expanded .rel-h__trigger-arrow {
    transform: rotate(180deg);
}

.rel-h__group.expanded .rel-h__items {
    max-height: 300px;
    overflow-y: auto;
    opacity: 1;
    padding: 8px;
}

.rel-h__item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.rel-h__item:hover {
    background: white;
    border-color: var(--group-color, #e2e8f0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.rel-h__item-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.rel-h__item-name {
    font-size: 12px;
    font-weight: 500;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   RELATIONSHIP CARDS (NEW)
   ============================================ */

.relationship-section {
    margin-bottom: 24px;
}

.relationship-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.relationship-section__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.relationship-section__title-icon {
    width: 18px;
    height: 18px;
    color: #64748b;
}

.relationship-section__count {
    padding: 2px 8px;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.relationship-section__add-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: transparent;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.relationship-section__add-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    background: #eff6ff;
}

.relationship-section__add-btn svg {
    width: 14px;
    height: 14px;
}

.relationship-section__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.relationship-section__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Relationship Card (Generic) */
.rel-card {
    --card-color: var(--entity-application);
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rel-card:hover {
    border-color: var(--card-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.rel-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.rel-card__title {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    line-height: 1.3;
}

.rel-card__status {
    flex-shrink: 0;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.rel-card__status--active {
    background: #dcfce7;
    color: #15803d;
}

.rel-card__status--transition {
    background: #fef3c7;
    color: #b45309;
}

.rel-card__status--deprecated {
    background: #fee2e2;
    color: #b91c1c;
}

.rel-card__status--planned {
    background: #dbeafe;
    color: #1d4ed8;
}

.rel-card__status--tbd {
    background: #f1f5f9;
    color: #64748b;
}

.rel-card__ratings {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rel-card__rating {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rel-card__rating-label {
    font-size: 10px;
    color: #64748b;
    min-width: 60px;
}

.rel-card__rating-bar {
    flex: 1;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.rel-card__rating-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.rel-card__rating-fill--1 { width: 20%; background: #ef4444; }
.rel-card__rating-fill--2 { width: 40%; background: #f59e0b; }
.rel-card__rating-fill--3 { width: 60%; background: #eab308; }
.rel-card__rating-fill--4 { width: 80%; background: #84cc16; }
.rel-card__rating-fill--5 { width: 100%; background: #10b981; }

.rel-card__rating-value {
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    min-width: 12px;
    text-align: right;
}

.rel-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.rel-card__chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: #f1f5f9;
    border-radius: 4px;
    font-size: 10px;
    color: #64748b;
}

.rel-card__chip svg {
    width: 12px;
    height: 12px;
}

.rel-card__chip--highlight {
    background: var(--entity-interface-bg);
    color: var(--entity-interface);
}

/* Application Card Specific */
.rel-card--application {
    --card-color: var(--entity-application);
}

.rel-card--application .rel-card__title::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--entity-application);
    border-radius: 2px;
    margin-right: 8px;
}

/* Process Card Specific */
.rel-card--process {
    --card-color: var(--entity-process);
}

.rel-card--process .rel-card__title::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--entity-process);
    border-radius: 2px;
    margin-right: 8px;
}

/* Interface Card Specific */
.rel-card--interface {
    --card-color: var(--entity-interface);
    flex-direction: row;
    align-items: center;
    padding: 12px 14px;
}

.rel-card--interface .rel-card__icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--entity-interface-bg);
    border-radius: 6px;
    color: var(--entity-interface);
}

.rel-card--interface .rel-card__icon svg {
    width: 18px;
    height: 18px;
}

.rel-card--interface .rel-card__content {
    flex: 1;
    min-width: 0;
}

.rel-card--interface .rel-card__title {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rel-card--interface .rel-card__title::before {
    display: none;
}

.rel-card--interface .rel-card__flow {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}

.rel-card--interface .rel-card__flow svg {
    width: 12px;
    height: 12px;
    color: #94a3b8;
}

.rel-card--interface .rel-card__protocol {
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
}

/* Protocol Colors */
.rel-card__protocol--rest {
    background: #dcfce7;
    color: #15803d;
}

.rel-card__protocol--soap {
    background: #dbeafe;
    color: #1d4ed8;
}

.rel-card__protocol--idoc {
    background: #fef3c7;
    color: #b45309;
}

.rel-card__protocol--file {
    background: #f1f5f9;
    color: #475569;
}

.rel-card__protocol--default {
    background: #f1f5f9;
    color: #64748b;
}

/* Empty State for Relationship Section */
.relationship-section__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    background: #f8fafc;
    border: 1px dashed #e2e8f0;
    border-radius: 10px;
    text-align: center;
}

.relationship-section__empty-icon {
    width: 40px;
    height: 40px;
    color: #cbd5e1;
    margin-bottom: 8px;
}

.relationship-section__empty-text {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

/* ============================================
   STATUS BADGES (GLOBAL)
   ============================================ */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-badge--active,
.status-badge--Zielsystem,
.status-badge--aktiv {
    background: #dcfce7;
    color: #15803d;
}

.status-badge--transition,
.status-badge--Transition,
.status-badge--Migration {
    background: #fef3c7;
    color: #b45309;
}

.status-badge--deprecated,
.status-badge--Abloesung,
.status-badge--sunset {
    background: #fee2e2;
    color: #b91c1c;
}

.status-badge--planned,
.status-badge--geplant {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-badge--tbd,
.status-badge--offen {
    background: #f1f5f9;
    color: #64748b;
}

.status-positive {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    background: #dcfce7;
    color: #15803d;
}

.status-warning {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    background: #fef3c7;
    color: #b45309;
}

/* ============================================
   RATING BARS (VISUAL INDICATORS)
   ============================================ */

.rating-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rating-bar__label {
    font-size: 11px;
    color: #64748b;
    min-width: 80px;
}

.rating-bar__track {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.rating-bar__fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.rating-bar__fill--excellent { background: linear-gradient(90deg, #10b981, #059669); }
.rating-bar__fill--good { background: linear-gradient(90deg, #84cc16, #65a30d); }
.rating-bar__fill--moderate { background: linear-gradient(90deg, #eab308, #ca8a04); }
.rating-bar__fill--poor { background: linear-gradient(90deg, #f59e0b, #d97706); }
.rating-bar__fill--critical { background: linear-gradient(90deg, #ef4444, #dc2626); }

.rating-bar__value {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    min-width: 20px;
    text-align: right;
}

/* ============================================
   LIFECYCLE PHASE EDITOR
   ============================================ */

.lifecycle-phases-editor {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lifecycle-phase-editor {
    padding: 12px 16px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    background: white;
    transition: all 0.15s ease;
}

.lifecycle-phase-editor:hover {
    border-color: #cbd5e1;
}

.lifecycle-phase-editor.active {
    border-color: var(--phase-color);
    background: color-mix(in srgb, var(--phase-color) 5%, white);
}

.lifecycle-phase-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lifecycle-phase-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.lifecycle-phase-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--phase-color);
}

.lifecycle-phase-editor .lifecycle-phase-dates {
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
    margin-top: 8px;
}

.lifecycle-phase-editor .lifecycle-phase-dates.hidden {
    display: none;
}

.lifecycle-phase-editor .lifecycle-phase-dates input[type="date"] {
    font-size: 0.875rem;
}

.lifecycle-phase-editor .lifecycle-phase-dates input[type="date"]:focus {
    outline: 2px solid var(--phase-color);
    outline-offset: 1px;
    border-color: var(--phase-color);
}

/* ============================================
   LIFECYCLE PHASES TIMELINE DISPLAY
   ============================================ */

.lifecycle-phases-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-left: 20px;
}

.lifecycle-phase-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
    padding: 8px 0;
}

.lifecycle-phase-item::before {
    content: '';
    position: absolute;
    left: -14px;
    top: 20px;
    bottom: -8px;
    width: 2px;
    background: var(--phase-color, #e2e8f0);
    opacity: 0.3;
}

.lifecycle-phase-item:last-child::before {
    display: none;
}

.lifecycle-phase-marker {
    position: relative;
    z-index: 1;
    margin-left: -26px;
}

.lifecycle-phase-content {
    flex: 1;
}

.lifecycle-phase-header {
    margin-bottom: 2px;
}

/* ============================================
   LIFECYCLE STATE SELECTOR (Legacy)
   ============================================ */

.lifecycle-state-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    background: white;
    cursor: pointer;
    transition: all 0.15s ease;
}

.lifecycle-state-btn:hover {
    border-color: var(--state-color);
    background: color-mix(in srgb, var(--state-color) 10%, white);
}

.lifecycle-state-btn.active {
    border-color: var(--state-color);
    background: color-mix(in srgb, var(--state-color) 15%, white);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--state-color) 20%, transparent);
}

.lifecycle-state-btn.active span:last-child {
    color: var(--state-color);
    font-weight: 600;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .unified-list__header {
        padding: 1rem;
    }

    .unified-list__controls {
        flex-direction: column;
    }

    .unified-list__search {
        min-width: auto;
    }

    .unified-list__item {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .unified-list__item-content {
        flex-basis: 100%;
    }

    .unified-list__item-actions {
        margin-left: 0;
    }

    .relationship-section__grid {
        grid-template-columns: 1fr;
    }

    .rel-card--interface {
        flex-direction: column;
        align-items: flex-start;
    }

    .rel-card--interface .rel-card__protocol {
        margin-top: 8px;
    }
}

/* ============================================
   LEANIX-STYLE RELATIONS EXPLORER
   Full visualization with SVG paths and navigation
   ============================================ */

.leanix-re {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: visible;
}

/* Breadcrumb Navigation */
.leanix-re__breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 13px;
    flex-wrap: wrap;
}

.leanix-re__nav-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    color: #64748b;
    font-size: 16px;
    transition: all 0.15s;
    flex-shrink: 0;
}

.leanix-re__nav-btn:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #3b82f6;
}

.leanix-re__nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.leanix-re__breadcrumb-path {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.leanix-re__path {
    color: #3b82f6;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.15s;
}

.leanix-re__path:hover {
    text-decoration: underline;
    background: #eff6ff;
}

.leanix-re__path--current {
    color: #1e293b;
    font-weight: 600;
    cursor: default;
    background: transparent;
}

.leanix-re__path--current:hover {
    text-decoration: none;
    background: transparent;
}

.leanix-re__separator {
    color: #94a3b8;
    font-size: 12px;
}

/* Title */
.leanix-re__title {
    padding: 16px 20px 8px;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    text-align: center;
}

/* Graph Container - holds SVG and layout */
.leanix-re__graph {
    position: relative;
    min-height: 120px;
    padding: 20px 16px;
    overflow: visible;
}

/* SVG Layer for connection paths - positioned absolutely over the layout */
.leanix-re__svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
    z-index: 1;
}

.leanix-re__svg-path {
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    transition: stroke 0.2s ease;
}

/* Layout Container - horizontal flex layout */
.leanix-re__layout {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 20px;
    position: relative;
    z-index: 2;
    padding-top: 10px;
}

/* Column containers */
.leanix-re__column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.leanix-re__column--left {
    align-items: flex-end;
    min-width: 100px;
}

.leanix-re__column--center {
    align-items: center;
    flex-shrink: 0;
}

.leanix-re__column--right {
    align-items: flex-start;
    min-width: 100px;
}

/* Expanded columns for horizontal expansion - now inline in flow */
.leanix-re__expanded-column {
    display: none;
    flex-direction: column;
    gap: 6px;
    z-index: 3;
}

.leanix-re__expanded-column.active {
    display: flex;
}

.leanix-re__expanded-column--left {
    order: -1;
    align-items: flex-end;
}

.leanix-re__expanded-column--right {
    order: 10;
    align-items: flex-start;
}

/* Entity Card (Center) */
.leanix-re__entity-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: white;
    border: 2px solid var(--entity-color, #3b82f6);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    cursor: default;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.leanix-re__entity-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--entity-bg, #EFF6FF);
    border-radius: 8px;
    flex-shrink: 0;
}

.leanix-re__entity-icon svg {
    width: 20px;
    height: 20px;
    color: var(--entity-color, #3b82f6);
}

.leanix-re__entity-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--entity-color, #3b82f6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.leanix-re__entity-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* Badge Node - wrapper for badge button */
.leanix-re__badge-node {
    position: relative;
}

/* Badge Button */
.leanix-re__badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: white;
    border: 2px solid var(--badge-color, #e2e8f0);
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
}

.leanix-re__badge:hover {
    background: var(--badge-bg, #f8fafc);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: scale(1.03);
}

.leanix-re__badge-node.expanded .leanix-re__badge {
    background: var(--badge-bg, #f8fafc);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border-width: 2.5px;
}

.leanix-re__badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    background: var(--badge-color, #3b82f6);
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
}

.leanix-re__badge-label {
    font-size: 13px;
    font-weight: 500;
    color: #475569;
}

/* Expanded Item - shown when badge is clicked */
.leanix-re__expanded-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border: 2px solid var(--item-color, #e2e8f0);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
    max-width: 180px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.leanix-re__expanded-item:hover {
    background: var(--item-bg, #f8fafc);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: scale(1.02);
}

.leanix-re__item-name {
    font-size: 12px;
    font-weight: 500;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.leanix-re__item-status {
    font-size: 9px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Empty state when no relations */
.leanix-re__empty {
    text-align: center;
    padding: 32px 20px;
    color: #64748b;
}

.leanix-re__empty-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    color: #cbd5e1;
}

.leanix-re__empty-text {
    font-size: 13px;
    margin: 0;
}

/* Responsive Adjustments */
@media (max-width: 900px) {
    .leanix-re__layout {
        flex-direction: column;
        gap: 30px;
    }

    .leanix-re__column--left,
    .leanix-re__column--right {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        min-width: auto;
    }

    .leanix-re__expanded-column {
        position: relative;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        transform: none !important;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        margin-top: 16px;
    }

    .leanix-re__svg {
        display: none;
    }
}

@media (max-width: 600px) {
    .leanix-re__graph {
        padding: 16px 12px;
        min-height: 180px;
    }

    .leanix-re__entity-name {
        max-width: 140px;
        font-size: 12px;
    }

    .leanix-re__badge {
        padding: 8px 12px;
    }

    .leanix-re__badge-count {
        min-width: 20px;
        height: 20px;
        font-size: 10px;
    }

    .leanix-re__badge-label {
        font-size: 11px;
    }

    .leanix-re__breadcrumb {
        padding: 10px 12px;
        font-size: 12px;
    }

    .leanix-re__title {
        font-size: 14px;
        padding: 12px 16px 6px;
    }

    .leanix-re__expanded-item {
        min-width: 120px;
        padding: 8px 10px;
    }

    .leanix-re__item-name {
        font-size: 11px;
    }
}
