﻿/* ==========================================================================
   FID.Compass DETAIL PAGES – Wiederverwendbare Komponenten-Bibliothek
   ==========================================================================
   
   Nutzt die Design-System-Tokens aus design-system.css und colors-only.css.
   Harmonisch mit dem gesamten FID.Compass-System (Cards, Sidebar, Dashboard).
   
   Komponenten:
   1. Layout       – .detail-container, .content-area
   2. Header       – .content-header, .editor-btn
   3. Section      – .field-section, .detail-section
   4. Field Row    – .field-row, .field-label, .field-value
   5. Tags         – .tech-tags, .tech-tag
   6. Empty State  – .empty-state
   7. Tabs         – .tab-pane, .tab-content
   8. Responsive
   9. Print
   
   Version: 2026.02.18
   ========================================================================== */


/* ==========================================================================
   1. LAYOUT
   Flex-Container mit Sidebar + Hauptbereich.
   Transparent — Seitenhintergrund scheint durch.
   ========================================================================== */

/* Focus styles are now handled centrally in design-system.css */

.detail-container {
    display: flex;
    gap: 0;
    min-height: calc(100vh - 180px);
    background: transparent;
}

.content-area {
    flex: 1;
    min-width: 0;
    background: transparent;
    overflow-x: hidden;
    overflow-y: auto;
}

.tab-content {
    min-height: 400px;
}


/* ==========================================================================
   2. CONTENT HEADER
   Titelzeile mit Editor-Button.
   Wiederverwendbar in jeder Tab-Pane.
   ========================================================================== */

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-6, 1.5rem) var(--space-8, 2rem);
    background: transparent;
    border-bottom: 2px solid var(--border-light, #e5e7eb);
}

.content-header h2 {
    margin: 0;
    font-family: var(--font-family-primary, 'Inter', 'Segoe UI', sans-serif);
    font-size: var(--font-size-2xl, 1.5rem);
    font-weight: var(--font-weight-semibold, 600);
    line-height: 1.3;
    color: var(--text-primary, #111827);
    display: flex;
    align-items: center;
    gap: var(--space-3, 0.75rem);
}

/* Enforce identical title metrics across all FID detail panes. */
.tab-pane > .content-header {
    min-height: 4.75rem;
    align-items: center;
    padding-top: 0;
    padding-bottom: 0;
}

.tab-pane > .content-header > h2 {
    padding: var(--space-6, 1.5rem) 0 !important;
    margin: 0 !important;
    font-size: var(--font-size-2xl, 1.5rem) !important;
    font-weight: var(--font-weight-semibold, 600) !important;
    line-height: 1.3 !important;
    align-self: center;
}

.content-header h2 i {
    color: var(--primary-color, #00618F);
    font-size: 1.25rem;
}

/* Editor Button — dezent, Outline-Style, harmonisch zum System */
.editor-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2, 0.5rem);
    padding: var(--space-2, 0.5rem) var(--space-4, 1rem);
    background: transparent;
    color: var(--text-secondary, #374151);
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: var(--radius-md, 6px);
    font-family: var(--font-family-primary, 'Inter', 'Segoe UI', sans-serif);
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: var(--font-weight-medium, 500);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast, 150ms ease);
    white-space: nowrap;
}

.editor-btn:hover {
    background: var(--gray-100, #f3f4f6);
    color: var(--text-primary, #111827);
    border-color: var(--gray-300, #d1d5db);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: none;
}

.editor-btn:active {
    transform: translateY(0);
    box-shadow: none;
    background: var(--gray-200, #e5e7eb);
}

.editor-btn:focus,
.editor-btn:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

.editor-btn i {
    font-size: 0.9rem;
    color: var(--text-muted, #6b7280);
}


/* ==========================================================================
   3. FIELD SECTION
   Gruppiert zusammengehörige Felder (Card-Style).
   Wiederverwendbar über alle Bereiche.
   ========================================================================== */

.field-section {
    background: transparent;
    border: none !important;
    border-radius: 0;
    padding: var(--space-6, 1.5rem);
    margin-bottom: var(--space-6, 1.5rem);
    box-shadow: none !important;
}

.field-section:last-child {
    margin-bottom: 0;
}

/* Section Title – Brand-Farbe als Akzent */
.field-section h4,
.field-section h5,
.field-section h6 {
    margin: 0 0 var(--space-4, 1rem);
    padding-bottom: var(--space-3, 0.75rem);
    border-bottom: 2px solid var(--border-light, #e5e7eb);
    font-family: var(--font-family-primary, 'Inter', 'Segoe UI', sans-serif);
    font-size: var(--font-size-lg, 1.125rem);
    font-weight: var(--font-weight-semibold, 600);
    line-height: 1.4;
    color: var(--primary-color, #00618F);
    display: flex;
    align-items: center;
    gap: var(--space-2, 0.5rem);
}

.field-section h4 i,
.field-section h5 i,
.field-section h6 i {
    color: var(--primary-hover, #327EBB);
    font-size: 1.1rem;
}

/* Legacy alias – ältere Templates (detail_step*.html) */
.detail-section {
    background: transparent;
    border-radius: var(--radius-xl, 12px);
    padding: var(--space-6, 1.5rem);
    margin-bottom: var(--space-6, 1.5rem);
}

.detail-section-header {
    display: flex;
    align-items: center;
    gap: var(--space-3, 0.75rem);
    margin-bottom: var(--space-5, 1.25rem);
    padding-bottom: var(--space-3, 0.75rem);
    border-bottom: 2px solid var(--border-light, #e5e7eb);
}

.detail-section-header h3,
.detail-section-header h4 {
    margin: 0;
    font-family: var(--font-family-primary, 'Inter', 'Segoe UI', sans-serif);
    font-weight: var(--font-weight-semibold, 600);
    color: var(--text-primary, #111827);
}

.detail-section-header i {
    color: var(--primary-color, #00618F);
    font-size: 1.25rem;
}


/* ==========================================================================
   4. FIELD ROW
   Key-Value-Paar: Label links, Wert rechts.
   Basis-Baustein für alle Detailansichten.
   ========================================================================== */

.field-row {
    display: flex;
    align-items: flex-start;
    padding: var(--space-3, 0.75rem) 0;
    border-bottom: 1px solid var(--gray-100, #f3f4f6);
    gap: var(--space-4, 1rem);
}

.field-row.detail-list-row {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color, #d1d5db);
}

.field-row.detail-list-row:first-child {
    padding-top: 0.5rem;
}

.field-row.detail-list-row:last-child {
    padding-bottom: 0.5rem;
    border-bottom: none;
}

.field-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.field-row:first-child {
    padding-top: 0;
}

/* Portal pane: ensure visible separators between portal software entries */
.portal-software-entry {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color, #d1d5db);
}

.portal-software-entry:last-child {
    border-bottom: none;
}

.portal-software-entry .field-row {
    border-bottom: none;
    padding: 0;
}

.portal-software-entry .portal-software-extensions-row {
    margin-top: 0.35rem;
}

.portal-software-entry .portal-software-version {
    display: inline-block;
    margin-left: 0.5rem;
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: var(--font-weight-medium, 500);
    color: var(--text-muted, #6b7280);
    white-space: nowrap;
}

/* Label – feste Breite, dezent */
.field-label {
    flex: 0 0 180px;
    font-family: var(--font-family-primary, 'Inter', 'Segoe UI', sans-serif);
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: var(--font-weight-medium, 500);
    line-height: 1.5;
    color: var(--text-muted, #6b7280);
    padding-top: 2px;
}

/* Value – flexibler Bereich */
.field-value {
    flex: 1;
    font-family: var(--font-family-primary, 'Inter', 'Segoe UI', sans-serif);
    font-size: var(--font-size-base, 1rem);
    font-weight: var(--font-weight-normal, 400);
    line-height: 1.6;
    color: var(--text-primary, #111827);
    word-break: break-word;
}

.field-value a {
    color: var(--primary-color, #00618F);
    text-decoration: none;
    transition: color var(--transition-fast, 150ms ease);
    outline: none;
}

.field-value a:focus,
.field-value a:active {
    outline: none;
    box-shadow: none;
}

.field-value a:hover {
    color: var(--primary-hover, #327EBB);
    text-decoration: underline;
}

.field-row.detail-list-row--hierarchy {
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
}

.detail-hierarchy-root {
    min-width: 0;
}

.detail-hierarchy-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3, 0.75rem);
    min-width: 0;
}

.detail-hierarchy-term {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2, 0.5rem);
    min-width: 0;
    font-weight: var(--font-weight-normal, 400);
    color: var(--text-primary, #111827);
}

.detail-hierarchy-root .detail-hierarchy-term {
    font-weight: var(--font-weight-semibold, 600);
}

.detail-hierarchy-term > i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 1.8rem;
    height: 1.8rem;
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: var(--radius-md, 6px);
    background: var(--gray-50, #f9fafb);
    color: var(--primary-color, #00618F);
    font-size: 0.95rem;
}

.detail-hierarchy-term .entity-link,
.detail-hierarchy-term > span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.detail-hierarchy-count-badge {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 0.3rem;
    padding: 0.18rem 0.55rem;
    border: 1px solid rgba(53, 123, 92, 0.28);
    border-radius: var(--radius-full, 9999px);
    background: rgba(53, 123, 92, 0.1);
    color: #256844;
    font-size: var(--font-size-xs, 0.75rem);
    font-weight: var(--font-weight-bold, 700);
    line-height: 1.2;
    white-space: nowrap;
}

.detail-hierarchy-children {
    position: relative;
    display: grid;
    gap: 0.4rem;
    margin-top: 0.75rem;
    margin-left: 0.9rem;
    padding-left: 1.1rem;
    border-left: 1px solid var(--border-light, #e5e7eb);
}

.detail-hierarchy-children--nested {
    gap: 0.3rem;
    margin-top: 0.45rem;
    margin-left: 0.35rem;
    padding-left: 0.9rem;
}

.detail-hierarchy-child {
    position: relative;
    min-width: 0;
    padding: 0;
    font-size: var(--font-size-sm, 0.875rem);
    line-height: 1.5;
}

.detail-hierarchy-child::before {
    content: "";
    position: absolute;
    top: 1.05rem;
    left: -1.1rem;
    width: 0.75rem;
    border-top: 1px solid var(--border-light, #e5e7eb);
}

.detail-hierarchy-children--nested .detail-hierarchy-child::before {
    left: -0.9rem;
    width: 0.55rem;
}

.detail-hierarchy-child-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2, 0.5rem);
    min-width: 0;
    padding: 0.38rem 0.55rem;
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: var(--radius-md, 6px);
    background: var(--gray-50, #f9fafb);
    transition: background var(--transition-fast, 150ms ease), border-color var(--transition-fast, 150ms ease);
}

.detail-hierarchy-child-content:hover,
.detail-hierarchy-child:focus-within > .detail-hierarchy-child-content {
    background: var(--white, #ffffff);
    border-color: rgba(0, 97, 143, 0.28);
}

.detail-hierarchy-child-title {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    font-weight: var(--font-weight-medium, 500);
    color: var(--text-primary, #111827);
}

.detail-hierarchy-child-title > i {
    flex: 0 0 auto;
    color: var(--primary-color, #00618F);
    font-size: 0.82rem;
}

.detail-hierarchy-child-title .entity-link,
.detail-hierarchy-child-title > span {
    min-width: 0;
    color: var(--text-primary, #111827);
    overflow-wrap: anywhere;
}

.detail-hierarchy-child-title .entity-link:hover {
    color: var(--primary-color, #00618F);
}

.detail-hierarchy-meta {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    max-width: 12rem;
    padding: 0.12rem 0.45rem;
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: var(--radius-full, 9999px);
    background: var(--white, #ffffff);
    color: var(--text-muted, #6b7280);
    font-size: 0.72rem;
    font-weight: var(--font-weight-semibold, 600);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

html.dark-mode .detail-hierarchy-term > i,
[data-theme="dark"] .detail-hierarchy-term > i {
    background: rgba(118, 194, 224, 0.1);
    border-color: rgba(118, 194, 224, 0.28);
    color: #b9e4f3;
}

html.dark-mode .detail-hierarchy-count-badge,
[data-theme="dark"] .detail-hierarchy-count-badge {
    background: rgba(142, 209, 176, 0.13);
    border-color: rgba(142, 209, 176, 0.35);
    color: #bce9d0;
}

html.dark-mode .detail-hierarchy-children,
html.dark-mode .detail-hierarchy-child::before,
[data-theme="dark"] .detail-hierarchy-children,
[data-theme="dark"] .detail-hierarchy-child::before {
    border-color: rgba(148, 163, 184, 0.28);
}

html.dark-mode .detail-hierarchy-child-content,
[data-theme="dark"] .detail-hierarchy-child-content {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(148, 163, 184, 0.22);
}

html.dark-mode .detail-hierarchy-child-content:hover,
html.dark-mode .detail-hierarchy-child:focus-within > .detail-hierarchy-child-content,
[data-theme="dark"] .detail-hierarchy-child-content:hover,
[data-theme="dark"] .detail-hierarchy-child:focus-within > .detail-hierarchy-child-content {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(118, 194, 224, 0.35);
}

html.dark-mode .detail-hierarchy-child-title > i,
[data-theme="dark"] .detail-hierarchy-child-title > i {
    color: #b9e4f3;
}

html.dark-mode .detail-hierarchy-meta,
[data-theme="dark"] .detail-hierarchy-meta {
    background: rgba(15, 23, 42, 0.5);
    border-color: rgba(148, 163, 184, 0.24);
    color: #cbd5e1;
}

.field-value img {
    border-radius: var(--radius-lg, 8px);
    box-shadow: none;
    max-width: 100%;
    height: auto;
}

/* FID Logo / Bild – begrenzte Größe */
.fid-logo {
    max-width: 200px;
    max-height: 120px;
    border-radius: var(--radius-lg, 8px);
    box-shadow: none;
}


/* ==========================================================================
   5. TECH TAGS
   Technologie-Tags, Formate, Standards.
   Wiederverwendbar – gleiches Design wie item-card.css Tags.
   ========================================================================== */

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2, 0.5rem);
}

.tech-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1, 0.25rem);
    padding: var(--space-1, 0.25rem) var(--space-3, 0.75rem);
    background: linear-gradient(135deg, var(--gray-50, #f9fafb) 0%, var(--gray-100, #f3f4f6) 100%);
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: var(--radius-full, 9999px);
    font-family: var(--font-family-primary, 'Inter', 'Segoe UI', sans-serif);
    font-size: var(--font-size-sm, 0.875rem);
    color: var(--text-secondary, #374151);
    text-decoration: none;
}

.tech-tag i {
    font-size: 0.85rem;
    color: var(--primary-hover, #327EBB);
}

/* Aliases – tags-container/tag-item used in section includes */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2, 0.5rem);
}

.tag-item {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1, 0.25rem);
    padding: var(--space-1, 0.25rem) var(--space-3, 0.75rem);
    background: linear-gradient(135deg, var(--gray-50, #f9fafb) 0%, var(--gray-100, #f3f4f6) 100%);
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: var(--radius-full, 9999px);
    font-family: var(--font-family-primary, 'Inter', 'Segoe UI', sans-serif);
    font-size: var(--font-size-sm, 0.875rem);
    color: var(--text-secondary, #374151);
}

.tag-label {
    line-height: 1.4;
}

.tag-label a {
    color: inherit;
    text-decoration: none;
}

.tag-label a:hover {
    color: var(--primary-color, #00618F);
    text-decoration: underline;
}


/* ==========================================================================
   6. EMPTY STATE
   Platzhalter wenn keine Daten vorhanden.
   Wiederverwendbar in allen Bereichen.
   ========================================================================== */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-12, 3rem) var(--space-6, 1.5rem);
    text-align: center;
    background: transparent;
    border-radius: var(--radius-xl, 12px);
    border: none;
}

.empty-state i {
    font-size: 3rem;
    color: var(--gray-300, #d1d5db);
    margin-bottom: var(--space-4, 1rem);
    opacity: 0.5;
}

.empty-state h3,
.empty-state h5 {
    font-family: var(--font-family-primary, 'Inter', 'Segoe UI', sans-serif);
    font-size: var(--font-size-lg, 1.125rem);
    font-weight: var(--font-weight-medium, 500);
    color: var(--text-muted, #6b7280);
    margin: 0 0 var(--space-2, 0.5rem);
    border-bottom: none;
    padding-bottom: 0;
}

.empty-state p {
    font-family: var(--font-family-primary, 'Inter', 'Segoe UI', sans-serif);
    font-size: var(--font-size-sm, 0.875rem);
    color: var(--text-muted, #6b7280);
    margin: 0 0 var(--space-6, 1.5rem);
    max-width: 400px;
    opacity: 0.8;
}

.empty-state .editor-btn {
    margin-top: 0;
}

.empty-state--hidden-section {
    max-width: 520px;
    margin: var(--space-4, 1rem) auto;
    padding: var(--space-10, 2.5rem) var(--space-6, 1.5rem);
    background: var(--gray-50, #f9fafb);
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: var(--radius-lg, 8px);
}

.empty-state--hidden-section i {
    color: var(--text-muted, #6b7280);
    opacity: 0.65;
}

.empty-state--hidden-section h3 {
    color: var(--text-secondary, #374151);
}

.empty-state--hidden-section p {
    margin-bottom: 0;
    max-width: 440px;
}

.empty-state--loading-section {
    max-width: 520px;
    margin: var(--space-4, 1rem) auto;
    padding: var(--space-10, 2.5rem) var(--space-6, 1.5rem);
}

.empty-state--loading-section i {
    color: var(--primary-color, #00618F);
    opacity: 0.75;
    animation: detail-loading-spin 1s linear infinite;
}

.empty-state--loading-section-error i {
    color: #b91c1c;
    animation: none;
}

@keyframes detail-loading-spin {
    to {
        transform: rotate(360deg);
    }
}


/* ==========================================================================
   7. TABS
   Tab-Panes für Inhalts-Bereiche.
   Gesteuert über .active Klasse (JS toggle).
   ========================================================================== */

/* Tab-Pane Body – einheitliches Innenpadding */
.tab-pane-body {
    padding: var(--space-8, 2rem);
}

.tab-pane {
    display: none;
    background: transparent;
}

.tab-pane.active {
    display: block;
    animation: dp-fadeIn 0.3s ease;
}

@keyframes dp-fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ==========================================================================
   8. RESPONSIVE
   ========================================================================== */

@media (max-width: 992px) {
    .detail-container {
        flex-direction: column;
    }

    .content-area {
        width: 100%;
    }

    .content-header {
        padding: var(--space-4, 1rem) var(--space-5, 1.25rem);
        flex-direction: column;
        gap: var(--space-3, 0.75rem);
        align-items: flex-start;
    }

    .tab-pane > .content-header {
        min-height: 0;
    }

    .tab-pane > .content-header > h2 {
        min-height: 0;
    }

    .content-header h2 {
        font-size: var(--font-size-xl, 1.25rem);
    }

    .field-row {
        flex-direction: column;
        gap: var(--space-1, 0.25rem);
    }



    .field-label {
        flex: none;
        padding-top: 0;
    }

    .field-section {
        padding: var(--space-4, 1rem);
    }
}

@media (max-width: 576px) {
    .content-header h2 {
        font-size: var(--font-size-lg, 1.125rem);
    }

    .editor-btn {
        padding: var(--space-1, 0.25rem) var(--space-3, 0.75rem);
        font-size: var(--font-size-xs, 0.75rem);
    }

    .field-section h4,
    .field-section h5,
    .field-section h6 {
        font-size: var(--font-size-base, 1rem);
    }

    .tech-tag {
        font-size: var(--font-size-xs, 0.75rem);
        padding: 0.15rem var(--space-2, 0.5rem);
    }

    .detail-hierarchy-item {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.45rem;
    }

    .detail-hierarchy-count-badge {
        white-space: normal;
    }

    .detail-hierarchy-children {
        margin-left: 0.35rem;
        padding-left: 0.85rem;
    }

    .detail-hierarchy-child::before {
        left: -0.85rem;
        width: 0.5rem;
    }

    .detail-hierarchy-child-content {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.35rem;
    }

    .detail-hierarchy-meta {
        max-width: 100%;
    }
}


/* ==========================================================================
   KOOPERATIONEN – Partner Cards & Cooperation Areas
   ========================================================================== */

/* Section count badge */
.koop-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.4rem;
    background: var(--primary-color, #00618F);
    color: white;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

/* Partner grid */
.koop-partner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1rem;
}

/* Partner card */
.partner-card {
    background: var(--gray-50, #f9fafb);
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: 10px;
    padding: 1.25rem;
}

/* Partner name link */
.partner-name-link {
    color: var(--primary-color, #00618F);
    text-decoration: none;
}
.partner-name-link:hover {
    text-decoration: none;
}

.partner-logo-link {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-light, #e5e7eb);
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    text-decoration: none;
}

.partner-logo-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Header row: icon + name + status */
.partner-card-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.partner-card-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--primary-color, #00618F);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.partner-card-title {
    flex: 1;
    min-width: 0;
}

.partner-card-title h5 {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary, #111827);
    line-height: 1.3;
    word-break: break-word;
}

.partner-institution {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted, #6b7280);
    margin-top: 2px;
    line-height: 1.3;
}

.partner-status-badge {
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: var(--gray-200, #e5e7eb);
    color: var(--text-muted, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.partner-status-badge.status-active {
    background: #d1fae5;
    color: #065f46;
}

/* Meta tags row */
.partner-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.partner-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    padding: 0.2rem 0.55rem;
    background: white;
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: 6px;
    color: var(--text-muted, #6b7280);
    line-height: 1.4;
}

.partner-tag i {
    font-size: 0.7rem;
    color: var(--primary-color, #00618F);
}

/* Details text */
.partner-details {
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--text-secondary, #374151);
    margin-bottom: 0.75rem;
}

/* Cooperation areas section */
.partner-areas {
    border-top: 1px solid var(--border-light, #e5e7eb);
    padding-top: 0.75rem;
    margin-top: 0.5rem;
}

.partner-areas-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.partner-areas-label i {
    font-size: 0.8rem;
    color: var(--primary-color, #00618F);
}

/* Cooperation area items */
.coop-area-item {
    margin-bottom: 0.5rem;
}

.coop-area-item:last-child {
    margin-bottom: 0;
}

.coop-area-name {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-color, #00618F);
    margin-bottom: 0.25rem;
}

.coop-area-detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.2rem;
    margin-left: 0.25rem;
}

.coop-area-tab {
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted, #6b7280);
    padding-top: 0;
}

.coop-area-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
}

.coop-area-tag {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    padding: 0.15rem 0.55rem;
    background: #ffffff;
    border: 1px solid var(--border-light, #e5e7eb);
    color: var(--text-primary, #111827);
    border-radius: 6px;
    line-height: 1.4;
}

.coop-area-tag-link {
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.coop-area-tag-link:hover {
    text-decoration: none;
    border-color: var(--border-light, #e5e7eb);
    box-shadow: none;
    filter: none;
}

@media (max-width: 768px) {
    .koop-partner-grid {
        grid-template-columns: 1fr;
    }
}


/* ==========================================================================
   PORTAL – Completeness, Tech-Radar, Related FIDs
   ========================================================================== */

/* Completeness bar */
.portal-completeness {
    background: var(--gray-50, #f9fafb);
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: var(--radius-xl, 12px);
    padding: var(--space-5, 1.25rem);
    margin-bottom: var(--space-6, 1.5rem);
}

.portal-completeness__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3, 0.75rem);
    flex-wrap: wrap;
    margin-bottom: var(--space-3, 0.75rem);
}

.portal-completeness__title {
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: var(--font-weight-semibold, 600);
    color: var(--text-secondary, #374151);
    display: flex;
    align-items: center;
    gap: var(--space-2, 0.5rem);
}

.portal-completeness__title i {
    color: var(--primary-color, #00618F);
}

.portal-completeness__value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color, #00618F);
}

.portal-completeness__bar-bg {
    height: 10px;
    background: var(--gray-200, #e5e7eb);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: var(--space-2, 0.5rem);
}

.portal-completeness__bar {
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--primary-color, #00618F), var(--primary-light, #6BA3E8));
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.portal-completeness__detail {
    font-size: var(--font-size-xs, 0.75rem);
    color: var(--text-muted, #6b7280);
}

/* Tech-Radar bars */
.portal-tech-radar {
    display: flex;
    flex-direction: column;
    gap: var(--space-3, 0.75rem);
}

.portal-tech-radar__row {
    display: flex;
    align-items: center;
    gap: var(--space-3, 0.75rem);
}

.portal-tech-radar__label {
    flex: 0 0 110px;
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: 500;
    color: var(--text-secondary, #374151);
    white-space: nowrap;
}

.portal-tech-radar__bar-bg {
    flex: 1;
    height: 24px;
    background: var(--gray-100, #f3f4f6);
    border-radius: var(--radius-md, 6px);
    overflow: hidden;
    position: relative;
}

.portal-tech-radar__bar {
    height: 100%;
    border-radius: var(--radius-md, 6px);
    background: linear-gradient(90deg, var(--primary-color, #00618F), var(--accent-color, #8ED1B0));
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0;
}

.portal-tech-radar__count {
    flex: 0 0 28px;
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: 700;
    color: var(--primary-color, #00618F);
    text-align: right;
}

/* Related FID grid */
.portal-related-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3, 0.75rem);
}

.portal-related-item {
    display: flex;
    align-items: center;
    gap: var(--space-2, 0.5rem);
    padding: var(--space-2, 0.5rem) var(--space-3, 0.75rem);
    background: var(--gray-50, #f9fafb);
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: var(--radius-lg, 8px);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, background 0.15s ease;
    max-width: 240px;
}

.portal-related-item:hover {
    border-color: var(--primary-color, #00618F);
    background: #fff;
}

.portal-related-item__logo {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md, 6px);
    overflow: hidden;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid var(--border-light, #e5e7eb);
}

.portal-related-item__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.portal-related-item__logo--fallback {
    background: linear-gradient(135deg, var(--primary-color, #00618F), var(--primary-hover, #327EBB));
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    border: none;
}

.portal-related-item__name {
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: 500;
    color: var(--text-primary, #111827);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* ==========================================================================
   9. PRINT
   ========================================================================== */

@media print {
    .editor-btn {
        display: none !important;
    }

    .detail-container {
        display: block;
    }

    .field-section {
        box-shadow: none;
        break-inside: avoid;
        border: 1px solid #d1d5db;
    }

    .tab-pane {
        display: block !important;
    }
}

