:root {
    --club-blue: #0057b8;
    --club-blue-dark: #003f87;
    --club-blue-light: #e8f1ff;
    --club-white: #ffffff;
    --club-gray: #f4f6f8;
    --club-border: #d8dee8;
    --club-text: #1f2937;
    --club-muted: #6b7280;
    --club-danger: #b91c1c;
    --club-danger-bg: #fee2e2;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--club-gray);
    color: var(--club-text);
}

a {
    color: inherit;
}

.topbar {
    height: 64px;
    background: var(--club-blue);
    color: var(--club-white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.topbar-title {
    font-size: 22px;
    font-weight: bold;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.topbar-user a {
    color: var(--club-white);
    text-decoration: none;
    font-weight: bold;
}

.role-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
}

.app-shell {
    display: flex;
    min-height: calc(100vh - 64px);
}

.sidebar {
    width: 240px;
    background: var(--club-blue-dark);
    color: var(--club-white);
    padding: 20px;
}

.sidebar nav a {
    display: block;
    padding: 11px 12px;
    border-radius: 8px;
    text-decoration: none;
    margin-bottom: 6px;
}

.sidebar nav a:hover {
    background: rgba(255, 255, 255, 0.14);
}

.main-content {
    flex: 1;
    padding: 28px;
}

h1 {
    margin-top: 0;
}

.card {
    background: var(--club-white);
    border: 1px solid var(--club-border);
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
    margin-bottom: 20px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 18px;
    margin-bottom: 20px;
}

.stat-card {
    min-height: 120px;
}

.stat-label {
    color: var(--club-muted);
    font-size: 14px;
    margin-bottom: 14px;
}

.stat-value {
    font-size: 36px;
    font-weight: bold;
    color: var(--club-blue);
}

.muted {
    color: var(--club-muted);
}

button,
.btn {
    background: var(--club-blue);
    color: var(--club-white);
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-weight: bold;
}

button:hover,
.btn:hover {
    background: var(--club-blue-dark);
}

input,
select,
textarea {
    width: 100%;
    padding: 10px 11px;
    border: 1px solid var(--club-border);
    border-radius: 8px;
    margin-top: 5px;
    margin-bottom: 15px;
    font: inherit;
}

label {
    font-weight: bold;
    font-size: 14px;
}

.alert {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.alert-error {
    background: var(--club-danger-bg);
    color: var(--club-danger);
}

.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--club-blue), var(--club-blue-dark));
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 380px;
    background: var(--club-white);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.login-card h1 {
    color: var(--club-blue);
    margin-bottom: 6px;
}

.login-card button {
    width: 100%;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.page-header h1 {
    margin-bottom: 4px;
}

.button-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-secondary {
    background: #e5e7eb;
    color: #1f2937;
}

.btn-secondary:hover {
    background: #d1d5db;
}

.btn-small {
    padding: 7px 10px;
    font-size: 13px;
}

.filter-form {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 16px;
    align-items: end;
}

.filter-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 11px 10px;
    border-bottom: 1px solid var(--club-border);
    text-align: left;
    vertical-align: top;
}

.data-table th {
    color: var(--club-muted);
    font-size: 13px;
    font-weight: bold;
    background: #f9fafb;
}

.table-actions {
    white-space: nowrap;
    text-align: right;
}

.status-badge {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
    background: #e5e7eb;
    color: #374151;
}

.status-aktiv {
    background: #dcfce7;
    color: #166534;
}

.status-ausgetreten {
    background: #fee2e2;
    color: #991b1b;
}

.status-archiviert {
    background: #e5e7eb;
    color: #374151;
}

.status-verstorben {
    background: #f3f4f6;
    color: #111827;
}

.status-gesperrt {
    background: #fef3c7;
    color: #92400e;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 16px 20px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 40px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 18px 24px;
}

.detail-grid dt {
    font-size: 13px;
    color: var(--club-muted);
    font-weight: bold;
    margin-bottom: 4px;
}

.detail-grid dd {
    margin: 0;
}

@media (max-width: 900px) {
    .dashboard-grid,
    .form-grid,
    .detail-grid,
    .filter-form {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
    }
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    gap: 10px 18px;
    margin-top: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    background: #f9fafb;
    border: 1px solid var(--club-border);
    border-radius: 8px;
    padding: 10px;
}

.checkbox-item input {
    width: auto;
    margin: 0;
}

.badge-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.team-badge {
    display: inline-block;
    background: var(--club-blue-light);
    color: var(--club-blue-dark);
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 13px;
    font-weight: bold;
}

@media (max-width: 900px) {
    .checkbox-grid {
        grid-template-columns: 1fr;
    }
}
.section-divider {
    border: none;
    border-top: 1px solid var(--club-border);
    margin: 24px 0;
}

.text-warning {
    color: #ff0000;
    font-weight: bold;
}

.consent-card h2 {
    margin-bottom: 4px;
}

.consent-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
}

.required-badge {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: bold;
    margin-left: 6px;
}

.toggle-line {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    background: #f9fafb;
    border: 1px solid var(--club-border);
    border-radius: 8px;
    padding: 10px 12px;
}

.toggle-line input {
    width: auto;
    margin: 0;
}

.row-warning td {
    background: #fffbeb;
}

.row-muted td {
    opacity: 0.65;
    background: #f9fafb;
}

@media (max-width: 900px) {
    .consent-card-header {
        flex-direction: column;
    }

    .toggle-line {
        width: 100%;
    }
}

.btn-danger {
    background: #b91c1c;
    color: #ffffff;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-weight: bold;
}

.btn-danger:hover {
    background: #7f1d1d;
}

.role-badge-table {
    background: var(--club-blue-light);
    color: var(--club-blue-dark);
}

.stat-link {
    text-decoration: none;
    color: inherit;
}

.stat-link:hover {
    border-color: var(--club-blue);
    box-shadow: 0 4px 14px rgba(0, 87, 184, 0.16);
}

.stat-warning {
    border-color: #f59e0b;
    background: #fffbeb;
}

.dashboard-list-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    gap: 18px;
    margin-bottom: 20px;
}

.card-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.text-warning {
    color: #b45309;
    font-weight: bold;
}

@media (max-width: 1100px) {
    .dashboard-list-grid {
        grid-template-columns: 1fr;
    }
}

.audit-table td {
    vertical-align: top;
}

.audit-json {
    max-width: 520px;
    max-height: 260px;
    overflow: auto;
    background: #f9fafb;
    border: 1px solid var(--club-border);
    border-radius: 8px;
    padding: 10px;
    font-size: 12px;
    white-space: pre-wrap;
}