/* ============================================
   BIM Viewer – Evolut Design System
   Tokens: evolut-extensions/design/styles.css (via sync-data.ps1)
   ============================================ */

/* Import evolut-extensions base (tokens + fonts).
   @layer keeps component styles from conflicting. */
@import url('evolut-design.css') layer(evolut-base);

:root {
    /* --- Brand: inherited from evolut-design.css ---
       --deep-teal, --cerulean, --light-mint, --radical-red,
       --bg, --bg-white, --text, --text-secondary, --text-muted,
       --border, --radius, --radius-sm, --shadow-sm, --shadow-md
       are defined in the imported layer and available here. */

    /* Viewer-specific overrides */
    --border-light: #eef0f4;
    --shadow: var(--shadow-sm);

    /* Layout (viewer-only) */
    --header-h: 72px;
    --sidebar-w: 260px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Tenorite', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   LOADING & ERROR
   ============================================ */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    color: var(--text-muted);
    gap: 1rem;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--deep-teal);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.error-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    color: var(--text-secondary);
    gap: 0.5rem;
}
.error-icon { font-size: 3rem; }
.error-screen h3 { font-size: 1.2rem; }
.error-screen p { font-size: 0.9rem; color: var(--text-muted); }

/* ============================================
   HEADER
   ============================================ */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    box-shadow: var(--shadow);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.customer-logo { height: 40px; object-fit: contain; }
.header-divider { width: 1px; height: 32px; background: var(--border); }

.header-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--deep-teal);
    letter-spacing: -0.02em;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    font-family: inherit;
    border: 1px solid var(--border);
    background: var(--bg-white);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn:hover { border-color: var(--deep-teal); color: var(--deep-teal); }


.powered-by {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.powered-by strong { color: var(--deep-teal); font-weight: 600; }

/* ============================================
   ROLE BAR (Sub-header 1)
   ============================================ */
.role-bar {
    background: var(--deep-teal);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    overflow-x: auto;
    scrollbar-width: none;
}
.role-bar::-webkit-scrollbar { display: none; }

.role-tab {
    padding: 0.7rem 1.2rem;
    font-size: 0.82rem;
    font-weight: 500;
    font-family: inherit;
    color: rgba(255,255,255,0.55);
    background: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}
.role-tab:hover { color: rgba(255,255,255,0.9); }
.role-tab.active {
    color: #ffffff;
    border-bottom-color: var(--light-mint);
}

/* ============================================
   USECASE BAR (Sub-header 2)
   ============================================ */
.usecase-bar {
    background: #00627a;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    overflow-x: auto;
    scrollbar-width: none;
}
.usecase-bar::-webkit-scrollbar { display: none; }

.usecase-tab {
    padding: 0.65rem 1.2rem;
    font-size: 0.78rem;
    font-weight: 500;
    font-family: inherit;
    color: rgba(255,255,255,0.55);
    background: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}
.usecase-tab:hover { color: rgba(255,255,255,0.9); }
.usecase-tab.active {
    color: #ffffff;
    border-bottom-color: var(--light-mint);
}

/* Shared label for bars */
.bar-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.35);
    margin-right: 0.75rem;
    white-space: nowrap;
}

/* ============================================
   REPRESENTATION BAR
   ============================================ */
.representation-bar {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 48px;
}

.representation-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-right: 0.5rem;
}

.representation-chip {
    padding: 0.35rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 500;
    font-family: inherit;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}
.representation-chip:hover { border-color: var(--cerulean); color: var(--cerulean); }
.representation-chip.active {
    background: var(--cerulean);
    color: white;
    border-color: var(--cerulean);
}

.representation-type {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-left: 0.2rem;
    font-weight: 400;
}
.representation-chip.active .representation-type { color: rgba(255,255,255,0.7); }

/* ============================================
   CONTENT LAYOUT
   ============================================ */
.content-wrapper {
    display: flex;
    min-height: calc(100vh - var(--header-h) - 80px);
}

/* ============================================
   SIDEBAR – Guided Navigation
   ============================================ */
.view-sidebar {
    width: var(--sidebar-w);
    background: var(--bg-white);
    border-right: 1px solid var(--border);
    padding: 1rem 0;
    flex-shrink: 0;
    overflow-y: auto;
}

.sidebar-section-title {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 0.5rem 1.5rem;
}

/* View tabs (in sidebar) */
.view-tab {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.65rem 1.5rem;
    font-size: 0.85rem;
    font-weight: 400;
    font-family: inherit;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}
.view-tab:hover { background: var(--bg); color: var(--text); }
.view-tab.active {
    background: #f0f9ff;
    color: var(--deep-teal);
    font-weight: 600;
    border-left-color: var(--deep-teal);
}

.view-tab-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: var(--bg);
    font-size: 0.78rem;
    flex-shrink: 0;
}
.view-tab.active .view-tab-icon { background: var(--deep-teal); }

/* ============================================
   MAIN PANEL
   ============================================ */
.main-panel {
    flex: 1;
    padding: 1.75rem 2rem;
    max-width: 960px;
    margin: 0 auto;
}

.view-content { display: none; }
.view-content.active { display: block; }

/* ============================================
   CHECKLIST VIEW
   ============================================ */
.checklist-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.checklist-header {
    background: linear-gradient(135deg, var(--deep-teal), #006880);
    padding: 1.25rem 1.5rem;
    color: white;
}
.checklist-header h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.35rem; }
.checklist-header p { font-size: 0.82rem; opacity: 0.85; }

.checklist-body { padding: 1rem 1.5rem; }

.checklist-item {
    display: flex;
    gap: 0.85rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-light);
}
.checklist-item:last-child { border-bottom: none; }

.checklist-icon {
    width: 32px; height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.checklist-content { flex: 1; }
.checklist-title { font-weight: 600; font-size: 0.88rem; margin-bottom: 0.2rem; }
.checklist-desc { font-size: 0.82rem; color: var(--text-secondary); }

.checklist-hint {
    margin-top: 0.5rem;
    padding: 0.6rem 0.85rem;
    background: #fffbeb;
    border-left: 3px solid var(--warning);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.78rem;
    font-style: italic;
    color: #92400e;
}

.checklist-tag {
    display: inline-flex;
    margin-top: 0.4rem;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--cerulean);
    background: #f0f9ff;
    padding: 0.2rem 0.5rem;
    border-radius: 100px;
}

/* ============================================
   CLASSIFICATION VIEW
   ============================================ */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.search-input {
    flex: 1;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: inherit;
    background: var(--bg-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%238c92a4'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E") no-repeat 0.75rem center / 16px;
    transition: border-color 0.15s;
}
.search-input:focus { outline: none; border-color: var(--cerulean); }

.filter-select {
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-family: inherit;
    background: var(--bg-white);
    cursor: pointer;
}

.result-count {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.data-table thead th {
    padding: 0.7rem 1rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.data-table tbody td {
    padding: 0.6rem 1rem;
    font-size: 0.82rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}
.data-table tbody tr:hover { background: #fafbfc; }

.bkp-tag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #f0f0f0;
    color: var(--text-secondary);
}
.bkp-tag.bkp-highlight {
    background: #dff5e3;
    color: #166534;
}

/* ============================================
   CLASSIFICATION TREE VIEW
   Gehört zu: views/classification.js
   ============================================ */
.clf-tree {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.clf-header-row {
    display: flex;
    align-items: center;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.clf-hdr-name {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    min-width: 0;
}

.clf-hdr-actions {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}
.clf-hdr-actions::before {
    content: '|';
    color: var(--border);
    margin: 0 0.25rem;
    font-size: 0.65rem;
}
.clf-hdr-action {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
    user-select: none;
}
.clf-hdr-action:hover { background: var(--border-light); color: var(--text-secondary); }

.clf-search {
    flex: 1;
    max-width: 200px;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-family: inherit;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    color: var(--text);
    background: var(--bg-white);
}
.clf-search:focus { outline: none; border-color: var(--cerulean); }
.clf-search::placeholder { text-transform: none; letter-spacing: normal; color: var(--text-muted); }

.clf-hdr-filter {
    width: 100px;
    box-sizing: border-box;
    text-align: center;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    flex-shrink: 0;
    cursor: pointer;
    padding: 0.25rem 0.2rem;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: var(--bg-white);
    transition: all 0.15s;
    user-select: none;
}
.clf-hdr-filter:hover { border-color: var(--cerulean); color: var(--text-secondary); }
.clf-hdr-filter.active { background: var(--deep-teal); color: white; border-color: var(--deep-teal); }

.clf-node { border-bottom: 1px solid var(--border-light); }
.clf-node:last-child { border-bottom: none; }

.clf-row {
    display: flex;
    align-items: center;
    padding: 0.45rem 0.75rem;
    transition: background 0.1s;
}
.clf-row:hover { background: #fafbfc; }

.clf-row-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.clf-arrow {
    width: 16px;
    font-size: 0.5rem;
    color: var(--text-muted);
    transition: transform 0.15s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.clf-arrow.open { transform: rotate(90deg); }

.clf-leaf-indent { width: 16px; flex-shrink: 0; }

.clf-name {
    font-size: 0.82rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clf-col {
    width: 100px;
    text-align: center;
    flex-shrink: 0;
}

.clf-check {
    color: var(--cerulean);
    font-weight: 700;
    font-size: 0.9rem;
}

.clf-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    font-style: italic;
    font-family: Georgia, 'Times New Roman', serif;
    color: var(--cerulean);
    border: 1.5px solid var(--cerulean);
    cursor: pointer;
    transition: all 0.15s;
}
.clf-info-btn:hover { background: var(--cerulean); color: white; }

.clf-kids { display: none; }
.clf-kids.open { display: block; }

/* Inline detail panel */
.clf-detail {
    display: none;
    padding: 0.5rem 0.75rem 0.75rem 2.25rem;
    background: rgba(0, 165, 207, 0.04);
    border-top: 1px solid rgba(0, 165, 207, 0.15);
}
.clf-detail.open { display: block; }

.clf-detail-empty {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
}

.clf-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}
.clf-table th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}
.clf-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
}
.clf-table tr:hover td { background: #fafbfc; }

.clf-value {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    margin: 0.1rem 0.15rem;
    background: rgba(0, 165, 207, 0.1);
    color: var(--deep-teal);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}
.clf-value-default {
    background: rgba(0, 165, 207, 0.2);
    border: 1px solid rgba(0, 165, 207, 0.3);
}
.clf-type {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: var(--bg);
    color: var(--text-muted);
    border-radius: 4px;
    font-size: 0.75rem;
    font-style: italic;
}

/* ============================================
   STRUCTURE VIEW
   Gehört zu: views/structure.js
   ============================================ */
.str-tree {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.str-header-row {
    display: flex;
    align-items: center;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.str-hdr-name {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    min-width: 0;
}

.str-hdr-actions {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}
.str-hdr-actions::before {
    content: '|';
    color: var(--border);
    margin: 0 0.25rem;
    font-size: 0.65rem;
}

.str-hdr-action {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
    user-select: none;
}
.str-hdr-action:hover { background: var(--border-light); color: var(--text-secondary); }

.str-search {
    flex: 1;
    max-width: 200px;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-family: inherit;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    color: var(--text);
    background: var(--bg-white);
}
.str-search:focus { outline: none; border-color: var(--cerulean); }
.str-search::placeholder { text-transform: none; letter-spacing: normal; color: var(--text-muted); }

.str-hdr-filter {
    width: 100px;
    box-sizing: border-box;
    text-align: center;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    flex-shrink: 0;
    cursor: pointer;
    padding: 0.25rem 0.2rem;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: var(--bg-white);
    transition: all 0.15s;
    user-select: none;
}
.str-hdr-filter:hover { border-color: var(--cerulean); color: var(--text-secondary); }
.str-hdr-filter.active { background: var(--deep-teal); color: white; border-color: var(--deep-teal); }

.str-node { border-bottom: 1px solid var(--border-light); }
.str-node:last-child { border-bottom: none; }

.str-row {
    display: flex;
    align-items: center;
    padding: 0.45rem 0.75rem;
    transition: background 0.1s;
}
.str-row:hover { background: #fafbfc; }

.str-row-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.str-arrow {
    width: 16px;
    font-size: 0.5rem;
    color: var(--text-muted);
    transition: transform 0.15s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.str-arrow.open { transform: rotate(90deg); }

.str-leaf-indent { width: 16px; flex-shrink: 0; }

.str-code {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--deep-teal);
    white-space: nowrap;
    flex-shrink: 0;
}

.str-name {
    font-size: 0.82rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.str-col {
    width: 100px;
    text-align: center;
    flex-shrink: 0;
}

.str-check {
    color: var(--cerulean);
    font-weight: 700;
    font-size: 0.9rem;
}

.str-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    font-style: italic;
    font-family: Georgia, 'Times New Roman', serif;
    color: var(--cerulean);
    border: 1.5px solid var(--cerulean);
    cursor: pointer;
    transition: all 0.15s;
}
.str-info-btn:hover { background: var(--cerulean); color: white; }

.str-kids { display: none; }
.str-kids.open { display: block; }

.str-detail {
    display: none;
    padding: 0.5rem 0.75rem 0.75rem 2.25rem;
    background: rgba(0, 165, 207, 0.04);
    border-top: 1px solid rgba(0, 165, 207, 0.15);
}
.str-detail.open { display: block; }

.str-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}
.str-table th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}
.str-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
}
.str-table tr:hover td { background: #fafbfc; }

.str-value {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    margin: 0.1rem 0.15rem;
    background: rgba(0, 165, 207, 0.1);
    color: var(--deep-teal);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* ============================================
   PROPERTIES VIEW
   Gehört zu: views/properties.js
   ============================================ */
.prp-tree {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.prp-header-row {
    display: flex;
    align-items: center;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.prp-hdr-name {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    min-width: 0;
}

.prp-hdr-actions {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}
.prp-hdr-actions::before {
    content: '|';
    color: var(--border);
    margin: 0 0.25rem;
    font-size: 0.65rem;
}
.prp-hdr-action {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
    user-select: none;
}
.prp-hdr-action:hover { background: var(--border-light); color: var(--text-secondary); }

.prp-search {
    flex: 1;
    max-width: 200px;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-family: inherit;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    color: var(--text);
    background: var(--bg-white);
}
.prp-search:focus { outline: none; border-color: var(--cerulean); }
.prp-search::placeholder { text-transform: none; letter-spacing: normal; color: var(--text-muted); }

.prp-hdr-filter {
    width: 100px;
    box-sizing: border-box;
    text-align: center;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    flex-shrink: 0;
    cursor: pointer;
    padding: 0.25rem 0.2rem;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: var(--bg-white);
    transition: all 0.15s;
    user-select: none;
}
.prp-hdr-filter:hover { border-color: var(--cerulean); color: var(--text-secondary); }
.prp-hdr-filter.active { background: var(--deep-teal); color: white; border-color: var(--deep-teal); }

.prp-node { border-bottom: 1px solid var(--border-light); }
.prp-node:last-child { border-bottom: none; }

.prp-row {
    display: flex;
    align-items: center;
    padding: 0.45rem 0.75rem;
    transition: background 0.1s;
}
.prp-row:hover { background: #fafbfc; }

.prp-row-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.prp-arrow {
    width: 16px;
    font-size: 0.5rem;
    color: var(--text-muted);
    transition: transform 0.15s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.prp-arrow.open { transform: rotate(90deg); }

.prp-leaf-indent { width: 16px; flex-shrink: 0; }

.prp-name {
    font-size: 0.82rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* PropertySet header row styling */
.prp-pset-row .prp-name {
    font-weight: 600;
    color: var(--text-secondary);
}

/* Expression properties: italic + muted + Auto badge */
.prp-expression .prp-name {
    font-style: italic;
    color: var(--text-muted);
}
.prp-badge-auto {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    font-size: 0.65rem;
    font-weight: 600;
    font-style: normal;
    color: var(--text-muted);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    flex-shrink: 0;
}

.prp-col {
    width: 100px;
    text-align: center;
    flex-shrink: 0;
}

.prp-check {
    color: var(--cerulean);
    font-weight: 700;
    font-size: 0.9rem;
}

.prp-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    font-style: italic;
    font-family: Georgia, 'Times New Roman', serif;
    color: var(--cerulean);
    border: 1.5px solid var(--cerulean);
    cursor: pointer;
    transition: all 0.15s;
}
.prp-info-btn:hover { background: var(--cerulean); color: white; }

.prp-kids { display: none; }
.prp-kids.open { display: block; }

.prp-detail {
    display: none;
    padding: 0.5rem 0.75rem 0.75rem 2.25rem;
    background: rgba(0, 165, 207, 0.04);
    border-top: 1px solid rgba(0, 165, 207, 0.15);
}
.prp-detail.open { display: block; }

.prp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}
.prp-table th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}
.prp-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
}
.prp-table tr:hover td { background: #fafbfc; }

/* ============================================
   BKP-ZUORDNUNG VIEW
   Gehört zu: views/bkp-zuordnung.js
   ============================================ */
.bkp-tree {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.bkp-header-row {
    display: flex;
    align-items: center;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.bkp-hdr-name {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    min-width: 0;
}

.bkp-hdr-actions {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}
.bkp-hdr-actions::before {
    content: '|';
    color: var(--border);
    margin: 0 0.25rem;
    font-size: 0.65rem;
}
.bkp-hdr-action {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
    user-select: none;
}
.bkp-hdr-action:hover { background: var(--border-light); color: var(--text-secondary); }

.bkp-search {
    flex: 1;
    max-width: 200px;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-family: inherit;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    color: var(--text);
    background: var(--bg-white);
}
.bkp-search:focus { outline: none; border-color: var(--cerulean); }
.bkp-search::placeholder { text-transform: none; letter-spacing: normal; color: var(--text-muted); }

.bkp-hdr-col {
    width: 180px;
    box-sizing: border-box;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    flex-shrink: 0;
}

.bkp-hdr-filter {
    cursor: pointer;
    padding: 0.25rem 0.2rem;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: var(--bg-white);
    transition: all 0.15s;
    user-select: none;
    font-size: 0.6rem;
}
.bkp-hdr-filter:hover { border-color: var(--cerulean); color: var(--text-secondary); }
.bkp-hdr-filter.active { background: var(--deep-teal); color: white; border-color: var(--deep-teal); }

.bkp-node { border-bottom: 1px solid var(--border-light); }
.bkp-node:last-child { border-bottom: none; }

.bkp-row {
    display: flex;
    align-items: center;
    padding: 0.45rem 0.75rem;
    transition: background 0.1s;
}
.bkp-row:hover { background: #fafbfc; }

.bkp-row-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.bkp-arrow {
    width: 16px;
    font-size: 0.5rem;
    color: var(--text-muted);
    transition: transform 0.15s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bkp-arrow.open { transform: rotate(90deg); }

.bkp-leaf-indent { width: 16px; flex-shrink: 0; }

.bkp-name {
    font-size: 0.82rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bkp-col {
    width: 180px;
    text-align: left;
    flex-shrink: 0;
    padding: 0 0.25rem;
}

.bkp-code-inline {
    font-size: 0.72rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.bkp-options-btn {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: rgba(0, 165, 207, 0.1);
    color: var(--cerulean);
    border: 1px solid rgba(0, 165, 207, 0.25);
    border-radius: 100px;
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}
.bkp-options-btn:hover { background: var(--cerulean); color: white; }

.bkp-kids { display: none; }
.bkp-kids.open { display: block; }

/* Detail panel */
.bkp-detail {
    display: none;
    padding: 0.5rem 0.75rem 0.75rem 2.25rem;
    background: rgba(0, 165, 207, 0.04);
    border-top: 1px solid rgba(0, 165, 207, 0.15);
}
.bkp-detail.open { display: block; }

.bkp-detail-section {
    margin-bottom: 0.75rem;
}
.bkp-detail-section:last-child { margin-bottom: 0; }

.bkp-detail-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.bkp-detail-empty {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
}

.bkp-options-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.bkp-code-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: rgba(0, 165, 207, 0.08);
    color: var(--text-secondary);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid transparent;
}
.bkp-code-default {
    background: rgba(0, 165, 207, 0.2);
    border-color: rgba(0, 165, 207, 0.3);
    color: var(--deep-teal);
    font-weight: 600;
}

/* ============================================
   EBKP-H KATALOG VIEW
   Gehört zu: views/ebkp-h.js
   Pattern: identisch mit str-* (Structure View)
   ============================================ */
.ekh-tree {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.ekh-header-row {
    display: flex;
    align-items: center;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.ekh-hdr-name {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    min-width: 0;
}

.ekh-hdr-actions {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}
.ekh-hdr-actions::before {
    content: '|';
    color: var(--border);
    margin: 0 0.25rem;
    font-size: 0.65rem;
}
.ekh-hdr-action {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
    user-select: none;
}
.ekh-hdr-action:hover { background: var(--border-light); color: var(--text-secondary); }

.ekh-search {
    flex: 1;
    max-width: 200px;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-family: inherit;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    color: var(--text);
    background: var(--bg-white);
}
.ekh-search:focus { outline: none; border-color: var(--cerulean); }
.ekh-search::placeholder { text-transform: none; letter-spacing: normal; color: var(--text-muted); }

.ekh-hdr-filter {
    width: 100px;
    box-sizing: border-box;
    text-align: center;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    flex-shrink: 0;
    cursor: pointer;
    padding: 0.25rem 0.2rem;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: var(--bg-white);
    transition: all 0.15s;
    user-select: none;
}
.ekh-hdr-filter:hover { border-color: var(--cerulean); color: var(--text-secondary); }
.ekh-hdr-filter.active { background: var(--deep-teal); color: white; border-color: var(--deep-teal); }

.ekh-node { border-bottom: 1px solid var(--border-light); }
.ekh-node:last-child { border-bottom: none; }

.ekh-row {
    display: flex;
    align-items: center;
    padding: 0.45rem 0.75rem;
    transition: background 0.1s;
}
.ekh-row:hover { background: #fafbfc; }

.ekh-row-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.ekh-arrow {
    width: 16px;
    font-size: 0.5rem;
    color: var(--text-muted);
    transition: transform 0.15s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ekh-arrow.open { transform: rotate(90deg); }

.ekh-leaf-indent { width: 16px; flex-shrink: 0; }

.ekh-code {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--deep-teal);
    white-space: nowrap;
    flex-shrink: 0;
}

.ekh-desc {
    font-size: 0.82rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Column cells — same width as header pills (100px) */
.ekh-col {
    width: 100px;
    text-align: center;
    flex-shrink: 0;
}

/* Info button — identical to str-info-btn */
.ekh-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    font-style: italic;
    font-family: Georgia, 'Times New Roman', serif;
    color: var(--cerulean);
    border: 1.5px solid var(--cerulean);
    cursor: pointer;
    transition: all 0.15s;
}
.ekh-info-btn:hover { background: var(--cerulean); color: white; }
.ekh-info-btn.ekh-inherited {
    border-style: dashed;
    color: var(--text-muted);
    border-color: var(--text-muted);
}
.ekh-info-btn.ekh-inherited:hover { background: var(--cerulean); color: white; border-style: solid; border-color: var(--cerulean); }

.ekh-kids { display: none; }
.ekh-kids.open { display: block; }

/* Detail panel — same pattern as str-detail */
.ekh-detail {
    display: none;
    padding: 0.5rem 0.75rem 0.75rem 2.25rem;
    background: rgba(0, 165, 207, 0.04);
    border-top: 1px solid rgba(0, 165, 207, 0.15);
}
.ekh-detail.open { display: block; }

.ekh-detail-empty {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
}

.ekh-detail-inherited {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 0.4rem;
}

.ekh-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}
.ekh-table th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}
.ekh-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
}
.ekh-table tr:hover td { background: #fafbfc; }

.ekh-bez-code {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    background: rgba(0, 165, 207, 0.1);
    color: var(--deep-teal);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.ekh-abk {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    background: rgba(139, 92, 246, 0.1);
    color: #6d28d9;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
}

.ekh-einheit-tag {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    background: var(--bg);
    color: var(--text-muted);
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 500;
    border: 1px solid var(--border);
}

/* Kosten detail panel */
.ekh-kosten-detail {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.ekh-kosten-section {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.ekh-kosten-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.ekh-kosten-text {
    font-size: 0.82rem;
    color: var(--text);
    line-height: 1.5;
}

/* Overlay summary table (key-value pairs) */
.ekh-table-compact {
    width: auto;
    margin-bottom: 0.25rem;
}
.ekh-table-compact th {
    font-size: 0.72rem;
    padding: 0.35rem 0.75rem 0.35rem 0;
    background: none;
    border-bottom: none;
    white-space: nowrap;
    color: var(--text-muted);
    vertical-align: top;
}
.ekh-table-compact td {
    font-size: 0.82rem;
    padding: 0.35rem 0;
    border-bottom: none;
    line-height: 1.5;
}


/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}
.empty-state-icon { font-size: 2.5rem; margin-bottom: 1rem; opacity: 0.4; }
.empty-state h4 { font-size: 1rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.35rem; }
.empty-state p { font-size: 0.85rem; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    .view-sidebar { width: 220px; }
    .main-panel { padding: 1.25rem; }
}

@media (max-width: 680px) {
    .content-wrapper { flex-direction: column; }
    .view-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .header { padding: 0 1rem; }
    .header-title { font-size: 1rem; }
    .representation-bar { padding: 0 1rem; }
}

/* ============================================
   PRINT
   ============================================ */
@media print {
    .header { position: static; box-shadow: none; }
    .representation-bar { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .view-sidebar { display: none; }
    .view-content { display: block !important; page-break-before: always; }
    .view-content:first-child { page-break-before: auto; }
    .main-panel { max-width: 100%; padding: 1rem 0; }
    .btn { display: none; }
}
