:root {
  --bg: #f4f1ea;
  --card: #ffffff;
  --text: #2b2320;
  --muted: #7a6f66;
  --accent: #8a5a2b;
  --accent-soft: #f0e4d4;
  --border: #e4ddd1;
  --shadow: 0 2px 8px rgba(60, 45, 30, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1815;
    --card: #262019;
    --text: #f0e8df;
    --muted: #b0a396;
    --accent: #d8a56a;
    --accent-soft: #3a2c1c;
    --border: #3a322a;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  }
}

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

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  padding: 1.5rem 1rem;
}

.page { max-width: 32rem; margin: 0 auto; }

.header { text-align: center; margin-bottom: 1.5rem; }
.header h1 { font-size: 2rem; letter-spacing: -0.02em; }
.subtitle { color: var(--muted); font-size: 0.95rem; margin-top: 0.25rem; }

/* Heute-Box */
.today {
  background: var(--accent);
  color: #fff;
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-align: center;
}
.today--weekend { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.today__label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.85; }
.today__name { font-size: 1.6rem; font-weight: 700; }
.today__day { font-size: 0.9rem; opacity: 0.85; }

/* Abschnitte */
.block { margin-bottom: 1.5rem; }
.block__title {
  font-size: 0.95rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.6rem;
  padding-left: 0.2rem;
}

/* Listen (Plan + Team) */
.schedule, .team {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.day, .member {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.9rem 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow);
}

.day__name, .member__name { font-weight: 600; color: var(--muted); min-width: 6.5rem; }
.member__name { color: var(--text); }
.day__person, .member__drink { font-weight: 600; text-align: right; }
.member__drink { font-weight: 500; color: var(--muted); font-size: 0.9rem; }

.day--active { border-color: var(--accent); border-width: 2px; background: var(--accent-soft); }
.day--active .day__name { color: var(--accent); }

/* Bearbeiten-Modus */
.day--editing, .member--editing { gap: 0.6rem; }

.day__input, .member__input {
  min-width: 0;
  font: inherit;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--bg);
  color: var(--text);
}
.day__input { flex: 1; font-weight: 600; text-align: right; }

.member--editing { flex-wrap: wrap; }
.member__input--name { flex: 1 1 40%; font-weight: 600; }
.member__input--drink { flex: 1 1 40%; font-size: 0.9rem; }

.day__input:focus, .member__input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.member__remove {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.member__remove:hover { background: var(--accent-soft); color: var(--text); }

/* Teilnahme-Spalte (nur Bearbeiten-Modus) */
.member__participation {
  flex: 0 0 auto;
  margin-left: auto;            /* rechtsbündig, auch nach Umbruch */
  display: grid;
  grid-template-columns: 2.6rem 2.6rem;
  justify-items: center;
  align-items: center;
}
.member__choice {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  cursor: pointer;
  accent-color: var(--accent);
}

/* Spaltenüberschrift "Teilnahme Kaffeedienst" */
.member--head {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0 1.1rem;
  align-items: flex-end;
}
.member__head-spacer { flex: 1; }
.member__participation--head {
  margin-left: 0;
  margin-right: 2.6rem;         /* fluchtet mit den Zeilen (Platz des ×-Buttons) */
}
.member__part-title {
  grid-column: 1 / 3;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
  margin-bottom: 0.15rem;
}
.member__part-label { font-size: 0.75rem; color: var(--muted); }

/* Aktionen / Buttons */
.actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.btn {
  font: inherit;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border-radius: 0.6rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: filter 0.15s ease, background 0.15s ease;
}
.btn:disabled { opacity: 0.6; cursor: default; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn--ghost { background: transparent; color: var(--muted); border-color: var(--border); }
.btn--ghost:hover { background: var(--accent-soft); }
.btn--add { margin-top: 0.6rem; width: 100%; }

/* Status-Meldung */
.status {
  min-height: 1.4rem;
  text-align: right;
  font-size: 0.9rem;
  margin-top: 0.6rem;
  color: var(--muted);
}
.status--success { color: #2e7d32; }
.status--error { color: #c62828; }
@media (prefers-color-scheme: dark) {
  .status--success { color: #7cc47f; }
  .status--error { color: #ef9a9a; }
}

.footer { text-align: center; color: var(--muted); font-size: 0.85rem; margin-top: 2rem; }
.footer__link { color: var(--accent); text-decoration: none; }
.footer__link:hover { text-decoration: underline; }

/* Login-Seite */
.page--login { max-width: 24rem; }
.login__form { display: flex; flex-direction: column; gap: 0.6rem; }
.login__label {
  font-size: 0.85rem;
  color: var(--muted);
  padding-left: 0.2rem;
}
.login__input {
  font: inherit;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  background: var(--bg);
  color: var(--text);
}
.login__input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.login__submit { margin-top: 0.4rem; }
.login__error {
  background: var(--accent-soft);
  color: #c62828;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 0.55rem 0.8rem;
  font-size: 0.9rem;
}
@media (prefers-color-scheme: dark) {
  .login__error { color: #ef9a9a; }
}
