:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --border: #e2e8f0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.btn {
    background-color: var(--primary);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
}

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

.btn-danger { background-color: #ef4444; }

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

/* Grid für Profile */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 30px 20px;
}

.profile-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    background: rgba(214, 221, 230, 0.95); /* Noch ein Stück dunkler beim Hover */
}

.profile-card img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 3px solid var(--primary);
}

/* Tabelle für Admin */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th { background-color: #f1f5f9; }

/* Spezifische Stile für den Login-Hintergrund */
.login-body {
    background: url('/images/cover.jpg') no-repeat center center fixed;
    background-size: cover;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

/* Die zentrierte Glassmorphism-Karte */
.login-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px); /* Verschwommener Hintergrund-Effekt */
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 40px;
    max-width: 400px;
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    text-align: center;
}

.login-card h2 {
    margin: 0 0 10px 0;
    color: #1e293b;
    font-size: 28px;
}

.login-card .subtitle {
    color: #64748b;
    margin-bottom: 30px;
    font-size: 14px;
}

/* Interaktive Eingabefelder mit wanderndem Label */
.input-group {
    position: relative;
    margin-bottom: 20px;
    text-align: left;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    color: #1e293b;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.input-group label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    transition: all 0.3s ease;
    pointer-events: none;
}

/* Verschiebt das Label nach oben, wenn das Feld fokussiert oder befüllt ist */
.input-group input:focus ~ label,
.input-group input:not(:placeholder-shown) ~ label {
    top: -8px;
    left: 12px;
    font-size: 12px;
    background: #2563eb;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
}

.input-group input:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Button-Styling */
.btn-login {
    width: 100%;
    background-color: #2563eb;
    color: white;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    transition: background 0.2s ease;
}

.btn-login:hover {
    background-color: #1d4ed8;
}

/* Trennlinie */
.login-divider {
    display: flex;
    align-items: center;
    margin: 25px 0;
    color: #94a3b8;
    font-size: 14px;
}

.login-divider::before, .login-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid #cbd5e1;
}

.login-divider span {
    padding: 0 10px;
}

/* Sekundäre Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-secondary {
    display: block;
    background-color: #2563eb;
    color: white;
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 1px solid #bbf7d0; /* Passende, leicht grüne Umrandung */
    text-align: center;
    box-sizing: border-box;
    width: 100%;
}

.btn-secondary:hover {
     background-color: #1d4ed8;
}

.btn-link {
    display: block;
    background-color: #f1f5f9; /* Hellgrau */
    color: #475569;            /* Dunkelgrau */
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
    text-align: center;
    box-sizing: border-box;
    width: 100%;
}

.btn-link:hover {
    background-color: #e2e8f0; /* Etwas dunkleres Grau beim Drüberfahren */
    color: #1e293b;            /* Fast Schwarz beim Drüberfahren */
    text-decoration: none;
}

/* Registrierungskarte Breite */
.register-card {
    max-width: 500px;
}

.input-row {
    display: flex;
    gap: 15px;
}

.input-row .input-group {
    flex: 1;
}

/* Textarea exakt analog zu den anderen Inputs (Gleiche Höhe & Padding) */
.input-group textarea {
    width: 100%;
    height: 47px; /* Passt die Textarea an die Standard-Eingabefeld-Höhe an */
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    color: #1e293b;
    box-sizing: border-box;
    transition: all 0.3s ease;
    resize: none;
    font-family: inherit;
}

.input-group textarea:focus ~ label,
.input-group textarea:not(:placeholder-shown) ~ label {
    top: -8px;
    left: 12px;
    font-size: 12px;
    background: #2563eb;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
}

/* Dropdown und Datumsfelder Fixes */
.select-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    color: #1e293b;
    appearance: none;
}

/* Bildvorschau limitiert analog zum Dashboard */
.avatar-preview-container {
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
}

#avatar-preview {
    width: 100px;      /* Identisch zum Dashboard */
    height: 100px;     /* Identisch zum Dashboard */
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #2563eb; /* Blaue kreisförmige Umrandung aus dem Dashboard */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Datei-Upload */
.file-input-group {
    margin-bottom: 25px;
}

.file-input-group input[type="file"] {
    display: none;
}

.btn-file {
    display: inline-block;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    transition: all 0.2s;
}

.btn-file:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    margin: 20px 0;
    font-size: 14px;
    color: #475569;
}

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

.checkbox-group label {
    cursor: pointer;
    user-select: none;
}

/* Registrierungs-Button */
.btn-register {
    width: 100%;
    background-color: #22c55e;
    color: white;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    transition: background 0.2s ease;
}

.btn-register:hover {
    background-color: #16a34a;
}

/* Status-Hinweistext unter dem Button */
.status-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.status-message h3 {
    margin: 0 0 5px 0;
    font-size: 18px;
}

.status-message p {
    margin: 0;
    font-size: 14px;
}

.status-message.success {
    background-color: #dcfce7;
    color: #14532d;
    border: 1px solid #bbf7d0;
}

.status-message.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.btn-link-back {
    display: block;
    color: #64748b;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 5px;
}

.btn-link-back:hover {
    text-decoration: underline;
    color: #1e293b;
}

/* Styling für das deaktivierte Formular */
fieldset:disabled .input-group input,
fieldset:disabled .input-group textarea,
fieldset:disabled .select-group select {
    background: rgba(241, 245, 249, 0.6);
    color: #94a3b8;
    border-color: #cbd5e1;
    cursor: not-allowed;
}

fieldset:disabled .checkbox-group,
fieldset:disabled .checkbox-group input {
    opacity: 0.6;
    cursor: not-allowed;
}

fieldset:disabled .btn-register {
    background-color: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
}

/* Der neue, hervorgehobene "Zurück zum Login"-Button nach Erfolg */
.btn-login-highlight {
    display: block;
    background-color: #2563eb; /* Signalblau */
    color: white !important;
    padding: 14px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    box-sizing: border-box;
    width: 100%;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
    transition: all 0.2s ease;
}

.btn-login-highlight:hover {
    background-color: #1d4ed8;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

/* Animierte optische Hervorhebung für die Countdown-Zahl */
#countdown {
    font-weight: bold;
    color: #16a34a;
}

/* Ermöglicht das korrekte Wandern der Beschriftung bei Datum und Select */
.input-group select:focus ~ label,
.input-group select.has-value ~ label,
.input-group input[type="date"]:focus ~ label,
.input-group input[type="date"].has-value ~ label {
    top: -8px;
    left: 12px;
    font-size: 12px;
    background: #2563eb; /* Wird beim Aktivieren schön Blau wie die anderen */
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
}

/* Versteckt den nativen Browser-Platzhalter beim Datum, solange es inaktiv ist */
.input-group input[type="date"] {
    color: transparent;
}

.input-group input[type="date"]:focus,
.input-group input[type="date"].has-value {
    color: #1e293b;
}

.role-section-box h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #1e293b;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 10px;
    font-size: 22px;
}

/* Modifiziertes Profilkarten-Design */
.profile-card {
    background: #f8fafc; /* Etwas hellerer Innenbereich für die Karten */
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Oberer Teil: Bild und Name zentriert */
.card-header-center {
    text-align: center;
    margin-bottom: 15px;
}

.card-header-center img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #2563eb;
    margin-bottom: 12px;
}

.full-name {
    margin: 0;
    font-size: 20px;
    font-weight: 700; /* Groß und Fett */
    color: #0f172a;
}

.maiden-name {
    margin: 4px 0 0 0;
    font-size: 13px;
    color: #475569; /* Klein und Dunkelgrau */
}

/* Unterer Teil: Kontaktdaten linksbündig */
.card-body-left {
    text-align: left;
    font-size: 14px;
    color: #334155;
    border-top: 1px solid #e2e8f0;
    padding-top: 15px;
}

.card-body-left p {
    margin: 8px 0;
    line-height: 1.4;
}

.address-text {
    display: inline-block;
    margin-top: 2px;
    padding-left: 2px;
    color: #475569;
}

/* Status-Texte */
.loading-text, .empty-text {
    grid-column: 1 / -1;
    text-align: center;
    color: #64748b;
    font-style: italic;
    margin: 10px 0;
}

/* Hintergrund für das Dashboard (analog zur Login-Seite) */
.dashboard-bg {
    background: url('/images/cover.jpg') no-repeat center center fixed;
    background-size: cover;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    min-height: 100vh;
}

/* Transparenter Glassmorphism-Hauptcontainer */
.dashboard-container {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    
    /* HIER DIE ÄNDERUNG: */
    width: 90%;            /* Nutzt exakt 90% der Bildschirmbreite */
    max-width: 1800px;     /* Verhindert extremes Strecken auf riesigen 4K-Monitoren */
    margin: 20px auto;     /* Zentriert den gestreckten Container auf dem Bildschirm */
    box-sizing: border-box;
}

.dashboard-header {
    /* Sticky verhindert, dass das Menü auf Mobilgeräten den Viewport sprengt */
    position: sticky !important;
    top: 10px !important;       /* Hält beim Scrollen 10px Abstand nach oben */
    z-index: 5000 !important;
    margin-top: -10px !important;  
    margin-left: -20px !important;  /* Zieht die Leiste links perfekt bündig */
    margin-right: -20px !important; /* Zieht die Leiste rechts perfekt bündig */
    width: calc(100% + 40px) !important; /* Dehnt sie exakt über die echte Breite aus */
    
    margin-bottom: 20px !important;
    padding: 0 10px !important;     /* Hält das Innere symmetrisch zentriert */
    box-sizing: border-box !important;
}

/* Kästen für Schülerrand / Lehrerrand leicht abgesetzt */
.role-section-box {
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 35px;
}

/* Strukturierte Zeilen für die Icons und Werte */
.info-row {
    display: flex;
    align-items: center;
    margin: 10px 0;
    font-size: 14px;
}

/* Richtet das Haus-Icon bei mehrzeiligen Adressen oben aus */
.info-row.align-top {
    align-items: flex-start;
}

/* Feste Breite für Icons sorgt für perfekte vertikale Bündigkeit des Textes */
.info-icon {
    width: 28px;
    min-width: 28px;
    font-size: 16px;
    display: inline-block;
}

.info-value {
    color: #334155;
    word-break: break-word;
    flex-grow: 1;
}

/* Adress-Formatierung bündig */
.address-value {
    line-height: 1.4;
    display: block;
}

/* Rechtes Benutzermenü im Header */
.user-menu-top {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.6);
    padding: 8px 16px;
    border-radius: 30px;
    border: 1px solid #cbd5e1;
}

/* Exakt 50px groß (die Hälfte der 100px-Dashboard-Karten) */
.user-avatar-small {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #2563eb;
}

.user-actions-nav {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.user-nav-name {
    font-weight: 700;
    font-size: 15px;
    color: #1e293b;
}

.nav-links {
    font-size: 13px;
    margin-top: 2px;
}

.nav-link-item {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

.nav-link-item:hover {
    text-decoration: underline;
}

.logout-link {
    color: #ef4444; /* Rote Abmeldeschrift */
}

.nav-separator {
    color: #94a3b8;
    margin: 0 4px;
}

.action-buttons-row {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.action-buttons-row .btn, 
.action-buttons-row .btn-link {
    flex: 1;
    margin: 0;
}

/* Trennlinie innerhalb der Detail-Box */
.profile-details-popover .popover-divider {
    border: 0 !important;
    border-top: 1px solid #eeeeee !important;
    margin: 8px 0 !important;
}

/* Wenn geklickt: Das Profilbild erhält die dicke blaue Linie */
.profile-card .profile-img.is-active {
    transform: scale(1.04) !important;
    border-color: #2563eb !important;
}

/* Blockiert jegliche Hover-Anzeige */
.profile-card:hover .profile-details-popover {
    opacity: 0;
    visibility: hidden;
}

/* 1. Hintergrund-Transparenz erhöhen (Hintergrundbild abschwächen) */
body.dashboard-bg {
    position: relative !important;
    background-image: url('/images/cover.jpg') !important; /* Falls hier definiert */
    background-size: cover !important;
    background-position: center !important;
    background-attachment: fixed !important;
    z-index: 1;
}

/* Wir legen eine halbtransparente Schicht über das Hintergrundbild, um die Transparenz des Bildes zu steuern */
body.dashboard-bg::before {
    content: "" !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    /* Erhöhe den letzten Wert (0.85), um den Hintergrund noch blasser/transparenter zu machen (0.0 = unsichtbar, 1.0 = vollflächig deckend) */
    background-color: rgba(255, 255, 255, 0.85) !important; /* Weißer Schleier, ideal für helle Layouts */
    /* Falls dein Layout ein dunkles Design hat, nutze stattdessen diese Zeile: */
    /* background-color: rgba(15, 23, 42, 0.85) !important; */
    z-index: -1 !important;
}

/* 2. Den Haupt-Container auf exakt 100% der Breite zwingen */
.container.dashboard-container {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    padding: 10px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    background: transparent !important; /* Entfernt Box-Hintergründe, damit das Grid frei fließt */
    box-shadow: none !important;
}

/* Sobald eine Karte aktiv ist (ihr Bild die Klasse .is-active hat), 
   erhöhen wir die Priorität der gesamten Karte radikal */
.profile-grid .profile-card:has(.profile-img.is-active) {
    z-index: 100 !important;
}

/* Falls dein Browser die moderne ":has()"-Funktion noch nicht optimal unterstützt,
   erhöhen wir den Z-Index zusätzlich generell, sobald ein Popover sichtbar ist: */
.profile-grid .profile-card:has(.profile-details-popover.is-visible) {
    z-index: 100 !important;
}

/* Der Haupt-Container oben rechts */
.user-menu-top-clean {
    position: relative !important;
    display: inline-block !important;
    cursor: pointer !important;
}

/* Das runde, klickbare Profilbild im Header */
.user-avatar-clickable {
    width: 45px !important;
    height: 45px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 2px solid #ffffff !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2) !important;
    transition: transform 0.2s ease, border-color 0.2s ease !important;
}

/* Kleiner visueller Effekt beim Drüberfahren mit der Maus */
.user-menu-top-clean:hover .user-avatar-clickable {
    transform: scale(1.05) !important;
    border-color: #2563eb !important; /* Blauer Akzentrand */
}

/* Das Dropdown-Menü (Standardmäßig unsichtbar) */
.user-dropdown-menu {
    position: absolute !important;
    top: 55px !important; /* Platziert die Box knapp unter dem Bild */
    right: 0 !important;   /* Richtet das Menü am rechten Rand aus */
    width: 130px !important;
    background-color: #ffffff !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important;
    padding: 6px 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-10px) !important;
    transition: all 0.2s ease-in-out !important;
    z-index: 9999 !important; /* Liegt über absolut allem */
}

/* Klasse wird per JS bei Klick hinzugefügt */
.user-dropdown-menu.is-active {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

/* Die einzelnen Links im Menü */
.user-dropdown-menu .dropdown-item {
    display: block !important;
    padding: 10px 15px !important;
    color: #333333 !important;
    text-decoration: none !important;
    font-size: 0.9rem !important;
    font-weight: normal !important;
    text-align: left !important;
    transition: background-color 0.15s ease !important;
}

/* Hover-Effekt für die Menüpunkte */
.user-dropdown-menu .dropdown-item:hover {
    background-color: #f3f4f6 !important;
}

/* Rote Färbung für den Abmelden-Button beim Hovern */
.user-dropdown-menu .dropdown-item.logout-danger:hover {
    background-color: #fee2e2 !important;
    color: #dc2626 !important;
}

/* Trennlinie im Menü */
.user-dropdown-menu .dropdown-divider {
    border: 0 !important;
    border-top: 1px solid #eeeeee !important;
    margin: 4px 0 !important;
}

/* Hauptbereich: Minimale Ränder für maximale Platzausnutzung */
.role-section-box h2.section-title-simple:first-of-type {
    margin-top: -5px !important;    /* Zieht den Titel näher an die Top-Bar heran */
    padding-top: 0 !important;      /* Eliminiert eventuelle Innenabstände */
}

/* Flexbox-Zeile für Überschrift und Avatar */
.dashboard-top-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    margin-top: 5px !important;
    margin-bottom: 8px !important;
    padding: 0 !important;
}

/* Rahmenlose, kompakte Überschriften */
.section-title-simple {
    font-size: 1.3rem !important;
    color: #1e3a8a !important;
    margin: 15px 0 8px 0 !important; /* Vertikale Abstände halbiert */
    padding: 0 !important;
    border: none !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-title-simple.no-margin {
    margin: 0 !important;
}

/* 🧩 1. DAS HAUPTRASTER: Nutzt schriftbasierte 'rem' statt fixer Pixel */
.profile-grid.compact-grid {
    display: grid !important;
    /* Spalten passen sich nun elastisch der Schriftgröße an (ca. 7.5 facher Textwert) */
    grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)) !important; 
    /* Horizontaler Abstand um 5px erhöht (wie gewünscht) und elastisch gelagert */
    column-gap: 0.4rem !important; 
    row-gap: 2.2rem !important;    /* Großzügiger vertikaler Puffer gegen Überlappung */
    padding: 0.5rem 0 1.5rem 0 !important;
    width: 100% !important;
}

/* Einzelne Profilkarte */
.profile-grid .profile-card {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Foto-Container im Standard-Layout */
.profile-card .avatar-container {
    position: relative !important;
    width: 85px !important; /* Kompaktere Desktop-Größe */
    height: 85px !important;
    cursor: pointer !important;
}

/* Rundes Profilbild */
.profile-card .profile-img {
    width: 100% !important;
    height: 100% !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 2.5px solid #ffffff !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.12) !important;
    transition: all 0.15s ease-in-out !important;
}

/* 🧩 DAS NAMENSSCHILD (DUNKELBLAU) - ABSOLUT FLUCHTEND IN DER MITTE */
.profile-card .profile-firstname {
    position: absolute !important;
    bottom: -0.3rem !important;
    left: 50% !important;
    /* 🧩 Zieht das Schild mathematisch exakt auf den echten Mittelpunkt zurück */
    transform: translateX(-50%) !important; 
    
    background-color: #1e3a8a !important;
    color: #ffffff !important;
    padding: 0.2rem 0.6rem !important;
    border-radius: 1.5rem !important;
    font-size: 0.72rem !important; 
    font-weight: bold !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
    white-space: nowrap !important;
    z-index: 5 !important; /* Thront sicher über dem Bild-Unterrand */
}

/* Die Detail-Box im Normalzustand */
.profile-card .profile-details-popover {
    position: absolute !important;
    top: 105% !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 260px !important;
    background-color: #ffffff !important;
    color: #333333 !important;
    padding: 15px !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2) !important;
    
    /* Sanftes Ein- und Ausblenden */
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.15s ease-in-out, visibility 0.15s ease-in-out !important;
    z-index: 9999 !important;
}

/* Wenn geklickt und aktiv */
.profile-card .profile-details-popover.is-visible {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Blockiert jeden alten Hover-Versuch */
.profile-card:hover .profile-details-popover:not(.is-visible) {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* --- ERZWUNGENE MINIMAL-ABSTÄNDE FÜR SMARTPHONES (HANDYS) --- */
@media screen and (max-width: 480px) {
    /* 5. Die Detail-Box (Popover) für Handys optimieren, damit sie nicht rechts aus dem Bildschirm ragt */
    .profile-card .profile-details-popover {
        width: 240px !important; /* Etwas schmaler auf Mobilgeräten */
        position: fixed !important; /* Fixiert die Box auf dem Handy-Bildschirm */
        top: 30% !important; /* Erscheint mittig auf dem Display statt unter dem Bild */
        left: 50% !important;
        transform: translate(-50%, -50%) scale(0.9) !important;
        box-shadow: 0 10px 30px rgba(0,0,0,0.4) !important;
    }

    /* Wenn das Popover auf dem Handy aktiv geklickt wird */
    .profile-card .profile-details-popover.is-visible {
        transform: translate(-50%, -50%) scale(1) !important;
    }

    /* Vollkommen starre, zentrierte Box auf dem Handy (kann niemals verrutschen) */
    .profile-grid .profile-card .profile-details-popover {
        position: fixed !important;
        top: 50% !important; /* Exakt vertikale Mitte des Bildschirms */
        left: 50% !important; /* Exakt horizontale Mitte des Bildschirms */
        width: 280px !important; /* Maximale, gut lesbare Breite auf Handys */
        max-width: 90vw !important; /* Verhindert Übersteuern auf extrem schmalen Handys */
        
        /* Absolut exakte Zentrierung über die Mitte des Popovers */
        transform: translate(-50%, -50%) scale(0.9) !important;
        
        box-shadow: 0 15px 40px rgba(0,0,0,0.4) !important;
        transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    }

    /* Aktivierter Zustand auf dem Handy */
    .profile-grid .profile-card .profile-details-popover.is-visible {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translate(-50%, -50%) scale(1) !important;
    }

    .dashboard-top-row {
        margin-top: 5px !important;
        margin-bottom: 10px !important;
    }

    /* Äußerer Rand schrumpft auf ein Minimum */
    .dashboard-fullwidth {
        padding: 5px 6px !important;
    }

    /* Winzige, aber scharfe Profilbilder für das Handy-Raster */
    .profile-card .avatar-container {
        width: 65px !important;
        height: 65px !important;
    }

    /* Verringert den Abstand vor der zweiten Sektion */
    .section-title-simple {
        font-size: 1.15rem !important;
        margin: 12px 0 6px 0 !important;
    }
}

/* =========================================================================
   TEXTAREA ADRESSEINGABE - ABSOLUT AUSFALLSICHERE LABEL-STEUERUNG
   ========================================================================= */

/* Gibt der Adress-Box eine feste, großzügige Mindesthöhe */
.input-group textarea {
    width: 100% !important;
    min-height: 80px !important;
    max-height: 150px !important;
    padding: 14px 10px 5px 10px !important;
    resize: vertical !important;
    box-sizing: border-box !important;
    font-family: inherit !important;
    font-size: 1rem !important;
}

/* Richtet das Label im leeren Zustand oben links in der Textarea aus */
.input-group.align-textarea label {
    top: 12px !important;
    transform: none !important;
    transition: all 0.2s ease-in-out !important;
}

/* FIX: Zwingt das Label dauerhaft nach oben, wenn fokussiert, ausgefüllt oder nicht-leer */
/* FIX: Zwingt das Label dauerhaft nach oben mit weißer Schrift auf blauem Hintergrund */
.input-group.align-textarea textarea:focus ~ label,
.input-group.align-textarea textarea:not(:placeholder-shown) ~ label,
.input-group.align-textarea textarea:valid ~ label,
.input-group.align-textarea:focus-within label {
    top: -12px !important;
    font-size: 0.8rem !important;
    background-color: #2563eb !important; /* Dunkelblauer Hintergrund wie überall sonst */
    color: #ffffff !important;            /* Weiße Schrift */
    padding: 2px 8px !important;          /* Kompaktes Padding für die Kapsel-Optik */
    border-radius: 4px !important;        /* Leicht abgerundete Ecken passend zum Design */
    z-index: 5 !important;
}

/* =========================================================================
   EINHEITLICHE MINIMALISTISCHE ICON-NAVIGATION (TOP-BAR)
   ========================================================================= */

/* Gemeinsame Menüleiste für Dashboard UND Karte */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 20px !important; 
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
    width: 100%;
}

/* Schwebende Top-Bar auf der Landkarte (angepasst an Handy-Fluss) */
.top-bar-floating {
    position: absolute !important;
    top: 10px !important;        
    left: 10px !important;       
    right: 10px !important;      
    width: calc(100% - 20px) !important; 
    z-index: 5000 !important;
}

/* Flexbox-Ausrichtung für die linken und rechten Icon-Gruppen */
.nav-group-left, .nav-group-right {
    display: flex;
    gap: 3px;
    align-items: center;
}

/* Einheitliche, minimalistische runde Buttons */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background-color: #ffffff;
    color: #4b5563;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    box-sizing: border-box;
}

/* Minimalistische SVG-Icons steuern */
.icon-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.2s ease;
}

/* Hover- & Aktiv-Zustände */
.icon-btn:hover {
    color: #2563eb;
    border-color: #2563eb;
    background-color: #eff6ff;
}

.icon-btn:hover svg {
    transform: scale(1.08);
}

.icon-btn.active {
    color: #ffffff;
    background-color: #2563eb;
    border-color: #2563eb;
    cursor: default;
}

.icon-btn.logout-btn:hover {
    color: #dc2626;
    border-color: #dc2626;
    background-color: #fef2f2;
}

/* CSS-Tooltips */
.icon-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 48px;
    background-color: #1f2937;
    color: #ffffff;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: normal;
    white-space: nowrap;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.15s ease;
    pointer-events: none;
    z-index: 6000;
}

.nav-group-left .icon-btn::after { left: 0; }
.nav-group-right .icon-btn::after { right: 0; }

.icon-btn:hover::after {
    opacity: 1;
    visibility: visible;
    top: 45px;
}

/* --- ERZWUNGENE HARMONISIERUNG FÜR SMARTPHONES --- */
@media screen and (max-width: 480px) {
    /* Karte bleibt unangetastet absolut positioniert */
    .top-bar-floating {
        top: 10px !important;
        left: 10px !important;
        right: 10px !important;
    }
    
    /* 🧩 SMARTPHONE-FIX FÜR DAS DASHBOARD: */
    .dashboard-header {
        top: 10px !important;
        /* Gleicht die kompakteren Ränder auf Handys auf den Pixel genau an */
        margin-top: -10px !important; 
        margin-left: -16px !important;  
        margin-right: -16px !important; 
        width: calc(100% + 32px) !important;
        margin-bottom: 15px !important;
        padding: 0 6px !important;
        box-sizing: border-box !important;
    }
    
    .dashboard-fullwidth {
        margin-top: 0 !important;
    }
}

/* =========================================================================
   AUSFALLSICHERE VOLLBILD-MASSE FÜR DIE LANDKARTE
   ========================================================================= */

/* Setzt die Leinwand auf die volle Fenstergröße zurück */
.map-body-fullsize {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
}

/* 🧩 DER FIX: Die Karte wird absolut in alle vier Ecken gespannt */
#map {
    position: absolute !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 1 !important; /* Liegt sicher unter dem Menü (z-index 1000) */
    background: #e5e7eb; 
}

/* Die runden Profilbilder-Pins auf der Karte */
.custom-profile-marker {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 3px solid #1e3a8a;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    overflow: hidden;
    background-color: white;
}
.custom-profile-marker img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* =========================================================================
   DUNKELBLAUES DESIGN FÜR DIE CLUSTER-KREISE (ZUSAMMENFASSUNGEN)
   ========================================================================= */

/* Kleine Cluster (wenige Personen) */
.marker-cluster-small {
    background-color: rgba(37, 99, 235, 0.4) !important; /* Transparentes Hellblau außen */
}
.marker-cluster-small div {
    background-color: #1e3a8a !important; /* Kräftiges Dunkelblau innen */
    color: #ffffff !important;            /* Weiße Zahl */
}

/* Mittlere Cluster */
.marker-cluster-medium {
    background-color: rgba(29, 78, 216, 0.4) !important;
}
.marker-cluster-medium div {
    background-color: #1e3a8a !important;
    color: #ffffff !important;
}

/* Große Cluster (sehr viele Personen) */
.marker-cluster-large {
    background-color: rgba(30, 58, 138, 0.4) !important;
}
.marker-cluster-large div {
    background-color: #1d4ed8 !important;
    color: #ffffff !important;
}

/* Generelle Textglättung und Typografie für die Cluster-Zahlen */
.marker-cluster div {
    font-family: sans-serif !important;
    font-weight: bold !important;
    font-size: 13px !important;
}

/* =========================================================================
   EBENEN-STEUERUNG (Z-INDEX) FÜR DEN GEBURTSTAGSKALENDER
   ========================================================================= */

/* 1. Die Tageskacheln (Zahlen 1-31) bleiben im Hintergrund */
.day-grid-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    z-index: 10 !important; /* Niedriger Z-Index */
}

/* 2. Die runden Profilfotos werden radikal in den Vordergrund gezwungen */
.custom-profile-marker {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 3px solid #2563eb;
    box-shadow: 0 2px 5px rgba(0,0,0,0.25);
    overflow: hidden;
    background-color: white;
    z-index: 9999 !important; /* 🧩 DER FIX: Schwebt immer ÜBER den Tageszahlen */
}

.custom-profile-marker img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Auch das Cluster-Plugin (die dunkelblauen Kreise) muss über den Zahlen schweben */
.marker-cluster {
    z-index: 9999 !important;
}

.calendar-zoom-text div {
    transition: transform 0.1s ease-out;
    transform-origin: center center;
}

/* =========================================================================
   PERFEKTE HARMONISIERUNG & NEGATIVER AUSGLEICH FÜR DIE BESATZUNG
   ========================================================================= */

/* 1. REAKTIVIERUNG: Der body erhält wieder seinen alten, stabilen Zustand */
body.dashboard-bg {
    padding: 20px !important;
    margin: 0 !important;
}

/* Der Hauptcontainer wird bündig geöffnet */
.container.dashboard-container {
    padding-top: 0px !important;
    padding-left: 0px !important;   
    padding-right: 0px !important;  
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* 2. DIE NAVIGATIONSLEISTE (TOP-BAR) ERHÄLT IHREN ALTEN PERFEKTEN ABSTAND ZURÜCK */
.dashboard-header {
    position: sticky !important;
    top: 10px !important;       /* 10px Abstand nach oben beim Scrollen */
    z-index: 5000 !important;
    width: calc(100% + 40px) !important; /* Dehnt die Leiste perfekt über die Body-Ränder */
    
    margin-top: -10px !important;  
    margin-left: -20px !important;  /* Dockt links perfekt an */
    margin-right: -20px !important; /* Dockt rechts perfekt an */
    margin-bottom: 20px !important;
    padding: 0 10px !important;     /* Hält das Innere symmetrisch */
    box-sizing: border-box !important;
}

/* 3. 🧩 DER FIX PER NEGATIVEM MARGIN FÜR DIE SCHÜLER ("BESATZUNG") */
/* Zieht die Überschrift "Besatzung" um 5px nach links, damit sie perfekt fluchtet */
.dashboard-fullwidth h2.section-title-simple:first-of-type {
    margin-top: 0px !important;    
    margin-left: -5px !important;  /* Zieht den Text weiter nach links */
    padding-left: 0px !important;
}

/* Zieht das gesamte Schüler-Raster links und rechts um 5px nach außen */
#schueler-container {
    margin-left: -5px !important;  /* Zieht die Profilfotos weiter nach links */
    margin-right: -5px !important; /* Zieht die Profilfotos weiter nach rechts */
    padding-left: 0px !important;
    padding-right: 0px !important;
    width: calc(100% + 10px) !important;
    box-sizing: border-box !important;
}

/* Die Lehrer (Außerirdische) behalten ihre funktionierende Fluchtung */
.dashboard-fullwidth h2.section-title-simple:not(:first-of-type) {
    margin-top: 25px !important;   
    padding-left: 0px !important;
}
#lehrer-container {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0px !important;
    padding-right: 0px !important;
    width: 100% !important;
}

/* --- OPTIMIERUNG FÜR SMARTPHONES --- */
@media screen and (max-width: 480px) {
    .dashboard-header {
        top: 10px !important;
        margin-top: -10px !important; 
        margin-left: -16px !important;  
        margin-right: -16px !important; 
        width: calc(100% + 32px) !important;
        padding: 0 6px !important;
    }
    #schueler-container {
        margin-left: -8px !important;
        margin-right: -8px !important;
        width: calc(100% + 10px) !important;
    }
}

/* =========================================================================
   ERZWUNGENE NEBENENANDER-AUSRICHTUNG (PC & HANDY IMMER IN EINER ZEILE)
   ========================================================================= */
.heading-inline-container {
    display: flex;
    align-items: center;
    gap: 15px;                      /* 30px Abstand zwischen Text und Balken auf dem PC */
    width: 100% !important;
    box-sizing: border-box !important;
    margin-top: 35px;
    margin-bottom: 12px;
    padding-left: 10px !important;  
    padding-right: 10px !important; 
    flex-wrap: nowrap !important;   /* 🛑 ZWINGEND: Verhindert jeglichen Umbruch nach unten! */
}

/* Die allererste Zeile dockt nahtlos und bündig unter der Top-Bar an */
.heading-inline-container:first-of-type {
    margin-top: 0px;
    margin-left: -5px !important;   
    width: calc(100% + 5px) !important;
}

/* 🧩 DER ENTSCHEIDENDE FIX FÜR DEN BÜNDIGEN START & DIE SCHRIFTSKALIERUNG:
   Nutzt relative Einheiten (em), damit die Box im Gleichschritt mit der Schrift wächst */
.heading-inline-container .section-title-simple {
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap;
    width: 9.5em !important;        /* 🧩 Exakt ausgemessen: Hält "Außerirdische" perfekt im Raster */
    flex-shrink: 0 !important;      /* Verhindert, dass die Schrift gestaucht wird */
}

.progress-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;                       
    flex-grow: 1;
    min-width: 0;                   /* Erlaubt dem Balken, sich flexibel zu verkleinern */
}

.progress-bar-bg {
    flex-grow: 1;                   
    height: 14px;
    background-color: #e2e8f0;
    border-radius: 7px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.progress-bar-fill {
    height: 100%;
    width: 0%;                      
    border-radius: 7px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.color-blue { background-color: #1e3a8a; }
.color-lightblue { background-color: #0284c7; }

.progress-label {
    font-family: sans-serif;
    font-size: 12px;
    font-weight: bold;
    color: #475569;
    white-space: nowrap;
    min-width: auto !important;     
    text-align: left;               
}

/* --- DYNAMISCHE ANPASSUNG FÜR SMARTPHONES (HANDYS) --- */
@media screen and (max-width: 600px) {
    .heading-inline-container {
        gap: 22px !important;       /* Macht den Abstand auf dem Handy kompakter für mehr Balkenplatz */
    }
    
    .heading-inline-container .section-title-simple {
        width: 8.2em !important;    /* Kompakterer Textrahmen auf kleinen Displays */
        font-size: 1.1rem !important;
    }
    
    .progress-label {
        font-size: 11px;            /* Leicht kleinere Prozentzahl auf dem Handy */
    }
}

/* =========================================================================
   PERFEKTE VERTIKALE MITTEL-ACHSE FÜR BILD UND NAME (PC & HANDY)
   ========================================================================= */
.avatar-container {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;     
    justify-content: center !important;
    position: relative !important; 
    width: 6.5rem !important; 
    margin: 0 auto !important;          
}

/* 🧩 DER BILD-CONTAINER: Bildet nun die absolute, fehlerfreie Zentrierungs-Achse */
.profile-image-wrapper {
    position: relative !important; /* Bildet den starren Anker für das Namensschild */
    display: block !important;
    cursor: pointer;
    
    width: 6.5rem !important;         
    height: 6.5rem !important;
    flex-shrink: 0 !important;       
    flex-grow: 0 !important;
    
    border-radius: 50% !important;
    margin: 0 auto 0.5rem auto !important;
    box-sizing: border-box !important;
    transition: transform 0.2s ease !important;
    
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

.profile-image-wrapper:hover {
    transform: scale(1.04);
}

.profile-image-wrapper .profile-img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;    
    object-position: center !important;
    border-radius: 50% !important;
    box-sizing: border-box !important;
}

/* Rahmenfarben direkt auf dem Bild */
.profile-image-wrapper.has-char .profile-img {
    border: 4px solid #ffd700 !important; 
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3) !important;
}
.profile-image-wrapper.no-char .profile-img {
    border: 4px solid #ffffff !important; 
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
}

/* 🧩 DAS OPTIMIERTE NAMENSSCHILD: 
   Rastet durch den neuen HTML-Ort auf den Pixel genau im Zentrum des Kreises ein! */
.profile-card .profile-firstname {
    position: absolute !important;
    bottom: -0.4rem !important;         /* Richtet das Schild knapp unter dem Fotorand aus */
    left: 50% !important;
    transform: translate(-50%, 0) !important; /* Spiegelt die Kapsel haargenau in die Mitte */
    
    background-color: #1e3a8a !important;
    color: #ffffff !important;
    padding: 0.2rem 0.6rem !important;
    border-radius: 1.5rem !important;
    font-size: 0.72rem !important; 
    font-weight: bold !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.25) !important;
    white-space: nowrap !important;
    z-index: 50 !important;             /* Steht sicher über dem runden Bildrand */
}

/* =========================================================================
   ABSOLUTES VOLLBILD-MODAL FÜR CHARAKTERISTIKEN (KINO-MODUS & SCAN-SCHUTZ)
   ========================================================================= */
.charakteristik-modal {
    display: none;                  
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;        
    height: 100vh !important;       
    background-color: #000000 !important; 
    z-index: 999999999 !important;  
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

.charakteristik-zoom-container {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    justify-content: center !important; 
    align-items: center !important;     
    overflow: auto !important;      
    touch-action: pinch-zoom !important; 
    background-color: #000000 !important;
}

.charakteristik-wrapper {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

.charakteristik-img {
    max-width: 100vw !important;    
    max-height: 100vh !important;   
    object-fit: contain !important; 
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    -khtml-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    pointer-events: none !important; 
}

.charakteristik-protection-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent !important;
    z-index: 22 !important;
}

/* =========================================================================
   ❌ ABSOLUT FEHLERFREIER SCHLIEẞEN-BUTTON (MITTEL-GARANTIE BEI 170% SCHRIFT)
   ========================================================================= */
.charakteristik-close-btn {
    position: fixed !important;
    top: 15px !important;
    
    /* 🧩 DER ULTIMATIVE SKALIERUNGS-VERNICHTER:
       Wir verwerfen "left: 50%" und "translate". Stattdessen spannen wir den Button 
       von der linken zur rechten Kante auf und zentrieren das "X" im Inneren über Flexbox!
       Dadurch ist es mathematisch zu 100% UNMÖGLICH, dass das Kreuz nach rechts verschoben wird! */
    left: 0 !important;
    right: 0 !important;
    width: 46px !important;         /* Die feste Breite des Kreises */
    margin: 0 auto !important;      /* Zwingt den Kreis exakt in die optische Mitte des Bildschirms! */
    
    height: 46px !important;
    background-color: rgba(30, 41, 59, 0.95) !important; /* Sattes Schiefergrau */
    border: 2px solid #ffffff !important;
    color: #ffffff !important;
    border-radius: 50% !important;
    font-size: 26px !important;     
    font-weight: bold !important;
    display: inline-flex !important; /* Aktiviert Flexbox im Button */
    justify-content: center !important; /* Zentriert das "X" im Kreis waagerecht */
    align-items: center !important;     /* Zentriert das "X" im Kreis senkrecht */
    cursor: pointer !important;
    z-index: 9999999999 !important; 
    box-shadow: 0 4px 16px rgba(0,0,0,0.6);
    transition: background 0.2s, scale 0.2s !important;
}

/* Weicher Hover-Effekt: Vergrößert den Button, ohne die zentrierte Margin-Achse zu stören */
.charakteristik-close-btn:hover {
    background-color: #2563eb !important; 
    scale: 1.06 !important;
}

/* =========================================================================
   📱 RESPONSIVE RESPONSIVENESS FÜR SMARTPHONES (SMARTPHONE-ANPASSUNG)
   ========================================================================= */
@media screen and (max-width: 480px) {
    .profile-grid.compact-grid {
        grid-template-columns: repeat(auto-fill, minmax(5.8rem, 1fr)) !important; 
        column-gap: 0.35rem !important; 
        row-gap: 2.5rem !important;
        padding: 0.2rem 0 0.8rem 0 !important;
    }

    /* Der Kreis schrumpft auf dem Handy proportional mit */
    .profile-image-wrapper {
        width: 5.2rem !important;
        height: 5.2rem !important;
    }

    /* Das Schild fluchtet auch auf dem Handy absolut zentriert am verkleinerten Kreis */
    .profile-card .profile-firstname {
        bottom: -0.3rem !important;
        padding: 0.15rem 0.45rem !important;
        font-size: 0.65rem !important;
        left: 50% !important;
        transform: translate(-50%, 0) !important; 
    }

    .charakteristik-close-btn {
        top: 15px !important;       /* Perfekter Abstand zur Kamera-Notch auf Handys */
        
        /* 🧩 MOBILER ANKER-SCHUTZ: 
           Erzwingt die Rand-zu-Rand-Bündigkeit auch auf dem Handy, sodass die 
           unsichtbare Dashboard-Scrollbar ignoriert wird! */
        left: 0 !important;
        right: 0 !important;
        margin: 0 auto !important;  
        
        width: 44px !important;
        height: 44px !important;
        font-size: 24px !important;
    }
}

/* =========================================================================
   🧩 STERNE-ABZEICHEN (KONTRASTREICHER WEISSER HINTERGRUND)
   ========================================================================= */
.profile-image-wrapper .profile-stars-badge {
    position: absolute !important;
    top: -0.4rem !important;            /* Symmetrischer Überlapp zum oberen Bildrand */
    left: 50% !important;
    transform: translate(-50%, 0) !important; /* Spiegelt die Kapsel haargenau in die Mitte */
    
    /* 🧩 DER KONTRAST-FIX: Schneeweißer Hintergrund für perfekte Sichtbarkeit */
    background-color: #ffffff !important; 
    color: #1e293b !important;            /* Dunkle Schrift für knackige Lesbarkeit */
    border: 1px solid #e2e8f0 !important; /* Dezente Konturlinie passend zum Design */
    
    padding: 0.15rem 0.5rem !important;
    border-radius: 1.5rem !important;
    font-size: 0.68rem !important; 
    font-weight: bold !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
    white-space: nowrap !important;
    z-index: 50 !important;             /* Thront sicher über dem Bildrand */
}

/* Smartphone-Optimierung: Passt die Kapsel an das kleinere mobile Handy-Raster an */
@media screen and (max-width: 480px) {
    .profile-image-wrapper .profile-stars-badge {
        top: -0.35rem !important;
        padding: 0.1rem 0.4rem !important;
        font-size: 0.6rem !important;
    }
}


/* =========================================================================
   📅 SYSTEM-CSS FÜR DIE HOCHPRÄZISE JAHRESKALENDER-TABELLE (TERMIN-MODUL)
   ========================================================================= */
.calendar-layout-container {
    width: 100%;
    margin-top: 25px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 32px rgba(0,0,0,0.06);
    overflow-x: auto;
}

/* Die feste, unverrückbare HTML-Tabelle */
.calendar-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 6px; /* Einheitliche Gassen zwischen den Quadraten */
    min-width: 750px;
    user-select: none; /* Verhindert hässliche Textmarkierungen beim Ziehen der Maus */
}

/* Kopfzeile (J, F, M, A...) */
.calendar-table th {
    text-align: center;
    font-weight: bold;
    color: #1e3a8a;
    font-size: 16px;
    padding-bottom: 8px;
    width: calc(100% / 13);
}

/* Die Wochentags-Spalte ganz links */
.calendar-table td.weekday-label-cell {
    font-weight: 700;
    color: #475569;
    font-size: 13px;
    text-align: right;
    padding-right: 12px;
    width: 50px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    cursor: default;
}

/* Die quadratischen Interaktions-Zellen für die Monatstage */
.calendar-table td.day-cell-box {
    height: 34px;
    text-align: center;
    vertical-align: middle;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
    position: relative;
}

/* Die 3 rollierenden Farbzustände */
.day-state-white {
    background-color: #ffffff !important;
    color: #1e293b !important;
}
.day-state-green {
    background-color: #22c55e !important;
    color: #ffffff !important;
    border-color: #16a34a !important;
}
.day-state-red {
    background-color: #ef4444 !important;
    color: #ffffff !important;
    border-color: #dc2626 !important;
}

/* 🧩 NEU: Zustand für markierte Zellen (Halbtransparenter blauer Überlapp-Effekt) */
.calendar-table td.day-cell-box.is-selected {
    box-shadow: 0 0 0 3px #3b82f6 !important; /* Kräftiger blauer Auswahlrahmen */
    outline: none;
}

/* Unsichtbare Zellen für Tage, die in dem Monat nicht existieren */
.calendar-table td.day-cell-empty {
    background: transparent !important;
    border: none !important;
    visibility: hidden;
}

