* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0; background: #f4f6f8; color: #222;
}
.muted { color: #888; }
.error { color: #c0392b; font-weight: bold; margin-top: 12px; }

/* LOGIN */
.login-bg {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #ff9966, #c0392b);
}
.login-card {
  background: white; padding: 40px; border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2); width: 320px; text-align: center;
}
.login-card h1 { margin: 0 0 8px 0; font-size: 28px; }
.login-card input {
  width: 100%; padding: 12px; margin: 8px 0; border: 1px solid #ddd;
  border-radius: 6px; font-size: 15px;
}
.login-card button {
  width: 100%; padding: 12px; background: #c0392b; color: white;
  border: none; border-radius: 6px; font-size: 16px; font-weight: bold;
  cursor: pointer; margin-top: 8px;
}
.login-card button:hover { background: #a93022; }

/* HEADER */
header {
  background: white; padding: 12px 24px; border-bottom: 1px solid #ddd;
  display: flex; justify-content: space-between; align-items: center;
}
header h1 { margin: 0; font-size: 22px; }
.userbar { font-size: 14px; }
.userbar a.logout { margin-left: 12px; color: #c0392b; text-decoration: none; }

/* TABS */
.tabs {
  background: white; padding: 0 24px; border-bottom: 1px solid #ddd;
  display: flex; gap: 4px;
}
.tab {
  background: none; border: none; padding: 14px 20px; font-size: 15px;
  cursor: pointer; color: #666; border-bottom: 3px solid transparent;
}
.tab.active { color: #c0392b; border-bottom-color: #c0392b; font-weight: bold; }
.tab:hover { color: #c0392b; }

main { padding: 24px; max-width: 1200px; margin: 0 auto; }
.tab-content { display: none; }
.tab-content.active { display: block; }

.toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; gap: 12px; flex-wrap: wrap;
}
.toolbar h2 { margin: 0; }
.toolbar input[type=search] {
  padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px;
  font-size: 14px; width: 220px;
}

.btn-primary {
  background: #c0392b; color: white; border: none; padding: 10px 18px;
  border-radius: 6px; font-weight: bold; cursor: pointer; font-size: 14px;
}
.btn-primary:hover { background: #a93022; }
.btn-secondary {
  background: #ecf0f1; color: #333; border: 1px solid #ccc; padding: 10px 18px;
  border-radius: 6px; cursor: pointer; font-size: 14px;
}
.btn-secondary:hover { background: #d6dde0; }
.btn-small {
  background: white; border: 1px solid #ccc; padding: 4px 10px;
  border-radius: 4px; cursor: pointer; font-size: 13px;
}
.btn-small:hover { background: #f4f6f8; }

/* PLAN */
.plan-list { display: grid; gap: 12px; }
.plan-item {
  background: white; padding: 16px; border-radius: 8px;
  display: grid; grid-template-columns: 80px 1fr auto; gap: 16px; align-items: center;
  border-left: 4px solid #ddd;
}
.plan-item.akzeptiert { border-left-color: #27ae60; }
.plan-item.vorgeschlagen { border-left-color: #f39c12; }
.plan-item.abgelehnt { border-left-color: #c0392b; opacity: 0.6; }
.plan-tag { font-weight: bold; color: #c0392b; }
.plan-mahlzeit { font-size: 13px; color: #888; }
.plan-name { font-size: 16px; font-weight: bold; }
.plan-meta { font-size: 12px; color: #888; }
.plan-actions { display: flex; gap: 6px; }

/* REZEPTE */
.rezept-grid {
  display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.rezept-card {
  background: white; padding: 16px; border-radius: 8px; cursor: pointer;
  border: 1px solid transparent; transition: all 0.15s;
}
.rezept-card:hover { border-color: #c0392b; transform: translateY(-2px); }
.rezept-card h3 { margin: 0 0 8px 0; font-size: 16px; }
.rezept-meta { display: flex; gap: 12px; font-size: 13px; color: #888; margin-bottom: 8px; }
.rezept-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.tag-chip {
  background: #ecf0f1; padding: 2px 8px; border-radius: 4px; font-size: 11px;
}
.tag-chip.kueche-deutsch { background: #fde8d8; }
.tag-chip.kueche-italienisch { background: #d6eaf8; }
.tag-chip.kueche-asiatisch { background: #d5f5e3; }

/* STERNE */
.sterne { display: inline-flex; gap: 2px; }
.stern {
  font-size: 18px; cursor: pointer; color: #ddd; user-select: none;
  transition: color 0.1s;
}
.stern.active, .stern:hover, .stern:hover ~ .stern.active { color: #f39c12; }
.stern-row {
  display: flex; align-items: center; gap: 12px; margin: 8px 0;
  font-size: 14px;
}
.stern-row label { min-width: 110px; }

/* MODAL */
.modal {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); display: flex; align-items: center;
  justify-content: center; z-index: 100;
}
.modal-content {
  background: white; padding: 32px; border-radius: 12px;
  max-width: 600px; width: 90%; max-height: 90vh; overflow-y: auto;
  position: relative;
}
.modal-close {
  position: absolute; top: 12px; right: 12px; background: none;
  border: none; font-size: 28px; cursor: pointer; color: #888;
}
.modal-content h2 { margin-top: 0; }
.modal-content label {
  display: block; margin-top: 12px; font-size: 13px; font-weight: bold; color: #555;
}
.modal-content input, .modal-content textarea, .modal-content select {
  width: 100%; padding: 8px; margin-top: 4px; border: 1px solid #ddd;
  border-radius: 4px; font-size: 14px; font-family: inherit;
}
.modal-content textarea { min-height: 80px; resize: vertical; }
.modal-actions {
  display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  header { padding: 8px 12px; flex-direction: column; gap: 4px; }
  main { padding: 12px; }
  .tabs { overflow-x: auto; }
  .tab { padding: 12px 12px; font-size: 14px; white-space: nowrap; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar input[type=search] { width: 100%; }
  .plan-item { grid-template-columns: 1fr; gap: 8px; }
  .plan-actions { justify-content: flex-end; }
}
