/* Amphibienportal – gemeinsame Basis-Optic ("Das Feldprotokoll").
   Neue Templates binden diese Datei ein; bestehende migrieren schrittweise. */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #e8f5e9;
    color: #333;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    padding: 0;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: #1b5e20;
    color: #fff;
    padding: 12px 18px;
    border-radius: 0 0 8px 0;
    z-index: 100;
    text-decoration: none;
    font-weight: 600;
}
.skip-link:focus { left: 0; }

/* Sprechende Icons: ein Strichsystem, 1.8px stroke, currentColor */
.ic {
    width: 1.15em;
    height: 1.15em;
    flex-shrink: 0;
    vertical-align: -0.2em;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

/* Sidebar / Hauptnavigation */
.sidebar {
    width: 220px;
    min-height: 100vh;
    background: #2e7d32;
    padding: 24px 0;
    flex-shrink: 0;
    position: sticky;
    top: 0;
}
.sidebar .ic { width: 1.3em; height: 1.3em; }
.sidebar-title {
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    text-align: center;
    padding: 0 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    margin-bottom: 8px;
}
.sidebar nav ul { list-style: none; }
.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    color: #fff;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: background 0.2s, color 0.2s;
    border-left: 3px solid transparent;
}
.sidebar nav a:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}
.sidebar nav a.active {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-left-color: #a5d6a7;
}
.sidebar nav a:focus-visible {
    outline: 3px solid #fff;
    outline-offset: -3px;
}

/* Beta-Kennzeichnung: jede Beta-Instanz muss sich zu erkennen geben */
.beta-badge {
    display: inline-block;
    background: #fdf3e7;
    color: #7a4a00;
    border: 1px solid #b26a00;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 1px 6px;
    border-radius: 4px;
    vertical-align: 0.15em;
    margin-left: 6px;
}

.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 16px;
    min-width: 0;
    width: 100%;
    max-width: 100%;
}
.page-wrapper { max-width: 700px; width: 100%; min-width: 0; }
.page-wrapper.wide { max-width: 1200px; }
.page-wrapper.narrow { max-width: 560px; }

.content-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 36px 32px;
    width: 100%;
}
.content-container + .content-container { margin-top: 28px; }

h1 { font-size: 1.5rem; color: #2e7d32; margin-bottom: 8px; text-align: center; }
.subline {
    text-align: center;
    color: #3c4043;
    font-size: 0.95rem;
    margin-bottom: 28px;
}

/* Formulare */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    font-size: 0.95rem;
}
.pflicht { color: #b3261e; }
.freiwillig { color: #5f6368; font-weight: 400; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="date"],
select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 2px solid #5c9e66;
    border-radius: 8px;
    font-size: 1rem;
    color: #333;
    background: #fafffe;
    transition: border-color 0.2s;
}
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #5c9e66;
    border-radius: 8px;
    font-size: 1rem;
    color: #333;
    background: #fafffe;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.2s;
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid #1b5e20;
    outline-offset: 2px;
    border-color: #2e7d32;
}

button[type="submit"] {
    margin-top: 24px;
    width: 100%;
    min-height: 48px;
    padding: 14px;
    background: #2e7d32;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
button[type="submit"]:hover { background: #1b5e20; }
button[type="submit"]:focus-visible {
    outline: 3px solid #1b5e20;
    outline-offset: 3px;
}

.success-message {
    background: #e2f0e3;
    border: 1px solid #2e7d32;
    color: #1b5e20;
    padding: 14px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 18px;
    font-weight: 600;
}
.error-message {
    background: #fbe9eb;
    border: 1px solid #b3261e;
    color: #8c1d18;
    padding: 14px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 18px;
    font-weight: 600;
}
.pausiert-hinweis {
    background: #fdf3e7;
    color: #7a4a00;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    font-size: 1.05rem;
    border: 2px solid #b26a00;
}
.back-link {
    display: block;
    text-align: center;
    margin-top: 16px;
    color: #5f6368;
    font-size: 0.95rem;
    text-decoration: none;
}
.back-link:hover { color: #2e7d32; }

/* Daten-Tabellen (Statistik, Admin) */
.data-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 36px 32px;
    width: 100%;
}
.data-title { font-size: 1.3rem; color: #2e7d32; margin-bottom: 16px; text-align: center; }
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}
/* Erste Spalte bleibt beim seitlichen Scrollen stehen */
.table-wrap .data-table thead tr:first-child th:first-child,
.table-wrap .anmeldung-table thead tr:first-child th:first-child,
.table-wrap .abo-liste thead tr:first-child th:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #2e7d32;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.06);
}
.table-wrap .data-table tbody td:first-child,
.table-wrap .anmeldung-table tbody td:first-child,
.table-wrap .abo-liste tbody td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.06);
}
.table-wrap .data-table tbody tr:nth-child(even) td:first-child,
.table-wrap .anmeldung-table tbody tr:nth-child(even) td:first-child,
.table-wrap .abo-liste tbody tr:nth-child(even) td:first-child { background: #f1f8e9; }
.table-wrap .data-table tbody tr:hover td:first-child,
.table-wrap .anmeldung-table tbody tr:hover td:first-child,
.table-wrap .abo-liste tbody tr:hover td:first-child { background: #dcedc8; }
.table-wrap .data-table tfoot td:first-child,
.table-wrap .anmeldung-table tfoot td:first-child,
.table-wrap .abo-liste tfoot td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #e8f5e9;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.06);
}
.table-wrap:focus-visible {
    outline: 3px solid #1b5e20;
    outline-offset: -3px;
}
.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.data-table th, .data-table td {
    padding: 9px 8px;
    text-align: center;
    border: 1px solid #c8e6c9;
}
.data-table th {
    background: #2e7d32; color: #fff;
    font-weight: 600; white-space: nowrap;
    border-color: #1b5e20;
}
.data-table th:first-child { border-radius: 8px 0 0 0; }
.data-table th:last-child { border-radius: 0 8px 0 0; }
.data-table tr:nth-child(even) { background: #f1f8e9; }
.data-table tr:hover { background: #dcedc8; }
.data-table th.sep-left, .data-table td.sep-left { border-left: 3px solid #2e7d32; }
.data-table .sum-row td {
    background: #e8f5e9;
    font-weight: 700;
    color: #2e7d32;
    border-top: 2px solid #2e7d32;
}
.empty-hint { text-align: center; color: #5f6368; padding: 24px; font-style: italic; }

/* Rechtsleiste: fester Seitenabschluss ganz unten, wandert nicht beim Scrollen */
.site-footer {
    flex: 0 0 100%;
    display: flex;
    justify-content: center;
    padding: 16px 12px 20px;
}
.site-footer-inner {
    display: flex;
    justify-content: center;
    gap: 10px;
    width: fit-content;
    max-width: 100%;
    background: #1b5e20;
    color: #fff;
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 0.85rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}
.site-footer-inner a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.site-footer-inner a:hover { color: #c8e6c9; }
.site-footer-inner a:focus-visible { outline: 3px solid #fff; outline-offset: 2px; border-radius: 4px; }
body { flex-wrap: wrap; }
body:has(.site-footer) .sidebar { min-height: calc(100vh - 78px); }

@media (max-width: 800px) {
    body { flex-direction: column; }
    .sidebar {
        width: 100%;
        min-height: auto;
        position: relative;
        padding: 12px 0;
    }
    .sidebar-title {
        padding: 0 16px 10px;
        margin-bottom: 4px;
        font-size: 1rem;
    }
    .sidebar nav ul {
        display: flex;
        flex-wrap: wrap;
        gap: 0;
    }
    .sidebar nav li {
        flex: 1 1 33.33%;
        min-width: 0;
    }
    .sidebar nav a {
        flex: 1 1 auto;
        height: 100%;
        flex-direction: column;
        justify-content: center;
        gap: 2px;
        min-height: 48px;
        padding: 8px 6px;
        font-size: 0.78rem;
        text-align: center;
        border-left: none;
        border-bottom: 3px solid transparent;
    }
    .sidebar nav a.active {
        border-left-color: transparent;
        border-bottom-color: #a5d6a7;
    }
    .main-content { padding: 20px 12px; }
    .site-footer { flex: 0 0 auto; width: 100%; }
    body:has(.site-footer) .sidebar { min-height: 0; }
    .content-container { padding: 28px 18px; }
    .data-container { padding: 24px 14px; }
}

@media (max-width: 600px) {
    .data-table { font-size: 0.78rem; }
    .data-table th, .data-table td { padding: 7px 4px; }
}
