* { 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: #1f2937;
    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; }
.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=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: #2563eb;
    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: #2563eb; 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=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; }
}
