/* ============================================================
   Schloss Türnich Buchungssystem - Hauptstylesheet
   Farbschema und Typografie basierend auf schloss-tuernich.de
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
    /* Schloss Türnich Farbpalette */
    --red: #CE322E;
    --darkred: #991613;
    --green: #03451C;
    --darkgreen: #123A21;
    --dark: #333333;

    /* Erweiterte Palette */
    --white: #ffffff;
    --cream: #faf8f5;
    --gray-light: #f5f5f5;
    --gray: #e5e5e5;
    --gray-medium: #979494;
    --gray-dark: #666666;
    --blackbar: #262322;

    --success: #0e840e;
    --success-light: #d8f1c4;
    --error: #CE322E;
    --error-light: #fce4e4;
    --warning: #ffa401;
    --warning-light: #fff3cd;
    --info: #17a2b8;
    --info-light: #d1ecf1;

    /* Typografie */
    --font-family: 'Lato', Calibri, Arial, sans-serif;
    --font-size-base: 16px;
    --font-size-sm: 14px;
    --font-size-lg: 18px;
    --font-size-xl: 24px;
    --line-height: 1.6;

    /* Abstände */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 40px;
    --spacing-xxl: 60px;

    /* Layout */
    --wrapper-width: 1120px;
    --wrapper-padding: 20px;
    --border-radius: 6px;
    --border-radius-lg: 15px;

    /* Schatten */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

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

html {
    font-size: var(--font-size-base);
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    font-weight: 400;
    line-height: var(--line-height);
    color: var(--dark);
    background-color: var(--cream);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Typografie --- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 300;
    line-height: 1.3;
    margin-bottom: var(--spacing-md);
    color: var(--dark);
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.2rem; }

p {
    margin-bottom: var(--spacing-md);
    line-height: 1.8;
}

a {
    color: var(--red);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--darkred);
}

/* --- Layout --- */
.wrapper {
    max-width: var(--wrapper-width);
    margin: 0 auto;
    padding: 0 var(--wrapper-padding);
}

.main-content {
    flex: 1;
    padding: var(--spacing-xl) 0;
}

/* --- Blackbar (Top) --- */
.blackbar {
    height: 20px;
    background-color: var(--blackbar);
}

/* --- Header / Navigation --- */
.site-header {
    background-color: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid var(--gray);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.site-header .wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 65px;
}

.site-header .logo img {
    height: 45px;
    width: auto;
}

.site-header .logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.site-header .logo-text {
    font-size: var(--font-size-sm);
    color: var(--gray-medium);
    font-weight: 300;
    border-left: 1px solid var(--gray);
    padding-left: var(--spacing-sm);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    flex: 1;
    justify-content: flex-end;
    margin-right: var(--spacing-lg);
}

.site-nav a {
    color: var(--dark);
    font-size: var(--font-size-sm);
    font-weight: 400;
    padding: var(--spacing-xs) 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.site-nav a:hover,
.site-nav a.active {
    color: var(--red);
    border-bottom-color: var(--red);
}

.site-nav .nav-user {
    color: var(--gray-medium);
    font-size: var(--font-size-sm);
}

.site-nav .btn-logout {
    color: var(--gray-medium);
    font-size: var(--font-size-sm);
}

.site-nav .btn-logout:hover {
    color: var(--red);
}

/* Mobile Navigation */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--dark);
    cursor: pointer;
}

/* --- Hero / Topimage --- */
.hero {
    background-color: var(--green);
    background-size: cover;
    background-position: center;
    padding: var(--spacing-xxl) 0;
    color: var(--white);
    text-align: center;
}

.hero h1 {
    color: var(--white);
    font-weight: 300;
    font-size: 2.5rem;
    margin-bottom: var(--spacing-sm);
}

.hero p {
    font-size: var(--font-size-lg);
    opacity: 0.9;
}

/* --- Cards --- */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    border: 1px solid var(--gray);
}

.card-header {
    border-bottom: 1px solid var(--gray);
    padding-bottom: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.card-header h2,
.card-header h3 {
    margin-bottom: 0;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 10px 24px;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    line-height: 1.4;
}

.btn:active {
    transform: scale(0.98);
}

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

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

.btn-secondary {
    background-color: var(--green);
    color: var(--white);
}

.btn-secondary:hover {
    background-color: var(--darkgreen);
    color: var(--white);
}

.btn-outline {
    background-color: transparent;
    color: var(--red);
    border: 2px solid var(--red);
}

.btn-outline:hover {
    background-color: var(--red);
    color: var(--white);
}

.btn-sm {
    padding: 6px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 36px;
    font-size: var(--font-size-lg);
}

.btn-block {
    display: block;
    width: 100%;
}

/* --- Formulare --- */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--dark);
    background-color: var(--white);
    border: 1px solid #bbb;
    border-radius: var(--border-radius);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(206, 50, 46, 0.15);
}

.form-control::placeholder {
    color: var(--gray-medium);
}

/* Feld-Validierungsfehler */
.has-error .form-control {
    border-color: var(--error);
    box-shadow: 0 0 0 2px rgba(206, 50, 46, 0.12);
}

.has-error label {
    color: var(--error);
}

.field-error {
    display: block;
    font-size: 0.8rem;
    color: var(--error);
    margin-top: 4px;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

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

.form-text {
    font-size: 13px;
    color: var(--gray-medium);
    margin-top: var(--spacing-xs);
}

/* --- Alerts / Flash Messages --- */
.alert {
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-md);
    font-size: var(--font-size-sm);
    border: 1px solid transparent;
}

.alert-success {
    background-color: var(--success-light);
    color: var(--success);
    border-color: #c3e6cb;
}

.alert-error {
    background-color: var(--error-light);
    color: var(--error);
    border-color: #f5c6cb;
}

.alert-warning {
    background-color: var(--warning-light);
    color: #856404;
    border-color: #ffeeba;
}

.alert-info {
    background-color: var(--info-light);
    color: #0c5460;
    border-color: #bee5eb;
}

/* --- Tabellen --- */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

table th,
table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--gray);
}

table th {
    font-weight: 700;
    background-color: var(--gray-light);
    color: var(--dark);
}

table tr:hover {
    background-color: var(--gray-light);
}

table tr:nth-child(even) {
    background-color: #fafafa;
}

/* --- Badge --- */
.badge {
    display: inline-block;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 12px;
    line-height: 1.5;
}

.badge-admin { background-color: var(--red); color: var(--white); }
.badge-verwaltung { background-color: var(--warning); color: var(--white); }
.badge-helfer { background-color: var(--green); color: var(--white); }
.badge-active { background-color: var(--success); color: var(--white); }

/* --- Dashboard Grid --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-lg);
}

.dashboard-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-lg);
    border: 1px solid var(--gray);
    transition: box-shadow 0.2s ease, transform 0.1s ease;
    text-decoration: none;
    color: var(--dark);
    display: block;
}

.dashboard-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    color: var(--dark);
}

.dashboard-card .card-icon {
    font-size: 2rem;
    color: var(--red);
    margin-bottom: var(--spacing-md);
}

.dashboard-card h3 {
    margin-bottom: var(--spacing-sm);
}

.dashboard-card p {
    color: var(--gray-dark);
    font-size: var(--font-size-sm);
    margin-bottom: 0;
}

.dashboard-card.disabled {
    opacity: 0.55;
    cursor: default;
    pointer-events: none;
}

.badge-coming-soon {
    background-color: var(--gray-medium);
    color: var(--white);
    font-size: 11px;
    font-weight: 400;
    vertical-align: middle;
}

/* --- Admin-Breadcrumbs --- */
.admin-breadcrumb {
    font-size: 0.9rem;
    color: var(--gray-dark);
    margin-bottom: var(--spacing-md);
}

.admin-breadcrumb a {
    color: var(--green);
    text-decoration: none;
}

.admin-breadcrumb a:hover {
    text-decoration: underline;
}

.admin-breadcrumb .breadcrumb-sep {
    margin: 0 8px;
    color: var(--gray-medium);
}

/* --- Login-Seite --- */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--green) 0%, var(--darkgreen) 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: var(--spacing-xl);
}

.login-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-xl);
}

.login-logo {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.login-logo img {
    height: 60px;
    width: auto;
}

.login-title {
    text-align: center;
    font-size: var(--font-size-lg);
    color: var(--dark);
    margin-bottom: var(--spacing-lg);
    font-weight: 300;
}

.login-footer {
    text-align: center;
    margin-top: var(--spacing-lg);
    font-size: var(--font-size-sm);
}

.login-footer a {
    color: var(--gray);
    text-decoration: none;
}

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

/* --- Login: Google OAuth --- */
.login-divider {
    display: flex;
    align-items: center;
    margin: var(--spacing-lg) 0;
    color: var(--gray);
    font-size: var(--font-size-sm);
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.login-divider span {
    padding: 0 var(--spacing-md);
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    background: #fff;
    color: #333;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.btn-google:hover {
    background: #f7f7f7;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    text-decoration: none;
    color: #333;
}

.btn-google .google-icon {
    flex-shrink: 0;
}

/* --- Footer --- */
.site-footer {
    background-color: var(--green);
    color: rgba(255, 255, 255, 0.8);
    padding: var(--spacing-xl) 0 0;
    margin-top: auto;
}

.site-footer a {
    color: rgba(255, 255, 255, 0.8);
}

.site-footer a:hover {
    color: var(--white);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-xl);
    padding-bottom: var(--spacing-xl);
}

.footer-section h4 {
    color: var(--white);
    font-weight: 700;
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--spacing-md);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: var(--spacing-sm);
}

.footer-section ul li a {
    font-size: var(--font-size-sm);
}

.footer-bottom {
    background-color: var(--darkgreen);
    padding: var(--spacing-md) 0;
    font-size: 13px;
    text-align: center;
}

/* --- Hilfsklassen --- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-medium); }
.text-success { color: var(--success); }
.text-warning { color: #e6a817; }
.text-error { color: var(--error); }
.text-small { font-size: var(--font-size-sm); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mt-4 { margin-top: var(--spacing-xl); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--spacing-sm); }
.gap-2 { gap: var(--spacing-md); }

/* --- Responsive --- */
@media (max-width: 768px) {
    :root {
        --font-size-base: 15px;
    }

    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }

    .wrapper {
        padding: 0 var(--spacing-md);
    }

    .site-header .wrapper {
        height: 55px;
    }

    .site-nav {
        display: none;
    }

    .mobile-toggle {
        display: block;
    }

    .site-nav.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 55px;
        left: 0;
        right: 0;
        background: var(--white);
        padding: var(--spacing-md);
        box-shadow: var(--shadow-md);
        gap: var(--spacing-sm);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: var(--spacing-md);
    }

    .login-card {
        padding: var(--spacing-lg);
    }
}

/* ============================================================
   Event-Verwaltung
   ============================================================ */

/* Event-Filter */
.event-filters {
    padding: var(--spacing-sm);
}

.event-filters-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.event-filter-categories {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.event-filter-traeger select {
    min-width: 180px;
}

/* Badge-Varianten */
.badge-category {
    background: var(--green);
    color: var(--white);
    padding: 2px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-active {
    background: #d4edda;
    color: #155724;
    padding: 2px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-inactive {
    background: #f8d7da;
    color: #721c24;
    padding: 2px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-archived {
    background: #e2e3e5;
    color: #495057;
    padding: 2px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-room {
    background: #e8f4fd;
    color: #0c5b8a;
    padding: 2px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
}

/* Detail-Grid */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 0.85rem;
    color: var(--gray-dark);
    margin-bottom: 4px;
    font-weight: 600;
}

.detail-value {
    font-size: 1rem;
}

/* Bild-Grid */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--spacing-md);
}

.image-card {
    position: relative;
    border: 1px solid var(--gray);
    border-radius: var(--radius);
    overflow: hidden;
}

.image-card-primary {
    border: 2px solid var(--success);
}

.image-primary-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: var(--success);
    color: var(--white);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 1;
}

.image-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.image-card-actions {
    padding: var(--spacing-xs) var(--spacing-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gray-light);
}

/* Event-Liste: Zellen oben ausrichten */
.event-list-table td {
    vertical-align: top;
}

/* Event-Liste: Thumbnail */
.event-list-thumb-cell {
    width: 72px;
    padding: 6px 8px !important;
    vertical-align: top;
}

.event-list-thumb {
    width: 60px;
    height: 40px;
    object-fit: cover;
    border-radius: 3px;
    display: block;
}

.event-list-thumb-placeholder {
    width: 60px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-light);
    border-radius: 3px;
    color: var(--gray-medium);
    font-size: 1rem;
}

/* Aktions-Dropdown (Event-Liste u.a.) */
.action-dropdown {
    position: relative;
    display: inline-block;
}

.action-dropdown-toggle {
    background: none;
    border: 1px solid var(--gray);
    border-radius: var(--radius-sm);
    padding: 5px 10px;
    cursor: pointer;
    font-size: var(--font-size-sm);
    color: var(--dark);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.action-dropdown-toggle:hover {
    background: var(--gray-light);
    border-color: var(--gray-medium);
}

.action-dropdown-toggle .fa-chevron-down {
    font-size: 0.65em;
    opacity: 0.6;
}

.action-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background: var(--white);
    border: 1px solid var(--gray);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    min-width: 180px;
    z-index: 100;
    padding: 4px 0;
    list-style: none;
}

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

.action-dropdown-menu li {
    margin: 0;
}

.action-dropdown-menu a,
.action-dropdown-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 14px;
    font-size: var(--font-size-sm);
    color: var(--dark);
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
}

.action-dropdown-menu a:hover,
.action-dropdown-menu button:hover {
    background: var(--gray-light);
}

.action-dropdown-menu a i,
.action-dropdown-menu button i {
    width: 16px;
    text-align: center;
    color: var(--gray-medium);
}

.action-dropdown-menu .dropdown-divider {
    height: 1px;
    background: var(--gray);
    margin: 4px 0;
}

.action-dropdown-menu .text-danger {
    color: var(--red);
}

.action-dropdown-menu .text-danger i {
    color: var(--red);
}

/* Tabelle mit Dropdowns: overflow nicht abschneiden */
.table-responsive:has(.action-dropdown) {
    overflow: visible;
}

/* Formular-Erweiterungen */
.form-row {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.form-group-half {
    flex: 1;
    min-width: 200px;
}

.form-group-quarter {
    flex: 1;
    min-width: 120px;
}

.form-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--gray-medium);
    margin-top: 4px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    cursor: pointer;
}

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

.form-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
}

/* Card-Titel */
.card-title {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-md);
    color: var(--green);
    border-bottom: 2px solid var(--gray-light);
    padding-bottom: var(--spacing-xs);
}

.card-title.mb-0 {
    margin-bottom: 0;
}

/* --- Collapsible Cards --- */
.card.collapsible .card-title {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.card.collapsible .card-title::after {
    content: '\f078'; /* fa-chevron-down */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.75rem;
    color: var(--gray-medium);
    transition: transform 0.25s ease;
    flex-shrink: 0;
    margin-left: var(--spacing-sm);
}

.card.collapsible.open .card-title {
    margin-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--gray-light);
    padding-bottom: var(--spacing-xs);
}

.card.collapsible.open .card-title::after {
    transform: rotate(180deg);
}

.card.collapsible .card-body {
    display: none;
}

.card.collapsible.open .card-body {
    display: block;
}

/* Per-Card Save Button */
.card-save {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--gray-light);
    text-align: right;
}

/* Button-Gruppe */
.btn-group {
    display: flex;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}

.btn-danger {
    background: var(--red);
    color: var(--white);
    border: none;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.btn-danger:hover {
    background: var(--darkred);
}

.btn-outline-danger {
    color: var(--red);
    border-color: var(--red);
}
.btn-outline-danger:hover {
    background: var(--red);
    color: var(--white);
}

/* Aktionen-Liste (Event-Detail) */
.action-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}
.action-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--lightgray);
}
.action-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.action-info {
    flex: 1;
}
.action-info p {
    margin: 0.25rem 0 0;
}

/* Kapazitäts-Anpassung */
.capacity-adjust {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: var(--spacing-xs);
}

.capacity-input {
    width: 60px !important;
    padding: 4px 8px !important;
    font-size: 0.85rem !important;
    text-align: center;
}

/* Inline-Bearbeitung */
.edit-row td {
    background: var(--cream);
    padding: var(--spacing-md) !important;
}

.date-edit-form .form-row {
    margin-bottom: var(--spacing-sm);
}

.date-edit-form .form-actions {
    margin-top: var(--spacing-sm);
}

/* Inline-Elemente */
.d-inline {
    display: inline;
}

/* Text-Utilities */
.text-dark {
    color: var(--dark);
    text-decoration: none;
}

.text-dark:hover {
    color: var(--green);
}

.text-nowrap {
    white-space: nowrap;
}

.text-small {
    font-size: 0.85rem;
}

/* Beschreibungstext */
.description-text {
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Historien-Tabelle */
.row-current {
    background: #d4edda;
}

.row-archived {
    opacity: 0.7;
}

/* Responsive Ergänzungen */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }

    .form-group-half,
    .form-group-quarter {
        min-width: 100%;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .btn-group {
        flex-direction: column;
    }

    .btn-group .btn {
        width: 100%;
        text-align: center;
    }
}

/* --- Payment Setup Guide (Admin-Formular) --- */
.payment-setup-guide {
    margin-top: var(--spacing-md);
    border: 1px solid var(--gray);
    border-radius: var(--border-radius);
    background: var(--gray-light);
}

.payment-setup-guide summary {
    padding: 10px var(--spacing-md);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--green);
    display: flex;
    align-items: center;
    gap: 6px;
}

.payment-setup-guide summary:hover {
    background: var(--gray);
}

.payment-setup-guide .guide-content {
    padding: var(--spacing-md);
    border-top: 1px solid var(--gray);
}

.payment-setup-guide .guide-content ol {
    padding-left: var(--spacing-lg);
    margin: 0;
}

.payment-setup-guide .guide-content li {
    margin-bottom: var(--spacing-sm);
    font-size: 0.9rem;
    line-height: 1.5;
}

.payment-setup-guide .guide-content code {
    background: var(--white);
    border: 1px solid var(--gray);
    border-radius: 3px;
    padding: 1px 6px;
    font-size: 0.85em;
    word-break: break-all;
}

/* ============================================================
   Buchungsverwaltung
   ============================================================ */

/* Booking-Status-Badges */
.badge-pending { background: var(--warning-light); color: #856404; }
.badge-confirmed { background: #cce5ff; color: #004085; }
.badge-paid { background: var(--success-light); color: var(--success); }
.badge-cancelled { background: var(--gray-light); color: var(--gray-dark); }
.badge-refunded { background: #f0e0ff; color: #6f42c1; }
.badge-expired { background: #f8d7da; color: #721c24; }
.badge-waitlist { background: #fff3e0; color: #e65100; }

/* Filter-Bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 120px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-dark);
    margin-bottom: 2px;
}

.filter-group .form-control {
    padding: 6px 10px;
    font-size: 13px;
}

.filter-group select.form-control {
    padding-right: 30px;
}

.filter-group-search {
    flex: 1;
    min-width: 180px;
}

.filter-actions {
    display: flex;
    gap: var(--spacing-xs);
    align-items: flex-end;
    padding-bottom: 1px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
}

.pagination-link {
    display: inline-block;
    padding: 6px 12px;
    font-size: 13px;
    border: 1px solid var(--gray);
    border-radius: var(--border-radius);
    color: var(--dark);
    text-decoration: none;
    background: var(--white);
    transition: background 0.15s, border-color 0.15s;
}

.pagination-link:hover {
    background: var(--gray-light);
    border-color: var(--gray-medium);
    color: var(--dark);
}

.pagination-link.active {
    background: var(--red);
    border-color: var(--red);
    color: var(--white);
    font-weight: 700;
}

.pagination-ellipsis {
    display: inline-block;
    padding: 6px 8px;
    font-size: 13px;
    color: var(--gray-medium);
}

/* History-Timeline */
.history-timeline {
    position: relative;
    padding-left: 24px;
}

.history-timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: var(--gray);
}

.history-entry {
    position: relative;
    padding-bottom: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--gray-light);
}

.history-entry:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.history-marker {
    position: absolute;
    left: -20px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gray-medium);
    border: 2px solid var(--white);
}

.history-entry-current .history-marker {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(14, 132, 14, 0.2);
}

.history-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.history-details {
    color: var(--gray-dark);
}

/* Capacity-Bar */
.capacity-bar {
    height: 8px;
    background: var(--gray-light);
    border-radius: 4px;
    overflow: hidden;
}

.capacity-bar-fill {
    height: 100%;
    background: var(--success);
    border-radius: 4px;
    transition: width 0.3s;
}

.capacity-bar-fill.capacity-bar-yellow {
    background: var(--warning);
}

.capacity-bar-fill.capacity-bar-red {
    background: var(--error);
}

/* ============================================================
   Statistik-Dashboard
   ============================================================ */

/* KPI-Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.kpi-card {
    background: var(--white);
    border: 1px solid var(--gray);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.kpi-card .kpi-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--green);
    line-height: 1.2;
}

.kpi-card .kpi-label {
    font-size: 0.85rem;
    color: var(--gray-dark);
    margin-top: 4px;
}

.kpi-card .kpi-sub {
    font-size: 0.8rem;
    color: var(--gray-medium);
    margin-top: 2px;
}

/* Chart-Grid */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
}

.chart-card {
    background: var(--white);
    border: 1px solid var(--gray);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
}

.chart-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--green);
    margin-bottom: var(--spacing-md);
}

.chart-container {
    position: relative;
    width: 100%;
    height: 280px;
}

.chart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--gray-medium);
    font-style: italic;
}

/* Responsive: Buchungsverwaltung & Statistiken */
@media (max-width: 1024px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .filter-bar {
        flex-direction: column;
    }

    .filter-group {
        min-width: 100%;
    }

    .filter-group-search {
        min-width: 100%;
    }

    .chart-grid {
        grid-template-columns: 1fr;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .capacity-bar-container {
        margin-top: var(--spacing-md);
    }
}

/* ============================================================
   Admin-Nachrichtentool
   ============================================================ */

.placeholder-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.placeholder-chip {
    display: inline-block;
    padding: 2px 10px;
    font-size: var(--font-size-sm);
    background: var(--gray-light);
    border: 1px solid var(--gray);
    border-radius: 12px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s, border-color 0.15s;
}

.placeholder-chip:hover {
    background: var(--green);
    color: var(--white);
    border-color: var(--green);
}

.message-compose textarea {
    min-height: 160px;
    resize: vertical;
}

.recipient-list {
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid var(--gray);
    border-radius: var(--radius);
    padding: var(--spacing-sm);
    background: var(--white);
}

.recipient-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) 0;
    cursor: pointer;
}

.recipient-item:not(:last-child) {
    border-bottom: 1px solid var(--gray-light);
}

.recipient-item input[type="checkbox"] {
    flex-shrink: 0;
}

.recipient-name {
    font-weight: 700;
}

.message-preview {
    background: var(--gray-light);
    border: 1px solid var(--gray);
    border-radius: var(--radius);
    padding: var(--spacing-md);
}

.message-preview #previewContent {
    font-size: var(--font-size-sm);
    line-height: 1.6;
    color: var(--dark);
}

.checkbox-inline {
    display: inline;
    font-weight: 400;
    font-size: var(--font-size-sm);
}

.gap-2 {
    gap: var(--spacing-sm);
}

.ml-2 {
    margin-left: var(--spacing-sm);
}

.btn-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================================
   Nachrichtenprotokoll
   ============================================================ */
.message-log-entry .message-log-subject {
    margin-top: 4px;
}

.message-log-actions a {
    color: var(--primary);
    text-decoration: none;
    cursor: pointer;
}

.message-log-actions a:hover {
    text-decoration: underline;
}

.message-log-body-content {
    background: var(--gray-light);
    border-radius: var(--radius);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-sm);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.message-log-recipient-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: var(--font-size-sm);
}

.message-log-recipient-list li {
    padding: 2px 0;
}

.message-log-errors {
    color: var(--error);
}

.badge-info {
    background: var(--gray-medium);
    color: var(--white);
}

/* ============================================================
   Kontext-Hilfe Tooltips
   ============================================================ */
.label-with-help {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.help-tooltip {
    position: relative;
    cursor: help;
    line-height: 1;
}

.help-icon {
    font-size: 13px;
    color: var(--gray-medium);
    transition: color 0.15s;
}

.help-tooltip:hover .help-icon {
    color: var(--green);
}

.help-text {
    display: none;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    width: 286px;
    padding: 10px 12px;
    background: var(--dark);
    color: var(--white);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 100;
    animation: tooltipFadeIn 0.15s ease-out;
}

.help-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--dark);
}

.help-tooltip:hover .help-text,
.btn-help:hover > .help-text {
    display: block;
}

.btn-help {
    position: relative;
    display: inline-block;
}

@keyframes tooltipFadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(4px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@media (max-width: 480px) {
    .help-text {
        width: 220px;
        left: 0;
        transform: none;
    }
    .help-text::after {
        left: 10px;
        transform: none;
    }
    @keyframes tooltipFadeIn {
        from { opacity: 0; transform: translateY(4px); }
        to   { opacity: 1; transform: translateY(0); }
    }
}

/* ============================================================
   FAQ-Bereich
   ============================================================ */
.faq-search {
    margin-bottom: var(--spacing-lg);
}

.faq-search-field {
    position: relative;
}

.faq-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-medium);
    font-size: var(--font-size-sm);
}

.faq-search-field .form-control {
    padding-left: 40px;
    padding-right: 40px;
}

.faq-search-clear {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-medium);
    font-size: var(--font-size-lg);
    text-decoration: none;
    line-height: 1;
}

.faq-search-clear:hover {
    color: var(--error);
}

.faq-search-count {
    margin-top: var(--spacing-sm);
    font-size: var(--font-size-sm);
    color: var(--gray-dark);
}

.faq-category {
    margin-bottom: var(--spacing-lg);
}

.faq-category-title {
    font-size: var(--font-size-lg);
    color: var(--green);
    border-bottom: 2px solid var(--gray);
    padding-bottom: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.faq-category-title i {
    width: 24px;
    text-align: center;
    margin-right: 4px;
}

.faq-item {
    border: 1px solid var(--gray);
    border-radius: var(--radius);
    margin-bottom: var(--spacing-sm);
    background: var(--white);
}

.faq-question {
    padding: 14px var(--spacing-md);
    cursor: pointer;
    font-weight: 700;
    font-size: var(--font-size-base);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    user-select: none;
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 12px;
    color: var(--gray-medium);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.faq-item[open] .faq-question::after {
    transform: rotate(180deg);
}

.faq-item[open] .faq-question {
    border-bottom: 1px solid var(--gray);
}

.faq-answer {
    padding: var(--spacing-md);
    font-size: var(--font-size-sm);
    line-height: 1.7;
    color: var(--gray-dark);
}

.faq-empty {
    text-align: center;
    padding: var(--spacing-xxl) var(--spacing-lg);
    color: var(--gray-medium);
}

.faq-empty > i {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
}

.faq-empty p {
    margin-bottom: var(--spacing-md);
    font-size: var(--font-size-lg);
    color: var(--gray-dark);
}

/* ============================================================
   Mobile Gästeliste (Karten-Layout < 768px)
   ============================================================ */
@media (max-width: 768px) {
    .guest-list-table thead {
        display: none;
    }

    .guest-list-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--gray);
        border-radius: var(--border-radius);
        padding: var(--spacing-sm);
        background: var(--white);
    }

    .guest-list-table tbody tr:hover {
        background: var(--white);
    }

    .guest-list-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 4px 8px;
        border: none;
        text-align: right;
    }

    .guest-list-table tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        margin-right: 1rem;
        text-align: left;
        flex-shrink: 0;
    }

    .guest-list-table tbody td[data-label=""]::before {
        display: none;
    }

    .guest-list-table tbody td[data-label=""] {
        justify-content: flex-end;
    }

    .guest-list-table tfoot {
        display: none;
    }
}

/* ================================================================
   App Modal (Ersatz für native alert/confirm)
   ================================================================ */

.app-modal-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.app-modal-backdrop.visible {
    display: block;
    opacity: 1;
}

.app-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1001;
    padding: 16px;
    overflow-y: auto;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
}

.app-modal.visible {
    display: flex;
}

.app-modal-dialog {
    background: white;
    border-radius: var(--border-radius, 8px);
    box-shadow: var(--shadow-lg, 0 10px 40px rgba(0, 0, 0, 0.15));
    width: 100%;
    max-width: 480px;
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.app-modal.visible .app-modal-dialog {
    transform: scale(1);
    opacity: 1;
}

.app-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #e9ecef;
}

.app-modal-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text, #333);
}

.app-modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #999;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.15s;
}

.app-modal-close:hover {
    color: #555;
}

.app-modal-body {
    padding: 20px 24px;
    font-size: 0.9375rem;
    color: var(--text, #333);
    line-height: 1.5;
}

.app-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 0 0 var(--border-radius, 8px) var(--border-radius, 8px);
}

body.app-modal-open {
    overflow: hidden;
}

@media (max-width: 767px) {
    .app-modal-dialog {
        max-width: 100%;
    }
}

/* Clickable table rows */
tr.clickable-row {
    cursor: pointer;
}
tr.clickable-row:hover td {
    background: var(--bg-light, #f8f8f8);
}
tr.clickable-row a.row-link {
    position: relative;
    z-index: 1;
}
