/* ================================================================
   SONGBILDER – zentrales Stylesheet
   Warme, angenehme Farbwelt + Pergament-Optik
   ================================================================ */

:root {
    --warm-50:  #fdf8ee;
    --warm-100: #f7ecd6;
    --warm-200: #efdcb4;
    --warm-300: #e3c489;
    --warm-400: #d3a45c;
    --warm-500: #c1893f;
    --warm-600: #a86f2f;
    --warm-700: #8a5726;
    --warm-800: #6b4420;
    --warm-900: #4a2f18;

    --accent-500: #c1552c;
    --accent-600: #a8431f;

    --ink: #4a2f18;
    --ink-soft: #6b5238;
    --paper: #fbf3e2;

    --danger-500: #b3492f;
    --danger-600: #963b25;

    --success-500: #4c7a4f;
}

* { box-sizing: border-box; }

body {
    font-family: 'Georgia', 'Iowan Old Style', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--ink);
    min-height: 100vh;
    background-color: var(--warm-100);
    background-image:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.35), transparent 45%),
        radial-gradient(circle at 80% 0%, rgba(193, 137, 63, 0.18), transparent 40%),
        radial-gradient(circle at 50% 100%, rgba(168, 111, 47, 0.15), transparent 45%),
        linear-gradient(135deg, #f3e4c2 0%, #e9d1a0 45%, #ddbd85 100%);
}

/* ---------- Pergament-Fläche (für Home / Dokument-Inhalte) ---------- */
.parchment {
    position: relative;
    background-color: #f3e6c6;
    background-image:
        repeating-linear-gradient(0deg, rgba(139, 94, 42, 0.035) 0px, rgba(139, 94, 42, 0.035) 1px, transparent 1px, transparent 3px),
        radial-gradient(ellipse at top left, rgba(255, 250, 235, 0.6), transparent 55%),
        radial-gradient(ellipse at bottom right, rgba(139, 94, 42, 0.12), transparent 55%),
        radial-gradient(ellipse at 30% 90%, rgba(139, 94, 42, 0.10), transparent 50%),
        linear-gradient(160deg, #f6ead0 0%, #eddcb2 55%, #e4cd9c 100%);
    border: 1px solid rgba(139, 94, 42, 0.25);
    box-shadow:
        inset 0 0 60px rgba(139, 94, 42, 0.18),
        inset 0 0 3px rgba(139, 94, 42, 0.35),
        0 10px 30px rgba(74, 47, 24, 0.18);
}

.parchment-content {
    font-family: 'Georgia', 'Iowan Old Style', serif;
    color: var(--ink);
    line-height: 1.75;
}
.parchment-content h1, .parchment-content h2, .parchment-content h3 {
    font-family: 'Georgia', serif;
    color: var(--warm-800);
}
.parchment-content h1 { font-size: 2.1rem; font-weight: 800; margin-bottom: .25rem; }
.parchment-content h2 { font-size: 1.5rem; font-weight: 700; margin-top: 1.75rem; margin-bottom: .5rem; }
.parchment-content h3 { font-size: 1.2rem; font-weight: 700; margin-top: 1.25rem; }
.parchment-content p { margin-bottom: .65rem; }
.parchment-content .em-line { font-style: italic; color: var(--ink-soft); }
.parchment-content .quote-line {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-600);
    text-align: center;
    margin: 1.25rem 0;
}
.parchment-content hr {
    border: none;
    border-top: 1px dashed rgba(139, 94, 42, 0.4);
    margin: 1.75rem 0;
}
.parchment-content .lead {
    font-size: 1.15rem;
    color: var(--ink);
}

/* ---------- Glass / Karten ---------- */
.glass-card {
    backdrop-filter: blur(14px) saturate(160%);
    background-color: rgba(255, 250, 240, 0.72);
    border: 1px solid rgba(193, 137, 63, 0.3);
}

/* ---------- Header / Navigation (zentriert) ---------- */
.site-header {
    background-color: rgba(255, 248, 232, 0.82);
    backdrop-filter: blur(14px) saturate(160%);
    border-bottom: 1px solid rgba(193, 137, 63, 0.3);
}
.header-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
}
.header-logo {
    justify-self: start;
    display: flex;
    align-items: center;
    gap: .75rem;
}
.header-logo img {
    height: 42px;
    max-width: 160px;
    object-fit: contain;
}
.header-logo-text {
    font-family: Georgia, serif;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--warm-800);
    letter-spacing: .03em;
}
.header-nav {
    justify-self: center;
    display: flex;
    align-items: center;
    gap: .25rem;
    flex-wrap: wrap;
    justify-content: center;
}
.header-action {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: .6rem;
}
.lang-switch {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--ink-soft);
}
.lang-switch a {
    color: var(--ink-soft);
    text-decoration: none;
    padding: 0.2rem 0.3rem;
    border-radius: 0.3rem;
    transition: color .2s, background .2s;
}
.lang-switch a:hover { color: var(--warm-800); }
.lang-switch a.active {
    color: var(--accent-600);
    background: rgba(193, 137, 63, 0.15);
}
.lang-switch span { color: rgba(193, 137, 63, 0.5); }

/* ---------- Anmelden/Mitmachen-Dropdown ---------- */
.auth-dropdown { position: relative; }
.auth-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fffaf0;
    border: 1px solid rgba(193, 137, 63, 0.3);
    border-radius: 0.6rem;
    box-shadow: 0 10px 30px rgba(74, 47, 24, 0.25);
    min-width: 170px;
    padding: .4rem;
    z-index: 70;
}
.auth-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem .7rem;
    border-radius: .5rem;
    color: var(--ink-soft);
    font-weight: 600;
    font-size: .875rem;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.auth-dropdown-menu a:hover {
    background: rgba(193, 137, 63, 0.15);
    color: var(--warm-800);
}
.auth-dropdown-menu a i { width: 1.1rem; text-align: center; color: var(--accent-600); }

@media (max-width: 820px) {
    /* Gemeinsame Basis für alle mobilen Breiten */
    .header-username { display: none; }
    .header-logo img { height: 30px; max-width: 90px; }
    .header-logo-text { font-size: .95rem; }

    /* Nur Icons zeigen, Text bleibt für Screenreader/Tooltip erhalten */
    .nav-link-text {
        position: absolute;
        width: 1px; height: 1px;
        padding: 0; margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
    .nav-link { padding: .5rem .55rem; flex-shrink: 0; }
    .nav-link i { font-size: .8rem; }
    .header-action .btn { padding: .5rem .6rem; flex-shrink: 0; }
    .px-6 { padding-left: .5rem; padding-right: .5rem; }

    /* Eigenes Tooltip: erscheint bei Hover (Desktop-Breite trotzdem möglich)
       und kurz bei Touch (siehe Skript in _header.html) */
    [data-tooltip] { position: relative; }
    [data-tooltip]::after {
        content: attr(data-tooltip);
        position: absolute;
        top: calc(100% + 8px);
        left: 50%;
        transform: translateX(-50%) translateY(-4px);
        background: var(--warm-800);
        color: #fff;
        font-size: .68rem;
        font-weight: 600;
        padding: .35rem .6rem;
        border-radius: .4rem;
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        transition: opacity .15s ease, transform .15s ease;
        z-index: 60;
        box-shadow: 0 4px 10px rgba(0,0,0,.2);
    }
    [data-tooltip]:hover::after,
    [data-tooltip].show-tooltip::after {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Mittlere Breite (Tablet/große Handys quer): eine Zeile, Nav mittig statt links gepackt */
@media (max-width: 820px) and (min-width: 561px) {
    .header-grid {
        grid-template-columns: auto minmax(0, 1fr) auto;
        column-gap: .4rem;
    }
    .header-logo { justify-self: start; min-width: 0; }
    .header-nav {
        justify-self: stretch;
        min-width: 0;
        gap: .35rem;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
        justify-content: center;
    }
    .header-nav::-webkit-scrollbar { display: none; }
    .header-action { justify-self: end; gap: .3rem; flex-shrink: 0; }
}

/* Sehr schmal (Handy hochkant): Logo + Anmelden oben in einer Zeile,
   Navigation darunter als eigene, zentrierte Zeile - wirkt deutlich aufgeräumter */
@media (max-width: 560px) {
    .header-grid {
        grid-template-columns: 1fr auto 1fr;
        grid-template-areas:
            ". logo auth"
            "nav nav nav";
        row-gap: .5rem;
        column-gap: .3rem;
    }
    .header-logo { grid-area: logo; justify-self: center; min-width: 0; }
    .header-action { grid-area: auth; justify-self: end; gap: .3rem; flex-shrink: 0; }
    .header-nav {
        grid-area: nav;
        justify-self: stretch;
        min-width: 0;
        gap: .3rem;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        -ms-overflow-style: none;
        -webkit-overflow-scrolling: touch;
        justify-content: center;
        padding-bottom: .2rem;
    }
    .header-nav::-webkit-scrollbar { display: none; }
}

@media (max-width: 420px) {
    .lang-switch { display: none; }
}

.nav-link {
    color: var(--ink-soft);
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.6rem;
    transition: background 0.2s, color .2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}
.nav-link:hover {
    background: rgba(193, 137, 63, 0.18);
    color: var(--warm-800);
}
.nav-link.current {
    background: linear-gradient(to right, var(--warm-500), var(--accent-500));
    color: #fff;
    box-shadow: 0 3px 10px rgba(161, 100, 43, 0.35);
}

/* ---------- Buttons ---------- */
.btn {
    padding: 0.55rem 1.1rem;
    border-radius: 0.6rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    cursor: pointer;
    border: none;
}
.btn-primary {
    background: linear-gradient(to right, var(--warm-500), var(--accent-500));
    color: #fff;
    box-shadow: 0 4px 10px rgba(161, 100, 43, 0.3);
}
.btn-primary:hover {
    background: linear-gradient(to right, var(--warm-600), var(--accent-600));
}
.btn-secondary {
    background: #fffaf0;
    color: var(--ink-soft);
    border: 1px solid rgba(193, 137, 63, 0.4);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.btn-secondary:hover { background: var(--warm-50); }
.btn-danger {
    background: linear-gradient(to right, var(--danger-500), var(--danger-600));
    color: #fff;
}
.btn-danger:hover {
    background: linear-gradient(to right, var(--danger-600), #7c2f1c);
}

/* ---------- Modal ---------- */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(74, 47, 24, 0.55);
    backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}
.modal.open { display: flex; }
#tileForm {
    max-height: 80vh;
    overflow: auto;
}
.footer-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--ink-soft);
    font: inherit;
    cursor: pointer;
    text-decoration: none;
}
.footer-link:hover { text-decoration: underline; }
.avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(74, 47, 24, 0.2);
}

/* ---------- Formulare ---------- */
.input-group { position: relative; margin-bottom: 1rem; }
.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(193, 137, 63, 0.45);
    border-radius: 0.5rem;
    background: #fffdf7;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
}
.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--warm-500);
    box-shadow: 0 0 0 3px rgba(193, 137, 63, 0.18);
}
.input-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: 0.3rem;
}

/* Veröffentlichen-Schalter steht VOR dem Feld */
.field-publish {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.35rem;
}
.field-publish input[type="checkbox"] {
    width: 1.15rem;
    height: 1.15rem;
    accent-color: var(--warm-500);
    cursor: pointer;
}
.field-publish label {
    margin-bottom: 0;
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--ink-soft);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.file-drop {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem;
    border: 1px dashed rgba(193, 137, 63, 0.5);
    border-radius: .6rem;
    background: #fffdf7;
}
.file-drop img, .file-drop .file-drop-placeholder {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: .5rem;
    background: #fff;
    border: 1px solid rgba(193, 137, 63, 0.3);
}
.file-drop .file-drop-placeholder {
    display: flex; align-items: center; justify-content: center;
    color: var(--warm-400); font-size: 1.3rem;
}
.file-drop input[type="file"] { flex: 1; font-size: .8rem; }

/* ---------- Floating Action ---------- */
.floating-action {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--warm-500), var(--accent-500));
    color: #fff;
    border: none;
    box-shadow: 0 8px 25px rgba(161, 100, 43, 0.45);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 40;
}
.floating-action:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(161, 100, 43, 0.6);
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.slide-up { animation: slideUp 0.3s ease; }

/* ---------- Sidebar-Navigation (App) ---------- */
.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--ink-soft);
    font-weight: 600;
}
.nav-item:hover { background: rgba(193, 137, 63, 0.15); }
.nav-item.active {
    background: linear-gradient(to right, var(--warm-500), var(--accent-500));
    color: #fff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.nav-item i { width: 1.5rem; text-align: center; }

/* ---------- Unterstützer-Kacheln ---------- */
.supporter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}
.supporter-tile {
    position: relative;
    overflow: hidden;
    background: rgba(255, 250, 240, 0.75);
    backdrop-filter: blur(8px);
    border-radius: 1rem;
    padding: 1.5rem 1rem;
    text-align: center;
    border: 1px solid rgba(193, 137, 63, 0.3);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(74, 47, 24, 0.07);
}
.supporter-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(74, 47, 24, 0.14);
}
.supporter-tile .logo, .supporter-tile .extra-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin: 0 auto 0.75rem;
    border-radius: 12px;
    background: #fff;
    padding: 0.5rem;
    box-shadow: 0 2px 8px rgba(74, 47, 24, 0.1);
}
.supporter-tile .extra-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    padding: 0;
}
.supporter-tile .company {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--warm-800);
    margin-bottom: 0.25rem;
}
.supporter-tile .description {
    font-size: 0.875rem;
    color: var(--ink-soft);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.supporter-tile .homepage a {
    color: var(--accent-600);
    text-decoration: none;
    font-size: 0.875rem;
    word-break: break-all;
}
.supporter-tile .homepage a:hover { text-decoration: underline; }

/* ---------- Songbilder-Kacheln (Bild + Hover-Overlay) ---------- */
.songbilder-tile {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid rgba(193, 137, 63, 0.3);
    box-shadow: 0 4px 12px rgba(74, 47, 24, 0.08);
    transition: box-shadow .3s ease, transform .3s ease;
    background: rgba(255, 250, 240, 0.8);
}
.songbilder-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(74, 47, 24, 0.16);
}
.songbilder-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: filter .4s ease, transform .5s ease;
    filter: grayscale(0%) brightness(1);
}
.songbilder-tile:hover img,
.songbilder-tile.touch-active img {
    filter: grayscale(85%) brightness(0.45);
    transform: scale(1.06);
}
.songbilder-tile-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity .35s ease;
}
.songbilder-tile:hover .songbilder-tile-overlay,
.songbilder-tile.touch-active .songbilder-tile-overlay {
    opacity: 1;
    pointer-events: auto;
}
.songbilder-tile-overlay h3 {
    font-family: Georgia, serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: #fff;
    margin-bottom: .5rem;
    text-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.songbilder-tile-overlay p {
    font-size: .9rem;
    color: rgba(255,255,255,.92);
    margin-bottom: 1rem;
    text-shadow: 0 1px 4px rgba(0,0,0,.5);
}
.songbilder-tile-overlay a.yt-link,
.songbilder-tile-overlay button.yt-link {
    background: linear-gradient(to right, var(--warm-500), var(--accent-500));
    color: #fff;
    font-weight: 600;
    font-size: .85rem;
    text-decoration: none;
    padding: .55rem 1.3rem;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    box-shadow: 0 4px 10px rgba(0,0,0,.35);
    transition: transform .2s ease;
}
.songbilder-tile-overlay a.yt-link:hover,
.songbilder-tile-overlay button.yt-link:hover { transform: translateY(-2px); }

/* ---------- News ---------- */
.news-item {
    background: rgba(255, 250, 240, 0.78);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid rgba(193, 137, 63, 0.3);
    box-shadow: 0 4px 12px rgba(74, 47, 24, 0.07);
    margin-bottom: 1.25rem;
}
.news-item h3 { font-weight: 700; font-size: 1.2rem; color: var(--warm-800); margin-bottom: .25rem; }
.news-item .news-date { font-size: .8rem; color: var(--ink-soft); margin-bottom: .6rem; }
.news-item .news-content { color: var(--ink); line-height: 1.65; }

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; cursor: pointer; inset: 0;
    background-color: #d8c4a0;
    transition: .3s;
    border-radius: 999px;
}
.toggle-slider:before {
    position: absolute; content: "";
    height: 20px; width: 20px; left: 3px; bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}
.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(to right, var(--warm-500), var(--accent-500));
}
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(20px); }

.visitor-counter {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 250, 240, 0.6);
    backdrop-filter: blur(4px);
    padding: 0.5rem 1.5rem;
    border-radius: 9999px;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--warm-800);
    border: 1px solid rgba(193, 137, 63, 0.3);
}
.visitor-counter i { color: var(--accent-600); }

/* ---------- Visionen-Kacheln ---------- */
.vision-tile {
    background: rgba(255, 250, 240, 0.8);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid rgba(193, 137, 63, 0.3);
    box-shadow: 0 4px 12px rgba(74, 47, 24, 0.08);
    transition: all .3s ease;
}
.vision-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(74, 47, 24, 0.16);
}
.vision-tile-header {
    text-align: center;
}
.vision-tile-header h3 {
    font-family: Georgia, serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--warm-800);
    margin-bottom: 0;
}
.vision-tile-collapse {
    max-height: 0;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
    transition: max-height 0.4s ease, padding 0.4s ease;
}
.vision-tile-content {
    color: var(--ink);
    line-height: 1.7;
}
.vision-tile-content p { margin-bottom: .5rem; }
.vision-tile-footer {
    margin-top: 0.75rem;
    text-align: center;
}
.vision-tile-btn {
    background: linear-gradient(to right, var(--warm-500), var(--accent-500));
    color: #fff;
    border: none;
    padding: 0.55rem 1.4rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(161, 100, 43, 0.3);
    transition: background 0.2s, transform 0.2s;
}
.vision-tile-btn:hover {
    background: linear-gradient(to right, var(--warm-600), var(--accent-600));
    transform: translateY(-1px);
}

/* ---------- Patenschafts-Badge (Fahne/Ribbon oben links) ---------- */
.patron-badge-wrap {
    position: absolute;
    top: 0;
    left: 0;
    width: 130px;
    height: 130px;
    overflow: hidden;
    z-index: 5;
    pointer-events: none;
}
.patron-badge {
    position: absolute;
    top: 28px;
    left: -48px;
    width: 175px;
    transform: rotate(-45deg);
    text-align: center;
    background: linear-gradient(to right, var(--accent-500), var(--accent-600));
    color: #fff;
    font-size: 0.52rem;
    font-weight: 500;
    padding: 5px 4px;
    box-shadow: 0 2px 8px rgba(74, 47, 24, 0.35);
    letter-spacing: .01em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- HTML-Quellcode-Editor (Dual-Mode neben Quill) ---------- */
.raw-html-editor {
    width: 100%;
    min-height: 140px;
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 0.8rem;
    padding: 0.75rem;
    border: 1px solid rgba(193, 137, 63, 0.45);
    border-radius: 0.5rem;
    background: #fffdf7;
    color: var(--ink);
}
.editor-toggle-btn {
    font-size: 0.75rem;
    padding: 0.35rem 0.7rem;
    margin-bottom: 0.5rem;
}

/* ---------- Quill Rich-Text-Editor ---------- */
.quill-editor {
    background: #fffdf7;
    border-radius: 0.5rem;
    overflow: auto;
    max-height: 500px;
    min-height: 160px;
    border: 1px solid rgba(193, 137, 63, 0.3);
}
.ql-toolbar.ql-snow {
    border-color: rgba(193, 137, 63, 0.45) !important;
    background: var(--warm-50);
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}
.ql-container.ql-snow {
    border-color: rgba(193, 137, 63, 0.45) !important;
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
    font-family: 'Georgia', serif;
    min-height: 140px;
    font-size: 1rem;
    color: var(--ink);
}
.ql-editor.ql-blank::before {
    color: var(--ink-soft);
    font-style: normal;
}

.page { display: none; }
.page.active { display: block; }
.hidden { display: none !important; }

/* ---------- Eigenes Dialog-Modal (ersetzt alert/confirm/prompt) ---------- */
.app-dialog-box {
    background-color: #fffaf0;
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(74, 47, 24, 0.35);
    width: 100%;
    max-width: 420px;
    margin: 0 1rem;
    padding: 1.75rem;
}
.app-dialog-icon {
    width: 48px; height: 48px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem;
    margin: 0 auto 1rem;
    color: #fff;
}
.app-dialog-icon.info { background: linear-gradient(135deg, var(--warm-500), var(--accent-500)); }
.app-dialog-icon.danger { background: linear-gradient(135deg, var(--danger-500), var(--danger-600)); }
.app-dialog-title {
    font-family: Georgia, serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--warm-800);
    text-align: center;
    margin-bottom: .5rem;
}
.app-dialog-message {
    font-size: .9rem;
    color: var(--ink);
    text-align: center;
    margin-bottom: 1.25rem;
    white-space: pre-wrap;
}
.app-dialog-input {
    width: 100%;
    padding: .65rem .9rem;
    border: 1px solid rgba(193, 137, 63, .45);
    border-radius: .5rem;
    background: #fffdf7;
    margin-bottom: 1.25rem;
}
.app-dialog-actions {
    display: flex;
    gap: .75rem;
    justify-content: center;
}

/* ---------- Accordion (Home/Archiv) ---------- */
.accordion-item {
    border-bottom: 1px dashed rgba(139, 94, 42, 0.4);
}
.accordion-item:last-child { border-bottom: none; }
.accordion-item:first-child .accordion-trigger { border-top-left-radius: 1rem; border-top-right-radius: 1rem; }
.accordion-item:last-child .accordion-panel { border-bottom-left-radius: 1rem; border-bottom-right-radius: 1rem; }
.accordion-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 1.15rem 1.5rem;
    font-family: Georgia, serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--warm-800);
    text-align: left;
    transition: color .2s ease;
}
.accordion-trigger:hover { color: var(--accent-600); }
.accordion-icon {
    flex-shrink: 0;
    color: var(--accent-600);
    transition: transform .3s ease;
}
.accordion-item.open .accordion-trigger { color: var(--accent-600); }
.accordion-item.open .accordion-icon { transform: rotate(180deg); }
.accordion-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height .4s ease;
}
.accordion-panel-inner {
    padding: 0 1.5rem 1.5rem;
    line-height: 1.75;
    color: var(--ink);
}
.accordion-panel-inner p { margin-bottom: .65rem; }

/* ---------- Statistik-Balken ---------- */
.stat-bar-list {
    display: grid;
    grid-template-columns: max-content 1fr max-content;
    column-gap: .75rem;
    row-gap: .55rem;
    align-items: center;
    font-size: .875rem;
}
.stat-bar-label {
    color: var(--ink);
    white-space: nowrap;
}
.stat-bar-track {
    height: 10px;
    background: rgba(193, 137, 63, 0.15);
    border-radius: 999px;
    overflow: hidden;
}
.stat-bar-fill {
    height: 100%;
    background: linear-gradient(to right, var(--warm-500), var(--accent-500));
    border-radius: 999px;
}
.stat-bar-count {
    text-align: right;
    font-weight: 700;
    color: var(--warm-800);
}

/* ---------- Passwort-Eingabe mit Auge-Toggle + Stärkeanzeige ---------- */
.password-field-wrap { position: relative; }
.password-field-wrap input { padding-right: 2.75rem !important; }
.password-toggle-eye {
    position: absolute;
    right: .75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--ink-soft);
    padding: .25rem;
}
.password-toggle-eye:hover { color: var(--warm-800); }
.password-strength-bar {
    height: 5px;
    border-radius: 3px;
    background: #e8dcc4;
    margin-top: .4rem;
    overflow: hidden;
}
.password-strength-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    transition: width .25s ease, background .25s ease;
}
.password-strength-label {
    font-size: .72rem;
    margin-top: .25rem;
    font-weight: 600;
}
.drag-handle {
    cursor: grab;
    color: var(--warm-400);
    padding: 0 .5rem;
    touch-action: none;
}
.drag-handle:active { cursor: grabbing; }
[data-sortable-item].dragging {
    opacity: 0.4;
}
[data-sortable-item] {
    transition: transform .15s ease;
}
