/**
 * PaperOffice Tabulator Theme v3.0
 * 
 * 1:1 Replikat des originalen Syncfusion-Grid Designs.
 * Mit Checkbox-Hover, Page-Badge, Document-Links etc.
 * 
 * @version 3.0.0
 * @date 2024-12-27
 */

/* ==========================================
   BASE STYLES
   ========================================== */

.tabulator {
    font-family: inherit;
    font-size: 13px;
    background: #fff;
    border: 1px solid var(--po-border, #e0e0e0);
    border-radius: 0;
    overflow: visible;
}

/* Horizontales Scrollen Container */
.tabulator .tabulator-tableholder {
    overflow-x: auto !important;
    overflow-y: auto !important;
}

/* ==========================================
   HEADER - Kompakt wie Original Syncfusion
   ========================================== */

.tabulator .tabulator-header {
    background: #f8f9fa;
    border-bottom: 1px solid var(--po-border, #e0e0e0);
    font-weight: 500;
    min-height: 32px !important;
    max-height: 36px !important;
}

.tabulator .tabulator-header .tabulator-col {
    background: transparent;
    border-right: 1px solid #e9ecef;
    position: relative;
}

.tabulator .tabulator-header .tabulator-col .tabulator-col-content {
    padding: 4px 8px !important;
    color: var(--po-text-secondary, #495057);
    font-size: 11px !important;
    font-weight: 500;
    line-height: 1.3 !important;
}

/* Sorter Icons richtig positionieren - nicht im Text */
.tabulator .tabulator-header .tabulator-col .tabulator-col-sorter {
    position: absolute !important;
    right: 4px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
}

.tabulator .tabulator-header .tabulator-col .tabulator-col-title {
    padding-right: 18px !important; /* Platz für Sort-Icon */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover {
    background: #e9ecef;
}

/* Header Filter */
.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 12px;
}

/* ==========================================
   ROWS - Zebra Striping wie Original
   ========================================== */

.tabulator .tabulator-tableholder .tabulator-table .tabulator-row {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    transition: background 0.15s ease, min-height 0.2s ease;
    min-height: 90px !important;
}

.tabulator .tabulator-tableholder .tabulator-table .tabulator-row:nth-child(even) {
    background: #f8f9fa;
}

.tabulator .tabulator-tableholder .tabulator-table .tabulator-row:hover {
    background: #dbeafe !important;
    cursor: pointer;
}

.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-selected {
    background: #bbdefb !important;
}

/* Cells */
.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell {
    padding: 8px 10px;
    border-right: none;
    color: var(--po-text-secondary, #212529);
    vertical-align: top;
    overflow: visible !important; /* Letzte Spalte nicht abschneiden */
}

/* Letzte Spalte mindestbreite */
.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell:last-child {
    min-width: 110px !important;
}

/* Horizontal Scroll für alle Spalten */
.tabulator .tabulator-tableholder {
    overflow-x: auto !important;
    overflow-y: auto !important;
}

/* ==========================================
   CHECKBOX - NUR BEI HOVER SICHTBAR!
   ========================================== */

/* Checkbox standardmäßig unsichtbar - HOHE SPEZIFIZITÄT */
.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.cell-checkbox input[type="checkbox"],
.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.cell-checkbox input {
    opacity: 0 !important;
    transition: opacity 0.15s ease !important;
    width: 16px !important;
    height: 16px !important;
    cursor: pointer;
    accent-color: var(--po-accent, #0078d4);
}

/* Checkbox sichtbar bei Row-Hover */
.tabulator .tabulator-tableholder .tabulator-table .tabulator-row:hover .tabulator-cell.cell-checkbox input[type="checkbox"],
.tabulator .tabulator-tableholder .tabulator-table .tabulator-row:hover .tabulator-cell.cell-checkbox input {
    opacity: 1 !important;
}

/* Checkbox sichtbar wenn Row selektiert */
.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-selected .tabulator-cell.cell-checkbox input[type="checkbox"],
.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-selected .tabulator-cell.cell-checkbox input {
    opacity: 1 !important;
}

/* Header Checkbox immer sichtbar */
.tabulator .tabulator-header .tabulator-col input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--po-accent, #0078d4);
}

/* ==========================================
   PREVIEW CONTAINER - Original Syncfusion Design
   ========================================== */

/* Preview Container (Thumbnail + Page Badge) */
.tabulator-cell .preview-container {
    position: relative;
    display: inline-block;
}

/* Thumbnail Image - Original Styles (50x65px) */
.tabulator-cell .preview-container img {
    width: 50px;
    height: 65px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    background: #f8f9fa;
}

/* Page Badge - BLAU wie Original! */
.tabulator-cell .page-badge {
    position: absolute;
    bottom: 2px;
    left: 2px;
    background: #0078d4;
    color: #fff;
    padding: 2px 5px;
    font-size: 10px;
    font-weight: 500;
    border-radius: 3px;
    min-width: 16px;
    text-align: center;
}

/* Fallback Icon */
.tabulator-cell .preview-container .fas.fa-file-alt {
    font-size: 24px;
    color: var(--po-accent, #0078d4);
}

/* ==========================================
   DOCUMENT NAME LINK - Original Design
   ========================================== */

.tabulator-cell .document-name-link {
    color: var(--po-accent, #0078d4);
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s ease;
    display: block;
    word-wrap: break-word;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1.3;
    font-weight: 500;
}

.tabulator-cell .document-name-link:hover {
    color: var(--po-accent-dark, #0056b3);
    text-decoration: underline;
}

/* Document Summary */
.tabulator-cell .document-summary-container {
    margin-top: 4px;
}

.tabulator-cell .document-summary {
    color: var(--po-text-muted, #6c757d);
    font-size: 11px;
    line-height: 1.3;
}

.tabulator-cell .document-summary.truncated-content {
    display: block;
}

.tabulator-cell .document-summary.full-content {
    display: none;
}

/* Expand Summary on Hover */
.tabulator-row:hover .document-summary.truncated-content {
    display: none;
}

.tabulator-row:hover .document-summary.full-content {
    display: block;
}

/* ==========================================
   LEGACY: DOC-CELL (für Kompatibilität)
   ========================================== */

.tabulator-cell .doc-cell {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 4px 0;
}

.tabulator-cell .doc-thumb-container {
    position: relative;
    width: 50px;
    height: 60px;
    flex-shrink: 0;
}

.tabulator-cell .doc-thumb {
    width: 50px;
    height: 60px;
    object-fit: cover;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: #f8f9fa;
}

.tabulator-cell .doc-thumb-placeholder {
    width: 50px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #6c757d;
    font-size: 20px;
}

.tabulator-cell .doc-pages-badge {
    position: absolute;
    bottom: 2px;
    left: 2px;
    background: var(--po-accent, #0078d4);
    color: #fff;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 3px;
    font-weight: 500;
    min-width: 16px;
    text-align: center;
}

.tabulator-cell .doc-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.tabulator-cell .doc-title {
    color: var(--po-accent, #0078d4);
    font-weight: 500;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tabulator-cell .doc-title:hover {
    text-decoration: underline;
}

.tabulator-cell .doc-description {
    color: #6c757d;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tabulator-cell .doc-description i {
    margin-right: 4px;
}

/* ==========================================
   TAGS CONTAINER
   ========================================== */

.tabulator-cell .tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

/* Graue Tags (Dokument-Typ) */
.tabulator-cell .tag-gray {
    display: inline-block;
    padding: 3px 8px;
    background: #e9ecef;
    color: #495057;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

/* Blaue Tags (Schlüsselwörter) */
.tabulator-cell .tag-blue {
    display: inline-block;
    padding: 3px 8px;
    background: #e3f2fd;
    color: #1565c0;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.tabulator-cell .tag-more {
    color: #6c757d;
    font-size: 11px;
    font-style: italic;
}

/* ==========================================
   DATA FIELDS BARS (System/Manuell/Auto) - Original Design
   ========================================== */

.tabulator-cell .data-fields-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
}

.tabulator-cell .field-bar {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    width: 100%;
    box-sizing: border-box;
}

/* System: Blauer Rand, kein Hintergrund */
.tabulator-cell .field-bar.field-system {
    background: transparent;
    border: 1.5px solid #0078d4;
    color: #0078d4;
}

/* Legacy Badges (für Rückwärtskompatibilität) */
.tabulator-cell .field-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
}

.tabulator-cell .field-badge.field-system {
    background: transparent;
    border: 1px solid #0078d4;
    color: #0078d4;
}

/* Manuell: Orange gefüllt */
.tabulator-cell .field-bar.field-manual {
    background: #fd7e14;
    border: none;
    color: #fff;
}

/* Auto: Grün gefüllt */
.tabulator-cell .field-bar.field-auto {
    background: #28a745;
    border: none;
    color: #fff;
}

/* Legacy Badges */
.tabulator-cell .field-badge.field-manual {
    background: #fd7e14;
    color: #fff;
}

.tabulator-cell .field-badge.field-auto {
    background: #28a745;
    color: #fff;
}

/* ==========================================
   STATUS TAGS (Paid, Unpaid, Closed, etc.)
   ========================================== */

.tabulator-cell .status-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.tabulator-cell .status-tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.tabulator-cell .status-success {
    background: #d4edda;
    color: #155724;
}

.tabulator-cell .status-danger {
    background: #f8d7da;
    color: #721c24;
}

.tabulator-cell .status-warning {
    background: #fff3cd;
    color: #856404;
}

.tabulator-cell .status-default {
    background: #e9ecef;
    color: #495057;
}

/* ==========================================
   REGION (Flaggen)
   ========================================== */

.tabulator-cell .region-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.tabulator-cell .region-cell .fi {
    font-size: 20px;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.tabulator-cell .region-label {
    font-size: 10px;
    color: #6c757d;
}

/* ==========================================
   DATE CELL
   ========================================== */

.tabulator-cell .date-cell {
    color: #495057;
    font-size: 12px;
}

/* ==========================================
   AI-DMS STATUS
   ========================================== */

.tabulator-cell .ai-dms-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tabulator-cell .ai-dms-indexed {
    color: #28a745;
    font-size: 12px;
    font-weight: 500;
}

.tabulator-cell .ai-dms-indexed i {
    margin-right: 4px;
}

.tabulator-cell .ai-dms-running {
    color: #28a745;
    font-size: 12px;
}

.tabulator-cell .ai-model-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
}

.tabulator-cell .ai-model-ultra {
    background: #e3f2fd;
    color: #0078d4;
}

.tabulator-cell .ai-model-basic {
    background: #e9ecef;
    color: #495057;
}

/* ==========================================
   AI-AGENT STATUS
   ========================================== */

.tabulator-cell .ai-agent-done {
    color: #28a745;
    font-size: 12px;
    font-weight: 500;
}

.tabulator-cell .ai-agent-done i {
    margin-right: 4px;
}

.tabulator-cell .ai-agent-running {
    color: #0078d4;
    font-size: 12px;
}

.tabulator-cell .ai-agent-none {
    color: #6c757d;
    font-size: 12px;
}

.tabulator-cell .ai-agent-none i {
    margin-right: 4px;
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */

.tabulator-cell .text-muted {
    color: #adb5bd !important;
}

/* ==========================================
   SCROLLBAR
   ========================================== */

.tabulator .tabulator-tableholder::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.tabulator .tabulator-tableholder::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.tabulator .tabulator-tableholder::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.tabulator .tabulator-tableholder::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ==========================================
   PLACEHOLDER
   ========================================== */

.tabulator .tabulator-tableholder .tabulator-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

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

@media (max-width: 768px) {
    .tabulator .tabulator-header .tabulator-col .tabulator-col-content {
        padding: 8px 6px;
        font-size: 11px;
    }
    
    .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell {
        padding: 6px;
    }
}

/* ==========================================
   VIEW OPTIONS - Grid Lines
   ========================================== */

/* Grid Lines: All (Both) */
.grid-lines-all .tabulator-row .tabulator-cell {
    border-right: 1px solid var(--po-border, #e9ecef) !important;
}

.grid-lines-all .tabulator-header .tabulator-col {
    border-right: 1px solid var(--po-border, #e9ecef) !important;
}

/* ==========================================
   VIEW OPTIONS - Preview Modes (mit hoher Spezifizität)
   ========================================== */

/* Preview: Auto - Standard, Row expandiert bei Hover */
#idp_documents_datatable.preview-auto .tabulator .tabulator-tableholder .tabulator-table .tabulator-row {
    min-height: 60px !important;
    transition: min-height 0.2s ease !important;
}

#idp_documents_datatable.preview-auto .tabulator .tabulator-tableholder .tabulator-table .tabulator-row:hover {
    min-height: 85px !important;
}

/* Preview: Large (Groß/Erweitert) - Immer große Rows */
#idp_documents_datatable.preview-large .tabulator .tabulator-tableholder .tabulator-table .tabulator-row {
    min-height: 100px !important;
}

#idp_documents_datatable.preview-large .tabulator-cell .preview-container img {
    width: 55px !important;
    height: 80px !important;
}

#idp_documents_datatable.preview-large .tabulator-cell .page-badge {
    font-size: 11px;
    padding: 3px 6px;
}

/* Preview: Normal (Eingeklappt) - Kompakte Rows (50px wie gewünscht) */
#idp_documents_datatable.preview-normal .tabulator .tabulator-tableholder .tabulator-table .tabulator-row {
    min-height: 50px !important;
    height: auto !important;
}

#idp_documents_datatable.preview-normal .tabulator-cell .preview-container img {
    width: 30px !important;
    height: 42px !important;
}

#idp_documents_datatable.preview-normal .tabulator-cell .page-badge {
    font-size: 9px;
    padding: 1px 3px;
}

/* Fallback für alte Klassen ohne #id */
.preview-auto .tabulator-row {
    min-height: 60px !important;
}

.preview-large .tabulator-row {
    min-height: 100px !important;
}

.preview-normal .tabulator-row {
    min-height: 50px !important;
}

/* ==========================================
   PO DROPDOWN MENU STYLES
   ========================================== */

.po-dropdown-menu {
    background: var(--po-bg-primary, #fff);
    border: 1px solid var(--po-border, #e0e0e0);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

.po-dropdown-item {
    display: block;
    padding: 10px 16px;
    color: var(--po-text-primary, #212529);
    text-decoration: none;
    font-size: 13px;
    transition: background 0.15s ease;
}

.po-dropdown-item:hover {
    background: var(--po-bg-secondary, #f8f9fa);
    color: var(--po-accent, #0078d4);
}

.po-dropdown-item i {
    width: 16px;
    text-align: center;
}

.po-dropdown-divider {
    height: 1px;
    background: var(--po-border, #e0e0e0);
    margin: 4px 0;
}

/* ==========================================
   DARK MODE - PaperOffice Palantir Theme
   Aktiviert durch: html.dark-side oder [data-theme="dark"]
   UPDATE 05.01.2026: Vollständiges Dark Mode Styling
   ========================================== */

/* Base Container */
html.dark-side .tabulator,
[data-theme="dark"] .tabulator {
    background: var(--po-bg-secondary, #22262b) !important;
    border-color: var(--po-border, #3a3f47) !important;
}

/* Header */
html.dark-side .tabulator .tabulator-header,
[data-theme="dark"] .tabulator .tabulator-header {
    background: var(--po-bg-tertiary, #1a1d21) !important;
    border-color: var(--po-border, #3a3f47) !important;
}

html.dark-side .tabulator .tabulator-header .tabulator-col,
[data-theme="dark"] .tabulator .tabulator-header .tabulator-col {
    background: transparent !important;
    border-color: var(--po-border, #3a3f47) !important;
}

html.dark-side .tabulator .tabulator-header .tabulator-col .tabulator-col-content,
[data-theme="dark"] .tabulator .tabulator-header .tabulator-col .tabulator-col-content {
    color: var(--po-text-muted, #9ca3af) !important;
}

html.dark-side .tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover,
[data-theme="dark"] .tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover {
    background: var(--po-bg-hover, #2d3139) !important;
}

html.dark-side .tabulator .tabulator-header .tabulator-col .tabulator-header-filter input,
[data-theme="dark"] .tabulator .tabulator-header .tabulator-col .tabulator-header-filter input {
    background: var(--po-bg-input, #1a1d21) !important;
    border-color: var(--po-border, #3a3f47) !important;
    color: var(--po-text-primary, #e6e8eb) !important;
}

/* Rows */
html.dark-side .tabulator .tabulator-tableholder .tabulator-table .tabulator-row,
[data-theme="dark"] .tabulator .tabulator-tableholder .tabulator-table .tabulator-row {
    background: var(--po-bg-secondary, #22262b) !important;
    border-color: var(--po-border, #3a3f47) !important;
}

html.dark-side .tabulator .tabulator-tableholder .tabulator-table .tabulator-row:nth-child(even),
[data-theme="dark"] .tabulator .tabulator-tableholder .tabulator-table .tabulator-row:nth-child(even) {
    /* background entfernt - 12.01.2026 */
}

html.dark-side .tabulator .tabulator-tableholder .tabulator-table .tabulator-row:hover,
[data-theme="dark"] .tabulator .tabulator-tableholder .tabulator-table .tabulator-row:hover {
    /* Dezente Hover-Farbe - solide, leicht heller als Basis */
    background: #232830 !important;
}

html.dark-side .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-selected,
[data-theme="dark"] .tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-selected {
    background: rgba(96, 165, 250, 0.15) !important;
}

/* Cells */
html.dark-side .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell,
[data-theme="dark"] .tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell {
    color: var(--po-text-primary, #e6e8eb) !important;
    border-color: var(--po-border, #3a3f47) !important;
}

/* Placeholder */
html.dark-side .tabulator .tabulator-tableholder .tabulator-placeholder,
[data-theme="dark"] .tabulator .tabulator-tableholder .tabulator-placeholder {
    background: var(--po-bg-secondary, #22262b) !important;
    color: var(--po-text-muted, #9ca3af) !important;
}

/* Scrollbar */
html.dark-side .tabulator .tabulator-tableholder::-webkit-scrollbar-track,
[data-theme="dark"] .tabulator .tabulator-tableholder::-webkit-scrollbar-track {
    background: var(--po-bg-tertiary, #1a1d21) !important;
}

html.dark-side .tabulator .tabulator-tableholder::-webkit-scrollbar-thumb,
[data-theme="dark"] .tabulator .tabulator-tableholder::-webkit-scrollbar-thumb {
    background: var(--po-border-dark, #4a5568) !important;
}

html.dark-side .tabulator .tabulator-tableholder::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] .tabulator .tabulator-tableholder::-webkit-scrollbar-thumb:hover {
    background: var(--po-text-muted, #9ca3af) !important;
}

/* Thumbnail Preview */
html.dark-side .tabulator-cell .preview-container img,
html.dark-side .tabulator-cell .doc-thumb,
[data-theme="dark"] .tabulator-cell .preview-container img,
[data-theme="dark"] .tabulator-cell .doc-thumb {
    border-color: var(--po-border, #3a3f47) !important;
    background: var(--po-bg-tertiary, #1a1d21) !important;
}

html.dark-side .tabulator-cell .doc-thumb-placeholder,
[data-theme="dark"] .tabulator-cell .doc-thumb-placeholder {
    background: var(--po-bg-tertiary, #1a1d21) !important;
    border-color: var(--po-border, #3a3f47) !important;
    color: var(--po-text-muted, #9ca3af) !important;
}

/* Page Badge - Behalte Akzentfarbe */
html.dark-side .tabulator-cell .page-badge,
html.dark-side .tabulator-cell .doc-pages-badge,
[data-theme="dark"] .tabulator-cell .page-badge,
[data-theme="dark"] .tabulator-cell .doc-pages-badge {
    background: var(--po-accent, #60a5fa) !important;
}

/* Document Name Link */
html.dark-side .tabulator-cell .document-name-link,
html.dark-side .tabulator-cell .doc-title,
[data-theme="dark"] .tabulator-cell .document-name-link,
[data-theme="dark"] .tabulator-cell .doc-title {
    color: var(--po-accent-light, #93c5fd) !important;
}

html.dark-side .tabulator-cell .document-name-link:hover,
html.dark-side .tabulator-cell .doc-title:hover,
[data-theme="dark"] .tabulator-cell .document-name-link:hover,
[data-theme="dark"] .tabulator-cell .doc-title:hover {
    color: var(--po-accent, #60a5fa) !important;
}

/* Document Summary & Description */
html.dark-side .tabulator-cell .document-summary,
html.dark-side .tabulator-cell .doc-description,
[data-theme="dark"] .tabulator-cell .document-summary,
[data-theme="dark"] .tabulator-cell .doc-description {
    color: var(--po-text-muted, #9ca3af) !important;
}

/* Tags - Graue Tags */
html.dark-side .tabulator-cell .tag-gray,
[data-theme="dark"] .tabulator-cell .tag-gray {
    background: var(--po-bg-tertiary, #1a1d21) !important;
    color: var(--po-text-secondary, #b0b7bf) !important;
}

/* Tags - Blaue Tags */
html.dark-side .tabulator-cell .tag-blue,
[data-theme="dark"] .tabulator-cell .tag-blue {
    background: rgba(96, 165, 250, 0.15) !important;
    color: var(--po-accent-light, #93c5fd) !important;
}

html.dark-side .tabulator-cell .tag-more,
[data-theme="dark"] .tabulator-cell .tag-more {
    color: var(--po-text-muted, #9ca3af) !important;
}

/* Data Fields */
html.dark-side .tabulator-cell .field-bar.field-system,
html.dark-side .tabulator-cell .field-badge.field-system,
[data-theme="dark"] .tabulator-cell .field-bar.field-system,
[data-theme="dark"] .tabulator-cell .field-badge.field-system {
    border-color: var(--po-accent, #60a5fa) !important;
    color: var(--po-accent-light, #93c5fd) !important;
}

/* Status Tags */
html.dark-side .tabulator-cell .status-success,
[data-theme="dark"] .tabulator-cell .status-success {
    background: rgba(52, 211, 153, 0.15) !important;
    color: #34d399 !important;
}

html.dark-side .tabulator-cell .status-danger,
[data-theme="dark"] .tabulator-cell .status-danger {
    background: rgba(248, 113, 113, 0.15) !important;
    color: #f87171 !important;
}

html.dark-side .tabulator-cell .status-warning,
[data-theme="dark"] .tabulator-cell .status-warning {
    background: rgba(251, 191, 36, 0.15) !important;
    color: #fbbf24 !important;
}

html.dark-side .tabulator-cell .status-default,
[data-theme="dark"] .tabulator-cell .status-default {
    background: var(--po-bg-tertiary, #1a1d21) !important;
    color: var(--po-text-secondary, #b0b7bf) !important;
}

/* Region Label */
html.dark-side .tabulator-cell .region-label,
[data-theme="dark"] .tabulator-cell .region-label {
    color: var(--po-text-muted, #9ca3af) !important;
}

/* Date Cell */
html.dark-side .tabulator-cell .date-cell,
[data-theme="dark"] .tabulator-cell .date-cell {
    color: var(--po-text-secondary, #b0b7bf) !important;
}

/* AI Status */
html.dark-side .tabulator-cell .ai-dms-indexed,
html.dark-side .tabulator-cell .ai-agent-done,
[data-theme="dark"] .tabulator-cell .ai-dms-indexed,
[data-theme="dark"] .tabulator-cell .ai-agent-done {
    color: #34d399 !important;
}

html.dark-side .tabulator-cell .ai-dms-running,
html.dark-side .tabulator-cell .ai-agent-running,
[data-theme="dark"] .tabulator-cell .ai-dms-running,
[data-theme="dark"] .tabulator-cell .ai-agent-running {
    color: var(--po-accent, #60a5fa) !important;
}

html.dark-side .tabulator-cell .ai-agent-none,
[data-theme="dark"] .tabulator-cell .ai-agent-none {
    color: var(--po-text-muted, #9ca3af) !important;
}

/* AI Model Badges */
html.dark-side .tabulator-cell .ai-model-ultra,
[data-theme="dark"] .tabulator-cell .ai-model-ultra {
    background: rgba(96, 165, 250, 0.15) !important;
    color: var(--po-accent-light, #93c5fd) !important;
}

html.dark-side .tabulator-cell .ai-model-basic,
[data-theme="dark"] .tabulator-cell .ai-model-basic {
    background: var(--po-bg-tertiary, #1a1d21) !important;
    color: var(--po-text-secondary, #b0b7bf) !important;
}

/* Text Muted Override */
html.dark-side .tabulator-cell .text-muted,
[data-theme="dark"] .tabulator-cell .text-muted {
    color: var(--po-text-muted, #9ca3af) !important;
}

/* PO Dropdown Menu */
html.dark-side .po-dropdown-menu,
[data-theme="dark"] .po-dropdown-menu {
    background: var(--po-bg-elevated, #2d3139) !important;
    border-color: var(--po-border, #3a3f47) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

html.dark-side .po-dropdown-item,
[data-theme="dark"] .po-dropdown-item {
    color: var(--po-text-primary, #e6e8eb) !important;
}

html.dark-side .po-dropdown-item:hover,
[data-theme="dark"] .po-dropdown-item:hover {
    background: var(--po-bg-hover, #3a4049) !important;
    color: var(--po-accent, #60a5fa) !important;
}

html.dark-side .po-dropdown-divider,
[data-theme="dark"] .po-dropdown-divider {
    background: var(--po-border, #3a3f47) !important;
}

/* Grid Lines: All (Both) - Dark Mode */
html.dark-side .grid-lines-all .tabulator-row .tabulator-cell,
[data-theme="dark"] .grid-lines-all .tabulator-row .tabulator-cell {
    border-color: var(--po-border, #3a3f47) !important;
}

html.dark-side .grid-lines-all .tabulator-header .tabulator-col,
[data-theme="dark"] .grid-lines-all .tabulator-header .tabulator-col {
    border-color: var(--po-border, #3a3f47) !important;
}
