/* Helferplaner – Stylesheet (keine externen Schriften/CDNs, DSGVO-freundlich) */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --ink: #1d2533;
  --ink-2: #4a5568;
  --muted: #718096;
  --line: #dfe4ec;
  --line-2: #eef1f5;
  --accent: #2458d6;
  --accent-ink: #ffffff;
  --accent-soft: #e8efff;
  --nav: #16203a;
  --ok: #1f8a4c;
  --ok-soft: #e1f5e8;
  --warn: #b7791f;
  --warn-soft: #fff3d6;
  --bad: #c53030;
  --bad-soft: #fde6e6;
  --over: #5a67d8;
  --over-soft: #e6e9ff;
  --na: #f1f3f6;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  font-size: 15px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 .25rem; line-height: 1.25; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
code { background: var(--line-2); padding: .1em .35em; border-radius: 4px; font-size: .9em; word-break: break-all; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.warn-text { color: var(--warn); font-weight: 600; }
.ok-text { color: var(--ok); font-weight: 600; }
.req { color: var(--bad); }
.mt { margin-top: 1rem; }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
.topbar {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: var(--nav); color: #fff; padding: .5rem 1.25rem; position: sticky; top: 0; z-index: 50;
}
.topbar a { color: #c9d3ea; }
.topbar a:hover, .topbar a.active { color: #fff; text-decoration: none; }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: #fff !important; }
.brand-mark {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px;
  background: var(--accent); color: #fff; font-weight: 800;
}
.event-switch select { background: #25304f; color: #fff; border: 1px solid #3a4770; border-radius: 6px; padding: .3rem .5rem; max-width: 240px; }
.mainnav { display: flex; gap: .15rem; flex-wrap: wrap; }
.mainnav a, .topbar-right a { padding: .4rem .6rem; border-radius: 6px; font-size: .92rem; }
.mainnav a.active { background: rgba(255, 255, 255, .12); }
.mainnav { align-items: center; }
.nav-group { position: relative; }
.nav-group-btn {
  font: inherit; font-size: .92rem; color: #c9d3ea; background: transparent; border: 0; cursor: pointer;
  padding: .4rem .6rem; border-radius: 6px;
}
.nav-group-btn:hover, .nav-group.active > .nav-group-btn { color: #fff; }
.nav-group.active > .nav-group-btn { background: rgba(255, 255, 255, .12); }
.caret { font-size: .7rem; opacity: .8; }
.nav-sub {
  display: none; position: absolute; top: 100%; left: 0; z-index: 60; min-width: 200px; padding: .35rem;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px rgba(16, 24, 40, .18);
}
.nav-group:hover .nav-sub, .nav-group:focus-within .nav-sub, .nav-group.open .nav-sub { display: block; }
.nav-sub a { display: block; color: var(--ink) !important; padding: .45rem .7rem; border-radius: 6px; }
.nav-sub a:hover { background: var(--line-2); text-decoration: none; }
.nav-sub a.active { background: var(--accent-soft); color: var(--accent) !important; font-weight: 600; }
.subnav { display: flex; gap: .25rem; margin: -.5rem 0 1.25rem; border-bottom: 1px solid var(--line); overflow-x: auto; }
.subnav a { padding: .55rem .9rem; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-weight: 500; }
.subnav a:hover { color: var(--ink); text-decoration: none; }
.subnav a.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; gap: .1rem; }
.container { max-width: 1180px; margin: 0 auto; padding: 1.5rem 1.25rem 5rem; }
.container.wide { max-width: none; }
.container.narrow { max-width: 760px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head p { margin: 0; max-width: 70ch; }
.head-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.back { font-size: .9rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1rem; align-items: end; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 1rem; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.25rem; align-items: start; }
.mail-grid { grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); }
.center-row { text-align: center; margin: 1rem 0; }
.spacer { flex: 1; }

/* ---------- Karten ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1.25rem; }
.card-h { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.card-h h2 { margin: 0; }
.card-active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.card.sticky { position: sticky; top: 70px; }
.danger-zone { border-color: #f3c7c7; }
.empty-state { text-align: center; padding: 3rem 1rem; }
.linkbox { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.25rem; }
.tiles .card { margin: 0; display: flex; flex-direction: column; }
.tiles .card form, .tiles .card > .btn { margin-top: auto; }
.tiles form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.tiles form .choice { width: 100%; }
details summary { cursor: pointer; color: var(--accent); font-size: .92rem; }

/* ---------- Statistik ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; box-shadow: var(--shadow); border-top: 4px solid var(--accent); }
.stat-v { font-size: 2rem; font-weight: 750; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-l { color: var(--muted); font-size: .9rem; }
.stat-warn { border-top-color: var(--warn); }
.stat-bad { border-top-color: var(--bad); }
.stat-good { border-top-color: var(--ok); }
.bar { position: relative; height: 22px; background: var(--line-2); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); transition: width .3s; }
.bar-fill.good { background: #48bb78; }
.bar-fill.mid { background: #ecc94b; }
.bar-fill.low { background: #f56565; }
.bar span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 600; }
.mini-stat { margin-bottom: .75rem; }
.chips-row { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .3rem; }
.pill { background: var(--line-2); border-radius: 999px; padding: .15rem .6rem; font-size: .85rem; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: .4rem 0; border-bottom: 1px solid var(--line-2); }
.list li:last-child { border-bottom: 0; }
.steps li { margin-bottom: .4rem; }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: .5rem .6rem; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: middle; }
.tbl th { font-size: .82rem; color: var(--ink-2); font-weight: 600; background: #fafbfc; border-bottom-color: var(--line); }
.tbl th.num, .tbl td.num { text-align: right; }
.tbl tbody tr:hover td { background: #fafcff; }
.tbl-edit td { padding: .3rem .35rem; }
.tbl-edit input { padding: .35rem .45rem; }
.heat td.num { font-weight: 600; }
.actions { display: flex; gap: .2rem; justify-content: flex-end; }
.legend { margin: .75rem 0 0; display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }

/* Status-Farben (Belegung) */
.st-empty { background: var(--bad-soft) !important; }
.st-part { background: var(--warn-soft) !important; }
.st-full { background: var(--ok-soft) !important; }
.st-over { background: var(--over-soft) !important; }
.st-none { background: var(--na) !important; color: var(--muted); }

/* ---------- Formulare ---------- */
.field { margin-bottom: 1rem; min-width: 0; }
.field > label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; font: inherit; color: inherit; background: #fff;
  border: 1px solid #cbd3df; border-radius: 7px; padding: .5rem .65rem;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
textarea { resize: vertical; }
input.strong { font-weight: 600; }
.w-sm { max-width: 110px; }
.w-md { max-width: 240px; }
.num-in { width: 64px !important; text-align: right; }
.help { font-size: .82rem; color: var(--muted); margin-top: .3rem; }
.field-error { color: var(--bad); font-size: .85rem; margin-top: .3rem; font-weight: 600; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--bad); }
.has-error .card-choice { border-color: var(--bad); }
.choices { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; }
.choices-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.choice { display: inline-flex; align-items: flex-start; gap: .45rem; cursor: pointer; font-weight: 400; margin: .2rem 0; }
.choice input { margin-top: .25rem; flex: none; }
label.choice { font-size: .95rem; }
.card-choice { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem; min-width: 190px; background: #fff; }
.card-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1rem 0; margin: 0 0 1rem; }
legend { font-size: .85rem; color: var(--muted); padding: 0 .4rem; }
.form-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: .5rem; }
.inline-actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.inline-actions select { width: auto; max-width: 240px; padding: .3rem .5rem; }
.savebar {
  position: sticky; bottom: 0; z-index: 20; display: flex; justify-content: flex-end; align-items: center; gap: 1rem;
  background: rgba(255, 255, 255, .95); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .75rem 1rem; box-shadow: 0 -4px 12px rgba(16, 24, 40, .06); margin-top: 1rem;
}
.filterbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; padding: .75rem 1rem; }
.filterbar input[type=search] { flex: 1 1 220px; width: auto; }
.filterbar select { width: auto; }
.checklist { list-style: none; padding: 0; }
.checklist .ok { color: var(--ok); }
.checklist .bad { color: var(--bad); font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; white-space: nowrap;
  padding: .5rem .9rem; border-radius: 7px; border: 1px solid #c4cedd; background: #fff; color: var(--ink);
}
.btn:hover { background: #f5f7fb; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { background: #1c47b3; }
.btn-danger { background: #fff; color: var(--bad); border-color: #f0b4b4; }
.btn-danger:hover { background: var(--bad-soft); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--accent); }
.btn-sm { padding: .3rem .6rem; font-size: .85rem; }
.btn-lg { padding: .75rem 1.4rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; flex: none;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; font-size: .9rem;
}
.icon-btn:hover { background: var(--line-2); }
.icon-btn.danger:hover { background: var(--bad-soft); color: var(--bad); border-color: #f0b4b4; }

/* ---------- Badges & Meldungen ---------- */
.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: .12rem .5rem; border-radius: 999px; vertical-align: middle; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-muted { background: var(--line-2); color: var(--ink-2); }
.flash { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid; }
.flash-success { background: var(--ok-soft); border-color: #a8dcb9; color: #17663a; }
.flash-error { background: var(--bad-soft); border-color: #f2b8b8; color: #9b2c2c; }
.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 200;
  background: var(--nav); color: #fff; padding: .6rem 1.1rem; border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); font-weight: 600;
}
.toast.ok { background: var(--ok); }
.day-dot {
  display: inline-grid; place-items: center; min-width: 26px; height: 20px; padding: 0 3px; border-radius: 5px;
  font-size: .72rem; font-weight: 700; margin-right: 2px; border: 1px solid transparent;
}
.day-dot.as { background: var(--ok); color: #fff; }
.day-dot.av { background: #fff; color: var(--ok); border-color: #8fd3a8; }
.day-dot.na { background: var(--line-2); color: #a0aec0; text-decoration: line-through; }

/* ---------- Stellenplan ---------- */
.bereich-card { padding-top: 1rem; }
.bereich-head { display: grid; grid-template-columns: 2fr 1.3fr 1.5fr .8fr auto auto; gap: .75rem; align-items: end; margin-bottom: .5rem; }
.bereich-head .field { margin-bottom: 0; }
.bereich-head .choice { margin-bottom: .5rem; }
.bereich-head .actions { margin-bottom: .3rem; }
.posten-tbl { margin-bottom: .6rem; }
.posten-tbl th.day-col { width: 70px; }
.all-in { background: #fafbfc !important; }

/* ---------- Zusatzfelder ---------- */
.feld-row { border: 1px solid var(--line); border-radius: 8px; padding: .75rem .9rem .1rem; margin-bottom: .75rem; background: #fcfdfe; }
.feld-main { display: grid; grid-template-columns: 2fr 1.2fr auto auto; gap: .75rem; align-items: end; }
.feld-main .choice, .feld-main .actions { margin-bottom: 1.2rem; }
.feld-extra { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .75rem; }
.field-hint { background: var(--accent-soft); border-radius: 8px; padding: .75rem 1rem; }

/* ---------- Einteilungsmatrix ---------- */
.mx { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 1rem; height: calc(100vh - 110px); min-height: 520px; }
.mx-side { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.mx-side-head { padding: .75rem; border-bottom: 1px solid var(--line); display: grid; gap: .4rem; }
.mx-helfer { overflow-y: auto; flex: 1; padding: .5rem; }
.mx-legend { padding: .5rem .75rem; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; color: var(--muted); }
.hcard {
  border: 1px solid var(--line); border-radius: 8px; padding: .45rem .6rem; margin-bottom: .4rem; background: #fff;
  cursor: grab; user-select: none; transition: box-shadow .15s, border-color .15s;
}
.hcard:hover { border-color: #aebbd2; box-shadow: var(--shadow); }
.hcard.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); background: #f7f9ff; }
.hname { font-weight: 600; font-size: .9rem; }
.hdays { margin: .2rem 0; }
.hwish { font-size: .76rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info-dot { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: .65rem; font-weight: 800; vertical-align: 1px; }
.mx-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.mx-toolbar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-bottom: .6rem; }
.mx-toolbar select { width: auto; max-width: 260px; padding: .35rem .5rem; }
.mx-scroll { flex: 1; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-height: 0; }
.mx-hint { margin: .5rem 0 0; }
.mx-tbl { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .88rem; }
.mx-tbl th, .mx-tbl td { border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: .3rem .4rem; vertical-align: top; }
.mx-tbl thead th { position: sticky; top: 0; z-index: 3; background: #f7f8fb; border-bottom: 1px solid var(--line); text-align: center; font-weight: 700; }
.mx-daysub { font-weight: 400; font-size: .75rem; color: var(--muted); }
.mx-pcol { position: sticky; left: 0; z-index: 2; background: #fff; text-align: left !important; min-width: 210px; max-width: 290px; font-weight: 500; }
.mx-tbl thead .mx-pcol { z-index: 4; background: #f7f8fb; }
.mx-pcol .ub { display: block; font-size: .72rem; color: var(--muted); font-weight: 400; }
.mx-day { min-width: 170px; }
.mx-brow th, .mx-brow td { background: #eef2f8; font-weight: 700; border-top: 2px solid var(--line); }
.mx-brow .mx-pcol { background: #eef2f8; }
.mx-bstat { text-align: center; font-size: .8rem; }
.mx-cell { min-height: 38px; transition: box-shadow .1s; }
.chip {
  display: inline-flex; align-items: center; gap: .15rem; background: #fff; border: 1px solid #c9d3e3; border-radius: 6px;
  padding: .1rem .15rem .1rem .45rem; margin: 0 .2rem .2rem 0; font-size: .82rem; cursor: grab; max-width: 100%;
}
.chip.hl { background: var(--accent); color: #fff; border-color: var(--accent); }
.chip.hl .chip-x { color: #fff; }
.chip-warn { border-color: var(--bad); box-shadow: inset 3px 0 0 var(--bad); }
.chip-dup { border-color: var(--warn); box-shadow: inset 3px 0 0 var(--warn); }
.chip-x { border: 0; background: transparent; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 .25rem; color: var(--muted); border-radius: 4px; }
.chip-x:hover { background: var(--bad-soft); color: var(--bad); }
.slot-add {
  display: block; width: 100%; border: 1px dashed transparent; background: transparent; color: var(--muted);
  border-radius: 6px; font: inherit; font-size: .78rem; padding: .1rem .3rem; cursor: pointer; text-align: left;
}
.slot-add.open { color: var(--bad); font-weight: 600; }
.mx-cell:hover .slot-add, .slot-add:focus { border-color: #b8c4d8; background: rgba(255, 255, 255, .7); }
.st-none .slot-add { opacity: 0; }
.st-none:hover .slot-add { opacity: 1; }
/* Auswahlmodus */
.mx-cell.sel-ok { box-shadow: inset 0 0 0 2px #48bb78; }
.mx-cell.sel-wish { box-shadow: inset 0 0 0 3px var(--ok); }
.mx-cell.sel-wish .slot-add, .mx-cell.sel-ok .slot-add { border-color: var(--ok); color: var(--ok); font-weight: 700; }
.mx-cell.sel-no { opacity: .55; }
.select-banner {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: var(--accent-soft); border: 1px solid #b9cbf5; color: #1d3f96; border-radius: 8px; padding: .5rem .8rem; margin-bottom: .6rem; font-size: .88rem;
}
.select-banner { display: block; }
.sb-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.sb-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.sb-list { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .3rem; }
.sb-list li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; background: #fff; border: 1px solid #c9d6f3; border-radius: 7px; padding: .25rem .35rem .25rem .6rem; }
.sb-list li.cur { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.sb-go { font: inherit; text-align: left; background: none; border: 0; cursor: pointer; color: var(--ink); padding: .2rem 0; flex: 1 1 260px; }
.sb-go:hover { color: var(--accent); }
.sb-btns { display: flex; gap: .3rem; }
.mx-cell.sugg { box-shadow: inset 0 0 0 3px #f6ad55; }
.mx-cell.sugg-cur { box-shadow: inset 0 0 0 4px var(--accent); background: var(--accent-soft) !important; opacity: 1 !important; }
.mx-cell.flash { animation: cellflash 1.4s ease-out 2; }
@keyframes cellflash {
  0% { box-shadow: inset 0 0 0 4px var(--accent), 0 0 0 0 rgba(36, 88, 214, .6); }
  60% { box-shadow: inset 0 0 0 4px var(--accent), 0 0 0 12px rgba(36, 88, 214, 0); }
  100% { box-shadow: inset 0 0 0 4px var(--accent), 0 0 0 0 rgba(36, 88, 214, 0); }
}
.col-picker { list-style: none; margin: 0; padding: .3rem; border: 1px solid var(--line); border-radius: 8px; max-height: 340px; overflow-y: auto; }
.col-picker li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .1rem .3rem; border-radius: 6px; }
.col-picker li:hover { background: var(--line-2); }
.col-picker li:has(input:checked) { background: var(--accent-soft); }
.col-move { display: flex; gap: .2rem; }
.col-move .icon-btn { width: 24px; height: 24px; }
.section-title { margin: 1.5rem 0 .75rem; }
.lg { display: inline-block; padding: 0 .4rem; border-radius: 4px; margin-left: .3rem; background: #fff; }
.lg.sel-wish { box-shadow: inset 0 0 0 2px var(--ok); }
.lg.sel-ok { box-shadow: inset 0 0 0 1px #48bb78; }
/* Drag & Drop */
.dragging .mx-cell.dz-no { opacity: .45; }
.dragging .mx-cell.dz-ok { box-shadow: inset 0 0 0 2px #9ae6b4; }
.dragging .mx-cell.dz-wish { box-shadow: inset 0 0 0 3px var(--ok); }
.dragging .mx-cell.dz-busy { box-shadow: inset 0 0 0 2px #f6ad55; }
.mx-cell.over { box-shadow: inset 0 0 0 3px var(--accent) !important; background: var(--accent-soft) !important; opacity: 1 !important; }

/* ---------- Picker ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 100; display: grid; place-items: center; padding: 1rem; }
.modal { background: #fff; border-radius: 12px; width: min(560px, 100%); max-height: 85vh; display: flex; flex-direction: column; padding: 1rem 1.25rem; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); gap: .5rem; }
.modal-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.modal-h h3 { margin: 0; }
.pk-list { overflow-y: auto; margin: 0 -.25rem; padding: 0 .25rem; }
.pk-group { margin-bottom: .75rem; }
.pk-gt { font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: .4rem 0 .3rem; }
.pk-passt .pk-gt { color: var(--ok); }
.pk-nicht .pk-item, .pk-belegt .pk-item { opacity: .7; }
.pk-item {
  display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; font: inherit; cursor: pointer;
  border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: .4rem .65rem; margin-bottom: .3rem;
}
.pk-item:hover { border-color: var(--accent); background: var(--accent-soft); opacity: 1; }
.pk-name { font-weight: 600; }
.pk-info { font-size: .78rem; color: var(--muted); }

/* ---------- Sammelmail ---------- */
.placeholders { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.placeholders .small { width: 100%; }
.ph-btn { font: inherit; font-size: .78rem; font-family: ui-monospace, Consolas, monospace; border: 1px solid #c9d6f3; background: var(--accent-soft); color: #1d3f96; border-radius: 5px; padding: .15rem .45rem; cursor: pointer; }
.ph-btn:hover { background: #d7e3ff; }
.empf-box { background: #fafbfc; border: 1px solid var(--line-2); border-radius: 8px; padding: .6rem .8rem; }
.empf-list { max-height: 180px; overflow-y: auto; font-size: .85rem; margin-top: .4rem; }
.auswahl-box { margin-bottom: .75rem; }
.auswahl-list { max-height: 240px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: .4rem .6rem; margin-top: .4rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.mail-preview { border: 1px solid var(--line); border-radius: 8px; background: #fcfcfd; margin-bottom: .75rem; max-height: 55vh; overflow-y: auto; }
.mp-head { padding: .6rem .8rem; border-bottom: 1px solid var(--line); font-size: .88rem; }
.mp-body { margin: 0; padding: .8rem; white-space: pre-wrap; word-wrap: break-word; font-family: inherit; font-size: .9rem; }
.mail-preview > p { padding: .8rem; margin: 0; }
#m-progress { margin-top: .75rem; }

/* ---------- Helfer bearbeiten ---------- */
.einsatz-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.einsatz-list li { display: flex; justify-content: space-between; gap: .5rem; padding: .55rem 0; border-bottom: 1px solid var(--line-2); font-size: .9rem; }

/* ---------- Login / öffentlich ---------- */
.layout-bare .container, .layout-public .container { padding-top: 3rem; }
.login-box { max-width: 380px; margin: 4rem auto; }
.login-brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.2rem; margin-bottom: 1.25rem; }
.layout-public { background: linear-gradient(180deg, #e9effc 0, var(--bg) 320px); }
.public-head h1 { font-size: 1.9rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 700; color: var(--accent); margin: 0 0 .3rem; }
.public-form h2 { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line-2); }
.public-form h2:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.area-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .2rem 1rem; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Druck ---------- */
.layout-print { background: #fff; }
.print-bar { display: flex; gap: .5rem; padding: .75rem 1.25rem; border-bottom: 1px solid var(--line); background: #fafbfc; position: sticky; top: 0; }
.print-page { max-width: 1000px; margin: 0 auto; padding: 1.5rem; }
.print-meta { font-size: .8rem; color: var(--muted); margin-bottom: .25rem; }
.print-block { break-inside: avoid; margin-bottom: 1.25rem; }
.print-block h2 { font-size: 1.05rem; margin: 1rem 0 .4rem; }
.ptbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.ptbl th, .ptbl td { border: 1px solid #bbb; padding: .3rem .45rem; text-align: left; vertical-align: top; }
.ptbl th { background: #eee; }
.ptbl tr.gap td { background: #fff3f3; }
.ptbl td.na { background: #f3f3f3; }
.ptbl td.box { height: 1.8rem; }
.ptbl hr { border: 0; border-top: 1px dotted #bbb; margin: .25rem 0; }
.gap-txt { color: #c53030; }
.page { margin-bottom: 2rem; }
.plan .lead { font-size: 1.05rem; color: var(--ink-2); }
.plan-item { display: grid; grid-template-columns: 120px 1fr; gap: 1rem; border: 1px solid #ccc; border-radius: 8px; padding: .8rem 1rem; margin-bottom: .6rem; break-inside: avoid; }
.plan-day { border-right: 1px solid #ddd; }
.plan-ort { font-weight: 700; font-size: 1.05rem; margin-bottom: .2rem; }
.plan-foot { margin-top: 1.25rem; color: var(--ink-2); }
@media print {
  .no-print { display: none !important; }
  .print-page { padding: 0; max-width: none; }
  .page { break-after: page; margin: 0; }
  .page:last-child { break-after: auto; }
  body { font-size: 12px; }
  @page { margin: 12mm; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .bereich-head { grid-template-columns: 1fr 1fr; }
  .grid-main, .mail-grid { grid-template-columns: minmax(0, 1fr); }
  .card.sticky { position: static; }
}
@media (max-width: 800px) {
  .topbar { padding: .5rem .75rem; gap: .5rem; }
  .mainnav { width: 100%; flex-wrap: wrap; }
  .nav-sub { position: fixed; top: auto; left: 1rem; right: 1rem; }
  .topbar-right { margin-left: 0; }
  .container { padding: 1rem 1rem 5rem; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-3, .grid-4, .feld-main, .feld-extra { grid-template-columns: minmax(0, 1fr); }
  .mx { grid-template-columns: minmax(0, 1fr); height: auto; }
  .mx-side { max-height: 300px; }
  .mx-scroll { max-height: 75vh; }
  .mx-pcol { min-width: 140px; }
  .mx-day { min-width: 140px; }
  .public-head h1 { font-size: 1.5rem; }
  .card-choice { min-width: 0; width: 100%; }
}
