:root {
    /* --- FARBPALETTE --- */
    --primary: #003d66;
    --primary-light: #003d66;
    --primary-bl: #003d66;
    
    --bg-grey: #f0f2f5;
    --bg-red: #ff0000;
    --bg-blue: #0063a1;
    
    --white: #ffffff;
    --text: #333;
    --text-grey: #777;
    --border: #ddd;
    
    /* Spezieller Verlauf für die Navigation */
    --awb-background-image: linear-gradient(180deg, #003d66 0%, #0063a1 100%);

    /* --- KATEGORIE FARBEN --- */
    --c-plenum: #d32f2f;
    --c-fraktion: #1976d2;
    --c-enquete: #FFFF00;
    --c-vorstand: #b22222;
    --c-ausschuss: #0000FF;
    --c-presselage: #BA55D3;
    --c-arbeitskreis: #FFD700;
    --c-wahlkreis: #388e3c;
    --c-sonstiges: #9e9e9e;
    --c-frei: rgba(0, 193, 255, 0.6);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-grey);
    color: var(--text);
    margin: 0;
    padding-bottom: 90px; /* Platz für Menü */
}

/* --- HEADER (Desktop/Standard) --- */
header {
    background: var(--primary-bl);
    color: var(--white);
    padding: 15px;
    text-align: center;
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
h1 { margin: 0; font-size: 1.2rem; font-weight: 600; }
h2 { margin: 5px; font-size: 1rem; font-weight: 600; }

.container { padding: 0px 15px 15px 15px; max-width: 800px; margin: 0 auto; }
.hidden { display: none !important; }
.spacer-bottom { height: 80px; }

/* --- BUTTONS --- */
.btn-mini, .btn-mini-close {
    background: var(--primary); color: white; text-decoration: none;
    padding: 6px 12px; border-radius: 20px; font-size: 0.8rem;
    white-space: nowrap; border: none; cursor: pointer;
    box-shadow: 0px 8px 10px -7px #000000, 5px 5px 15px 5px rgba(0,0,0,0);
}
.btn-mini-close { background: var(--bg-red); }

/* --- LISTENANSICHT (Kalender & News) --- */
.date-header {
    margin-top: 20px; margin-bottom: 8px; padding-left: 5px;
    font-size: 1rem; font-weight: 800;
    color: #003d66;
    text-transform: uppercase;
    text-shadow: 1px -1px 1px rgba(211,211,211,0.6);
    letter-spacing: 0.5px;
}

.event-item {
    background: var(--white);
    padding: 8px 15px; 
    border-bottom: 1px solid #f0f0f0;
    display: flex; align-items: center;
    cursor: pointer;
}
.event-item:first-child { border-top-left-radius: 12px; border-top-right-radius: 12px; }
.event-item:last-child { border-bottom: none; border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; }
.event-item:active { background-color: #eef4ff; }

/* KATEGORIE BALKEN */
.cat-Plenum       { border-left: 2px solid var(--c-plenum); border-right: 2px solid var(--c-plenum); }
.cat-Presselage   { border-left: 2px solid var(--c-presselage); border-right: 2px solid var(--c-presselage); }
.cat-Fraktion     { border-left: 2px solid var(--c-fraktion); border-right: 2px solid var(--c-fraktion); }
.cat-Enquete      { border-left: 2px solid var(--c-enquete); border-right: 2px solid var(--c-enquete); }
.cat-Vorstand     { border-left: 2px solid var(--c-vorstand); border-right: 2px solid var(--c-vorstand); }
.cat-Ausschuss    { border-left: 2px solid var(--c-ausschuss); border-right: 2px solid var(--c-ausschuss); }
.cat-Arbeitskreis { border-left: 2px solid var(--c-arbeitskreis); border-right: 2px solid var(--c-arbeitskreis); }
.cat-Wahlkreis    { border-left: 2px solid var(--c-wahlkreis); border-right: 2px solid var(--c-wahlkreis); }
.cat-Sonstiges    { border-left: 2px solid var(--c-sonstiges); border-right: 2px solid var(--c-sonstiges); }
.cat-Frei         { border-left: 2px solid var(--c-frei); border-right: 2px solid var(--c-frei); }

.event-cat-label { 
    font-size: 0.7rem; color: #888; text-transform: uppercase; 
    font-weight: bold; margin-bottom: 2px; display: block; 
}

.event-time { font-weight: 700; color: var(--primary); width: 55px; font-size: 0.85rem; flex-shrink: 0; }
.event-info { flex-grow: 1; padding-right: 10px; }
.event-title { font-size: 1rem; font-weight: 600; color: #222; margin-bottom: 2px; }
.event-loc-short { font-size: 0.85rem; color: #777; }
.event-arrow { color: #ccc; font-size: 1.2rem; }

/* NEWS */
.news-item {
    background: var(--white); padding: 20px; margin-bottom: 15px;
    border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.news-date { font-size: 0.8rem; color: var(--primary); font-weight: bold; text-transform: uppercase; margin-bottom: 5px; }
.news-title { font-size: 1rem; font-weight: bold; color: #222; margin-bottom: 10px; }
.news-content { font-size: 0.95rem; color: #444; line-height: 1.5; white-space: pre-wrap; }

/* --- DETAIL OVERLAY (Modal) --- */
.detail-modal {
    display: none; position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--white); z-index: 2000;
    overflow-y: auto; animation: slideUp 0.25s ease-out;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.detail-header {
    background: var(--primary-bl); border-bottom: 1px solid #eee;
    color: #FFF;
    padding: 15px 20px; position: sticky; top: 0;
    display: flex; justify-content: space-between; align-items: center; z-index: 2001;
}

.btn-close { font-size: 1.5rem; background: red; border: none; cursor: pointer; color: #fff; border-radius: 4px; padding: 0 10px; }

.detail-content { padding: 25px 20px; }
.detail-label { font-size: 0.75rem; text-transform: uppercase; color: #888; font-weight: bold; margin-top: 20px; display: block; }
.detail-text { font-size: 1.05rem; color: #333; line-height: 1.5; }

.file-download-box {
    display: flex; align-items: center;
    background: #f8f9fa; border: 1px solid #e9ecef;
    padding: 15px; border-radius: 10px; margin-top: 10px;
    text-decoration: none; color: #333;
}
.icon-pdf { font-size: 1.4rem; margin-right: 15px; }

/* --- ADRESSBUCH (Basis) --- */
.contact-card {
    background: var(--white); border-radius: 12px;
    padding: 20px; margin-bottom: 15px;
    border-style: solid;
    border-color: #008b8b;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.contact-row {
    display: flex; align-items: center; 
    justify-content: flex-start; 
    gap: 8px; padding: 6px 0; 
    border-bottom: 1px solid #eee;
}
.contact-row .btn-mini { margin-left: auto; }
.contact-row:last-child { border-bottom: none; }

.contact-val { 
    font-size: 1rem; color: #333; 
    word-break: break-all; overflow-wrap: anywhere; line-height: 1.4;
}

.contact-note {
    background: #fff8e1; color: #666; font-size: 0.85rem;
    padding: 8px; border-radius: 6px; margin-top: 10px;
    font-style: italic; border-left: 3px solid #ffd54f;
}

/* Versteckter Bereich (Details) */
.contact-details {
    display: none; margin-top: 15px; padding-top: 15px;
    border-top: 1px dashed #ccc; 
    margin-left: -15px; margin-right: -15px; margin-bottom: -15px;
    padding-left: 15px; padding-right: 15px; padding-bottom: 15px;
    border-bottom-left-radius: 8px; border-bottom-right-radius: 8px;
}
.contact-details.show { display: block; animation: slideDown 0.3s ease-out; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

.expand-icon { float: right; transition: transform 0.3s; font-size: 0.8rem; color: #999; }

/* --- NAVIGATION (Footer) --- */
.nav {
    display: flex; justify-content: space-between; gap: 15px;
    background: var(--awb-background-image); padding: 15px;
    position: fixed; bottom: 0; width: 100%; box-sizing: border-box;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05); border-top: 1px solid #eee;
    z-index: 900;
}
.nav-item {
    flex: 1; text-align: center; padding: 5px 0; font-size: 24px;
    border-radius: 10px; background: #2b88af; color: #666;
    font-weight: 600; cursor: pointer; transition: all 0.2s;
    user-select: none; -webkit-tap-highlight-color: transparent;
    box-shadow: 0px 8px 10px -7px #000000, 5px 5px 15px 5px rgba(0, 0, 0, 0);
}
.nav-item.active {
    background: var(--primary); color: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05); border-top: 1px solid #eee; 
}

/* --- DASHBOARD (Header & Cards) --- */
.dash-header {
    background: var(--primary-bl); color: var(--white);
    padding: 25px 20px; margin: 10px 0 20px 0;
    border-radius: 20px; position: relative;
    box-shadow: 0 4px 10px rgba(0,64,128,0.2);
}
.dash-logo { position: absolute; top: 20px; right: 20px; height: 50px; width: auto; opacity: 0.9; }
.dash-greeting { font-size: 1.4rem; font-weight: 700; margin: 0 0 5px 0; padding-right: 60px; text-shadow: 0 1px 2px rgba(0,0,0,0.1); }
.dash-date { color: rgba(255,255,255,0.8); font-size: 0.95rem; font-weight: 500; }

.dash-section-title { margin: 0 0 12px 10px; font-size: 0.85rem; font-weight: 800; text-transform: uppercase; color: #888; letter-spacing: 1px; }

.dash-card {
    background: var(--white); border-radius: 15px;
    padding: 6px 16px; margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    /* border-left: 4px solid transparent; */transition: transform 0.2s;
}
.dash-card:active { transform: scale(0.98); }
.dash-card.news-highlight { border-left: 2px solid var(--primary); border-right: 2px solid var(--primary); }
.dash-empty { text-align: center; color: #999; padding: 15px; font-style: italic; }

/* --- SUCHE & LOGINS --- */
.search-bar-container { background: #ffffff; padding: 10px 15px; position: sticky; top: 0; z-index: 90; box-shadow: 0 2px 5px rgba(0,0,0,0.05); margin-bottom: 10px; }
.search-input { width: 100%; padding: 10px 15px; border-radius: 20px; border: 1px solid #ddd; background-color: #f0f2f5; font-size: 1rem; outline: none; box-sizing: border-box; }
.search-input:focus { border-color: #003d66; background: #fff; }

#login-view { background: var(--white); padding: 30px; border-radius: 12px; margin-top: 40px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); text-align: center; }
input[type="text"] { width: 100%; padding: 12px; margin: 2px 0; border: 1px solid var(--border); border-radius: 8px; box-sizing: border-box; font-size: 1rem; }
.btn-login { background: var(--primary); color: white; border: none; padding: 12px; width: 100%; border-radius: 8px; font-size: 1rem; font-weight: bold; cursor: pointer; }

/* --- TOAST & OFFLINE BANNER --- */
#copy-toast { visibility: hidden; min-width: 250px; background-color: #333; color: #fff; text-align: center; border-radius: 2px; padding: 16px; position: fixed; z-index: 3000; left: 50%; bottom: 100px; transform: translateX(-50%); font-size: 1rem; }
#copy-toast.show { visibility: visible; animation: fadein 0.5s, fadeout 0.5s 2.5s; }
@keyframes fadein { from {bottom: 0; opacity: 0;} to {bottom: 100px; opacity: 1;} }
@keyframes fadeout { from {bottom: 100px; opacity: 1;} to {bottom: 0; opacity: 0;} }

#offline-banner { display: none; background-color: #d32f2f; color: white; text-align: center; padding: 5px; font-size: 0.8rem; position: sticky; top: 0; z-index: 200; }

/* --- AKKORDEON (Kontakte) --- */
.group-header {
    background-color: #2b88af; padding: 15px; margin-bottom: 5px; border-radius: 8px;
    cursor: pointer; font-weight: bold; color: #e0e0e0;
    display: flex; justify-content: space-between; align-items: center;
    user-select: none; border: 1px solid #e0e0e0;
    box-shadow: 0 4px 10px rgba(0, 64, 128, 0.2);        
}
.group-content { display: none; padding: 0 5px; margin-bottom: 15px; animation: fadeIn 0.3s; }
.group-content.show { display: block; }
.group-arrow { font-size: 0.8rem; transition: transform 0.3s ease; }
.group-header.active .group-arrow { transform: rotate(180deg); }

/* LEVEL 2 (Untergruppen) */
.sub-group-header {
    background-color: #2b88af7a; padding: 15px; margin-bottom: 5px; border-radius: 8px;
    cursor: pointer; font-weight: bold; color: #003d66; text-align: center;
    display: flex; justify-content: space-between; align-items: center;
    user-select: none; border: 1px solid #e0e0e0;
    box-shadow: 0 4px 10px rgba(0, 64, 128, 0.2); 
}
.sub-group-header:hover { background-color: #f9f9f9; }
.sub-group-content { display: none; margin-bottom: 10px; }
.sub-group-content.show { display: block; }
.sub-group-header.active { border-left: 4px solid var(--primary); color: var(--primary); }
.sub-group-header.active .group-arrow { transform: rotate(180deg); }


/* =========================================
   NEUE STYLES (Gremien, A-Z Liste, Profil)
   ========================================= */

/* --- Umschalter (Tabs) --- */
.view-switch-container {
    display: flex;
    background: #e0e0e0;
    margin: 10px 0 20px 0; /* Margin angepasst */
    padding: 4px;
    border-radius: 8px;
}

.view-switch-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 0;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.view-switch-btn.active {
    background: white;
    color: #004080; /* Primary Color */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* --- Stil A: Gremien Karten (Complex) --- */
.contact-card-complex {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 2px solid #003d66;
    position: relative;
    transition: all 0.2s;
    cursor: default; /* Wird per JS geändert */
}

.contact-card-complex.clickable { cursor: pointer; }
.contact-card-complex.clickable:active { transform: scale(0.99); background: #fafafa; }

.contact-card-complex.is-boss { border-left-color: #004080; }
.contact-card-complex.is-staff { border-left-color: #9e9e9e; }

/* Header Bereich Karte */
.cc-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.cc-name { font-weight: bold; font-size: 1.1rem; color: #333; margin: 0; line-height: 1.2; }
.cc-room { display: inline-block; background: #f0f2f5; font-size: 0.75rem; padding: 2px 6px; border-radius: 4px; color: #555; margin-left: 8px; font-weight: normal; vertical-align: middle; }
.cc-company { font-weight: bold; font-size: 0.9rem; color: #555; margin-top: 3px; }
.cc-role { color: #004080; font-size: 0.9rem; font-weight: 600; margin-top: 3px; }
.cc-dept { color: #666; font-size: 0.85rem; margin-top: 2px; font-style: italic; }
.cc-arrow { color: #ccc; font-size: 1.2rem; transition: transform 0.2s; margin-left: 10px; }

/* Haupt-Infos */
.cc-main-info { margin-bottom: 5px; }
.cc-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; padding-bottom: 4px; border-bottom: 1px solid #f9f9f9; }
.cc-val { font-size: 1rem; color: #333; display: flex; align-items: center; gap: 8px; }
.cc-btn { background: #e3f2fd; color: #004080; text-decoration: none; padding: 6px 12px; border-radius: 6px; font-size: 0.85rem; font-weight: 600; cursor: pointer; border:none; }

/* Versteckte Details */
.cc-hidden-details { 
    display: none; 
    margin-top: 15px; 
    padding-top: 10px; 
    border-top: 1px dashed #ddd; 
    background: #fafafa; 
    margin: 10px -15px -15px -15px; 
    padding: 15px; 
    border-radius: 0 0 8px 8px; 
}
.cc-hidden-details.show { display: block; animation: fadeIn 0.3s; }
.cc-detail-row { display: flex; align-items: flex-start; margin-bottom: 8px; font-size: 0.9rem; color: #555; }
.cc-detail-icon { width: 25px; font-size: 1.1rem; text-align: center; margin-right: 5px; }

/* --- Stil B: A-Z Streifen (Simple) --- */
.contact-strip {
    background: white;
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    display: flex; justify-content: space-between; align-items: center;
    cursor: pointer;
    transition: background 0.2s;
}
.contact-strip:active { background: #f5f5f5; }
.strip-name { font-weight: 600; color: #333; font-size: 1rem; }
.strip-arrow { color: #ccc; font-size: 0.8rem; transition: transform 0.2s; }

.strip-details { 
    display: none; 
    background: #fafafa; 
    padding: 15px; 
    border-bottom: 1px solid #ddd; 
}
.strip-details.show { display: block; animation: fadeIn 0.3s; }

/* Badges */
.role-badge { display: inline-block; background: #e3f2fd; color: #004080; font-size: 0.75rem; padding: 3px 8px; border-radius: 4px; margin-right: 5px; margin-bottom: 5px; border: 1px solid #bbdefb; }

/* QR Code Container */
body #qrcode-container {
max-width: 70%;
margin: 0 auto; 
}


@keyframes fadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }


/* =========================================
   DARK MODE OVERRIDES (Nachtmodus)
   ========================================= */

body.dark-mode {
    --bg-grey: #121212;
    --white: #1e1e1e;
    --text: #ffffff; /* Weiß für Text */
    --border: #333;
    --primary: #e0e0e0; 
    --primary-light: #4da3ff44;
    --primary-bl: #121212;
}

body.dark-mode .dash-header, body.dark-mode .detail-header, body.dark-mode .header { background: #121212; }
body.dark-mode .dashboard-view, body.dark-mode .nav { background: #1e1e1e; border-top: 1px solid #333; }
body.dark-mode .nav-item { background: #2c2c2c; color: #aaa; }
body.dark-mode .nav-item.active { background: var(--primary); color: #000; }
body.dark-mode input, body.dark-mode textarea { background-color: #2c2c2c !important; color: #fff !important; border-color: #444 !important; }
body.dark-mode .search-bar-container { background: #1e1e1e; box-shadow: 0 2px 5px rgba(255,255,255,0.05); }
body.dark-mode .contact-note { background: #332b00; color: #ccc; border-left-color: #ffb300; }
body.dark-mode .dash-header { box-shadow: none; }
body.dark-mode .dash-card, body.dark-mode .news-item { background: #252525; border: 1px solid #333; box-shadow: none; }
body.dark-mode .detail-text { color: #e0e0e0; }
body.dark-mode .btn-mini { background: var(--primary-bl); color: white; }

/* Textfarben im Dark Mode */
body.dark-mode h1, body.dark-mode h2, body.dark-mode h3, 
body.dark-mode .dash-greeting, body.dark-mode .news-title, 
body.dark-mode .event-title, body.dark-mode .detail-label { color: #ffffff !important; }

body.dark-mode .news-content { color: #d1d1d1 !important; }
body.dark-mode .date-header { color: #aaa; }
body.dark-mode .news-date { color: var(--primary); }
body.dark-mode .contact-val { color: #e3f2fd !important; }

/* Akkordeon Dark Mode */
body.dark-mode .group-header { background-color: #2c2c2c; color: var(--primary); border-color: #444; }
body.dark-mode .sub-group-header { background-color: #1e1e1e; color: #ccc; border-bottom-color: #333; border-left-color: #444; }
body.dark-mode .sub-group-header.active { border-left-color: var(--primary); color: #fff; }

/* Neue Kontakt Elemente im Dark Mode */
body.dark-mode .view-switch-container {
    background: #333;
}

body.dark-mode .view-switch-btn {
    color: #aaa;
}

body.dark-mode .view-switch-btn.active {
    background: #555;
    color: #fff;
    box-shadow: none;
}

/* Karten Dark Mode */
body.dark-mode .contact-card-complex {
    background: #1e1e1e;
    border-left-color: #444; /* Standard Border */
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}
body.dark-mode .contact-card-complex.clickable:active { background: #252525; }

body.dark-mode .contact-card-complex.is-boss { border-left-color: #64b5f6; } /* Helleres Blau für Dark Mode */
body.dark-mode .contact-card-complex.is-staff { border-left-color: #666; }

body.dark-mode .cc-name { color: #e0e0e0; }
body.dark-mode .cc-room { background: #333; color: #ccc; }
body.dark-mode .cc-company { color: #aaa; }
body.dark-mode .cc-role { color: #90caf9; } /* Helles Blau */
body.dark-mode .cc-dept { color: #888; }
body.dark-mode .cc-arrow { color: #555; }

body.dark-mode .cc-row { border-bottom-color: #333; }
body.dark-mode .cc-val { color: #ccc; }
body.dark-mode .cc-btn, 
body.dark-mode .btn-mini { 
    background: #333; 
    color: #90caf9; 
    border: 1px solid #555;
}

body.dark-mode .cc-hidden-details {
    background: #252525;
    border-top-color: #333;
}
body.dark-mode .cc-detail-row { color: #bbb; }

/* Streifen A-Z Dark Mode */
body.dark-mode .contact-strip {
    background: #1e1e1e;
    border-bottom-color: #333;
}
body.dark-mode .contact-strip:active { background: #2a2a2a; }
body.dark-mode .strip-name { color: #e0e0e0; }
body.dark-mode .strip-arrow { color: #555; }

body.dark-mode .strip-details {
    background: #252525;
    border-bottom-color: #333;
}

/* Badges Dark Mode */
body.dark-mode .role-badge {
    background: #333;
    color: #90caf9;
    border-color: #555;
}

/* Profil Karte im Dark Mode */
body.dark-mode #profile-card-container > div {
    background: #1e1e1e !important;
    border-color: #333 !important;
}
body.dark-mode #profile-card-container .cc-header, 
body.dark-mode #profile-card-container > div > div:first-child {
    background: linear-gradient(to bottom, #2a2a2a, #1e1e1e) !important;
    border-bottom-color: #333 !important;
}
body.dark-mode #profile-card-container > div > div:last-child {
    background: #1e1e1e !important;
    color: #ddd !important;
}

/* QR Code Container Dark Mode */
body.dark-mode #qrcode-container {
    background: black !important; /* QR muss weiß bleiben für Scanbarkeit */
    border: 4px solid #000000;
max-width: 70%;
margin: 0 auto; 
}

/* =========================================
   PROFIL VISITENKARTE (Clean Design)
   ========================================= */

.profile-business-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    border: 2px solid #003d66;
 /*   text-align: center;   */
    margin-bottom: 20px;
margin-top: 10px;
}

/* Oberer Teil */
.pbc-header {
    padding: 30px 20px;
    background: linear-gradient(to bottom, #ffffff, #fafafa);
    border-bottom: 1px solid #eee;
}

.pbc-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: #333;
    margin-bottom: 5px;
    line-height: 1.2;
}

.pbc-org {
    font-size: 1rem;
    color: #555;
    font-weight: bold;
    margin-bottom: 2px;
}

.pbc-role {
    font-size: 0.9rem;
    color: var(--text-grey);
    font-weight: 400;
}

/* Unterer Teil (Kontakt) */
.pbc-body {
    padding: 20px;
    background: white;
    color: #444;
    font-size: 1rem;
}

.pbc-row {
    margin-bottom: 8px;
    word-break: break-word; /* Damit lange E-Mails umbrechen */
}

/* --- Dark Mode Anpassung für die Visitenkarte --- */
body.dark-mode .profile-business-card {
    background: #1e1e1e;
    border-color: #333;
    box-shadow: none;
}

body.dark-mode .pbc-header {
    background: linear-gradient(to bottom, #2a2a2a, #1e1e1e);
    border-bottom-color: #333;
}

body.dark-mode .pbc-body {
    background: #1e1e1e;
    color: #ccc;
}

body.dark-mode .pbc-name { color: #fff; }
body.dark-mode .pbc-org { color: #aaa; }
body.dark-mode .pbc-role { color: #90caf9; } /* Helleres Blau für Kontrast */

/* =========================================
   1. KONTAKT KARTEN (Gremien & A-Z Detail)
   ========================================= */

.contact-card-complex {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-top: 5px; /* In der Liste keinen Margin unten */
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 2px solid #003d66;
 /*   border-left: 4px solid #ccc;   */
    position: relative;
    transition: all 0.2s;
    cursor: default;
}

.contact-card-complex.clickable { cursor: pointer; }
.contact-card-complex.clickable:active { transform: scale(0.99); background: #fafafa; }

/* Status-Farben (Rand links) */
.contact-card-complex.is-boss { border-left-color: #003d66; } 
.contact-card-complex.is-staff { border-left-color: #003d66; } 

/* Typografie Karte */
.cc-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.cc-name { font-weight: bold; font-size: 1.1rem; color: #333; margin: 0; line-height: 1.2; }
.cc-room { display: inline-block; background: #f0f2f5; font-size: 0.75rem; padding: 2px 6px; border-radius: 4px; color: #555; margin-left: 8px; font-weight: normal; vertical-align: middle; }
.cc-company { font-weight: bold; font-size: 0.9rem; color: #555; margin-top: 3px; }
.cc-role { color: #004080; font-size: 0.9rem; font-weight: 600; margin-top: 3px; }
.cc-dept { color: #666; font-size: 0.85rem; margin-top: 2px; font-style: italic; }

/* Infos & Buttons */
.cc-main-info { margin-bottom: 5px; }
.cc-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; padding-bottom: 4px; border-bottom: 1px solid #f9f9f9; }
.cc-val { font-size: 1rem; color: #333; display: flex; align-items: center; gap: 8px; }
.cc-btn { background: #e3f2fd; color: #004080; text-decoration: none; padding: 6px 12px; border-radius: 6px; font-size: 0.85rem; font-weight: 600; cursor: pointer; }

/* Versteckte Details */
.cc-hidden-details { display: none; margin-top: 15px; padding-top: 10px; border-top: 1px dashed #ddd; background: #fafafa; margin: 10px -15px -15px -15px; padding: 15px; border-radius: 0 0 8px 8px; }
.cc-hidden-details.show { display: block; animation: fadeIn 0.3s; }
.cc-detail-row { display: flex; align-items: flex-start; margin-bottom: 8px; font-size: 0.9rem; color: #555; }
.cc-detail-icon { width: 25px; font-size: 1.1rem; text-align: center; margin-right: 5px; }


/* =========================================
   2. DARK MODE (Nachtmodus)
   ========================================= */

/* Basis Variablen Anpassung */
body.dark-mode {
    --bg-grey: #121212;
    --white: #1e1e1e;
    --text: #ffffff;
    --border: #333;
}

/* --- KARTEN IM DARK MODE --- */
body.dark-mode .contact-card-complex {
    background: #1e1e1e;
    border-left-color: #444;
    box-shadow: none;
    border: 1px solid #333;
    border-left-width: 4px; /* Linker Rand bleibt dicker */
}
body.dark-mode .contact-card-complex.is-boss { border-left-color: #64b5f6; }
body.dark-mode .cc-name { color: #e0e0e0; }
body.dark-mode .cc-company { color: #aaa; }
body.dark-mode .cc-room { background: #333; color: #ccc; }
body.dark-mode .cc-role { color: #90caf9; }
body.dark-mode .cc-dept { color: #888; }
body.dark-mode .cc-val { color: #ccc; }
body.dark-mode .cc-row { border-bottom-color: #333; }
body.dark-mode .cc-btn { background: #333; color: #90caf9; border: 1px solid #555; }
body.dark-mode .cc-hidden-details { background: #252525; border-top-color: #444; }
body.dark-mode .cc-detail-row { color: #bbb; }


/* --- A-Z LISTE & FAVORITEN IM DARK MODE --- */
/* Da die A-Z Liste Inline-Styles nutzt, müssen wir hier mit !important arbeiten */


/* =========================================
   FAVORITEN HEADER (Lösung A - Clean CSS)
   ========================================= */

/* 1. HELL-MODUS (Standard) */
/* Wir nutzen !important, um den Standard-Blau-Style sicher zu überschreiben */
.group-header.fav-highlight {
    background: linear-gradient(to right, #ff6347, #FF8C00) !important; /* Dein Orange */
    border-left-color: #f1c40f !important; /* Gelber Rand */
    color: white !important;
}

/* 2. DUNKEL-MODUS */
body.dark-mode .group-header.fav-highlight {
    background: linear-gradient(to right, #3e2723, #5d4037) !important; /* Dunkles Braun */
    border-left-color: #ffb300 !important; /* Goldener Rand */
    color: #ffe0b2 !important; /* Helle Schrift */
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
}


/* --- FAVORITEN HEADER (Hell & Dunkel) --- */

/* 1. HELL-MODUS (Standard) */
/* Die Klasse .fav-highlight überschreibt das Standard-Blau */
.group-header.fav-highlight {
    background: linear-gradient(to right, #ff6347, #FF8C00) !important;
    border-left-color: #f1c40f !important;
    color: white !important;
}

/* 2. DUNKEL-MODUS */
body.dark-mode .group-header.fav-highlight {
    background: linear-gradient(to right, #3e2723, #5d4037) !important; /* Dunkles Braun */
    border-left-color: #ffb300 !important; /* Gold */
    color: #ffe0b2 !important; /* Helle Schrift */
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
}


/* 1. Der Favoriten Header (Gelb -> Dunkelbraun) */
body.dark-mode #contact-list div[style*="background:#fff3e0"],
body.dark-mode #contact-list div[style*="background: rgb(255, 243, 224)"] {
    background: #3e2723 !important; /* Dunkles Braun */
    color: #ffcc80 !important;      /* Helles Orange */
    border-bottom-color: #5d4037 !important;
}

body.dark-mode .group-header[style*="linear-gradient"] {
    background: linear-gradient(to right, #2c211b, #4e342e) !important; /* Sehr dunkles Braun */
    border-left-color: #ffa000 !important; /* Dunkles Gold */
    color: #fff !important;
    border-top: 1px solid #444;
    border-bottom: 1px solid #444;
}

/* 2. Die Buchstaben-Trenner (A, B, C...) */
body.dark-mode #contact-list div[style*="background:#eee"],
body.dark-mode #contact-list div[style*="background: rgb(238, 238, 238)"] {
    background: #2c2c2c !important;
    color: #aaa !important;
    border-top-color: #444 !important;
}

/* 3. Die Namens-Zeile (Button) */
body.dark-mode #contact-list div[onclick] {
    background-color: #1e1e1e !important;
    border-bottom-color: #333 !important;
    color: #e0e0e0 !important;
}
body.dark-mode #contact-list div[onclick] span {
    color: #e0e0e0 !important;
}

/* 4. Aktiver Zustand (wenn aufgeklappt) - Hellblau -> Dunkelblau */
body.dark-mode #contact-list div[onclick][style*="background: rgb(227, 242, 253)"], 
body.dark-mode #contact-list div[onclick][style*="#e3f2fd"] {
    background-color: #0d47a1 !important; /* Dunkelblau */
    color: #fff !important;
}

/* 5. Der aufgeklappte Container (Hintergrund) */
body.dark-mode #contact-list div[id^="fav-list-"],
body.dark-mode #contact-list div[id^="az-list-"] {
    background: #121212 !important; /* Ganz dunkel */
    border-top-color: #333 !important;
}


/* --- LADE SPINNER --- */
.spinner {
    border: 4px solid #f3f3f3; /* Hellgrau */
    border-top: 4px solid #004080; /* Deine Primary Farbe */
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto; /* Zentriert */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}