*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --wine: #5C6576;
  --wine-light: #E8EBF0;
  --green: #3D6B4F;
  --green-light: #E8F0EB;
  --wildrose: #C46FA3;
  --wildrose-light: #F5EBF2;
  --mohn: #E8735A;
  --creme: #FAEEDA;
  --text: #1A1A1A;
  --text-muted: #6B7280;
}
body {
  font-family: 'DM Sans', sans-serif;
  background: #F2F1EE;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 2rem 1rem 4rem;
}
.card {
  width: 100%;
  max-width: 580px;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 2px 40px rgba(60,67,82,0.13);
  animation: fadeUp 0.5s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero {
  position: relative;
  overflow: hidden;
}
.hero img {
  width: 100%;
  height: auto;
  display: block;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(61,67,82,0.5) 0%, rgba(61,67,82,0.75) 100%);
}
.hero-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem;
}
.hero-date {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.82);
  margin-bottom: 0.55rem;
}
.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: 34px;
  font-weight: 600;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 1rem;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.tag {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 4px 12px;
  border-radius: 20px;
  color: #fff;
}
.tag-wildrose { background: var(--wildrose); }
.tag-green    { background: var(--green); }
.tag-mohn     { background: var(--mohn); }
.body-wrap { padding: 1.75rem 1.75rem 0; }
.intro {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 1.75rem;
}
.section-card {
  border: 1px solid #EBEBEB;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 0.875rem;
}
.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.875rem 1.1rem;
}
.section-head.wildrose { background: var(--wildrose-light); }
.section-head.green    { background: var(--green-light); }
.section-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.section-icon.wildrose { background: var(--wildrose); }
.section-icon.green    { background: var(--green); }
.section-label { flex: 1; }
.section-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
}
.section-subtitle {
  font-size: 11.5px;
  margin-top: 1px;
}
.section-subtitle.wildrose { color: var(--wildrose); }
.section-subtitle.green    { color: var(--green); }
.section-pill {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  color: #fff;
  white-space: nowrap;
}
.section-pill.wildrose { background: var(--wildrose); }
.section-pill.green    { background: var(--green); }

/* Section images: fixed aspect box + contain = never stretched */
.section-photo-wrap {
  width: 100%;
  position: relative;
  overflow: hidden;
  background: #f0f0ee;
}
.section-photo-wrap--lauf {
  aspect-ratio: 1066 / 1600;
}
.section-photo-wrap--kaffee {
  aspect-ratio: 1600 / 1520;
}
.section-photo-wrap img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
.section-body {
  padding: 1rem 1.1rem;
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.75;
}
.section-body strong {
  color: var(--text);
  font-weight: 500;
}

.section-body-italic-gap {
  margin-top: 1.1rem;
  font-style: italic;
  color: var(--text-muted);
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0.25rem 0 0.875rem;
}
.divider-line  { flex: 1; height: 1px; background: #EBEBEB; }
.divider-label { font-size: 11px; color: #9CA3AF; letter-spacing: 0.04em; white-space: nowrap; }
.rsvp-box {
  margin: 0.25rem 1.75rem 1.75rem;
  background: var(--creme);
  border-radius: 14px;
  padding: 1.25rem;
}
.rsvp-text {
  font-size: 13.5px;
  color: #7C5A2A;
  line-height: 1.75;
  margin-bottom: 1rem;
}
.rsvp-text strong { color: #4A3010; font-weight: 500; }
.rsvp-buttons { display: flex; flex-direction: column; gap: 8px; }
.btn {
  display: block;
  text-align: center;
  padding: 12px 20px;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.88; }
.btn-primary   { background: var(--wine); color: #fff; }
.btn-secondary { background: var(--wildrose); color: #fff; }
.btn-outline   {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid #D1D5DB;
}
.footer {
  padding: 1.1rem 1.75rem;
  border-top: 1px solid #F0F0F0;
  font-size: 11.5px;
  color: #B5B5B5;
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--wildrose);
  opacity: 0.5;
}
@media (max-width: 480px) {
  body { padding: 0; background: #fff; }
  .card { border-radius: 0; box-shadow: none; max-width: 100%; }
  .hero-title { font-size: 28px; }
}

/* —— RSVP modal & card —— */
.rsvp-dialog {
  position: fixed;
  inset: 0;
  width: min(420px, calc(100vw - 2rem));
  max-width: min(420px, calc(100vw - 2rem));
  height: fit-content;
  max-height: min(90vh, 720px);
  margin: auto;
  border: none;
  border-radius: 18px;
  padding: 0;
  background: #fff;
  box-shadow: 0 8px 48px rgba(60, 67, 82, 0.22);
}
.rsvp-dialog::backdrop {
  background: rgba(26, 26, 26, 0.45);
}
.rsvp-modal-card {
  position: relative;
  padding: 1.5rem 1.35rem 1.35rem;
  max-height: min(90vh, 720px);
  overflow-y: auto;
}
.rsvp-modal-close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 50%;
  background: var(--wine-light);
  color: var(--wine);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rsvp-modal-close:hover {
  opacity: 0.85;
}
.rsvp-modal-title {
  font-family: "Playfair Display", serif;
  font-size: 1.35rem;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 0.35rem;
  padding-right: 2rem;
}
.rsvp-modal-sub {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.1rem;
}
.rsvp-modal-sectiontitle {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  margin-top: 0.25rem;
}
.rsvp-plus-head {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px dashed #e5e5e5;
}
.rsvp-option-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  margin-bottom: 8px;
  border: 1px solid #ebebeb;
  border-radius: 12px;
  background: #fafafa;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.35;
}
.rsvp-option-row:hover {
  border-color: #ddd;
}
.rsvp-option-sub {
  background: #fff;
  border-style: dashed;
}
.rsvp-opt-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.rsvp-opt-icon.wildrose {
  background: var(--wildrose-light);
}
.rsvp-opt-icon.green {
  background: var(--green-light);
}
.rsvp-option-text {
  flex: 1;
  min-width: 0;
}
.rsvp-checkbox-end {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  accent-color: var(--wine);
  cursor: pointer;
}
.rsvp-plus-cta {
  width: 100%;
  margin: 0.35rem 0 0.25rem;
  padding: 12px 14px;
  border: 2px dashed var(--wildrose);
  border-radius: 12px;
  background: var(--wildrose-light);
  color: #8b3b6f;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.rsvp-plus-cta:hover {
  background: #f0dce8;
  border-color: var(--wildrose);
}
.rsvp-plus-panel {
  margin-bottom: 0.35rem;
}
.rsvp-modal-status {
  font-size: 13px;
  min-height: 1.25em;
  margin-top: 0.25rem;
}
.rsvp-modal-status.error {
  color: #b91c1c;
}
.rsvp-modal-status.success {
  color: var(--green);
}
.rsvp-panel-success {
  text-align: center;
  padding: 0.5rem 0.25rem 0;
}
.rsvp-success-emoji {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 0.5rem;
}
.rsvp-success-title {
  font-family: "Playfair Display", serif;
  font-size: 1.4rem;
  color: var(--text);
  margin-bottom: 0.5rem;
  font-weight: 600;
}
.rsvp-success-text strong {
  color: var(--text);
  font-weight: 500;
}
.rsvp-success-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  align-items: stretch;
}
#rsvp-open-btn {
  width: 100%;
}

/* —— RSVP form —— */
.rsvp-form-fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.form-field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.form-input {
  font: inherit;
  font-size: 15px;
  padding: 0.65rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 10px;
  width: 100%;
}
.form-input:focus {
  outline: 2px solid var(--wine);
  outline-offset: 1px;
}
.check-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.45;
}
.check-line input {
  margin-top: 3px;
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  accent-color: var(--wine);
}
.rsvp-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: -0.2rem;
}
#rsvp-status,
#rsvp-config-msg {
  font-size: 13px;
  min-height: 1.25em;
}
#rsvp-status.error {
  color: #b91c1c;
}
#rsvp-status.success {
  color: var(--green);
}
button.btn {
  font-family: inherit;
  border: none;
  cursor: pointer;
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.privacy-note {
  font-size: 11px;
  color: #9ca3af;
  line-height: 1.5;
  margin-top: 0.75rem;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* ===================================================
   DASHBOARD — Host-Gästeliste (PRD v5 + Realtime-KPI-Tiles)
   =================================================== */

body.dashboard-page {
  background: #f2f1ee;
  min-height: 100vh;
  font-family: "DM Sans", sans-serif;
  color: #1a1a1a;
  display: block;
  padding: 0;
  justify-content: initial;
}

/* Vor Login nur die Login-Karte, kein Dashboard-Header/shell */
body.dashboard-page.dash-page--login-only main#dash-main {
  min-height: 100vh;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

body.dashboard-page.dash-page--login-only #dash-login.dash-login-card {
  margin: 0;
  width: 100%;
}

body.dashboard-page.dash-page--login-only .dash-config-banner:not([hidden]) ~ main#dash-main {
  min-height: calc(100vh - 52px);
}

/* Eigenes display auf .dash-* überschreibt sonst das HTML-[hidden]-Attribut (KPI-Leiste bleibt sichtbar). */
body.dashboard-page [hidden] {
  display: none !important;
}

.dash-config-banner {
  margin: 0;
  padding: 12px 16px;
  background: #fde8e8;
  color: #7f1d1d;
  font-size: 13px;
  border-bottom: 1px solid #fecaca;
}

/* ── Header ── */
.dash-header {
  background: #fff;
  border-bottom: 1px solid #e8ebf0;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.dash-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.dash-title {
  font-family: "Playfair Display", serif;
  font-size: 20px;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.2;
}

.dash-subtitle {
  font-size: 11px;
  color: #6b7280;
  margin-top: 2px;
}

/* ── Live-Indikator ── */
.dash-live {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  color: #3d6b4f;
}

.dash-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3d6b4f;
  animation: dashPulse 2s ease-in-out infinite;
}

@keyframes dashPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

/* ── Logout-Button ── */
.dash-logout-btn {
  font-size: 11px;
  color: #5c6576;
  background: none;
  border: 0.5px solid #e8ebf0;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-family: "DM Sans", sans-serif;
}

.dash-logout-btn:hover {
  background: #e8ebf0;
}

/* ── KPI-Tiles ── */
.dash-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 14px 16px 0;
}

.dash-kpi {
  background: #fff;
  border: 0.5px solid #e8ebf0;
  padding: 10px 12px;
  border-radius: 0 0 10px 10px;
}

.dash-kpi--guests {
  border-top: 3px solid var(--wildrose);
}

.dash-kpi--run {
  border-top: 3px solid var(--green);
}

.dash-kpi--coffee {
  border-top: 3px solid var(--mohn);
}

.dash-kpi-label {
  font-size: 10px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.dash-kpi-num {
  font-family: "Playfair Display", serif;
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
  color: #1a1a1a;
}

.dash-kpi-detail {
  font-size: 10px;
  color: #6b7280;
  margin-top: 3px;
}

@media (max-width: 520px) {
  .dash-kpis {
    grid-template-columns: 1fr;
  }
}

/* ── Tabellenbereich ── */
.dash-list-section {
  padding: 14px 16px 24px;
}

.dash-section-label {
  font-size: 10px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
}

.dash-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 0.5px solid #e8ebf0;
  table-layout: fixed;
}

.dash-th-name {
  width: auto;
}

.dash-th-icon {
  width: 58px;
}

/* ── Kopfzeile ── */
.dash-th {
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  color: #6b7280;
  background: #f9f8f6;
  border-bottom: 1px solid #e8ebf0;
  white-space: nowrap;
}

.dash-th.dash-th-icon {
  text-align: center;
}

.dash-col-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  line-height: 1;
}

.dash-col-emoji {
  font-size: 15px;
}

.dash-col-label {
  font-size: 9px;
  color: #6b7280;
  font-weight: 400;
}

/* ── Tabellenzellen ── */
.dash-td {
  padding: 10px 12px;
  font-size: 13px;
  color: #1a1a1a;
  border-bottom: 0.5px solid #f0efed;
  vertical-align: middle;
}

.dash-td-name {
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-td-icon {
  text-align: center;
}

.dash-tr:last-child .dash-td {
  border-bottom: none;
}

/* ── Begleitungs-Zeile ── */
.dash-tr--companion .dash-td {
  background: #fdfcfb;
}

.dash-td-companion {
  color: #6b7280;
  font-size: 12px;
  font-style: italic;
  font-weight: 400;
  padding-left: 24px;
}

/* ── +1 Badge ── */
.dash-plus-badge {
  font-size: 9px;
  background: var(--creme);
  color: #b36a00;
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 6px;
  font-weight: 500;
  vertical-align: middle;
}

/* ── Teilnahme-Pills ── */
.dash-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}

.dash-pill--run {
  background: var(--green-light);
  color: var(--green);
}

.dash-pill--coffee {
  background: var(--creme);
  color: #b36a00;
}

.dash-pill--off {
  background: #f2f1ee;
  color: #c0bfbd;
}

/* ── Login-Karte ── */
.dash-login-card {
  margin: 16px;
  max-width: 420px;
  background: var(--wine-light);
  border: 0.5px solid #d0d4dd;
  border-radius: 14px;
  padding: 20px 16px;
}

.dash-login-card h2 {
  font-family: "Playfair Display", serif;
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 4px;
}

.dash-login-card > p {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 16px;
}

.dash-login-card label {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
}

.dash-login-card input {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 0.5px solid #d0d4dd;
  border-radius: 8px;
  font-size: 13px;
  font-family: "DM Sans", sans-serif;
  background: #fff;
  color: #1a1a1a;
  margin-bottom: 10px;
}

.dash-login-card input:focus {
  outline: 2px solid var(--wine);
  outline-offset: 1px;
}

.dash-login-card button {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  background: var(--wine);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  font-family: "DM Sans", sans-serif;
  border: none;
  cursor: pointer;
  margin-top: 2px;
}

.dash-login-card button:hover {
  background: #4a5263;
}

.dash-login-card button:disabled {
  opacity: 0.6;
  cursor: default;
}

/* ── Fehler & Leer-Zustände (Dashboard) ── */
.dash-login-card .dash-error,
.dash-list-section .dash-error {
  color: #b91c1c;
  font-size: 12px;
  margin-top: 8px;
}

.dash-state-text {
  text-align: center;
  color: #6b7280;
  font-size: 13px;
  padding: 32px 0;
  font-style: italic;
  font-family: "Playfair Display", serif;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}
