.large-modal {
    max-width: 1400px;
    min-width: 700px;
}
/* Modal-Dialog für Dokumenten-Bearbeitung */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    overflow: auto;
    background: rgba(0,0,0,0.35);
    align-items: center;
    justify-content: center;
}
.modal-content {
    background: #fff;
    margin: 60px auto;
    padding: 30px 28px 18px 28px;
    border-radius: 10px;
    max-width: 520px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    position: relative;
}
.modal .close {
    position: absolute;
    right: 18px;
    top: 12px;
    font-size: 28px;
    color: #888;
    cursor: pointer;
}
.modal .form-group {
    margin-bottom: 18px;
}
.modal label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: #4d5fa3;
}
.modal input[type="text"],
.modal textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    font-size: 14px;
    margin-bottom: 2px;
}
.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 10px;
}
.save-btn {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}
.save-btn:hover { background: #4d5fa3; }
.delete-btn {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}
.delete-btn:hover { background: #c0392b; }
.cancel-btn {
    background: #aaa;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}
.cancel-btn:hover { background: #888; }
/* Spinner für LLM-Antwort */
.spinner {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 3px solid #e0e0e0;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* Inferenz-Test Eingabefeld wie Suchfeld */
.inferenc-box {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}
.inferenc-box input[type="text"] {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            padding: 10px;
        }
        .container {
            margin: 0 auto;
            background: white;
            border-radius: 12px;
            box-shadow: 0 20px 60px rgba(0,0,0,0.3);
            overflow: hidden;
        }
        header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 30px;
            text-align: center;
        }
        h1 { font-size: 28px; margin-bottom: 5px; }
        .stats {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
            padding: 30px;
            background: #f8f9fa;
            border-bottom: 1px solid #e9ecef;
        }
        .stat {
            background: white;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            text-align: center;
        }
        .stat-value { font-size: 32px; font-weight: bold; color: #667eea; }
        .stat-label { color: #6c757d; margin-top: 5px; }
        .content {
            padding: 30px;
        }
        .search-box {
            display: flex;
            gap: 10px;
            margin-bottom: 30px;
        }
        input[type="text"] {
            flex: 1;
            padding: 12px 16px;
            border: 1px solid #dee2e6;
            border-radius: 6px;
            font-size: 14px;
        }
        button {
            padding: 12px 24px;
            background: #667eea;
            color: white;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-weight: 500;
            transition: background 0.3s;
        }
        button:hover { background: #764ba2; }
        .documents {
            display: grid;
            gap: 15px;
        }
        .documents table {
            width: 100%;
            border-collapse: collapse;
            background: white;
            border-radius: 8px;
            box-shadow: 0 2px 12px rgba(0,0,0,0.05);
            table-layout: fixed;
        }
        .documents th, .documents td {
            padding: 8px 10px;
            font-size: 12px;
            border-bottom: 1px solid #e9ecef;
            vertical-align: top;
            /*word-break: break-word;*/
            /* overflow: hidden; entfernt */
            /* min-width: 40px; entfernt */
        }
        .documents th {
            background: #f8f9fa;
            color: #4d5fa3;
            font-weight: 600;
            position: sticky;
            top: 0;
            z-index: 1;
            user-select: none;
            white-space: nowrap;
            cursor: pointer;
        }
        .documents th:hover {
            background: #e9ecef;
        }
        .documents th .sort-indicator {
            font-size: 10px;
            margin-left: 4px;
            color: #999;
        }
        .documents th.sorted .sort-indicator {
            color: #667eea;
        }
        .documents .filter-input {
            width: 100%;
            padding: 4px 6px;
            font-size: 11px;
            border: 1px solid #dee2e6;
            border-radius: 3px;
            margin-top: 4px;
            box-sizing: border-box;
        }
        .documents th.resizable {
            position: relative;
        }
        .documents th.resizable::after {
            content: '';
            position: absolute;
            right: 0;
            top: 0;
            height: 100%;
            width: 5px;
            cursor: col-resize;
            background: transparent;
            transition: background 0.2s;
        }
        .documents th.resizable:hover::after {
            background: #667eea;
        }
        .documents tr:nth-child(even) { background: #fbfcff; }
        .documents .mono { font-family: monospace; font-size: 12px; color: #666; }
        .document {
            background: #f8f9fa;
            padding: 20px;
            border-radius: 8px;
            border-left: 4px solid #667eea;
        }
        .document-id {
            font-family: monospace;
            font-size: 12px;
            color: #6c757d;
            margin-bottom: 10px;
        }
        .document-text {
            color: #212529;
            line-height: 1.5;
            margin-bottom: 10px;
        }
        .document-meta {
            font-size: 12px;
            color: #6c757d;
        }
        .loading {
            text-align: center;
            padding: 40px;
            color: #6c757d;
        }
        .error {
            background: #f8d7da;
            color: #721c24;
            padding: 15px;
            border-radius: 6px;
            margin-bottom: 20px;
        }
        .tabs {
            display: flex;
            border-bottom: 2px solid #e9ecef;
            margin-bottom: 20px;
        }
        .tab {
            padding: 12px 24px;
            cursor: pointer;
            border: none;
            background: none;
            font-size: 14px;
            font-weight: 500;
            color: #6c757d;
            border-bottom: 3px solid transparent;
            margin-bottom: -2px;
            transition: all 0.3s;
        }
        .tab:hover { color: #667eea; }
        .tab.active {
            color: #667eea;
            border-bottom-color: #667eea;
        }
        .tab-content {
            display: none;
        }
        .tab-content.active {
            display: block;
        }
        /* Schema-Tabelle: flexible Text-Spalte */
        /* Schema-Tabelle: Text-Spalte mit Mindestbreite, table-layout: fixed */
        .schema-table {
            border-collapse: collapse;
            width: 100%;
            background: white;
            table-layout: fixed;
        }
        /* Schema-Tabelle: Text-Spalte flexibel */
        /* Einheitliche Spaltenbreiten für Kopf und Inhalt */
        .schema-table th,
        .schema-table td {
            padding: 12px;
            text-align: left;
            border-bottom: 1px solid #e9ecef;
            word-break: break-word;
        }
        .schema-table th.id-col, .schema-table td.id-col { width: 8vw; }
        .schema-table th.type-col, .schema-table td.type-col { width: 8vw; }
        .schema-table th.tags-col, .schema-table td.tags-col { width: 8vw; }
        .schema-table th.path-col, .schema-table td.path-col { width: 8vw; }
        .schema-table th.text-col, .schema-table td.text-col {
            width: 30vw;
            white-space: normal;
            word-break: break-word;
        }
        .schema-table th.embedding-col, .schema-table td.embedding-col { width: 8vw; }
        /* Aktion-Spalte in Dokumenten-Tabelle */
        .schema-table th.action-col, .schema-table td.action-col {
            width: 8vw;
            text-align: center;
        }
        .edit-btn {
            padding: 6px 16px;
            background: #667eea;
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 13px;
            font-weight: 500;
            transition: background 0.2s;
        }
        .edit-btn:hover {
            background: #4d5fa3;
        }
        .schema-table th {
            background: #f8f9fa;
            font-weight: 600;
            color: #667eea;
        }
        .schema-table tr:hover {
            background: #f8f9fa;
        }
        .type-badge {
            display: inline-block;
            background: #e7f3ff;
            color: #0066cc;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 11px;
            font-weight: 500;
        }
        .pk-badge {
            background: #fff3cd;
            color: #997404;
            margin-left: 5px;
        }