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

body {
    font-family: Georgia, 'Times New Roman', serif;
    background: #f5f0eb;
    color: #2c2c2c;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Header ───────────────────────────────────────────── */
header {
    background: #3b2f20;
    color: #f5f0eb;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 6px rgba(0,0,0,.4);
}

.header-top {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 2rem;
    height: 64px;
}

.header-banner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 0;
}

.banner-title {
    font-size: 1.5rem;
    color: #e8d9c4;
    font-weight: normal;
    font-style: italic;
    line-height: 1.35;
    max-width: 60%;
}

.header-banner img {
    max-height: 180px;
    width: auto;
    flex-shrink: 0;
}

.site-name {
    font-size: 1.25rem;
    font-weight: bold;
    letter-spacing: .03em;
    white-space: nowrap;
    color: #e8d9c4;
}

nav { flex: 1; }

nav ul {
    list-style: none;
    display: flex;
    gap: .25rem;
    flex-wrap: wrap;
}

nav ul li a {
    display: block;
    padding: .45rem .9rem;
    color: #d4c4a8;
    text-decoration: none;
    border-radius: 4px;
    font-size: .95rem;
    transition: background .15s, color .15s;
}

nav ul li a:hover {
    background: #5a4430;
    color: #fff;
}

nav ul li a.active {
    background: #8b6340;
    color: #fff;
}

.header-right {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-shrink: 0;
}

.logout-btn {
    background: transparent;
    border: 1px solid #8b6340;
    color: #d4c4a8;
    padding: .35rem .8rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: .875rem;
    white-space: nowrap;
    transition: background .15s, color .15s;
}

.logout-btn:hover {
    background: #8b6340;
    color: #fff;
}

/* Burger – desktop: versteckt */
.burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: .35rem;
    border-radius: 4px;
    width: 38px;
    height: 38px;
}

.burger span {
    display: block;
    height: 2px;
    background: #d4c4a8;
    border-radius: 2px;
    transition: transform .25s, opacity .25s;
}

.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile-only Abmelden-Link in der Nav */
.nav-mobile-logout { display: none; }

/* ── Main ─────────────────────────────────────────────── */
main {
    flex: 1;
    padding: 2.5rem 1.5rem;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

h1 {
    font-size: 2rem;
    color: #3b2f20;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid #c5a97a;
    padding-bottom: .5rem;
}

p {
    line-height: 1.75;
    margin-bottom: 1rem;
}

/* ── Login form ───────────────────────────────────────── */
.login-card {
    background: #fff;
    border: 1px solid #d4c4a8;
    border-radius: 8px;
    padding: 2rem;
    max-width: 420px;
    margin: 2rem auto;
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
}

.login-card h1 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.1rem;
}

.form-group label {
    display: block;
    font-size: .9rem;
    margin-bottom: .35rem;
    color: #5a4430;
}

.form-group input {
    width: 100%;
    padding: .6rem .85rem;
    border: 1px solid #c5a97a;
    border-radius: 4px;
    font-size: 1rem;
    background: #fdfaf6;
    color: #2c2c2c;
    transition: border-color .15s, box-shadow .15s;
}

.form-group input:focus {
    outline: none;
    border-color: #8b6340;
    box-shadow: 0 0 0 3px rgba(139,99,64,.18);
}

.btn-primary {
    width: 100%;
    padding: .7rem;
    background: #8b6340;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background .15s;
    margin-top: .5rem;
}

.btn-primary:hover {
    background: #6b4c30;
}

.alert-error {
    background: #fdecea;
    border: 1px solid #e57373;
    color: #b71c1c;
    padding: .7rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: .9rem;
}

/* ── Alerts ───────────────────────────────────────────── */
.alert-success {
    background: #eaf6ec;
    border: 1px solid #81c784;
    color: #1b5e20;
    padding: .7rem 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    font-size: .9rem;
}

/* ── Kontaktliste Tabelle ─────────────────────────────── */
.table-wrap {
    overflow-x: auto;
    margin-bottom: 2.5rem;
}

.kontakt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .92rem;
}

.kontakt-table th,
.kontakt-table td {
    padding: .55rem .85rem;
    text-align: left;
    border-bottom: 1px solid #d4c4a8;
}

.kontakt-table th {
    background: #3b2f20;
    color: #e8d9c4;
    font-weight: normal;
    letter-spacing: .02em;
}

.kontakt-table tbody tr:nth-child(even) {
    background: #faf5ee;
}

.kontakt-table tbody tr:hover {
    background: #f0e6d6;
}

.kontakt-table a {
    color: #8b6340;
}

.td-actions {
    white-space: nowrap;
    display: flex;
    gap: .4rem;
    align-items: center;
    padding: .35rem .85rem;
}

.td-actions form {
    margin: 0;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: .2rem;
    cursor: pointer;
    border-radius: 3px;
    transition: background .15s;
    text-decoration: none;
}

.icon-btn:hover {
    background: rgba(0,0,0,.08);
}

.row-editing {
    background: #fff8e8 !important;
    outline: 2px solid #c5a97a;
}

.edit-hint {
    font-size: .9rem;
    color: #5a4430;
    margin-bottom: 1rem;
}

.edit-hint a {
    color: #8b6340;
    margin-left: .5rem;
}

/* ── Kontakt-Formular ─────────────────────────────────── */
.kontakt-form-section {
    margin-top: 1rem;
    border-top: 2px solid #c5a97a;
    padding-top: 1.5rem;
}

.kontakt-form-section h2 {
    font-size: 1.25rem;
    color: #3b2f20;
    margin-bottom: 1.25rem;
}

.kontakt-form {
    max-width: 750px;
}

.form-row {
    display: flex;
    gap: 1rem;
}

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

.form-group--plz {
    flex: 0 0 120px !important;
}

.required { color: #b71c1c; }

.required-note {
    font-size: .8rem;
    color: #7a6050;
    margin-bottom: .75rem;
}

.btn-submit {
    width: auto;
    padding: .65rem 2rem;
}

/* ── Benutzerverwaltung ───────────────────────────────── */
.uv-table .td-pass {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-family: monospace;
    font-size: .9rem;
}

.btn-toggle-pass {
    background: none;
    border: none;
    cursor: pointer;
    color: #8b6340;
    padding: .1rem .2rem;
    line-height: 1;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
}

.btn-toggle-pass:hover { background: rgba(0,0,0,.07); }

.input-readonly {
    background: #ede8e0 !important;
    color: #7a6a58 !important;
    cursor: not-allowed;
}

/* ── File Browser ────────────────────────────────────── */
.fb-breadcrumb {
    font-size: .9rem;
    margin-bottom: 1rem;
    color: #5a4430;
}

.fb-breadcrumb a {
    color: #8b6340;
    text-decoration: none;
}

.fb-breadcrumb a:hover { text-decoration: underline; }

.fb-sep {
    margin: 0 .35rem;
    color: #b0967a;
}

.fb-listing {
    border: 1px solid #d4c4a8;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.fb-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .5rem .9rem;
    border-bottom: 1px solid #ede5d8;
    font-size: .92rem;
}

.fb-entry:last-child { border-bottom: none; }

.fb-entry--up    { background: #fdfaf6; }
.fb-entry--folder { background: #faf5ee; }
.fb-entry--file  { background: #fff; }

.fb-entry:hover { background: #f0e6d6; }

.fb-link {
    display: flex;
    align-items: center;
    gap: .45rem;
    color: #3b2f20;
    text-decoration: none;
    flex: 1;
}

.fb-link:hover { color: #8b6340; }

.fb-meta {
    font-size: .8rem;
    color: #9a836a;
    white-space: nowrap;
    margin-left: 1rem;
}

.fb-empty {
    padding: 1.25rem .9rem;
    color: #9a836a;
    font-style: italic;
}

.fb-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: .5rem;
}

.fb-panel {
    flex: 1;
    min-width: 260px;
    border: 1px solid #d4c4a8;
    border-radius: 6px;
    overflow: hidden;
}

.fb-panel summary {
    padding: .6rem 1rem;
    background: #3b2f20;
    color: #e8d9c4;
    cursor: pointer;
    font-size: .9rem;
    user-select: none;
    list-style: none;
}

.fb-panel summary::-webkit-details-marker { display: none; }

.fb-panel summary::before {
    content: '+ ';
    font-weight: bold;
}

.fb-panel[open] summary::before { content: '− '; }

.fb-panel[open] { background: #fdfaf6; }

.fb-form {
    padding: .9rem 1rem;
}

.fb-form-row {
    display: flex;
    gap: .5rem;
    align-items: center;
}

.fb-form-row input[type="text"],
.fb-form-row input[type="file"] {
    flex: 1;
    padding: .45rem .7rem;
    border: 1px solid #c5a97a;
    border-radius: 4px;
    font-size: .9rem;
    background: #fdfaf6;
}

.btn-sm {
    width: auto;
    padding: .45rem 1rem;
    font-size: .9rem;
    margin-top: 0;
    white-space: nowrap;
}

.fb-hint {
    font-size: .78rem;
    color: #9a836a;
    margin-top: .5rem;
}

/* ── Footer ───────────────────────────────────────────── */
footer {
    background: #3b2f20;
    color: #8b7355;
    text-align: center;
    padding: .75rem 1rem;
    font-size: .85rem;
}
footer a {
    color: #c5a97a;
    text-decoration: none;
}
footer a:hover {
    text-decoration: underline;
}
.impressum a {
    color: #5a4430;
    text-decoration: none;
}
.impressum a:hover {
    text-decoration: underline;
}

/* ── Mobile Navigation ────────────────────────────────── */
@media (max-width: 768px) {
    .burger { display: flex; }

    .logout-btn { display: none; }       /* statt dessen im Menü */
    .nav-mobile-logout { display: block; }

    nav {
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: #2e2416;
        z-index: 200;
        max-height: 0;
        overflow: hidden;
        transition: max-height .3s ease;
    }

    nav.open { max-height: 600px; }

    nav ul {
        flex-direction: column;
        gap: 0;
        padding: .5rem 0;
    }

    nav ul li a {
        padding: .75rem 1.5rem;
        border-radius: 0;
        font-size: 1rem;
    }

    nav ul li a:hover,
    nav ul li a.active {
        background: #8b6340;
    }

    .header-top {
        position: relative;
        gap: 1rem;
    }

    .header-right {
        margin-left: auto;
    }

    .header-banner {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 0;
        padding: .6rem 0 0;
        margin: 0 -1.5rem;
    }

    .banner-title {
        font-size: 1.1rem;
        max-width: 100%;
        padding: .5rem 1rem .6rem;
        text-align: center;
    }

    .header-banner img {
        max-height: none;
        width: 100%;
        height: auto;
        display: block;
        object-fit: cover;
    }
}
