:root {
  --bg: #f6f5f2;
  --card: #ffffff;
  --text: #1d1c1a;
  --muted: #6d6a64;
  --line: #e4e1da;
  --accent: #c2410c;
  --accent-ink: #ffffff;
  --accent-soft: #fdeee6;
  --ok: #15803d;
  --ok-soft: #e8f5ec;
  --warn: #a16207;
  --warn-soft: #fbf3dc;
  --err: #b91c1c;
  --err-soft: #fbe9e9;
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151412;
    --card: #1f1d1b;
    --text: #efece6;
    --muted: #a19c93;
    --line: #34312d;
    --accent: #f08a4b;
    --accent-ink: #1b0e05;
    --accent-soft: #3a2418;
    --ok: #4ade80;
    --ok-soft: #173222;
    --warn: #facc15;
    --warn-soft: #33290d;
    --err: #f87171;
    --err-soft: #3a1717;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: 0 0 .25rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 1rem 0 .5rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 16px; }
.narrow { max-width: 640px; }

/* Navigation */
.top {
  background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.top .wrap { display: flex; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.brand { font-weight: 700; text-decoration: none; color: var(--text); white-space: nowrap; }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  text-decoration: none; color: var(--muted); padding: 6px 10px; border-radius: 8px; white-space: nowrap; font-size: .95rem;
}
.nav a.on, .nav a:hover { background: var(--accent-soft); color: var(--accent); }
.logout button { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; font-size: .9rem; }

/* Karten & Raster */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.grid { display: grid; gap: 16px; }
@media (min-width: 760px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: repeat(3, 1fr); } }
.stat { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; }
.head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }

/* Buttons */
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  min-height: 44px;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--err); }
.btn.small { padding: 6px 10px; min-height: 34px; font-size: .875rem; }
.btn.big { width: 100%; padding: 16px; font-size: 1.05rem; }
.btn:disabled { opacity: .5; cursor: default; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }

/* Formulare */
label { display: block; font-weight: 600; font-size: .9rem; margin: 12px 0 4px; }
label .muted { font-weight: 400; }
input, textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text); font: inherit; min-height: 44px;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.row { display: grid; gap: 12px; }
@media (min-width: 600px) { .row.two { grid-template-columns: 1fr 1fr; } .row.three { grid-template-columns: 2fr 1fr 1fr; } }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.check input { width: auto; min-height: 0; }
.hp { position: absolute; left: -9999px; }

/* Listen & Tabellen */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); align-items: center; }
.list li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list a.rowlink { color: inherit; text-decoration: none; display: block; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
td.num, th.num { text-align: right; white-space: nowrap; }
.scroll { overflow-x: auto; }
.hidden-row { opacity: .45; text-decoration: line-through; }

/* Badges */
.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--line); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err { background: var(--err-soft); color: var(--err); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }

.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; background: var(--ok-soft); color: var(--ok); font-weight: 500; }
.flash.err { background: var(--err-soft); color: var(--err); }
.note { padding: 12px 16px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); margin-bottom: 16px; }

.monthnav { display: flex; align-items: center; gap: 8px; }
.monthnav a { text-decoration: none; font-size: 1.2rem; padding: 4px 10px; border-radius: 8px; }
.monthnav a:hover { background: var(--accent-soft); }

/* Öffentliche Buchungsseite */
.hero { padding: 32px 0 8px; }
.types { display: grid; gap: 10px; }
@media (min-width: 600px) { .types { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }
.type { border: 2px solid var(--line); border-radius: var(--radius); padding: 14px; cursor: pointer; background: var(--card); text-align: left; font: inherit; color: inherit; }
.type.on { border-color: var(--accent); background: var(--accent-soft); }
.type b { display: block; }
.days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.day {
  flex: 0 0 auto; min-width: 66px; border: 2px solid var(--line); border-radius: 12px; padding: 8px 6px;
  text-align: center; cursor: pointer; background: var(--card); font: inherit; color: inherit; scroll-snap-align: start;
}
.day small { display: block; color: var(--muted); font-size: .75rem; }
.day b { font-size: 1.2rem; display: block; }
.day.on { border-color: var(--accent); background: var(--accent-soft); }
.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-top: 12px; }
.time { border: 1px solid var(--line); border-radius: 10px; padding: 10px 0; text-align: center; cursor: pointer; background: var(--card); font: inherit; color: inherit; font-weight: 600; }
.time.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.step { display: none; }
.step.show { display: block; }
.summary { padding: 12px 16px; border-radius: 10px; background: var(--accent-soft); margin-bottom: 8px; font-weight: 600; }

.upload {
  display: block; border: 2px dashed var(--line); border-radius: var(--radius); padding: 28px 16px; text-align: center; cursor: pointer;
  background: var(--card);
}
.upload input { display: none; }
.upload b { display: block; font-size: 1.1rem; }
.thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); display: flex; align-items: center; justify-content: center; font-size: .7rem; color: var(--muted); }
details summary { cursor: pointer; color: var(--muted); }

/* Handy: Navigation in eigene, wischbare Zeile */
@media (max-width: 759px) {
  .top .wrap { flex-wrap: wrap; row-gap: 6px; }
  .brand { flex: 1; }
  .nav { order: 3; flex-basis: 100%; margin: 0 -16px; padding: 0 12px; }
}

.foot { text-align: center; color: var(--muted); font-size: .875rem; padding-top: 0; padding-bottom: 32px; }
.foot a { color: var(--muted); }
.legal p { white-space: normal; }

/* Leistungszeilen (Songs-Seite, Rechnungsentwurf) */
.line-row { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); align-items: center; }
.line-row:first-of-type { border-top: 0; }
.line-row input { min-height: 38px; padding: 6px 10px; }
@media (min-width: 600px) { .line-row { grid-template-columns: minmax(180px, 2fr) 3fr; gap: 12px; } }

.proposals { display: grid; gap: 10px; margin-top: 12px; }
.btn.proposal { justify-content: flex-start; text-align: left; }

.kind-select { width: auto; min-height: 34px; padding: 4px 8px; font-size: .875rem; }

/* Listeneintrag mit mehreren Knöpfen: Knöpfe unter den Text */
.list li.stack { flex-wrap: wrap; }
.list li.stack > .rowlink { flex-basis: 100%; }
.list li.stack > .actions { width: 100%; justify-content: flex-end; }

/* Kalender */
:root { --c-session: #c2410c; --c-anfrage: #a16207; --c-vorschlag: #7c3aed; --c-google: #2563eb; --c-belegt: #8a857c; }
@media (prefers-color-scheme: dark) { :root { --c-session: #f08a4b; --c-anfrage: #facc15; --c-vorschlag: #a78bfa; --c-google: #60a5fa; --c-belegt: #a19c93; } }
.cal-week { display: grid; gap: 10px; }
@media (min-width: 900px) { .cal-week { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; } }
.cal-day { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 90px; }
@media (min-width: 900px) { .cal-day { min-height: 320px; } }
.cal-day.weekend { background: color-mix(in srgb, var(--card) 85%, var(--bg)); }
.cal-day.today { border-color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
.cal-dayhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: .95rem; }
.cal-item { display: block; border-left: 3px solid var(--c, var(--line)); background: color-mix(in srgb, var(--c) 9%, transparent);
  border-radius: 6px; padding: 5px 8px; margin-bottom: 6px; text-decoration: none; color: var(--text); font-size: .85rem; line-height: 1.3; }
a.cal-item:hover { background: color-mix(in srgb, var(--c) 18%, transparent); }
.cal-time { display: block; font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-title { display: block; font-weight: 600; overflow-wrap: anywhere; }
.cal-sub { display: block; font-size: .75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-session { --c: var(--c-session); } .cal-anfrage { --c: var(--c-anfrage); } .cal-vorschlag { --c: var(--c-vorschlag); }
.cal-google { --c: var(--c-google); } .cal-belegt { --c: var(--c-belegt); }
.cal-anfrage, .cal-vorschlag { border-left-style: dashed; }
.cal-empty { color: var(--muted); font-size: .8rem; margin: 0; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 12px; color: var(--muted); }
.cal-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); margin-right: 5px; vertical-align: -1px; }
.cal-agenda-day { padding: 8px 0; border-top: 1px solid var(--line); }
.cal-agenda-day:first-child { border-top: 0; padding-top: 0; }
.cal-agenda-date { font-weight: 700; font-size: .85rem; margin-bottom: 6px; }
.cal-agenda-date.today { color: var(--accent); }

/* Umschalter Woche/Monat */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.seg a, .seg span { padding: 6px 12px; font-size: .875rem; font-weight: 600; text-decoration: none; color: var(--muted); }
.seg .on { background: var(--accent-soft); color: var(--accent); }

/* Monatsansicht */
.cal-month { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.cal-mhead, .cal-mrow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-mhead div { padding: 6px 8px; font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); }
.cal-mrow + .cal-mrow .cal-mday { border-top: 1px solid var(--line); }
.cal-mday { display: flex; flex-direction: column; gap: 3px; min-height: 108px; padding: 6px; border-left: 1px solid var(--line);
  color: var(--text); text-decoration: none; min-width: 0; }
.cal-mday:first-child { border-left: 0; }
.cal-mday:hover { background: var(--accent-soft); }
.cal-mday.weekend { background: color-mix(in srgb, var(--card) 85%, var(--bg)); }
.cal-mday.other { color: var(--muted); background: var(--bg); }
.cal-mday.other .cal-mitem { opacity: .55; }
.cal-mnum { font-size: .85rem; font-weight: 700; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.cal-mday.today .cal-mnum { background: var(--accent); color: var(--accent-ink); }
.cal-mlist { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-mitem { display: block; font-size: .72rem; line-height: 1.35; padding: 1px 5px; border-radius: 4px; border-left: 2px solid var(--c);
  background: color-mix(in srgb, var(--c) 10%, transparent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-mitem b { font-weight: 600; font-variant-numeric: tabular-nums; }
.cal-more { font-size: .7rem; color: var(--muted); padding-left: 5px; }
.cal-dots { display: none; gap: 3px; flex-wrap: wrap; }
.cal-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); display: block; }
@media (max-width: 699px) {
  .cal-mday { min-height: 58px; padding: 4px 2px; align-items: center; }
  .cal-mlist { display: none; }
  .cal-dots { display: flex; justify-content: center; }
  .cal-mhead div { padding: 6px 2px; text-align: center; font-size: .7rem; }
  .cal-mnum { font-size: .8rem; }
}
.cal-extern { --c: var(--c-belegt); }
:root { --c-produktion: #0f766e; }
@media (prefers-color-scheme: dark) { :root { --c-produktion: #2dd4bf; } }
.cal-produktion { --c: var(--c-produktion); }
.prodfields { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--c-produktion) 8%, transparent); }
.prodfields .check { margin: 0 0 6px; }
.prodhours { display: flex; align-items: center; gap: 8px; padding-left: 26px; }
.prodhours input { width: 5em; min-height: 36px; padding: 4px 8px; }
.dot-inline { display: inline-block; width: 9px; height: 9px; border-radius: 3px; background: var(--c); margin-right: 7px; }
:root { --c-deadline: #be123c; }
@media (prefers-color-scheme: dark) { :root { --c-deadline: #fb7185; } }
.cal-deadline { --c: var(--c-deadline); }
.badge.deadline { background: color-mix(in srgb, var(--c-deadline) 14%, transparent); color: var(--c-deadline); }
