:root {
  --brown-dark: #3b2a1e;
  --brown: #6b4a34;
  --gold: #b8874a;
  --cream: #faf6f0;
  --green: #5c6b47;
  --red: #a13b2c;
  --text: #2b241f;
  --border: #e3d9cb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Verdana, sans-serif;
  color: var(--text);
  background: var(--cream);
  line-height: 1.55;
}

a { color: var(--brown); }

.topbar {
  background: var(--brown-dark);
  color: #eee;
  font-size: 0.85rem;
}
.topbar-inner { max-width: 1100px; margin: 0 auto; padding: 6px 20px; }

.mainnav { background: #fff; border-bottom: 3px solid var(--gold); }
.mainnav-inner {
  max-width: 1100px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.brand { font-size: 1.4rem; font-weight: 700; color: var(--brown-dark); text-decoration: none; }
.navlinks { list-style: none; display: flex; gap: 18px; margin: 0; padding: 0; flex-wrap: wrap; }
.navlinks > li { position: relative; }
.navlinks a, .navlinks > li > span { text-decoration: none; color: var(--text); cursor: default; font-weight: 500; }
.navlinks a:hover { color: var(--gold); }
.dropdown-menu {
  display: none; position: absolute; top: 100%; left: 0; background: #fff;
  border: 1px solid var(--border); list-style: none; padding: 8px 0; margin: 0; min-width: 160px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.08); z-index: 10;
}
.dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu li a { display: block; padding: 6px 16px; }
.navright { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

.btn-outline, .btn-primary, .btn-small {
  border-radius: 4px; padding: 8px 14px; text-decoration: none; font-size: 0.9rem;
  border: 1px solid var(--brown); cursor: pointer; font-family: inherit;
}
.btn-outline { color: var(--brown); background: transparent; }
.btn-outline:hover { background: var(--brown); color: #fff; }
.btn-primary { background: var(--brown); color: #fff; border: none; }
.btn-primary:hover { background: var(--brown-dark); }
.btn-small { padding: 5px 10px; font-size: 0.82rem; }
.btn-danger { border-color: var(--red); color: var(--red); background: transparent; }
.btn-danger:hover { background: var(--red); color: #fff; }

main { max-width: 1100px; margin: 0 auto; padding: 0 20px 60px; }

.hero { background: linear-gradient(135deg, var(--brown-dark), var(--brown)); color: #fff; padding: 60px 20px; margin: 0 -20px 30px; }
.hero-inner { max-width: 1060px; margin: 0 auto; }
.hero h1 { margin-top: 0; font-size: 2.2rem; }

.content-section { margin-bottom: 40px; }
.content-section.narrow { max-width: 420px; }
.content-section h1 { color: var(--brown-dark); border-bottom: 2px solid var(--gold); padding-bottom: 8px; }
.content-section h2 { color: var(--brown); margin-top: 28px; }

.notice-box {
  background: #fff7e6; border: 1px solid var(--gold); border-radius: 6px;
  padding: 14px 18px; margin: 16px 0; font-size: 0.92rem;
}

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.gallery-item { margin: 0; text-align: center; }
.gallery-item img { width: 100%; height: 160px; object-fit: cover; border-radius: 6px; }
.gallery-item figcaption { margin-top: 6px; font-weight: 500; color: var(--brown); }

.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; }
.team-card { text-align: center; }
.team-card img { width: 100%; height: 200px; object-fit: cover; border-radius: 6px; }

.price-table, .data-table, .slot-table {
  width: 100%; border-collapse: collapse; margin: 14px 0; background: #fff;
}
.price-table th, .price-table td,
.data-table th, .data-table td,
.slot-table th, .slot-table td {
  border: 1px solid var(--border); padding: 8px 10px; text-align: left; font-size: 0.92rem;
}
.price-table th, .data-table th, .slot-table th { background: #f2e9dc; }

.resource-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.resource-card {
  display: block; background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: 18px; text-decoration: none; color: var(--text);
}
.resource-card:hover { border-color: var(--gold); }
.resource-card h2 { margin-top: 0; color: var(--brown-dark); }

.day-nav { display: flex; justify-content: space-between; align-items: center; margin: 16px 0; }

/* Farbgebung 1:1 aus der Wochenansicht (.wk-* Klassen) übernommen, damit Tages- und
   Wochenansicht denselben Zustand identisch einfärben. */
.row-blocked { background: #f5e6e4; }
.row-blocked .slot-btn, .row-blocked .slot-static { color: var(--red); }
.row-full { background: #f6f1e7; color: #8a7f70; }
.row-partial { background: #f3ede2; }
/* Vergangen: ausgegraut, aber Inhalt (Namen) bleibt lesbar – keine volle Transparenz. */
.row-past { background: #f3f0ec; color: #c2b9ad; }
.row-past-booked { background: #ece4d8; color: #6f6656; }
.row-past .slot-sub, .row-past-booked .slot-sub { color: inherit; }
.row-blockover { background: #efe9e0; color: #8a7f70; }
.row-free { background: #eef5e6; }
.row-mine { background: #efe0c2; }
.row-wait { background: #f1ecfa; }
.row-claim { background: #fbe9c6; }
.row-beyond { background: #faf7f2; color: #c2b9ad; }
.row-unread { background: #fff3d6; }
.row-unread td:first-child { border-left: 3px solid var(--gold); }
/* Training-Slot in der Tagesansicht: teal linker Balken + Label */
.row-training td:first-child { box-shadow: inset 4px 0 0 #3f8fab; }
.slot-train { color: #2f6d84; font-weight: 700; }

/* Tagesansicht: eine klickbare Zelle pro Slot (wie in der Wochenansicht). */
.slot-table td.slot-action { padding: 0; }
.slot-action form { margin: 0; }
.slot-btn, .slot-static {
  display: flex; flex-direction: column; gap: 2px;
  width: 100%; text-align: left;
  padding: 9px 12px; border: none; background: transparent;
  font-family: inherit; color: var(--text); line-height: 1.3;
}
.slot-btn { cursor: pointer; }
.slot-btn:hover { background: rgba(0, 0, 0, 0.06); }
.slot-main { font-size: 0.95rem; }
.slot-sub { font-size: 0.8rem; color: #6b5f52; }

/* Umschalter Tages-/Wochenansicht */
.view-toggle { display: inline-flex; border: 1px solid var(--brown); border-radius: 6px; overflow: hidden; margin: 4px 0 14px; }
.view-btn { padding: 7px 16px; font-size: 0.9rem; text-decoration: none; color: var(--brown); background: #fff; font-weight: 500; }
.view-btn + .view-btn { border-left: 1px solid var(--brown); }
.view-btn:hover { background: #f2e9dc; }
.view-btn.is-active { background: var(--brown); color: #fff; }

/* Wochenraster (Buchungskalender): Spalte 0 = Zeit, Spalten 1–7 = Mo–So */
.week-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 16px 0; flex-wrap: wrap; }
.week-nav .week-label { font-weight: 700; color: var(--brown-dark); }
.btn-disabled { opacity: 0.4; cursor: default; }

/* Bestätigungs-Popup fürs Buchen */
.modal-backdrop { position: fixed; inset: 0; background: rgba(43, 36, 31, 0.55); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 16px; }
.modal-backdrop[hidden] { display: none; }
.modal-card { position: relative; width: 100%; max-width: 400px; background: var(--cream); border: 1px solid var(--border); border-top: 4px solid var(--gold); border-radius: 12px; padding: 26px 26px 22px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.30); animation: modalIn 0.18s ease-out; }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-close { position: absolute; top: 8px; right: 12px; background: none; border: none; font-size: 1.6rem; line-height: 1; color: var(--brown); cursor: pointer; padding: 4px; }
.modal-close:hover { color: var(--brown-dark); }
.modal-eyebrow { margin: 0 0 2px; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.modal-card h3 { margin: 0 0 14px; color: var(--brown-dark); font-size: 1.4rem; }
.modal-when { margin: 0 0 18px; color: var(--text); font-size: 1.02rem; line-height: 1.5; }
.modal-when strong { font-size: 1.15rem; color: var(--brown-dark); }
.modal-note { margin: -6px 0 18px; padding: 10px 12px; background: #e8f1f5; border: 1px solid #3f8fab; border-radius: 8px; color: #2f6d84; font-size: 0.9rem; line-height: 1.45; }
.modal-check { display: flex; align-items: flex-start; gap: 10px; background: #fff7e6; border: 1px solid var(--gold); border-radius: 8px; padding: 12px 14px; font-size: 0.95rem; margin-bottom: 20px; cursor: pointer; }
.modal-check input { margin-top: 3px; width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--brown); }
.modal-check-hint { display: block; color: #6b5f52; font-size: 0.85rem; margin-top: 2px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.modal-actions .btn-outline, .modal-actions .btn-primary, .modal-actions .btn-danger { padding: 10px 18px; font-size: 0.95rem; }
/* Storno-Popup: Aktionen untereinander (klar, auch mit drei Optionen bei Trainings). */
.modal-actions-stack { flex-direction: column; align-items: stretch; gap: 8px; }
.modal-actions-stack button { width: 100%; text-align: center; }
/* Warnhinweis (kurzfristige, gewertete Absage) – im Gegensatz zur teal Info-Box (.modal-note). */
.modal-warn { margin: -6px 0 18px; padding: 10px 12px; background: #fbeeee; border: 1px solid var(--red); border-radius: 8px; color: #9a3b34; font-size: 0.9rem; line-height: 1.45; }

/* Bestätigungs-Popup (Sperre aufheben, Warteliste beitreten/verlassen) */
.modal-card-sm { max-width: 380px; }
.modal-msg { margin: 0 0 20px; color: var(--text); font-size: 0.98rem; line-height: 1.55; }
.modal-msg[hidden] { display: none; }

/* Sperr-Bereich im Buchungs-Popup (Team/Admin) */
.modal-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0 14px; color: #8a7f70; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.1em; }
.modal-divider::before, .modal-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.modal-block .modal-fields { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.modal-field { display: flex; flex-direction: column; gap: 4px; font-size: 0.88rem; font-weight: 600; color: var(--text); flex: 1 1 130px; }
.modal-field select, .modal-field input { padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-family: inherit; font-size: 0.95rem; font-weight: 400; }
.modal-field input:disabled { opacity: 0.5; }
.modal-check-sm { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; margin: 0 0 14px; cursor: pointer; }
.modal-check-sm input { width: 15px; height: 15px; accent-color: var(--brown); }
.week-scroll { overflow-x: auto; }
.week-table { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 640px; }
.week-table th, .week-table td { border: 1px solid var(--border); text-align: center; }
.week-table thead th { background: #f2e9dc; padding: 6px 2px; font-size: 0.82rem; color: var(--brown-dark); }
.week-table thead th.wk-today { background: var(--gold); color: #fff; }
.week-table thead th.wk-today .wk-date { color: #fff; }
.week-table .timecol { width: 58px; background: #faf6f0; font-weight: 600; font-size: 0.8rem; padding: 4px 6px; white-space: nowrap; color: var(--brown); }
.wk-date { font-weight: 400; font-size: 0.75rem; color: #6b5f52; }
.wk-cell { padding: 0; height: 34px; }
.wk-cell form { margin: 0; height: 100%; }
.wk-btn { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; min-height: 34px; border: none; background: transparent; cursor: pointer; font-family: inherit; font-size: 0.76rem; line-height: 1.05; padding: 2px; color: var(--text); }
.wk-static { display: flex; align-items: center; justify-content: center; height: 100%; min-height: 34px; font-size: 0.76rem; padding: 2px; }
.wk-free { background: #eef5e6; }
.wk-free .wk-btn:hover { background: #d7e8c4; }
.wk-claim { background: #fbe9c6; }
.wk-claim .wk-btn:hover { background: #f4dca6; }
.wk-mine { background: #efe0c2; }
.wk-mine .wk-btn:hover { background: #e6d0a5; }
.wk-full { background: #f6f1e7; color: #8a7f70; }
.wk-wait { background: #f1ecfa; }
.wk-wait .wk-btn:hover { background: #e6def5; }
.wk-past { background: #f3f0ec; color: #c2b9ad; }
.wk-beyond { background: #faf7f2; color: #c2b9ad; }
.wk-blocked { background: #f5e6e4; color: var(--red); }
.wk-partial { background: #f3ede2; }
.wk-partial .wk-btn:hover { background: #e8dcc6; }
.wk-past-booked { background: #ece4d8; color: #6f6656; }
.wk-blockover { background: #efe9e0; color: #8a7f70; }
.wk-sub { display: block; font-size: 0.66rem; color: #6b5f52; font-weight: 400; margin-top: 2px; }
/* Training-Slot: teal linker Balken + Label, unabhängig vom Belegungs-Hintergrund */
.wk-training { box-shadow: inset 4px 0 0 #3f8fab; }
.wk-train { display: block; font-size: 0.6rem; font-weight: 700; letter-spacing: 0.03em; color: #2f6d84; margin-top: 1px; }
.wk-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 14px 0; font-size: 0.82rem; color: #6b5f52; }
.wk-legend span { display: inline-flex; align-items: center; gap: 6px; }
.wk-legend i { width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--border); display: inline-block; }

.form { display: flex; flex-direction: column; gap: 12px; max-width: 380px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-weight: 500; font-size: 0.92rem; }
.form input, .form select { padding: 8px; border: 1px solid var(--border); border-radius: 4px; font-size: 0.95rem; }
.form-inline { flex-direction: row; align-items: flex-end; flex-wrap: wrap; max-width: none; }
.inline-check { display: inline-flex !important; flex-direction: row !important; gap: 4px; font-weight: normal; }

.hint { color: #6b5f52; font-size: 0.9rem; }

.flash-wrap { margin: 16px 0; }
.flash { padding: 10px 14px; border-radius: 4px; margin-bottom: 8px; font-size: 0.92rem; }
.flash-success { background: #e5f1df; border: 1px solid var(--green); }
.flash-error { background: #f8e5e2; border: 1px solid var(--red); }
.flash-info { background: #eaf1f7; border: 1px solid #4a7fa1; }

.sitefooter { background: var(--brown-dark); color: #ddd; margin-top: 40px; }
.sitefooter-inner {
  max-width: 1100px; margin: 0 auto; padding: 18px 20px; display: flex;
  justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 0.85rem;
}
.sitefooter a { color: #fff; }

/* --- Mein Konto: Kontodaten + Benachrichtigungs-Kanäle --- */
.account { max-width: 620px; margin: 0 auto; }
.account-sub { margin-top: -6px; margin-bottom: 22px; }
.section-heading { color: var(--brown-dark); margin: 26px 0 4px; }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  margin: 14px 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.card-title { margin: 0 0 14px; font-size: 1.15rem; color: var(--brown-dark); }
.account-form .card { margin-top: 0; }
.account-form label { display: block; margin-bottom: 14px; font-weight: 600; }
.account-form label:last-child { margin-bottom: 0; }
.account-form input[type="text"],
.account-form input[type="email"] {
  width: 100%; margin-top: 6px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px;
  font-family: inherit; font-size: 1rem; color: var(--text); background: #fff;
}
.account-form input:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184,135,74,0.18);
}
.account-form .hint { font-weight: 400; }

/* Kanal-Karten */
.channel { padding: 16px 20px; }
.channel-head { display: flex; align-items: center; gap: 14px; }
.ch-icon {
  width: 44px; height: 44px; flex: none; border-radius: 12px;
  display: grid; place-items: center; font-size: 1.35rem;
  background: rgba(184,135,74,0.14);
}
.ch-meta { flex: 1; min-width: 0; }
.ch-title { font-weight: 700; font-size: 1.05rem; }
.ch-tag {
  font-size: 0.7rem; font-weight: 600; vertical-align: middle;
  background: var(--border); color: var(--text);
  padding: 2px 7px; border-radius: 999px; margin-left: 6px;
}
.ch-status { font-size: 0.86rem; color: #7a6f62; margin-top: 2px; word-break: break-word; }
.ch-status.ok { color: var(--green); font-weight: 600; }
.channel-body {
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
}
.channel-body form { margin: 0; }

.deeplink-box {
  background: var(--cream); border: 1px dashed var(--gold); border-radius: 10px;
  padding: 12px 14px; width: 100%;
}
.deeplink-box p { margin: 0 0 10px; font-size: 0.9rem; }

/* Toggle-Schalter */
.switch { position: relative; display: inline-block; width: 48px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; cursor: pointer; background: #cfc7bb;
  border-radius: 999px; transition: background-color .2s ease;
}
.switch .slider::before {
  content: ""; position: absolute; height: 22px; width: 22px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform .2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.switch input:checked + .slider { background: var(--gold); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch input:disabled + .slider { opacity: 0.4; cursor: not-allowed; }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 3px rgba(184,135,74,0.3); }

/* Einwilligung */
.card.consent { background: var(--cream); }
label.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; }
label.check input[type="checkbox"] { margin-top: 4px; flex: none; width: 18px; height: 18px; accent-color: var(--gold); }
.consent-check span { font-size: 0.92rem; }
.privacy-details {
  margin: 14px 0 6px; border: 1px solid var(--border); border-radius: 10px;
  background: #fff; padding: 4px 14px;
}
.privacy-details summary {
  cursor: pointer; font-weight: 600; padding: 8px 0; color: var(--brown);
}
.privacy-details[open] summary { margin-bottom: 6px; }
.privacy-details ul { margin: 4px 0; padding-left: 20px; }
.privacy-details li { font-size: 0.9rem; margin: 4px 0; }
.privacy-details p { font-size: 0.9rem; }
.consent-meta { color: var(--green); font-weight: 600; margin: 10px 0 0; }

.account-actions { margin-top: 18px; }
.account-actions .btn-primary { padding: 11px 26px; font-size: 0.95rem; }

/* PHP-Version: Abmelden-Knopf als kleines Formular in der Navigation */
.inline-form{display:inline;margin:0}
.inline-form button{cursor:pointer;font:inherit}
