/* (c) 2026 by Ing. F. Weijers, weijers@cyberprofis.de */
/* Für das Projekt spenden: https://paypal.me/IngWeijers */

/* ── Variables (Fitness Löwe Branding) ── */
:root {
    --primary: #1a1a1a;       /* Schwarz/Dunkel — fitness-loewe.de */
    --secondary: #c8102e;     /* Rot — Akzentfarbe */
    --accent: #f5a623;
    --teal: #329D9C;
    --text: #1a1a1a;
    --text-light: #666;
    --bg: #f4f4f4;
    --white: #fff;
    --danger: #c8102e;
    --success: #28a745;
    --warning: #ffc107;
    --border: #e0e0e0;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --radius: 8px;
    --font-heading: 'Oswald', sans-serif;
    --font-body: 'Montserrat', sans-serif;
}

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

html { font-size: 16px; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: .3px;
}

/* ── Navbar ── */
.navbar {
    background: var(--primary);
    padding: 0 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    color: var(--white);
    font-size: 1.3rem;
    font-weight: 800;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    letter-spacing: 0.3px;
}

.nav-logo { font-size: 1.5rem; }

.nav-logo-img {
    height: 36px;
    width: auto;
    object-fit: contain;
    filter: brightness(0) invert(1); /* Logo weiß in der dunklen Navbar */
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-links a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: background 0.2s;
    white-space: nowrap;
}

.nav-links a:hover { background: rgba(255,255,255,0.15); }

.nav-logout {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
}

/* Hamburger */
.hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.6rem;
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    min-width: 44px;
    min-height: 44px;
    line-height: 1;
}

.hamburger:hover { background: rgba(255,255,255,0.15); }

/* ── Container & Layout ── */
.container {
    flex: 1;
    padding: 1.5rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* ── Footer ── */
.footer {
    background: var(--primary);
    color: rgba(255,255,255,0.8);
    text-align: center;
    padding: 1rem;
    font-size: 0.85rem;
    margin-top: auto;
}

/* ── Flash Messages ── */
.flash-messages { margin-bottom: 1rem; }

.alert {
    padding: 0.9rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.alert-success { background: #d4edda; color: #155724; border-left: 4px solid var(--success); }
.alert-error   { background: #f8d7da; color: #721c24; border-left: 4px solid var(--danger); }
.alert-warning { background: #fff3cd; color: #856404; border-left: 4px solid var(--warning); }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.4rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
    gap: 0.4rem;
    min-height: 44px;
    white-space: nowrap;
}

.btn-primary   { background: var(--secondary); color: var(--white); }
.btn-primary:hover { background: #c73615; transform: translateY(-1px); }

.btn-secondary { background: #6c757d; color: var(--white); }
.btn-secondary:hover { background: #5a6268; }

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

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

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

.btn-small {
    padding: 0.4rem 0.75rem;
    font-size: 0.82rem;
    min-height: 36px;
}

.btn-disabled  { background: #ccc; color: #888; cursor: not-allowed; }

.btn-block { width: 100%; }

.btn-waitlist {
    background: var(--accent);
    color: #333;
    width: 100%;
}
.btn-waitlist:hover { background: #e0951f; }

/* WhatsApp Button */
.btn-whatsapp {
    background: #25D366;
    color: var(--white);
}
.btn-whatsapp:hover { background: #1da851; transform: translateY(-2px); box-shadow: 0 4px 15px rgba(37,211,102,0.4); }

/* ── Forms ── */
.form-group { margin-bottom: 1.25rem; }

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
    background: var(--white);
    -webkit-appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--teal);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}
.full-width { grid-column: 1 / -1; }

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    accent-color: var(--teal);
}

/* ── Cards ── */
.card {
    background: var(--white);
    padding: 1.25rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card h2, .card h3 {
    color: var(--primary);
    margin-bottom: 1rem;
}

.mb-4  { margin-bottom: 1.5rem; }
.mt-1  { margin-top: 1rem; }

/* ── Login ── */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    padding: 1rem;
}

.login-box {
    background: var(--white);
    padding: 2rem 1.75rem;
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h1 { color: var(--primary); text-align: center; margin-bottom: 0.5rem; }
.subtitle { text-align: center; color: var(--text-light); margin-bottom: 1.5rem; }

/* ── Hero / Index ── */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #2a5c8e 100%);
    color: var(--white);
    padding: 3rem 1.5rem 2.5rem;
    border-radius: 14px;
    text-align: center;
    margin-bottom: 2rem;
}

.hero-logo { font-size: 3.5rem; margin-bottom: 0.5rem; }

.hero h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.hero p { font-size: 1.05rem; opacity: 0.9; margin-bottom: 1.5rem; }

.hero-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.whatsapp-icon { display: inline-block; width: 22px; height: 22px; }

/* ── Dashboard (User) ── */
.dashboard { max-width: 1100px; margin: 0 auto; }

.user-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.user-header h1 { color: var(--primary); font-size: 1.5rem; }
.user-id { color: var(--text-light); font-size: 0.85rem; }

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.course-list { list-style: none; }

.course-item {
    padding: 0.85rem 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}
.course-item:last-child { border-bottom: none; }
.course-item.compact { flex-direction: row; }

.course-info { display: flex; flex-direction: column; gap: 0.2rem; flex: 1; min-width: 0; }
.course-info strong { color: var(--primary); font-size: 0.95rem; }
.course-info span { font-size: 0.8rem; color: var(--text-light); }

.trainer-label { font-style: italic; }

.waitlist-pos {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 600;
}

.places {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: #e9ecef;
    white-space: nowrap;
}
.places.low { background: #ffeeba; color: #856404; }
.places.empty-places { background: #f8d7da; color: #721c24; }

.empty { color: var(--text-light); text-align: center; padding: 1.5rem; font-size: 0.9rem; }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-light); }

/* ── Course Grid (Public) ── */
.courses-page { max-width: 1100px; margin: 0 auto; }

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 1.25rem;
    margin-top: 1.25rem;
}

.course-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s;
}
.course-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.12); }

.course-cancelled {
    opacity: 0.65;
    border: 2px dashed #ccc;
}

.course-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
}
.course-header h3 { color: var(--primary); font-size: 1rem; }

.course-badges { display: flex; flex-wrap: wrap; gap: 0.3rem; flex-shrink: 0; }

.course-desc { color: var(--text-light); font-size: 0.85rem; margin-bottom: 0.75rem; flex: 1; }

.course-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    font-size: 0.82rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.course-places { margin-bottom: 0.75rem; font-size: 0.9rem; }
.places-available { color: var(--success); font-weight: 600; }
.places-full { color: var(--danger); font-weight: 600; }
.waitlist-info { font-size: 0.8rem; color: var(--accent); margin-left: 0.5rem; }

.course-actions { margin-top: auto; }

.exception-notice {
    background: #fff3cd;
    border-left: 4px solid var(--warning);
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    color: #856404;
}

.booked-badge {
    display: block;
    text-align: center;
    padding: 0.65rem;
    background: #d4edda;
    color: #155724;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.waitlist-badge {
    display: block;
    text-align: center;
    padding: 0.65rem;
    background: #fff3cd;
    color: #856404;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* ── Badges ── */
.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 5px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.4;
}
.badge-tiny  { font-size: 0.68rem; padding: 0.15rem 0.4rem; }
.badge-open  { background: #d4edda; color: #155724; }
.badge-full  { background: #f8d7da; color: #721c24; }
.badge-active   { background: #d4edda; color: #155724; }
.badge-inactive { background: #f8d7da; color: #721c24; }
.badge-recurring { background: #e3f2fd; color: #0d47a1; }
.badge-exception { background: #f8d7da; color: #721c24; }

/* ── Admin Pages ── */
.admin-dashboard, .admin-page { max-width: 1000px; margin: 0 auto; }

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.page-header h1 { color: var(--primary); font-size: 1.5rem; }
.sub-info { color: var(--text-light); font-size: 0.85rem; margin-top: 0.2rem; }

.admin-badge {
    background: rgba(255,255,255,0.15);
    color: var(--primary);
    border: 1px solid var(--border);
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

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

.stat-card {
    background: var(--white);
    padding: 1.25rem;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
}
.stat-card h3 { color: var(--primary); margin-bottom: 0.4rem; font-size: 0.95rem; }
.stat-value { font-size: 2.2rem; font-weight: 800; color: var(--secondary); }
.stat-sub { font-size: 0.8rem; color: var(--text-light); }

/* ── Tables ── */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }

.admin-table {
    width: 100%;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border-collapse: collapse;
    min-width: 500px;
}

.admin-table th, .admin-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
}

.admin-table th {
    background: var(--primary);
    color: var(--white);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 0.75rem 1rem;
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #fafafa; }

.row-exception td { background: #fff8f0 !important; }
.action-cell { white-space: nowrap; }

.waitlist-count {
    background: var(--accent);
    color: #333;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.85rem;
}

.waitlist-pos-badge {
    display: inline-block;
    background: var(--teal);
    color: var(--white);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    text-align: center;
    line-height: 28px;
    font-size: 0.82rem;
    font-weight: 700;
}

/* ── Progress Bar ── */
.progress-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    display: inline-block;
    width: 60px;
    vertical-align: middle;
    margin-right: 0.4rem;
}
.progress { height: 100%; background: var(--secondary); border-radius: 4px; }

/* ── Alerts (Benachrichtigungen) ── */
.alerts-section {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
    border-left: 4px solid var(--warning);
}

.alerts-title {
    background: #fff8e1;
    padding: 0.85rem 1.25rem;
    color: #7a5c00;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-bottom: 1px solid #ffe082;
}

.alert-badge {
    background: var(--secondary);
    color: var(--white);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: auto;
}

.alert-card {
    display: flex;
    align-items: flex-start;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f5f5f5;
    gap: 0.75rem;
}
.alert-card:last-child { border-bottom: none; }

.alert-icon { font-size: 1.3rem; flex-shrink: 0; margin-top: 0.1rem; }

.alert-body { flex: 1; }
.alert-msg { font-size: 0.9rem; color: var(--text); margin-bottom: 0.25rem; }
.alert-meta { font-size: 0.78rem; color: var(--text-light); margin-bottom: 0.5rem; }

.resolve-form, .checkbox-confirm { display: inline; }

.checkbox-confirm {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--success);
    font-weight: 600;
}
.checkbox-confirm input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--success);
}

/* ── Section Headers ── */
.section-header {
    margin: 1.25rem 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}
.section-header h3 { color: var(--primary); font-size: 1rem; }

.waitlist-section-header { border-bottom-color: var(--accent); }
.waitlist-section-header h3 { color: #7a5c00; }

/* ── Assign Form ── */
.assign-form {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}
.assign-form select { flex: 1; min-width: 200px; padding: 0.65rem 0.9rem; border: 2px solid var(--border); border-radius: 8px; font-size: 0.95rem; }
.info-text { font-size: 0.85rem; color: var(--text-light); margin-top: 0.4rem; }

/* ── Exception Form ── */
.exception-form { display: flex; gap: 0.75rem; align-items: flex-end; flex-wrap: wrap; }
.exception-form .form-group { flex: 1; min-width: 160px; margin-bottom: 0; }

/* ── Info & Utility ── */
.info-box { background: #e9ecef; padding: 1rem; border-radius: 8px; font-size: 0.9rem; }
.info-box, .admin-link, .back-link { margin-top: 1.5rem; text-align: center; }
.inline-form { display: inline; }

/* ── Responsive Mobile ── */
@media (max-width: 768px) {
    html { font-size: 16px; } /* prevent iOS zoom on focus */

    .hamburger { display: flex; align-items: center; justify-content: center; }

    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--primary);
        flex-direction: column;
        padding: 0.75rem;
        gap: 0.25rem;
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
        z-index: 99;
    }

    .nav-links.open { display: flex; }

    .nav-links a {
        margin: 0;
        padding: 0.85rem 1rem;
        font-size: 1rem;
        border-radius: 8px;
    }

    .container { padding: 1rem 0.75rem; }

    .hero h1 { font-size: 1.6rem; }
    .hero { padding: 2rem 1rem; }

    .hero-actions { width: 100%; }
    .hero-actions .btn { width: 100%; max-width: 320px; }

    .courses-grid { grid-template-columns: 1fr; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(3, 1fr); }

    .page-header { flex-direction: column; align-items: flex-start; }

    .user-header { flex-direction: column; }
    .user-header .btn { width: 100%; text-align: center; }

    .assign-form { flex-direction: column; }
    .assign-form select { min-width: 100%; }
    .assign-form .btn { width: 100%; }

    .exception-form { flex-direction: column; }
    .exception-form .form-group { min-width: 100%; }

    .btn { min-height: 48px; font-size: 1rem; }
    .btn-small { min-height: 40px; }

    .admin-table th, .admin-table td { padding: 0.65rem 0.75rem; font-size: 0.82rem; }

    .course-item { flex-wrap: wrap; }
    .course-item .btn { width: 100%; margin-top: 0.5rem; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat-value { font-size: 1.8rem; }
    .course-header { flex-direction: column; align-items: flex-start; }
    .course-header .course-badges { margin-top: 0.3rem; }
    .form-grid { grid-template-columns: 1fr; }
}

/* ── Wochenplan / Kurszeilen ── */
.week-section {
    margin-bottom: 2rem;
}

.week-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    background: var(--primary);
    color: var(--white);
    padding: .75rem 1.1rem;
    border-radius: var(--radius) var(--radius) 0 0;
    flex-wrap: wrap;
}
.week-header-next { background: var(--teal); }
.week-current { background: var(--secondary) !important; }

.week-label { font-weight: 700; font-size: 1rem; }
.week-dates { font-size: .82rem; opacity: .85; }

.day-block { background: var(--white); box-shadow: var(--shadow); margin-bottom: .75rem; border-radius: var(--radius); overflow: hidden; }

.day-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    background: #f0f4f8;
    padding: .6rem 1rem;
    border-bottom: 1px solid var(--border);
}
.day-name { font-weight: 700; color: var(--primary); font-size: .95rem; }
.day-date { font-size: .82rem; color: var(--text-light); }

.day-courses { }

.course-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .75rem 1rem;
    border-bottom: 1px solid #f5f5f5;
    transition: background .15s;
}
.course-row:last-child { border-bottom: none; }
.course-row:hover { background: #fafafa; }
.course-row-booked { background: #f0fff4; }
.course-row-booked:hover { background: #e6ffed; }
.course-row-full { }
.course-row-cancelled { background: #fff8f0; opacity: .75; }

.course-row-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.course-row-time { font-size: .8rem; color: var(--text-light); font-variant-numeric: tabular-nums; white-space: nowrap; }
.course-row-name { font-size: .95rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.course-row-meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: .8rem; color: var(--text-light); }

.places-pill {
    display: inline-block;
    padding: .15rem .5rem;
    border-radius: 10px;
    background: #e9ecef;
    font-size: .75rem;
    font-weight: 600;
    color: var(--text-light);
}
.places-pill-full { background: #f8d7da; color: #721c24; }
.places-pill-low { background: #fff3cd; color: #856404; }

.course-row-action { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }

.status-badge {
    display: inline-block;
    padding: .3rem .65rem;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 700;
    white-space: nowrap;
}
.status-booked { background: #d4edda; color: #155724; }
.status-waitlist { background: #fff3cd; color: #856404; }

/* ── Kursplan Admin ── */
.week-nav {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}
.week-nav-item {
    padding: .35rem .75rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: .8rem;
    text-decoration: none;
    color: var(--primary);
    transition: all .15s;
}
.week-nav-item:hover, .week-nav-item.active { background: var(--primary); color: var(--white); border-color: var(--primary); }

.schedule-week { scroll-margin-top: 80px; }

/* ── Modals ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-box {
    background: var(--white);
    border-radius: 14px;
    padding: 1.5rem;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 40px rgba(0,0,0,.2);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.modal-header h3 { color: var(--primary); }
.modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-light);
    padding: .25rem .5rem;
    border-radius: 4px;
}
.modal-close:hover { background: #f0f0f0; }

@media (max-width: 768px) {
    .course-row { flex-wrap: wrap; }
    .course-row-action { width: 100%; justify-content: flex-end; margin-top: .25rem; }
    .schedule-week .course-row-action { flex-wrap: wrap; }
    .week-nav { gap: .25rem; }
    .week-nav-item { font-size: .75rem; padding: .25rem .55rem; }
}

/* ── Login-Seite ── */
.login-page { max-width: 1100px; margin: 0 auto; }
.login-logo { font-size: 3rem; text-align: center; margin-bottom: .25rem; }
.login-box h2 { text-align: center; color: var(--primary); margin-bottom: .25rem; }
.whatsapp-cta { margin-top: 1rem; }

/* ── Startseite: Wochenplan ── */
.index-schedule { margin-top: 2.5rem; }

.index-schedule-title {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    color: var(--primary);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.index-week-label { font-size: .85rem; color: var(--text-light); font-weight: normal; }

.index-schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.index-course-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.index-course-head {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
}

.index-course-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--primary);
    color: var(--white);
    border-radius: 8px;
    padding: .4rem .6rem;
    min-width: 44px;
    flex-shrink: 0;
    line-height: 1.2;
}
.index-day-abbr { font-weight: 800; font-size: .9rem; }
.index-day-date { font-size: .7rem; opacity: .85; white-space: nowrap; }

.index-course-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.index-course-info strong { color: var(--primary); font-size: .95rem; }
.index-course-time { font-size: .78rem; color: var(--text-light); }
.index-trainer { font-size: .78rem; color: var(--text-light); }
.index-course-desc { font-size: .78rem; color: var(--text-light); font-style: italic; }

.index-participants {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
}

.index-waitlist {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    align-items: center;
    border-top: 1px dashed #eee;
    padding-top: .5rem;
}
.waitlist-label { font-size: .75rem; color: var(--text-light); font-weight: 600; }

.participant-chip {
    display: inline-block;
    background: #e8f4fd;
    color: var(--primary);
    border-radius: 12px;
    padding: .15rem .55rem;
    font-size: .75rem;
    font-weight: 500;
}
.participant-chip-wl {
    background: #fff3cd;
    color: #7a5c00;
}

.index-no-bookings { font-size: .8rem; color: #bbb; font-style: italic; }

/* ── Kursbeschreibung in Kursplan ── */
.course-row-desc {
    font-size: .78rem;
    color: var(--text-light);
    font-style: italic;
    margin-top: .1rem;
}

/* ── Datumsformat kompakt im Tages-Header ── */
.day-name-full { display: none; }

@media (min-width: 480px) {
    .day-name { display: none; }
    .day-date { display: none; }
    .day-name-full { display: block; font-weight: 700; color: var(--primary); font-size: .95rem; }
}

@media (max-width: 768px) {
    .index-schedule-grid { grid-template-columns: 1fr; }
}

/* ── Help / Nutzerhandbuch ── */
.help-toc-list {
    margin: .5rem 0 0 1.2rem;
    padding: 0;
    line-height: 2;
}
.help-toc-list a { color: var(--primary); }
.help-toc-list a:hover { color: var(--secondary); }
.help-steps {
    margin: .5rem 0 .75rem 1.4rem;
    padding: 0;
    line-height: 1.9;
}
.help-list {
    margin: .5rem 0 .75rem 1.4rem;
    padding: 0;
    line-height: 1.9;
}
.help-note {
    background: #e8f4fd;
    border-left: 3px solid var(--primary);
    padding: .6rem .9rem;
    border-radius: 4px;
    font-size: .88rem;
    color: #1a3a4a;
    margin-top: .75rem;
}
