/* === base.css === */
/* =============================================================
   BASE — Fonts, CSS-Variablen & Grundlayout
   ============================================================= */

/* Lokale Font-Dateien (kein externer CDN nötig) */
@font-face { font-family: 'Source Sans 3'; font-weight: 300; font-style: normal; font-display: swap; src: url('../fonts/source-sans-3-300.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-weight: 400; font-style: normal; font-display: swap; src: url('../fonts/source-sans-3-400.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-weight: 500; font-style: normal; font-display: swap; src: url('../fonts/source-sans-3-500.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-weight: 600; font-style: normal; font-display: swap; src: url('../fonts/source-sans-3-600.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-weight: 700; font-style: normal; font-display: swap; src: url('../fonts/source-sans-3-700.woff2') format('woff2'); }

:root {
    /* Konfigurierbare Grundfarben (werden über Einstellungen/DB überschrieben) */
    --dark-bg: #263238;
    --primary-green: #2E7D32;
    --hover-green: #4CAF50;
    --page-bg: #f7f9fc;

    /* Feste Designfarben */
    --text-light: #ECEFF1;
    --text-dark: #37474F;
    --card-bg: #FFFFFF;
    --border-color: #CFD8DC;

    /* Automatisch abgeleitete Farbtöne — passen sich an JEDE Primärfarbe an.
       Werden von color-mix() aus --primary-green berechnet. */
    --primary-5:  color-mix(in srgb, var(--primary-green), white 95%);  /* Toolbar/Panel-BG */
    --primary-10: color-mix(in srgb, var(--primary-green), white 90%);  /* Selected/Hover-BG */
    --primary-20: color-mix(in srgb, var(--primary-green), white 80%);  /* Active/Pressed-BG */
    --primary-30: color-mix(in srgb, var(--primary-green), white 70%);  /* Borders */
    --primary-35: color-mix(in srgb, var(--primary-green), white 65%);  /* Dunklere Borders */
    --primary-50: color-mix(in srgb, var(--primary-green), white 50%);  /* Akzent-Borders */

    /* Typografie */
    --font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    /* Navigation */
    --nav-width-collapsed: 56px;
    --nav-width-expanded: 240px;
}

html, body {
    height: 100%;
    overflow-x: hidden;
}

/* Scrollbar-Styling — NICHT auf PowerTable/Tabellen anwenden */
/* Firefox */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-30) transparent;
}
/* Chromium (Edge, Chrome) — nur Haupt-Scrollbar */
html::-webkit-scrollbar { width: 8px; height: 8px; }
html::-webkit-scrollbar-track { background: transparent; }
html::-webkit-scrollbar-thumb { background: var(--primary-30); border-radius: 4px; }
html::-webkit-scrollbar-thumb:hover { background: var(--primary-50); }

body {
    font-family: var(--font-family);
    margin: 0;
    background-color: var(--page-bg);
    color: var(--text-dark);
    position: relative;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
}

/* Headings */
h1 { font-size: 1.75rem; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 0.75rem; color: var(--text-dark); }
h2 { font-size: 1.25rem; font-weight: 700; line-height: 1.3; letter-spacing: -0.015em; margin: 0 0 0.5rem; color: var(--text-dark); }
h3 { font-size: 1rem; font-weight: 600; line-height: 1.4; margin: 0 0 0.5rem; color: var(--text-dark); }

/* Globale Animationen */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

/* Staggered Fade-In für Listen/Grids */
.animate-in > * {
    opacity: 0;
    animation: fadeInUp 0.4s ease forwards;
}
.animate-in > *:nth-child(1) { animation-delay: 0.03s; }
.animate-in > *:nth-child(2) { animation-delay: 0.06s; }
.animate-in > *:nth-child(3) { animation-delay: 0.09s; }
.animate-in > *:nth-child(4) { animation-delay: 0.12s; }
.animate-in > *:nth-child(5) { animation-delay: 0.15s; }
.animate-in > *:nth-child(6) { animation-delay: 0.18s; }
.animate-in > *:nth-child(7) { animation-delay: 0.21s; }
.animate-in > *:nth-child(8) { animation-delay: 0.24s; }
.animate-in > *:nth-child(9) { animation-delay: 0.27s; }
.animate-in > *:nth-child(10) { animation-delay: 0.30s; }

/* Globale SVG-Icon-Klassen (Sprite-Sheet: partials/_icon_sprites.html) */
.icon      { width: 1em; height: 1em; display: inline-block; vertical-align: middle; flex-shrink: 0; }
.icon-sm   { width: 0.75em; height: 0.75em; }
.icon-lg   { width: 1.25em; height: 1.25em; }
.icon-xl   { width: 1.5em; height: 1.5em; }
.icon-hero { width: 48px; height: 48px; }

/* Card Entrance Animation */
.card { animation: fadeInUp 0.35s ease both; }

/* === layout.css === */
/* =============================================================
   LAYOUT — Header, Navigation, Container, Footer, Vollbild
   ============================================================= */

/* === Main Wrapper === */
.main-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--page-bg);
}

/* === Header === */
/* Header geht über die volle Breite, ÜBER der Sidebar */
.header {
    display: flex;
    align-items: center;
    background-color: var(--primary-green);
    color: var(--text-light);
    padding: 0 1.5rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    height: 52px;
    box-sizing: border-box;
}

/* Hamburger-Menü — nur auf Mobile sichtbar */
.menu-icon { display: none; cursor: pointer; padding: 0.5rem; }
.menu-icon span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-light);
    margin: 5px 0;
    border-radius: 1px;
    transition: transform 0.2s, opacity 0.2s;
}

.header-title {
    margin-left: 0.5rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.header-logo {
    height: 36px;
    width: auto;
    margin-right: 0.75rem;
}

.app-name {
    font-weight: 700;
    font-size: 1rem;
}

.module-name {
    font-weight: 400;
    font-size: 0.9rem;
    margin-left: 0.75rem;
    padding-left: 0.75rem;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    gap: 0.375rem;
    opacity: 0.9;
}

.header-module-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: inherit;
}

/* Header-Aktionen (E-Mail-Badge etc.) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
    padding-right: 1rem;
}

.header-action-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    transition: background 0.2s;
}

.header-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.header-action-icon {
    width: 22px;
    height: 22px;
}

.header-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #dc3545;
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === Seitliche Navigation (kompakte Sidebar) === */
/* Sidebar sitzt UNTER dem Header und ÜBER dem Footer */
.side-nav {
    position: fixed;
    top: 52px;
    left: 0;
    bottom: 44px;
    width: var(--nav-width-collapsed);
    background-color: var(--dark-bg);
    z-index: 100;
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0;
    box-sizing: border-box;
    overflow: hidden;
    overflow-y: auto;
    transition: width 0.25s ease;
}

.side-nav:hover,
.side-nav.expanded {
    width: var(--nav-width-expanded);
}

/* Overlay-Schatten beim Aufklappen */
.side-nav:hover::after,
.side-nav.expanded::after {
    content: '';
    position: fixed;
    top: 0;
    left: var(--nav-width-expanded);
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.08);
    pointer-events: none;
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.nav-button {
    padding: 0.6rem 0;
    padding-left: 15px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    gap: 1rem;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    border-left: 3px solid transparent;
    margin: 1px 0;
}
/* 3px border + 15px padding + 20px icon + 16px gap = 54px → bei 56px Breite ist der Text komplett verdeckt */

.nav-button:hover {
    background-color: rgba(255,255,255,0.08);
    color: #fff;
    border-left-color: var(--primary-green);
    padding-left: 18px;
}

/* Aktiver Nav-Link (wird per JS gesetzt) */
.nav-button.nav-active {
    background-color: rgba(255,255,255,0.12);
    color: #fff;
    border-left-color: var(--hover-green);
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-left: 0.1rem;
    color: inherit;
}

.nav-spacer {
    flex-grow: 1;
    min-height: 1rem;
}

.nav-settings {
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: auto;
    padding-top: 0.25rem;
}

.logout-button {
    color: rgba(255,255,255,0.5);
}
.logout-button:hover {
    color: #ef9a9a;
    border-left-color: #ef5350;
}

/* === Sub-Navigation / Tab-Header === */
.tab-header {
    background-color: var(--dark-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    gap: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    position: fixed;
    top: 52px;
    left: 0;
    right: 0;
    z-index: 1001;
    height: 36px;
    box-sizing: border-box;
}

.tab-header::-webkit-scrollbar {
    display: none;
}

.tab-header .tab-item {
    padding: 0.6rem 1.25rem;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    border-bottom: 3px solid transparent;
    opacity: 0.7;
}

.tab-header .tab-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    opacity: 1;
}

.tab-header .tab-item.active {
    border-bottom: 3px solid var(--primary-green);
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.05);
}

/* Tab-Inhalte */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* === Hauptinhaltsbereich === */
.container {
    flex-grow: 1;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
    padding-top: calc(52px + 2rem);
    padding-bottom: calc(44px + 2rem);
    box-sizing: border-box;
}

/* Sidebar vorhanden (eingeloggt): Content nach rechts verschieben.
   Header/Footer bleiben volle Breite. Nur Content und Tab-Header verschieben. */
.side-nav ~ .main-wrapper {
    margin-left: var(--nav-width-collapsed);
}
/* Tab-Header: volle Breite wie Header/Footer */
/* Wenn Tab-Header vorhanden: Sidebar startet darunter */
body:has(.tab-header) .side-nav {
    top: calc(52px + 36px);
}

/* Wenn Tab-Header vorhanden ist */
.tab-header ~ main.container {
    padding-top: calc(52px + 36px + 2rem);
}

/* === Footer === */
/* Footer geht über die volle Breite, ÜBER der Sidebar */
.footer {
    background-color: var(--dark-bg);
    color: #90A4AE;
    text-align: center;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    height: 44px;
    box-sizing: border-box;
}

.footer p {
    margin: 0;
    color: #90A4AE;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
}

.footer-content .footer-version {
    position: absolute;
    left: 0;
    font-size: 0.75rem;
    color: #90A4AE;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.2s;
}

.footer-content .footer-version:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.footer-content .meldung-footer-btn {
    position: absolute;
    right: 0;
}

.footer a {
    color: #B0BEC5;
    text-decoration: none;
    transition: color 0.2s;
}

.footer a:hover {
    color: var(--hover-green);
}

/* Meldung-Button im Footer */
.meldung-footer-btn {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    background-color: #c62828;
    color: white !important;
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background-color 0.2s, transform 0.1s;
    text-decoration: none !important;
}

.meldung-footer-btn:hover {
    background-color: #b71c1c;
    transform: scale(1.02);
    text-decoration: none !important;
}

/* === Fullwidth Card für Tabellen === */
.card-fullwidth {
    width: 100%;
    max-width: none !important;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .card-fullwidth {
        width: calc(100vw - 20px);
        margin-left: -10px;
        margin-right: -10px;
        padding: 1rem !important;
    }
}

/* === Fullheight Layout (kein Seiten-Scroll) === */
html:has(.page-fullheight),
body:has(.page-fullheight) {
    height: 100vh;
    overflow: hidden;
}

.main-wrapper:has(.page-fullheight) {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.main-wrapper:has(.page-fullheight) > .container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-width: none;
    padding: 1rem;
    padding-top: calc(52px + 1rem);
    padding-bottom: calc(44px + 1rem);
}

/* Footer bleibt immer sichtbar */

.page-fullheight {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    padding: 1rem 1.5rem !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.page-fullheight .table-container {
    flex: 1;
    min-height: 0;
}

.page-fullheight .view-controls,
.page-fullheight .statistik-leiste,
.page-fullheight .view-management,
.page-fullheight .filter-bar,
.page-fullheight .action-buttons {
    flex-shrink: 0;
}

/* === Tab-basierte Seiten (Mitglieder, Veranstaltungen) === */
html:has(#mitglied-tabelle-ansicht.active),
html:has(#veranstaltung-tabelle-ansicht.active) {
    height: 100vh;
    overflow: hidden;
}

body:has(#mitglied-tabelle-ansicht.active),
body:has(#veranstaltung-tabelle-ansicht.active) {
    height: 100vh;
    overflow: hidden;
}

.main-wrapper:has(#mitglied-tabelle-ansicht.active),
.main-wrapper:has(#veranstaltung-tabelle-ansicht.active) {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.main-wrapper:has(#mitglied-tabelle-ansicht.active) > .container,
.main-wrapper:has(#veranstaltung-tabelle-ansicht.active) > .container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-width: none;
    padding: 1rem;
    padding-top: calc(52px + 36px + 1rem);
    padding-bottom: calc(44px + 1rem);
}

/* Footer bleibt immer sichtbar */

#mitglieder-card:has(#mitglied-tabelle-ansicht.active),
#veranstaltungen-card:has(#veranstaltung-tabelle-ansicht.active) {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

#mitglied-tabelle-ansicht.active,
#veranstaltung-tabelle-ansicht.active {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

#mitglied-tabelle-ansicht .table-container,
#veranstaltung-tabelle-ansicht .table-container {
    flex: 1;
    min-height: 0;
}

#mitglied-tabelle-ansicht .view-management,
#veranstaltung-tabelle-ansicht .view-management {
    flex-shrink: 0;
}

/* Ansichten ein-/ausblenden */
#mitglied-detail-ansicht,
#mitglied-tabelle-ansicht,
#veranstaltung-detail-ansicht,
#veranstaltung-tabelle-ansicht {
    display: none;
}

#mitglied-detail-ansicht.active,
#veranstaltung-detail-ansicht.active {
    display: block;
}

/* Tabellen-Ansichten: display: flex (nicht block!) — sonst bricht die Flex-Kette
   und .table-container kann die Höhe nicht begrenzen → Tabelle wächst endlos */

/* === Mobile: Sidebar als Overlay, Hamburger sichtbar === */
@media (max-width: 768px) {
    .menu-icon { display: block; }

    .side-nav {
        left: calc(-1 * var(--nav-width-expanded));
        width: var(--nav-width-expanded);
    }
    .side-nav.expanded { left: 0; }
    .side-nav:hover { width: var(--nav-width-expanded); }

    .header,
    .tab-header,
    .footer,
    .container,
    .side-nav ~ .main-wrapper {
        left: 0 !important;
        margin-left: 0 !important;
    }

    .container {
        padding-top: calc(52px + 1.5rem);
    }

    .tab-header ~ main.container {
        padding-top: calc(52px + 36px + 1.5rem);
    }
}

/* === buttons.css === */
/* =============================================================
   BUTTONS — Alle Button-Varianten
   ============================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.35rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    min-height: 34px;
    box-sizing: border-box;
    font-family: inherit;
    color: var(--text-light);
    background-color: var(--primary-green);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-30);
}

.btn:hover {
    background-color: var(--hover-green);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn:active {
    transform: translateY(0) scale(0.97);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.btn-primary {
    background-color: var(--primary-green);
    color: white;
}

.btn-primary:hover {
    background-color: var(--hover-green);
}

.btn-secondary {
    background-color: #607D8B;
    color: white;
}

.btn-secondary:hover {
    background-color: #78909C;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-dark);
}

.btn-outline:hover {
    background-color: var(--primary-5);
    border-color: var(--primary-green);
    color: var(--primary-green);
}

.btn-danger {
    background-color: #c62828;
    color: white;
}

.btn-danger:hover {
    background-color: #b71c1c;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
}

.btn-responsive {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: auto;
    max-width: 220px;
}

@media (max-width: 768px) {
    .btn-responsive span {
        display: none;
    }
}

/* Icon-Buttons */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background-color: var(--primary-5);
    color: var(--primary-green);
    transform: scale(1.1);
}

.btn-icon:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-icon:disabled:hover {
    background: transparent;
}

.btn-icon svg {
    width: 18px;
    height: 18px;
}

.btn-icon-danger {
    color: #c62828;
}

.btn-icon-danger:hover {
    background-color: #ffebee;
    color: #b71c1c;
}

.btn-icon-small {
    padding: 0.25rem;
    width: 24px;
    height: 24px;
}

/* Lade-Zustand für Buttons (universal) */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}
.btn-loading::after {
    content: '';
    position: absolute;
    width: 1rem;
    height: 1rem;
    border: 2px solid #fff;
    border-right-color: transparent;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
    left: calc(50% - 0.5rem);
    top: calc(50% - 0.5rem);
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* Aktionen-Zelle in Tabellen */
.aktionen-cell {
    white-space: nowrap;
    text-align: center;
}

.aktionen-cell .btn-icon {
    margin: 0 2px;
}

/* === forms.css === */
/* =============================================================
   FORMS — Formulare, Inputs, Einstellungen, Toggles, Upload
   ============================================================= */

/* === Basis-Formular === */
.form-group {
    margin-bottom: 1rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 0.9375rem;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px var(--primary-30);
    outline: none;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.form-actions {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.form-hint {
    display: block;
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.25rem;
}

.field-hint {
    font-size: 0.85rem;
    color: #78909C;
    margin: 0.25rem 0 0.75rem 0;
}

/* === Einstellungen-Seite === */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.form-chapter {
    background-color: var(--page-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.form-chapter-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary-green);
    margin: 0 0 1.25rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-10);
}

/* === Autocomplete === */
.autocomplete-results {
    position: absolute;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 100%;
    max-height: 150px;
    overflow-y: auto;
    z-index: 2100;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.autocomplete-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.5rem;
}

.autocomplete-item:last-child { border-bottom: none; }

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: #f5f5f5;
}

.autocomplete-item .ort {
    color: #6c757d;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

.autocomplete-item .mitglied-nr {
    color: var(--primary-green);
    font-weight: 600;
    font-size: 0.85rem;
    margin-right: 0.5rem;
    min-width: 40px;
    display: inline-block;
}

.autocomplete-name  { font-weight: 500; font-size: 0.9rem; }
.autocomplete-email { color: #666; font-size: 0.8rem; }

.autocomplete-source {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    margin-left: auto;
    flex-shrink: 0;
}

.autocomplete-source-bekannt  { background-color: #e3f2fd; color: #1565c0; }
.autocomplete-source-mitglied { background-color: var(--primary-10); color: var(--primary-green); }

.autocomplete-container { position: relative; }

.zahler-search-container {
    position: relative;
    width: 100%;
}

.zahler-search-container input {
    width: 100%;
    box-sizing: border-box;
}

.zahler-search-container .autocomplete-results {
    top: 100%;
    left: 0;
    margin-top: 2px;
}

/* === Multi-Select === */
.multi-select-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.multi-select-container label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--page-bg);
    padding: 5px 10px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
}

/* === Toggle (Ein-/Ausschalter) === */
.toggle-label,
.form-group .toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    margin-bottom: 0;
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 50px;
    min-width: 50px;
    height: 26px;
    background-color: #ccc;
    border-radius: 13px;
    transition: background-color 0.3s;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background-color: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider {
    background-color: var(--primary-green);
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.toggle-text { font-weight: 500; }

/* === Checkbox-Label === */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] { width: 18px; height: 18px; }

/* === Passwort-Feld === */
.password-field {
    position: relative;
    display: flex;
    align-items: center;
}

.password-field input {
    flex: 1;
    padding-right: 45px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-dark);
    opacity: 0.6;
}

.password-toggle:hover { opacity: 1; }
.eye-icon { font-size: 1.2rem; }

/* === Farbauswahl === */
.color-picker-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.color-input-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.color-input-wrapper input[type="color"] {
    width: 50px;
    height: 38px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    padding: 2px;
}

.color-text {
    width: 90px;
    font-family: monospace;
    text-transform: uppercase;
}

.color-preview-box {
    margin-top: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    height: 100px;
    display: flex;
}

.color-preview-box .preview-header {
    flex: 2;
    background-color: var(--primary-green);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

.color-preview-box .preview-nav {
    flex: 1;
    background-color: var(--dark-bg);
    color: #90A4AE;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.color-preview-box .preview-content {
    flex: 2;
    background-color: var(--page-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
    font-size: 0.85rem;
}

@media (max-width: 600px) {
    .color-picker-grid { grid-template-columns: 1fr; }
}

/* === Logo-Upload === */
.logo-upload-area {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.logo-preview {
    width: 120px;
    height: 120px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fafafa;
    overflow: hidden;
}

.logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.logo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: #90A4AE;
}

.logo-placeholder svg  { width: 40px; height: 40px; }
.logo-placeholder span { font-size: 0.8rem; }

.logo-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.upload-hint {
    font-size: 0.75rem;
    color: #90A4AE;
    margin: 0;
}

@media (max-width: 600px) {
    .logo-upload-area {
        flex-direction: column;
        align-items: center;
    }
}

/* Visuell versteckt aber erreichbar */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* === Upload-Area (Bilanz / Drag & Drop) === */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #90A4AE;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary-green);
    background: rgba(46, 125, 50, 0.05);
}

/* Datei-Upload-Bereich */
.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    background: #fafafa;
}

.file-upload-area:hover,
.file-upload-area.dragover {
    border-color: var(--primary-green);
    background: var(--primary-10);
}

.file-upload-area.has-file {
    border-color: var(--primary-green);
    border-style: solid;
    background: var(--primary-10);
}

.file-upload-icon   { font-size: 2.5rem; margin-bottom: 0.5rem; }
.file-upload-text   { color: #6c757d; margin-bottom: 0.5rem; }
.file-upload-hint   { font-size: 0.85rem; color: #999; }
.file-upload-input  { display: none; }

.file-upload-filename {
    margin-top: 0.5rem;
    font-weight: 500;
    color: var(--primary-green);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.file-upload-remove {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}

/* === Bilanz: Spalten-Mapping === */
.mapping-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.mapping-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mapping-item label { font-size: 0.85rem; }

@media (max-width: 900px) { .mapping-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .mapping-grid { grid-template-columns: 1fr; } }

/* === Kategorien-Tabs (Bilanz) === */
.kategorien-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.tab-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.9rem;
    color: #90A4AE;
    border-bottom: 2px solid transparent;
}

.tab-btn:hover { color: var(--text-dark); }
.tab-btn.active { color: var(--primary-green); border-bottom-color: var(--primary-green); }

.kategorien-liste { max-height: 300px; overflow-y: auto; }

.kategorie-item {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.kategorie-item.inactive { opacity: 0.5; }
.kategorie-item .form-control { flex: 1; }

/* Buchung-Details */
.buchung-info {
    background: var(--page-bg);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.buchung-info p { margin: 0.25rem 0; }

/* === Empfänger-Auswahl (Modals) === */
.recipient-list-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.recipient-list-container label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
}

.recipient-list-container label:hover {
    background-color: var(--page-bg);
}

.recipient-list-container label input {
    width: 1.1rem;
    height: 1.1rem;
}

/* === E-Mail-Einstellungen: Setup-Tabs === */
.settings-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 1rem;
}

.settings-tab {
    padding: 0.75rem 1.25rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 0.95rem;
    color: #666;
    transition: all 0.15s;
}

.settings-tab:hover { color: #333; }
.settings-tab.active { color: var(--primary-green); border-bottom-color: var(--primary-green); }

.settings-tab-content         { display: none; }
.settings-tab-content.active  { display: block; }

/* === Flex-Hilfsklasse === */
.flex-grow { flex: 1; }

/* === Currency-Input (Preiseingabe mit Popup) === */
.currency-wrapper {
    position: relative;
    width: 100%;
}
/* Anzeige-Text (klickbar) */
.currency-display {
    display: block;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-dark);
    min-height: 24px;
    line-height: 24px;
}
.currency-display-empty {
    color: #999;
}
/* Eigenständiges Betragsfeld (nicht in form-group/editable-field): eigener Rand */
.currency-standalone {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.35rem 0.5rem;
    transition: border-color 0.2s;
}
.currency-standalone:hover {
    border-color: var(--primary-30);
}

/* === Nummernpad-Popup === */
.numpad-popup {
    display: none;
    position: fixed;
    width: 165px;
    z-index: 10000;
    background: var(--card-bg);
    border: 1px solid var(--primary-30);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
    padding: 0.4rem;
    animation: scaleIn 0.15s ease;
}
.numpad-popup.open { display: block; }

/* Anzeige oben im Pad */
.numpad-display {
    text-align: right;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.35rem 0.5rem;
    margin-bottom: 0.3rem;
    background: var(--page-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-dark);
    min-height: 1.5rem;
    font-variant-numeric: tabular-nums;
}

/* 4x3 Grid */
.numpad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-bottom: 4px;
}
.numpad-key {
    padding: 0.4rem 0;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 500;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-dark);
    cursor: pointer;
    text-align: center;
    transition: background 0.1s, border-color 0.1s;
    user-select: none;
}
.numpad-key:hover {
    background: var(--primary-5);
    border-color: var(--primary-30);
}
.numpad-key:active {
    background: var(--primary-10);
    transform: scale(0.96);
}
.numpad-key-clear {
    color: #e53935;
    font-weight: 600;
}

/* Untere Reihe: Backspace + OK */
.numpad-bottom {
    display: flex;
    gap: 4px;
}
.numpad-key-back {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.numpad-key-ok {
    flex: 2;
    background: var(--primary-green);
    color: white;
    border-color: var(--primary-green);
    font-weight: 600;
    font-size: 1rem;
}
.numpad-key-ok:hover {
    opacity: 0.9;
    background: var(--primary-green);
    border-color: var(--primary-green);
}

/* === Datepicker === */
/* Nativen Browser-Datepicker-Button verstecken (unser Custom-Button ersetzt ihn) */
.datepicker-wrapper input[type="date"]::-webkit-calendar-picker-indicator { display: none; -webkit-appearance: none; }
.datepicker-wrapper input[type="date"]::-webkit-inner-spin-button { display: none; }

.datepicker-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.datepicker-wrapper input[type="date"] {
    padding-right: 2.5rem;
}
.datepicker-btn {
    position: absolute;
    right: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #78909c;
    padding: 0.25rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: all 0.15s;
}
.datepicker-btn:hover {
    color: var(--primary-green);
    background: var(--primary-5);
}

/* Datepicker Popup */
.datepicker-popup {
    display: none;
    position: fixed;
    z-index: 10000;
    background: var(--card-bg);
    border: 1px solid var(--primary-30);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
    padding: 0.75rem;
    width: 260px;
    animation: scaleIn 0.15s ease;
    user-select: none;
}
.datepicker-popup.open { display: block; }

.dp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
.dp-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dark);
}
.dp-nav {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    padding: 0.25rem 0.375rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    transition: all 0.15s;
}
.dp-nav:hover {
    background: var(--primary-5);
    border-color: var(--primary-green);
    color: var(--primary-green);
}

.dp-days-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 0.25rem;
}
.dp-day-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: #90a4ae;
    text-transform: uppercase;
    padding: 0.25rem 0;
}

.dp-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.dp-day {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.1s;
    margin: 0 auto;
}
.dp-day:hover:not(.dp-empty) {
    background: var(--primary-5);
    color: var(--primary-green);
}
.dp-day.dp-empty { cursor: default; }
.dp-day.dp-today {
    font-weight: 700;
    border: 1px solid var(--primary-green);
    color: var(--primary-green);
}
.dp-day.dp-selected {
    background: var(--primary-green);
    color: white;
    font-weight: 600;
}
.dp-day.dp-selected.dp-today { border-color: transparent; }

.dp-footer {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}
.dp-today-btn {
    background: none;
    border: none;
    color: var(--primary-green);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    transition: background 0.15s;
}
.dp-today-btn:hover { background: var(--primary-5); }

/* === tables.css === */
/* =============================================================
   TABLES — Alle Tabellen, Filter-Popup, Drag & Drop, Resize
   ============================================================= */

/* === Gemeinsamer Tabellen-Container === */
.table-container {
    overflow: hidden;
    width: 100%;
    position: relative;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
}
/* Border als Overlay-Pseudo-Element — wird ÜBER dem Scrollbalken gezeichnet */
.table-container::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid var(--primary-30);
    border-radius: inherit;
    pointer-events: none;
    z-index: 11;
}
/* Ecken und Ränder anpassen wenn Toolbar/Pagination vorhanden */
.pt-toolbar + .table-container { border-radius: 0; margin-top: 0 !important; }
.pt-toolbar + .table-container::before { border-top: none; border-radius: 0; }
.table-container:has(+ .pt-pagination) { border-radius: 0; }
.table-container:has(+ .pt-pagination)::before { border-bottom: none; border-radius: 0; }
.pt-toolbar + .table-container:has(+ .pt-pagination)::before { border-top: none; border-bottom: none; border-radius: 0; }
/* Nur table-container allein: alle Ecken rund */
.table-container:not(.pt-toolbar + *):not(:has(+ .pt-pagination)) { border-radius: 6px; }

/* === Recipient-Table (einzige Nicht-PowerTable-Tabelle) === */
#recipient-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}
#recipient-table th,
#recipient-table td {
    border: 1px solid var(--border-color);
    padding: 0.6rem 0.8rem;
    text-align: left;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#recipient-table th {
    background-color: var(--page-bg);
    position: sticky;
    top: 0;
    z-index: 10;
    user-select: none;
    position: relative;
}

/* === Spaltenbreite anpassen (Resize-Handle) === */
.resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 5px;
    cursor: col-resize;
    z-index: 11;
}

/* === Spalten verschieben (Drag & Drop) === */
.draggable-header,
.header-text {
    cursor: grab;
    display: block;
    padding: 0.2rem 0;
    padding-right: 22px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.draggable-header:active,
.header-text:active {
    cursor: grabbing;
}

.drag-placeholder {
    border-left: 3px solid var(--primary-green);
}

/* === Sortierung === */
.sort-indicator {
    margin-left: 5px;
    opacity: 0.5;
    display: inline-block;
    width: 1em;
}

/* === Filter-Button === */
.filter-button {
    cursor: pointer;
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
    width: 16px;
    height: 16px;
}

.filter-button svg { width: 100%; height: 100%; }
.filter-button:hover { opacity: 1; }

.filter-button.active {
    opacity: 1;
    color: #1976D2;
}

.filter-button.active svg {
    stroke: #1976D2;
}

/* === Filter-Popup === */
.filter-popup {
    position: fixed;
    background-color: white;
    border: 1px solid #999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    width: 250px;
    max-height: 350px;
}

.filter-popup-header,
.filter-popup-footer { padding: 0.5rem; }

.filter-popup-header input { width: 100%; box-sizing: border-box; }

.filter-popup-list {
    overflow-y: auto;
    padding: 0.5rem;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.filter-popup-list label { display: block; margin-bottom: 0.3rem; }
.filter-popup-footer { text-align: right; }

/* Höherer Z-Index in Modalen */
#invite-filter-popup,
#wizard-filter-popup,
#custom-filter-popup {
    position: fixed;
    z-index: 10001;
}

/* === Tfoot — Ergebniszeile === */
/* PowerTable-Tabellen: Styling über .pt-summary-td in power-table.css */

.summary-cell {
    cursor: pointer;
}

.summary-cell:hover {
    background-color: #e0e6eb;
}

/* === Einladungs-Tabelle === */
#invite-mitglied-tabelle {
    width: 100%;
    border-collapse: collapse;
}

#invite-mitglied-tabelle th,
#invite-mitglied-tabelle td {
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    text-align: left;
}

#invite-mitglied-tabelle th {
    background-color: var(--page-bg);
    font-weight: 600;
}

/* === Editierbare Tabelle (Bilanz) === */
.editable-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2rem;
}

.editable-table th,
.editable-table td {
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    text-align: left;
}

.editable-table th {
    background-color: var(--page-bg);
    font-weight: 600;
}

.editable-table td[contenteditable="true"] {
    cursor: cell;
    background-color: #f7fcff;
    transition: background-color 0.2s;
}

.editable-table td[contenteditable="true"]:focus {
    background-color: #e3f2fd;
    outline: 2px solid var(--primary-green);
}

.editable-table td.saved { background-color: var(--primary-20); }
.editable-table td.error { background-color: #ffcdd2; }

/* === Ansichtsprofile === */
.view-management {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    background-color: #fdfdfd;
}

.view-profiles {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.view-profiles select { max-width: 200px; }
.view-profiles input  { max-width: 200px; }

.column-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.column-toggles label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    font-size: 0.9rem;
}

/* === Deaktivierte Zeile === */
.disabled-row {
    opacity: 0.5;
    background-color: #f5f5f5 !important;
}

.disabled-row select { pointer-events: none; }

/* === Benutzerdefinierte Felder (Veranstaltungen) === */
.custom-fields-modal-content {
    max-width: 960px;
    text-align: left;
}

.custom-fields-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
}

.custom-fields-table th,
.custom-fields-table td {
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    text-align: left;
    vertical-align: top;
}

.custom-fields-table th { background-color: var(--page-bg); }
.custom-fields-table .form-control { width: 95%; }

.options-container {
    padding-top: 1rem;
    padding-left: 0.5rem;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: nowrap;
}
.option-item .option-text {
    flex: 1;
    min-width: 0;
}
.option-preis-wrapper {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    width: 260px;
}
.option-preis-wrapper .option-preis {
    flex: 1;
    min-width: 50px;
    text-align: right;
}
.option-preis-eur {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary-green);
    flex-shrink: 0;
    white-space: nowrap;
}
/* Option-Item Inputs: gleiche Höhe */
.option-item .form-control {
    height: 34px;
    padding: 0.35rem 0.5rem;
    font-size: 0.9rem;
    box-sizing: border-box;
}
.option-item .delete-option-btn {
    height: 34px;
    width: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.delete-option-btn,
.delete-row-btn-custom {
    background: none;
    border: none;
    color: #c62828;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
}

.toggle-arrow {
    cursor: pointer;
    font-size: 1rem;
    width: 20px;
    display: inline-block;
    text-align: center;
    transition: transform 0.2s ease-in-out;
}

.toggle-arrow.expanded { transform: rotate(90deg); }

.options-row         { display: none; }
.options-row.visible { display: table-row; }

.options-cell {
    background-color: #f7f9fc;
    border-top: 2px solid var(--primary-green) !important;
    padding: 1.5rem !important;
}

/* (Settings-Dropdown entfernt — Profile sind jetzt direkt in der Toolbar) */

/* === power-table.css === */
/* =============================================================
   POWER-TABLE v3.1 — Forstverein Green Theme
   =============================================================
   Alle .pt-* Klassen für die PowerTable-Komponente
   ============================================================= */

/* Basis — Flex-Layout: thead/tfoot fix, nur tbody scrollt.
   CSS Grid auf tr sorgt für Spaltenausrichtung über alle Sektionen. */
.power-table {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    width: 100%;
}
.power-table thead,
.power-table tfoot {
    display: block;
    flex-shrink: 0;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-gutter: stable;
}
/* Scrollbar in thead/tfoot unsichtbar machen */
.power-table thead::-webkit-scrollbar,
.power-table tfoot::-webkit-scrollbar {
    background: transparent;
}
.power-table thead::-webkit-scrollbar-thumb,
.power-table tfoot::-webkit-scrollbar-thumb {
    background: transparent;
}
.power-table tbody {
    display: block;
    flex: 1;
    overflow-y: auto;
    scrollbar-gutter: stable;
    min-height: 0;
}
.power-table tr:not(.pt-detail-row) {
    display: grid;
    grid-template-columns: var(--pt-cols, repeat(auto-fill, minmax(0, 1fr)));
}
.power-table th, .power-table td { text-align: left; border: none !important; min-width: 0; }

/* Detail-Zeilen: volle Breite, kein Grid */
.pt-detail-row         { display: block; }
.pt-detail-row > td    { display: block; padding: 0; background: #f8fafc; }
.pt-detail-content     { padding: 1.25rem 1.5rem; }
.pt-detail-row.hidden  { display: none; }

/* Lade-/Leer-Zellen: volle Breite über alle Grid-Spalten */
.pt-loading, .pt-empty { grid-column: 1 / -1; }

/* SVG Icons */
.pt-icon       { width: 12px; height: 12px; display: inline-block; vertical-align: middle; flex-shrink: 0; }
.pt-icon-muted { opacity: 0.35; }
.pt-grip-icon  { width: 8px; height: 14px; }

/* Header */
.pt-th {
    padding: 0.625rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1e293b;
    background: linear-gradient(to bottom, var(--primary-5), var(--primary-10));
    box-shadow: inset -1px 0 0 0 var(--primary-30), inset 0 -2px 0 0 var(--primary-50);
    user-select: none;
    white-space: nowrap;
    position: relative;
    overflow: visible;
}
.pt-th:last-child { box-shadow: inset 0 -2px 0 0 var(--primary-50); }

/* Klickbare Links in Zellen */
.pt-link {
    color: var(--primary-green);
    text-decoration: none;
    cursor: pointer;
}
.pt-link:hover { text-decoration: underline; }

.pt-th-content { display: flex; align-items: center; gap: 0.375rem; }
.pt-th-label   { flex: 1; }
.pt-sortable .pt-th-label        { cursor: pointer; }
.pt-sortable .pt-th-label:hover  { color: var(--primary-green); }
.pt-th-select, .pt-th-detail     { width: 36px; text-align: center; padding: 0.625rem 0.25rem; }

/* Drag Handle */
.pt-drag-handle {
    cursor: grab;
    color: #90a4ae;
    padding: 0.125rem;
    border-radius: 0.125rem;
    display: flex;
    align-items: center;
    transition: color 0.15s;
    flex-shrink: 0;
}
.pt-drag-handle:hover  { color: #546e7a; }
.pt-drag-handle:active { cursor: grabbing; }

/* Sort */
.pt-sort-icon        { color: #90a4ae; display: flex; align-items: center; cursor: pointer; transition: color 0.15s; flex-shrink: 0; }
.pt-sort-icon:hover  { color: #546e7a; }
.pt-sort-icon.active { color: var(--primary-green); }

/* Body */
.pt-td {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    color: #334155;
    box-shadow: inset -1px 0 0 0 #e8ecef, inset 0 -1px 0 0 #e8ecef;
}
.pt-td:last-child { box-shadow: inset 0 -1px 0 0 #e8ecef; }

.power-table tbody tr                                            { transition: background 0.1s; cursor: default; }
.power-table tbody tr:hover                                      { background: var(--primary-5); }
.power-table tbody tr:nth-child(even):not(.pt-detail-row):not(:hover) { background: #fafbfc; }
.pt-row-selected                                                 { background: var(--primary-10) !important; }
.pt-td-select, .pt-td-detail                                    { text-align: center; width: 36px; padding: 0.5rem 0.25rem; }

/* Detail-Toggle-Button */
.pt-detail-toggle,
.toggle-detail-btn {
    background: none;
    border: 1px solid var(--primary-30);
    border-radius: 0.25rem;
    cursor: pointer;
    color: #546e7a;
    padding: 0.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    transition: all 0.15s;
}

.pt-detail-toggle:hover,
.toggle-detail-btn:hover {
    color: var(--primary-green);
    border-color: var(--primary-green);
    background: var(--primary-10);
}

.pt-detail-toggle.open,
.toggle-detail-btn.open {
    color: var(--primary-green);
    background: var(--primary-10);
    border-color: var(--primary-50);
}

/* Leer & Laden */
.pt-empty   { text-align: center; padding: 2.5rem !important; color: #90a4ae; font-style: italic; }
.pt-loading { text-align: center; padding: 2.5rem !important; color: #546e7a; }

.pt-loading-spinner {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--primary-30);
    border-top-color: var(--primary-green);
    border-radius: 50%;
    animation: pt-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 0.5rem;
}

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

/* Resize Handle */
.pt-resize-handle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    cursor: col-resize;
    background: transparent;
    transition: background 0.15s;
}
.pt-resize-handle:hover { background: var(--primary-green); }

/* Drag & Drop Einrast-Markierungen */
.pt-dragging        { opacity: 0.4; }
.pt-drag-over-left  { box-shadow: inset  3px 0 0 0 var(--primary-green) !important; }
.pt-drag-over-right { box-shadow: inset -3px 0 0 0 var(--primary-green) !important; }

/* Filter */
.pt-filter-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 0.125rem;
    flex-shrink: 0;
}

.pt-filter-btn {
    padding: 0.125rem;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #90a4ae;
    display: flex;
    align-items: center;
    transition: color 0.15s;
}
.pt-filter-btn:hover  { color: #546e7a; }
.pt-filter-btn.active { color: var(--primary-green); }

.pt-filter-dropdown {
    display: none;
    background: white;
    border: 1px solid var(--primary-30);
    border-radius: 0.5rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    z-index: 10000;
    min-width: 200px;
    max-height: 300px;
    flex-direction: column;
    overflow: hidden;
}
.pt-filter-dropdown.show { display: flex; }

.pt-filter-search { padding: 0.5rem; border-bottom: 1px solid #e5e7eb; flex-shrink: 0; }

.pt-filter-search-input {
    width: 100%;
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--primary-30);
    border-radius: 0.25rem;
    font-size: 0.8125rem;
    outline: none;
}
.pt-filter-search-input:focus { border-color: var(--primary-green); box-shadow: 0 0 0 2px rgba(46,125,50,0.15); }

.pt-filter-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    cursor: pointer;
    font-size: 0.8125rem;
}
.pt-filter-option:hover { background: var(--primary-5); }

/* Scrollbare Optionsliste im Filter-Dropdown */
.pt-filter-options-scroll {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.pt-filter-actions { padding: 0.5rem; border-top: 1px solid #e5e7eb; text-align: right; flex-shrink: 0; }

.pt-filter-apply {
    padding: 0.375rem 1rem;
    background: var(--primary-green);
    color: white;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.8125rem;
    transition: background 0.15s;
}
.pt-filter-apply:hover { background: var(--hover-green); }

/* Spaltensuche */
.pt-search-row td { padding: 0.25rem 0.5rem; background: var(--primary-5); }

.pt-col-search {
    width: 100%;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--primary-30);
    border-radius: 0.25rem;
    font-size: 0.75rem;
    outline: none;
}
.pt-col-search:focus { border-color: var(--primary-green); }

/* Inline-Edit */
.pt-inline-edit {
    width: 100%;
    padding: 0.25rem 0.5rem;
    border: 2px solid var(--primary-green);
    border-radius: 0.25rem;
    font-size: 0.8125rem;
    outline: none;
    background: var(--primary-5);
}

/* Toolbar */
.pt-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0.75rem;
    gap: 0.75rem;
    flex-wrap: wrap;
    flex-shrink: 0;
    border: 1px solid var(--primary-30);
    background: var(--primary-5);
    border-radius: 6px 6px 0 0;
}

.pt-toolbar-left,
.pt-toolbar-right { display: flex; align-items: center; gap: 0.5rem; }

.pt-search-input {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--primary-30);
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    min-width: 200px;
    outline: none;
    background: white;
}
.pt-search-input:focus { border-color: var(--primary-green); box-shadow: 0 0 0 2px rgba(46,125,50,0.15); }

/* Bulk Actions */
.pt-bulk-bar   { display: flex; align-items: center; gap: 0.5rem; }
.pt-bulk-count { font-size: 0.8125rem; font-weight: 600; color: var(--primary-green); }

.pt-bulk-btn {
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--primary-30);
    border-radius: 0.375rem;
    background: white;
    cursor: pointer;
    font-size: 0.8125rem;
    transition: background 0.15s;
}
.pt-bulk-btn:hover { background: var(--primary-5); }

/* Pagination */
.pt-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    flex-shrink: 0;
    border: 1px solid var(--primary-30);
    border-top: none;
    background: var(--primary-5);
    font-size: 0.8125rem;
    color: #546e7a;
    border-radius: 0 0 6px 6px;
}

.pt-page-controls { display: flex; align-items: center; gap: 0.25rem; }

.pt-page-btn {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--primary-30);
    border-radius: 0.25rem;
    background: white;
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1;
    transition: background 0.15s;
}
.pt-page-btn:hover:not(:disabled) { background: var(--primary-10); }
.pt-page-btn:disabled              { opacity: 0.3; cursor: default; }

.pt-page-current { padding: 0 0.5rem; font-weight: 500; }

.pt-page-size {
    padding: 0.25rem 0.375rem;
    border: 1px solid var(--primary-30);
    border-radius: 0.25rem;
    font-size: 0.8125rem;
    margin-right: 0.5rem;
    background: white;
}

.pt-page-info { font-weight: 500; }

/* Aggregate Bar */
.pt-aggregate-bar {
    padding: 0.5rem 0.75rem;
    border-top: 1px solid var(--primary-30);
    background: var(--primary-5);
    font-size: 0.8125rem;
    color: #334155;
}

/* Summary Row (Ergebniszeile) */
.pt-summary-row  { background: linear-gradient(to bottom, var(--primary-10), var(--primary-5)); }
.pt-summary-td   {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    color: #1e293b;
    white-space: nowrap;
    background: linear-gradient(to bottom, var(--primary-10), var(--primary-5));
    box-shadow: inset -1px 0 0 0 var(--primary-35), inset 0 2px 0 0 var(--primary-50), inset 0 -1px 0 0 var(--primary-30);
}
.pt-summary-td:last-child { box-shadow: inset 0 2px 0 0 var(--primary-50), inset 0 -1px 0 0 var(--primary-30); }
.pt-summary-label {
    font-size: 0.6875rem;
    color: #546e7a;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.pt-summary-td strong {
    color: var(--primary-green);
    font-weight: 700;
}

/* Kontextmenü & Menü-Elemente */
.pt-context-menu {
    position: fixed; z-index: 9999; background: white;
    border: 1px solid var(--primary-30); border-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
    min-width: 200px; max-height: 80vh; overflow-y: auto; padding: 0.375rem 0;
}
.pt-menu-title    { padding: 0.5rem 0.75rem; font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; color: #90a4ae; letter-spacing: 0.05em; }
.pt-menu-item     { display: flex; align-items: center; gap: 0.5rem; padding: 0.375rem 0.75rem; font-size: 0.8125rem; cursor: pointer; transition: background 0.1s; }
.pt-menu-item:hover   { background: var(--primary-5); }
.pt-menu-checkbox     { cursor: pointer; }
.pt-menu-active       { font-weight: 600; color: var(--primary-green); }
.pt-menu-danger       { color: #dc2626; }
.pt-menu-danger:hover { background: #fef2f2; color: #b91c1c; }
.pt-menu-divider      { height: 1px; background: #e2e8f0; margin: 0.375rem 0; }
.pt-menu-columns-scroll { max-height: calc(5 * 1.85rem); overflow-y: auto; scrollbar-width: thin; }
.pt-menu-columns-scroll::-webkit-scrollbar       { width: 5px; }
.pt-menu-columns-scroll::-webkit-scrollbar-thumb  { background: var(--primary-30); border-radius: 3px; }
.pt-menu-columns-scroll::-webkit-scrollbar-track  { background: transparent; }

/* Toolbar-Buttons (Export) */
.pt-export-btn {
    background: white;
    border: 1px solid var(--primary-30);
    cursor: pointer;
    color: #546e7a;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    white-space: nowrap;
    transition: all 0.15s;
}
.pt-export-btn:hover { color: var(--primary-green); background: var(--primary-5); border-color: var(--primary-50); }

/* Toolbar — Profilverwaltung inline */
.pt-toolbar-profiles {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}
.pt-toolbar-profile-select {
    min-width: 100px;
}
.pt-toolbar-profile-select .custom-select-wrapper { height: auto !important; }
.pt-toolbar-profile-select .custom-select-trigger {
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--primary-30);
    border-radius: 0.25rem;
    background: white;
    min-height: unset;
    cursor: pointer;
}
.pt-toolbar-profile-select .custom-select-trigger:hover { border-color: var(--primary-50); }
.pt-toolbar-profile-select .custom-select-dropdown {
    left: 0;
    right: auto;
    min-width: 140px;
    font-size: 0.8125rem;
}
.pt-toolbar-profile-select .custom-select-option { padding: 0.375rem 0.625rem; font-size: 0.8125rem; }
.pt-toolbar-btn {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--primary-30);
    border-radius: 0.25rem;
    background: white;
    cursor: pointer;
    color: #546e7a;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    white-space: nowrap;
    transition: all 0.15s;
}
.pt-toolbar-btn:hover { background: var(--primary-5); color: var(--primary-green); border-color: var(--primary-50); }
.pt-toolbar-delete:hover { background: #fef2f2; color: #dc2626; border-color: #fca5a5; }
.pt-toolbar-reset:hover  { color: var(--primary-green); }

/* Toolbar — Trennlinie & Toggle */
.pt-toolbar-sep {
    width: 1px;
    height: 1.25rem;
    background: var(--primary-30);
    flex-shrink: 0;
}
.pt-toolbar-toggle {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    cursor: pointer;
    font-size: 0.8125rem;
    color: #546e7a;
    white-space: nowrap;
    user-select: none;
}
.pt-toolbar-toggle input { accent-color: var(--primary-green); }

/* Summary: Klickbare Zellen */
.pt-summary-clickable {
    cursor: pointer;
    transition: background 0.1s;
}
.pt-summary-clickable:hover {
    background: var(--primary-20);
}
.pt-summary-placeholder {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: #90a4ae;
    font-size: 0.6875rem;
    padding: 0.125rem 0.5rem;
    border: 1px dashed #b0bec5;
    border-radius: 0.25rem;
    transition: all 0.15s;
}
.pt-summary-clickable:hover .pt-summary-placeholder {
    color: var(--primary-green);
    border-color: var(--primary-green);
    background: rgba(46, 125, 50, 0.06);
}

/* Summary: Typ-Auswahl-Menü */
.pt-summary-menu {
    z-index: 10000;
    background: white;
    border: 1px solid var(--primary-30);
    border-radius: 0.5rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    min-width: 140px;
    padding: 0.25rem 0;
}

.pt-summary-menu-item {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: background 0.1s;
}
.pt-summary-menu-item:hover {
    background: var(--primary-5);
}
.pt-summary-menu-item.pt-menu-active {
    font-weight: 600;
    color: var(--primary-green);
}

/* Responsive */
@media (max-width: 768px) {
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .power-table {
        min-width: 700px;
    }
}
@media (max-width: 600px) {
    .pt-th, .pt-td { padding: 0.375rem 0.5rem; font-size: 0.75rem; }
    .pt-pagination  { flex-direction: column; gap: 0.5rem; }
}
@media (min-width: 900px) {
    .power-table td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .power-table th { text-overflow: ellipsis; white-space: nowrap; }
}

/* === modals.css === */
/* =============================================================
   MODALS — Overlays, Wizard-Modals, Confirm-Dialog, PDF-Viewer
   ============================================================= */

/* === Basis Modal === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-overlay.active,
.modal-overlay.show {
    display: flex;
}

.modal-overlay-top {
    z-index: 2001;
}

.modal-overlay-topmost {
    z-index: 2002;
}

.modal-content {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.2), 0 8px 20px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 800px;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
    animation: scaleIn 0.2s ease both;
}

/* Modale mit Header/Body/Footer-Struktur */
.modal-content:has(.modal-footer) {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-content.modal-sm   { max-width: 450px; }
.modal-content.modal-small  { max-width: 400px; }
.modal-content.modal-large  { max-width: 900px; width: 95%; }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-content:has(.modal-footer) .modal-header,
.modal-content:has(.wizard-footer) .modal-header {
    padding: 1.5rem 2rem 0 2rem;
}

.modal-header h2 {
    margin: 0;
    color: var(--text-dark);
}

.modal-close {
    font-size: 2rem;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    border: none;
    background: none;
}

.modal-close:hover {
    color: var(--text-dark);
}

.modal-body {
    margin-top: 1rem;
}

.modal-content:has(.modal-footer) .modal-body {
    padding: 1rem 2rem;
    margin-top: 0;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.modal-body h4 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.modal-footer {
    padding: 1rem 2rem;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
}

/* === Versand-Fortschritt === */
.sending-progress {
    padding: 1rem;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--hover-green), var(--primary-green));
    transition: width 0.3s ease;
}

.result-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.result-icon.success { color: var(--hover-green); }
.result-icon.error   { color: #f44336; }
.result-icon.warning { color: #FF9800; }

.sending-result .result-details {
    background: #f5f5f5;
    padding: 1rem;
    border-radius: 8px;
    text-align: left;
    margin-top: 1rem;
}

.sending-result .stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #ddd;
}

.sending-result .stat-row:last-child { border-bottom: none; }
.sending-result .stat-label          { color: #666; }
.sending-result .stat-value          { font-weight: bold; }
.sending-result .stat-value.success  { color: var(--hover-green); }
.sending-result .stat-value.error    { color: #f44336; }
.sending-result .stat-value.warning  { color: #FF9800; }

/* === Wizard-Modals mit fixer Tabellenhöhe === */
#wizard-modal > .gm-box,
#custom-wizard-modal > .gm-box,
#custom-rechnung-modal > .gm-box,
#csv-import-modal > .gm-box,
#rundschreiben-modal > .gm-box,
#abschluss-wizard-modal > .gm-box,
#create-wizard-modal > .gm-box,
#mahnung-modal > .gm-box,
#invite-modal > .gm-box {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.wizard-footer {
    padding: 0.75rem 1.5rem;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Wizard-Steps im Tab-Header-Design */
.wizard-steps {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0;
    background-color: var(--dark-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    height: 36px;
    overflow-x: auto;
    scrollbar-width: none;
}
.wizard-steps::-webkit-scrollbar { display: none; }

.wizard-step {
    padding: 0 1.25rem;
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: default;
    border-bottom: 3px solid transparent;
    opacity: 0.5;
    height: 36px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: opacity 0.2s, border-color 0.2s;
}
.wizard-step.active {
    border-bottom-color: var(--primary-green);
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.05);
}
.wizard-step.completed {
    opacity: 0.8;
    border-bottom-color: rgba(255, 255, 255, 0.2);
}
.wizard-step .step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
}
.wizard-step.active .step-number {
    background: var(--primary-green);
    color: #fff;
}
.wizard-step.completed .step-number {
    background: var(--primary-green);
    color: #fff;
}
.wizard-step .step-label {
    font-size: 0.85rem;
}

#wizard-modal .wizard-content,
#custom-wizard-modal .wizard-content,
#custom-rechnung-modal .wizard-content,
#csv-import-modal .wizard-content,
#rundschreiben-modal .wizard-content,
#abschluss-wizard-modal .wizard-content-container,
#create-wizard-modal .wizard-content,
#mahnung-modal .gm-body,
#invite-modal .wizard-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 1.5rem 2rem;
}

#wizard-modal .table-container,
#custom-rechnung-modal .table-container,
#mahnung-modal .table-container,
#invite-modal .table-container {
    flex: 1;
    max-height: 45vh;
    min-height: 200px;
    overflow-y: auto;
    overflow-x: auto;
}

/* Invite Step 2+3 */
#invite-modal #invite-step-2,
#invite-modal #invite-step-3 {
    overflow-y: auto;
}

#wizard-modal .wizard-steps { flex-shrink: 0; }

#wizard-modal .view-controls,
#wizard-modal .column-toggles,
#custom-rechnung-modal .view-controls {
    flex-shrink: 0;
}

/* Step-Indicator (für mehrstufige Formulare) */
.step-indicator {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--border-color);
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
}

.step-indicator.active    { background: var(--primary-green); color: white; }
.step-indicator.completed { background: var(--hover-green); color: white; }

/* === Confirm-Modal === */
.confirm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.confirm-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.confirm-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    min-width: 320px;
    max-width: 450px;
    transform: scale(0.9);
    transition: transform 0.2s;
}

.confirm-modal-overlay.show .confirm-modal {
    transform: scale(1);
}

.confirm-modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.confirm-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.confirm-modal-body {
    padding: 1.5rem;
}

.confirm-modal-body p {
    margin: 0;
    font-size: 0.95rem;
    color: #546E7A;
    line-height: 1.5;
    white-space: pre-wrap;
}

.confirm-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

@media (max-width: 500px) {
    .confirm-modal {
        min-width: auto;
        margin: 1rem;
    }
}

/* === Meldungs-Modal === */
.meldung-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 16px;
    border-radius: 20px;
    background-color: #c62828;
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(198, 40, 40, 0.4);
    z-index: 9999;
    font-size: 0.9rem;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.meldung-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(198, 40, 40, 0.5);
    background-color: #b71c1c;
}

.meldung-modal-content {
    max-width: 700px;
}

#meldung-screenshot-container {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    background-color: #f7f9fc;
    text-align: center;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#meldung-screenshot-container img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.meldung-system-info {
    background-color: #f7f9fc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    font-size: 0.85rem;
}

.meldung-system-info .info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.meldung-system-info .info-item  { display: flex; gap: 0.5rem; }
.meldung-system-info .info-label { color: #90A4AE; font-weight: 500; }
.meldung-system-info .info-value { color: var(--text-dark); }

@media (max-width: 768px) {
    .meldung-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
        bottom: 15px;
        right: 15px;
    }
    .meldung-system-info .info-grid { grid-template-columns: 1fr; }
}

/* === Sendungsverlauf-Modal === */
.sendungsverlauf-modal-content {
    max-width: 700px;
    max-height: 80vh;
}

.sendungsverlauf-liste {
    max-height: 60vh;
    overflow-y: auto;
}

.sendung-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.sendung-item:hover       { background-color: #f5f5f5; }
.sendung-item:last-child  { border-bottom: none; }

.sendung-info {
    flex: 1;
    min-width: 0;
}

.sendung-betreff {
    font-weight: 500;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sendung-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.sendung-typ {
    background: var(--primary-10);
    color: var(--primary-green);
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.sendung-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: 1rem;
}

.sendung-action-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    color: var(--text-dark);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.sendung-action-btn:hover {
    background-color: var(--primary-green);
    color: white;
    border-color: var(--primary-green);
}

.sendung-no-preview {
    color: #999;
    font-style: italic;
}

/* === E-Mail-Vorschau-Modal === */
.email-vorschau-modal-content {
    width: 900px;
    max-width: 95vw;
}

.email-vorschau-modal-content .modal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.email-vorschau-meta {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.email-vorschau-meta p { margin: 0.25rem 0; }

.email-vorschau-inhalt {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    background: white;
    flex: 1;
    min-height: 200px;
}

.email-vorschau-inhalt iframe {
    width: 100%;
    height: 100%;
    min-height: 200px;
    border: none;
    display: block;
}

.email-vorschau-anhang {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.email-vorschau-anhang h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: #6c757d;
}

/* === PDF-Viewer-Modal === */
.pdf-viewer-modal-content {
    width: 95vw;
    max-width: 95vw;
    height: 95vh;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pdf-viewer-body {
    padding: 0 !important;
    flex: 1;
    min-height: 0;
    height: auto;
}

.pdf-viewer-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* === Bestätigungs-Popup (Veranstaltungen Anmeldung) === */
.confirmation-popup-content {
    text-align: left;
}

.confirmation-popup-content h3 {
    margin-top: 0;
}

.confirmation-popup-list {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 1rem;
    background-color: #f7f9fc;
}

.confirmation-popup-list ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.confirmation-popup-list li {
    padding: 0.25rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.confirmation-popup-list li:last-child { border-bottom: none; }

.confirmation-popup-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* === Validierungsfehler === */
.validation-error {
    color: #c62828;
    font-size: 0.8rem;
    margin-top: 4px;
    display: block;
}

input.invalid {
    border-color: #c62828 !important;
    box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.15) !important;
}

/* === global-modals.css === */
/* =============================================================================
   GLOBAL MODAL SYSTEM (gm-)
   Einheitliches Modal-System für alle Module.
   Prefix gm- vermeidet Konflikte mit bestehenden Klassen.
   ============================================================================= */

/* --- CSS Custom Properties --- */
:root {
    --gm-header-h: 52px;
    --gm-tab-h: 36px;
    --gm-footer-h: 44px;
    --gm-top: calc(var(--gm-header-h) + var(--gm-tab-h));   /* 88px */
    --gm-bottom: var(--gm-footer-h);                          /* 44px */
    --gm-gap: 1.25rem;
    --gm-z: 2000;
    --gm-radius: 10px;
    --gm-anim: 150ms;
    --gm-border: var(--border-color, #e0e0e0);
    --gm-bg-subtle: #f7f9fc;
}

/* =============================================================================
   OVERLAY (Backdrop) — zwischen Tab-Header und Footer
   ============================================================================= */
.gm-overlay {
    position: fixed;
    top: var(--gm-top);
    left: 0;
    right: 0;
    bottom: var(--gm-bottom);
    z-index: var(--gm-z);
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--gm-gap);
    animation: gm-fade-in var(--gm-anim) ease-out;
}

/* Seiten ohne Tab-Header: Overlay startet direkt unter dem Header */
body:not(:has(.tab-header)) .gm-overlay {
    top: var(--gm-header-h);
}

/* Hidden-Zustand */
.gm-overlay.hidden {
    display: none;
}

/* =============================================================================
   BOX (Container)
   ============================================================================= */
.gm-box {
    background: var(--card-bg, #fff);
    border-radius: var(--gm-radius);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2), 0 8px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    max-height: 100%;
    width: 100%;
    overflow: hidden;
    animation: gm-enter var(--gm-anim) ease-out;
}
/* Forms innerhalb der Box müssen Flex-Layout mitmachen */
.gm-box > form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* --- Breitenvarianten --- */
.gm-sm   { max-width: 450px; }
.gm-md   { max-width: 700px; }
.gm-lg   { max-width: 900px; width: 95%; }
.gm-xl   { max-width: 1100px; width: 95%; }
.gm-full { max-width: calc(100vw - 2rem); }

/* =============================================================================
   HEADER (fix oben im Modal)
   ============================================================================= */
.gm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--gm-border);
    flex-shrink: 0;
    gap: 1rem;
}
.gm-header h2,
.gm-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
    line-height: 1.4;
    min-width: 0;
}

/* Danger-Header (für Lösch-Bestätigungen etc.) */
.gm-header.gm-danger {
    background: #fef2f2;
    border-bottom-color: #fecaca;
}
.gm-header.gm-danger h2,
.gm-header.gm-danger h3 {
    color: #991b1b;
}

/* =============================================================================
   CLOSE BUTTON
   ============================================================================= */
.gm-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: none;
    color: #90A4AE;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
    font-size: 1.4rem;
    line-height: 1;
}
.gm-close:hover {
    color: var(--text-dark);
    background: rgba(0, 0, 0, 0.05);
}
.gm-close::after {
    content: '\00D7';
}

/* =============================================================================
   TAB/WIZARD NAVIGATION — im Design des App-Tab-Headers
   ============================================================================= */
.gm-tabs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0 1rem;
    background-color: var(--dark-bg, #2c3e50);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    height: 36px;
}
.gm-tabs::-webkit-scrollbar { display: none; }

.gm-tab {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0 1.25rem;
    height: 36px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border-bottom: 2px solid transparent;
    position: relative;
}
.gm-tab:hover {
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.05);
}
.gm-tab.active {
    color: #fff;
    border-bottom-color: var(--primary-green, #4CAF50);
    background: rgba(255, 255, 255, 0.08);
}

/* Tab im "done"-Zustand (Wizard - Schritt erledigt) */
.gm-tab.done {
    color: rgba(255, 255, 255, 0.8);
}
.gm-tab.done::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary-green, #4CAF50);
    margin-right: 0.25rem;
}

/* Wizard-Nummer-Badge im Tab */
.gm-wizard-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
    flex-shrink: 0;
}
.gm-tab.active .gm-wizard-num {
    background: var(--primary-green, #4CAF50);
    color: #fff;
}
.gm-tab.done .gm-wizard-num {
    background: var(--primary-green, #4CAF50);
    color: #fff;
}

/* Tab Panels */
.gm-tab-panel {
    display: none;
}
.gm-tab-panel.active {
    display: block;
}

/* Wizard Panels */
.gm-wizard-panel {
    display: none;
}
.gm-wizard-panel.active {
    display: block;
}

/* =============================================================================
   BODY (scrollbarer Inhalt)
   ============================================================================= */
.gm-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1.5rem 2rem;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
}

/* =============================================================================
   FOOTER (fix unten im Modal)
   ============================================================================= */
.gm-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-top: 1px solid var(--gm-border);
    background: var(--gm-bg-subtle);
    flex-shrink: 0;
}
.gm-footer-split {
    justify-content: space-between;
}
.gm-footer-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.gm-footer-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

/* =============================================================================
   BUTTONS (im Modal-Footer)
   ============================================================================= */
.gm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.375rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    height: 34px;
    box-sizing: border-box;
}
.gm-btn-primary {
    background: var(--primary-green, #4CAF50);
    color: #fff;
    border-color: var(--primary-green, #4CAF50);
}
.gm-btn-primary:hover {
    opacity: 0.9;
}
.gm-btn-danger {
    background: #e53935;
    color: #fff;
    border-color: #e53935;
}
.gm-btn-danger:hover {
    background: #c62828;
    border-color: #c62828;
}
.gm-btn-secondary {
    background: var(--card-bg, #fff);
    color: var(--text-dark);
    border-color: var(--gm-border);
}
.gm-btn-secondary:hover {
    background: #f5f5f5;
}
.gm-btn-ghost {
    background: none;
    color: #90A4AE;
    border-color: transparent;
}
.gm-btn-ghost:hover {
    color: var(--text-dark);
    background: rgba(0, 0, 0, 0.03);
}
.gm-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Loading Spinner auf Button */
.gm-btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}
.gm-btn-loading::after {
    content: '';
    position: absolute;
    width: 1rem;
    height: 1rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: gm-spin 0.6s linear infinite;
    left: calc(50% - 0.5rem);
    top: calc(50% - 0.5rem);
    color: inherit;
}
.gm-btn-primary.gm-btn-loading::after { color: #fff; }
.gm-btn-danger.gm-btn-loading::after { color: #fff; }
.gm-btn-secondary.gm-btn-loading::after { color: #90A4AE; }

/* =============================================================================
   ANIMATIONEN
   ============================================================================= */
@keyframes gm-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes gm-enter {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}
@keyframes gm-spin {
    to { transform: rotate(360deg); }
}

/* =============================================================================
   FORMULARFELDER IN MODALEN — gleiches Design wie editable-fields
   ============================================================================= */
/* Checkbox-Gruppen: Kein Rahmen, kein Floating-Label — wie in Mitglieder */
.gm-body .form-group:has(> label > input[type="checkbox"]),
.wizard-content .form-group:has(> label > input[type="checkbox"]),
.gm-body .form-group:has(> input[type="checkbox"]),
.wizard-content .form-group:has(> input[type="checkbox"]) {
    border: none;
    padding: 0;
    background: transparent;
}
.gm-body .form-group:has(> label > input[type="checkbox"]):hover,
.wizard-content .form-group:has(> label > input[type="checkbox"]):hover,
.gm-body .form-group:has(> input[type="checkbox"]):hover,
.wizard-content .form-group:has(> input[type="checkbox"]):hover {
    border-color: transparent;
    box-shadow: none;
}
.gm-body .form-group:has(> label > input[type="checkbox"]) > label:first-child,
.wizard-content .form-group:has(> label > input[type="checkbox"]) > label:first-child {
    position: static;
    font-size: 0.9rem;
    font-weight: normal;
    color: var(--text-dark);
    background: transparent;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

/* Reguläre Formgruppen (NICHT Checkboxen): Rahmen + Floating-Label */
.gm-body .form-group:not(:has(> label > input[type="checkbox"])):not(:has(> input[type="checkbox"])),
.wizard-content .form-group:not(:has(> label > input[type="checkbox"])):not(:has(> input[type="checkbox"])) {
    position: relative;
    border: 1px solid var(--gm-border);
    border-radius: 8px;
    padding: 10px 12px;
    background-color: var(--card-bg, #fff);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.gm-body .form-group:not(:has(> label > input[type="checkbox"])):hover,
.wizard-content .form-group:not(:has(> label > input[type="checkbox"])):hover {
    border-color: var(--primary-30);
    box-shadow: 0 0 0 2px var(--primary-5);
}
.gm-body .form-group:not(:has(> label > input[type="checkbox"])):focus-within,
.wizard-content .form-group:not(:has(> label > input[type="checkbox"])):focus-within {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 2px var(--primary-10);
}

/* Label als Floating-Label im Rahmen (nur für reguläre Felder) */
.gm-body .form-group:not(:has(> label > input[type="checkbox"])) > label:first-child,
.wizard-content .form-group:not(:has(> label > input[type="checkbox"])) > label:first-child {
    position: absolute;
    top: -10px;
    left: 10px;
    max-width: calc(100% - 25px);
    width: fit-content;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-green);
    background-color: var(--card-bg, #fff);
    padding: 0 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0;
}

/* Input/Textarea innerhalb von form-group: kein eigener Border, gleiche Höhe wie editable-fields */
.gm-body .form-group input.form-control,
.wizard-content .form-group input.form-control,
.gm-body .form-group select.form-control,
.wizard-content .form-group select.form-control {
    border: none;
    padding: 0;
    background: transparent;
    box-shadow: none;
    font-size: 1rem;
    outline: none;
    height: 24px;
}
.gm-body .form-group textarea.form-control,
.wizard-content .form-group textarea.form-control {
    border: none;
    padding: 0;
    background: transparent;
    box-shadow: none;
    font-size: 1rem;
    outline: none;
    height: auto;
    min-height: 3rem;
}

/* Inputs in Tabellen innerhalb von Modalen */
.gm-body table .form-control,
.wizard-content table .form-control {
    height: 34px;
    padding: 0.35rem 0.5rem;
    font-size: 0.9rem;
    box-sizing: border-box;
    border-radius: 6px;
}
.gm-body .form-group input.form-control:focus,
.wizard-content .form-group input.form-control:focus,
.gm-body .form-group textarea.form-control:focus,
.wizard-content .form-group textarea.form-control:focus {
    box-shadow: none;
    border: none;
}

/* Currency-Wrapper innerhalb form-group: transparent, kein eigener Rahmen */
.gm-body .form-group .currency-wrapper,
.wizard-content .form-group .currency-wrapper {
    width: 100%;
    position: static;
}
.gm-body .form-group .currency-display,
.wizard-content .form-group .currency-display {
    font-size: 1rem;
    min-height: 24px;
    line-height: 24px;
}

/* Select innerhalb: Chevron sichtbar */
.gm-body .form-group select.form-control,
.wizard-content .form-group select.form-control {
    padding-right: 1.5rem;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2390a4ae' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0 center;
    background-size: 14px;
}
.gm-body .form-group select.form-control:focus,
.wizard-content .form-group select.form-control:focus {
    box-shadow: none;
    border: none;
}

/* Buttons in Modalen: gleiche Höhe wie Inputs */
.gm-body .btn,
.wizard-content .btn,
.gm-footer .btn,
.wizard-footer .btn {
    height: 34px;
    padding: 0.375rem 1rem;
    box-sizing: border-box;
    font-size: 0.875rem;
}

/* Textarea: Mindesthöhe */
.gm-body .form-group textarea.form-control,
.wizard-content .form-group textarea.form-control {
    min-height: 3rem;
    resize: vertical;
}

/* Currency-Wrapper in form-group: kein extra Padding */
.gm-body .form-group .currency-wrapper,
.wizard-content .form-group .currency-wrapper {
    margin: 0;
}

/* form-row in Modalen: Abstand zwischen Feldern */
.gm-body .form-row,
.wizard-content .form-row {
    gap: 1rem;
    margin-bottom: 0;
}

/* =============================================================================
   PDF/VIEWER MODALS — volle verfügbare Höhe
   ============================================================================= */
.gm-box:has(.pdf-viewer-body) {
    height: 100%;
}
.pdf-viewer-body {
    flex: 1;
    min-height: 0;
    padding: 0 !important;
    overflow: hidden;
}
.pdf-viewer-body iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* =============================================================================
   MOBILE RESPONSIVE
   ============================================================================= */
@media (max-width: 768px) {
    .gm-overlay {
        padding: 0.5rem;
    }
    .gm-header h2,
    .gm-header h3 {
        font-size: 1rem;
    }
    .gm-body {
        padding: 1rem;
    }
    .gm-header,
    .gm-footer {
        padding: 0.625rem 1rem;
    }
    .gm-tabs {
        height: 32px;
    }
    .gm-tab {
        font-size: 0.8rem;
        padding: 0 0.75rem;
        height: 32px;
    }
}

@media (max-width: 479px) {
    .gm-footer {
        flex-wrap: wrap;
    }
    .gm-footer .gm-btn {
        flex: 1 1 auto;
        min-width: 0;
    }
}

/* =============================================================================
   BODY SCROLL LOCK
   ============================================================================= */
body.gm-scroll-locked {
    overflow: hidden;
}

/* === cards.css === */
/* =============================================================
   CARDS — Karten, Dashboard, Module-Tiles, Status-Messages
   ============================================================= */

/* === Basis-Karte === */
.card {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.04);
    text-align: center;
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--primary-green);
}

.card h1 {
    color: var(--text-dark);
}

/* === Auswertungs-Kachel === */
.auswertung-card {
    background: linear-gradient(135deg, var(--primary-5) 0%, var(--primary-10) 100%);
    border: 1px solid var(--primary-green);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.auswertung-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.auswertung-header h3 {
    margin: 0;
    color: var(--primary-green);
    font-size: 1.1rem;
}

.auswertung-subtitle {
    margin: 0.25rem 0 0 0;
    color: #666;
    font-size: 0.9rem;
}

.auswertung-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.auswertung-preview-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auswertung-preview-item .name   { font-weight: 500; }
.auswertung-preview-item .badge  {
    background: var(--primary-green);
    color: white;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.auswertung-preview-more {
    background: #f5f5f5;
    border: 1px dashed #ccc;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    color: #666;
}

/* === Bilanz-Dashboard === */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.dashboard-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.dashboard-card.positive  { border-left: 4px solid var(--hover-green); }
.dashboard-card.negative  { border-left: 4px solid #e53935; }
.dashboard-card.warning   { border-left: 4px solid #FF9800; }
.dashboard-card.highlight {
    background: var(--primary-green);
    color: white;
    border: none;
}

.dashboard-card.highlight .dashboard-label { color: rgba(255,255,255,0.8); }

.dashboard-label {
    display: block;
    font-size: 0.8rem;
    color: #90A4AE;
    margin-bottom: 0.5rem;
}

.dashboard-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
}

.dashboard-card .btn-small {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

@media (max-width: 900px) { .dashboard-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .dashboard-grid { grid-template-columns: 1fr; } }

/* === Wizard-Steps (Bilanz-Import) === */
/* Statistik-Leiste (über Tabellen) */
.statistik-leiste {
    margin-bottom: 1rem;
}

/* wizard-steps und wizard-step Styles → siehe modals.css */

.wizard-content { min-height: 300px; }

/* === Status-Meldungen === */
.status-message {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.status-message.success {
    background-color: var(--primary-10);
    color: var(--primary-green);
    border: 1px solid var(--primary-50);
}

.status-message.error {
    background-color: #FFEBEE;
    color: #C62828;
    border: 1px solid #EF9A9A;
}

/* === Test-Ergebnis === */
.test-result {
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
}

.test-result.success {
    background-color: var(--primary-10);
    color: var(--primary-green);
    border: 1px solid var(--primary-50);
}

.test-result.error {
    background-color: #FFEBEE;
    color: #C62828;
    border: 1px solid #EF9A9A;
}

/* === Info-Karte === */
.info-card {
    background-color: #FAFAFA;
}

.info-content h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.info-table th,
.info-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.info-table th { background-color: var(--page-bg); font-weight: 600; }
.info-table tbody tr:hover { background-color: #f5f5f5; }

.info-note {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #FFF8E1;
    border-left: 4px solid #FFC107;
    border-radius: 0 6px 6px 0;
    font-size: 0.9rem;
}

/* === Modul-Kacheln (Startseite) === */
.module-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.module-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1rem 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    position: relative;
    overflow: hidden;
}

/* Dezenter Shimmer-Effekt beim Hover */
.module-tile::before {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, var(--primary-5), transparent);
    transition: left 0.5s ease;
}
.module-tile:hover::before { left: 100%; }

.module-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--primary-30);
    border-color: var(--primary-green);
}

.module-tile-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-green);
    border-radius: 14px;
    margin-bottom: 0.875rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.module-tile:hover .module-tile-icon {
    transform: scale(1.08);
    box-shadow: 0 4px 12px var(--primary-50);
}

.module-tile-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

.module-tile-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-dark);
    text-align: center;
}

.module-tile-desc {
    font-size: 0.75rem;
    color: #78909c;
    margin-top: 0.25rem;
    text-align: center;
}

.module-tile-settings .module-tile-icon { background: #546E7A; }
.module-tile-settings:hover { border-color: #546E7A; box-shadow: 0 8px 24px rgba(84, 110, 122, 0.2); }

.module-tile-logout .module-tile-icon { background: #78909C; }
.module-tile-logout:hover { border-color: #c62828; box-shadow: 0 8px 24px rgba(198, 40, 40, 0.15); }
.module-tile-logout:hover .module-tile-icon { background: #c62828; }

@media (max-width: 600px) {
    .module-tiles { grid-template-columns: repeat(2, 1fr); }
}

/* === Dashboard-Grid (Startseite) === */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}
@media (max-width: 1200px) { .dashboard-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 800px)  { .dashboard-grid { grid-template-columns: 1fr; } }
.dashboard-col { display: flex; flex-direction: column; gap: 1rem; }
.dashboard-card { max-width: none; text-align: left; border-left: none; }

.dashboard-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}
.dashboard-section-header h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1.1rem;
}
.dashboard-section-header h2 svg { color: var(--primary-green); }

.dashboard-stat-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--primary-5);
    border-radius: 6px;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: #546e7a;
}
.dashboard-stat-highlight {
    font-weight: 700;
    color: var(--primary-green);
    font-size: 1rem;
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.dashboard-table th {
    text-align: left;
    padding: 0.4rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #90a4ae;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 2px solid var(--primary-30);
}
.dashboard-table td {
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}
.dashboard-table tr:hover td { background: var(--primary-5); }
.dashboard-table tr.overdue td { color: #c62828; }

.badge-warning { background: #fff3e0; color: #e65100; padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; }
.badge-info    { background: #e3f2fd; color: #1565c0; padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; }

.empty-text { color: #90a4ae; font-style: italic; font-size: 0.9rem; padding: 1rem 0; }

/* Veranstaltungs-Karten auf Dashboard */
.dashboard-events { display: flex; flex-direction: column; gap: 0.75rem; }
a.dashboard-event-card {
    text-decoration: none;
    color: inherit;
    display: block;
}
.dashboard-event-card {
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid var(--primary-green);
    transition: background 0.15s, box-shadow 0.15s;
}
.dashboard-event-card:hover {
    background: var(--primary-5);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.dashboard-event-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}
.dashboard-event-header strong { font-size: 0.9rem; color: var(--text-dark); }
.dashboard-event-date { font-size: 0.8rem; color: #546e7a; white-space: nowrap; }
.dashboard-event-meta { font-size: 0.78rem; color: #78909c; margin-bottom: 0.5rem; }

.dashboard-event-stats {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.4rem;
}
.dashboard-event-stat {
    flex: 1;
    text-align: center;
    padding: 0.3rem 0.25rem;
    background: white;
    border-radius: 4px;
}
.stat-num  { display: block; font-size: 1.1rem; font-weight: 700; color: #333; }
.stat-label { display: block; font-size: 0.65rem; color: #90a4ae; text-transform: uppercase; letter-spacing: 0.03em; }
.stat-success .stat-num { color: var(--primary-green); }
.stat-danger  .stat-num { color: #c62828; }
.stat-muted   .stat-num { color: #90a4ae; }
.stat-extern  .stat-num { color: #f57c00; }

.dashboard-event-bar {
    display: flex;
    height: 4px;
    border-radius: 2px;
    background: #e0e0e0;
    margin-top: 0.4rem;
    overflow: hidden;
}
.bar-zugesagt { background: var(--primary-green); transition: width 0.3s; }
.bar-abgesagt { background: #ef5350; transition: width 0.3s; }

/* Formularfeld-Auswertung in Veranstaltungs-Karten */
.dashboard-event-fields {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed #ddd;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.dashboard-field-group { }
.dashboard-field-question {
    font-size: 0.8rem;
    font-weight: 600;
    color: #37474f;
    margin-bottom: 0.2rem;
}
.dashboard-field-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.15rem;
}
.dashboard-field-name {
    font-size: 0.78rem;
    color: #37474f;
    min-width: 70px;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dashboard-field-bar-wrap {
    flex: 1;
    height: 6px;
    background: #e8ecef;
    border-radius: 3px;
    overflow: hidden;
    min-width: 30px;
}
.dashboard-field-bar {
    height: 100%;
    background: var(--primary-green);
    border-radius: 3px;
    transition: width 0.3s;
    min-width: 2px;
}
.dashboard-field-count {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary-green);
    min-width: 20px;
    text-align: right;
}

/* === E-Mail-Sektion (Startseite) === */
.email-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.email-section-header h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1.25rem;
}

.email-section-header h2 svg { color: var(--primary-green); }

.email-badge {
    background: #e53935;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    margin-left: 0.25rem;
}

.email-list-home {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.email-item-home {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.email-item-home:hover { background: var(--primary-10); }

.email-item-home.unread {
    background: #fff;
    border-left: 3px solid var(--primary-green);
}

.email-item-home.unread .email-item-subject {
    font-weight: 700;
    color: #000;
}

.email-item-content { flex: 1; min-width: 0; }

.email-item-subject {
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-item-from {
    font-size: 0.8rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-item-date {
    font-size: 0.75rem;
    color: #888;
    margin-left: 1rem;
    white-space: nowrap;
}

.empty-text {
    color: #888;
    text-align: center;
    padding: 1rem;
}

/* === toasts.css === */
/* =============================================================
   TOASTS — Toast-Benachrichtigungen
   ============================================================= */

/* === Globales Toast-System === */
#toast-container {
    position: fixed;
    top: 64px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 280px;
    max-width: 400px;
    pointer-events: auto;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    border-left: 4px solid #90A4AE;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.hide {
    transform: translateX(100%);
    opacity: 0;
}

.toast-success { border-left-color: var(--hover-green); }
.toast-error   { border-left-color: #f44336; }
.toast-warning { border-left-color: #FF9800; }
.toast-info    { border-left-color: #2196F3; }

.toast-success .toast-icon { color: var(--hover-green); }
.toast-error   .toast-icon { color: #f44336; }
.toast-warning .toast-icon { color: #FF9800; }
.toast-info    .toast-icon { color: #2196F3; }

.toast-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
}

.toast-icon svg { width: 100%; height: 100%; }

.toast-message {
    flex: 1;
    font-size: 0.95rem;
    color: var(--text-dark);
    line-height: 1.4;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: #90A4AE;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.toast-close:hover { color: var(--text-dark); }

@media (max-width: 500px) {
    #toast-container {
        left: 10px;
        right: 10px;
        top: 70px;
    }
    .toast {
        min-width: auto;
        max-width: none;
    }
}

/* === mitglieder.css === */
/* =============================================================
   MITGLIEDER — Detailansicht, editierbare Felder, Navigation
   ============================================================= */

/* === Mitglied-Header-Navigation === */
.mitglied-header-navigation {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.2rem;
    background-color: #f7f9fc;
    transition: background-color 0.2s;
    border-bottom: 2px solid var(--primary-green);
    padding: 0.75rem;
    border-radius: 8px;
}

.nav-arrow {
    background: none;
    border: 1px solid var(--primary-green);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, border-color 0.2s;
    flex-shrink: 0;
}

.nav-arrow:hover {
    background-color: var(--primary-green);
    border-color: #90A4AE;
}

.mitglied-header-center {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-grow: 1;
    min-width: 0;
    border-radius: 8px;
}

/* ID-Badges */
#mitglied-id-display,
#veranstaltung-id-display {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background-color: var(--primary-green);
    white-space: nowrap;
    border-radius: 14px;
    width: 50px;
    height: 36px;
    align-content: center;
    text-align: center;
}

/* Name-Header */
#mitglied-name-header,
#veranstaltung-name-header {
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    min-width: 0;
}

#mitglied-name-header,
#mitglied-name-header .display-value,
#mitglied-name-header input,
#mitglied-name-header .field-input {
    font-size: 1.5rem !important;
    font-weight: 600;
}

#veranstaltung-name-header .field-input {
    font-size: 1.5rem !important;
    font-weight: 600;
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    padding: 0;
    font-family: inherit;
    color: var(--text-dark);
}
#veranstaltung-name-header {
    flex: 1;
    min-width: 0;
}
#veranstaltung-name-header .editable-field {
    flex: 1;
    min-width: 0;
    display: flex !important;
}

/* Name-Header Row */
.name-header-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.name-header-row .editable-field {
    display: inline-block;
    border: 1px solid transparent !important;
    border-radius: 8px;
    padding: 10px 12px !important;
    margin: 0 !important;
    cursor: pointer;
    min-width: auto;
    position: relative;
    background-color: #f7f9fc;
}

.name-header-row .editable-field .display-value,
.name-header-row .editable-field .field-input {
    font-size: 1.6rem;
    font-weight: 600;
}

.name-header-row .editable-field:hover {
    background-color: rgba(0,0,0,0.05);
    border-radius: 4px;
}

/* Letzte Aktualisierung */
.letzte-aktualisierung {
    font-size: 0.8rem;
    color: #6c757d;
    text-align: right;
    white-space: nowrap;
    margin-left: auto;
}

/* === Detail-Grid === */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-column .form-chapter-title {
    margin-bottom: 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary-green);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-10);
}

.detail-actions {
    grid-column: 1 / -1;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    display: flex;
    gap: 1rem;
}

.anmerkungen-section {
    grid-column: 1 / -1;
}

/* === Anmerkungen === */
.anmerkung-input-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.anmerkung-input-container textarea { flex-grow: 1; height: 40px; }
.anmerkung-input-container .btn     { height: 40px; flex-shrink: 0; }

.anmerkungen-liste {
    max-height: 450px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
}

.anmerkung-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    border-bottom: 1px solid #f0f0f0;
    gap: 0.5rem;
}

.anmerkung-item:last-child { border-bottom: none; }
.anmerkung-item:hover      { background-color: #f8f9fa; }

.anmerkung-text {
    flex: 1;
    word-break: break-word;
}

.anmerkung-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.2s;
}

.anmerkung-item:hover .anmerkung-actions { opacity: 1; }

/* === Deaktivierter Zustand === */
#mitglied-details-content.is-disabled .editable-field,
#mitglied-details-content.is-disabled .detail-actions,
#mitglied-details-content.is-disabled .anmerkungen-section {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

#mitglied-details-content.is-disabled #mitglied-name-header {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

#veranstaltung-details-content.is-disabled .editable-field,
#veranstaltung-details-content.is-disabled .display-field,
#veranstaltung-details-content.is-disabled .full-width-section {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

#veranstaltung-details-content.is-disabled #veranstaltung-name-header {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

/* === Editierbare Felder === */
.editable-field {
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 1rem;
    background-color: var(--card-bg);
    cursor: text;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.editable-field:hover {
    border-color: var(--primary-30);
    box-shadow: 0 0 0 2px var(--primary-5);
}

.display-field {
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 1rem;
    background-color: var(--page-bg);
}

/* Schwebendes Label über dem Feld */
.editable-field .label-below,
.display-field .label-below {
    position: absolute;
    top: -10px;
    left: 10px;
    max-width: calc(100% - 25px);
    width: fit-content;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-green);
    background-color: var(--card-bg);
    padding: 0 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Anzeige-Wert (für display-fields und Spezialfelder) */
.editable-field .display-value,
.display-field .display-value {
    font-size: 1rem;
    min-height: 1.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* === Echte Input-Felder (field-input) === */
.editable-field .field-input {
    width: 100%;
    border: none;
    background-color: transparent;
    font-family: inherit;
    font-size: 1rem;
    padding: 0;
    margin: 0;
    outline: none;
    box-sizing: border-box;
    color: var(--text-dark);
}

.editable-field input.field-input {
    height: 24px;
}

.editable-field textarea.field-input {
    height: auto;
    min-height: 4rem;
    resize: vertical;
    white-space: pre-wrap;
}

/* Focus-Indikator: grüner Border */
.editable-field:focus-within {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 2px var(--primary-10);
    background-color: var(--card-bg);
}

/* Select-Felder: Chevron-Indikator */
.editable-field[data-type="select"]::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2390a4ae' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-size: contain;
    opacity: 0.4;
    pointer-events: none;
}
.editable-field[data-type="select"]:hover::after { opacity: 0.7; }
.editable-field[data-type="select"] { cursor: pointer; }

/* EUR-Label im Number-Editor */
.editor-currency-label {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-green);
    pointer-events: none;
    opacity: 0.7;
}

/* Custom-Dropdown-Editor */
.custom-select-wrapper {
    position: relative;
    width: 100%;
    height: auto !important;
}
.custom-select-trigger {
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-dark);
    padding: 0;
    min-height: 1.2rem;
}
.custom-select-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: -13px;
    right: -13px;
    background: var(--card-bg);
    border: 1px solid var(--primary-30);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
    z-index: 100;
    max-height: 240px;
    overflow-y: auto;
    padding: 0.25rem 0;
    animation: scaleIn 0.15s ease;
}
.custom-select-dropdown.open { display: block; }
.custom-select-option {
    padding: 0.5rem 0.875rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.1s;
    color: var(--text-dark);
}
.custom-select-option:hover {
    background: var(--primary-5);
}
.custom-select-option.active {
    background: var(--primary-10);
    color: var(--primary-green);
    font-weight: 600;
}

/* Spezielle Hervorhebungen */
.editable-field[data-field="funktionen"],
.display-field[data-field="mitgliedsbeitrag"] {
    border: 1px solid var(--primary-green);
    background-color: var(--primary-10);
}

#open-custom-fields-modal-btn,
#einladung-feld,
.response-details-trigger {
    border: 1px solid var(--primary-green);
    background-color: var(--primary-10);
}

#open-custom-fields-modal-btn:hover,
#einladung-feld:hover,
.response-details-trigger:hover {
    background-color: var(--primary-30);
}

/* Deaktivierte Hervorhebungen */
#veranstaltung-details-content.is-disabled #open-custom-fields-modal-btn,
#veranstaltung-details-content.is-disabled #einladung-feld,
#veranstaltung-details-content.is-disabled .response-details-trigger {
    border: 1px solid var(--primary-green);
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    background-color: var(--primary-10);
}

#mitglied-details-content.is-disabled .editable-field[data-field="funktionen"],
#mitglied-details-content.is-disabled .display-field[data-field="mitgliedsbeitrag"] {
    border: 1px solid var(--primary-green);
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    background-color: var(--primary-10);
}

/* Feld mit Icon */
.field-with-icon {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.field-with-icon .display-value,
.field-with-icon .field-input,
.field-with-icon .editor { flex: 1; min-width: 0; }

.icon-button {
    flex-shrink: 0;
    margin-left: 0.75rem;
    color: var(--primary-green);
    text-decoration: none;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.icon-button:hover  { opacity: 1; }
.icon-button.hidden { display: none; }

/* Disabled-Zustand: Inputs deaktiviert */
.editable-field input:disabled,
.editable-field textarea:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.editable-field input.form-control {
    padding-top: 10px;
}

/* Custom-Dropdown ersetzt natives <select> */

/* Mitglieder-Link */
.member-link {
    color: var(--primary-green);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s;
}

.member-link:hover {
    color: var(--hover-green);
    text-decoration: underline;
}

/* === Historie-Modal === */
.historie-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.historie-item:last-child { border-bottom: none; }

.historie-meta {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.historie-meta strong { color: var(--text-dark); }

.historie-aenderung {
    font-size: 0.95rem;
    line-height: 1.5;
}

.historie-aenderung .feld-name  { font-weight: 600; color: var(--primary-green); }
.historie-aenderung .alter-wert { text-decoration: line-through; color: #e53935; margin-left: 0.5rem; }
.historie-aenderung .neuer-wert { color: #43a047; margin-left: 0.5rem; }

/* === email-layout.css === */
/* =============================================================
   EMAIL-LAYOUT — E-Mail-Client Layout, Sidebar, Nachrichten
   ============================================================= */

/* === Vollbild-Wrapper === */
.email-client-wrapper {
    position: fixed;
    top: 52px;
    left: var(--nav-width-collapsed, 0);
    right: 0;
    bottom: 44px;
    background: #f5f5f5;
    z-index: 10;
}

.email-client-layout {
    display: flex;
    height: 100%;
    background: white;
    overflow: hidden;
}

/* === Sidebar / Ordnerliste === */
.email-sidebar {
    width: 200px;
    min-width: 200px;
    background: #f8f9fa;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

.email-sidebar-footer {
    display: flex;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e0e0e0;
    margin-top: auto;
}

.email-compose-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--primary-green);
    color: var(--text-light);
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.email-compose-btn:hover { background: var(--hover-green); }
.email-compose-btn svg   { width: 16px; height: 16px; }

.email-folder-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.email-folder-item {
    display: flex;
    align-items: center;
    padding: 0.6rem 1rem;
    cursor: pointer;
    transition: background 0.15s;
    gap: 0.75rem;
    color: #333;
    text-decoration: none;
}

.email-folder-item:hover  { background: #e9ecef; }
.email-folder-item.active { background: var(--primary-green); color: var(--text-light); }
.email-folder-item.drag-over { background: #d4edda; border: 2px dashed var(--primary-green); }

.email-folder-icon { width: 18px; height: 18px; opacity: 0.7; }
.email-folder-item.active .email-folder-icon { opacity: 1; }

.email-folder-name {
    flex: 1;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-folder-count {
    font-size: 0.8rem;
    background: rgba(0, 0, 0, 0.1);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    min-width: 24px;
    text-align: center;
}

.email-folder-item.active .email-folder-count { background: rgba(255, 255, 255, 0.2); }

/* Folder-Badge, Divider, Section-Title */
.folder-badge {
    font-size: 0.75rem;
    background: var(--primary-green);
    color: var(--text-light);
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.folder-add {
    opacity: 0.7;
    margin-top: 0.5rem;
    border-top: 1px solid #e0e0e0;
    padding-top: 1rem;
}
.folder-add:hover { opacity: 1; }

.folder-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 0.5rem 1rem;
}

.folder-section-title {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    padding: 0.5rem 1rem 0.25rem;
    letter-spacing: 0.05em;
}

/* === E-Mail Main Area === */
.email-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.email-toolbar {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    gap: 1rem;
}

.email-toolbar-left   { display: flex; align-items: center; gap: 0.5rem; }
.email-toolbar-center { flex: 1; max-width: 400px; }
.email-toolbar-right  { color: #666; font-size: 0.85rem; }

.email-content-area {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* === Nachrichtenliste === */
.email-message-list {
    width: 350px;
    min-width: 300px;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.email-list-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f8f9fa;
}

.email-search-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.email-list-content { flex: 1; overflow-y: auto; }

/* Nachrichten-Item */
.email-message-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    padding-left: 0.75rem;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}

.email-message-item:hover   { background: #f5f5f5; }
.email-message-item.active  { background: #d0e8ff; border-left: 4px solid #1565c0; }
.email-message-item.unread  { font-weight: 600; }
.email-message-item.dragging { opacity: 0.5; background: #e0e0e0; }

.email-message-item.unread:not(.active) {
    border-left: 3px solid var(--primary-green);
    background: #f1f8e9;
}

.email-message-item.unread .email-message-subject {
    font-weight: 700;
    color: #000;
}

/* Checkbox */
.email-message-checkbox {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
}

.email-message-item:hover .email-message-checkbox,
.email-message-item.selected .email-message-checkbox,
.has-selection .email-message-checkbox { opacity: 1; }
.email-message-checkbox:checked        { opacity: 1; }

.email-message-content { flex: 1; min-width: 0; }

.email-message-subject {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-message-sender {
    font-size: 0.8rem;
    font-weight: 400;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-message-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.email-message-date      { font-size: 0.75rem; color: #888; }
.email-message-flags     { display: flex; gap: 0.25rem; }
.email-flag              { font-size: 0.8rem; }

/* Stern */
.email-message-star { color: #ccc; cursor: pointer; font-size: 1rem; transition: color 0.15s; padding: 0.25rem; }
.email-message-star:hover   { color: #ffc107; }
.email-message-star.starred { color: #ffc107; }
.email-attachment-icon      { color: #888; }

/* Hover: Datum durch Löschen-Button ersetzen */
.email-message-delete-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    color: #888;
    margin-left: 0.5rem;
    transition: all 0.15s;
}

.email-message-item:hover .email-message-delete-btn { display: flex; }
.email-message-delete-btn:hover                      { background: #ffebee; color: #c62828; }
.email-message-item:hover .email-message-date        { display: none; }

.email-message-meta .email-message-star                              { opacity: 0.5; }
.email-message-item:hover .email-message-meta .email-message-star,
.email-message-meta .email-message-star.starred                      { opacity: 1; }

/* === Skeleton Loading === */
.email-message-skeleton {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
}

.skeleton-checkbox,
.skeleton-star,
.skeleton-sender,
.skeleton-subject,
.skeleton-preview,
.skeleton-date {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-checkbox { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }
.skeleton-star     { width: 18px; height: 18px; flex-shrink: 0; }
.skeleton-content  { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.skeleton-sender   { width: 40%; height: 14px; }
.skeleton-subject  { width: 70%; height: 13px; }
.skeleton-preview  { width: 90%; height: 12px; }
.skeleton-date     { width: 60px; height: 12px; flex-shrink: 0; }

@keyframes skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* === Vorschau-Panel === */
.email-preview-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.email-preview-header {
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.email-preview-subject { font-size: 1.2rem; font-weight: 600; margin-bottom: 0.75rem; color: #333; }

.email-preview-meta {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.email-preview-from  { font-weight: 500; }
.email-preview-to    { color: #666; font-size: 0.9rem; }
.email-preview-date  { margin-left: auto; color: #888; font-size: 0.85rem; white-space: nowrap; }

.email-preview-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e0e0e0;
    background: #fafafa;
}

.email-action-btn {
    padding: 0.4rem 0.75rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.15s;
}
.email-action-btn:hover         { background: #f0f0f0; border-color: #ccc; }
.email-action-btn.danger:hover  { background: #fee; border-color: #dc3545; color: #dc3545; }

.email-preview-body {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    background: white;
}

.email-preview-body iframe { width: 100%; min-height: 300px; border: none; }

.email-preview-attachments {
    padding: 0.75rem 1rem;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.email-attachment-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.email-attachment-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
}
.email-attachment-item:hover { background: #f0f0f0; border-color: var(--primary-green); }

.email-preview-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #888;
}

.email-preview-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.email-preview-content .preview-header      { flex-shrink: 0; }
.email-preview-content .preview-info        { flex-shrink: 0; }
.email-preview-content .preview-attachments { flex-shrink: 0; }
.email-preview-content .preview-body        { flex: 1; overflow-y: auto; }

/* Preview Placeholder */
.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
}
.preview-placeholder svg { margin-bottom: 1rem; }

/* === Folder Mapping (Einstellungen) === */
.folder-mapping { border: 1px solid #e0e0e0; border-radius: 6px; overflow: hidden; }

.folder-mapping-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e0e0e0;
}
.folder-mapping-item:last-child { border-bottom: none; }
.folder-mapping-icon svg        { width: 16px; height: 16px; }
.folder-mapping-name            { flex: 1; }

.folder-type-badge {
    font-size: 0.75rem;
    background: #e9ecef;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    color: #666;
}

/* Ordner verschieben */
.move-folder-list { max-height: 300px; overflow-y: auto; }

.move-folder-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.15s;
    border-radius: 4px;
}
.move-folder-item:hover { background: #f0f0f0; }
.move-folder-item svg   { flex-shrink: 0; width: 18px; height: 18px; }

/* === Rotating (Refresh-Button) === */
.rotating svg { animation: rotate 1s linear infinite; }

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

/* === Loading === */
.email-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #888;
}
.email-loading .spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e0e0e0;
    border-top-color: var(--primary-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.75rem;
}

/* === Externe Bilder geblockt === */
.email-images-blocked-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 4px;
    font-size: 0.82rem;
    color: #666;
    margin-bottom: 4px;
}
.email-images-blocked-banner svg { flex-shrink: 0; color: #f9a825; }

.email-load-images-btn {
    margin-left: auto;
    padding: 0.2rem 0.6rem;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: #fff;
    cursor: pointer;
    font-size: 0.8rem;
    color: #333;
    white-space: nowrap;
    transition: background 0.15s;
}
.email-load-images-btn:hover { background: #f0f0f0; }

/* === Context-Menu === */
.email-context-menu {
    position: fixed;
    z-index: 10000;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15), 0 0 1px rgba(0,0,0,0.1);
    min-width: 200px;
    padding: 0.5rem 0;
    animation: contextMenuFadeIn 0.15s ease-out;
}

@keyframes contextMenuFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: #333;
    transition: background 0.1s;
}
.context-menu-item:hover              { background: #f0f0f0; }
.context-menu-item svg                { flex-shrink: 0; color: #666; }
.context-menu-item.context-menu-danger         { color: #c62828; }
.context-menu-item.context-menu-danger svg     { color: #c62828; }
.context-menu-item.context-menu-danger:hover   { background: #ffebee; }
.context-menu-divider                 { height: 1px; background: #e0e0e0; margin: 0.5rem 0; }

/* Kontextmenü: Untermenü für Filterregeln */
.context-menu-has-submenu {
    position: relative;
}
.context-menu-has-submenu .context-submenu-arrow {
    margin-left: auto;
    color: #999;
}
.context-submenu {
    display: none;
    position: absolute;
    left: 100%;
    top: -0.5rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15), 0 0 1px rgba(0,0,0,0.1);
    min-width: 180px;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem 0;
    z-index: 10001;
}
.context-menu-has-submenu:hover .context-submenu {
    display: block;
}
.context-submenu-header {
    padding: 0.4rem 1rem;
    font-size: 0.75rem;
    color: #888;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 0.25rem;
    word-break: break-all;
}
.context-submenu-label {
    padding: 0.3rem 1rem;
    font-size: 0.7rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.context-submenu-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: #333;
    transition: background 0.1s;
}
.context-submenu-item:hover {
    background: #e3f2fd;
    color: #1565c0;
}

/* SVG Icons in E-Mail-Client */
.email-folder-icon svg,
.email-compose-btn svg,
.btn svg,
.toolbar-btn svg,
.preview-action-btn svg { vertical-align: middle; flex-shrink: 0; }

.email-sidebar-footer .btn svg { width: 14px; height: 14px; }

/* === Mobile === */
.mobile-back-btn {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    color: var(--primary-green);
    font-size: 0.9rem;
    cursor: pointer;
}
.mobile-back-btn svg { width: 18px; height: 18px; }

.mobile-header {
    display: none;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    gap: 0.75rem;
}

.mobile-header-title {
    flex: 1;
    font-weight: 600;
    font-size: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .email-client-wrapper {
        left: 0;
    }

    .mobile-back-btn { display: flex; }
    .mobile-header   { display: flex; }

    .email-client-layout {
        position: relative;
        height: calc(100vh - 60px);
        overflow: hidden;
    }

    .email-sidebar,
    .email-main,
    .email-message-list,
    .email-preview-panel {
        position: absolute;
        top: 0; left: 0;
        width: 100%; height: 100%;
        transition: transform 0.25s ease;
        background: #fff;
        overflow-y: auto;
    }

    .email-sidebar {
        z-index: 10;
        transform: translateX(0);
        border-right: none;
        min-width: 100%; width: 100%;
        position: relative;
        display: flex;
        flex-direction: column;
        padding: 0; padding-bottom: 70px;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .email-sidebar .email-compose-btn { margin: 1rem; width: calc(100% - 2rem); }
    .email-sidebar .email-folder-list { padding: 0 1rem; }
    .email-sidebar .email-folder-item { margin: 0; }

    .email-client-layout.show-list    .email-sidebar,
    .email-client-layout.show-preview .email-sidebar { transform: translateX(-100%); }

    .email-main { z-index: 20; transform: translateX(100%); display: flex; flex-direction: column; }

    .email-client-layout.show-list    .email-main,
    .email-client-layout.show-preview .email-main { transform: translateX(0); }

    .email-message-list {
        position: relative; z-index: 1; transform: none;
        flex: 1; min-width: 100%; max-width: 100%; border-right: none;
    }

    .email-client-layout.show-preview .email-message-list {
        transform: translateX(-100%);
        position: absolute;
    }

    .email-preview-panel { position: absolute; z-index: 30; transform: translateX(100%); }
    .email-client-layout.show-preview .email-preview-panel { transform: translateX(0); }

    .email-toolbar { flex-wrap: wrap; padding: 0.5rem; }
    .email-toolbar-left,
    .email-toolbar-right { gap: 0.25rem; }

    .email-search-wrapper { order: 3; width: 100%; margin-top: 0.5rem; }
    .email-search-input   { width: 100%; }
    .email-folder-list    { padding: 0.5rem 0; }
    .email-folder-item    { padding: 0.75rem 1rem; margin: 0; }
    .email-message-item   { padding: 0.75rem 1rem; }
    .email-message-preview { display: none; }

    .email-sidebar .email-sidebar-footer {
        position: absolute; bottom: 0; left: 0; right: 0;
        padding: 0.75rem 1rem; border-top: 1px solid #e0e0e0;
        background: #fff; display: flex; justify-content: center; gap: 0.75rem;
    }
    .email-sidebar-footer .btn { flex: 1; max-width: 150px; }
}

@media (max-width: 480px) {
    .email-message-subject { font-size: 0.9rem; }
    .email-message-from    { font-size: 0.8rem; }
    .email-message-date    { font-size: 0.75rem; }
    .preview-actions       { gap: 0.25rem; }
    .preview-action-btn    { padding: 0.4rem; }
    .classic-subject,
    .conversation-subject  { font-size: 1.1rem; }
}

/* === email-compose.css === */
/* =============================================================
   EMAIL-COMPOSE — Compose-Modal, Attachments, Chat, Signaturen
   ============================================================= */

/* === Compose-Modal === */
.compose-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.compose-modal.active { display: flex; }

.compose-modal-content {
    width: 1200px;
    max-width: 95vw;
    height: 90vh;
    max-height: 90vh;
    background: white;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.compose-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.compose-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}
.compose-header h3 { flex: 1; margin: 0; font-size: 1.1rem; }

.compose-close {
    background: none; border: none; font-size: 1.5rem;
    cursor: pointer; color: #666; padding: 0; line-height: 1;
}
.compose-close:hover { color: #333; }

/* Empfänger-Feld */
.compose-recipient-field {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    flex: 1;
}

.compose-recipient-input-wrapper { flex: 1; position: relative; }

.compose-recipient-btn {
    flex-shrink: 0; padding: 0.5rem;
    min-width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
}

/* Autocomplete im Compose */
.compose-autocomplete {
    position: absolute; top: 100%; left: 0; right: 0;
    background: white; border: 1px solid #ddd; border-top: none;
    border-radius: 0 0 4px 4px; max-height: 200px; overflow-y: auto;
    z-index: 100; display: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.compose-autocomplete.active { display: block; }

/* Felder */
.compose-fields {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.compose-field {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.compose-field:last-child { margin-bottom: 0; }
.compose-field label { width: 60px; font-weight: 500; color: #666; font-size: 0.9rem; }
.compose-field input  { flex: 1; }

.compose-label  { width: 60px; font-size: 0.9rem; color: #666; }

.compose-input { flex: 1; padding: 0.4rem 0.5rem; border: 1px solid #ddd; border-radius: 4px; font-size: 0.9rem; }
.compose-input:focus { border-color: var(--primary-green); outline: none; }

/* Toolbar */
.compose-toolbar {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
}

.toolbar-btn {
    padding: 0.4rem 0.6rem;
    background: none; border: none; cursor: pointer;
    border-radius: 4px; color: #333; font-size: 0.9rem;
    display: flex; align-items: center; justify-content: center;
    min-width: 32px;
}
.toolbar-btn:hover { background: #e0e0e0; }

.toolbar-divider { width: 1px; height: 20px; background: #ddd; margin: 0 0.25rem; }

/* Gemeinsame Toolbar-Elemente (für compose und ee) */
.toolbar-select {
    padding: 2px 4px; border: 1px solid #ccc; border-radius: 4px;
    font-size: 0.8rem; cursor: pointer; background: #fff;
}
.toolbar-color-label {
    cursor: pointer; display: flex; align-items: center; gap: 2px;
    font-size: 0.8rem;
}
.toolbar-color-input {
    width: 20px; height: 20px; border: none; padding: 0; cursor: pointer;
}
/* Generische Toolbar-Button-Klasse (prefix-tb-btn) */
[class$="-tb-btn"] {
    padding: 4px 6px; background: none; border: 1px solid transparent;
    cursor: pointer; border-radius: 4px; font-size: 0.85rem;
    display: flex; align-items: center; justify-content: center;
    min-width: 28px; height: 28px; color: #333;
}
[class$="-tb-btn"]:hover { background: #e0e0e0; border-color: #ccc; }
/* Richtext-Toolbar Container (Rundschreiben-Editor) */
.richtext-toolbar {
    display: flex; align-items: center; gap: 2px;
    padding: 0.35rem 0.5rem; background: #f5f5f5;
    border: 1px solid #ddd; border-bottom: none;
    border-radius: 6px 6px 0 0; flex-wrap: wrap;
}

/* Editor */
.compose-editor {
    flex: 1;
    min-height: 200px;
    padding: 1rem;
    border: 1px solid #e0e0e0; border-radius: 0 0 6px 6px;
    overflow-y: auto; font-size: 0.95rem; line-height: 1.5;
}
.compose-editor:focus      { outline: none; border-color: var(--primary-green); }
.compose-editor.drag-over  { background: #f0fff0; border-color: var(--primary-green); }

/* Footer */
.compose-footer {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid #e0e0e0; background: #f8f9fa;
    border-radius: 0 0 8px 8px;
}
.compose-footer .btn { padding: 0.5rem 1rem; }

/* Chip-Input für Empfänger */
.chip-input-container {
    display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px;
    padding: 4px 8px; min-height: 36px; max-height: 90px;
    overflow-y: auto;
    border: 1px solid #ddd; border-radius: 6px; background: #fff;
    cursor: text; width: 100%;
}
.chip-input-container:focus-within { border-color: var(--primary-green); box-shadow: 0 0 0 2px rgba(76,175,80,0.15); }
.chip-input-container .email-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; background: #e3f2fd; border: 1px solid #bbdefb;
    border-radius: 12px; font-size: 0.82rem; white-space: nowrap; max-width: 250px;
}
.chip-input-container .email-chip .chip-name { overflow: hidden; text-overflow: ellipsis; }
.chip-input-container .email-chip .chip-remove {
    cursor: pointer; font-size: 1rem; line-height: 1; color: #666;
    margin-left: 2px; font-weight: 600;
}
.chip-input-container .email-chip .chip-remove:hover { color: #c00; }
.chip-input {
    border: none; outline: none; flex: 1; min-width: 120px;
    font-size: 0.9rem; padding: 2px 0; background: transparent;
}

/* Anhänge im Compose */
.compose-attachments {
    display: none;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 0;
}

.compose-attachment {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #f8f9fa; border: 1px solid #e0e0e0; border-radius: 6px;
    font-size: 0.85rem; transition: all 0.15s;
}
.compose-attachment:hover          { background: #fff; border-color: #ccc; box-shadow: 0 2px 4px rgba(0,0,0,0.08); }
.compose-attachment.can-preview    { cursor: pointer; }

.attachment-icon  { flex-shrink: 0; display: flex; align-items: center; justify-content: center; }

.attachment-info {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; gap: 0.1rem;
}

.attachment-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.attachment-size { font-size: 0.75rem; color: #888; }

.attachment-actions { display: flex; gap: 0.25rem; margin-left: auto; }

.attachment-preview,
.attachment-remove,
.attachment-remove-btn,
.attachment-preview-btn,
.attachment-download-btn {
    background: none; border: none; cursor: pointer; color: #888;
    padding: 0.25rem; border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s; line-height: 1;
}

.attachment-preview:hover, .attachment-preview-btn:hover { color: var(--primary-green); background: var(--primary-10); }
.attachment-remove:hover,  .attachment-remove-btn:hover  { color: #dc3545; background: #ffebee; }
.attachment-download-btn:hover                           { color: #2196f3; background: #e3f2fd; }

/* === Preview im alten Stil (Kompat.) === */
.preview-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    padding: 1rem; border-bottom: 1px solid #e0e0e0; background: #f8f9fa;
}
.preview-subject { font-size: 1.2rem; font-weight: 600; color: #333; flex: 1; }
.preview-actions { display: flex; gap: 0.25rem; }

.preview-action-btn {
    padding: 0.5rem; background: #f0f0f0; border: none; border-radius: 4px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.preview-action-btn:hover  { background: #e0e0e0; }
.preview-action-btn svg    { width: 16px; height: 16px; }

.preview-info { padding: 1rem; border-bottom: 1px solid #e0e0e0; font-size: 0.9rem; }
.preview-info > div { margin-bottom: 0.25rem; }
.preview-info strong { color: #666; font-weight: 500; }

.preview-body { flex: 1; padding: 1rem; overflow: auto; line-height: 1.6; }
.preview-body pre { white-space: pre-wrap; word-wrap: break-word; font-family: inherit; margin: 0; }

.preview-attachments { padding: 1rem; border-top: 1px solid #e0e0e0; background: #f8f9fa; }

.attachments-header {
    display: flex; align-items: center; gap: 0.5rem;
    margin-bottom: 0.75rem; font-weight: 500; color: #666;
}

.attachments-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.attachment-item {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 0.75rem; background: white;
    border: 1px solid #ddd; border-radius: 4px; cursor: pointer; transition: all 0.15s;
}
.attachment-item:hover { background: #e9ecef; border-color: #bbb; }

/* === Zitierter Inhalt === */
.compose-quoted        { margin-top: 0.5rem; border-top: 1px solid #e0e0e0; padding-top: 0.5rem; }

.compose-quoted-toggle,
.preview-quoted-toggle {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 0.75rem; cursor: pointer;
    color: #666; font-size: 0.85rem; user-select: none; transition: color 0.15s;
}
.compose-quoted-toggle:hover, .preview-quoted-toggle:hover { color: var(--primary-green); }
.compose-quoted-toggle svg, .preview-quoted-toggle svg     { transition: transform 0.2s; }
.compose-quoted-toggle.expanded svg, .preview-quoted-toggle.expanded svg { transform: rotate(180deg); }

.compose-quoted-content {
    padding: 0.75rem 1rem; background: #f8f9fa; border-radius: 6px;
    margin-top: 0.5rem; max-height: 300px; overflow-y: auto;
    font-size: 0.9rem; color: #555; border-left: 3px solid var(--border-color);
}
.compose-quoted-content .email-quote  { border-left: none; padding-left: 0; }
.compose-quoted-content .quote-header { color: #888; margin-bottom: 0.5rem; }

.preview-quoted        { margin-top: 1rem; border-top: 1px solid #e0e0e0; padding-top: 0.75rem; }

.preview-quoted-content {
    padding: 0.75rem 1rem; background: #f8f9fa; border-radius: 6px;
    margin-top: 0.5rem; max-height: 400px; overflow-y: auto;
    font-size: 0.9rem; color: #555; border-left: 3px solid var(--border-color);
}
.preview-quoted-content pre { white-space: pre-wrap; word-break: break-word; margin: 0; font-family: inherit; }

/* Quoted Toggle (Chat / Thread) */
.chat-bubble-quoted    { border-top: 1px solid rgba(0,0,0,0.08); padding-top: 0.5rem; margin-top: 0.5rem; }

.quoted-toggle {
    display: flex; align-items: center; gap: 0.4rem;
    cursor: pointer; font-size: 0.8rem; color: #888;
    padding: 0.25rem 0; user-select: none; transition: color 0.15s;
}
.quoted-toggle:hover           { color: var(--primary-green); }
.quoted-toggle svg             { transition: transform 0.2s; flex-shrink: 0; }
.quoted-toggle.expanded svg    { transform: rotate(180deg); }

.quoted-content { margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px dashed rgba(0,0,0,0.1); }

/* === HTML-Vorschau im Compose === */
.compose-html-toggle {
    display: inline-flex; align-items: center; gap: 0.4rem;
    cursor: pointer; font-size: 0.85rem; color: var(--text-secondary);
    user-select: none; margin-right: auto;
}
.compose-html-toggle input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }

.compose-editor-row { display: flex; gap: 1rem; flex: 1; min-height: 0; }
.compose-editor-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.compose-modal-wide .modal-content { max-width: 1200px; }

.compose-html-preview {
    flex: 1; display: flex; flex-direction: column; min-width: 0;
    border-left: 1px solid var(--border-color); padding-left: 1rem;
}

.compose-html-preview-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 0.5rem; font-size: 0.85rem; font-weight: 600;
    color: var(--text-secondary);
}

.compose-preview-iframe {
    width: 100%; flex: 1; min-height: 250px;
    border: 1px solid var(--border-color); border-radius: 6px; background: #fff;
}

.compose-html-preview-loading { display: flex; justify-content: center; padding: 1rem; }

@media (max-width: 768px) {
    .compose-editor-row   { flex-direction: column; }
    .compose-html-preview { border-left: none; border-top: 1px solid var(--border-color); padding-left: 0; padding-top: 0.75rem; }
    .compose-modal-content { width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; margin: 0; }
}

/* === Klassische Thread-Ansicht === */
.classic-view { height: 100%; display: flex; flex-direction: column; }

.classic-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    padding: 1rem 1.25rem; border-bottom: 1px solid #e0e0e0; background: #fafafa;
}

.classic-subject { font-size: 1.25rem; font-weight: 600; color: #333; flex: 1; margin-right: 1rem; }
.classic-thread  { flex: 1; overflow-y: auto; padding: 0; }

.thread-message        { border-bottom: 1px solid #e8e8e8; }
.thread-message:last-child { border-bottom: none; }

.thread-message-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.75rem 1.25rem; cursor: pointer; transition: background 0.15s;
}
.thread-message-header:hover                    { background: #f5f5f5; }
.thread-message.expanded .thread-message-header { background: var(--primary-5); border-bottom: 1px solid #e0e0e0; }

.thread-message-from { display: flex; align-items: center; gap: 0.75rem; flex: 1; min-width: 0; }
.thread-message-from .from-name             { font-weight: 600; color: #333; white-space: nowrap; }
.thread-message-from.is-own .from-name      { color: var(--primary-green); }
.thread-message-from .preview-snippet       { color: #888; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }

.thread-message-meta { display: flex; align-items: center; gap: 0.5rem; color: #888; font-size: 0.85rem; flex-shrink: 0; }
.thread-message-meta .has-attachment-icon { color: #666; }
.thread-message-meta .expand-icon         { transition: transform 0.2s; }
.thread-message.expanded .expand-icon     { transform: rotate(180deg); }

.thread-message-body  { display: none; padding: 1rem 1.25rem; background: #fff; }
.thread-message.expanded .thread-message-body { display: block; }

.thread-message-details {
    font-size: 0.9rem; color: #555; margin-bottom: 1rem;
    padding-bottom: 0.75rem; border-bottom: 1px solid #eee;
}
.thread-message-details div { margin-bottom: 0.25rem; }

.thread-message-content             { line-height: 1.6; }
.thread-message-content img         { max-width: 100%; height: auto; }
.thread-message-content pre         { white-space: pre-wrap; word-wrap: break-word; font-family: inherit; }

.thread-message-body .chat-bubble-attachments { margin: 0.75rem 0; padding: 0; border-top: none; }

/* === Chat-Bubbles === */
.conversation-header { padding: 1rem 1.5rem; border-bottom: 1px solid #e0e0e0; background: #fafafa; }
.conversation-subject { font-size: 1.25rem; font-weight: 600; color: #333; margin-bottom: 0.25rem; }
.conversation-meta    { font-size: 0.8rem; color: #888; margin-bottom: 0.75rem; }

.conversation-messages {
    padding: 1rem; display: flex; flex-direction: column; gap: 1rem;
    max-height: calc(100vh - 280px); overflow-y: auto;
}

.chat-bubble {
    max-width: 85%; padding: 0.75rem 1rem; border-radius: 12px; position: relative;
}
.chat-bubble-other { align-self: flex-start; background: #f0f0f0; border-bottom-left-radius: 4px; }
.chat-bubble-own   { align-self: flex-end; background: #e3f2fd; border-bottom-right-radius: 4px; }

.chat-bubble-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; gap: 1rem; }
.chat-bubble-cc     { font-size: 0.75rem; color: #888; margin-bottom: 0.35rem; }

.chat-bubble-sender               { font-weight: 600; font-size: 0.85rem; color: #333; }
.chat-bubble-own .chat-bubble-sender { color: #1565c0; }
.chat-bubble-date { font-size: 0.75rem; color: #888; white-space: nowrap; }

.chat-bubble-body              { font-size: 0.9rem; line-height: 1.5; color: #333; word-wrap: break-word; }
.chat-bubble-body .plain-text  { white-space: pre-wrap; font-family: inherit; }
.chat-bubble-body img          { max-width: 100%; height: auto; }
.chat-bubble-body a            { color: #1976d2; }
.chat-bubble-own .chat-bubble-body { color: #1a237e; }

.chat-bubble-attachments { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid rgba(0,0,0,0.1); }

.chat-bubble-attachments.compose-attachments {
    background: transparent; padding: 0.75rem 0 0 0; border-top: 1px solid rgba(0,0,0,0.1);
}

.chat-bubble .compose-attachment           { background: rgba(255,255,255,0.7); border-color: rgba(0,0,0,0.1); }
.chat-bubble .compose-attachment:hover     { background: rgba(255,255,255,0.9); border-color: rgba(0,0,0,0.2); }
.chat-bubble-own .chat-bubble-attachments  { border-top-color: rgba(0,0,0,0.08); }
.chat-bubble-own .compose-attachment       { background: rgba(255,255,255,0.5); }
.chat-bubble-own .compose-attachment:hover { background: rgba(255,255,255,0.8); }

/* === Ansichtsmodus-Auswahl === */
.view-mode-toggle { display: flex; gap: 0.75rem; margin-top: 0.5rem; }

.view-mode-option {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.75rem 1rem; border: 2px solid #e0e0e0; border-radius: 8px;
    cursor: pointer; transition: all 0.2s; flex: 1;
}
.view-mode-option:hover        { border-color: #bbb; background: #f5f5f5; }
.view-mode-option.active       { border-color: var(--primary-green); background: var(--primary-10); }
.view-mode-option input[type="radio"] { display: none; }
.view-mode-option svg          { color: #666; flex-shrink: 0; }
.view-mode-option.active svg   { color: var(--primary-green); }
.view-mode-option span         { font-weight: 500; color: #333; }

/* === Signatur-Verwaltung === */
.signatur-list { display: flex; flex-direction: column; gap: 1rem; }

.signatur-item { border: 1px solid #ddd; border-radius: 6px; padding: 0.75rem; background: #fafafa; }

.signatur-item-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.signatur-item-header .signatur-name { flex: 1; font-weight: 600; }

.signatur-item-actions { display: flex; gap: 0.25rem; flex-shrink: 0; }

.sig-toolbar {
    display: flex; align-items: center; gap: 0.25rem; padding: 0.25rem;
    background: #f0f0f0; border: 1px solid #ddd; border-bottom: none;
    border-radius: 4px 4px 0 0;
}

.sig-toolbar-btn {
    padding: 0.2rem 0.4rem; background: transparent;
    border: 1px solid transparent; border-radius: 3px; cursor: pointer; font-size: 13px; line-height: 1;
}
.sig-toolbar-btn:hover { background: #e0e0e0; }

.sig-color-label { display: flex; align-items: center; gap: 2px; cursor: pointer; font-size: 13px; }
.sig-color-input { width: 20px; height: 20px; border: none; padding: 0; cursor: pointer; background: transparent; }

.signatur-editor {
    min-height: 80px; max-height: 200px; overflow-y: auto;
    padding: 0.5rem; border: 1px solid #ddd; border-radius: 0 0 4px 4px;
    background: white; font-family: Arial, sans-serif; font-size: 13px; line-height: 1.4;
}
.signatur-editor:focus { outline: none; border-color: var(--primary-green); }

/* Signatur-Dropdown in Compose-Toolbar */
.toolbar-dropdown { position: relative; display: inline-block; }

.toolbar-dropdown-menu {
    display: none; position: absolute; top: 100%; left: 0;
    min-width: 180px; background: white; border: 1px solid #ddd;
    border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 100; max-height: 200px; overflow-y: auto;
}
.toolbar-dropdown-menu.active { display: block; }

.toolbar-dropdown-item { padding: 0.5rem 0.75rem; cursor: pointer; font-size: 13px; white-space: nowrap; }
.toolbar-dropdown-item:hover { background: #f0f0f0; }

/* === E-Mail-Setup-Wizard === */
.setup-wizard-container {
    max-width: 600px; margin: 2rem auto; padding: 2rem;
    background: white; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.setup-step h2       { margin-bottom: 0.5rem; color: #333; }
.setup-description   { color: #666; margin-bottom: 1.5rem; }

.setup-server-section { margin-bottom: 1.5rem; padding: 1rem; background: #f8f9fa; border-radius: 6px; }
.setup-server-section h3 { margin: 0 0 1rem 0; font-size: 1rem; }

.setup-buttons { display: flex; gap: 0.75rem; margin-top: 1.5rem; justify-content: flex-end; }

.setup-test-result { margin: 1rem 0; padding: 1rem; border-radius: 6px; }
.setup-test-result.testing { background: #fff3cd; border: 1px solid #ffc107; }
.setup-test-result.success { background: #d4edda; border: 1px solid #28a745; }
.setup-test-result.error   { background: #f8d7da; border: 1px solid #dc3545; }
.setup-test-result ul      { margin: 0.5rem 0 0 1.5rem; padding: 0; }

.setup-sync-progress { text-align: center; padding: 2rem; }
.setup-sync-progress .spinner {
    width: 48px; height: 48px;
    border: 4px solid #e0e0e0; border-top-color: var(--primary-green);
    border-radius: 50%; animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.setup-progress { display: flex; align-items: center; justify-content: center; margin-bottom: 2rem; }

.progress-step {
    width: 32px; height: 32px; border-radius: 50%;
    background: #e0e0e0; color: #666;
    display: flex; align-items: center; justify-content: center; font-weight: 500;
}
.progress-step.active, .progress-step.completed { background: var(--primary-green); color: white; }

.progress-line { width: 40px; height: 2px; background: #e0e0e0; }

/* === Rundschreiben-Tabellen === */
#rs-liste-tabelle,
#rs-empfaenger-tabelle { table-layout: auto; }

#rs-liste-tabelle td,
#rs-empfaenger-tabelle td { white-space: normal; }

/* === veranstaltungen.css === */
/* =============================================================
   VERANSTALTUNGEN — Anmeldeseite, Gast-Felder, Benutzerdefinierte Felder
   ============================================================= */

/* === Anmeldeseite Layout === */
.anmelde-card {
    text-align: left;
    max-width: 960px;
}

.anmelde-gast-felder {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.anmelde-feld-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.anmelde-submit-row {
    text-align: right;
    margin-top: 3rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

/* === Benutzerdefinierte Felder auf Anmeldeseite === */
.anmelde-details-sektion {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.custom-field-wrapper {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #f7f9fc;
    border-radius: 8px;
}

.custom-field-wrapper label {
    font-weight: 600;
    display: block;
    margin-bottom: 0.75rem;
}

.custom-field-wrapper .form-group { margin-bottom: 0.5rem; }

.custom-field-wrapper .option-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
}

.custom-field-wrapper .anzahl-option-item {
    display: grid;
    grid-template-columns: 1fr 120px;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

/* === Responsive Anmeldeseite === */
@media (max-width: 640px) {
    .anmelde-card {
        padding: 1.25rem 1rem;
        border-radius: 0;
        box-shadow: none;
        border-left: none;
        border-right: none;
        max-width: 100%;
    }

    .anmelde-card h1 {
        font-size: 1.3rem;
        line-height: 1.3;
    }

    .teilnahmegebuehr-info { font-size: 0.9rem; }

    .anmelde-details-sektion { margin-top: 1.25rem; padding-top: 1rem; }

    .anmelde-feld-row { grid-template-columns: 1fr; }

    .anmelde-card .form-control {
        padding: 12px 14px;
        font-size: 1rem;
        min-height: 48px;
    }

    .anmelde-card input[type="checkbox"] {
        width: 1.5rem !important;
        height: 1.5rem !important;
        min-width: 1.5rem;
    }

    .anmelde-submit-row {
        text-align: center;
        margin-top: 2rem;
        padding-top: 1.25rem;
    }

    .anmelde-submit-row .btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 1.1rem;
    }

    .anmelde-details-sektion .delete-gast-btn {
        width: 100%;
        margin-top: 0.75rem !important;
    }

    #add-externe-zeile-btn {
        width: 100%;
        margin-top: 1rem;
        padding: 12px;
    }

    .custom-field-wrapper { padding: 0.75rem; }

    .custom-field-wrapper .anzahl-option-item {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }

    .custom-field-wrapper .anzahl-option-item input[type="number"] {
        min-height: 44px;
        font-size: 1rem;
    }

    .custom-field-wrapper .option-label {
        padding: 0.5rem 0;
        gap: 0.75rem;
    }

    .custom-field-wrapper .option-label input[type="radio"],
    .custom-field-wrapper .option-label input[type="checkbox"] {
        width: 1.25rem;
        height: 1.25rem;
        min-width: 1.25rem;
    }

    .confirmation-popup-content {
        width: 95vw !important;
        max-width: 95vw !important;
        padding: 1.25rem !important;
    }

    .confirmation-popup-buttons {
        flex-direction: column-reverse;
        gap: 0.75rem;
    }

    .confirmation-popup-buttons .btn {
        width: 100%;
        padding: 13px;
        text-align: center;
    }

    .anmelde-card .form-chapter-title { font-size: 1rem; }
}

/* === utilities.css === */
/* =============================================================
   UTILITIES — Hilfsklassen, Spinner, Animationen
   ============================================================= */

/* === Sichtbarkeit === */
.d-none {
    display: none !important;
}

/* === Farben === */
.positive { color: var(--hover-green); }
.negative { color: #e53935; }

/* === Spinner / Lade-Animationen === */
@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-green);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 3rem auto;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 0.5rem;
}

.spinner-small {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* === Empty State === */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #999;
    text-align: center;
}

.empty-state svg {
    margin-bottom: 1rem;
}

/* === Formular-Kapitel-Titel (kompakt, für Detailansicht) === */
.form-chapter-title.compact {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

/* === View-Controls (Such- und Steuerleiste) === */
.view-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 1.5rem;
}

.filter-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.filter-bar .form-control {
    width: auto;
    min-width: 120px;
    height: 34px;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-bg);
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2390a4ae' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 14px;
    padding-right: 2rem;
}
.filter-bar .form-control:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 2px var(--primary-10);
    outline: none;
}

.search-container {
    position: relative;
    flex-grow: 1;
    min-width: 200px;
}

/* === Kippschalter (Mitglieder/Tabelle) === */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 160px;
    height: 38px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--primary-green);
    transition: .4s;
    border-radius: 34px;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.slider::before {
    position: absolute;
    content: "Mitglied";
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    width: 78px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    color: var(--primary-green);
    transition: .4s;
    border-radius: 34px;
    z-index: 2;
}

.slider::after {
    position: absolute;
    content: 'Mitglied / Tabelle';
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    z-index: 1;
}

input:checked + .slider:before {
    transform: translateX(78px);
    content: "Tabelle";
}
