/* Nahtreff — gemeinsames Design-System (Light & Dark) */

:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-alt: #f8f7fc;
    --text: #262a3b;
    --text-muted: #6b7280;
    --border: #e3e1ec;
    --primary: #ff5e7e;
    --primary-dark: #e8415f;
    --accent: #ff9a56;
    --success-bg: #d4edda;
    --success-text: #155724;
    --success-border: #c3e6cb;
    --error-bg: #f8d7da;
    --error-text: #721c24;
    --error-border: #f5c6cb;
    --shadow: 0 10px 40px rgba(217, 60, 40, 0.14);
    --shadow-sm: 0 2px 10px rgba(217, 60, 40, 0.08);
    --star-color: #ffc107;
    --danger: #dc3545;
    --danger-dark: #b3202f;
    --radius-lg: 20px;
    --radius-md: 15px;
    --radius-sm: 8px;
}

:root[data-theme="dark"] {
    --bg: #11121a;
    --surface: #1b1d29;
    --surface-alt: #20222f;
    --text: #e7e8f0;
    --text-muted: #9a9db1;
    --border: #2c2f40;
    --primary: #ff7d93;
    --primary-dark: #ff5e7e;
    --accent: #ffb36b;
    --success-bg: #163828;
    --success-text: #8be3ab;
    --success-border: #1f4f36;
    --error-bg: #3a1b22;
    --error-text: #ff9fab;
    --error-border: #5a2530;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
    --star-color: #ffd54a;
    --danger: #e4566d;
    --danger-dark: #ff7c8e;
}

/* Ocean (Blau/Türkis) */
:root[data-palette="ocean"] {
    --bg: #eef6fb;
    --surface: #ffffff;
    --surface-alt: #f3f9fc;
    --text: #1c2b33;
    --text-muted: #5b7480;
    --border: #d9e8f0;
    --primary: #2f8fd6;
    --primary-dark: #1f72b0;
    --accent: #35c6b0;
    --success-bg: #d4edda;
    --success-text: #155724;
    --success-border: #c3e6cb;
    --error-bg: #f8d7da;
    --error-text: #721c24;
    --error-border: #f5c6cb;
    --shadow: 0 10px 40px rgba(47, 143, 214, 0.14);
    --shadow-sm: 0 2px 10px rgba(47, 143, 214, 0.08);
    --star-color: #ffc107;
    --danger: #dc3545;
    --danger-dark: #b3202f;
    --radius-lg: 20px;
    --radius-md: 15px;
    --radius-sm: 8px;
}

:root[data-theme="dark"][data-palette="ocean"] {
    --bg: #0d1a22;
    --surface: #132430;
    --surface-alt: #16293a;
    --text: #e3f0f5;
    --text-muted: #93b0bc;
    --border: #203648;
    --primary: #4fb3ea;
    --primary-dark: #2f8fd6;
    --accent: #3fe0c5;
    --success-bg: #163828;
    --success-text: #8be3ab;
    --success-border: #1f4f36;
    --error-bg: #3a1b22;
    --error-text: #ff9fab;
    --error-border: #5a2530;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
    --star-color: #ffd54a;
    --danger: #e4566d;
    --danger-dark: #ff7c8e;
}

/* Lavendel (Lila/Pink) */
:root[data-palette="lavender"] {
    --bg: #f6f1fb;
    --surface: #ffffff;
    --surface-alt: #faf6fd;
    --text: #2a2438;
    --text-muted: #70647f;
    --border: #e6def2;
    --primary: #9256d9;
    --primary-dark: #7a3dc0;
    --accent: #e85fa0;
    --success-bg: #d4edda;
    --success-text: #155724;
    --success-border: #c3e6cb;
    --error-bg: #f8d7da;
    --error-text: #721c24;
    --error-border: #f5c6cb;
    --shadow: 0 10px 40px rgba(146, 86, 217, 0.14);
    --shadow-sm: 0 2px 10px rgba(146, 86, 217, 0.08);
    --star-color: #ffc107;
    --danger: #dc3545;
    --danger-dark: #b3202f;
    --radius-lg: 20px;
    --radius-md: 15px;
    --radius-sm: 8px;
}

:root[data-theme="dark"][data-palette="lavender"] {
    --bg: #19131f;
    --surface: #241b2e;
    --surface-alt: #2a2036;
    --text: #efe8f7;
    --text-muted: #ab9bbd;
    --border: #392c47;
    --primary: #b07ee8;
    --primary-dark: #9256d9;
    --accent: #ff7db8;
    --success-bg: #163828;
    --success-text: #8be3ab;
    --success-border: #1f4f36;
    --error-bg: #3a1b22;
    --error-text: #ff9fab;
    --error-border: #5a2530;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
    --star-color: #ffd54a;
    --danger: #e4566d;
    --danger-dark: #ff7c8e;
}

/* Wald (Grün) */
:root[data-palette="forest"] {
    --bg: #f1f7ef;
    --surface: #ffffff;
    --surface-alt: #f6faf4;
    --text: #22301f;
    --text-muted: #5f7256;
    --border: #dde9d8;
    --primary: #3f9142;
    --primary-dark: #2f7533;
    --accent: #8bc248;
    --success-bg: #d4edda;
    --success-text: #155724;
    --success-border: #c3e6cb;
    --error-bg: #f8d7da;
    --error-text: #721c24;
    --error-border: #f5c6cb;
    --shadow: 0 10px 40px rgba(63, 145, 66, 0.14);
    --shadow-sm: 0 2px 10px rgba(63, 145, 66, 0.08);
    --star-color: #ffc107;
    --danger: #dc3545;
    --danger-dark: #b3202f;
    --radius-lg: 20px;
    --radius-md: 15px;
    --radius-sm: 8px;
}

:root[data-theme="dark"][data-palette="forest"] {
    --bg: #121a10;
    --surface: #1b2618;
    --surface-alt: #20301b;
    --text: #e6f0e1;
    --text-muted: #9bb092;
    --border: #2c3f26;
    --primary: #5fb762;
    --primary-dark: #3f9142;
    --accent: #a4e05c;
    --success-bg: #163828;
    --success-text: #8be3ab;
    --success-border: #1f4f36;
    --error-bg: #3a1b22;
    --error-text: #ff9fab;
    --error-border: #5a2530;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
    --star-color: #ffd54a;
    --danger: #e4566d;
    --danger-dark: #ff7c8e;
}

/* Sunset (Orange/Rot) */
:root[data-palette="sunset"] {
    --bg: #fff5f0;
    --surface: #ffffff;
    --surface-alt: #fff9f6;
    --text: #4a2c2a;
    --text-muted: #8a6e6c;
    --border: #f0dcd5;
    --primary: #ff7e5f;
    --primary-dark: #e66a4d;
    --accent: #feb47b;
    --success-bg: #d4edda;
    --success-text: #155724;
    --success-border: #c3e6cb;
    --error-bg: #f8d7da;
    --error-text: #721c24;
    --error-border: #f5c6cb;
    --shadow: 0 10px 40px rgba(255, 126, 95, 0.14);
    --shadow-sm: 0 2px 10px rgba(255, 126, 95, 0.08);
    --star-color: #ffc107;
    --danger: #dc3545;
    --danger-dark: #b3202f;
    --radius-lg: 20px;
    --radius-md: 15px;
    --radius-sm: 8px;
}

:root[data-theme="dark"][data-palette="sunset"] {
    --bg: #2a1a18;
    --surface: #352220;
    --surface-alt: #3d2a28;
    --text: #fbeae8;
    --text-muted: #bca5a3;
    --border: #4d3a38;
    --primary: #ff8c70;
    --primary-dark: #ff7e5f;
    --accent: #ffc0a0;
    --success-bg: #163828;
    --success-text: #8be3ab;
    --success-border: #1f4f36;
    --error-bg: #3a1b22;
    --error-text: #ff9fab;
    --error-border: #5a2530;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
    --star-color: #ffd54a;
    --danger: #e4566d;
    --danger-dark: #ff7c8e;
}

/* Midnight (Tiefblau/Lila) */
:root[data-palette="midnight"] {
    --bg: #eef2ff;
    --surface: #ffffff;
    --surface-alt: #f5f7ff;
    --text: #1e1b4b;
    --text-muted: #6366f1;
    --border: #dbeafe;
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --accent: #a5b4fc;
    --success-bg: #d4edda;
    --success-text: #155724;
    --success-border: #c3e6cb;
    --error-bg: #f8d7da;
    --error-text: #721c24;
    --error-border: #f5c6cb;
    --shadow: 0 10px 40px rgba(79, 70, 229, 0.14);
    --shadow-sm: 0 2px 10px rgba(79, 70, 229, 0.08);
    --star-color: #ffc107;
    --danger: #dc3545;
    --danger-dark: #b3202f;
    --radius-lg: 20px;
    --radius-md: 15px;
    --radius-sm: 8px;
}

:root[data-theme="dark"][data-palette="midnight"] {
    --bg: #0f0c29;
    --surface: #1a1635;
    --surface-alt: #211c40;
    --text: #e0e7ff;
    --text-muted: #818cf8;
    --border: #2e2a5e;
    --primary: #818cf8;
    --primary-dark: #4f46e5;
    --accent: #c7d2fe;
    --success-bg: #163828;
    --success-text: #8be3ab;
    --success-border: #1f4f36;
    --error-bg: #3a1b22;
    --error-text: #ff9fab;
    --error-border: #5a2530;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.3);
    --star-color: #ffd54a;
    --danger: #e4566d;
    --danger-dark: #ff7c8e;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: background-color 0.2s ease, color 0.2s ease;
}

a { color: inherit; }

/* Debug-Modus-Banner */

.debug-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 6px 16px;
    background: var(--danger, #d9534f);
    color: #fff;
    font-size: 0.85rem;
    flex-shrink: 0;
    z-index: 20;
}

.debug-banner-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.debug-banner-close:hover {
    opacity: 0.8;
}

/* Top navigation */

.topnav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 5px 30px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    flex-shrink: 0;
    z-index: 10;
}

.topnav .brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.6em;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: 0.5px;
}

.topnav .brand .brand-mark {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}

.topnav .brand span {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.topnav .nav-links {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.topnav .nav-link {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 20px;
    transition: background-color 0.2s;
}

.topnav .nav-link:hover {
    background: var(--surface-alt);
}

.topnav .nav-link.primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
}

.theme-toggle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, transform 0.2s;
}

/* User menu (Navbar-Dropdown) */

.user-menu {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 6px;
    border: none;
    background: transparent;
    border-radius: 20px;
    color: var(--text);
    font-family: inherit;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.user-menu-trigger:hover {
    background: var(--surface-alt);
}

.user-menu-name {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-caret {
    color: var(--text-muted);
    font-size: 0.8em;
}

.user-menu-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    padding: 6px;
    z-index: 20;
}

.user-menu-dropdown.open {
    display: block;
}

.user-menu-header {
    padding: 8px 12px 10px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85em;
    line-height: 1.5;
}

.user-menu-header strong {
    color: var(--text);
}

.user-menu-item {
    display: block;
    width: 100%;
    padding: 9px 12px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 0.95em;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.user-menu-item:hover {
    background: var(--surface-alt);
}

.form-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}
.form-row .form-group {
    flex: 1;
    min-width: 200px;
    max-width: 450px;
}

/* Interactive Star Rating */
.star-rating {
    display: inline-flex;
    gap: 4px;
    font-size: 1.2em;
}
.star {
    color: rgba(204, 204, 204, 0.3);
    transition: color 0.2s;
    cursor: default;
}
.star.filled {
    color: #ffcc00;
}

.skill-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
    background: var(--surface-alt);
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.skill-row .star-rating {
    cursor: pointer;
}
.skill-row .star {
    cursor: pointer;
}
.skill-row .star:hover, .skill-row .star.hover {
    color: #ffda44;
}
.skill-row input {
    flex: 1;
}
.skill-row .star-rating {
    flex-shrink: 0;
}
.skill-row .btn-danger {
    padding: 5px 10px;
}

.user-menu-form {
    margin: 0;
}

.site-footer {
    position: relative;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    padding: 10px 20px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.site-footer a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9em;
}

.site-footer a:hover {
    color: var(--text);
    text-decoration: underline;
}

.footer-flash-messages {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 320px;
    z-index: 10;
}

.footer-flash-messages .flash {
    margin-bottom: 8px;
    padding: 12px 16px;
    font-size: 0.9em;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--primary);
    background: var(--surface);
    border-radius: var(--radius-md);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 30px;
    background: var(--surface-alt);
    border-bottom: 1px solid var(--border);
    font-size: 0.9em;
    flex-shrink: 0;
}

.breadcrumbs a {
    color: var(--text-muted);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.breadcrumb-sep {
    color: var(--text-muted);
    opacity: 0.6;
}

.breadcrumb-current {
    color: var(--text);
    font-weight: 600;
}

.theme-toggle:hover {
    border-color: var(--primary);
    transform: scale(1.05);
}

/* Page shell */

.page {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 30px 20px;
    flex: 1 1 auto;
    overflow-y: auto;
}

.page.narrow {
    max-width: 600px;
}

.page.full-bleed {
    max-width: none;
}

.page.flush {
    padding: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--text-muted);
    text-decoration: none;
}

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

/* Flash messages */

.flash {
    padding: 15px;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    border: 1px solid var(--border);
    background: var(--surface-alt);
    color: var(--text);
}

.flash.success {
    background: var(--success-bg);
    color: var(--success-text);
    border-color: var(--success-border);
}

.flash.error {
    background: var(--error-bg);
    color: var(--error-text);
    border-color: var(--error-border);
}

/* Cards / surfaces */

.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 40px;
    margin-bottom: 30px;
}

.section {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 30px;
    margin-bottom: 30px;
}

.section-title {
    font-size: 1.5em;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
}

.section-heading {
    font-size: 1.6em;
    margin: 10px 0 20px;
    text-align: center;
}

/* Mitglieder-Karte */

.map-card {
    margin-bottom: 30px;
    padding: 30px;
}

#member-map {
    height: 420px;
    border-radius: var(--radius-md);
    z-index: 0;
}

.map-login-teaser {
    text-align: center;
    padding: 30px 0;
}

.map-login-teaser .hero-actions {
    justify-content: center;
    margin-top: 15px;
}

.member-heart-marker svg,
.member-heart-cluster svg {
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
}

.member-heart-cluster {
    position: relative;
}

.member-heart-cluster span {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 82%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.75em;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* Admin */

.admin-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.admin-row:last-child { border-bottom: none; }

.admin-row-info {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

/* Headings / hero */

.hero {
    text-align: center;
    padding: 50px 20px 40px;
}

.hero h1 {
    font-size: 2.6em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.hero h1 .brand-mark {
    width: 0.78em;
    height: 0.78em;
    flex-shrink: 0;
}

.hero .subtitle {
    font-size: 1.15em;
    color: var(--text-muted);
    margin-bottom: 25px;
}

.hero-landing {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    padding: 40px 20px 50px;
    margin-bottom: 10px;
}

.hero-landing::before {
    content: '';
    position: absolute;
    inset: -40% -10%;
    background:
        radial-gradient(circle at 30% 30%, var(--primary) 0%, transparent 60%),
        radial-gradient(circle at 70% 70%, var(--accent) 0%, transparent 60%);
    opacity: 0.25;
    filter: blur(40px);
    z-index: 0;
}

.hero-landing > * { position: relative; z-index: 1; }

.hero-landing h1 {
    font-size: 3.2em;
    text-shadow: 0 0 16px var(--surface), 0 0 30px var(--surface), 0 0 30px var(--surface);
}

.hero-landing h1 .brand-mark {
    filter: drop-shadow(0 0 8px var(--surface)) drop-shadow(0 0 8px var(--surface));
}

.hero-landing .subtitle {
    text-shadow: 0 0 14px var(--surface), 0 0 26px var(--surface), 0 0 26px var(--surface);
}

.hero-illustration {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 560px;
    height: auto;
    max-width: 95%;
    opacity: 0.45;
    z-index: 0;
    pointer-events: none;
}

.hero-stats {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    background: var(--surface);
    padding: 8px 22px;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 25px;
    font-weight: 600;
}

.hero-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

.featured-card {
    position: relative;
    border: 2px solid transparent;
    background-image: linear-gradient(var(--surface), var(--surface)),
                       linear-gradient(135deg, var(--primary), var(--accent));
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

.featured-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    font-size: 0.75em;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
}

h1, h2, h3 { color: var(--text); }

.form-title { text-align: center; margin-bottom: 10px; }
.form-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 30px; }

/* Buttons */

.btn {
    display: inline-block;
    padding: 13px 30px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1em;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255, 94, 126, 0.35);
}

.btn:disabled, .btn:disabled:hover {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: var(--surface-alt);
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-danger {
    background: var(--danger);
    background-image: none;
}

.btn-small { padding: 8px 20px; font-size: 0.9em; }

.btn.active,
.btn-secondary.active {
    background: var(--primary);
    color: white;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.35);
}

/* Forms */

.form-group { margin-bottom: 20px; }

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1em;
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.2s;
}

input::placeholder, textarea::placeholder { color: var(--text-muted); }

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
}

textarea { resize: vertical; min-height: 100px; }

.radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.radio-item { position: relative; }
.radio-item input[type="checkbox"],
.radio-item input[type="radio"] { position: absolute; opacity: 0; }

.radio-label {
    display: block;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.radio-item input:checked + .radio-label {
    border-color: var(--primary);
    background: var(--surface-alt);
}

.radio-label:hover { background: var(--surface-alt); }

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    align-items: start;
}

.filter-grid.compact {
    gap: 14px;
    margin-top: 14px;
}

.filter-grid.compact .form-group { margin-bottom: 0; }

.search-card { padding: 24px 30px; }

.gender-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gender-pills .radio-item { position: relative; }

.radio-label.pill {
    padding: 8px 18px;
    border-radius: 20px;
}

.search-actions { display: flex; align-items: flex-end; }

.radio-group.filter-compact {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.radio-group.filter-compact .radio-label { padding: 10px; }

.form-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-muted);
}

.form-footer a { color: var(--primary); text-decoration: none; font-weight: 500; }
.form-footer a:hover { text-decoration: underline; }

/* Users grid (index) */

.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.user-card {
    position: relative;
    display: block;
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 30px;
    text-align: center;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.user-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
    color: white;
    flex-shrink: 0;
}

.avatar.lg { width: 150px; height: 150px; font-size: 4em; }

.avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.avatar.sm { width: 48px; height: 48px; font-size: 1.2em; margin: 0; }
.avatar.xs { width: 32px; height: 32px; font-size: 0.9em; margin: 0; }

.username { font-size: 1.3em; margin-bottom: 5px; }
.bio { color: var(--text-muted); margin-bottom: 15px; }

.skills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 15px; justify-content: center; }

.skill-badge {
    background: var(--primary);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85em;
}

.skill-badge.prof-5 { background: #3fae57; }
.skill-badge.prof-4 { background: #2f8fe0; }
.skill-badge.prof-3 { background: #e08a20; }
.skill-badge.prof-2 { background: #e0b020; }
.skill-badge.prof-1 { background: #e0514a; }

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 60px 20px;
}

/* Profile page */

.profile-header {
    display: flex;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
}

.profile-info { flex: 1; min-width: 200px; }
.profile-info .name { font-size: 2.2em; margin-bottom: 8px; }
.profile-info .handle { color: var(--text-muted); margin-bottom: 12px; }
.profile-info .email { color: var(--primary); text-decoration: none; font-weight: 500; }

.profile-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }

.tag {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 15px;
    font-size: 0.9em;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    color: var(--text);
}

.profile-actions { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }

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

.skill-card, .hobby-card {
    padding: 15px;
    background: var(--surface-alt);
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.skill-level { display: flex; gap: 3px; }

.hobbies-list { display: flex; flex-wrap: wrap; gap: 10px; }

.hobby-badge {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 1.05em;
}

.experience-item {
    padding: 20px;
    border-left: 4px solid var(--primary);
    background: var(--surface-alt);
    margin-bottom: 15px;
    border-radius: 0 10px 10px 0;
}

.experience-title { font-size: 1.15em; margin-bottom: 5px; }
.experience-company { color: var(--text-muted); margin-bottom: 5px; }
.experience-date { color: var(--text-muted); font-size: 0.9em; margin-bottom: 10px; }
.experience-desc { color: var(--text); }

/* Fotos */

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
}

.photo-card {
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface-alt);
    text-align: center;
}

.photo-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

.photo-card-footer {
    padding: 10px;
}

.rate-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.rate-btn {
    flex: 1;
    padding: 8px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-size: 1.1em;
    transition: all 0.2s;
}

.rate-btn:hover { border-color: var(--primary); background: var(--surface-alt); }
.rate-btn.active-like { border-color: #3fae57; background: var(--surface-alt); }
.rate-btn.active-pass { border-color: var(--danger); background: var(--surface-alt); }

.photo-counts {
    font-size: 0.9em;
    color: var(--text-muted);
}

.photo-upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.photo-manage-card {
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface-alt);
    text-align: center;
}

.photo-manage-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

.photo-manage-footer {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.photo-status {
    font-size: 0.8em;
    padding: 3px 8px;
    border-radius: 10px;
    display: inline-block;
}

.photo-status.pending { background: var(--error-bg); color: var(--error-text); }
.photo-status.approved { background: var(--success-bg); color: var(--success-text); }

.admin-photo-thumb {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

/* Badges & Online-Status */

.nav-badge {
    display: inline-block;
    min-width: 18px;
    padding: 1px 6px;
    margin-left: 4px;
    background: var(--danger);
    color: white;
    font-size: 0.75em;
    font-weight: 700;
    border-radius: 10px;
    text-align: center;
}

.online-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #3fae57;
    vertical-align: middle;
}

.online-status { color: var(--text-muted); font-size: 0.95em; margin-bottom: 8px; }

.match-tag { background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%); color: white; border: none; }

/* Melden-Formular */

.report-form {
    display: none;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.report-form.visible { display: block; }

/* Settings-Banner für Status-Elemente (Profilvollständigkeit, Pro etc.) */
.settings-banner {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.banner-title {
    font-size: 1.6em;
    font-weight: 800;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.banner-text {
    color: var(--text-muted);
    font-size: 1.05em;
}
.progress-bar-banner {
    width: 100%;
    max-width: 900px;
    height: 16px;
    background: var(--surface-alt);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}
.progress-fill-banner {
    height: 100%;
    background: linear-gradient(to right, var(--primary) 0%, var(--accent) 100%);
    transition: width 0.5s ease-out;
}

/* Admin-Statistiken */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.stat-value { font-size: 1.8em; font-weight: 800; color: var(--primary); }
.stat-label { color: var(--text-muted); font-size: 0.9em; margin-top: 4px; }

/* Matches & Benachrichtigungen */

.match-row, .notification-row {
    text-decoration: none;
    color: var(--text);
    cursor: pointer;
}

.notification-row.unread { background: var(--surface-alt); border-radius: var(--radius-sm); padding-left: 10px; }

/* Chat */

.chat-thread {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 50vh;
    overflow-y: auto;
    margin-bottom: 20px;
    padding: 10px;
    background: var(--surface-alt);
    border-radius: var(--radius-sm);
}

.chat-bubble {
    max-width: 75%;
    align-self: flex-start;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.chat-bubble.mine {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
}

.chat-time { font-size: 0.75em; color: var(--text-muted); margin-top: 4px; }
.chat-bubble.mine .chat-time { color: rgba(255, 255, 255, 0.8); }

.chat-form { display: flex; gap: 10px; align-items: center; }
.chat-form input[type="text"] { flex: 1; }
.chat-image-label { cursor: pointer; }

.chat-text { white-space: pre-wrap; word-break: break-word; }

.chat-image {
    max-width: 100%;
    max-height: 260px;
    border-radius: var(--radius-sm);
    display: block;
    margin-bottom: 6px;
}

.chat-delete-form { display: inline-block; margin-left: 6px; }

.chat-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85em;
    opacity: 0.7;
    padding: 0;
}

.chat-delete-btn:hover { opacity: 1; }

.emoji-picker {
    position: relative;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
    gap: 4px;
    padding: 10px 36px 10px 10px;
    margin-bottom: 10px;
    background: var(--surface-alt);
    border-radius: var(--radius-sm);
    max-height: 160px;
    overflow-y: auto;
}

.emoji-picker[hidden] { display: none; }

.emoji-picker-close {
    position: absolute;
    top: 6px;
    right: 6px;
    background: var(--surface);
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.85em;
    flex-shrink: 0;
}

.emoji-picker-close:hover { color: inherit; background: var(--border); }

.emoji-btn {
    background: none;
    border: none;
    font-size: 1.3em;
    cursor: pointer;
    border-radius: 6px;
    padding: 4px;
}

.emoji-btn:hover { background: var(--surface); }

.subscriber-tag {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    border: none;
}

.pro-badge {
    display: inline-block;
    vertical-align: middle;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    font-size: 0.45em;
    font-weight: 800;
    letter-spacing: 0.05em;
    padding: 5px 12px;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
}

.tag-danger {
    background: var(--error-bg);
    color: var(--error-text);
    border-color: var(--error-border);
}

.totp-qr {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.totp-qr svg { width: 220px; height: 220px; background: white; padding: 10px; border-radius: var(--radius-sm); }

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 30px 0 10px;
}

.pager-info { color: var(--text-muted); font-size: 0.95em; }

.pager-disabled {
    opacity: 0.4;
    pointer-events: none;
}

@media (max-width: 600px) {
    .topnav { padding: 14px 16px; }
    .page { padding: 20px 14px; }
    .card { padding: 25px; }
    .profile-header { text-align: center; justify-content: center; }
    .profile-actions { justify-content: center; }
}

/* Online Users Sidebar Layout */
.main-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}
.page-center {
    flex: 1;
    overflow-y: auto;
    height: 100%;
    transition: margin-right 0.3s ease;
}
.sidebar-right {
    width: 260px;
    background: var(--surface);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: margin-right 0.3s ease, opacity 0.3s ease;
    z-index: 5;
}
.sidebar-right.hidden {
    margin-right: -260px;
    opacity: 0;
    pointer-events: none;
}
html.online-sidebar-hidden .sidebar-right {
    margin-right: -260px;
    opacity: 0;
    pointer-events: none;
    transition: none;
}
.sidebar-header {
    padding: 16px;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    background: var(--surface-alt);
    color: var(--text);
}
.user-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}
.user-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
    color: var(--text);
    text-decoration: none;
    font-size: 0.95em;
}
.user-list-item:hover {
    background: var(--surface-alt);
}
.user-list-item .status-led {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.user-list-item .led-online {
    background: #3fae57;
    box-shadow: 0 0 4px #3fae57;
}
.user-list-item .led-offline {
    background: #ccc;
}

/* Context Menu for User List */
.user-context-menu {
    position: absolute;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    z-index: 1000;
    min-width: 180px;
    padding: 6px;
    display: none;
}

.user-context-menu-item {
    display: block;
    padding: 8px 12px;
    font-size: 0.9em;
    color: var(--text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
}

.user-context-menu-item:hover {
    background: var(--surface-alt);
}

/* Simple Modal System */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.modal-overlay.open {
    display: flex;
}

.modal-container {
    background: var(--surface);
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface-alt);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.user-list-item .led-away {
    background: #ff9a56;
    box-shadow: 0 0 4px #ff9a56;
}


/* Footer Status Selector */
.footer-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
    color: var(--text-muted);
    margin-left: 20px;
}
.status-select-compact {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.85em;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}
.status-select-compact:hover {
    border-color: var(--primary);
}
.heart-pulse { animation: pulse 1.5s ease-in-out infinite; transform-origin: center; }
@keyframes pulse { 0%, 60% { transform: scale(1); } 15% { transform: scale(1.15); } 30% { transform: scale(1); } 45% { transform: scale(1.1); } }

/* ===== Mail-Client-Layout (Nachrichten) ===== */
.mail-layout {
    display: flex;
    align-items: stretch;
    flex: 1;
    min-height: 0;
    border: 1px solid var(--border);
    overflow: hidden;
    background: var(--card);
}

.mail-sidebar {
    width: var(--mail-sidebar-width, 320px);
    flex-shrink: 0;
    overflow-y: auto;
}

.mail-splitter {
    width: 6px;
    flex-shrink: 0;
    cursor: col-resize;
    background: var(--border);
    position: relative;
    transition: background 0.15s;
}

.mail-layout.sidebar-collapsed .mail-sidebar,
.mail-layout.sidebar-collapsed .mail-splitter {
    display: none;
}

.mail-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 1em;
}

.mail-sidebar-toggle:hover { background: rgba(255, 255, 255, 0.06); }

.mail-splitter::after {
    content: "";
    position: absolute;
    top: 0; bottom: 0;
    left: -3px; right: -3px;
}

.mail-splitter:hover,
.mail-splitter.dragging {
    background: var(--primary);
}

.mail-layout.no-select {
    user-select: none;
}

/* ===== Mail-Tree (Ordnerbaum in der Sidebar) ===== */
.mail-tree { padding: 6px; }

.mail-folder { border-bottom: 1px solid var(--border); }
.mail-folder:last-child { border-bottom: none; }

.mail-folder > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 8px;
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    user-select: none;
    border-radius: 6px;
}
.mail-folder > summary::-webkit-details-marker { display: none; }

.mail-folder > summary::before {
    content: "▶";
    font-size: 0.65em;
    color: var(--text-muted);
    transition: transform 0.15s;
    flex-shrink: 0;
}
.mail-folder[open] > summary::before { transform: rotate(90deg); }

.mail-folder > summary:hover { background: rgba(255, 255, 255, 0.04); }

.mail-folder-icon { flex-shrink: 0; }
.mail-folder-name { flex: 1; }

.mail-folder-count {
    background: var(--border);
    color: var(--text-muted);
    font-size: 0.75em;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 10px;
}

.mail-folder-items { padding: 2px 0 6px 0; }

.mail-tree-empty {
    color: var(--text-muted);
    font-size: 0.85em;
    padding: 6px 8px 6px 30px;
    margin: 0;
}

.mail-tree-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px 7px 28px;
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
}

.mail-tree-item:hover { background: rgba(255, 255, 255, 0.04); }

.mail-tree-item.active {
    background: rgba(88, 166, 255, 0.14);
    border-left: 3px solid var(--primary);
    padding-left: 25px;
}

.mail-tree-item .avatar.xs { flex-shrink: 0; }
.mail-tree-icon { flex-shrink: 0; font-size: 0.9em; }

.mail-tree-text {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.mail-tree-label {
    font-size: 0.88em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mail-tree-date {
    font-size: 0.75em;
    color: var(--text-muted);
    white-space: nowrap;
}

.mail-reading-pane {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.mail-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border);
}

.mail-toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.mail-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-align: center;
    padding: 40px 20px;
}

.mail-reading-pane .chat-thread { flex: 1; overflow-y: auto; }

.mail-reading-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 16px 20px 20px;
}

@media (max-width: 860px) {
    .mail-layout { flex-direction: column; min-height: 0; }
    .mail-sidebar { width: 100% !important; max-height: 320px; border-bottom: 1px solid var(--border); }
    .mail-splitter { display: none; }
    .mail-reading-pane { max-height: none; }
}

.edit-visibility-row {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: stretch;
    margin-bottom: 30px;
    flex-wrap: wrap;
}
.edit-visibility-row .card {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
    margin-bottom: 0;
}



/* Flash Messages (Top Center Notification System) */
.flash-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: auto;
    max-width: 90%;
    pointer-events: none;
}

.flash {
    pointer-events: auto;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 500;
    box-shadow: 0 12px 30px rgba(0,0,0,0.25);
    min-width: 320px;
    max-width: 600px;
    text-align: center;
    animation: slideIn 0.5s ease-out forwards;
    transition: opacity 0.5s ease, transform 0.5s ease;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    border: none;
    opacity: 1;
}

.flash.error {
    border-left: 8px solid #b91c1c;
}

.flash.success {
    border-left: 8px solid #15803d;
}

.flash.info {
    border-left: 8px solid #1d4ed8;
}

[data-theme='dark'] .flash.error {
    border-left: 8px solid #b91c1c;
}

[data-theme='dark'] .flash.success {
    border-left: 8px solid #15803d;
}

[data-theme='dark'] .flash.info {
    border-left: 8px solid #1d4ed8;
}

@keyframes slideIn {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===== Facebook-Style Layout: Topbar, linke Sidebar ===== */
.topnav { gap: 20px; padding: 8px 24px; flex-wrap: nowrap; }
.topnav .nav-links { gap: 8px; flex-wrap: nowrap; }

.topnav-search {
    flex: 0 1 380px;
    position: relative;
    margin-right: auto;
}
.topnav-search input[type="search"] {
    width: 100%;
    padding: 9px 16px 9px 38px;
    border: 2px solid transparent;
    border-radius: 24px;
    background: var(--surface-alt);
    color: var(--text);
    font-size: 0.95em;
    transition: border-color 0.2s, background-color 0.2s;
}
.topnav-search input[type="search"]:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
}
.topnav-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9em;
    pointer-events: none;
}

.nav-icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface-alt);
    text-decoration: none;
    font-size: 1.15em;
    transition: background-color 0.2s, transform 0.2s;
}
.nav-icon-btn:hover { background: var(--border); transform: scale(1.05); }
.nav-icon-btn .nav-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    margin: 0;
}

.sidebar-left {
    width: 250px;
    flex-shrink: 0;
    padding: 16px 12px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    overflow-y: auto;
}
.side-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    margin-bottom: 8px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    transition: background-color 0.15s;
}
.side-profile:hover { background: var(--surface-alt); }
.side-profile .avatar { margin: 0; }
.side-profile-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    transition: background-color 0.15s;
}
.side-link:hover { background: var(--surface-alt); }
.side-link.active {
    background: var(--surface-alt);
    color: var(--primary);
    font-weight: 700;
    box-shadow: inset 3px 0 0 var(--primary);
}
.side-icon { width: 28px; text-align: center; font-size: 1.25em; flex-shrink: 0; }
.side-link .nav-badge { margin-left: auto; }
.side-sep { height: 1px; margin: 8px 12px; background: var(--border); }

@media (max-width: 1000px) {
    .sidebar-left { display: none; }
    .topnav-search { flex-basis: 200px; }
}

/* ===== Facebook-Style: Profil mit Titelbild und Reitern ===== */
.profile-card { padding: 0; overflow: hidden; }
.profile-cover {
    height: 170px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
}
.profile-card .profile-header { padding: 0 40px 30px; align-items: flex-start; gap: 30px; }
.profile-card .profile-header > .avatar {
    margin: -80px 0 0;
    border: 5px solid var(--surface);
    box-shadow: var(--shadow-sm);
}
.profile-card .profile-info { padding-top: 18px; }

.profile-tabs {
    display: flex;
    gap: 4px;
    padding: 0 16px;
    margin-bottom: 20px;
    background: var(--surface);
    border-radius: var(--radius-md);
}
.profile-tab {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 14px 22px;
    font: inherit;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}
.profile-tab:hover { background: var(--surface-alt); color: var(--text); }
.profile-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.profile-tab-count {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 8px;
    border-radius: 10px;
    background: var(--surface-alt);
    font-size: 0.8em;
}
.tabs-enabled .tab-panel { display: none; }
.tabs-enabled .tab-panel.active { display: block; }

@media (max-width: 600px) {
    .profile-card .profile-header { padding: 0 20px 24px; }
}

/* ===== Facebook-Style: gemeinsame Seitenelemente ===== */
.card, .section {
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.card { border-radius: var(--radius-md); }
.page { max-width: 1100px; }

.hero:not(.hero-landing) { text-align: left; padding: 6px 4px 18px; }
.hero:not(.hero-landing) h1 { justify-content: flex-start; font-size: 1.9em; }
.hero:not(.hero-landing) .subtitle { margin-bottom: 0; }

input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], textarea, select {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 10px;
}
input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus,
input[type="number"]:focus, input[type="date"]:focus, textarea:focus, select:focus {
    background: var(--surface);
    border-color: var(--primary);
}

.admin-row.match-row, .notification-row.admin-row {
    padding-left: 10px;
    padding-right: 10px;
    border-radius: var(--radius-sm);
    transition: background-color 0.15s;
}
.admin-row.match-row:hover, .notification-row.admin-row:hover { background: var(--surface-alt); }

.section-title { border-bottom-width: 1px; border-bottom-color: var(--border); }

/* Mitglieder-Karten */
.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 16px;
}
.member-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: var(--text);
    transition: transform 0.2s, box-shadow 0.2s;
}
.member-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.member-card.featured { border-color: var(--primary); }
.member-card-photo {
    position: relative;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.member-card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.member-card-letter { font-size: 3.5em; font-weight: 800; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.member-card-photo .featured-badge { top: 10px; right: 10px; }
.member-card-online {
    position: absolute;
    left: 10px;
    bottom: 10px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #3fae57;
    border: 2px solid var(--surface);
}
.member-card-body { padding: 14px 16px 16px; }
.member-card-name { font-size: 1.1em; margin-bottom: 2px; }
.member-card-age { font-weight: 400; color: var(--text-muted); }
.member-card-meta { color: var(--text-muted); font-size: 0.85em; margin-bottom: 8px; }
.member-card-bio {
    color: var(--text-muted);
    font-size: 0.9em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.form-group .form-subtitle {
    text-align: left;
    margin: 6px 0 0;
    font-size: 0.85em;
}

/* ===== Facebook-Style: Login, Nachrichten, Karten ===== */
.page.auth { max-width: 1000px; }
.auth-wrap { display: flex; align-items: center; gap: 60px; min-height: 60vh; }
.auth-intro { flex: 1; }
.auth-intro-title {
    font-size: 2.4em;
    line-height: 1.15;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.auth-intro-text { font-size: 1.15em; color: var(--text-muted); margin-bottom: 20px; }
.auth-intro-list { list-style: none; padding: 0; display: grid; gap: 10px; font-weight: 500; }
.auth-card { flex: 0 0 420px; margin-bottom: 0; box-shadow: var(--shadow); }
@media (max-width: 860px) {
    .auth-wrap { flex-direction: column; gap: 24px; }
    .auth-card { flex-basis: auto; width: 100%; }
}

.hero:not(.hero-landing) .hero-actions { justify-content: flex-start; margin-top: 14px; }

.user-card { border: 1px solid var(--border); }
.stat-card { border: 1px solid var(--border); }

.mail-layout {
    background: var(--surface);
    border-radius: var(--radius-md);
}
.mail-folder > summary:hover,
.mail-tree-item:hover { background: var(--surface-alt); }
.mail-sidebar-toggle:hover { background: var(--surface-alt); }
.mail-tree-item.active { background: var(--surface-alt); }
.mail-sidebar { background: var(--surface); }
.mail-splitter { background: var(--border); }

.hero:not(.hero-landing) .subtitle + .btn { margin-top: 14px; }

/* ===== Einheitliche Seitenköpfe, leere Zustände, Überschriften ===== */
.hero:not(.hero-landing) {
    position: relative;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 28px 30px 22px;
    margin-bottom: 20px;
}
.hero:not(.hero-landing)::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 6px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
}
.hero:not(.hero-landing) h1 { margin-bottom: 4px; }

.empty-state {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 50px 30px;
}
.empty-state h2 { margin-bottom: 8px; }
.empty-state a { color: var(--primary); font-weight: 600; }

.section-heading { text-align: left; font-size: 1.35em; margin: 24px 4px 14px; }
.card .section-heading { margin-top: 0; }

.settings-banner {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 24px 28px;
}

/* ===== Einheitliches kompaktes Banner (Seitenkopf + Karten-Titel) ===== */
.hero:not(.hero-landing) {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border: none;
    color: #fff;
    padding: 26px 32px;
    box-shadow: var(--shadow-sm);
}
.hero:not(.hero-landing)::before { display: none; }
.hero:not(.hero-landing) h1,
.hero:not(.hero-landing) h2 { color: #fff; }
.hero:not(.hero-landing) .subtitle { color: rgba(255, 255, 255, 0.92); }
.hero:not(.hero-landing) .btn:not(.btn-secondary) {
    background: #fff;
    color: var(--primary-dark);
    box-shadow: none;
}
.hero:not(.hero-landing) .btn-secondary {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.8);
}

.card > .form-title:first-child,
.card > h1.section-heading:first-child {
    margin: -40px -40px 24px;
    padding: 22px 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #fff;
    text-align: left;
    font-size: 1.5em;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.card > .form-title:first-child + .form-subtitle { text-align: left; margin-top: -4px; }
@media (max-width: 600px) {
    .card > .form-title:first-child,
    .card > h1.section-heading:first-child { margin: -25px -25px 20px; padding: 18px 25px; }
}

/* ===== Chat: Eingabefeld unten angedockt ===== */
.mail-reading-body { padding-bottom: 0; }
.mail-reading-pane .chat-thread {
    flex: 1 1 0;
    min-height: 0;
    max-height: none;
    margin-bottom: 0;
}
.mail-reading-body .emoji-picker { flex-shrink: 0; margin: 10px 0 0; }
.mail-reading-body .chat-form {
    flex-shrink: 0;
    margin: 0 -20px;
    padding: 12px 20px;
    background: var(--surface);
    border-top: 1px solid var(--border);
}
.mail-reading-body .chat-form input[type="text"] { border-radius: 24px; padding: 11px 18px; }

/* ===== Chat: Verlauf bündig, ohne äußeren Innenabstand ===== */
.mail-reading-body { padding: 0; }
.mail-reading-pane .chat-thread {
    border-radius: 0;
    padding: 16px 20px;
}
.mail-reading-body .emoji-picker { margin: 0; border-radius: 0; border-top: 1px solid var(--border); }
.mail-reading-body .chat-form { margin: 0; }

/* ===== Suchfeld oben rechts, direkt vor den Icon-Buttons ===== */
.topnav-search {
    flex: 0 1 340px;
    margin-left: auto;
    margin-right: 0;
}

/* Sichtbarkeits-/Standort-Karten: drei gleich breite Karten in einer Reihe */
.edit-visibility-row { margin-top: 10px; }
.edit-visibility-row .card { flex: 1 1 260px; min-width: 260px; max-width: none; }
.edit-visibility-row .card > .form-title:first-child {
    min-height: 88px;
    display: flex;
    align-items: center;
    font-size: 1.25em;
}

/* Profilvollständigkeit innerhalb der Profil-Karte */
.completeness-box {
    margin: 0 0 28px;
    padding: 16px 20px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.completeness-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
    font-weight: 600;
}
.completeness-head strong { color: var(--primary); font-size: 1.2em; }
.completeness-box .progress-bar-banner { max-width: none; margin-bottom: 8px; background: var(--surface); }
.completeness-text { margin: 0; color: var(--text-muted); font-size: 0.95em; }

.about-text { white-space: pre-wrap; word-break: break-word; line-height: 1.6; color: var(--text); margin: 0; }

/* Status-Auswahl in der oberen Leiste */
.topnav-status { margin: 0; }
.topnav-status .status-select-compact {
    padding: 6px 12px;
    font-size: 0.9em;
    background: var(--surface-alt);
}

/* ===== Suche: strukturierte Filter-Bereiche ===== */
.search-card { padding: 8px 30px 24px; }
.filter-section { padding: 20px 0; border-bottom: 1px solid var(--border); }
.filter-title { font-size: 0.8em; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 14px; }
.filter-label { display: block; margin-bottom: 8px; font-weight: 500; }
.filter-field { margin-bottom: 16px; }
.filter-row { display: flex; gap: 16px; flex-wrap: wrap; }
.filter-row .form-group { margin-bottom: 0; flex: 0 0 140px; }
.filter-row .form-group.filter-grow { flex: 1 1 260px; max-width: 460px; }
.search-card .gender-pills { gap: 8px; }
.search-card .radio-label.pill { padding: 6px 14px; font-size: 0.92em; border-width: 1px; }
.search-card .radio-item input:checked + .radio-label.pill {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.filter-actions { display: flex; gap: 10px; margin-top: 20px; }

.filter-hint { text-transform: none; letter-spacing: 0; font-weight: 400; }

/* Tageskontingent unter dem Nachrichten-Eingabefeld */
.mail-reading-body .chat-quota {
    flex-shrink: 0;
    margin: 0 -20px;
    padding: 0 20px 10px;
    background: var(--surface);
    font-size: 0.78em;
    color: var(--text-muted);
}
.chat-quota a { color: var(--primary); font-weight: 600; text-decoration: none; }
.chat-quota a:hover { text-decoration: underline; }
.chat-quota-warn { color: var(--danger); }
.mail-reading-body .chat-quota { margin: 0; padding: 0 20px 10px; }
.mail-reading-body .chat-quota.chat-quota-warn { color: var(--danger); }

/* Platzhalter-Figur, wenn kein Hauptbild vorhanden ist */
.avatar img.avatar-default { object-fit: cover; }
.member-card-photo img.member-card-default { object-position: center 30%; }
