.e-grid {
    border: none;
    font-family: "Trebuchet MS", Aptos, "Segoe UI", sans-serif;
    cursor: default;
    color: var(--fc-text);
    background-color: transparent;
}

.e-grid .e-toolbar {
    border: none;
    background-color: transparent;
}

.e-grid .e-toolbar .e-toolbar-items {
    background-color: transparent;
}

.e-grid .e-headercell,
.e-grid .e-detailheadercell {
    height: 1.375rem;
    background-color: transparent;
}

.e-grid .e-gridheader {
    position: relative;
    min-height: 25px;
    height: 25px;
    padding: 2px 0;
    background: var(--fc-table-header);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius);
    box-shadow: none;
    color: var(--fc-text);
    font-weight: 600;
}

.e-grid .e-gridheader .e-headercell {
    height: 25px;
    margin: -10px 20px -5px -5px;
    border: none;
    color: var(--fc-text);
}

.e-grid .e-headercelldiv {
    margin: -10px 20px -5px -5px;
    color: var(--fc-text);
    font-size: 0.8125rem;
    font-weight: 600;
}

.e-grid .e-gridheader .e-sortfilter .e-fltr-icon .e-headercelldiv,
.e-grid .e-gridheader .e-sortfilter .e-rightalign.e-fltr-icon .e-headercelldiv {
    margin: -10px 20px -5px -5px;
}

.e-grid .e-gridcontent {
    height: 100%;
    border: none;
    background-color: var(--fc-table-row);
}

.e-grid .e-gridcontent .e-row,
.e-grid .e-gridcontent .e-altrow {
    background-color: var(--fc-table-row);
    border: none;
    border-radius: 0;
    overflow: visible;
}

.e-grid .e-rowcell {
    background-color: var(--fc-table-row);
    border-color: var(--fc-divider);
    border-style: solid;
    border-width: 0 0 1px 0;
    color: var(--fc-text);
    font-size: 0.8rem;
}

.e-grid .e-gridcontent tr:hover > .e-rowcell:not(.e-selectionbackground) {
    background-color: var(--fc-table-hover);
}

.e-grid .e-rowcell.e-selectionbackground,
.e-grid .e-row.e-selectionbackground .e-rowcell,
.e-grid tr[aria-selected="true"] > .e-rowcell {
    background-color: var(--fc-table-selected);
    color: var(--fc-text);
}

.e-grid .e-gridcontent tr[aria-selected="true"]:hover > .e-rowcell,
.e-grid .e-gridcontent tr:hover > .e-rowcell.e-selectionbackground {
    background-color: var(--fc-table-selected);
}

.e-grid .e-table {
    border: none;
    border-radius: 0;
    background-color: transparent;
}

/* Grid toolbars are deliberately neutral. Petrol marks hover/focus/active interaction,
   rather than turning every toolbar action into a primary action. */
.e-grid .e-toolbar .e-toolbar-item .e-tbar-btn {
    min-height: 27px;
    height: 27px;
    background-color: var(--fc-surface);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius-sm);
    box-shadow: none;
    color: var(--fc-navy);
    font-size: 0.75rem;
}

.e-grid .e-toolbar .e-toolbar-item .e-tbar-btn:hover {
    background-color: var(--fc-primary-soft);
    border-color: var(--fc-primary);
    color: var(--fc-primary);
}

.e-grid .e-toolbar .e-toolbar-item .e-tbar-btn:focus,
.e-grid .e-toolbar .e-toolbar-item .e-tbar-btn:focus-visible {
    background-color: var(--fc-surface);
    border-color: var(--fc-primary);
    color: var(--fc-primary);
    box-shadow: var(--fc-focus-ring);
}

.e-grid .e-toolbar .e-toolbar-item .e-tbar-btn:disabled,
.e-grid .e-toolbar .e-toolbar-item .e-tbar-btn.e-disabled {
    background-color: var(--fc-surface-secondary);
    border-color: var(--fc-border);
    color: var(--fc-text-disabled);
    opacity: 1;
}

.e-grid .e-toolbar .e-toolbar-item .e-tbar-btn .e-tbar-btn-text,
.e-grid .e-toolbar .e-toolbar-item .e-tbar-btn .e-icons,
.e-grid .e-toolbar .e-toolbar-item .e-tbar-btn.e-tbtn-txt .e-icons.e-btn-icon {
    color: inherit;
}

.e-grid .e-toolbar .e-tbar-btn .e-btn-icon {
    width: 16px;
    height: 16px;
}

.e-grid .e-toolbar .e-tbar-btn-text {
    margin-left: 2px;
}

.e-grid .e-toolbar .e-toolbar-item .e-tbar-btn.e-tbtn-txt .e-icons.e-btn-icon {
    padding: 0 0 0 4px;
    margin-top: -1px;
}

.e-grid .e-toolbar .e-toolbar-item .e-tbar-btn .e-icons.e-btn-icon {
    font-size: 0.875rem;
}

.e-toolbar {
    background-color: transparent;
}

.e-toolbar .e-toolbar-items:not(.e-tbar-pos):not(.e-toolbar-multirow) .e-toolbar-item:first-child {
    margin-left: 0;
}

/* Header icons are structural by default. Active filtering/sorting uses petrol. */
.e-grid .e-gridheader .e-icons:not(.e-icon-hide):not(.e-check):not(.e-stop):not(.e-icon-reorderuparrow):not(.e-icon-reorderdownarrow) {
    color: var(--fc-text-secondary);
}

.e-grid th.e-headercell[aria-sort="ascending"] .e-headertext,
.e-grid th.e-headercell[aria-sort="descending"] .e-headertext,
.e-grid th.e-headercell[aria-sort="ascending"] .e-sortfilterdiv,
.e-grid th.e-headercell[aria-sort="descending"] .e-sortfilterdiv {
    color: var(--fc-primary);
}

.e-grid .e-filtered::before {
    color: var(--fc-primary) !important;
}

.e-grid .e-grouptopleftcell {
    background: var(--fc-surface-secondary);
    color: var(--fc-text);
}

.e-grid .e-rowdragheader {
    background: transparent;
}

.e-grid .e-groupcaption {
    color: var(--fc-text);
    font-size: 0.8rem;
    font-weight: 600;
    background-color: var(--fc-warning-bg);    
}

.e-grid .e-gridcontent.e-wrap .e-rowcell {
    /*white-space: pre-wrap;*/ /* wichtige Einstellung 05.06.2025 REPET: AUSKOMMENTIERT AUS VERZWEIFLUNG MUSS NICHT RICHTIG SEIN???*/
    white-space: pre-line;
    word-break: break-word; /* wenn nötig, Worte umbrechen */
}

.groupitems > .e-grid {
    margin-top: 10px;
    font-size: 0.75rem;
}

.groupitems > .e-grid .e-gridcontent {
    height: unset;
}

.groupControlGridWrapper .e-grid .e-rowcell {
    margin-top: 10px;
    font-size: 0.75rem;
}

.groupitems .e-grid .e-headercelldiv {
    font-size: 0.8rem;
    font-weight: 600;
}

.e-grid .e-filtermenudiv {
    margin-top: -5px;
}

.row-not-relevant {
    opacity: 0.5;
}

/* Phase D: Excel/filter menu popups. The grid itself stays governed by Phase C. */
.e-grid .e-filter-popup,
.e-filter-popup,
.e-excelfilter,
.e-excel-filter,
.e-checkboxfilter {
    color: var(--fc-text);
    background-color: var(--fc-surface);
}

.e-filter-popup.e-popup,
.e-excelfilter.e-popup,
.e-excel-filter.e-popup,
.e-checkboxfilter.e-popup,
.e-grid .e-filter-popup.e-popup {
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius);
    box-shadow: var(--fc-shadow-dialog);
}

.e-excelfilter .e-searchbox,
.e-excel-filter .e-searchbox,
.e-checkboxfilter .e-searchbox,
.e-filter-popup .e-searchbox {
    border-color: var(--fc-border);
    background-color: var(--fc-surface);
}

.e-excelfilter .e-searchbox:focus-within,
.e-excel-filter .e-searchbox:focus-within,
.e-checkboxfilter .e-searchbox:focus-within,
.e-filter-popup .e-searchbox:focus-within {
    border-color: var(--fc-primary);
    box-shadow: var(--fc-focus-ring);
}

.e-excelfilter .e-ftrchk,
.e-excel-filter .e-ftrchk,
.e-checkboxfilter .e-ftrchk,
.e-filter-popup .e-ftrchk,
.e-excelfilter .e-checkboxlist,
.e-excel-filter .e-checkboxlist,
.e-checkboxfilter .e-checkboxlist {
    color: var(--fc-text);
    background-color: var(--fc-surface);
}

.e-excelfilter .e-ftrchk:hover,
.e-excel-filter .e-ftrchk:hover,
.e-checkboxfilter .e-ftrchk:hover,
.e-filter-popup .e-ftrchk:hover {
    background-color: var(--fc-primary-soft);
}

.e-excelfilter .e-menu-item,
.e-excel-filter .e-menu-item,
.e-filter-popup .e-menu-item,
.e-grid .e-filter-popup .e-menu-item {
    color: var(--fc-text);
    background-color: var(--fc-surface);
}

.e-excelfilter .e-menu-item:hover,
.e-excelfilter .e-menu-item.e-focused,
.e-excel-filter .e-menu-item:hover,
.e-excel-filter .e-menu-item.e-focused,
.e-filter-popup .e-menu-item:hover,
.e-filter-popup .e-menu-item.e-focused {
    color: var(--fc-primary);
    background-color: var(--fc-primary-soft);
}

.e-excelfilter .e-footer-content,
.e-excel-filter .e-footer-content,
.e-filter-popup .e-footer-content,
.e-checkboxfilter .e-footer-content {
    border-top-color: var(--fc-divider);
    background-color: var(--fc-surface);
}

.e-excelfilter .e-btn.e-primary,
.e-excel-filter .e-btn.e-primary,
.e-filter-popup .e-btn.e-primary,
.e-checkboxfilter .e-btn.e-primary {
    border-color: var(--fc-primary);
    background-color: var(--fc-primary);
    color: #FFFFFF;
}

.e-excelfilter .e-btn.e-primary:hover,
.e-excel-filter .e-btn.e-primary:hover,
.e-filter-popup .e-btn.e-primary:hover,
.e-checkboxfilter .e-btn.e-primary:hover {
    border-color: var(--fc-primary-hover);
    background-color: var(--fc-primary-hover);
}


/* Final design pass: Grid filter / Excel filter and Column Chooser.
   Syncfusion renders these popups at document level, so selectors must not
   depend on an .e-grid ancestor. Typography follows the grid row text. */
.e-excelfilter,
.e-excel-filter,
.e-checkboxfilter,
.e-filter-popup,
.e-ccdlg,
.e-ccdlg.e-dialog,
.e-ccdlg .e-dlg-content,
.e-ccdlg .e-footer-content {
    font-size: 0.8rem !important;
    color: var(--fc-text) !important;
    background: var(--fc-surface) !important;
}

.e-excelfilter *,
.e-excel-filter *,
.e-checkboxfilter *,
.e-filter-popup *,
.e-ccdlg * {
    font-size: inherit;
}

.e-excelfilter.e-popup,
.e-excel-filter.e-popup,
.e-checkboxfilter.e-popup,
.e-filter-popup.e-popup,
.e-ccdlg.e-dialog {
    border: 1px solid var(--fc-border) !important;
    border-radius: var(--fc-radius) !important;
    background: var(--fc-surface) !important;
    box-shadow: var(--fc-shadow-dialog) !important;
}

/* Filter operator/menu entries and checkbox rows. */
.e-excelfilter .e-menu-item,
.e-excel-filter .e-menu-item,
.e-filter-popup .e-menu-item,
.e-excelfilter .e-ftrchk,
.e-excel-filter .e-ftrchk,
.e-checkboxfilter .e-ftrchk,
.e-filter-popup .e-ftrchk {
    color: var(--fc-text) !important;
    background: var(--fc-surface) !important;
}

.e-excelfilter .e-menu-item:hover,
.e-excelfilter .e-menu-item.e-focused,
.e-excel-filter .e-menu-item:hover,
.e-excel-filter .e-menu-item.e-focused,
.e-filter-popup .e-menu-item:hover,
.e-filter-popup .e-menu-item.e-focused,
.e-excelfilter .e-ftrchk:hover,
.e-excel-filter .e-ftrchk:hover,
.e-checkboxfilter .e-ftrchk:hover,
.e-filter-popup .e-ftrchk:hover {
    color: var(--fc-primary) !important;
    background: var(--fc-primary-soft) !important;
}

/* Column chooser */
.e-ccdlg .e-dlg-header-content,
.e-ccdlg .e-dlg-header,
.e-ccdlg .e-cc-searchdiv,
.e-ccdlg .e-cc-contentdiv,
.e-ccdlg .e-ccul-ele,
.e-ccdlg .e-cclist {
    color: var(--fc-text) !important;
    background: var(--fc-surface) !important;
}

.e-ccdlg .e-dlg-header-content {
    border-bottom: 1px solid var(--fc-divider) !important;
}

.e-ccdlg .e-footer-content {
    border-top: 1px solid var(--fc-divider) !important;
}

.e-ccdlg .e-cclist:hover,
.e-ccdlg .e-cclist.e-hover,
.e-ccdlg .e-cclist.e-active {
    color: var(--fc-primary) !important;
    background: var(--fc-primary-soft) !important;
}

.e-ccdlg .e-input-group,
.e-ccdlg .e-input-group.e-control-wrapper,
.e-excelfilter .e-input-group,
.e-excel-filter .e-input-group,
.e-filter-popup .e-input-group {
    border-color: var(--fc-border) !important;
    background: var(--fc-surface) !important;
}

.e-ccdlg .e-input-group:focus-within,
.e-ccdlg .e-input-group.e-input-focus,
.e-excelfilter .e-input-group:focus-within,
.e-excel-filter .e-input-group:focus-within,
.e-filter-popup .e-input-group:focus-within {
    border-color: var(--fc-primary) !important;
    box-shadow: var(--fc-focus-ring) !important;
}

.e-grid .e-ccdlg .e-ccul-ele{
    margin: 0;
}