* { box-sizing: border-box; }
body {
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: #f4f5f7;
    color: #1f2430;
    margin: 0;
    padding: 0;
}
.topbar {
    background: #082633;
    color: #fff;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.topbar a { color: #fff; text-decoration: none; margin-left: 16px; font-size: 14px; }
.topbar .brand { font-weight: 600; font-size: 16px; }
.topbar-links { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; row-gap: 6px; }
.topbar-links a { white-space: nowrap; }
.topbar-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
}
.container {
    max-width: 780px;
    margin: 40px auto;
    background: #fff;
    padding: 32px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.container.wide { max-width: 1100px; }
h1, h2 { margin-top: 0; }
label { display: block; margin: 14px 0 4px; font-weight: 600; font-size: 14px; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=time], input[type=tel], select, textarea {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 14px;
}
textarea { min-height: 90px; }
button, .btn {
    display: inline-block;
    background: #0786bd;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    margin-top: 18px;
}
button.secondary, .btn.secondary { background: #6b7280; }
button.danger, .btn.danger { background: #dc2626; }
.flash { padding: 10px 14px; border-radius: 5px; margin-bottom: 16px; font-size: 14px; }
.flash.success { background: #dcfce7; color: #166534; }
.flash.error { background: #fee2e2; color: #991b1b; }
table { width: 100%; border-collapse: collapse; margin-top: 12px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #e5e7eb; font-size: 14px; }
th { background: #f9fafb; }
.badge { padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.badge.pending { background: #fef9c3; color: #854d0e; }
.badge.active { background: #dcfce7; color: #166534; }
.badge.locked { background: #fee2e2; color: #991b1b; }
.captcha-row { display: flex; align-items: center; gap: 12px; }
.hint { font-size: 12px; color: #6b7280; }
.nav-tabs { margin-bottom: 20px; }
.nav-tabs a { margin-right: 16px; text-decoration: none; color: #0786bd; font-size: 14px; }
.site-footer {
    width: 100%;
    padding: 20px 0 24px;
    margin-top: 40px;
}
.site-footer-inner {
    max-width: 780px;
    margin: 0 auto;
    padding: 0 32px;
    font-size: 13px;
    line-height: 1.6;
}
.site-footer-copyright {
    margin-top: 10px;
    font-size: 12px;
    opacity: 0.8;
}

/* ============ Mobile-Optimierung ============ */
@media (max-width: 680px) {
    .topbar {
        flex-wrap: nowrap;
        padding: 12px 16px;
        position: relative;
    }
    .topbar .brand { font-size: 15px; }

    .topbar-toggle { display: block; }

    .topbar-links {
        display: none;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: inherit;
        padding: 4px 16px 12px;
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
        z-index: 50;
    }
    .topbar-links.open { display: flex; }
    .topbar-links a {
        margin-left: 0;
        font-size: 14px;
        padding: 10px 0;
        width: 100%;
        border-top: 1px solid rgba(128,128,128,0.3);
    }
    .topbar-links a:first-child { border-top: none; }

    .container, .container.wide {
        max-width: 100%;
        margin: 0 auto;
        padding: 20px 16px;
        border-radius: 0;
        box-shadow: none;
    }

    h1 { font-size: 20px; }
    h2 { font-size: 16px; }

    label { font-size: 13px; }
    input[type=text], input[type=email], input[type=password], input[type=number],
    input[type=date], input[type=time], input[type=tel], select, textarea {
        font-size: 16px; /* verhindert automatisches Hineinzoomen auf iOS beim Fokussieren */
        padding: 11px 10px;
    }

    /* Eigenständige Absende-Buttons (nicht die kleinen Aktions-Buttons in Tabellenzeilen) füllen die Breite */
    form > button:only-of-type {
        display: block;
        width: 100%;
        text-align: center;
        padding: 13px 18px;
    }

    /* Tabellen horizontal scrollbar machen statt das Layout zu sprengen */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    th, td { padding: 8px 10px; font-size: 13px; }

    .nav-tabs { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 16px; }
    .nav-tabs a { margin-right: 0; font-size: 13px; }

    .captcha-row { flex-wrap: wrap; gap: 10px; }
    .captcha-row img { max-width: 100%; height: auto; }

    input[type=file] { width: 100%; }

    .site-footer { margin-top: 24px; padding: 18px 0 20px; }
    .site-footer-inner { padding: 0 16px; }

    /* Buttons/Links allgemein etwas größere Tippfläche für Touch-Bedienung */
    button, .btn, .nav-tabs a { min-height: 24px; }
}

/* Passwort-Richtlinie: Live-Checkliste unter Passwortfeldern */
.pw-policy { margin: 4px 0 12px; }
.pw-policy ul { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: #6b7280; }
.pw-policy li::before { content: "○ "; }
.pw-policy li.ok { color: #15803d; }
.pw-policy li.ok::before { content: "✓ "; }

/* Formularzeile mit mehreren Spalten (Admin) */
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > div { flex: 1; min-width: 200px; }

/* ============ Vereipo-Branding ============
   Farben aus dem Logo-Set: Dunkelblau #082633, Blau #0786BD, Akzent auf dunklem Grund #00A5DF.
   Kopf- und Fußfarben bleiben im Adminbereich unter Einstellungen pro Verein änderbar. */
body { color: #183744; }
h1, h2, h3 { color: #082633; }
a { color: #0786bd; }
a:hover { color: #066a96; }
button:hover, .btn:hover { background: #066a96; }
button.secondary:hover, .btn.secondary:hover { background: #4b5563; }
button.danger:hover, .btn.danger:hover { background: #b91c1c; }
button:focus-visible, .btn:focus-visible, a:focus-visible { outline: 2px solid #00a5df; outline-offset: 2px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #0786bd; box-shadow: 0 0 0 3px rgba(7, 134, 189, .18); }
.topbar .brand { display: inline-flex; align-items: center; gap: 10px; }
.topbar .brand img { margin-right: 0 !important; }
.topbar .brand-signet { width: auto; display: block; }
.app-footer { text-align: center; color: #6b7f89; font-size: 12px; padding: 20px 0; }
.app-footer a { color: inherit; text-decoration: none; }
.app-footer-brand { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: #082633 !important; }
.app-footer-brand img { display: block; }

/* Mitgliedersuche mit Live-Vorschlägen (assets/member-search.js) */
.ms-wrap { position: relative; }
.ms-hidden-select { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0; pointer-events: none; overflow: hidden; }
.ms-list { display: none; position: absolute; z-index: 50; left: 0; right: 0; top: 100%; margin: 2px 0 0; padding: 4px 0; list-style: none; background: #fff; border: 1px solid #d1d5db; border-radius: 8px; box-shadow: 0 8px 24px rgba(8, 38, 51, .15); max-height: 320px; overflow-y: auto; min-width: 240px; }
.ms-list li { padding: 7px 12px; cursor: pointer; line-height: 1.3; }
.ms-list li.ms-active, .ms-list li[data-i]:hover { background: #e8f4fa; }
.ms-list .ms-main { display: block; color: #082633; }
.ms-list .ms-sub { display: block; font-size: 12px; color: #6b7280; }
.ms-list .ms-badge { display: inline-block; margin-top: 2px; font-size: 11px; padding: 1px 6px; border-radius: 9px; background: #f3f4f6; color: #374151; }
.ms-list .ms-none { color: #6b7280; cursor: default; font-size: 14px; }

/* App auf dem Smartphone: Hinweis auf der Startseite und Installationsseite (aus KUNDESK übernommen) */
.pwa-banner { position: relative; display: flex; gap: 14px; align-items: flex-start; background: #eef7fc; border: 1px solid #b9dcf0;
    border-radius: 10px; padding: 14px 40px 14px 14px; margin: 16px 0 6px; }
.pwa-banner[hidden], [data-pwa-variant][hidden], [data-pwa-section][hidden], [data-pwa-install][hidden] { display: none; }
.pwa-banner-icon { width: 44px; height: 44px; border-radius: 10px; flex: 0 0 auto; }
.pwa-banner-body { flex: 1; min-width: 0; }
.pwa-banner-body strong { display: block; font-size: 15px; margin-bottom: 2px; }
.pwa-banner-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.pwa-banner-actions button, .pwa-banner-actions .btn { margin-top: 0; padding: 8px 14px; }
.pwa-steps { margin: 8px 0 0; padding-left: 22px; line-height: 1.6; }
.pwa-steps li { margin-bottom: 6px; }
.pwa-card { border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px 18px; margin-top: 16px; }
.pwa-card h2 { font-size: 18px; margin-bottom: 4px; }
.pwa-hero { display: flex; gap: 16px; align-items: center; margin-bottom: 8px; }
.pwa-hero img { width: 72px; height: 72px; border-radius: 16px; box-shadow: 0 1px 4px rgba(0,0,0,.15); flex: 0 0 auto; }
.pwa-qr { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 8px; width: 180px; height: 180px; line-height: 0; }
.pwa-qr svg { width: 100%; height: 100%; }
.pwa-standalone .nav-app, .pwa-standalone .pwa-browser-only { display: none !important; }
.pwa-standalone .pwa-standalone-only { display: block !important; }

/* Termine mit Zu-/Absage und Helferdienste */
.card { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 14px 18px; margin-bottom: 14px; }
.card h2, .card h3 { margin: 0 0 4px; }
.card-meta { color: #4b5563; font-size: 14px; margin: 0 0 8px; line-height: 1.5; }
.date-block { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 54px; padding: 6px 4px;
    border-radius: 8px; background: #eef7fc; color: #082633; line-height: 1.1; flex: 0 0 auto; }
.date-block .d { font-size: 20px; font-weight: 700; }
.date-block .m { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.date-block .w { font-size: 11px; color: #4b5563; }
.appt-row { display: flex; gap: 14px; align-items: flex-start; }
.appt-body { flex: 1; min-width: 0; }
.rsvp-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: center; }
.rsvp-buttons form { margin: 0; }
.rsvp-buttons button { margin-top: 0; padding: 8px 14px; background: #fff; color: #1f2430; border: 1px solid #d1d5db; }
.rsvp-buttons button.on-yes { background: #15803d; color: #fff; border-color: #15803d; }
.rsvp-buttons button.on-no { background: #b91c1c; color: #fff; border-color: #b91c1c; }
.rsvp-buttons button.on-maybe { background: #b45309; color: #fff; border-color: #b45309; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 12px; font-size: 12px; font-weight: 600; white-space: nowrap; background: #f3f4f6; color: #374151; }
.pill.yes { background: #dcfce7; color: #166534; }
.pill.no { background: #fee2e2; color: #991b1b; }
.pill.maybe { background: #fef3c7; color: #92400e; }
.pill.open { background: #e0f2fe; color: #075985; }
.pill.cat { background: #eef2ff; color: #3730a3; }
.progress { height: 12px; background: #e5e7eb; border-radius: 6px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: #0786bd; }
.progress.done > span { background: #15803d; }
.shift-table td, .shift-table th { vertical-align: top; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 16px; }
.tabs a { padding: 6px 12px; border-radius: 16px; background: #f3f4f6; color: #1f2430; text-decoration: none; font-size: 14px; }
.tabs a.active { background: #082633; color: #fff; }
.rsvp-buttons button:hover { background: #f3f4f6; }
.rsvp-buttons button.on-yes:hover { background: #166534; }
.rsvp-buttons button.on-no:hover { background: #991b1b; }
.rsvp-buttons button.on-maybe:hover { background: #92400e; }
.rsvp-buttons button:disabled { opacity: .5; cursor: not-allowed; }
.shift-list { border-top: 1px solid #e5e7eb; }
.shift-row { display: flex; gap: 14px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid #e5e7eb; flex-wrap: wrap; }
.shift-row.mine { background: #f0fdf4; margin: 0 -10px; padding: 10px; }
.shift-when { width: 92px; flex: 0 0 auto; font-size: 14px; line-height: 1.4; }
.shift-what { flex: 1; min-width: 160px; line-height: 1.6; }
.shift-action { flex: 0 1 260px; min-width: 200px; }
@media (max-width: 600px) { .shift-action { flex: 1 1 100%; } }
.duty-list { margin: 8px 0 2px; padding: 8px 10px; background: #f9fafb; border-radius: 8px; font-size: 14px; }
.duty-row { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 3px 0; }
.duty-name { color: #4b5563; min-width: 150px; }
.duty-take { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin: 0; }
.duty-take button { margin: 0; padding: 5px 12px; font-size: 13px; }
.duty-consent { font-weight: normal; font-size: 13px; display: flex; gap: 6px; align-items: center; margin: 0; }
.duty-consent input { width: auto; margin: 0; }
button.linkbutton { background: none; color: #0786bd; padding: 0 4px; margin: 0; font-size: 13px; text-decoration: underline; }
button.linkbutton:hover { background: none; color: #066a96; }
