/* Rasenplan – gemeinsames Stylesheet (lokal, keine externen Ressourcen) */

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

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #2c3e2c;
    background: linear-gradient(160deg, #1a5c1a 0%, #2d8a2d 50%, #1a6b1a 100%);
    min-height: 100vh;
}

.page {
    max-width: 720px;
    margin: 0 auto;
    padding: 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.site-header {
    text-align: center;
    padding: 24px 16px 16px;
    color: #fff;
}

.header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    margin-bottom: 8px;
}

.site-header h1 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
}

.header-sub {
    margin: 4px 0 0;
    font-size: 0.9rem;
    opacity: 0.85;
}

/* Main content card */
.main-content {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    flex: 1;
}

/* Motivation banner */
.motivation-banner {
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    border-left: 4px solid #2e7d32;
    padding: 16px 20px;
    border-radius: 0 12px 12px 0;
    margin-bottom: 24px;
    font-style: italic;
    color: #33691e;
}

/* Current week highlight */
.current-week-banner {
    background: #1a6b1a;
    color: #fff;
    padding: 12px 20px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 20px;
    font-weight: 600;
}

/* Terminliste (Legacy / Fallback) */
.termin-liste {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
}

.termin-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 6px;
    transition: background 0.15s;
}

.termin-item:hover {
    background: #f5f9f5;
}

.termin-item--aktuell {
    background: #e8f5e9;
    border: 2px solid #2e7d32;
    font-weight: 600;
}

.termin-item--vergangen {
    opacity: 0.5;
}

.termin-datum {
    min-width: 140px;
    font-size: 0.9rem;
    color: #1a6b1a;
    font-weight: 600;
}

.termin-person {
    flex: 1;
}

.termin-badge {
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
    white-space: nowrap;
}

.badge--aktuell {
    background: #2e7d32;
    color: #fff;
}

.badge--naechste {
    background: #fff3e0;
    color: #e65100;
}

/* ─── Öffentliche Kalender-Ansicht ─── */

body.page-public .page {
    max-width: 920px;
}

body.page-public .site-header h1 {
    font-size: 1.85rem;
    letter-spacing: -0.02em;
}

.kalender-kopf {
    text-align: center;
    margin-bottom: 20px;
}

.kalender-untertitel {
    margin: 10px 0 0;
    font-size: 0.9rem;
    color: #5a6e5a;
}

.kalender-heute {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, #1a6b1a, #2e7d32);
    color: #fff;
    padding: 16px 20px;
    border-radius: 14px;
    margin-bottom: 20px;
    box-shadow: 0 4px 16px rgba(26, 107, 26, 0.25);
}

.kalender-heute-icon {
    font-size: 1.75rem;
    line-height: 1;
}

.kalender-heute strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 2px;
}

.kalender-heute span {
    font-size: 0.95rem;
    opacity: 0.92;
}

.motivation-banner--kalender {
    margin-bottom: 28px;
    border-radius: 12px;
    text-align: center;
    font-style: normal;
    font-size: 0.95rem;
}

.kalender-leer {
    text-align: center;
    color: #666;
    padding: 32px 16px;
}

.kalender-jahr {
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin-bottom: 28px;
}

.kalender-monat-titel {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e8f0e8;
}

.kalender-monat-name {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a6b1a;
}

.kalender-monat-jahr {
    font-size: 0.95rem;
    font-weight: 600;
    color: #7a9a7a;
}

.kalender-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}

.kalender-woche {
    position: relative;
    background: #fff;
    border: 1px solid #e0e8e0;
    border-radius: 14px;
    padding: 14px 14px 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.15s, box-shadow 0.15s;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}

.kalender-woche::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #a5d6a7, #1a6b1a);
}

.kalender-woche:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.kalender-woche--aktuell {
    border-color: #2e7d32;
    border-width: 2px;
    background: linear-gradient(180deg, #f1f8f1 0%, #fff 40%);
    box-shadow: 0 4px 20px rgba(46, 125, 50, 0.18);
}

.kalender-woche--aktuell::before {
    height: 5px;
    background: #2e7d32;
}

.kalender-woche--naechste {
    border-color: #ffcc80;
    background: linear-gradient(180deg, #fffbf5 0%, #fff 50%);
}

.kalender-woche--naechste::before {
    background: linear-gradient(90deg, #ffcc80, #e65100);
}

.kalender-woche--vergangen {
    opacity: 0.55;
    background: #fafafa;
}

.kalender-woche--vergangen:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.kalender-woche-kw {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #7a9a7a;
}

.kalender-woche-datum {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.kalender-tag {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 52px;
    padding: 8px 10px;
    background: #f5f9f5;
    border: 1px solid #e0e8e0;
    border-radius: 10px;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.04);
}

.kalender-woche--aktuell .kalender-tag {
    background: #e8f5e9;
    border-color: #c8e6c9;
}

.kalender-tag-zahl {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
    color: #1a6b1a;
    font-variant-numeric: tabular-nums;
}

.kalender-tag-mon {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #5a7a5a;
    margin-top: 2px;
}

.kalender-pfeil {
    font-size: 1.25rem;
    color: #a5c9a5;
    font-weight: 300;
    line-height: 1;
}

.kalender-woche-person {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    color: #2c3e2c;
    padding-top: 2px;
}

.kalender-person-icon {
    display: inline-flex;
    color: #1a6b1a;
    opacity: 0.7;
}

.kalender-badge {
    align-self: center;
    font-size: 0.7rem;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.kalender-badge--aktuell {
    background: #2e7d32;
    color: #fff;
}

.kalender-badge--naechste {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
}

.checkliste--kalender {
    border: 1px dashed #c8e6c9;
    background: #fafcfa;
}

.kalender-tipp {
    margin-top: 20px;
    font-size: 0.9rem;
    color: #5a6e5a;
    padding: 14px 16px;
    background: #f5f9f5;
    border-radius: 10px;
    border-left: 3px solid #a5d6a7;
}

@media (max-width: 480px) {
    .kalender-grid {
        grid-template-columns: 1fr;
    }

    .kalender-tag-zahl {
        font-size: 1.35rem;
    }

    body.page-public .main-content {
        padding: 18px 16px;
    }
}

/* Checkliste */
.checkliste {
    background: #f5f9f5;
    border-radius: 12px;
    padding: 20px 24px;
    margin-top: 8px;
}

.checkliste h2 {
    margin: 0 0 12px;
    font-size: 1.1rem;
    color: #1a6b1a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkliste ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.checkliste li {
    padding: 6px 0 6px 28px;
    position: relative;
}

.checkliste li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #2e7d32;
    font-weight: bold;
}

/* Formular (RSVP) */
.rsvp-intro {
    margin-bottom: 20px;
}

.rsvp-zeitraum {
    display: inline-block;
    background: #e8f5e9;
    color: #1a6b1a;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 600;
    margin: 8px 0;
}

.rsvp-form > label:has(input[type="radio"]) {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 2px solid #e0e8e0;
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.rsvp-form > label:has(input[type="radio"]):hover {
    border-color: #2e7d32;
    background: #f5f9f5;
}

.rsvp-form > label:has(input[type="radio"]:checked) {
    border-color: #2e7d32;
    background: #e8f5e9;
}

.rsvp-form > label input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: #1a6b1a;
    flex-shrink: 0;
}

.rsvp-form > label input[type="radio"]:checked + span {
    font-weight: 600;
    color: #1a6b1a;
}

.rsvp-form textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 2px solid #e0e8e0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    margin: 8px 0 16px;
}

.rsvp-form textarea:focus {
    outline: none;
    border-color: #2e7d32;
}

.rsvp-select {
    display: block;
    width: 100%;
    padding: 14px 44px 14px 16px;
    border: 2px solid #e0e8e0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.4;
    color: #2c3e2c;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%231a6b1a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px;
    margin: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.rsvp-select:focus {
    outline: none;
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15);
}

.vertretung-feld {
    background: #f5f9f5;
    border: 2px solid #e0e8e0;
    padding: 16px;
    border-radius: 10px;
    margin: 4px 0 16px;
}

.vertretung-label {
    display: block;
    font-weight: 600;
    font-size: 1rem;
    color: #1a6b1a;
    margin: 0 0 12px;
    padding: 0;
    border: none;
    cursor: default;
}

/* Vertretungs-Optionen (Radio-Karten) */
.vertretung-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 2px solid #e0e8e0;
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.15s, background 0.15s;
}

.vertretung-option:hover {
    border-color: #2e7d32;
    background: #fafcfa;
}

.vertretung-option:has(input:checked) {
    border-color: #2e7d32;
    background: #e8f5e9;
}

.vertretung-option input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: #1a6b1a;
    flex-shrink: 0;
}

.vertretung-option-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.vertretung-option-text strong {
    color: #2c3e2c;
    font-size: 1rem;
}

.vertretung-option-text small {
    color: #666;
    font-size: 0.85rem;
}

/* Rundmail-Option: optisch abgesetzt */
.vertretung-option--rundmail {
    border-color: #ffcc80;
    background: #fffbf5;
}

.vertretung-option--rundmail:hover {
    border-color: #e65100;
    background: #fff8e1;
}

.vertretung-option--rundmail:has(input:checked) {
    border-color: #e65100;
    background: #fff3e0;
    box-shadow: 0 0 0 3px rgba(230, 81, 0, 0.12);
}

.vertretung-option--rundmail:has(input:checked) .vertretung-option-text strong {
    color: #e65100;
}

.vertretung-person-block {
    margin: 0 0 12px 32px;
    padding-left: 12px;
    border-left: 3px solid #2e7d32;
}

.vertretung-rundmail-block {
    margin: 0 0 4px 32px;
}

.rundmail-hinweis {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
    border: 2px solid #e65100;
    border-radius: 10px;
    padding: 16px;
}

.rundmail-hinweis-icon {
    font-size: 1.75rem;
    line-height: 1;
    flex-shrink: 0;
}

.rundmail-hinweis strong {
    display: block;
    color: #e65100;
    font-size: 1rem;
    margin-bottom: 6px;
}

.rundmail-hinweis p {
    margin: 0;
    font-size: 0.9rem;
    color: #5d4037;
    line-height: 1.5;
}

.rundmail-hinweis-lead {
    margin: 8px 0 10px !important;
}

.rundmail-ablauf {
    margin: 0;
    padding-left: 1.2rem;
    font-size: 0.9rem;
    color: #5d4037;
    line-height: 1.55;
}

.rundmail-ablauf li {
    margin-bottom: 8px;
}

.rundmail-ablauf li:last-child {
    margin-bottom: 0;
}

.rundmail-ablauf strong {
    color: #bf360c;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.rsvp-comment-label {
    font-weight: 600;
    margin: 4px 0 8px;
    display: block;
    color: #2c3e2c;
}

.btn-primary {
    display: inline-block;
    background: #1a6b1a;
    color: #fff;
    border: none;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s;
    width: 100%;
}

.btn-primary:hover {
    background: #2e7d32;
}

/* Danke-Seite */
.thank-you {
    text-align: center;
    padding: 32px 16px;
}

.thank-you-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.thank-you h2 {
    color: #1a6b1a;
    margin: 0 0 8px;
}

/* Fehler */
.error-message {
    background: #fce4ec;
    color: #c62828;
    padding: 16px 20px;
    border-radius: 10px;
    text-align: center;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 16px;
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
}

.back-link {
    text-align: center;
    margin-top: 24px;
}

.back-link a {
    color: #1a6b1a;
    font-weight: 600;
    text-decoration: none;
}

.back-link a:hover {
    text-decoration: underline;
}

/* Admin-Bereich */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.admin-stat {
    background: #f5f9f5;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}

.admin-stat strong {
    display: block;
    font-size: 1.8rem;
    color: #1a6b1a;
    line-height: 1.2;
}

.admin-stat span {
    font-size: 0.8rem;
    color: #666;
}

.admin-tools {
    background: #e8f5e9;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.admin-tools h2 {
    margin: 0 0 12px;
    font-size: 1rem;
    color: #1a6b1a;
}

.admin-tools ul {
    margin: 0;
    padding-left: 20px;
}

.admin-tools li {
    margin-bottom: 6px;
}

.admin-tools a {
    color: #1a6b1a;
    font-weight: 600;
}

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e0e8e0;
}

.admin-table th {
    background: #f5f9f5;
    color: #1a6b1a;
    font-weight: 600;
    white-space: nowrap;
}

.admin-table tr:hover td {
    background: #fafcfa;
}

.admin-table tr.row--aktuell td {
    background: #e8f5e9;
}

.admin-table tr.row--vergangen td {
    opacity: 0.55;
}

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge--ja { background: #e8f5e9; color: #2e7d32; }
.status-badge--nein { background: #fff3e0; color: #e65100; }
.status-badge--offen { background: #fce4ec; color: #c62828; }
.status-badge--kein { background: #f5f5f5; color: #999; }

.mail-flags {
    font-size: 0.75rem;
    color: #888;
    white-space: nowrap;
}

.admin-comment {
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
    max-width: 180px;
}

.import-year-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1a6b1a;
}

.import-year-input {
    display: block;
    width: 120px;
    padding: 10px 12px;
    margin-top: 6px;
    border: 2px solid #e0e8e0;
    border-radius: 10px;
    font-size: 1rem;
}

.import-textarea {
    width: 100%;
    min-height: 280px;
    padding: 14px;
    border: 2px solid #e0e8e0;
    border-radius: 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    resize: vertical;
    margin-bottom: 16px;
}

.import-textarea:focus {
    outline: none;
    border-color: #2e7d32;
}

.import-form {
    margin-top: 16px;
}

.nachfolger-hint {
    font-size: 0.85rem;
    color: #666;
    margin: -8px 0 16px;
    line-height: 1.4;
}

.cron-hint {
    background: #f5f5f5;
    padding: 12px 16px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.8rem;
    word-break: break-all;
    margin-top: 8px;
}

/* Jahr-Umschalter */
.year-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.year-switcher--public {
    justify-content: center;
}

.year-btn {
    padding: 8px 16px;
    background: #e8f5e9;
    color: #1a6b1a;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.year-btn:hover,
.year-btn.active {
    background: #1a6b1a;
    color: #fff;
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 12px;
}

.logout-link {
    color: #c62828;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
}

.logout-link:hover {
    text-decoration: underline;
}

.admin-file-hint {
    font-size: 0.85rem;
    color: #666;
    margin: 0 0 16px;
}

.admin-file-hint code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 4px;
}

.login-box {
    max-width: 400px;
    margin: 0 auto;
}

/* Responsive */
@media (max-width: 600px) {
    .main-content {
        padding: 16px;
    }

    .termin-item {
        flex-wrap: wrap;
    }

    .termin-datum {
        min-width: auto;
        width: 100%;
    }

    .site-header h1 {
        font-size: 1.3rem;
    }
}
