:root {
    --color-primary: #2b6e4f;
    --color-primary-dark: #1f5138;
    --color-bg: #f6f7f5;
    --color-card: #ffffff;
    --color-text: #222222;
    --color-muted: #6b6b6b;
    --color-error: #b3261e;
    --color-error-bg: #fbeceb;
    --color-success: #1f5138;
    --color-success-bg: #e7f3ec;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    background: var(--color-primary);
    color: white;
}

.topbar .brand {
    color: white;
    font-weight: 700;
    text-decoration: none;
    font-size: 1.2rem;
}

.topnav a {
    color: white;
    text-decoration: none;
    margin-left: 20px;
    opacity: 0.9;
}

.topnav a:hover { opacity: 1; text-decoration: underline; }

.content {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 20px;
}

.auth-box {
    max-width: 420px;
    margin: 60px auto;
    background: var(--color-card);
    padding: 32px;
    border-radius: var(--radius);
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.auth-box h1 { margin-top: 0; font-size: 1.5rem; }

form label {
    display: block;
    margin-top: 14px;
    margin-bottom: 4px;
    font-size: 0.9rem;
    font-weight: 600;
}

form input, form select, form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
}

form label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
}

form label input[type="checkbox"] {
    width: auto;
}

form h3 {
    margin-top: 32px;
    margin-bottom: 4px;
}

.data-table select, .data-table input {
    width: auto;
    min-width: 100px;
}

form button {
    margin-top: 20px;
    width: 100%;
    padding: 12px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
}

form button:hover { background: var(--color-primary-dark); }

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.alert ul { margin: 0; padding-left: 18px; }

.alert-error { background: var(--color-error-bg); color: var(--color-error); }
.alert-success { background: var(--color-success-bg); color: var(--color-success); }

.muted { color: var(--color-muted); }

.badge {
    background: var(--color-primary);
    color: white;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.tile {
    background: var(--color-card);
    border-radius: var(--radius);
    padding: 24px 16px;
    text-align: center;
    text-decoration: none;
    color: var(--color-text);
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

.tile-icon { display: block; font-size: 2rem; margin-bottom: 8px; }
.tile-title { display: block; font-weight: 600; }

.tile { position: relative; }

.tile-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--color-error);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes pastel-red-blink {
    0%, 100% { background-color: var(--color-card); }
    50% { background-color: #ffd6d6; }
}

.tile-alert {
    animation: pastel-red-blink 1.6s ease-in-out infinite;
}

/* ---- Tabellen (Benutzerverwaltung, Materialverwaltung, etc.) ---- */

section { margin-bottom: 40px; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.data-table th, .data-table td {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

.data-table th {
    background: #f0f1ee;
    font-weight: 600;
}

.data-table tbody tr:last-child td { border-bottom: none; }

.task-read { opacity: 0.55; }

.data-table td.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.inline-form { display: inline-block; margin: 0; }

/* ---- Buttons ---- */

.btn {
    display: inline-block;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
}

.btn-small { padding: 6px 12px; font-size: 0.85rem; }

.btn-success { background: var(--color-success); color: white; }
.btn-danger { background: var(--color-error); color: white; }
.btn-outline { background: transparent; color: var(--color-muted); border: 1px solid #ccc; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Kalender ---- */

#calendar {
    background: var(--color-card);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.fc-event { cursor: pointer; border: none !important; }
.fc-toolbar-title { font-size: 1.3rem !important; }

.kool-link-box {
    text-align: center;
    padding: 16px;
}

.kool-link-box a {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
}

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

/* ---- Event-Detail-Modal ---- */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-box {
    background: white;
    border-radius: var(--radius);
    padding: 28px;
    max-width: 480px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-muted);
}

.modal-category {
    display: inline-block;
    background: var(--color-bg);
    color: var(--color-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 10px;
    border-radius: 999px;
    margin-bottom: 8px;
}

.modal-box h2 { margin-top: 4px; }

.modal-details dt {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--color-muted);
    margin-top: 12px;
}

.modal-details dd {
    margin: 2px 0 0 0;
    white-space: pre-line;
}

.modal-edit-link {
    display: inline-block;
    margin-top: 20px;
    text-decoration: none;
}

/* ---- Bibelvers der Tages ---- */

.verse-card {
    background:
        linear-gradient(rgba(20, 45, 32, 0.6), rgba(20, 45, 32, 0.6)),
        url('/assets/img/bibelvers-bg.jpg');
    background-size: cover;
    background-position: center;
    background-color: #1f5138; /* Fallback, falls noch kein Bild hochgeladen wurde */
    border-radius: var(--radius);
    padding: 56px 32px;
    color: white;
    text-align: center;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 24px;
}

.verse-block-secondary {
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    padding-top: 24px;
}

.verse-text {
    font-size: 1.4rem;
    font-style: italic;
    line-height: 1.5;
    margin: 0;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.verse-ref {
    font-weight: 600;
    margin-top: 10px;
    opacity: 0.9;
}

.verse-source {
    font-size: 0.8rem;
    opacity: 0.75;
    margin-top: 8px;
}

.verse-card form { margin-top: 16px; }
