:root {
  --red: #c0392b;
  --red-dark: #96281b;
  --green: #2e7d32;
  --orange: #e67e22;
  --cream: #fffaf3;
  --paper: #ffffff;
  --ink: #2b2119;
  --ink-soft: #6b5f54;
  --line: #eee0d0;
  --shadow: 0 2px 10px rgba(43, 33, 25, 0.08);
  --radius: 14px;
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--cream);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---- Top bar ---- */
.topbar {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; }
.topbar .brand .logo { font-size: 1.6rem; }
.topbar nav { display: flex; gap: 14px; font-size: 0.9rem; }
.topbar nav a { text-decoration: none; opacity: 0.9; padding: 6px 10px; border-radius: 8px; }
.topbar nav a:hover, .topbar nav a.active { background: rgba(255,255,255,0.18); opacity: 1; }
.topbar .cart-btn {
  background: var(--orange); color: #fff; border: none; border-radius: 999px;
  padding: 10px 16px; font-weight: 700; cursor: pointer; font-size: 0.95rem;
}

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .topbar .brand { font-size: 1.05rem; }
  .topbar-actions { flex-wrap: wrap; gap: 6px !important; width: 100%; justify-content: flex-start; }
  .topbar-actions .btn, .topbar-actions a.btn { padding: 6px 10px; font-size: 0.78rem; }
  #push-status { display: none; }
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 10px; padding: 10px 16px; font-weight: 700;
  cursor: pointer; font-size: 0.95rem; text-decoration: none;
  transition: transform 0.05s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-green { background: var(--green); color: #fff; }
.btn-orange { background: var(--orange); color: #fff; }
.btn-outline { background: transparent; border: 2px solid var(--line); color: var(--ink); }
.btn-ghost { background: rgba(0,0,0,0.05); color: var(--ink); }
.btn-sm { padding: 6px 10px; font-size: 0.82rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Cards ---- */
.card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

/* ---- Forms ---- */
label { display: block; font-size: 0.82rem; font-weight: 700; color: var(--ink-soft); margin: 10px 0 4px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--line);
  font-size: 0.95rem; font-family: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red); }
textarea { resize: vertical; min-height: 60px; }

/* ---- Badges ---- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; }
.badge-neu { background: #fdecea; color: var(--red); }
.badge-in_zubereitung { background: #fff3e0; color: #b45309; }
.badge-fertig { background: #e8f5e9; color: var(--green); }
.badge-unterwegs { background: #e3f2fd; color: #1565c0; }
.badge-geliefert { background: #eee; color: #555; }
.badge-storniert { background: #f3e5f5; color: #6a1b9a; }

.channel-tag {
  display: inline-flex; align-items: center; gap: 4px; font-size: 0.72rem; font-weight: 700;
  background: rgba(0,0,0,0.06); padding: 2px 8px; border-radius: 999px; color: var(--ink-soft);
}

/* ---- Toast ---- */
#toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 10px;
  z-index: 999; opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
  max-width: 90vw; text-align: center; font-weight: 600;
}
#toast.show { opacity: 1; }

.empty-state { text-align: center; padding: 40px 16px; color: var(--ink-soft); }
.empty-state .big { font-size: 2.4rem; margin-bottom: 10px; }

.spinner { width: 22px; height: 22px; border: 3px solid rgba(0,0,0,0.1); border-top-color: var(--red); border-radius: 50%; animation: spin 0.7s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }

::-webkit-scrollbar { height: 8px; width: 8px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; }
