/* ============================================================
   Erntedankfest – Hauptstylesheet
   Design: Weiß #FFFFFF · Akzent #C8A97E · Anthrazit #2C2C2C
   ============================================================ */

/* --- Schriftart --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* --- CSS-Variablen --- */
:root {
  --color-bg:       #FFFFFF;
  --color-surface:  #FAF8F5;
  --color-border:   #E8E0D4;
  --color-accent:   #C8A97E;
  --color-accent-d: #B08E62;
  --color-text:     #2C2C2C;
  --color-muted:    #6B6560;
  --color-error:    #B94040;
  --color-success:  #3A7D5C;
  --color-warning:  #B07020;
  --radius:         8px;
  --shadow:         0 1px 3px rgba(0,0,0,.08), 0 1px 8px rgba(0,0,0,.04);
  --shadow-md:      0 2px 8px rgba(0,0,0,.10), 0 1px 16px rgba(0,0,0,.06);
  --font:           'Inter', system-ui, sans-serif;
  --max-w:          780px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--color-accent-d); text-decoration: underline; }
a:hover { color: var(--color-accent); }

/* --- Layout --- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* --- Header --- */
.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  padding: .875rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}
.site-logo {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  line-height: 1.3;
}
.site-logo span { color: var(--color-accent); }
.site-nav { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.site-nav a {
  font-size: .875rem;
  color: var(--color-muted);
  text-decoration: none;
  padding: .25rem .5rem;
  border-radius: 4px;
}
.site-nav a:hover { color: var(--color-text); background: var(--color-surface); }

/* --- Hauptbereich --- */
main { padding: 2rem 0 4rem; }

/* --- Karten --- */
.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem;
  margin-bottom: 1.25rem;
}
.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--color-text);
}

/* --- Hero (Startseite) --- */
.hero {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 3rem 1.25rem 2.5rem;
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: .75rem;
}
.hero p {
  font-size: 1.0625rem;
  color: var(--color-muted);
  max-width: 520px;
  margin: 0 auto 1.75rem;
}

/* --- Formulare --- */
.form-group { margin-bottom: 1.125rem; }
.form-label {
  display: block;
  font-size: .875rem;
  font-weight: 500;
  margin-bottom: .375rem;
  color: var(--color-text);
}
.form-input {
  width: 100%;
  padding: .625rem .875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  transition: border-color .15s;
}
.form-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(200,169,126,.15);
}

/* --- Schaltflächen --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .625rem 1.375rem;
  border-radius: var(--radius);
  font-size: .9375rem;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background .15s, color .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--color-accent);
  color: #fff;
}
.btn-primary:hover { background: var(--color-accent-d); color: #fff; }
.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-secondary:hover { background: var(--color-border); }
.btn-danger {
  background: transparent;
  color: var(--color-error);
  border: 1px solid var(--color-error);
}
.btn-danger:hover { background: var(--color-error); color: #fff; }
.btn-sm { padding: .375rem .875rem; font-size: .8125rem; }
.btn-block { width: 100%; }

/* --- Meldungen --- */
.alert {
  padding: .875rem 1.125rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: .9375rem;
}
.alert-success { background: #EFF8F3; color: var(--color-success); border: 1px solid #B6D9C8; }
.alert-error   { background: #FDF0F0; color: var(--color-error);   border: 1px solid #E8BEBE; }
.alert-info    { background: #F5F0E8; color: var(--color-warning);  border: 1px solid #DDD0B3; }

/* --- Farbpunkte --- */
.color-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,.12);
}
.dot-rot     { background: #D94040; }
.dot-orange  { background: #E87820; }
.dot-gelb    { background: #D4A820; }
.dot-gruen   { background: #3A8C50; }
.dot-blau    { background: #3A60B0; }
.dot-violett { background: #7B4C9A; }
.dot-weiss   { background: #E8E4DC; }

/* --- Farb-Badge --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .75rem;
  font-weight: 500;
  padding: .2rem .6rem;
  border-radius: 999px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-muted);
}

/* --- Lebensmittel-Auswahl --- */
.food-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .75rem;
  margin-top: 1rem;
}
@media (min-width: 540px) {
  .food-grid { grid-template-columns: 1fr 1fr; }
}

.food-item {
  display: flex;
  align-items: flex-start;
  gap: .875rem;
  padding: .875rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.food-item:hover {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(200,169,126,.15);
}
.food-item.selected {
  border-color: var(--color-accent);
  background: #FDF9F4;
}
.food-item.taken {
  opacity: .5;
  cursor: not-allowed;
  pointer-events: none;
}
.food-item-info { flex: 1; min-width: 0; }
.food-item-name { font-weight: 500; font-size: .9375rem; }
.food-item-meta { font-size: .8125rem; color: var(--color-muted); margin-top: .2rem; }
.food-item-qty  {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--color-accent-d);
  white-space: nowrap;
}

/* --- Reservierungsliste (Dashboard) --- */
.reservation-list { list-style: none; }
.reservation-item {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: .875rem 0;
  border-bottom: 1px solid var(--color-border);
}
.reservation-item:last-child { border-bottom: none; }
.reservation-info { flex: 1; min-width: 0; }
.reservation-name { font-weight: 500; }
.reservation-meta { font-size: .8125rem; color: var(--color-muted); margin-top: .15rem; }

/* --- Farbgruppen-Überschrift --- */
.color-section-title {
  display: flex;
  align-items: center;
  gap: .625rem;
  font-size: 1rem;
  font-weight: 600;
  margin: 1.5rem 0 .625rem;
  color: var(--color-text);
}
.category-label {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin: 1rem 0 .5rem;
}

/* --- Stat-Kacheln (Dashboard) --- */
.stats { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.stat-card {
  flex: 1;
  min-width: 140px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  text-align: center;
}
.stat-number { font-size: 2rem; font-weight: 700; color: var(--color-accent); }
.stat-label  { font-size: .8125rem; color: var(--color-muted); margin-top: .2rem; }

/* --- Admin-Tabelle --- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.data-table th {
  text-align: left;
  padding: .625rem .875rem;
  background: var(--color-surface);
  border-bottom: 2px solid var(--color-border);
  font-weight: 600;
  color: var(--color-muted);
  font-size: .8125rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
.data-table td {
  padding: .625rem .875rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--color-surface); }

/* --- Tabs (Admin-Filter) --- */
.tab-bar { display: flex; gap: .25rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.tab-btn {
  padding: .4rem .875rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: transparent;
  font-size: .8125rem;
  font-family: var(--font);
  cursor: pointer;
  color: var(--color-muted);
  transition: background .15s, color .15s;
}
.tab-btn.active, .tab-btn:hover {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

/* --- Modal --- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(44,44,44,.45);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--color-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 1.75rem;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.modal-actions {
  display: flex;
  gap: .75rem;
  margin-top: 1.25rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* --- Footer --- */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--color-border);
  padding: 1.5rem 0;
  text-align: center;
  font-size: .8125rem;
  color: var(--color-muted);
}
.site-footer a { color: var(--color-muted); }

/* --- Utility --- */
.text-muted   { color: var(--color-muted); }
.text-small   { font-size: .875rem; }
.text-center  { text-align: center; }
.mt-1  { margin-top: .5rem; }
.mt-2  { margin-top: 1rem; }
.mt-3  { margin-top: 1.5rem; }
.mb-1  { margin-bottom: .5rem; }
.mb-2  { margin-bottom: 1rem; }
.mb-3  { margin-bottom: 1.5rem; }
.flex  { display: flex; }
.items-center { align-items: center; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.w-full { width: 100%; }

/* --- Mobile Touch Optimierungen --- */
button, a, .food-item, .btn {
  -webkit-tap-highlight-color: transparent;
}

/* --- Responsive & Mobile --- */
@media (max-width: 640px) {
  .container {
    padding: 0 1rem;
  }

  .site-header {
    padding: 0.625rem 0;
  }

  .site-header .inner {
    padding: 0 1rem;
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  .site-logo {
    font-size: 0.9375rem;
    line-height: 1.25;
  }

  .site-nav {
    gap: 0.25rem;
  }

  .site-nav a {
    font-size: 0.8125rem;
    padding: 0.35rem 0.5rem;
  }

  .card {
    padding: 1.25rem 1rem;
    border-radius: 10px;
  }

  /* Verhindert automatisches Hereinzoomen auf iPhones/iPads */
  .form-input {
    font-size: 16px !important;
    padding: 0.75rem 0.875rem;
  }

  .btn {
    min-height: 44px;
    padding: 0.75rem 1.25rem;
  }

  .btn-sm {
    min-height: 36px;
    padding: 0.4rem 0.75rem;
  }

  .food-grid {
    gap: 0.625rem;
  }

  .food-item {
    padding: 0.875rem 1rem;
    border-radius: 10px;
    min-height: 52px;
  }

  .food-item:active {
    transform: scale(0.99);
  }

  .food-item.selected {
    border-color: var(--color-accent-d);
    background: #FAF5EE;
    box-shadow: 0 0 0 1px var(--color-accent-d);
  }

  .reservation-item {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.875rem 0;
  }

  .reservation-item form {
    margin-left: auto;
  }

  /* Schwebende Leiste am unteren Displayrand für einfache Daumen-Bedienung */
  .sticky-actions {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0.75rem 1rem;
    margin: 1.5rem -1rem 0;
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -4px 14px rgba(0,0,0,0.06);
    z-index: 50;
    display: flex;
    gap: 0.5rem;
  }

  .sticky-actions .btn {
    flex: 1;
    min-height: 46px;
  }

  .stats {
    flex-direction: column;
  }

  .stat-card {
    min-width: 100%;
    padding: 0.875rem 1rem;
  }

  .data-table {
    font-size: 0.8125rem;
  }

  .data-table th, .data-table td {
    padding: 0.5rem 0.625rem;
  }

  .modal {
    padding: 1.25rem;
    max-width: 95%;
  }
}

/* --- Scrollbar (dezent) --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--color-surface); }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }
