/* ============================================================
   Vereinsverwaltung TuS Schwefe 1921 e.V.
   ============================================================ */

[x-cloak] { display: none !important; }

/* Schriften: siehe fonts.css — wird im <head> vor app.css geladen.
   Eigene Datei, damit auch die Seiten ohne layout.php (login, fehler,
   wartung, Vordrucke) dieselben Schriften bekommen. */

:root {
    --primary: #003399;
    --primary-dark: #001f5c;
    --primary-light: #1e5bbf;
    --primary-bg: #f0f4ff;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --white: #ffffff;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
    --radius: 8px;
    --sidebar-width: 260px;
    --header-height: 60px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--gray-100);
}

h1, h2, h3, h4, h5 {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    color: var(--primary-dark);
    line-height: 1.3;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-light); }

/* ============================================================
   Login-Seite
   ============================================================ */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.login-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-card .logo { margin-bottom: 1.5rem; }
.login-card .logo h1 { font-size: 1.6rem; color: var(--primary); }
.login-card .logo p { color: var(--gray-600); font-size: 0.9rem; }

/* ============================================================
   App-Layout
   ============================================================ */

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--primary-dark);
    color: var(--white);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 1.1rem;
    color: var(--white);
    margin: 0;
}

.sidebar-header small {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
}

.sidebar-nav { padding: 1rem 0; }

/* Produkt-/Versionshinweis unten in der Seitenleiste. */
.sidebar-footer {
    padding: 0.85rem 1.5rem 1.1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 0.5rem;
}
.sidebar-footer-brand {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}
.sidebar-footer-brand i { color: var(--accent, #1e5bbf); }
.sidebar-version {
    margin-left: auto;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.85);
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    white-space: nowrap;
}
.sidebar-footer-by {
    margin-top: 0.25rem;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.45);
}

.nav-section {
    padding: 0.5rem 1.5rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 0.75rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    transition: all 0.15s;
}

.nav-link:hover, .nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.nav-link.active { border-left: 3px solid var(--white); padding-left: calc(1.5rem - 3px); }
.nav-link i { width: 20px; text-align: center; }

.nav-parent {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s;
    width: 100%;
    border: none;
    background: none;
    text-align: left;
}
.nav-parent:hover { background: rgba(255, 255, 255, 0.1); color: var(--white); }
.nav-parent i.fa-chevron-right { width: auto; margin-left: auto; font-size: 0.6rem; transition: transform 0.2s; }
.nav-parent.open i.fa-chevron-right { transform: rotate(90deg); }
.nav-children { display: none; }
.nav-children.open { display: block; }
.nav-children .nav-link { padding-left: 3rem; font-size: 0.85rem; }
.nav-children .nav-link.active { padding-left: calc(3rem - 3px); }

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-width: 0;
}

/* Header */
.top-header {
    background: var(--white);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-header h1 { font-size: 1.3rem; margin: 0; }

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-700);
    font-size: 0.9rem;
}

.burger-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--primary);
    cursor: pointer;
    padding: 0.25rem;
}

/* Page Content */
.page-content { padding: 2rem; }

/* ============================================================
   Karten / Cards
   ============================================================ */

.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2, .card-header h3 {
    font-size: 1.1rem;
    margin: 0;
}

.card-body { padding: 1.5rem; }

/* ============================================================
   Formulare
   ============================================================ */

.form-group { margin-bottom: 1.25rem; }

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    color: var(--gray-700);
}

.form-control {
    width: 100%;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 51, 153, 0.15);
}

.form-control:disabled {
    background: var(--gray-100);
    cursor: not-allowed;
}

.form-text {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* Checkbox */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    line-height: 1.5;
}

.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-light); color: var(--white); }

.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { background: #218838; color: var(--white); }

.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #c82333; color: var(--white); }

.btn-warning { background: var(--warning); color: var(--gray-900); }
.btn-warning:hover { background: #e0a800; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}
.btn-outline:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
    color: var(--gray-700);
}

.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.8rem; }
.btn-xs { padding: 0.2rem 0.5rem; font-size: 0.75rem; }
.btn-lg { padding: 0.7rem 1.75rem; font-size: 1rem; }

.btn-group { display: flex; gap: 0.5rem; }

/* ============================================================
   Tabellen
   ============================================================ */

.table-responsive { overflow-x: auto; }

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: middle;
}

.table th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-600);
    background: var(--gray-50, #fafbfc);
}

.table tbody tr:hover { background: var(--primary-bg); }

/* ============================================================
   Alerts / Flash Messages
   ============================================================ */

.alert {
    padding: 0.85rem 1.25rem;
    border-radius: 6px;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-erfolg {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-fehler {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warnung {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ============================================================
   Badge / Tags
   ============================================================ */

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-primary { background: var(--primary-bg); color: var(--primary); }
.badge-success { background: #d4edda; color: #155724; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-info { background: #d1ecf1; color: #0c5460; }
.badge-sm { padding: 0.05rem 0.35rem; font-size: 0.7rem; }

/* ============================================================
   Dashboard Karten
   ============================================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--white);
}

.stat-icon.blue { background: var(--primary); }
.stat-icon.green { background: var(--success); }
.stat-icon.orange { background: #fd7e14; }
.stat-icon.purple { background: #6f42c1; }
.stat-icon.red { background: var(--danger); }
.stat-icon.gray { background: var(--gray-500); }

.stat-info h3 {
    font-size: 1.6rem;
    font-family: 'Source Sans 3', sans-serif;
    color: var(--gray-900);
    margin: 0;
}

.stat-info p {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin: 0;
}

/* ============================================================
   Berechtigungs-Matrix
   ============================================================ */

.permission-matrix { margin-top: 1rem; }

.permission-matrix table {
    width: 100%;
    border-collapse: collapse;
}

.permission-matrix th, .permission-matrix td {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-200);
    text-align: center;
}

.permission-matrix th:first-child,
.permission-matrix td:first-child {
    text-align: left;
    font-weight: 600;
}

.permission-matrix thead th {
    background: var(--primary);
    color: var(--white);
    font-size: 0.8rem;
    text-transform: uppercase;
}

/* ============================================================
   Sidebar-Overlay (Mobil)
   ============================================================ */

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }

    .main-content { margin-left: 0; }
    .burger-toggle { display: block; }

    .page-content { padding: 1rem; }
    .top-header { padding: 0 1rem; }

    .form-row { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }

    .table th, .table td { padding: 0.5rem; font-size: 0.85rem; }
}

@media (max-width: 480px) {
    .login-card { margin: 1rem; padding: 1.5rem; }
    .btn-group { flex-direction: column; }
}

/* ============================================================
   Utilities
   ============================================================ */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-500); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.justify-center { justify-content: center; }
.align-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.w-full { width: 100%; }

/* ============================================================
   Tab-Navigation (Einstellungen etc.)
   ============================================================ */
.tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--gray-200);
    flex-wrap: wrap;
}
.tab-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    color: var(--gray-600);
    font-weight: 500;
    font-size: 0.9rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}
.tab-link:hover {
    color: var(--primary);
    border-bottom-color: var(--primary-light);
}
.tab-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.sub-tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--gray-200);
    flex-wrap: wrap;
}
.sub-tab-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--gray-500);
    font-weight: 500;
    font-size: 0.82rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
}
.sub-tab-link:hover {
    color: var(--primary-light);
    border-bottom-color: var(--primary-light);
}
.sub-tab-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

/* ============================================================
   Detail-Ansicht (Mitglied etc.)
   ============================================================ */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
@media (max-width: 768px) {
    .detail-grid { grid-template-columns: 1fr; }
}
.detail-section h4 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid var(--primary-bg);
}
.detail-section dl {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 0.25rem 0.75rem;
    margin: 0;
}
.detail-section dt {
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.85rem;
}
.detail-section dd {
    margin: 0;
}

/* ============================================================
   Pagination
   ============================================================ */
.pagination {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    margin-top: 1rem;
    flex-wrap: wrap;
}
.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    color: var(--primary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s;
}
.pagination-link:hover {
    background: var(--primary-bg);
    border-color: var(--primary-light);
}
.pagination-link.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* ============================================================
   Bar-Chart (Statistik)
   ============================================================ */
.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.bar-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.bar-label {
    flex: 0 0 100px;
    font-size: 0.85rem;
    color: var(--gray-700);
    text-align: right;
}
.bar-track {
    flex: 1;
    background: var(--gray-200);
    border-radius: 4px;
    height: 24px;
    overflow: hidden;
}
.bar-fill {
    background: var(--primary);
    height: 100%;
    border-radius: 4px;
    color: var(--white);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 0.5rem;
    min-width: 30px;
    transition: width 0.3s ease;
}

/* Dashboard Grid (2 Spalten) */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Geburtstage */
.geburtstag-liste {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.geburtstag-eintrag {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background 0.15s;
}
.geburtstag-eintrag:hover {
    background: var(--gray-100);
}
.geburtstag-eintrag.heute {
    background: #fff8e1;
    border-left: 3px solid var(--warning);
}
.geburtstag-datum {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 42px;
    padding: 0.25rem 0.5rem;
    background: var(--primary-bg);
    border-radius: 6px;
}
.geburtstag-datum .tag {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    color: var(--primary);
    font-family: 'Barlow Condensed', sans-serif;
}
.geburtstag-datum .monat {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--gray-600);
    font-weight: 600;
}
.geburtstag-info a {
    color: var(--gray-800);
    text-decoration: none;
}
.geburtstag-info a:hover {
    color: var(--primary);
}

/* Ehrungen Badges */
.badge-gold {
    background: linear-gradient(135deg, #d4a017, #f5d020);
    color: #5a3e00;
}
.badge-silber {
    background: linear-gradient(135deg, #a0a0a0, #d0d0d0);
    color: #333;
}

/* Tabellen: Warn-Zeile */
.row-warning {
    background: #fff8e1 !important;
}

/* Aushänge (Schwarzes Brett) */
.aushang-liste {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.aushang-eintrag {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1rem;
}
.aushang-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}
.aushang-inhalt {
    color: var(--gray-700);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

/* Sportplatz-Grafik */
.pitch-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}
.pitch-container svg {
    width: 100%;
    height: auto;
}
.pitch-banner {
    cursor: grab;
    transition: opacity 0.2s, filter 0.2s;
}
.pitch-banner:hover {
    opacity: 0.85;
    filter: brightness(1.1);
}
.pitch-banner:active {
    cursor: grabbing;
}
.pitch-tooltip {
    position: absolute;
    background: var(--gray-800);
    color: var(--white);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.8rem;
    white-space: nowrap;
    pointer-events: none;
    z-index: 100;
    transform: translate(-50%, -100%);
    margin-top: -8px;
}
.pitch-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--gray-800);
}
.pitch-banner-overlay {
    position: absolute;
    height: 2.2%;
    min-height: 10px;
    border-radius: 2px;
    border: 2px solid;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 4px;
    transition: box-shadow 0.15s, transform 0.1s;
    z-index: 10;
    text-shadow: 0 1px 1px rgba(0,0,0,0.3);
}
.pitch-banner-overlay:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    z-index: 20;
}
.pitch-banner-overlay.is-dragging {
    cursor: grabbing;
    box-shadow: 0 4px 12px rgba(0,0,0,0.35);
    z-index: 30;
    opacity: 0.9;
}

.pitch-legende {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
    font-size: 0.85rem;
}
.pitch-legende span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.pitch-legende i {
    width: 14px;
    height: 14px;
    display: inline-block;
    border-radius: 2px;
}

/* Kalenderansicht */
.view-toggle {
    display: flex;
    gap: 0;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    overflow: hidden;
}
.view-toggle button {
    padding: 0.35rem 0.75rem;
    border: none;
    background: var(--white);
    color: var(--gray-600);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.view-toggle button.active {
    background: var(--primary);
    color: var(--white);
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--gray-200);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}
.calendar-header {
    background: var(--primary);
    color: var(--white);
    text-align: center;
    padding: 0.5rem;
    font-weight: 600;
    font-size: 0.8rem;
}
.calendar-day {
    background: var(--white);
    /* Hoeher als frueher (80px): sonst quetschen sich schon zwei Termine
       unleserlich uebereinander. */
    min-height: 112px;
    padding: 0.4rem 0.35rem;
    position: relative;
}
.calendar-day.other-month {
    background: var(--gray-100);
    color: var(--gray-400);
}
.calendar-day.today {
    background: #e8f0fe;
}
.calendar-day-number {
    font-weight: 700;
    font-size: 0.82rem;
    margin-bottom: 0.3rem;
    color: var(--gray-600);
    font-variant-numeric: tabular-nums;
}

@media (max-width: 700px) {
    .calendar-day { min-height: 84px; }
    .calendar-event { font-size: 0.7rem; padding: 2px 4px; }
}
.calendar-event {
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.35;
    padding: 3px 6px;
    border-radius: 4px;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: default;
    /* Farbiger Streifen links: macht die Kategorie auch dann erkennbar,
       wenn die Flaeche selbst hell bleibt. */
    border-left: 3px solid currentColor;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}
.calendar-event + .calendar-event { margin-top: 0; }
.calendar-event.event-confirmed {
    background: #d4edda;
    color: #155724;
}
.calendar-event.event-requested {
    background: #fff3cd;
    color: #856404;
}
.calendar-event.event-training {
    background: #cce5ff;
    color: #004085;
}
.calendar-event.event-match {
    background: #d4edda;
    color: #155724;
}
.calendar-event.event-maintenance {
    background: #fff3cd;
    color: #856404;
}
.calendar-event.event-event {
    background: #d1ecf1;
    color: #0c5460;
}
.calendar-event.event-inspection {
    background: #e2d5f1;
    color: #4a1d8e;
}
.calendar-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.calendar-nav h4 {
    min-width: 160px;
    text-align: center;
    margin: 0;
}
.calendar-nav button {
    background: none;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    color: var(--gray-700);
}
.calendar-nav button:hover {
    background: var(--gray-100);
}
@media (max-width: 768px) {
    .calendar-day {
        min-height: 50px;
    }
    .calendar-event {
        font-size: 0.6rem;
    }
}

/* ========== Preisliste Druckansicht ========== */
.print-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 2rem;
}
.print-page {
    background: #fff;
    width: 100%;
    max-width: 700px;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}
.print-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid #003399;
}
.print-header h1 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.8rem;
    color: #003399;
    margin: 0 0 0.25rem;
}
.print-header h2 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.3rem;
    color: #555;
    margin: 0;
    font-weight: 500;
}
.print-columns {
    columns: 2;
    column-gap: 2rem;
}
.print-category {
    break-inside: avoid;
    margin-bottom: 1.5rem;
}
.print-category h3 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.05rem;
    color: #003399;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.3rem;
    margin-bottom: 0.5rem;
}
.print-category h3 i {
    width: 20px;
    text-align: center;
    margin-right: 0.3rem;
}
.print-item {
    display: flex;
    align-items: baseline;
    padding: 0.25rem 0;
    font-size: 0.95rem;
}
.print-item span:first-child {
    flex: 1;
    font-weight: 600;
}
.print-size {
    color: #888;
    font-size: 0.85rem;
    margin: 0 0.5rem;
    min-width: 40px;
    text-align: center;
}
.print-price {
    font-weight: 700;
    color: #003399;
    min-width: 60px;
    text-align: right;
}
.print-footer {
    margin-top: 1.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid #ddd;
    text-align: center;
    font-size: 0.8rem;
    color: #888;
}

@media print {
    body * { visibility: hidden !important; }
    .print-overlay,
    .print-overlay * { visibility: visible !important; }
    .print-overlay {
        position: absolute;
        inset: 0;
        background: #fff;
        padding: 0;
    }
    .print-page {
        box-shadow: none;
        border-radius: 0;
        max-width: 100%;
        padding: 1.5cm;
    }
    .no-print { display: none !important; }
}

@media (max-width: 600px) {
    .print-columns { columns: 1; }
}

/* ============================================================
   Kanban-Board (Aufgaben)
   ============================================================ */
.kanban-board {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    min-height: 500px;
    align-items: flex-start;
}

.kanban-column {
    flex: 1;
    min-width: 280px;
    max-width: 380px;
    background: var(--gray-100);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
}

.kanban-column-header {
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid var(--gray-300);
    border-radius: var(--radius) var(--radius) 0 0;
}

.kanban-column-header h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.kanban-count {
    background: var(--gray-300);
    color: var(--gray-700);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: 'Source Sans 3', sans-serif;
}

.kanban-column.col-offen .kanban-column-header { border-bottom-color: var(--warning); }
.kanban-column.col-offen .kanban-count { background: #fff3cd; color: #856404; }

.kanban-column.col-bearbeitung .kanban-column-header { border-bottom-color: var(--primary); }
.kanban-column.col-bearbeitung .kanban-count { background: var(--primary-bg); color: var(--primary); }

.kanban-column.col-erledigt .kanban-column-header { border-bottom-color: var(--success); }
.kanban-column.col-erledigt .kanban-count { background: #d4edda; color: #155724; }

.kanban-cards {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex: 1;
    min-height: 100px;
}

.kanban-card {
    background: var(--white);
    border-radius: 6px;
    padding: 0.85rem 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border-left: 3px solid var(--gray-300);
    cursor: default;
    transition: box-shadow 0.15s, transform 0.15s;
}

.kanban-card:hover {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.kanban-card.prio-dringend { border-left-color: var(--danger); }
.kanban-card.prio-hoch { border-left-color: #fd7e14; }
.kanban-card.prio-normal { border-left-color: var(--primary); }
.kanban-card.prio-niedrig { border-left-color: var(--gray-400); }

.kanban-card-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
    color: var(--gray-800);
    line-height: 1.3;
}

.kanban-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.78rem;
    color: var(--gray-500);
}

.kanban-card-meta i { font-size: 0.7rem; }

.kanban-card-bereich {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1rem 0.5rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
}

.bereich-vereinsheim { background: #e8f5e9; color: #2e7d32; }
.bereich-sportplatz { background: #e3f2fd; color: #1565c0; }
.bereich-finanzen { background: #fff3e0; color: #e65100; }
.bereich-vorstand { background: #f3e5f5; color: #7b1fa2; }
.bereich-allgemein { background: var(--gray-200); color: var(--gray-700); }

.kanban-card-actions {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.6rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--gray-200);
}

.kanban-card-actions .btn { padding: 0.2rem 0.5rem; font-size: 0.75rem; }

.kanban-ueberfaellig {
    color: var(--danger);
    font-weight: 600;
}

.kanban-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--gray-400);
    font-size: 0.85rem;
    font-style: italic;
}

/* Aufgaben-Filter-Bar */
.aufgaben-filter {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1.25rem;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    border-radius: 50px;
    border: 1px solid var(--gray-300);
    background: var(--white);
    font-size: 0.82rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--gray-600);
}

.filter-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-chip.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

@media (max-width: 768px) {
    .kanban-board {
        flex-direction: column;
    }
    .kanban-column {
        min-width: 100%;
        max-width: 100%;
    }
}

/* ============================================================
   Wiki
   ============================================================ */
.wiki-pinned-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.wiki-pinned-card {
    background: var(--gray-100);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;
}

.wiki-pinned-card:hover {
    border-color: var(--primary);
    background: var(--primary-bg);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.wiki-pinned-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--primary-bg);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 0.6rem;
}

.wiki-pinned-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gray-800);
    line-height: 1.3;
    margin-bottom: 0.25rem;
}

.wiki-pinned-kat {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.wiki-artikel-liste {
    display: flex;
    flex-direction: column;
}

.wiki-artikel-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--gray-200);
    cursor: pointer;
    transition: background 0.1s;
}

.wiki-artikel-row:last-child { border-bottom: none; }
.wiki-artikel-row:hover { background: var(--primary-bg); }

.wiki-artikel-row-icon {
    flex-shrink: 0;
    font-size: 0.9rem;
}

.wiki-artikel-row-content { flex: 1; min-width: 0; }

.wiki-artikel-row-titel {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--gray-800);
}

.wiki-artikel-row-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.78rem;
    color: var(--gray-500);
    margin-top: 0.15rem;
}

.wiki-artikel-row-meta i { font-size: 0.7rem; }

.wiki-kat-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--primary-bg);
    color: var(--primary);
}

.wiki-suchergebnis {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--gray-200);
    cursor: pointer;
    transition: background 0.1s;
}

.wiki-suchergebnis:last-child { border-bottom: none; }
.wiki-suchergebnis:hover { background: var(--primary-bg); }

.wiki-suchergebnis-titel {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.2rem;
}

.wiki-suchergebnis-titel i { color: var(--primary); margin-right: 0.3rem; }

.wiki-suchergebnis-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--gray-500);
}

/* Wiki Inhalt-Formatierung */
.wiki-inhalt h3 {
    font-size: 1.15rem;
    color: var(--primary-dark);
    margin: 1.5rem 0 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid var(--primary-bg);
}

.wiki-inhalt h3:first-child { margin-top: 0; }

.wiki-inhalt p { margin-bottom: 0.75rem; line-height: 1.7; }

.wiki-inhalt ul, .wiki-inhalt ol {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
}

.wiki-inhalt li { margin-bottom: 0.3rem; line-height: 1.6; }

.wiki-inhalt .table { margin: 1rem 0; }

.wiki-hinweis {
    background: #fff3cd;
    border-left: 4px solid var(--warning);
    padding: 0.85rem 1rem;
    border-radius: 0 6px 6px 0;
    margin: 1rem 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

.wiki-info {
    background: #d1ecf1;
    border-left: 4px solid var(--info);
    padding: 0.85rem 1rem;
    border-radius: 0 6px 6px 0;
    margin: 1rem 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Wiki Editor Toolbar */
.wiki-toolbar {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    padding: 0.4rem;
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-bottom: none;
    border-radius: 6px 6px 0 0;
}

.wiki-tb-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    border-radius: 4px;
    cursor: pointer;
    color: var(--gray-600);
    font-size: 0.85rem;
    transition: all 0.1s;
}

.wiki-tb-btn:hover {
    background: var(--white);
    color: var(--primary);
}

.wiki-tb-sep {
    width: 1px;
    background: var(--gray-300);
    margin: 0 0.25rem;
}

@media (max-width: 768px) {
    .wiki-pinned-grid { grid-template-columns: 1fr 1fr; }
    .wiki-artikel-row-meta { flex-direction: column; gap: 0.15rem; }
}

/* ============================================================
   Finanz-Dashboard
   ============================================================ */

.finanz-chart {
    display: flex;
    align-items: flex-end;
    gap: 0.25rem;
    height: 180px;
    padding: 0.5rem 0;
}

.finanz-chart-monat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.finanz-chart-bars {
    flex: 1;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    width: 100%;
    justify-content: center;
}

.finanz-chart-bar {
    width: 40%;
    max-width: 24px;
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    transition: height 0.4s ease;
    cursor: default;
}

.finanz-chart-bar.einnahmen {
    background: var(--success);
}

.finanz-chart-bar.ausgaben {
    background: var(--danger);
}

.finanz-chart-label {
    font-size: 0.7rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
    font-weight: 600;
}

.finanz-legend {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    vertical-align: middle;
    margin-right: 0.25rem;
}

.finanz-legend.einnahmen {
    background: var(--success);
}

.finanz-legend.ausgaben {
    background: var(--danger);
}

.finanz-ks-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Buchhaltung-Banner */
.buch-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius);
    color: var(--white);
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
}

.buch-banner:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.buch-banner-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.buch-banner-text {
    flex: 1;
}

.buch-banner-text strong {
    display: block;
    font-size: 1rem;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
}

.buch-banner-text span {
    font-size: 0.75rem;
    opacity: 0.75;
}

.buch-banner-lock {
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .finanz-chart { height: 120px; }
    .finanz-chart-label { font-size: 0.6rem; }
    .buch-banner-lock { display: none; }
    .buch-banner-text span { display: none; }
}

/* ============================================================
   Veranstaltungen
   ============================================================ */

.va-card.va-vergangen { opacity: 0.6; }

.va-row {
    display: flex;
    gap: 0;
    min-height: 100px;
}

.va-datum {
    width: 72px;
    min-width: 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.5rem;
    background: var(--gray-50);
    border-right: 3px solid var(--gray-200);
    text-align: center;
}

.va-datum-geplant { border-right-color: var(--primary); }
.va-datum-vorbereitung { border-right-color: var(--warning); }
.va-datum-abgeschlossen { border-right-color: var(--success); }

.va-datum-tag {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Barlow Condensed', sans-serif;
    line-height: 1;
    color: var(--gray-800);
}

.va-datum-monat {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--primary);
}

.va-datum-jahr {
    font-size: 0.65rem;
    color: var(--gray-400);
}

.va-inhalt {
    flex: 1;
    padding: 0.75rem 1rem;
    min-width: 0;
}

.va-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.35rem;
}

.va-name {
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Barlow Condensed', sans-serif;
    margin: 0;
}

.va-badges {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.va-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--gray-500);
}

.va-details i { margin-right: 0.15rem; }

.va-beschreibung {
    font-size: 0.8rem;
    color: var(--gray-600);
    margin-top: 0.4rem;
    line-height: 1.5;
}

.va-aktionen {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.75rem;
    align-items: center;
    justify-content: center;
}

/* Checkliste */
.va-checkliste {
    margin-top: 0.6rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--gray-100);
}

.va-checkliste-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.va-checkliste-bar {
    height: 4px;
    background: var(--gray-100);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.4rem;
}

.va-checkliste-progress {
    height: 100%;
    background: var(--success);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.va-checkliste-items {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.15rem 1rem;
}

.va-check-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: var(--gray-600);
    cursor: pointer;
}

.va-check-item.va-check-done span {
    text-decoration: line-through;
    color: var(--gray-400);
}

@media (max-width: 768px) {
    .va-row { flex-wrap: wrap; }
    .va-datum { width: 100%; flex-direction: row; gap: 0.5rem; border-right: none; border-bottom: 3px solid var(--gray-200); padding: 0.5rem; }
    .va-datum-geplant { border-bottom-color: var(--primary); }
    .va-datum-vorbereitung { border-bottom-color: var(--warning); }
    .va-datum-abgeschlossen { border-bottom-color: var(--success); }
    .va-aktionen { flex-direction: row; width: 100%; border-top: 1px solid var(--gray-100); padding: 0.5rem; }
    .va-checkliste-items { grid-template-columns: 1fr; }
}

/* ── Modals ── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal,
.modal-box {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.15rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--gray-500);
    padding: 0.25rem;
    line-height: 1;
}

.modal-close:hover {
    color: var(--gray-800);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--gray-200);
}

@media (max-width: 576px) {
    .modal { max-width: 100% !important; }
    .modal-footer { flex-wrap: wrap; }
}
