/* GartenLan / EventPlaner - Nachtgarten mit Lichterkette */
:root {
  --bg: #0e1712;
  --bg2: #142019;
  --bg3: #1b2a21;
  --line: #26392d;
  --line2: #33503e;
  --text: #e9f2ec;
  --dim: #9db3a5;
  --muted: #637a6c;
  --leaf: #7bd88f;
  --lamp: #f6c453;
  --lan: #5ec8f2;
  --rose: #f2789f;
  --danger: #ff6b6b;
  --r: 14px;
  --r-lg: 22px;
  --shadow: 0 10px 40px rgba(0, 0, 0, .35);
  --head: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: 'Nunito Sans', system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font-family: var(--body); font-size: 15px; line-height: 1.55;
  background-image:
    radial-gradient(1200px 500px at 85% -10%, rgba(246, 196, 83, .08), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(123, 216, 143, .07), transparent 60%);
  background-attachment: fixed;
}
a { color: var(--lamp); text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--head); margin: 0 0 .4em; line-height: 1.15; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.6rem); font-weight: 800; }
h2 { font-size: 1.35rem; font-weight: 800; }
h3 { font-size: 1.08rem; font-weight: 600; }
p { margin: 0 0 .8em; }
small, .dim { color: var(--dim); }
.muted { color: var(--muted); }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(14, 23, 18, .86); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--head); font-weight: 800; font-size: 1.15rem; color: var(--text); }
.brand img { width: 30px; height: 30px; }
.lights { display: inline-flex; gap: 5px; margin-left: 4px; }
.lights i { width: 6px; height: 6px; border-radius: 50%; background: var(--lamp); box-shadow: 0 0 8px var(--lamp); animation: glow 2.4s infinite ease-in-out; }
.lights i:nth-child(2) { background: var(--leaf); box-shadow: 0 0 8px var(--leaf); animation-delay: .4s; }
.lights i:nth-child(3) { background: var(--lan); box-shadow: 0 0 8px var(--lan); animation-delay: .8s; }
@keyframes glow { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.topbar .spacer { flex: 1; }
.topnav { display: flex; gap: 4px; }
.topnav a { padding: 7px 12px; border-radius: 10px; color: var(--dim); font-weight: 600; font-size: .92rem; }
.topnav a:hover, .topnav a.on { color: var(--text); background: var(--bg3); }
.me-chip { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 4px; border-radius: 30px; border: 1px solid var(--line); background: var(--bg2); cursor: pointer; }
.me-chip .nm { font-weight: 600; font-size: .9rem; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .78rem; color: #10180f; flex: none; }
.dot.sm { width: 24px; height: 24px; font-size: .68rem; }
.menu { position: absolute; right: 16px; top: 58px; background: var(--bg2); border: 1px solid var(--line2); border-radius: var(--r); box-shadow: var(--shadow); min-width: 200px; padding: 6px; z-index: 40; }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 10px; color: var(--text); background: none; border: 0; cursor: pointer; font-weight: 600; }
.menu a:hover, .menu button:hover { background: var(--bg3); }

/* ---------- Layout ---------- */
.app { max-width: 1100px; margin: 0 auto; padding: 22px 16px 120px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 14px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.card.tight { padding: 14px; }
.card.click { cursor: pointer; transition: transform .15s, border-color .15s; }
.card.click:hover { transform: translateY(-2px); border-color: var(--line2); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 26px 0 12px; flex-wrap: wrap; }
.section-title h2 { margin: 0; }
.back { display: inline-flex; gap: 6px; align-items: center; color: var(--dim); font-weight: 600; margin-bottom: 10px; }
.empty { text-align: center; padding: 30px 16px; color: var(--dim); border: 1px dashed var(--line2); border-radius: var(--r-lg); }
.hr { height: 1px; background: var(--line); margin: 14px 0; border: 0; }

/* ---------- Hero / Landing ---------- */
.hero { display: grid; gap: 22px; grid-template-columns: 1.2fr 1fr; align-items: start; margin-top: 10px; }
.hero .lead { font-size: 1.1rem; color: var(--dim); max-width: 34ch; }
.hero-title span { color: var(--lamp); }
.string { height: 30px; margin: 8px 0 18px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='30'%3E%3Cpath d='M0 6 Q30 26 60 6 T120 6' fill='none' stroke='%2333503e' stroke-width='1.5'/%3E%3Ccircle cx='30' cy='17' r='4' fill='%23f6c453'/%3E%3Ccircle cx='90' cy='17' r='4' fill='%237bd88f'/%3E%3C/svg%3E") repeat-x; opacity: .9; }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; } }

/* ---------- Event-Karten ---------- */
.ev-card { position: relative; overflow: hidden; }
.ev-card .kind { position: absolute; top: 14px; right: 14px; }
.ev-card h3 { padding-right: 90px; font-size: 1.2rem; font-family: var(--head); font-weight: 800; }
.ev-meta { display: flex; flex-direction: column; gap: 3px; color: var(--dim); font-size: .92rem; margin: 6px 0 12px; }
.datebox { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 58px; height: 62px; border-radius: 14px; background: var(--bg3); border: 1px solid var(--line2); flex: none; }
.datebox b { font-family: var(--head); font-size: 1.35rem; line-height: 1; }
.datebox span { font-size: .7rem; text-transform: uppercase; color: var(--lamp); letter-spacing: .06em; font-weight: 700; }

/* ---------- Badges / Buttons ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 20px; font-size: .75rem; font-weight: 700; background: var(--bg3); color: var(--dim); border: 1px solid var(--line2); white-space: nowrap; }
.badge.lamp { color: var(--lamp); border-color: rgba(246, 196, 83, .35); background: rgba(246, 196, 83, .08); }
.badge.leaf { color: var(--leaf); border-color: rgba(123, 216, 143, .35); background: rgba(123, 216, 143, .08); }
.badge.lan { color: var(--lan); border-color: rgba(94, 200, 242, .35); background: rgba(94, 200, 242, .08); }
.badge.rose { color: var(--rose); border-color: rgba(242, 120, 159, .35); background: rgba(242, 120, 159, .08); }
.badge.red { color: var(--danger); border-color: rgba(255, 107, 107, .35); background: rgba(255, 107, 107, .08); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line2); background: var(--bg3); color: var(--text); font-weight: 700; cursor: pointer; font-size: .93rem; min-height: 42px; transition: filter .15s, transform .1s; -webkit-tap-highlight-color: transparent; }
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--lamp); border-color: var(--lamp); color: #1a1708; }
.btn.leaf { background: var(--leaf); border-color: var(--leaf); color: #0d1f12; }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; border-color: rgba(255, 107, 107, .5); color: var(--danger); }
.btn.sm { padding: 6px 11px; min-height: 34px; font-size: .84rem; border-radius: 10px; }
.btn.icon { width: 36px; padding: 0; min-height: 36px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.linkbtn { background: none; border: 0; color: var(--lamp); cursor: pointer; font-weight: 700; padding: 0; }

/* ---------- Formulare ---------- */
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: .82rem; color: var(--dim); margin-bottom: 5px; font-weight: 600; }
.input, select.input, textarea.input { width: 100%; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line2); background: var(--bg); color: var(--text); font-size: 1rem; min-height: 44px; }
textarea.input { min-height: 90px; resize: vertical; }
.input:focus { outline: 2px solid rgba(246, 196, 83, .45); outline-offset: 1px; border-color: var(--lamp); }
.fgrid { display: grid; gap: 0 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .fgrid { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 6px 0; }
.check input { width: 20px; height: 20px; accent-color: var(--lamp); }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line2); border-radius: 12px; padding: 3px; gap: 3px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 8px 12px; border-radius: 9px; cursor: pointer; font-weight: 700; color: var(--dim); font-size: .88rem; }
.seg button.on { background: var(--bg3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line2); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 16px -16px 18px; padding: 0 16px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; padding: 9px 14px; border-radius: 12px; color: var(--dim); font-weight: 700; border: 1px solid transparent; font-size: .92rem; }
.tabs a.on { color: var(--text); background: var(--bg2); border-color: var(--line2); }

/* ---------- Stats ---------- */
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.stat .k { font-size: .78rem; color: var(--dim); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.stat .v { font-family: var(--head); font-size: 1.6rem; font-weight: 800; margin-top: 2px; }
.pos { color: var(--leaf); } .neg { color: var(--danger); }

/* ---------- Tabellen ---------- */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg2); }
table.t { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.t th, table.t td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t th { font-size: .75rem; color: var(--dim); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; background: var(--bg3); position: sticky; top: 0; }
table.t tr:last-child td { border-bottom: 0; }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.t td.c, table.t th.c { text-align: center; }
table.t tr.guest td:first-child { padding-left: 26px; color: var(--dim); }
table.t tfoot td { font-weight: 700; background: var(--bg3); }
.yes { color: var(--leaf); font-weight: 800; } .no { color: var(--muted); }

/* ---------- Versorgung ---------- */
.day-card { padding: 0; overflow: hidden; }
.day-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--bg3); border-bottom: 1px solid var(--line); }
.day-head h3 { margin: 0; }
.meal { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.meal:last-child { border-bottom: 0; }
.meal .ico { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; background: var(--bg); border: 1px solid var(--line2); flex: none; }
.meal .body { flex: 1; min-width: 0; }
.meal .type { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--lamp); font-weight: 800; }
.meal .title { font-weight: 700; font-size: 1.02rem; }
.meal .desc { color: var(--dim); font-size: .9rem; white-space: pre-line; }
.meal .side { text-align: right; flex: none; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.meal.mine .ico { border-color: var(--leaf); box-shadow: 0 0 0 3px rgba(123, 216, 143, .12); }

/* ---------- Wizard ---------- */
.wiz { max-width: 720px; margin: 0 auto; }
.wiz-progress { display: flex; gap: 6px; margin: 4px 0 22px; }
.wiz-progress i { flex: 1; height: 5px; border-radius: 4px; background: var(--line); }
.wiz-progress i.done { background: var(--leaf); }
.wiz-progress i.cur { background: var(--lamp); }
.speaker { display: flex; gap: 16px; align-items: flex-end; margin-bottom: 22px; animation: rise .35s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.avatar { width: 92px; height: 92px; border-radius: 50%; flex: none; background: var(--bg3); border: 3px solid var(--line2); display: flex; align-items: center; justify-content: center; font-size: 2.8rem; overflow: hidden; box-shadow: 0 6px 20px rgba(0, 0, 0, .3); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 54px; height: 54px; font-size: 1.6rem; border-width: 2px; }
.speaker .who { font-size: .72rem; text-align: center; color: var(--dim); font-weight: 700; margin-top: 6px; text-transform: uppercase; letter-spacing: .05em; }
.bubble { position: relative; flex: 1; background: #f7f3e6; color: #1e2a22; border-radius: 22px 22px 22px 6px; padding: 16px 18px; box-shadow: var(--shadow); }
.bubble::before { content: ''; position: absolute; left: -10px; bottom: 10px; border: 10px solid transparent; border-right-color: #f7f3e6; border-left: 0; }
.bubble h2 { color: #1e2a22; margin-bottom: 6px; font-size: 1.3rem; }
.bubble p { margin: 0; color: #3a4a3f; }
@media (max-width: 520px) {
  .speaker { flex-direction: column; align-items: flex-start; gap: 10px; }
  .bubble { border-radius: 6px 22px 22px 22px; width: 100%; }
  .bubble::before { left: 22px; top: -10px; bottom: auto; border: 10px solid transparent; border-bottom-color: #f7f3e6; border-top: 0; }
  .avatar { width: 74px; height: 74px; font-size: 2.2rem; }
}
.wiz-nav { position: sticky; bottom: 0; display: flex; gap: 10px; justify-content: space-between; padding: 14px 0 max(14px, env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 70%, transparent); margin-top: 18px; }
.wiz-nav .btn { flex: 1; max-width: 220px; }
.daypick { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.tog { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 16px; border: 2px solid var(--line2); background: var(--bg2); cursor: pointer; user-select: none; transition: border-color .15s, background .15s; text-align: left; }
.tog .t1 { font-weight: 800; font-family: var(--head); font-size: 1.05rem; }
.tog .t2 { font-size: .82rem; color: var(--dim); }
.tog::after { content: ''; position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line2); }
.tog.on { border-color: var(--leaf); background: rgba(123, 216, 143, .08); }
.tog.on::after { background: var(--leaf); border-color: var(--leaf); box-shadow: inset 0 0 0 4px var(--bg2); }
.mealday { margin-bottom: 14px; }
.mealday .lbl { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; font-weight: 800; font-family: var(--head); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 10px 14px; border-radius: 30px; border: 2px solid var(--line2); background: var(--bg2); cursor: pointer; font-weight: 700; font-size: .92rem; color: var(--dim); min-height: 44px; }
.chip.on { border-color: var(--leaf); color: var(--text); background: rgba(123, 216, 143, .1); }
.chip.on::before { content: '\2713  '; color: var(--leaf); }
.guest-row { display: flex; gap: 8px; margin-bottom: 8px; }
.guest-row .input { flex: 1; }
.hint { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: rgba(94, 200, 242, .08); border: 1px solid rgba(94, 200, 242, .25); color: var(--text); font-size: .92rem; }
.hint.lamp { background: rgba(246, 196, 83, .08); border-color: rgba(246, 196, 83, .3); }
.sumlist { display: grid; gap: 10px; }
.sumitem { padding: 12px 14px; background: var(--bg2); border-radius: 14px; border: 1px solid var(--line); }

/* ---------- Modal / Toast ---------- */
.modal-bg { position: fixed; inset: 0; z-index: 100; background: rgba(5, 10, 7, .7); backdrop-filter: blur(3px); display: flex; align-items: flex-end; justify-content: center; padding: 0; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; background: var(--bg2); border: 1px solid var(--line2); border-radius: 22px 22px 0 0; padding: 20px 18px max(20px, env(safe-area-inset-bottom)); box-shadow: var(--shadow); animation: up .2s ease; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
@media (min-width: 640px) { .modal-bg { align-items: center; padding: 20px; } .modal { border-radius: 22px; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-head h2 { margin: 0; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.toast-root { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; width: calc(100% - 32px); max-width: 420px; }
.toast { padding: 12px 16px; border-radius: 14px; background: var(--bg3); border: 1px solid var(--line2); box-shadow: var(--shadow); font-weight: 600; animation: up .2s; }
.toast.err { border-color: rgba(255, 107, 107, .6); color: #ffd0d0; }
.toast.ok { border-color: rgba(123, 216, 143, .6); }

.loader { display: flex; justify-content: center; padding: 60px 0; }
.loader span { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line2); border-top-color: var(--lamp); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.avatar-card { display: flex; gap: 14px; align-items: center; }
.perm-table td:first-child { white-space: normal; min-width: 220px; }
.hide-sm { }
@media (max-width: 640px) {
  .hide-sm { display: none !important; }
  .topnav { display: none; }
  .app { padding-top: 16px; }
  .meal { flex-wrap: wrap; }
  .meal .side { flex-direction: row; width: 100%; justify-content: flex-start; flex-wrap: wrap; padding-left: 54px; }
}
