/* ====================================================================
   DESIGN der Küchen-App  –  mobil zuerst (Handy)
   ==================================================================== */

:root {
  --rot:        #b71c1c;   /* Feuerwehr-Rot */
  --rot-dunkel: #7f0000;
  --rot-hell:   #ffebee;
  --gruen:      #2e7d32;
  --grau:       #6b7280;
  --grau-hell:  #f3f4f6;
  --text:       #1f2937;
  --weiss:      #ffffff;
  --schatten:   0 2px 8px rgba(0,0,0,0.12);
  --radius:     14px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--grau-hell);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ---------- Ladebildschirm ---------- */
.ladebildschirm {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--rot);
}
.spinner {
  width: 48px; height: 48px;
  border: 5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: dreh 0.9s linear infinite;
}
@keyframes dreh { to { transform: rotate(360deg); } }

/* ---------- Buttons allgemein ---------- */
.btn {
  background: var(--rot);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s;
}
.btn:active { filter: brightness(0.9); }
.btn-gross { width: 100%; padding: 15px; font-size: 17px; margin-top: 8px; }
.btn-grau  { background: var(--grau); }
.btn-loeschen { background: #fff; color: var(--rot); border: 2px solid var(--rot); }
.btn-text {
  background: none; border: none; color: #fff;
  font-size: 15px; cursor: pointer; text-decoration: underline;
}

/* ====================================================================
   LOGIN
   ==================================================================== */
.login-ansicht {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  /* Dunkel & edel: tiefes Anthrazit mit dezentem rotem Schimmer oben */
  background: radial-gradient(circle at 50% 0%, #3a1212 0%, #181012 45%, #0c0c0e 100%);
}
.login-box {
  background: #000;
  width: 100%; max-width: 380px;
  padding: 32px 26px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  text-align: center;
  color: #f3f4f6;
}
.logo-bild {
  width: 132px;
  height: auto;
  margin-bottom: 16px;
  border-radius: 12px;
}
.login-box h1 { font-size: 23px; margin-bottom: 4px; color: #fff; letter-spacing: 0.3px; }
.login-untertitel { color: #9ca3af; margin-bottom: 24px; }

/* Login-Felder dunkel (die Dialoge bleiben dank höherer Spezifität hell) */
.login-box .feld label { color: #d1d5db; }
.login-box .feld input {
  background: #2a2a31;
  border: 1px solid #3a3a44;
  color: #f3f4f6;
}
.login-box .feld input::placeholder { color: #6b7280; }
.login-box .feld input:focus { outline: 2px solid #ef5350; border-color: #ef5350; }
.login-box .wechsel-text { color: #9ca3af; }
.login-box .wechsel-text a { color: #ff6b6b; }
.login-box .fehler {
  background: rgba(183,28,28,0.18);
  color: #ffb4b4;
  border: 1px solid rgba(239,83,80,0.35);
}

.feld { text-align: left; margin-bottom: 14px; }
.feld label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.feld input {
  width: 100%;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 16px; /* >=16px verhindert Zoom auf iPhone */
}
.feld input:focus { outline: 2px solid var(--rot); border-color: var(--rot); }

.wechsel-text { margin-top: 18px; font-size: 14px; color: var(--grau); }
.wechsel-text a { color: var(--rot); font-weight: 600; text-decoration: none; }

.fehler {
  background: var(--rot-hell);
  color: var(--rot-dunkel);
  padding: 10px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 12px;
}

/* ====================================================================
   HAUPTANSICHT
   ==================================================================== */
.kopf {
  background: var(--rot);
  color: #fff;
  padding: 16px 18px;
  padding-top: calc(16px + env(safe-area-inset-top));
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
  box-shadow: var(--schatten);
}
.kopf h1 { font-size: 19px; cursor: pointer; }

.monat-leiste {
  display: flex; align-items: center; justify-content: center;
  gap: 18px;
  padding: 14px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}
#monat-anzeige { font-size: 17px; font-weight: 700; min-width: 150px; text-align: center; }
.btn-pfeil {
  background: var(--grau-hell);
  border: none; border-radius: 50%;
  width: 38px; height: 38px;
  font-size: 22px; line-height: 1; cursor: pointer; color: var(--text);
}
.btn-pfeil:active { background: #e5e7eb; }

.plan-liste { padding: 14px; padding-bottom: 90px; }

/* ---------- Eine Gericht-Karte ---------- */
.karte {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  margin-bottom: 14px;
  overflow: hidden;
}
.karte-kopf {
  padding: 14px 16px;
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 10px;
}
.karte-datum {
  font-size: 13px; color: var(--rot); font-weight: 700; text-transform: uppercase;
}
.karte-gericht { font-size: 18px; font-weight: 700; margin: 2px 0; }
.karte-koeche { font-size: 14px; color: var(--grau); }
.karte-koeche b { color: var(--text); }
.karte-preis {
  background: var(--rot-hell); color: var(--rot-dunkel);
  font-weight: 700; font-size: 15px;
  padding: 6px 10px; border-radius: 10px; white-space: nowrap;
}
.btn-bearbeiten {
  background: none; border: none; color: var(--grau);
  font-size: 18px; cursor: pointer; padding: 2px 6px;
}

.karte-trenner { height: 1px; background: #eee; margin: 0 16px; }

/* ---------- Teilnehmer-Bereich ---------- */
.karte-fuss { padding: 12px 16px 16px; }
.teilnehmer-titel {
  font-size: 13px; font-weight: 700; color: var(--grau);
  text-transform: uppercase; margin-bottom: 8px;
}
.teilnehmer-liste { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.teilnehmer {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px;
}
.teilnehmer .punkt {
  width: 9px; height: 9px; border-radius: 50%; background: var(--grau);
}
.teilnehmer.bezahlt .punkt { background: var(--gruen); }
.teilnehmer .bezahlt-text { font-size: 12px; color: var(--gruen); font-weight: 700; }
.teilnehmer-leer { font-size: 14px; color: var(--grau); font-style: italic; margin-bottom: 12px; }

/* ---------- Aktionsknöpfe in der Karte ---------- */
.karte-aktionen { display: flex; gap: 8px; flex-wrap: wrap; }
.karte-aktionen .btn { flex: 1; min-width: 120px; text-align: center; }
.btn-eintragen   { background: var(--gruen); }
.btn-austragen   { background: #fff; color: var(--grau); border: 1px solid #d1d5db; }
.btn-paypal      { background: #0070ba; display: flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
.btn-bezahlt-haken { background: #fff; color: var(--gruen); border: 1px solid var(--gruen); }

/* ---------- Schwebender Plus-Knopf ---------- */
.btn-schwebend {
  position: fixed;
  right: 20px; bottom: calc(20px + env(safe-area-inset-bottom));
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--rot); color: #fff;
  border: none; font-size: 30px; line-height: 1;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  cursor: pointer; z-index: 20;
}
.btn-schwebend:active { filter: brightness(0.9); }

.leer-hinweis { text-align: center; color: var(--grau); padding: 40px 20px; }
.leer-hinweis .gross { font-size: 40px; margin-bottom: 10px; }

/* ====================================================================
   DIALOG
   ==================================================================== */
.dialog-hintergrund {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 30;
}
.dialog {
  background: #fff;
  width: 100%; max-width: 480px;
  border-radius: 20px 20px 0 0;
  padding: 22px 20px;
  padding-bottom: calc(22px + env(safe-area-inset-bottom));
  box-shadow: var(--schatten);
}
.dialog h2 { font-size: 19px; margin-bottom: 16px; }
.dialog-knoepfe { display: flex; align-items: center; gap: 8px; margin-top: 18px; }
.dialog-knoepfe .abstand { flex: 1; }

@media (min-width: 520px) {
  .dialog-hintergrund { align-items: center; }
  .dialog { border-radius: 20px; }
}

/* Version 4: Zahlungsstatus */
.teilnehmer-meta { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.zahlstatus { font-size: 0.8rem; opacity: 0.85; }
.zahlstatus.offen { color: #777; }
.zahlstatus.pending { color: #b26a00; font-weight: 600; }
.zahlstatus.bezahlt { color: #1b7f3a; font-weight: 700; }
.admin-zahlung { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-mini { border: 0; border-radius: 999px; padding: 5px 9px; font-size: 0.78rem; cursor: pointer; background: #f0f0f0; }
.btn-mini:hover { filter: brightness(0.96); }
.btn-bar { background: #e8f1ff; }
.btn-paypal-ok { background: #eaf7ea; }
.hinweis-zahlung { font-size: 0.85rem; color: #666; margin: 8px 0 0; }

/* ---------- Essensübersicht / Wochenübersicht ---------- */
.uebersicht-box,
.tagesplan-box {
  padding: 14px 14px 0;
}
.tagesplan-box { padding-bottom: 90px; }
/* Abstand beim Auto-Scroll, damit die Überschrift nicht unter dem klebenden Kopf verschwindet */
.tagesplan-box { scroll-margin-top: 64px; }
.bereich-kopf {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 2px 10px;
}
.bereich-kopf h2 {
  font-size: 16px;
  margin: 0;
}
.bereich-kopf span {
  font-size: 12px;
  color: var(--grau);
  white-space: nowrap;
}
.essens-uebersicht {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  overflow: hidden;
}
.wochen-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: #e5e7eb;
}
.uebersicht-tag {
  min-height: 92px;
  background: #fff;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.uebersicht-tag.hat-gericht { background: #fff8f8; }
.uebersicht-tag.heute { outline: 2px solid var(--rot); outline-offset: -2px; }
.uebersicht-datum {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--grau);
  font-size: 11px;
}
.uebersicht-datum b {
  color: var(--text);
  font-size: 16px;
}
.uebersicht-inhalt strong {
  display: block;
  font-size: 13px;
  line-height: 1.2;
}
.uebersicht-inhalt small {
  display: block;
  margin-top: 4px;
  color: var(--grau);
  font-size: 11px;
  line-height: 1.25;
}
.kein-gericht {
  color: #9ca3af;
  font-size: 12px;
}
.plan-liste { padding: 0; padding-bottom: 0; }

@media (max-width: 700px) {
  .wochen-grid { grid-template-columns: 1fr; }
  .uebersicht-tag {
    min-height: auto;
    flex-direction: row;
    align-items: flex-start;
  }
  .uebersicht-datum {
    width: 54px;
    flex-shrink: 0;
  }
}

/* v7: Monatsübersicht bleibt stehen, Details öffnen per Klick */
.uebersicht-tag.klickbar {
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.uebersicht-tag.klickbar:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
  z-index: 1;
}
.uebersicht-tag.ausgewaehlt {
  background: #fff1f1;
  outline: 3px solid var(--rot);
  outline-offset: -3px;
}
/* Tag, an dem man selbst zum Essen eingetragen ist */
.uebersicht-tag.bin-dabei {
  border-left: 4px solid var(--gruen);
  background: #e9f7ec;
}
.dabei-badge {
  display: inline-block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--gruen);
  background: #fff;
  border: 1px solid var(--gruen);
  border-radius: 999px;
  padding: 1px 6px;
}
/* Vegetarisch/Vegan-Badge in der Monatsübersicht */
.kostform-badge {
  display: inline-block;
  margin-top: 4px;
  margin-left: 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--gruen);
  background: #e9f7ec;
  border: 1px solid var(--gruen);
  border-radius: 999px;
  padding: 1px 6px;
}
/* Kostform/Allergene-Zeile in der Gericht-Detailkarte */
.kostform-zeile {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text);
}
/* Auswahlfeld im Dialog wie die Textfelder aussehen lassen */
.feld select {
  width: 100%;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 16px;
  background: #fff;
  color: var(--text);
}
.feld select:focus { outline: 2px solid var(--rot); border-color: var(--rot); }
.detail-hinweis {
  margin-top: 16px;
}
.btn-loeschen-mini {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.btn-grau-mini {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}


/* v9 Test: Meldungen, Portionen, Rezept/Einkaufsliste, Statusfarben */
.feld textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  resize: vertical;
}
.meldungs-box {
  margin: 14px 14px 0;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  box-shadow: var(--schatten);
}
.meldungs-box strong { color: #9a3412; }
.meldungs-box p { margin-top: 4px; color: #7c2d12; }
.portionen-zeile { margin-top: 5px; color: var(--grau); font-size: 14px; }
.status-dashboard {
  margin: 12px 16px 0;
  padding: 10px;
  background: #f9fafb;
  border-radius: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  font-size: 13px;
}
.teilnehmer .punkt.bezahlt { background: #16a34a; }
.teilnehmer .punkt.bar { background: #f59e0b; }
.teilnehmer .punkt.paypal { background: #2563eb; }
.teilnehmer .punkt.offen { background: #dc2626; }
.zahlstatus.bar { color: #b45309; font-weight: 700; }
.zahlstatus.paypal { color: #1d4ed8; font-weight: 700; }
.btn-ausgebucht { background: #fff; color: #991b1b; border: 1px solid #fecaca; }
.gericht-details {
  margin: 12px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gericht-details details {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 12px;
}
.gericht-details summary { cursor: pointer; font-weight: 700; }
.gericht-details details div { margin-top: 8px; color: #374151; line-height: 1.45; }
@media (max-width: 520px) {
  .status-dashboard { grid-template-columns: 1fr; }
  .meldungs-box { flex-direction: column; }
}


/* v9 Test: Push-Schaltfläche */
.meldungs-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.meldungs-actions small { color: #7c2d12; font-size: 11px; text-align: right; max-width: 180px; }
@media (max-width: 520px) { .meldungs-actions { align-items: stretch; width: 100%; } .meldungs-actions small { text-align: left; max-width: none; } }

/* ================= Version 1.1 ================= */
.heute-box {
  margin: 14px 16px 10px;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff7ed, #fee2e2);
  border: 1px solid #fed7aa;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  box-shadow: 0 8px 24px rgba(127, 29, 29, 0.08);
}
.heute-box strong { color: #7f1d1d; font-size: 16px; }
.heute-box p { margin: 4px 0; color: #7c2d12; }
.heute-box small { color: #9a3412; }
.dialog-hilfe {
  margin-top: -4px;
  color: #666;
  font-size: 13px;
  line-height: 1.35;
}
.schnellmeldungen {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.feld textarea {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
}
@media (max-width: 520px) {
  .heute-box { flex-direction: column; align-items: stretch; }
}


/* ================= Version 1.0 Feinschliff ================= */
.admin-toolbar {
  display: flex;
  gap: 8px;
  padding: 10px 14px 0;
}
.btn-toolbar {
  background: #fff;
  color: var(--rot-dunkel);
  border: 1px solid #fecaca;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.profil-stats-box {
  padding: 14px 14px 0;
}
.profil-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--schatten);
  text-align: center;
}
.stat-card b {
  display: block;
  font-size: 17px;
  color: var(--rot-dunkel);
}
.stat-card span {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--grau);
}
@media (max-width: 620px) {
  .profil-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Schulden-/Zahlungsübersicht (Admin/Koch) ---------- */
.schulden-box { padding: 14px; }
.schulden-summe {
  background: var(--rot-hell);
  color: var(--rot-dunkel);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 10px;
  font-size: 14px;
}
.schulden-summe b { font-size: 16px; }
.schulden-zeile {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: var(--schatten);
}
.schulden-zeile.hat-offen { border-left: 4px solid var(--rot); }
.schulden-zeile.alles-bezahlt { border-left: 4px solid var(--gruen); }
.schulden-name { font-weight: 600; }
.schulden-betrag { font-size: 14px; color: var(--text); text-align: right; }
.schulden-betrag b { color: var(--rot-dunkel); }
.schulden-betrag .alles-ok { color: var(--gruen); font-weight: 700; }

/* ---------- Versionsnummer (dezent) ---------- */
.version-info {
  margin-top: 14px;
  text-align: center;
  font-size: 12px;
  color: var(--grau);
  opacity: 0.8;
}

/* ---------- Kopf-Aktionen (Profil / Abmelden) ---------- */
.kopf-aktionen { display: flex; align-items: center; gap: 14px; }

/* ---------- Erfolgs-Hinweis im Dialog ---------- */
.hinweis-ok {
  background: #e8f5e9;
  color: var(--gruen);
  padding: 10px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 12px;
  font-weight: 600;
}

/* ---------- Mitglieder verwalten (Admin-Dialog) ---------- */
.mitglieder-liste {
  max-height: 55vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.mitglied-zeile {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 8px 12px;
}
.mitglied-name { font-weight: 600; }
.mitglied-rolle {
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
  color: var(--text);
}


.deadline-zeile {
  margin-top: 6px;
  font-size: 0.92rem;
  color: #555;
}
.anmeldung-status {
  font-weight: 700;
}
.anmeldung-status.offen {
  color: #1b7f3a;
}
.anmeldung-status.geschlossen {
  color: #b71c1c;
}
button[disabled].btn-ausgebucht {
  opacity: 0.7;
  cursor: not-allowed;
}
