* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f6f3ef;
  color: #2b2b2b;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: var(--primary, #8b5a2b);
  color: #fff;
}
.site-header a { color: #fff; text-decoration: none; }
.site-header .brand { font-weight: 700; font-size: 1.15rem; }
.site-header nav { display: flex; align-items: center; gap: 1rem; }
.site-header nav a:hover { opacity: 0.85; }
.inline-form { display: inline; margin: 0; }
.linklike {
  background: none; border: none; color: inherit; cursor: pointer;
  font: inherit; text-decoration: underline; padding: 0;
}

.container {
  flex: 1;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

.site-footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.85rem;
  color: #777;
}
.site-footer .footer-links { display: block; margin-top: 0.25rem; }
.site-footer a { color: #777; }

.legal {
  background: #fff;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
  max-width: 760px;
  margin: 0 auto;
  text-align: left;
  line-height: 1.55;
}
.legal h1 { color: var(--primary, #8b5a2b); margin-top: 0; }
.legal h2 { font-size: 1.05rem; margin-bottom: 0.4rem; }

.hero {
  background: #fff;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
}
.hero.narrow { max-width: 440px; margin: 0 auto; }
.hero h1 { margin-top: 0; color: var(--primary, #8b5a2b); }
.subtitle { color: #555; }
.reward { font-size: 1.1rem; }

.create-form {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: 1.5rem 0 0.75rem;
  flex-wrap: wrap;
}
.create-form.column { flex-direction: column; align-items: stretch; max-width: 320px; margin-left: auto; margin-right: auto; }
.create-form input {
  padding: 0.7rem 0.9rem;
  border: 1px solid #ccc;
  border-radius: 10px;
  font-size: 1rem;
}
button, .btn {
  background: var(--primary, #8b5a2b);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.7rem 1.2rem;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button:hover, .btn:hover { filter: brightness(1.08); }

.auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
  text-align: left;
}
@media (max-width: 640px) { .auth-grid { grid-template-columns: 1fr; } }
.auth-form {
  border: 1px solid #e5e0d8;
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.auth-form h2 { margin: 0 0 0.25rem; font-size: 1.1rem; color: var(--primary, #8b5a2b); }
.auth-form input {
  padding: 0.65rem 0.85rem;
  border: 1px solid #ccc;
  border-radius: 10px;
  font-size: 0.95rem;
}

.hint { color: #888; font-size: 0.85rem; }
.error { color: #b00020; }
.info {
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
}

.card-view {
  background: #fff;
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
}
.card-view h1 { color: var(--primary, #8b5a2b); margin-top: 0; }
.card-name { font-size: 1.2rem; font-weight: 600; margin-bottom: 0; }
.card-code { color: #666; }
.card-code code { background: #f0ece6; padding: 0.15rem 0.5rem; border-radius: 6px; }

.stamp-digit {
  font-size: 4.5rem;
  font-weight: 800;
  color: var(--primary, #8b5a2b);
  margin: 0.5rem 0 0;
  line-height: 1;
}
.stamps { font-size: 1.4rem; letter-spacing: 0.25rem; margin: 0.75rem 0 0.25rem; }
.stamp { color: #d8cfc4; }
.stamp.filled { color: var(--primary, #8b5a2b); }
.stamp-count { color: #666; margin-top: 0; }

.reward-banner {
  background: var(--primary, #8b5a2b);
  color: #fff;
  font-weight: 700;
  border-radius: 12px;
  padding: 0.8rem;
  margin: 1rem 0;
}

.qr-box { margin: 1.25rem 0 0.25rem; }
.qr-box img { border: 1px solid #e0dacf; border-radius: 12px; background: #fff; }

.wallet-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 1.5rem 0 0.5rem;
}
.btn-google { background: #1a73e8; }

/* ---------- Admin mit linker Sidebar ---------- */
.admin-body { background: #f4f4f6; }
.admin-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: #1e1f24;
  color: #d7d7dc;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0.75rem;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  padding: 0.25rem 0.75rem 1.25rem;
  border-bottom: 1px solid #33353d;
  margin-bottom: 0.75rem;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; }
.sidebar-nav a {
  color: #c9c9d1;
  text-decoration: none;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  font-size: 0.95rem;
}
.sidebar-nav a:hover { background: #2a2c33; color: #fff; }
.sidebar-nav a.active { background: var(--primary, #8b5a2b); color: #fff; }
.sidebar-footer {
  border-top: 1px solid #33353d;
  padding-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.sidebar-footer a { color: #9a9aa5; font-size: 0.85rem; text-decoration: none; padding: 0 0.75rem; }
.sidebar-footer a:hover { color: #fff; }
.sidebar-footer .linklike { color: #9a9aa5; font-size: 0.85rem; text-align: left; padding: 0 0.75rem; }
.sidebar-footer .linklike:hover { color: #fff; }

.admin-content {
  flex: 1;
  padding: 2rem 2.5rem;
  max-width: 1100px;
}
.admin-content h1 { margin-top: 0; }
.admin-content h2 { font-size: 1.1rem; margin-bottom: 0.5rem; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.stat-num { font-size: 2rem; font-weight: 800; color: var(--primary, #8b5a2b); }
.stat-label { color: #777; font-size: 0.85rem; }

.cards-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  margin: 0.75rem 0 1.5rem;
}
.cards-table th, .cards-table td {
  text-align: left;
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid #eee;
  font-size: 0.95rem;
}
.cards-table th { background: #faf7f2; }
.cards-table code { background: #f0ece6; padding: 0.1rem 0.4rem; border-radius: 6px; }
.actions { white-space: nowrap; }
.actions form { display: inline-block; margin-right: 0.3rem; }

.scan-form { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.scan-form input {
  padding: 0.55rem 0.8rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 0.95rem;
  min-width: 260px;
}

.btn-small { padding: 0.35rem 0.7rem; font-size: 0.85rem; border-radius: 8px; }
.btn-reward { background: #2e7d32; }
.btn-danger { background: #b00020; }

.badge {
  background: #e0e0e0;
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: 0.8rem;
}
.badge-rewarded { background: #ffe082; color: #5d4037; font-weight: 600; }

.design-form fieldset, .settings-form {
  background: #fff;
  border: 1px solid #e5e0d8;
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.design-form legend { font-weight: 600; padding: 0 0.4rem; }
.design-form label { display: flex; flex-direction: column; gap: 0.35rem; margin-right: 1rem; margin-bottom: 0.75rem; font-size: 0.9rem; color: #444; }
.design-form fieldset:first-of-type label { flex-direction: row; align-items: center; gap: 0.5rem; }
.design-form textarea {
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  font: inherit;
}
.design-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.design-item {
  border: 1px dashed #ccc;
  border-radius: 10px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
}
.design-item input[type="url"] {
  padding: 0.4rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 0.8rem;
}
.design-preview { max-width: 100%; max-height: 80px; object-fit: contain; border-radius: 6px; }
.design-item .hint { font-size: 0.75rem; }

/* Karten-Vorschau im Design-Menü */
.pv-toggle { display: flex; gap: 0.5rem; margin-bottom: 0.4rem; }
.pv-tab {
  background: #fff;
  color: #444;
  border: 1px solid #ccc;
  border-radius: 999px;
  padding: 0.5rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 600;
}
.pv-tab.active { background: var(--primary, #8b5a2b); color: #fff; border-color: var(--primary, #8b5a2b); }
.hidden { display: none !important; }

.pv-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70px;
  margin: 6px;
  border: 2px dashed rgba(255, 255, 255, 0.5);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.75rem;
  text-align: center;
  padding: 0.4rem;
}
.pv-slot-round { border-radius: 50%; width: 56px; height: 56px; min-height: 56px; margin: 0 auto; }
.pv-icon { width: 29px; height: 29px; object-fit: contain; border-radius: 6px; background: rgba(255, 255, 255, 0.12); }

.pass-preview {
  width: 320px;
  max-width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: var(--pv-bg, #8b5a2b);
  color: var(--pv-text, #fff);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.2);
  margin-bottom: 0.5rem;
}
.pv-strip { min-height: 70px; background: rgba(0, 0, 0, 0.15); }
.pv-strip img { width: 100%; height: 110px; object-fit: cover; display: block; }
.pv-head { display: flex; align-items: center; gap: 0.6rem; padding: 0.8rem 1rem 0; }
.pv-logo { width: 44px; height: 44px; object-fit: contain; border-radius: 8px; background: rgba(255, 255, 255, 0.12); }
.pv-org { font-weight: 700; font-size: 0.95rem; }
.pv-rows { display: flex; justify-content: space-between; align-items: center; padding: 0.6rem 1rem; }
.pv-primary { display: flex; flex-direction: column; align-items: center; }
.pv-digit { font-size: 2.6rem; font-weight: 800; line-height: 1; }
.pv-plabel { color: var(--pv-label, #e6e6e6); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; }
.pv-secondary { text-align: right; }
.pv-slabel { display: block; color: var(--pv-label, #e6e6e6); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; }
.pv-svalue { font-weight: 600; font-size: 0.9rem; }
.pv-qrbox { display: flex; justify-content: center; padding: 0.4rem 0 0.9rem; }
.pv-qr { width: 92px; height: 92px; background: #fff; border-radius: 8px; padding: 4px; }

/* Google-Wallet-Variante */
.pv-google { width: 360px; }
.pv-hero { min-height: 80px; background: rgba(0, 0, 0, 0.15); }
.pv-hero img { width: 100%; height: 130px; object-fit: cover; display: block; }
.pv-gbody { padding: 0.9rem 1rem; text-align: center; }
.pv-glogo { width: 56px; height: 56px; object-fit: contain; border-radius: 50%; background: #fff; }
.pv-gname { font-weight: 700; margin-top: 0.4rem; }
.pv-gpoints { font-size: 1.1rem; margin-top: 0.3rem; }
.pv-gpoints .pv-digit { font-size: 2rem; }
.pv-greward { color: var(--pv-text, #fff); opacity: 0.85; font-size: 0.8rem; margin-top: 0.2rem; }

.settings-form { max-width: 480px; display: flex; flex-direction: column; gap: 0.9rem; }
.settings-form input {
  padding: 0.6rem 0.8rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 0.95rem;
  width: 100%;
}
.settings-form fieldset { border: 1px dashed #ccc; border-radius: 8px; margin: 0.5rem 0; }
.tier-row { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.tier-row input[type="number"] { width: 90px; flex-shrink: 0; }

.tier-list {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0;
  color: #555;
  font-size: 0.95rem;
}
