:root {
  --brand: #7a1f1f;
  --brand-fg: #fff;
  --accent: #f6c453;
  --ok: #1f8a4c;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Kundenseite (nur Fallback) ---------- */
.landing {
  min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 32px 20px; text-align: center; background: var(--brand); color: var(--brand-fg);
}
.landing .logo { width: 96px; height: 96px; border-radius: 22px; }
.landing h1 { margin: 8px 0 0; font-size: 28px; }
.landing .lead { margin: 0; max-width: 32ch; opacity: .9; }
.notice { background: rgba(0,0,0,.25); padding: 8px 14px; border-radius: 10px; }
.buttons { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; width: min(320px, 100%); }
.wallet-btn {
  display: block; padding: 15px 18px; border-radius: 12px; background: #000; color: #fff;
  text-decoration: none; font-weight: 600; font-size: 17px;
}
.desktop-only { display: none; margin-top: 20px; }
.desktop-only .qr { width: 200px; background: #fff; padding: 10px; border-radius: 12px; margin: 0 auto; }
@media (hover: hover) and (pointer: fine) { .desktop-only { display: block; } }

/* ---------- Aushang ---------- */
.poster-body { background: #fff; color: #111; }
.poster { max-width: 720px; margin: 0 auto; padding: 40px 24px; text-align: center; }
.poster h1 { font-size: 56px; margin: 0 0 8px; color: var(--brand); }
.poster .big { font-size: 26px; line-height: 1.35; }
.poster .qr { width: min(440px, 80vw); margin: 24px auto; }
.poster .small { font-size: 18px; color: #555; }
.poster .help { margin-top: 48px; padding: 20px; background: #f4f4f4; border-radius: 12px; text-align: left; }
.poster code { display: block; padding: 10px; background: #fff; border-radius: 8px; word-break: break-all; font-size: 16px; }
@media print { .no-print { display: none; } .poster { padding-top: 0; } }

/* ---------- Personal ---------- */
.staff { background: #111; color: #f2f2f2; }
.btn {
  appearance: none; border: 0; border-radius: 14px; padding: 14px 18px; font: inherit; font-weight: 600;
  background: #2a2a2a; color: #fff; cursor: pointer; touch-action: manipulation;
}
.btn:disabled { opacity: .4; }
.btn.primary { background: var(--ok); }
.btn.reward { background: var(--accent); color: #111; }
.btn.ghost { background: transparent; border: 1px solid #444; }
.btn.huge { width: 100%; padding: 22px; font-size: 24px; }
.link { background: none; border: 0; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }
.error { color: #ff7a7a; min-height: 1.2em; }

.login { max-width: 320px; margin: 18vh auto 0; padding: 0 20px; display: flex; flex-direction: column; gap: 12px; }
.login h1 { margin: 0 0 12px; }
.login input, .manual input {
  font: inherit; font-size: 22px; padding: 14px; border-radius: 12px; border: 1px solid #444; background: #1c1c1c; color: #fff;
}

#app { display: flex; flex-direction: column; height: 100dvh; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); }
.topbar a { color: inherit; margin-right: 12px; }
.stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; opacity: .85; }
.stats b { font-size: 18px; }

.scanner { position: relative; flex: 1; overflow: hidden; background: #000; }
.scanner video { width: 100%; height: 100%; object-fit: cover; }
.frame {
  position: absolute; inset: 50% auto auto 50%; width: min(64vw, 300px); aspect-ratio: 1; transform: translate(-50%, -50%);
  border: 3px solid rgba(255,255,255,.85); border-radius: 20px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35);
}
.camera-msg { position: absolute; left: 0; right: 0; bottom: 16px; margin: 0; text-align: center; padding: 0 16px; text-shadow: 0 1px 3px #000; }

.manual { display: flex; gap: 8px; padding: 12px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.manual input { flex: 1; min-width: 0; font-size: 18px; }

.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: flex-end; justify-content: center; }
.sheet-inner {
  width: min(520px, 100%); background: #1b1b1b; border-radius: 24px 24px 0 0; padding: 24px 20px;
  padding-bottom: max(24px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; text-align: center;
}
.sheet-code { margin: 0; opacity: .7; letter-spacing: .05em; }
.sheet-count { margin: 0; font-size: 56px; font-weight: 700; line-height: 1; }
.sheet-dots { margin: 0; font-size: 26px; letter-spacing: .12em; color: var(--accent); word-break: break-all; }
.sheet-msg { margin: 0; min-height: 1.4em; font-weight: 600; }
.sheet.is-full .sheet-count { color: var(--accent); }
.row { display: flex; gap: 10px; }
.row .btn { flex: 1; }

/* ---------- Verwaltung ---------- */
.admin { min-height: 100dvh; }
.admin-main { max-width: 560px; margin: 0 auto; padding: 8px 16px 48px; display: flex; flex-direction: column; gap: 20px; }
.panel { background: #1b1b1b; border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.panel h2 { margin: 0; font-size: 20px; }
.panel h3 { margin: 4px 0 0; font-size: 16px; }
.hint { margin: 0; color: #aaa; font-size: 14px; line-height: 1.45; }
.panel form { display: flex; flex-direction: column; gap: 10px; }
.panel textarea, .panel input {
  font: inherit; font-size: 17px; padding: 12px; border-radius: 12px; border: 1px solid #444; background: #111; color: #fff; width: 100%;
}
.panel textarea { resize: vertical; }
.meta { display: flex; justify-content: space-between; font-size: 13px; color: #aaa; }
.meta .over { color: #ff7a7a; font-weight: 700; }
.result { margin: 0; min-height: 1.2em; font-size: 14px; }
.current { border: 1px solid var(--accent); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.current p { margin: 0; }
.badge { background: var(--accent); color: #111; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }

.preview { background: linear-gradient(160deg, #3a4a6b, #6b3a55); border-radius: 16px; padding: 18px 12px; }
.notif { display: flex; gap: 10px; align-items: flex-start; background: rgba(245,245,245,.85); color: #111; border-radius: 14px; padding: 10px 12px; backdrop-filter: blur(10px); }
.notif img { width: 34px; height: 34px; border-radius: 8px; }
.notif div { display: flex; flex-direction: column; font-size: 14px; line-height: 1.3; min-width: 0; overflow-wrap: anywhere; }

.locations { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.locations li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: #111; border: 1px solid #333; }
.locations li.active { border-color: var(--ok); }
.locations li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.locations a { color: #aaa; font-size: 13px; }
.locations .empty { color: #888; justify-content: center; }
.switch { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.switch input { width: 22px; height: 22px; accent-color: var(--ok); }

/* ---------- Einladen ---------- */
.share .wallet-btn { border: 0; font: inherit; font-weight: 600; font-size: 17px; cursor: pointer; }
.share .ghost-light { background: transparent; border: 2px solid rgba(255,255,255,.7); color: #fff; }
.share-qr { width: 220px; background: #fff; padding: 10px; border-radius: 14px; }
.small-note { opacity: .85; font-size: 14px; }

/* ---------- Automatische Aktionen ---------- */
.auto { border-top: 1px solid #333; padding-top: 14px; }
.toggle { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.toggle input, .days input { width: 22px; height: 22px; accent-color: var(--ok); }
.panel .num { width: 80px; display: inline-block; text-align: center; padding: 8px; }
.panel input[type="time"] { width: auto; padding: 8px; }
.slot { border: 1px solid #333; border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.days { display: flex; flex-wrap: wrap; gap: 10px; }
.days label { display: flex; align-items: center; gap: 4px; }
.times { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.live { color: var(--accent); font-weight: 700; }
.btn.primary.bonus { background: linear-gradient(135deg, var(--ok), #c98a12); }

/* ---------- Plattform ---------- */
.admin-main.wide { max-width: 980px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.business-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.business-item {
  width: 100%; display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-radius: 14px;
  background: #111; border: 1px solid #333; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.business-item:hover { border-color: #666; }
.business-item img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; }
.business-item > span:first-of-type { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.business-item small { color: #999; }
.num-stat { display: flex; flex-direction: column; align-items: center; min-width: 70px; }
.badge.off { background: #555; color: #fff; }
.edit-grid { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
@media (max-width: 800px) { .edit-grid { grid-template-columns: 1fr; } }
.panel label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: #ccc; }
.panel label.toggle { flex-direction: row; color: inherit; font-size: 16px; }
.two { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.panel input[type="color"] { height: 44px; padding: 4px; }
.side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 12px; }
.card-preview {
  --label: #F6C453; border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 4px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4); min-height: 220px;
}
.card-preview small { color: var(--label); font-size: 11px; font-weight: 600; letter-spacing: .04em; }
.cp-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cp-top img { height: 30px; max-width: 96px; object-fit: contain; }
.cp-top img:not([src]) { display: none; }
.cp-top span:nth-child(2) { flex: 1; font-weight: 600; }
.cp-head { display: flex; flex-direction: column; align-items: flex-end; }
.cp-dots { font-size: 22px; letter-spacing: .08em; word-break: break-all; margin-bottom: 8px; }
.cp-qr { align-self: center; margin-top: auto; background: #fff; color: #111; width: 64px; height: 64px; border-radius: 6px;
  display: grid; place-items: center; font-size: 44px; }
.pins { border: 2px solid var(--accent); border-radius: 14px; padding: 14px; background: #2a2410; }
.pins h3 { margin: 0; }
.pins code { font-size: 22px; letter-spacing: .15em; background: #111; padding: 2px 8px; border-radius: 6px; }
#details { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid #333; padding-top: 16px; }
#details h3 { margin: 10px 0 0; }
#embed-code { font-family: ui-monospace, Menlo, monospace; font-size: 14px; }
.btn.copy { align-self: flex-start; }
.links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.links li { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.links span { color: #aaa; }
.links a { color: #9cf; word-break: break-all; }
#dns-box code, .hint code { background: #111; padding: 1px 6px; border-radius: 4px; color: #fff; }
.poster-logo { width: 120px; height: 120px; border-radius: 24px; }
