.gmail-search {
    background-color: var(--surface, #f8fafc);
    border-radius: var(--radius-full, 9999px);
    padding: 6px 12px;
    display: flex;
    align-items: center;
    max-width: 100%;
    min-width: 0;
    border: 1px solid var(--border, #e5e7eb);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.gmail-search:focus-within {
    border-color: var(--primary, #6d28d9);
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.2);
}

.gmail-search .input-group-text {
    background: none;
    border: none;
    color: var(--text-muted, #6b7280);
    padding: 0 4px 0 2px;
    flex-shrink: 0;
}

.gmail-search input {
    border: none;
    background: transparent;
    padding: 0 4px;
    font-size: 0.85rem;
    outline: none;
    box-shadow: none;
    min-width: 0;
    flex: 1 1 auto;
    max-width: 100%;
    color: var(--text-gray, #374151);
}

.gmail-search input::placeholder {
    color: var(--text-muted, #9ca3af);
}


#filtercontainer {
    max-width: 280px;
    flex-shrink: 0;
}

/* Filter-Card (Sidebar) – moderner Look */
.sidebar .card {
    border-radius: var(--radius-md, 12px);
    border: 1px solid var(--border, #e5e7eb);
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,0.05));
}

.sidebar .card h5 {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-gray, #374151);
}

.sidebar .card h5 .bi {
    color: var(--primary, #6d28d9);
    margin-right: 0.35rem;
}

/* Abschnittsüberschriften in der Filter-Sidebar */
.filter-group {
    margin-bottom: 1rem;
}

.filter-group-title {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted, #6b7280);
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border, #e5e7eb);
}

#filtercontainer h3 {
  font-size: 1rem;
  margin-top: 1rem;
}


/* Sidebar Grundlayout */
.filter-sidebar {
    font-size: 0.85rem;
  max-height: calc(100vh - 8rem); /* 🔑 ENTSCHEIDEND */
  overflow-y: auto;
  padding-right: 0.5rem;
  scrollbar-gutter: stable;
}

/* Optional: Scrollbar dezenter */
.filter-sidebar::-webkit-scrollbar {
    width: 6px;
}
.filter-sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.2);
    border-radius: 4px;
}
.filter-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

/* Sektionen */
.filter-section {
  margin-bottom: 1.4rem;
}

.filter-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 10px;
}

/* Kompakte Chip-Optik für Kosten & CME (weniger Platz) */
.filter-options-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  grid-template-columns: unset;
}

.filter-options-compact .filter-checkbox {
  padding: 5px 12px;
  margin: 0;
  font-size: 0.8rem;
  border-radius: var(--radius-full, 9999px);
  background: var(--primary-lighter, #ecfdf5);
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s;
}

.filter-options-compact .filter-checkbox:hover {
  background: var(--primary-light, #d1fae5);
}

.filter-options-compact .filter-checkbox span {
  font-size: 0.8rem;
  color: var(--text-gray, #374151);
}

.filter-section-compact {
  margin-bottom: 0.9rem;
}

.filter-section-compact .filter-label {
  margin-bottom: 0.35rem;
}

/* Überschriften */
.filter-label {
  display: block;
  font-weight: 600;
  font-size: 0.7rem;
  color: var(--text-muted, #6b7280);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Dozent: Toggle-Button wie Filter-Label, Chevron dreht sich */
.filter-label-toggle {
  background: none;
  border: none;
  padding: 0;
  margin-bottom: 0.5rem;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.filter-label-toggle:hover {
  color: var(--text-gray, #374151);
}

.filter-toggle-icon {
  font-size: 0.75rem;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.filter-label-toggle[aria-expanded="true"] .filter-toggle-icon {
  transform: rotate(180deg);
}

.filter-label-sub {
  display: block;
  font-weight: 500;
  font-size: 0.75rem;
  color: #555;
  margin-bottom: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
} 

/* Checkbox-Design */
.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 10px;
  cursor: pointer;
}

.filter-checkbox input {
  accent-color: var(--primary, #6d28d9);
}

.filter-checkbox span {
    color: #222;
}

/* Kategorie: kompakter, linksbündig, ruhigeres Schriftbild */
.filter-options-category {
  grid-template-columns: 1fr;
  gap: 3px;
}

.filter-checkbox-category {
  padding: 3px 6px;
  gap: 6px;
  border-radius: 8px;
  align-items: flex-start;
}

.filter-checkbox-category input {
  margin-top: 0.1rem;
  flex-shrink: 0;
}

.filter-checkbox-category span {
  font-size: 0.8rem;
  line-height: 1.25;
}

.filter-section-category .small {
  font-size: 0.68rem !important;
  margin-bottom: 0.2rem !important;
}

.filter-checkbox:hover {
  background-color: var(--primary-lighter, #ecfdf5);
}

/* Select-All hervorheben */
.filter-checkbox.select-all {
  font-weight: 500;
}


.filter-input {
  width: 100%;
  background-color: var(--surface, #f8fafc);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-md, 12px);
  padding: 8px 12px;
  font-size: 0.85rem;
}

.filter-input:focus {
  outline: none;
  border-color: var(--primary, #6d28d9);
  box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.2);
}

.filter-toggle {                     /* ⬅️ Bootstrap-Button resetten */
  display: flex;
  padding: 0;
  width: 100%;
  cursor: pointer;

  font-size: 0.85rem;
  font-weight: 500;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.04em;

  background-color: white;
  border: none;
  margin-bottom: 0.4rem;
}


.filter-toggle::after {
  content: "▾";
  font-size: 0.9rem;
  opacity: 0.6;
}

.filter-count {
  font-weight: 500;
  font-size: 0.9rem;
  opacity: 0.6;
  margin-left: 0.5rem;
}

#filtercontainer .form-control {
  font-size: 0.85rem;
  color: var(--text-gray, #374151);
  background-color: var(--surface, #f8fafc);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-md, 12px);
  padding: 8px 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#filtercontainer .form-control:focus {
  border-color: var(--primary, #6d28d9);
  box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.2);
  outline: none;
}

.sidebar {
    position: sticky;
    top: 1rem;
    flex: 0 0 auto;       /* nimmt nur so viel Platz wie nötig */
    min-width: 220px;
    max-width: 300px;
    height: calc(100vh - 2rem); /* Viewport minus Abstand */

}

.main-content {
    flex: 1 1 auto;
    min-width: 0;
}

/* --- Mobile: Filter als Slide-in-Overlay --- */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
.sidebar-backdrop.show {
    opacity: 1;
    visibility: visible;
}

/* Filter-Button nur auf Mobile – dezent, nicht dominant */
.sidebar-toggle-btn {
    position: fixed;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1030;
    width: auto;
    max-width: none;
    flex: 0 0 auto;
    padding: 0.6rem 1.25rem !important;
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 9999px;
    min-height: 44px;
    min-width: 120px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: var(--surface-elevated, #fff);
    color: var(--text-gray, #374151);
    border: 1px solid var(--border, #e5e7eb);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.sidebar-toggle-btn .bi {
    color: var(--primary, #6d28d9);
    font-size: 1rem;
}
.sidebar-toggle-btn:hover {
    background: var(--surface, #f8fafc);
    color: var(--text-gray);
    border-color: var(--primary-muted, #ddd6fe);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}
.sidebar-toggle-btn:active {
    transform: translateX(-50%) scale(0.98);
}

body.sidebar-open-mobile {
    overflow: hidden;
}

@media (max-width: 767.98px) {
    .row.flex-sidebar {
        flex-direction: row;
        /* Bootstrap-Gutter (negative Ränder) würden die Seite breiter als den Viewport machen */
        margin-left: 0;
        margin-right: 0;
    }
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: min(88%, 320px);
        max-width: 320px;
        height: 100vh;
        min-height: 100dvh;
        max-height: none;
        z-index: 1050;
        margin: 0;
        border-radius: 0;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar .card {
        border-radius: 0;
        border: none;
        box-shadow: none;
        min-height: 100%;
    }
    .sidebar .card-body {
        padding: 1rem 1.25rem;
        padding-top: max(1rem, env(safe-area-inset-top));
        padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    }
    #filtercontainer {
        max-width: none;
        width: 100%;
    }
    .filter-sidebar .filter-options {
        grid-template-columns: 1fr;
    }
    .sidebar-close {
        min-width: 44px;
        min-height: 44px;
        flex-shrink: 0;
    }
}

@media (min-width: 768px) {
    .sidebar-backdrop,
    .sidebar-close {
        display: none !important;
    }
    .sidebar-toggle-btn {
        display: none !important;
    }
}

/* Mobile: Filter öffnen über den Chip in der Schnellfilter-Zeile; der schwebende
   Button bleibt nur als Auslöser im DOM (wird per JS geklickt) */
@media (max-width: 767.98px) {
    .sidebar-toggle-btn {
        display: none !important;
    }
    .flex-sidebar .main-content {
        padding-bottom: 4.5rem;
        padding-left: 0;
        padding-right: 0;
    }
}

.row.flex-sidebar {
    display: flex;
    flex-wrap: nowrap; /* verhindert automatisches umbrechen *//* optionaler Abstand */
}


/* Container */
.range-slider {
  margin: 12px 0 12px 0;
}

/* Grund-Leiste (grüner Akzent) */
.range-slider .noUi-target {
  background: var(--border, #e5e7eb);
  border-radius: 999px;
  border: none;
  box-shadow: none;
}

/* horizontale Höhe */
.range-slider .noUi-horizontal {
  height: 6px;
}

/* Basis */
.range-slider .noUi-base {
  border-radius: 999px;
}

/* Connect → grüner Füllbereich */
.range-slider .noUi-connect {
  background: var(--primary, #6d28d9);
  border-radius: 999px;
}

/* Handles */
.range-slider .noUi-horizontal .noUi-handle {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--primary, #6d28d9);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  cursor: pointer;
  right: -8px;
  top: -5px;
}

/* noUi-Standard-Striche entfernen */
.range-slider .noUi-handle::before,
.range-slider .noUi-handle::after {
  display: none;
}

/* Fokus / Aktiv (dezenter Effekt) */
.range-slider .noUi-handle:focus,
.range-slider .noUi-handle:active {
  outline: none;
  border-color: #000;
}

#filtercontainer .filter-label {
  color: var(--text-muted, #6b7280);
  font-size: 0.7rem;
}

#price-min-display,
#price-max-display {
  color: inherit;
}

#price-min-display::after {
  content: " - ";
  opacity: 0.6;
}

#cme-min-display,
#cme-max-display {
  color: inherit;
}