/* Vereinskalender – Farben angelehnt an den bisherigen Terminplaner */
:root {
  --bg: #e4f0fa;
  --card: #ffffff;
  --ink: #1f2d3a;
  --muted: #5d6e7e;
  --line: #d3e0eb;
  --head: #465a6a;
  --brand: #2f6aa8;
  --brand-ink: #ffffff;
  /* Statusfarben wie im alten Terminplaner: Füllung (--x-fill), heller Hintergrund (--x-bg), Schrift (--x) */
  --yes: #4a7a14;
  --yes-fill: #aad064;
  --yes-bg: #eef6df;
  --maybe: #7d6200;
  --maybe-fill: #f9d239;
  --maybe-bg: #fef6d2;
  --no: #b0520c;
  --no-fill: #e47018;
  --no-bg: #fce6d6;
  --none: #6b7883;
  --none-fill: #c0c0c0;
  --none-bg: #eef1f3;
  --pending: #8a6d00;
  --pending-bg: #fff5cc;
  --danger: #b3261e;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(31, 45, 58, .06), 0 2px 8px rgba(31, 45, 58, .06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--brand); }
code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .95em; background: var(--none-bg); padding: 1px 5px; border-radius: 4px; }
h1, h2 { line-height: 1.25; margin: 0 0 .6rem; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.1rem; }
.muted { color: var(--muted); font-weight: normal; }
.small { font-size: .875rem; }
.center { text-align: center; }

/* ---------- Kopf ---------- */
.site-head {
  background: var(--head);
  color: #fff;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .5rem 1.5rem;
  padding: .7rem max(16px, calc((100% - 1100px) / 2));
}
.brand-link { color: #fff; text-decoration: none; display: flex; flex-direction: column; line-height: 1.15; }
.brand .club { font-size: .8rem; opacity: .8; letter-spacing: .03em; }
.brand .app { font-size: 1.35rem; font-weight: 600; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; }
.nav a, .nav .linkish {
  color: #fff; text-decoration: none; padding: .35rem .65rem; border-radius: 6px; font-size: .95rem;
}
.nav a:hover, .nav .linkish:hover { background: rgba(255, 255, 255, .12); }
.nav a.on { background: rgba(255, 255, 255, .2); }
.banner { background: #fff; border-bottom: 1px solid var(--line); }
.banner img { display: block; width: 100%; max-width: 831px; height: auto; margin: 0 auto; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 1rem 16px 2rem; }
.site-foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 0 16px 2rem; }
.site-foot p { margin: 0 0 .3rem; }
.site-foot .copyright { font-size: .75rem; opacity: .8; }
.site-foot .copyright a { color: inherit; }

/* ---------- Bausteine ---------- */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.1rem 1.2rem; margin-bottom: 1rem;
}
.card.narrow { max-width: 480px; margin-left: auto; margin-right: auto; }
.flash { padding: .6rem .8rem; border-radius: 8px; margin: 0 0 1rem; }
.flash.ok { background: var(--yes-bg); color: var(--yes); }
.flash.error { background: #fde4e2; color: var(--danger); }
.flash.warn { background: var(--pending-bg); color: var(--pending); }
.inline { display: inline; margin: 0; }

.btn {
  display: inline-block; border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: .5rem .9rem; border-radius: 8px; font: inherit; cursor: pointer; text-decoration: none; line-height: 1.3;
}
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }
.btn.small { padding: .3rem .6rem; font-size: .85rem; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); cursor: pointer; text-decoration: underline; }
.nav .linkish { text-decoration: none; }

.form { display: grid; gap: .8rem; }
.form label { display: grid; gap: .25rem; font-weight: 600; font-size: .95rem; }
.form label.check { display: block; font-weight: normal; }
input[type=text], input[type=search], input[type=password], input[type=email], input[type=date], input[type=time], input:not([type]), select, textarea {
  width: 100%; font: inherit; padding: .55rem .65rem; border: 1px solid #b9cbd9; border-radius: 8px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus, .btn:focus-visible, .opt:focus-visible {
  outline: 3px solid rgba(47, 106, 168, .3); outline-offset: 1px; border-color: var(--brand);
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: .3rem 1rem; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .85rem; white-space: nowrap; }
.badge.yes { background: var(--yes-bg); color: var(--yes); font-weight: 600; }
.badge.maybe { background: var(--maybe-bg); color: var(--maybe); font-weight: 600; }
.badge.no { background: var(--no-bg); color: var(--no); font-weight: 600; }
.badge.none { background: var(--none-bg); color: var(--none); }
.badge.pending { background: var(--pending-bg); color: var(--pending); }
.badge.public { background: #e1ebf7; color: var(--brand); font-size: .75rem; font-weight: 600; }
.badge.tag { font-size: .75rem; }
.embed-code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .8rem; white-space: pre; overflow-x: auto; }
.badge.admin { background: #e1ebf7; color: var(--brand); font-size: .75rem; }
.chip { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .85rem; font-weight: 600; }
.chip.yes { background: var(--yes-bg); color: var(--yes); }
.chip.maybe { background: var(--maybe-bg); color: var(--maybe); }
.chip.no { background: var(--no-bg); color: var(--no); }
.chip.none { background: var(--none-bg); color: var(--none); }
.chips { display: flex; gap: .35rem; flex-wrap: wrap; }

/* ---------- Terminübersicht ---------- */
.layout { display: grid; grid-template-columns: 300px 1fr; gap: 1rem; align-items: start; }
.event-list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: .6rem; position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; }
.list-title { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: .3rem .4rem .5rem; }
.event-item {
  display: grid; grid-template-columns: 52px 1fr auto; gap: .6rem; align-items: center;
  padding: .55rem .5rem; border-radius: 8px; text-decoration: none; color: var(--ink);
}
.event-item:hover { background: var(--none-bg); }
.event-item.past { opacity: .6; }
.event-item.past.on { opacity: 1; }
.event-item .meta .over { font-weight: 600; }
.event-item.on { background: #dbe8f5; box-shadow: inset 3px 0 0 var(--brand); }
.event-item .date { display: flex; flex-direction: column; align-items: center; background: var(--head); color: #fff; border-radius: 6px; padding: .2rem 0; line-height: 1.15; }
.event-item .wd { font-size: .7rem; text-transform: uppercase; opacity: .85; }
.event-item .d { font-weight: 700; font-size: .95rem; }
.event-item .info { display: flex; flex-direction: column; min-width: 0; }
.event-item .ttl { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-item .meta { font-size: .8rem; color: var(--muted); }
.event-item .meta .yes { color: var(--yes); font-weight: 600; }
.mine { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.mine-yes { background: var(--yes-fill); color: var(--ink); }
.mine-maybe { background: var(--maybe-fill); color: var(--ink); }
.mine-no { background: var(--no-fill); color: var(--ink); }
.mine-none { background: var(--none-bg); color: var(--none); border: 1px dashed var(--none-fill); }

.event-head .when { margin: 0 0 .2rem; color: var(--brand); font-weight: 600; }
.event-head h1 { margin-bottom: .3rem; }
.event-head .desc { margin: .4rem 0 0; white-space: normal; }

.my-answer { border-left: 5px solid var(--none-fill); }
.my-answer.s-yes { border-left-color: var(--yes-fill); }
.my-answer.s-maybe { border-left-color: var(--maybe-fill); }
.my-answer.s-no { border-left-color: var(--no-fill); }
.my-top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.save-state { font-size: .85rem; color: var(--muted); min-height: 1.2em; }
.save-state.ok { color: var(--yes); }
.save-state.err { color: var(--danger); font-weight: 600; }
.choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin: .4rem 0 .9rem; }
.opt {
  font: inherit; font-weight: 600; font-size: 1.05rem; padding: .8rem .5rem; border-radius: 10px; cursor: pointer;
  border: 2px solid var(--line); background: #fff; color: var(--ink); transition: background .12s, border-color .12s;
}
.opt.yes:hover { border-color: var(--yes-fill); }
.opt.maybe:hover { border-color: var(--maybe-fill); }
.opt.no:hover { border-color: var(--no-fill); }
.opt.on { color: var(--ink); }
.opt.yes.on { background: var(--yes-fill); border-color: var(--yes); }
.opt.maybe.on { background: var(--maybe-fill); border-color: var(--maybe); }
.opt.no.on { background: var(--no-fill); border-color: var(--no); }
.comment { display: grid; gap: .3rem; font-weight: 600; font-size: .95rem; margin-bottom: .5rem; }

.table-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; margin-bottom: .5rem; }
.table-head h2 { margin: 0; }
.table-scroll { overflow-x: auto; }
table.people { width: 100%; border-collapse: collapse; }
.people th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: .4rem .5rem; border-bottom: 2px solid var(--line); }
.people td { padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
/* Statusfarbe der Zeile wie früher, als Streifen links */
.people tr.s-yes td:first-child { box-shadow: inset 4px 0 0 var(--yes-fill); }
.people tr.s-maybe td:first-child { box-shadow: inset 4px 0 0 var(--maybe-fill); }
.people tr.s-no td:first-child { box-shadow: inset 4px 0 0 var(--no-fill); }
.people tr.s-none td:first-child { box-shadow: inset 4px 0 0 var(--none-fill); }
.people tr.me td { background: #f1f7fd; }
.people tr.me .name { font-weight: 700; }
.people .you { color: var(--muted); font-weight: normal; font-size: .85rem; }
.people td.st { width: 1%; white-space: nowrap; }
.people td.cm { color: var(--muted); }
.people select, .people td.cm input { padding: .3rem .4rem; font-size: .9rem; }
/* Admin-Auswahl in der Statusfarbe einfärben */
.people select.st-sel { font-weight: 600; color: var(--ink); }
.people select.st-sel.yes { background-color: var(--yes-fill); border-color: var(--yes); }
.people select.st-sel.maybe { background-color: var(--maybe-fill); border-color: var(--maybe); }
.people select.st-sel.no { background-color: var(--no-fill); border-color: var(--no); }
.people select.st-sel.none { background-color: var(--none-bg); border-color: var(--none-fill); color: var(--none); font-weight: normal; }
.people select.st-sel option { background: #fff; color: var(--ink); font-weight: normal; }
/* Status ohne Auswahlliste genauso kräftig wie die Admin-Auswahl */
.people td.st .badge { padding: .2rem .65rem; border: 1px solid transparent; color: var(--ink); }
.people td.st .badge.yes { background: var(--yes-fill); border-color: var(--yes); }
.people td.st .badge.maybe { background: var(--maybe-fill); border-color: var(--maybe); }
.people td.st .badge.no { background: var(--no-fill); border-color: var(--no); }
.people td.st .badge.none { background: var(--none-bg); border-color: var(--none-fill); color: var(--none); }
.people td.st select { width: auto; }
.people tr.inactive td { opacity: .55; }

/* ---------- Admin ---------- */
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.admin-list { list-style: none; margin: 0; padding: 0; }
.admin-list li { display: flex; justify-content: space-between; gap: .8rem; padding: .7rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.row-actions { display: flex; gap: .35rem; align-items: flex-start; flex-wrap: wrap; }
.row-actions form { margin: 0; }
.past summary { cursor: pointer; margin-top: 1rem; color: var(--muted); }
.creds { border: 2px solid var(--pending); }
.creds-table code { font-size: 1.05rem; }

/* ---------- Arbeitsstunden ---------- */
.wh { display: inline-block; padding: .15rem .6rem; border-radius: 999px; border: 1px solid; font-weight: 600; white-space: nowrap; color: var(--ink); }
.wh.open { background: var(--maybe-bg); border-color: var(--maybe-fill); }
.wh.done { background: var(--yes-bg); border-color: var(--yes-fill); }
.wh.big { font-size: 1.4rem; padding: .3rem 1rem; }
.wh-head { margin-bottom: 1rem; }
.wh-head .wh-bar { margin-top: .6rem; }
.wh-head p { margin: .4rem 0 0; }
.wh-bar { display: block; height: 10px; border-radius: 999px; background: var(--none-bg); overflow: hidden; max-width: 420px; }
.wh-bar > span { display: block; height: 100%; border-radius: 999px; }
.wh-bar.open > span { background: var(--maybe-fill); }
.wh-bar.done > span { background: var(--yes-fill); }
.wh-years { display: flex; gap: .4rem; margin-bottom: 1rem; }
.wh-pick { border: 1px solid var(--line); border-radius: 8px; padding: .5rem .7rem .3rem; margin: 0; min-width: 0; }
.wh-pick legend { font-weight: 600; font-size: .95rem; padding: 0 .3rem; }
.wh-pick .wh-filter { margin: .2rem 0 .4rem; }
.wh-pick-list { max-height: 260px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .1rem .8rem; }
.wh-pick-list label { padding: .25rem 0; font-weight: normal; }
.wh-pick-list label[hidden] { display: none; }
.wh-pick .wh-count { margin: .3rem 0 0; min-height: 1.2em; }
.wh-table { margin-top: .6rem; }
.wh-table td.name a { color: var(--ink); text-decoration: none; }
.wh-table td.name a:hover { text-decoration: underline; }

/* ---------- Handy ---------- */
@media (max-width: 820px) {
  .layout, .admin-grid { grid-template-columns: 1fr; }
  .event-list { position: static; max-height: none; display: flex; gap: .4rem; overflow-x: auto; padding: .5rem; }
  .list-title, .event-list > p { display: none; }
  .event-item { grid-template-columns: 44px auto auto; min-width: 210px; max-width: 260px; flex: 0 0 auto; border: 1px solid var(--line); }
  .people thead { display: none; }
  .people tr { display: grid; grid-template-columns: 1fr auto; border-bottom: 1px solid var(--line); padding: .35rem 0; }
  .people td { border: 0; padding: .15rem .4rem .15rem .8rem; }
  .people tr[class*="s-"] td:first-child { box-shadow: none; }
  .people tr.s-yes { box-shadow: inset 4px 0 0 var(--yes-fill); }
  .people tr.s-maybe { box-shadow: inset 4px 0 0 var(--maybe-fill); }
  .people tr.s-no { box-shadow: inset 4px 0 0 var(--no-fill); }
  .people tr.s-none { box-shadow: inset 4px 0 0 var(--none-fill); }
  .people td.cm { grid-column: 1 / -1; font-size: .9rem; }
  .people td.cm:empty { display: none; }
  .people.members tr { grid-template-columns: 1fr; }
  .site-head { padding: .6rem 16px; }
}
@media (max-width: 420px) {
  .row2 { grid-template-columns: 1fr; }
  .opt { font-size: .95rem; padding: .7rem .3rem; }
}

@media print {
  .site-head, .site-foot, .nav, .btn, form, .event-list { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; }
  .admin-grid > :not(.creds) { display: none; }
  .admin-grid > .wh-overview { display: block !important; }
  .wh-years, #details { display: none !important; }
  .wh, .wh-bar > span { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media print {
  body:has(.creds) main > :not(.creds) { display: none !important; }
}
