/* 1. Einheitliches Farbschema */
:root {
    --dark-bg: #263238;          /* Dunkles Blau/Grau für Navi & Footer */
    --primary-green: #2E7D32;      /* Haupt-Grün für Header & Akzente */
    --hover-green: #4CAF50;        /* Helleres Grün für Hover-Effekte */
    --page-bg: #f7f9fc;           /* Helles Grau für den Seitenhintergrund */
    --text-light: #ECEFF1;        /* Helles Grau/Weiß für Text auf dunklem Grund */
    --text-dark: #37474F;         /* Dunkles Grau für Text auf hellem Grund */
    --card-bg: #FFFFFF;           /* Weiß für die Inhalts-Karten */
    --border-color: #CFD8DC;      /* Helle Rahmenfarbe */
}

/* 2. Grund-Layout & Typografie */
html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background-color: var(--page-bg);
    color: var(--text-dark);
    position: relative;
}

.main-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--page-bg);
    position: relative;
    left: 0;
    transition: left 0.3s ease-in-out;
}

.main-wrapper.active {
    left: 280px;
}

/* 3. Header */
.header {
    display: flex;
    align-items: center;
    background-color: var(--primary-green);
    color: var(--text-light);
    padding: 1rem 1.5rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 60px;
    box-sizing: border-box;
    transition: left 0.3s ease-in-out;
}

.main-wrapper.active .header {
    left: 280px;
}

.menu-icon {
    cursor: pointer;
    padding: 0.5rem;
    width: 28px;
    height: 18px;
    position: relative;
}

.menu-icon span {
    display: block;
    width: 28px;
    height: 4px;
    background-color: var(--text-light);
    border-radius: 2px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    transition: all 0.3s ease-in-out;
}

.menu-icon span:nth-child(1) {
    top: 0;
}

.menu-icon span:nth-child(2) {
    top: 50%;
    transform: translate(-50%, -50%);
}

.menu-icon span:nth-child(3) {
    bottom: 0;
}

/* Hamburger zu X Animation */
.menu-icon.active span:nth-child(1) {
    top: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
}

.menu-icon.active span:nth-child(2) {
    opacity: 0;
    transform: translate(-50%, -50%) scaleX(0);
}

.menu-icon.active span:nth-child(3) {
    bottom: 50%;
    transform: translate(-50%, 50%) rotate(-45deg);
}

.header-title {
    margin-left: 1.5rem;
    font-size: 1.2rem;
    display: flex; /* Damit Logo und Text vertikal zentriert sind */
    align-items: center;
}

.header-logo {
    height: 40px;
    width: auto;
    margin-right: 0.75rem;
}

.app-name {
    font-weight: 700;
}

.module-name {
    font-weight: 300;
    margin-left: 0.75rem;
    padding-left: 0.75rem;
    border-left: 1px solid rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-module-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* 4. Seitliches Navigationsmenü */
.side-nav {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background-color: var(--dark-bg);
    z-index: 100;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    box-sizing: border-box;
    transition: left 0.3s ease-in-out;
}

.side-nav.active {
    left: 0;
}

.nav-button {
    padding: 15px 25px;
    text-decoration: none;
    font-size: 1.1rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background-color 0.2s, color 0.2s;
    border-left: 4px solid transparent;
}

.nav-button:hover {
    background-color: var(--primary-green);
    border-left: 4px solid var(--hover-green);
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-spacer {
    flex: 1 1 auto;
    min-height: 20px;
}

.nav-settings {
    border-top: 1px solid #455a64;
}

.logout-button {
    border-top: none;
}

/* 4.5 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: 60px;
    left: 0;
    right: 0;
    z-index: 999;
    height: 38px;
    box-sizing: border-box;
    transition: left 0.3s ease-in-out;
}

.main-wrapper.active .tab-header {
    left: 280px;
}

.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;
}

/* 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;
}

/* 5. Hauptinhaltsbereich */
.container {
    flex-grow: 1;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem;
    padding-top: calc(60px + 2rem); /* Header-Höhe + normales Padding */
    padding-bottom: calc(50px + 2rem); /* Footer-Höhe + normales Padding */
    box-sizing: border-box;
}

/* Wenn Tab-Header vorhanden ist */
.tab-header ~ main.container {
    padding-top: calc(60px + 38px + 2rem); /* Header + Tab-Header + Padding */
}

.card {
    background-color: var(--card-bg);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    text-align: center;
    border-top: 5px solid var(--primary-green);
}

.card h1 {
    color: var(--text-dark);
}

/* --- Füge dies zu deinem CSS hinzu --- */

/* Verbesserter Button-Stil (überschreibt alte .btn Regeln falls vorhanden) */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-light);
    background-color: var(--primary-green);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease;
}

.btn:hover {
    background-color: var(--hover-green);
}

.btn:active {
    transform: scale(0.98); /* Kleiner Klick-Effekt */
}

/* 8. Modal / Popup-Stile (neuer Abschnitt am Ende der Datei) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none; /* Standardmäßig versteckt */
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-overlay.active {
    display: flex; /* Sichtbar machen */
}

.modal-content {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 800px;
    position: relative;
    max-height: 80vh; /* Maximale Höhe */
    overflow-y: auto; /* Scrollbar, falls Inhalt zu lang */
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.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-body h4 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

/* Sending Modal - 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;
}

/* Auswertungs-Kachel */
.auswertung-card {
    background: linear-gradient(135deg, #f0f7f0 0%, #e8f5e9 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;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-hint {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 1rem;
    font-style: italic;
}

/* 6. Footer */
.footer {
    background-color: var(--dark-bg);
    color: #90A4AE;
    text-align: center;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 998;
    height: 50px;
    box-sizing: border-box;
    transition: left 0.3s ease-in-out;
}

.main-wrapper.active .footer {
    left: 280px;
}

.footer p {
    margin: 0;
    color: #90A4AE;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
}

.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);
}

/* 7. Hilfsklassen */
.d-none {
    display: none !important; /* Wichtig, um das Menü-Icon zu verstecken */
}

/* --- Füge dies am Ende deiner CSS-Datei hinzu --- */

/* 9. Verbessertes Formular-Layout im Modal */

.form-chapter-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-green);
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
    position: relative; /* Wichtig für die PLZ-Ergebnisliste */
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15);
    outline: none;
}

/* Stil für die PLZ/Ort Suchergebnisse */
.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; /* Muss über dem Modal-Inhalt liegen */
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.autocomplete-item {
    padding: 10px 12px;
    cursor: pointer;
}

.autocomplete-item:hover {
    background-color: var(--page-bg);
}

.autocomplete-item .ort {
    color: #6c757d;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

.zahler-search-container {
    position: relative;
    width: 100%;
}

.zahler-search-container input {
    width: 100%;
    box-sizing: border-box;
}

.zahler-search-container .autocomplete-results {
    top: 100%; /* Positioniert die Ergebnisse direkt unter dem Input */
    left: 0;
    margin-top: 2px;
}

.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;
}

/* ... bestehende Stile ... */

/* 10. Stile für Mitglieder-Übersicht */
.view-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap; /* Verhindert Umbruch */
    gap: 1.5rem;
}


/* NEU: Stile zum Ein- und Ausblenden der Ansichten */
#mitglied-detail-ansicht,
#mitglied-tabelle-ansicht,
#veranstaltung-detail-ansicht,
#veranstaltung-tabelle-ansicht {
    display: none; /* Beide Ansichten standardmäßig ausblenden */
}

#mitglied-detail-ansicht.active,
#mitglied-tabelle-ansicht.active,
#veranstaltung-detail-ansicht.active,
#veranstaltung-tabelle-ansicht.active {
    display: block; /* Nur die Ansicht mit der .active-Klasse anzeigen */
}

.search-container {
    position: relative;
    flex-grow: 1; /* Nimmt verfügbaren Platz ein */
    min-width: 200px;
}

/* Responsive Button mit Text-Verkürzung */
.btn-responsive {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: auto;
    max-width: 220px; /* Maximale Breite */
}

@media (max-width: 768px) {
    .btn-responsive span {
        display: none; /* Text auf kleinen Bildschirmen ausblenden */
    }
}


/* Kippschalter für die Ansicht - NEUES DESIGN */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 160px;
    height: 38px;
    flex-shrink: 0; /* Verhindert, dass der Schalter schrumpft */
}

.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'; /* Nur als "Hintergrund" Text */
    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";
}

/* 11. Neue Stile für die Detailansicht */

.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; /* Verhindert, dass die Pfeile schrumpfen */
}

.nav-arrow:hover {
    background-color: var(--primary-green);
    border-color: #90A4AE;
}

.mitglied-header-center {
    display: flex;
    align-items: center; /* Richtet ID und Name an der Grundlinie aus */
    gap: 0.75rem;
    flex-grow: 1; /* Nimmt den meisten Platz ein */
    min-width: 0; /* Wichtig für Flexbox, um Schrumpfen zu erlauben */
    border-radius: 8px;
}

#mitglied-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;
}

#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;
}

#mitglied-name-header {
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    min-width: 0;
}

/* Name-Header Row fuer Vorname/Nachname */
.name-header-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.name-header-row .editable-field {
    border: none !important;
    padding: 0.25rem 0.5rem !important;
    margin: 0 !important;
    cursor: pointer;
    min-width: auto;
}

.name-header-row .editable-field .display-value {
    font-size: 1.6rem;
    font-weight: 600;
}

.name-header-row .editable-field:hover {
    background-color: rgba(0,0,0,0.05);
    border-radius: 4px;
}

#veranstaltung-name-header{
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    min-width: 0;
}

/* NEU: Stile für den deaktivierten Zustand der Veranstaltungs-Details */
#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; /* Macht die Felder unklickbar */
}

#veranstaltung-details-content.is-disabled #veranstaltung-name-header {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

.letzte-aktualisierung {
    font-size: 0.8rem;
    color: #6c757d;
    text-align: right;
    white-space: nowrap;
    margin-left: auto; /* Schiebt das Datum ganz nach rechts */
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
}

/* NEU: Stile für die Kopfzeile des Vereinsdaten-Abschnitts */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-column .form-chapter-title {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.detail-actions {
    grid-column: 1 / -1; /* Nimmt die volle Breite ein */
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    display: flex;
    gap: 1rem;
}

.anmerkungen-section {
    grid-column: 1 / -1;
}

.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 {
    border-bottom: 1px solid #f0f0f0;
}
.anmerkung-item:last-child {
    border-bottom: none;
}

.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;
}

/* Datei: src/static/css/style.css */

#mitglied-name-header,
#mitglied-name-header .display-value,
#mitglied-name-header input {
    font-size: 1.5rem !important; /* !important stellt sicher, dass die Regel gewinnt */
    font-weight: 600;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 12. Stile für die neue statische Detailansicht */
/* NEU: Stile für den deaktivierten Zustand des Formulars hinzufügen */
#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; /* Macht die Felder unklickbar */
}

/* Datei: src/static/css/style.css */

/* Ausnahme für die Haupt-Überschrift anpassen */
#mitglied-details-content.is-disabled #mitglied-name-header {
    opacity: 0.5; /* Sorge dafür, dass es auch ausgegraut wird */
    pointer-events: none; /* KORREKTUR: Deaktiviert Klicks im leeren Zustand */
    cursor: not-allowed;
}

.editable-field {
    position: relative;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 1rem; /* Mehr Abstand */
    background-color: #f7f9fc;
    cursor: text;
    transition: background-color 0.2s;
}

.editable-field:hover {
    background-color: #eef2f7;
}

.display-field {
    position: relative;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 1rem;
    background-color: #f7f9fc; /* Gleicher Look wie die anderen Felder */
}

.editable-field .label-below,
.display-field .label-below {
    position: absolute;
    top: -10px; /* Positioniert das Label über dem Feld */
    left: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-green);
    background-color: var(--card-bg); /* Hintergrund der Karte */
    padding: 0 5px;
}

.editable-field .display-value {
    font-size: 1rem;
    min-height: 1.2rem; /* Verhindert Springen bei leeren Feldern */
    white-space: nowrap;      /* NEU: Verhindert den Zeilenumbruch */
    overflow: hidden;         /* NEU: Versteckt überstehenden Text */
    text-overflow: ellipsis;  /* NEU: Fügt "..." am Ende hinzu, wenn der Text zu lang ist */
    display: block;           /* NEU: Stellt sicher, dass die obigen Eigenschaften korrekt angewendet werden */
}

.editable-field input.form-control {
    padding-top: 10px; /* Gibt dem Label oben Platz */
}

.editable-field input,
.editable-field select {
    width: 100%;
    border: none;
    background-color: transparent;
    font-size: 1rem;
    margin: 0;
    outline: none;
}

/* Spezielle Hervorhebung für wichtige Felder in der Mitglieder-Detailansicht */
.editable-field[data-field="funktionen"],
.display-field[data-field="mitgliedsbeitrag"] {
    border: 1px solid var(--primary-green);
    background-color: #e8f5e9;
}

/* Spezielle Hervorhebung für Popup-Buttons in der Veranstaltungs-Detailansicht */
#open-custom-fields-modal-btn,
#einladung-feld,
.response-details-trigger {
    border: 1px solid var(--primary-green);
    background-color: #e8f5e9;
}

#open-custom-fields-modal-btn:hover,
#einladung-feld:hover,
.response-details-trigger:hover {
    background-color: #c8e6c9;
}

/* Hebt die grüne Hervorhebung auf, wenn keine Veranstaltung ausgewählt ist */
#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: #e8f5e9;
}

/* Hebt die grüne Hervorhebung auf, wenn kein Mitglied ausgewählt ist */
#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: #e8f5e9; /* Standard-Hintergrundfarbe der Felder */
}

/* Styling für Icon-Buttons in Formularfeldern */
.field-with-icon {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.field-with-icon .display-value {
    flex-grow: 1; /* Sorgt dafür, dass der Text den verfügbaren Platz einnimmt */
}

.icon-button {
    flex-shrink: 0; /* Verhindert, dass das Icon schrumpft */
    margin-left: 0.75rem;
    color: var(--primary-green);
    text-decoration: none;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.icon-button:hover {
    opacity: 1;
}

/* Versteckt den Button, wenn das Feld leer ist */
.icon-button.hidden {
    display: none;
}

/* 13. Stile für In-Place-Editoren in der Detailansicht */
.editable-field .editor {
    width: 100%;
    border: none;
    background-color: transparent;
    font-family: inherit;
    font-size: 1rem;
    padding: 0;
    margin: 0;
    outline: none;
    box-sizing: border-box;
    height: 24px; /* Sorgt für eine konsistente Höhe */
}

.editable-field select.editor {
    /* Leichte Anpassung, damit Select-Boxen gut aussehen */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' 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: 1em;
    padding-right: 2rem;
}

/* 13. Stile für das 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; /* Rötlich */
    margin-left: 0.5rem;
}

.historie-aenderung .neuer-wert {
    color: #43a047; /* Grünlich */
    margin-left: 0.5rem;
}

/* 14. Stile für editierbare Tabelle */
.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);
}

/* Visuelles Feedback beim Speichern */
.editable-table td.saved {
    background-color: #dcedc8; /* Hellgrün */
}
.editable-table td.error {
    background-color: #ffcdd2; /* Hellrot */
}

/* Styling für Ansichtsprofile und Spalten-Checkboxen */
.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;
}

/* Einfaches Styling für die neue Mitgliedertabelle */
#mitglied-tabelle {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}
#mitglied-tabelle th,
#mitglied-tabelle td {
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-size: 0.9rem;
}
#mitglied-tabelle th {
    background-color: var(--page-bg);
    position: sticky;
    top: 0;
}
.table-container {
    max-height: 600px;
    overflow-y: auto;
    width: 100%;
}

/* --- Styling für die benutzerdefinierte Tabelle --- */

/* Grund-Layout */
.table-container {
    max-height: 600px;
    overflow: auto;
    width: 100%;
    position: relative;
}
#mitglied-tabelle,
#veranstaltung-tabelle,
#wizard-mitglied-tabelle,
#custom-mitglied-tabelle,
#rechnung-tabelle {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* SEHR WICHTIG: Verhindert den Scrollbalken */
}
#mitglied-tabelle th,
#mitglied-tabelle td,
#veranstaltung-tabelle th,
#veranstaltung-tabelle td,
#wizard-mitglied-tabelle th,
#wizard-mitglied-tabelle td,
#custom-mitglied-tabelle th,
#custom-mitglied-tabelle td,
#rechnung-tabelle th,
#rechnung-tabelle td {
    border: 1px solid var(--border-color);
    padding: 0.6rem 0.8rem;
    text-align: left;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden; /* Verhindert, dass Inhalt die Zelle vergrößert */
    text-overflow: ellipsis; /* Fügt "..." bei zu langem Text hinzu */
}
#mitglied-tabelle th,
#veranstaltung-tabelle th,
#wizard-mitglied-tabelle th,
#custom-mitglied-tabelle th,
#rechnung-tabelle th {
    background-color: var(--page-bg);
    position: sticky;
    top: 0;
    z-index: 10;
    user-select: none;
}

/* 1. Spaltenbreite anpassen (unverändert) */
.resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 5px;
    cursor: col-resize;
    z-index: 11;
}

/* 2. Spalten verschieben (Drag & Drop) */
.draggable-header, .header-text { /* Gilt nur für den Text, nicht den ganzen Header */
    cursor: grab;
    display: block;
    padding: 0.2rem 0;
    padding-right: 22px; /* Platz für Filter-Button */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.draggable-header:active, .header-text:active {
    cursor: grabbing;
}
/* Grüner Platzhalter zwischen den Spalten */
.drag-placeholder {
    border-left: 3px solid var(--primary-green);
}

/* 3. Sortierung (NEU) */
.sort-indicator {
    margin-left: 5px;
    opacity: 0.5;
    display: inline-block;
    width: 1em; /* Sorgt für gleichbleibenden Platz */
}

/* Allgemeiner Style für alle Tabellen-Header mit Filter-Buttons */
#mitglied-tabelle th,
#rechnung-tabelle th,
#wizard-mitglied-tabelle th,
#custom-mitglied-tabelle th,
#mahnung-tabelle th,
#invite-mitglied-tabelle th,
#veranstaltung-tabelle th {
    position: relative;
}

/* 4. Excel-ähnliches Filter-Popup (unverändert) */
.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 {
    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; }

/* 5. Ergebniszeile (tfoot) (unverändert) */
#mitglied-tabelle tfoot td,
#veranstaltung-tabelle tfoot td {
    font-weight: bold;
    background-color: #f0f3f5;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

/* NEU: Styling für interaktive Ergebnis-Zellen */
.summary-cell {
    cursor: pointer;
}
.summary-cell:hover {
    background-color: #e0e6eb;
}

/* --- Korrekturen für Einladungs-Popup --- */

/* Wendet den Standard-Tabellen-Stil auch auf die Einladungs-Tabelle an */
#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;
}

/* Verhindert, dass das Popup in der Mitte des Modals landet */
/* Filter-Popup in Modalen bleibt fixed für korrekte Positionierung */
#invite-filter-popup,
#wizard-filter-popup,
#custom-filter-popup {
    position: fixed;
    z-index: 10001; /* Höher als Modal */
}

/* 15. Stile für die finale Empfängerliste im E-Mail-Modal */
.recipient-list-container {
    max-height: 50vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
}

.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;
}

/* 16. Stile für das Anmelde-Bestätigungs-Popup */
.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);
}

.validation-error {
    color: #c62828; /* Rote Farbe */
    font-size: 0.8rem;
    margin-top: 4px;
    display: block; /* Stellt sicher, dass die Nachricht unter dem Feld erscheint */
}

/* Roter Rahmen für ungültige Felder */
input.invalid {
    border-color: #c62828 !important;
    box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.15) !important;
}

/* 18. Stile für das "Benutzerdefinierte Felder"-Modal */
.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;
}

.option-item input {
    flex-grow: 1;
}

.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; /* Standardmäßig versteckt */
}

.options-row.visible {
    display: table-row; /* Sichtbar machen */
}

.options-cell {
    background-color: #f7f9fc;
    border-top: 2px solid var(--primary-green) !important;
    padding: 1.5rem !important;
}

/* 20. Stile für die benutzerdefinierten Felder auf der 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;
}

/* 21. 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: 1rem;
    font-weight: 600;
    color: var(--primary-green);
    margin: 0 0 1.5rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-green);
}

.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;
}

.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-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-dark);
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.btn-icon:hover {
    background-color: #e0e0e0;
}

.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;
}

.aktionen-cell {
    white-space: nowrap;
    text-align: center;
}

.aktionen-cell .btn-icon {
    margin: 0 2px;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
}

/* Status Message */
.status-message {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.status-message.success {
    background-color: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #A5D6A7;
}

.status-message.error {
    background-color: #FFEBEE;
    color: #C62828;
    border: 1px solid #EF9A9A;
}

/* Test Result */
.test-result {
    padding: 1rem;
    border-radius: 6px;
    margin-top: 1rem;
}

.test-result.success {
    background-color: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #A5D6A7;
}

.test-result.error {
    background-color: #FFEBEE;
    color: #C62828;
    border: 1px solid #EF9A9A;
}

/* Toggle/Checkbox Styles */
.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;
}

/* Password Field */
.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;
}

/* Info Card */
.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;
}

/* Spinner */
.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;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Navigation Spacer */
.nav-spacer {
    flex-grow: 1;
    min-height: 2rem;
}

.nav-settings {
    margin-top: auto;
}

/* 22. 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;
}

.field-hint {
    font-size: 0.85rem;
    color: #78909C;
    margin: 0.25rem 0 0.75rem 0;
}

/* Visually hidden but accessible */
.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;
}

/* 23. Color Picker */
.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;
}

/* Button Variants */
.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-dark);
}

.btn-outline:hover {
    background-color: var(--page-bg);
    border-color: var(--primary-green);
    color: var(--primary-green);
}

.btn-danger {
    background-color: #c62828;
    color: white;
}

.btn-danger:hover {
    background-color: #b71c1c;
}

/* Bilanz Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.dashboard-card {
    background: var(--page-bg);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    border: 1px solid var(--border-color);
}

.dashboard-card.positive { border-left: 4px solid #4CAF50; }
.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;
}

/* Wizard Steps */
.wizard-steps {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.wizard-step {
    flex: 1;
    text-align: center;
    padding: 0.5rem;
    color: #90A4AE;
    font-size: 0.9rem;
}

.wizard-step.active { color: var(--primary-green); font-weight: 600; }
.wizard-step.completed { color: var(--primary-green); }
.wizard-step.completed::after { content: ' ✓'; }

.wizard-content { min-height: 300px; }

/* Upload Area */
.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);
}

/* Mapping Grid */
.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; }

/* Kategorien Tabs */
.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; }

/* Disabled Row */
.disabled-row {
    opacity: 0.5;
    background-color: #f5f5f5 !important;
}

.disabled-row select { pointer-events: none; }

/* Modal Sizes */
.modal-content.modal-large { max-width: 900px; width: 95%; }
.modal-content.modal-small { max-width: 400px; }

/* Positive/Negative Colors */
.positive { color: #4CAF50; }
.negative { color: #e53935; }

/* Checkbox Label */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] { width: 18px; height: 18px; }

/* Autocomplete Container */
.autocomplete-container { position: relative; }

/* Responsive Bilanz */
@media (max-width: 900px) {
    .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
    .mapping-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Responsive Color Picker */
@media (max-width: 600px) {
    .color-picker-grid {
        grid-template-columns: 1fr;
    }

    .logo-upload-area {
        flex-direction: column;
        align-items: center;
    }

    .dashboard-grid { grid-template-columns: 1fr; }
    .mapping-grid { grid-template-columns: 1fr; }
}

/* 24. Toast Notifications */
#toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    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-success {
    border-left-color: #4CAF50;
}

.toast-success .toast-icon {
    color: #4CAF50;
}

.toast-error {
    border-left-color: #f44336;
}

.toast-error .toast-icon {
    color: #f44336;
}

.toast-warning {
    border-left-color: #FF9800;
}

.toast-warning .toast-icon {
    color: #FF9800;
}

.toast-info {
    border-left-color: #2196F3;
}

.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);
}

/* 25. 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) {
    #toast-container {
        left: 10px;
        right: 10px;
        top: 70px;
    }

    .toast {
        min-width: auto;
        max-width: none;
    }

    .confirm-modal {
        min-width: auto;
        margin: 1rem;
    }
}

/* 26. Meldung Button (Footer-Version) */
.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;
}

/* Alter Meldung Button (floating - nicht mehr verwendet) */
.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 */
.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);
}

/* Meldung Button auf mobilen Geraeten */
@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;
    }
}

/* ==================== Fullwidth Card für Tabellen ==================== */
.card-fullwidth {
    width: calc(100vw - 40px);
    max-width: none !important;
    margin-left: calc(-50vw + 50% + 20px);
    margin-right: calc(-50vw + 50% + 20px);
    box-sizing: border-box;
}

/* Bei aktivem Sidebar anpassen */
.main-wrapper.active .card-fullwidth {
    width: calc(100vw - 280px - 40px);
    margin-left: 0;
    margin-right: 0;
}

@media (max-width: 768px) {
    .card-fullwidth {
        width: calc(100vw - 20px);
        margin-left: -10px;
        margin-right: -10px;
        padding: 1rem !important;
    }
}

/* ==================== 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: #e8f5e9;
    color: #2E7D32;
    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);
}

/* ==================== E-Mail Vorschau Modal ==================== */
.modal-overlay-top {
    z-index: 1001;
}

.modal-overlay-topmost {
    z-index: 1002;
}

.email-vorschau-modal-content {
    max-width: 800px;
    max-height: 85vh;
}

.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;
    padding: 1rem;
    max-height: 50vh;
    overflow-y: auto;
    background: white;
}

.email-vorschau-inhalt iframe {
    width: 100%;
    min-height: 400px;
    border: none;
}

.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 {
    max-width: 90vw;
    max-height: 90vh;
    width: 900px;
}

.pdf-viewer-body {
    padding: 0 !important;
    height: 75vh;
}

.pdf-viewer-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ==================== Drag & Drop Upload ==================== */
.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: #e8f5e9;
}

.file-upload-area.has-file {
    border-color: var(--primary-green);
    border-style: solid;
    background: #e8f5e9;
}

.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-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;
}

.file-upload-input {
    display: none;
}

.sendung-no-preview {
    color: #999;
    font-style: italic;
}

/* ==========================================
   Header Actions & E-Mail Badge
   ========================================== */

.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;
}

/* ==========================================
   E-Mail Client Styles
   ========================================== */

/* Vollbild-Wrapper */
.email-client-wrapper {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 40px;
    background: #f5f5f5;
    z-index: 10;
}

.side-nav.active ~ .main-wrapper .email-client-wrapper {
    left: 220px;
}

.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);
}

/* Email 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;
}

.email-message-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}

.email-message-item:hover {
    background: #f5f5f5;
}

.email-message-item.active {
    background: #e3f2fd;
    border-left: 3px solid var(--primary-green);
}

.email-message-item.unread {
    background: #fff;
    font-weight: 500;
}

.email-message-item.unread::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--primary-green);
    border-radius: 50%;
}

.email-message-item.dragging {
    opacity: 0.5;
    background: #e0e0e0;
}

.email-message-sender {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-message-subject {
    font-size: 0.85rem;
    color: #333;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-message-preview {
    font-size: 0.8rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.email-message-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.25rem;
}

.email-message-date {
    font-size: 0.75rem;
    color: #888;
}

.email-message-flags {
    display: flex;
    gap: 0.25rem;
}

.email-flag {
    font-size: 0.8rem;
}

/* E-Mail-Vorschau */
.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;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 1.1rem;
}

/* 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: 700px;
    max-width: 95%;
    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-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;
}

.compose-fields {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.compose-field {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.compose-field:last-child {
    margin-bottom: 0;
}

.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;
}

.compose-toolbar {
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #e0e0e0;
    background: #fafafa;
}

.toolbar-btn {
    padding: 0.35rem 0.5rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.85rem;
    min-width: 28px;
}

.toolbar-btn:hover {
    background: #f0f0f0;
}

.toolbar-divider {
    width: 1px;
    background: #ddd;
    margin: 0 0.25rem;
}

.compose-editor {
    flex: 1;
    min-height: 250px;
    max-height: 400px;
    padding: 1rem;
    overflow-y: auto;
    font-size: 0.95rem;
    line-height: 1.5;
}

.compose-editor:focus {
    outline: none;
}

.compose-editor.drag-over {
    background: #f0f8ff;
    border: 2px dashed var(--primary-green);
}

.compose-attachments {
    display: none;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.compose-attachment {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.5rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
}

.attachment-name {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-size {
    color: #888;
    font-size: 0.8rem;
}

.attachment-remove {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    line-height: 1;
}

.attachment-remove:hover {
    color: #dc3545;
}

.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;
}

/* 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;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.flex-grow {
    flex: 1;
}

.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 {
    background: var(--primary-green);
    color: white;
}

.progress-step.completed {
    background: var(--primary-green);
    color: white;
}

.progress-line {
    width: 40px;
    height: 2px;
    background: #e0e0e0;
}

.form-hint {
    display: block;
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.25rem;
}

/* E-Mail Settings Modal */
.email-settings-modal .modal-content {
    width: 600px;
    max-width: 95%;
}

.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;
}

/* Loading States */
.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;
}

/* Responsive */
@media (max-width: 1024px) {
    .email-client-container {
        flex-direction: column;
        height: auto;
    }

    .email-sidebar {
        width: 100%;
        min-width: 100%;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }

    .email-folder-list {
        display: flex;
        overflow-x: auto;
        padding: 0.5rem;
    }

    .email-folder-item {
        flex-shrink: 0;
        padding: 0.5rem 1rem;
        border-radius: 20px;
        background: #f0f0f0;
        margin-right: 0.5rem;
    }

    .email-folder-item.active {
        background: var(--primary-green);
    }

    .email-message-list {
        width: 100%;
        min-width: 100%;
        max-height: 300px;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }

    .email-preview-panel {
        min-height: 400px;
    }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #333;
    color: white;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    min-width: 250px;
    max-width: 400px;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.hide {
    transform: translateX(100%);
    opacity: 0;
}

.toast-success {
    background: var(--primary-green);
}

.toast-error {
    background: #dc3545;
}

.toast-warning {
    background: #ffc107;
    color: #333;
}

.toast-info {
    background: #17a2b8;
}

.toast-message {
    flex: 1;
    font-size: 0.9rem;
}

.toast-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
    padding: 0;
    line-height: 1;
}

.toast-close:hover {
    opacity: 1;
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: white;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    z-index: 2000;
    padding: 0.5rem 0;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #333;
    transition: background 0.15s;
}

.context-menu-item:hover {
    background: #f0f0f0;
}

.context-menu-item.danger {
    color: #dc3545;
}

.context-menu-item.danger:hover {
    background: #fff5f5;
}

.context-menu-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 0.5rem 0;
}

.context-menu-item svg {
    flex-shrink: 0;
}

/* SVG Icon Styles */
.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;
}

.btn-icon {
    margin-right: 0.25rem;
}

/* Move Folder Modal */
.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;
}

/* Folder Mapping in Settings */
.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;
}

/* Compose Modal */
.compose-modal-content {
    width: 700px;
    max-width: 95vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.compose-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.compose-fields {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.compose-field {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.compose-field label {
    width: 60px;
    font-weight: 500;
    color: #666;
    font-size: 0.9rem;
}

.compose-field input {
    flex: 1;
}

.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;
}

.compose-editor {
    flex: 1;
    min-height: 200px;
    max-height: 300px;
    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);
}

.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.4rem 0.75rem;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 0.85rem;
}

.attachment-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 1rem;
    padding: 0;
    line-height: 1;
}

.attachment-remove:hover {
    color: #dc3545;
}

/* Preview Actions */
.preview-actions {
    display: flex;
    gap: 0.5rem;
}

.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;
}

/* 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;
}

.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
}

.preview-placeholder svg {
    margin-bottom: 1rem;
}

/* Spinner small */
.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;
}

/* Folder Badge */
.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;
}

.email-folder-item.active .folder-badge {
    background: rgba(255, 255, 255, 0.3);
}

/* Folder Add Button */
.folder-add {
    opacity: 0.7;
    margin-top: 0.5rem;
    border-top: 1px solid #e0e0e0;
    padding-top: 1rem;
}

.folder-add:hover {
    opacity: 1;
}