*,
*::before,
*::after {
    box-sizing: border-box;
}

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

html,
body {
    margin: 0;
}

body {
    font-family: Arial, sans-serif;
    min-height: 100%;
    padding-top: 72px;
    padding-bottom: 52px;
    background: #000;
    color: #eee;
    overflow-x: hidden;
}

/* Hintergrund nur für angemeldete Nutzer */
body.angemeldet {
    padding-top: 96px; /* Header inkl. Nutzerzeile */
    background-color: #000;
    background-image: url('/assets/bilder/scr00007.jpg');
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    transition: padding-right 0.25s ease;
}

/* Chat-Platz nur ab Rang Nutzer */
body.angemeldet.mit-chat {
    padding-right: 332px;
}

body.angemeldet.mit-chat.chat-zugeklappt {
    padding-right: 52px;
}

body.angemeldet::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    pointer-events: none;
    z-index: 0;
}

body.angemeldet .site-header,
body.angemeldet footer {
    background-color: rgba(34, 34, 34, 0.92);
}

header,
footer {
    background-color: #222;
    color: #fff;
    text-align: center;
    padding: 10px;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 12px 16px;
    box-sizing: border-box;
}

.header-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 2.25rem;
}

.site-logo {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    display: flex;
    align-items: center;
    line-height: 0;
    text-decoration: none;
}

.site-logo img {
    display: block;
    height: 2rem;
    width: auto;
    max-width: 7rem;
    object-fit: contain;
}

.site-nav {
    text-align: center;
    padding: 0 7rem;
}

.site-nav a {
    color: #fff;
    margin: 0 10px;
    text-decoration: none;
}

.site-nav a:visited {
    color: #fff;
}

.site-nav a:hover,
.site-nav a.active {
    text-decoration: underline;
}

.btn-abmelden {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 2;
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border: 1px solid #555;
    border-radius: 4px;
    background: #333;
    color: #ffb3b3;
    text-decoration: none;
    font-size: 0.85rem;
    line-height: 1.2;
    white-space: nowrap;
}

.btn-abmelden:link,
.btn-abmelden:visited {
    color: #ffb3b3;
}

.btn-abmelden:hover,
.btn-abmelden:focus {
    background: #444;
    border-color: #777;
    color: #fff;
}

.logout-link,
.logout-link:visited {
    color: #ffb3b3;
}

footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    margin: 0;
}

footer p {
    margin: 0;
}

main {
    padding: 20px;
    max-width: 720px;
    margin: 0 auto;
}

#app-content {
    position: relative;
    z-index: 1;
}

/* Anmeldung */
.auth-box {
    max-width: 360px;
    margin: 2rem auto;
    padding: 1.5rem;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
}

.auth-box h1 {
    margin-top: 0;
    font-size: 1.4rem;
}

.auth-box label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.auth-box input,
.auth-box textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid #444;
    border-radius: 4px;
    background: #111;
    color: #eee;
    font: inherit;
}

.auth-box textarea {
    resize: vertical;
    min-height: 100px;
}

.kontakt-hinweis,
.zeichenzaehler {
    font-size: 0.85rem;
    color: #aaa;
}

.zeichenzaehler {
    margin: -0.5rem 0 1rem;
    text-align: right;
}

/* Kontakt-Mitteilungen (Admin) */
.kontakt-board {
    margin-top: 1.75rem;
    max-width: 640px;
    text-align: left;
    background: rgba(26, 26, 26, 0.55);
    border: 1px solid rgba(80, 80, 80, 0.65);
    border-radius: 10px;
    overflow: hidden;
    backdrop-filter: blur(4px);
}

.kontakt-board-kopf {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(80, 80, 80, 0.55);
    background: rgba(34, 34, 34, 0.55);
}

.kontakt-board-kopf h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: normal;
}

.kontakt-board-liste {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.75rem;
    max-height: 420px;
    overflow-y: auto;
}

.kontakt-board-leer {
    margin: 0.75rem;
    color: #999;
    font-size: 0.9rem;
}

.kontakt-kachel {
    background: rgba(18, 18, 18, 0.55);
    border: 1px solid rgba(90, 90, 90, 0.55);
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
}

.kontakt-kachel-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.65rem;
    align-items: baseline;
    margin-bottom: 0.4rem;
    font-size: 0.75rem;
    color: #aaa;
}

.kontakt-kachel-name {
    color: #eee;
    font-weight: bold;
}

.kontakt-kachel-loeschen {
    margin-left: auto;
    border: none;
    background: transparent;
    color: #ffb3b3;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0;
}

.kontakt-kachel-loeschen:hover {
    color: #fff;
    text-decoration: underline;
}

.kontakt-kachel-text {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.4;
    color: #e8e8e8;
}

.auth-box button {
    width: 100%;
    padding: 0.6rem;
    border: none;
    border-radius: 4px;
    background: #444;
    color: #fff;
    cursor: pointer;
}

.auth-box button:hover {
    background: #555;
}

.auth-message {
    margin-top: 1rem;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.auth-message.error {
    background: #3a1515;
    color: #ffb3b3;
}

.auth-message.success {
    background: #153a1a;
    color: #b3ffb8;
}

.auth-footer-link {
    margin: 1rem 0 0;
    text-align: center;
    font-size: 0.9rem;
}

.auth-action-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 0.6rem;
    border: none;
    border-radius: 4px;
    background: #444;
    color: #fff !important;
    text-decoration: none !important;
    cursor: pointer;
    font: inherit;
    text-align: center;
}

.auth-action-btn:hover {
    background: #555;
    color: #fff !important;
}

.auth-link-btn {
    width: auto !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    color: #9ec9e8 !important;
    cursor: pointer;
    font: inherit;
    text-decoration: underline;
}

.auth-link-btn:hover {
    color: #cfe8f8 !important;
    background: transparent !important;
}

.auth-hinweis {
    margin: 0 0 1rem;
    font-size: 0.85rem;
    color: #aaa;
    line-height: 1.4;
}

.auth-hinweis.error {
    color: #ffb3b3;
}

.auth-hinweis.success {
    color: #b3ffb8;
}

.reg-modus {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.reg-modus-btn {
    flex: 1;
    width: auto !important;
    padding: 0.45rem 0.5rem !important;
    border: 1px solid #444 !important;
    border-radius: 4px !important;
    background: #111 !important;
    color: #ccc !important;
    cursor: pointer;
    font-size: 0.85rem;
}

.reg-modus-btn.is-active {
    background: #2a3a48 !important;
    border-color: #4a7a96 !important;
    color: #e8f4ff !important;
}

.reg-admin-board {
    margin-top: 1.75rem;
    max-width: 640px;
    text-align: left;
    background: rgba(26, 26, 26, 0.55);
    border: 1px solid rgba(80, 80, 80, 0.65);
    border-radius: 10px;
    overflow: hidden;
    backdrop-filter: blur(4px);
}

.reg-code-body {
    padding: 1rem;
}

.reg-code-wert {
    margin: 0;
    font-size: 1.45rem;
    letter-spacing: 0.12em;
    font-family: Consolas, 'Courier New', monospace;
    color: #e8f4ff;
}

.reg-code-meta {
    margin: 0.45rem 0 0;
    font-size: 0.8rem;
    color: #999;
}

.reg-mail-warn {
    color: #c47a7a;
}

.reg-antrag-board {
    margin-top: 1.25rem;
}

.reg-antrag-aktionen {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.35rem;
}

.reg-antrag-freigeben,
.reg-antrag-ablehnen {
    border: 1px solid rgba(120, 120, 120, 0.7);
    border-radius: 4px;
    background: rgba(40, 40, 40, 0.8);
    color: #eee;
    font: inherit;
    font-size: 0.78rem;
    padding: 0.25rem 0.55rem;
    cursor: pointer;
}

.reg-antrag-freigeben:hover {
    background: rgba(40, 80, 50, 0.9);
}

.reg-antrag-ablehnen:hover {
    background: rgba(90, 40, 40, 0.9);
}

.user-info {
    font-size: 0.85rem;
    color: #aaa;
    margin: 0.35rem 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Chat-Kachel rechts */
.chat-panel {
    position: fixed;
    top: 96px;
    right: 12px;
    bottom: 52px;
    width: 308px;
    z-index: 80;
    transition: width 0.25s ease;
}

.chat-kachel {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: rgba(26, 26, 26, 0.94);
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
}

.chat-kopf {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid #333;
    background: rgba(34, 34, 34, 0.95);
}

.chat-kopf h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: normal;
}

.chat-toggle {
    flex: 0 0 auto;
    width: 1.75rem;
    height: 1.75rem;
    border: 1px solid #555;
    border-radius: 4px;
    background: #333;
    color: #eee;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0;
}

.chat-toggle:hover {
    background: #444;
    color: #fff;
}

.chat-koerper {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.chat-liste {
    flex: 1 1 auto;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

/* Zugeklappt: schmaler Streifen rechts */
body.chat-zugeklappt .chat-panel {
    width: 40px;
    right: 8px;
}

body.chat-zugeklappt .chat-kopf {
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    height: 100%;
    border-bottom: none;
    padding: 0.5rem 0.25rem;
    gap: 0.75rem;
}

body.chat-zugeklappt .chat-kopf h2 {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 0.9rem;
    letter-spacing: 0.08em;
}

body.chat-zugeklappt .chat-toggle {
    order: -1;
}

body.chat-zugeklappt .chat-koerper {
    display: none;
}

.chat-nachricht {
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
    background: #151515;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 0.5rem 0.6rem;
    text-align: left;
}

.chat-avatar {
    flex: 0 0 2.55rem;
    width: 2.55rem;
    height: 2.55rem;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(40, 40, 40, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: bold;
    color: #ddd;
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.chat-inhalt {
    min-width: 0;
    flex: 1 1 auto;
}

.chat-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
    align-items: baseline;
    margin-bottom: 0.2rem;
    font-size: 0.72rem;
    color: #999;
    line-height: 1.25;
}

.chat-meta .chat-name {
    font-weight: bold;
}

.chat-text {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.chat-loeschen {
    margin-left: auto;
    border: none;
    background: transparent;
    color: #ffb3b3;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0;
}

.chat-loeschen:hover {
    color: #fff;
    text-decoration: underline;
}

.chat-form {
    flex: 0 0 auto;
    padding: 0.65rem;
    border-top: 1px solid #333;
    background: rgba(20, 20, 20, 0.95);
}

.chat-form textarea {
    width: 100%;
    resize: none;
    margin-bottom: 0.45rem;
    padding: 0.45rem;
    border: 1px solid #444;
    border-radius: 4px;
    background: #111;
    color: #eee;
    font: inherit;
}

.chat-form button {
    width: 100%;
    padding: 0.45rem;
    border: none;
    border-radius: 4px;
    background: #444;
    color: #fff;
    cursor: pointer;
}

.chat-form button:hover {
    background: #555;
}

.chat-status {
    margin: 0.4rem 0 0;
    font-size: 0.8rem;
    color: #aaa;
    min-height: 1.1em;
}

.chat-status.error {
    color: #ffb3b3;
}

.chat-leer {
    margin: 1rem 0.5rem;
    color: #777;
    font-size: 0.85rem;
    text-align: center;
}

@media (max-width: 900px) {
    body.angemeldet.mit-chat {
        padding-right: 0;
        padding-bottom: calc(52px + 38vh);
    }

    body.angemeldet.mit-chat.chat-zugeklappt {
        padding-right: 0;
        padding-bottom: calc(52px + 3rem);
    }

    .chat-panel {
        top: auto;
        right: 0;
        left: 0;
        bottom: 52px;
        width: 100%;
        height: 38vh;
        padding: 0 8px;
    }

    body.chat-zugeklappt .chat-panel {
        width: 100%;
        height: 2.75rem;
        right: 0;
        left: 0;
        padding: 0 8px;
    }

    body.chat-zugeklappt .chat-kopf {
        flex-direction: row;
        height: auto;
        border-bottom: none;
        padding: 0.5rem 0.85rem;
    }

    body.chat-zugeklappt .chat-kopf h2 {
        writing-mode: horizontal-tb;
        transform: none;
    }

    body.chat-zugeklappt .chat-toggle {
        order: 0;
    }
}

/* Notizen – volle Fläche bis zum Chat */
body.angemeldet:has(.notiz-seite) #app-content {
    position: fixed;
    top: 96px;
    left: 0;
    right: 332px;
    bottom: 52px;
    z-index: 1;
    padding: 10px 12px;
    overflow: hidden;
    transition: right 0.25s ease;
}

body.angemeldet.chat-zugeklappt:has(.notiz-seite) #app-content {
    right: 52px;
}

.notiz-seite {
    height: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.notiz-board {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: rgba(26, 26, 26, 0.45);
    border: 1px solid rgba(80, 80, 80, 0.65);
    border-radius: 10px;
    overflow: hidden;
    backdrop-filter: blur(4px);
    text-align: left;
}

.notiz-board-kopf {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid rgba(80, 80, 80, 0.55);
    background: rgba(34, 34, 34, 0.55);
}

.notiz-board-kopf h1 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: normal;
}

.notiz-neu-btn {
    border: 1px solid #555;
    border-radius: 4px;
    background: #333;
    color: #fff;
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    font: inherit;
    font-size: 0.9rem;
}

.notiz-neu-btn:hover {
    background: #444;
}

.notiz-flaeche {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.notiz-leer {
    position: absolute;
    left: 50%;
    top: 40%;
    transform: translate(-50%, -50%);
    margin: 0;
    color: #999;
    font-size: 0.95rem;
    pointer-events: none;
}

.notiz-kachel {
    position: absolute;
    width: 240px;
    background: rgba(255, 244, 170, 0.42);
    border: 1px solid rgba(180, 160, 80, 0.55);
    border-radius: 4px;
    padding: 0.55rem 0.65rem 0.65rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    color: #111;
    z-index: 2;
    touch-action: none;
}

.notiz-kachel.is-dragging {
    z-index: 20;
    opacity: 0.95;
    cursor: grabbing;
}

.notiz-kachel.notiz-neu {
    animation: notiz-neu-pulse 2.2s ease;
    z-index: 15;
}

@keyframes notiz-neu-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 220, 80, 0.95);
        transform: scale(1.02);
    }
    40% {
        box-shadow: 0 0 0 10px rgba(255, 220, 80, 0);
    }
    100% {
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
        transform: scale(1);
    }
}

.notiz-kachel-kopf {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.55rem;
    align-items: center;
    margin: -0.55rem -0.65rem 0.55rem;
    padding: 0.45rem 0.65rem;
    background: rgba(0, 0, 0, 0.12);
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    font-size: 0.72rem;
    color: #333;
    cursor: grab;
    user-select: none;
}

.notiz-autor {
    font-weight: 700;
    max-width: 7rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notiz-autor-zeile {
    display: inline-flex;
    align-items: baseline;
    gap: 0.2rem;
    max-width: 9rem;
    overflow: hidden;
}

.notiz-autor-praefix {
    font-weight: 400;
    color: #333;
    flex: 0 0 auto;
}

.notiz-kachel-kopf label {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    cursor: default;
}

.notiz-kachel-kopf input[type='date'] {
    border: 1px solid rgba(0, 0, 0, 0.25);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.45);
    color: #222;
    padding: 0.1rem 0.25rem;
    font: inherit;
    font-size: 0.72rem;
    max-width: 8.5rem;
    cursor: pointer;
}

.notiz-loeschen {
    margin-left: auto;
    border: none;
    background: transparent;
    color: #8a3030;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0;
}

.notiz-loeschen:hover {
    color: #c00;
    text-decoration: underline;
}

.notiz-titel {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 0.4rem;
    padding: 0.3rem 0.4rem;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.35);
    color: #111;
    font: inherit;
    font-size: 0.95rem;
    font-weight: bold;
}

.notiz-text {
    width: 100%;
    box-sizing: border-box;
    min-height: 70px;
    max-height: 160px;
    resize: vertical;
    padding: 0.3rem 0.4rem;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.3);
    color: #222;
    font: inherit;
    font-size: 0.85rem;
    line-height: 1.35;
}

.notiz-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.4rem;
}

.notiz-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.45rem;
    border: 1px solid rgba(0, 0, 0, 0.25);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.45);
    color: #222;
    text-decoration: none;
    font-size: 0.72rem;
    max-width: 100%;
}

.notiz-link-btn:visited {
    color: #222;
}

.notiz-link-btn:hover {
    background: rgba(255, 255, 255, 0.7);
}

.notiz-link-btn img {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    flex: 0 0 auto;
}

.notiz-link-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notiz-fuss {
    margin-top: 0.45rem;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.notiz-von {
    margin: 0;
    font-size: 0.72rem;
    color: #444;
    width: 100%;
    text-align: right;
}

.notiz-von-name {
    font-weight: 700;
}

.notiz-gesendet {
    margin: 0;
    font-size: 0.7rem;
    color: #3a5a3a;
    width: 100%;
    text-align: right;
}

.notiz-senden {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.3rem;
    max-width: 100%;
}

.notiz-senden-ziel,
.notiz-senden-detail {
    max-width: 7.5rem;
    border: 1px solid rgba(0, 0, 0, 0.25);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.5);
    color: #222;
    font: inherit;
    font-size: 0.7rem;
    padding: 0.15rem 0.25rem;
}

.notiz-senden-btn {
    border: 1px solid rgba(0, 0, 0, 0.3);
    border-radius: 3px;
    background: rgba(40, 40, 40, 0.75);
    color: #fff;
    font: inherit;
    font-size: 0.7rem;
    padding: 0.15rem 0.45rem;
    cursor: pointer;
}

.notiz-senden-btn:hover {
    background: rgba(60, 60, 60, 0.9);
}

.notiz-status {
    margin: 0;
    font-size: 0.7rem;
    color: #555;
    min-height: 1em;
    text-align: right;
    width: 100%;
}

@media (max-width: 900px) {
    body.angemeldet:has(.notiz-seite) #app-content {
        right: 0;
        bottom: calc(52px + 38vh);
    }

    body.angemeldet.chat-zugeklappt:has(.notiz-seite) #app-content {
        right: 0;
        bottom: calc(52px + 3rem);
    }

    .notiz-kachel {
        width: 200px;
    }
}

/* Nutzerverwaltung (Admin) */
.nutzer-seite {
    max-width: 1100px;
    margin: 0 auto;
    text-align: left;
}

.nutzer-seite-hinweis {
    color: #bbb;
    font-size: 0.92rem;
    margin: 0 0 1.25rem;
}

.nutzer-raster {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.nutzer-leer {
    color: #999;
    grid-column: 1 / -1;
}

.nutzer-kachel {
    background: rgba(22, 22, 22, 0.72);
    border: 2px solid rgba(120, 120, 120, 0.55);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    backdrop-filter: blur(4px);
}

.nutzer-kachel.is-inaktiv {
    opacity: 0.72;
}

.nutzer-kachel.is-hauptadmin {
    border-color: rgba(200, 170, 90, 0.85);
}

.nutzer-kachel-kopf {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.nutzer-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(60, 60, 60, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    color: #ddd;
    font-weight: bold;
    font-size: 1.1rem;
}

.nutzer-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nutzer-kachel-titel {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.nutzer-name {
    font-size: 1.05rem;
    color: #f0f0f0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nutzer-status {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.nutzer-status.is-aktiv {
    color: #8fd89a;
}

.nutzer-status.is-gesperrt {
    color: #ffb3b3;
}

.nutzer-meta {
    margin: 0 0 0.85rem;
    display: grid;
    gap: 0.45rem;
}

.nutzer-meta > div {
    display: grid;
    grid-template-columns: 7.5rem 1fr;
    gap: 0.35rem;
    align-items: center;
}

.nutzer-meta dt {
    margin: 0;
    font-size: 0.75rem;
    color: #999;
}

.nutzer-meta dd {
    margin: 0;
    font-size: 0.88rem;
    color: #e6e6e6;
    word-break: break-word;
}

.nutzer-rang {
    width: 100%;
    max-width: 100%;
    border: 1px solid rgba(100, 100, 100, 0.7);
    border-radius: 4px;
    background: rgba(10, 10, 10, 0.7);
    color: #eee;
    font: inherit;
    font-size: 0.85rem;
    padding: 0.25rem 0.35rem;
}

.nutzer-rang-fest {
    color: #e6d39a;
    font-weight: bold;
}

.nutzer-aktionen {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.nutzer-aktionen button {
    border: 1px solid rgba(120, 120, 120, 0.7);
    border-radius: 4px;
    background: rgba(40, 40, 40, 0.85);
    color: #eee;
    font: inherit;
    font-size: 0.78rem;
    padding: 0.3rem 0.6rem;
    cursor: pointer;
}

.nutzer-sperren:hover,
.nutzer-entsperren:hover {
    background: rgba(50, 70, 90, 0.95);
}

.nutzer-loeschen {
    color: #ffc0c0 !important;
}

.nutzer-loeschen:hover {
    background: rgba(90, 35, 35, 0.95) !important;
}

.nutzer-geschuetzt-hinweis {
    font-size: 0.78rem;
    color: #cbb87a;
}

/* Profilbearbeitung */
.profil-seite {
    max-width: 480px;
    margin: 0 auto;
}

.profil-box {
    background: rgba(26, 26, 26, 0.72);
    border: 2px solid rgba(80, 80, 80, 0.65);
    border-radius: 10px;
    padding: 1.25rem 1.35rem;
    backdrop-filter: blur(4px);
    text-align: left;
}

.profil-box h1 {
    margin: 0 0 0.35rem;
    font-size: 1.35rem;
}

.profil-hinweis {
    margin: 0 0 1.15rem;
    font-size: 0.85rem;
    color: #aaa;
}

.profil-feld {
    display: block;
    margin-bottom: 1rem;
}

.profil-label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
    color: #bbb;
}

.profil-feld input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.55rem 0.65rem;
    border: 1px solid #444;
    border-radius: 4px;
    background: #111;
    color: #eee;
    font: inherit;
}

.profil-feld input:focus {
    outline: none;
    border-color: #6a8aa8;
}

.profil-feld-readonly strong {
    display: block;
    color: #eee;
    font-size: 0.98rem;
}

.profil-feld-meta {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.75rem;
    color: #888;
}

.profil-status {
    display: block;
    min-height: 1.1em;
    margin-top: 0.25rem;
    font-size: 0.78rem;
    color: #999;
}

.profil-status.is-ok {
    color: #8fd89a;
}

.profil-status.is-error {
    color: #ffb3b3;
}

.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    margin-right: 0.4rem;
    vertical-align: -0.25rem;
    overflow: hidden;
    background: rgba(60, 60, 60, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.35);
    font-size: 0.7rem;
    font-weight: bold;
    color: #ddd;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.user-avatar-initial,
.profil-avatar-initial {
    line-height: 1;
}

.user-color-chip {
    display: inline-block;
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 50%;
    margin-right: 0.4rem;
    vertical-align: -0.1rem;
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
    font-size: 0;
    color: transparent;
    overflow: hidden;
}

.profil-bild-row {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.profil-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(50, 50, 50, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: bold;
    color: #ddd;
}

.profil-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profil-bild-aktionen {
    min-width: 0;
}

.profil-bild-upload-btn {
    display: inline-block;
    padding: 0.4rem 0.75rem;
    border-radius: 4px;
    background: #444;
    color: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
}

.profil-bild-upload-btn:hover {
    background: #555;
}

.profil-bild-entfernen {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid rgba(140, 80, 80, 0.7);
    border-radius: 4px;
    background: transparent;
    color: #ffb3b3;
    cursor: pointer;
    font: inherit;
    font-size: 0.85rem;
}

.profil-bild-entfernen:hover {
    background: rgba(90, 35, 35, 0.55);
}

.profil-farbe-feld .profil-feld-meta {
    margin-bottom: 0.5rem;
}

.profile-color-wheel-wrap {
    position: relative;
    width: min(260px, 100%);
    margin: 0.5rem auto 0.35rem;
    aspect-ratio: 1;
}

.profile-color-wheel-canvas {
    display: block;
    width: 100%;
    height: auto;
    cursor: crosshair;
    touch-action: none;
    border-radius: 50%;
}

.profile-color-wheel-marker {
    position: absolute;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), 0 1px 4px rgba(0, 0, 0, 0.45);
    pointer-events: none;
}

.profile-color-current {
    margin: 0.5rem 0 0;
    color: #aaa;
    font-size: 0.88rem;
    text-align: center;
}

.profile-color-current-chip {
    display: inline-block;
    min-width: 5.5em;
    padding: 2px 8px;
    border-radius: 4px;
    color: #111;
    font-weight: bold;
    font-size: 0.85rem;
    vertical-align: middle;
}
