/* ---------- Verwaltung ---------- */

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login { width: min(400px, 100%); padding: 36px 30px 26px; text-align: center; }
.login .field { text-align: left; margin-top: 18px; }
.login-doodle { width: 90px; margin: 0 auto 4px; display: block; transform: rotate(-4deg); }
.form-error { color: var(--red); min-height: 1.4em; margin: 2px 0 8px; font-size: 18px; }

.admin-head { display: flex; gap: 12px; align-items: center; padding-bottom: 10px; flex-wrap: wrap; }
.admin-head h1 { font-size: 52px; }

.warn {
  background: var(--red-soft);
  padding: 10px 18px;
  margin-bottom: 10px;
  font-size: 17px;
}

.tabs { display: flex; gap: 6px; padding-top: 6px; padding-bottom: 0; flex-wrap: wrap; position: relative; z-index: 1; }
.tab {
  appearance: none;
  font: inherit;
  font-size: 21px;
  border: 2.5px solid var(--ink);
  border-bottom: none;
  background: var(--paper-2);
  padding: 7px 20px 8px;
  border-radius: 14px 18px 0 0 / 12px 14px 0 0;
  cursor: pointer;
  color: var(--ink-soft);
  margin-bottom: -4px;
  transform: translateY(4px);
  transition: transform .12s, background .12s;
}
.tab:hover { transform: translateY(1px); color: var(--ink); }
.tab.active { background: var(--card); color: var(--ink); transform: translateY(2px); z-index: 2; font-weight: 600; padding-bottom: 12px; }
.tab:nth-child(2) { border-radius: 18px 12px 0 0 / 14px 10px 0 0; }
.tab .count { display: inline-block; min-width: 26px; padding: 0 7px; border-radius: 999px; background: var(--orange); color: #fff; font-size: 15px; margin-left: 4px; }
.tab .count:empty { display: none; }

.panel-wrap { padding-top: 0; }
.panel { padding: 26px 26px 30px; min-height: 360px; }

.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar h2 { margin-right: 10px; }

.stats { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.stat { padding: 10px 18px 8px; background: var(--paper); min-width: 130px; }
.stat b { font-family: var(--hand); font-size: 40px; line-height: 1; display: block; }
.stat span { color: var(--ink-soft); font-size: 16px; }

.day-group { margin-bottom: 22px; }
.day-group h3 { font-size: 30px; margin-bottom: 8px; display: flex; gap: 10px; align-items: baseline; }
.day-group h3 small { font-family: var(--ui); font-size: 16px; color: var(--ink-faint); font-weight: 400; }

.booking {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 4px 18px;
  align-items: start;
  padding: 12px 16px;
  margin-bottom: 10px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: var(--wobble-c);
  box-shadow: 2px 3px 0 rgba(45,42,50,.75);
}
.booking:nth-child(even) { border-radius: var(--wobble-b); }
.booking.past { opacity: .55; box-shadow: none; border-style: dashed; }
.booking.now { background: #fffbe6; border-color: var(--orange); box-shadow: 3px 4px 0 var(--orange); }
.booking .time { font-family: var(--hand); font-size: 30px; font-weight: 700; line-height: 1; }
.booking .time small { display: block; font-family: var(--ui); font-weight: 400; font-size: 15px; color: var(--ink-faint); margin-top: 4px; }
.booking .who a { color: var(--ink); text-decoration: none; border-bottom: 2px solid var(--blue-soft); }
.booking .who a:hover { border-color: var(--orange); }
.booking .who .amp { color: var(--ink-faint); margin: 0 6px; }
.booking .meta { font-size: 16px; color: var(--ink-soft); margin-top: 4px; word-break: break-word; }
.booking .meta .note { display: block; font-style: italic; margin-top: 3px; }
.booking .meta .note::before { content: '„'; }
.booking .meta .note::after { content: '“'; }
.booking .btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.empty { text-align: center; padding: 40px 10px; color: var(--ink-faint); font-family: var(--hand); font-size: 30px; }

/* ---------- Zeitfenster-Raster ---------- */

.range-form { display: flex; gap: 14px 18px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.range-form .field { margin: 0; }
.range-form input[type=date] { width: 180px; }
.range-form input[type=time], .range-form select { width: 120px; }
.range-form input[type=number] { width: 90px; }

.grid-help { color: var(--ink-soft); font-size: 17px; margin: 6px 0 12px; }
.grid-help b { color: var(--ink); }

.grid-scroll { overflow-x: auto; padding: 4px 4px 12px; margin: 0 -4px; }
.slot-grid {
  display: grid;
  gap: 3px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  min-width: max-content;
}
.slot-grid .gh {
  text-align: center;
  font-size: 15px;
  line-height: 1.1;
  padding: 2px 0 6px;
  color: var(--ink-soft);
}
.slot-grid .gh b { display: block; font-family: var(--hand); font-size: 22px; color: var(--ink); }
.slot-grid .gh.weekend b { color: var(--ink-faint); }
.slot-grid .gh.week2 { border-left: 3px dashed var(--paper-3); }
.slot-grid .gt { font-size: 14px; color: var(--ink-faint); text-align: right; padding-right: 6px; line-height: 26px; height: 26px; }
.slot-grid .gt.hour { color: var(--ink-soft); }
/* Eine Zelle je Zeitfenster, darin ein Kästchen je Dozent:in (Farbe über --lc) */
.slot-grid .cell { display: flex; gap: 3px; }
.slot-grid .cell.week2 { margin-left: 6px; }
.slot-grid .cell.past { opacity: .45; }
.slot-grid .c {
  --lc: var(--green);
  width: 58px;
  height: 26px;
  border: 1.5px dashed #d9cfbb;
  border-radius: 6px 8px 6px 9px;
  background: rgba(255,255,255,.6);
  cursor: crosshair;
  transition: background .08s, transform .08s;
  font-size: 12px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 0 3px;
  line-height: 22px;
  text-align: center;
}
.slot-grid.multi .c { width: 34px; padding: 0 1px; font-size: 11px; letter-spacing: -.3px; }
.slot-grid .c:hover { border-color: var(--lc); }
.slot-grid .c.on {
  background: color-mix(in srgb, var(--lc) 20%, white);
  border: 2px solid var(--lc);
  border-radius: 9px 5px 8px 6px;
}
.slot-grid .c.on::before { content: '✓'; color: var(--lc); font-weight: bold; filter: brightness(.85); }
.slot-grid .c.booked {
  background: var(--lc);
  border: 2px solid var(--ink);
  color: #fff;
  font-weight: 700;
  cursor: help;
}
.slot-grid .c.booked::before { content: none; }
.slot-grid .gh.week2 { margin-left: 6px; }

/* Legende/Auswahl der Dozierenden im Raster, Filter bei den Anmeldungen */
.lec-legend, .lec-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.lec-filter { margin: 0 0 0 14px; }
.chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  padding: 3px 13px 2px;
  font: inherit;
  font-size: 17px;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
}
.chip small { color: var(--ink-faint); font-size: 14px; }
.chip.active { background: color-mix(in srgb, var(--lc, var(--yellow)) 22%, white); outline: 3px solid var(--lc, var(--yellow)); outline-offset: 1px; }
.chip .mini-box {
  width: 18px; height: 16px; border: 2px solid var(--lc); border-radius: 5px 4px 5px 3px;
  background: color-mix(in srgb, var(--lc) 20%, white); color: var(--lc);
  font: 700 11px/12px var(--ui); font-style: normal; text-align: center;
}
.lec-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: var(--lc); border: 2px solid var(--ink); flex: none; }
.lec-pill {
  display: inline-block;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: var(--lc);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 0 10px;
  margin-right: 10px;
  vertical-align: 3px;
}
.booking[style*='--lc'] { border-left: 7px solid var(--lc); }

.lec-editor { max-width: 720px; margin-bottom: 26px; }
.lec-editor h3, #tab-settings > h3 { font-family: var(--hand); font-size: 26px; margin: 4px 0 2px; }
.lec-row { display: flex; gap: 10px; align-items: center; margin: 8px 0; }
.lec-row .lec-dot { width: 20px; height: 20px; }
.lec-row input { flex: 1; min-width: 0; }
.lec-row input.lec-mail { flex: 1.4; font-size: 17px; }
.reminder-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; margin-top: 10px; }
.reminder-edit .field { margin-bottom: 10px; }
.reminder-edit input { font-size: 17px; }
.reminder-edit textarea.mail-text { font-size: 16px; line-height: 1.4; min-height: 360px; }
.ph-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 14px; }
.ph-chip { appearance: none; font: 13px/1.2 ui-monospace, Menlo, monospace; padding: 3px 7px; background: var(--blue-soft); border: 1.5px solid var(--ink-faint); border-radius: 8px; cursor: pointer; color: var(--ink); }
.ph-chip:hover { border-color: var(--ink); background: #c4dcff; }
.mail-preview-head .chip.small { font-size: 15px; padding: 1px 10px 0; box-shadow: 1.5px 1.5px 0 var(--ink); }
.mail-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 17px; }
.mail-preview { background: #fff; border: 2px solid var(--ink); border-radius: 10px 8px 11px 9px; padding: 12px 14px; font: 15px/1.45 -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif; color: #222; }
.mail-subject { font-weight: 600; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid #e3e3e3; }
.mail-subject .faint { font-weight: 400; }
.mail-body { white-space: pre-wrap; word-break: break-word; }
.mail-notes { font-size: 14px; margin-top: 6px; }
.mail-notes .mail-warn { color: var(--red); }
.mail-setup { margin-top: 18px; }
.mail-setup summary { cursor: pointer; font-size: 18px; padding: 4px 0; }
.mail-setup[open] summary { margin-bottom: 4px; }
@media (max-width: 900px) { .reminder-edit { grid-template-columns: 1fr; } }
.reminder-box .test-mail { gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.reminder-box .test-mail input { flex: 1; min-width: 220px; font-size: 17px; padding: 5px 10px; }
.reminder-box .test-mail select { width: auto; font-size: 16px; padding: 5px 8px; }

.cal-feeds { max-width: 860px; margin: 0 0 26px; }
.cal-feeds h3 { font-family: var(--hand); font-size: 26px; margin: 4px 0 2px; }
.cal-feeds .warn { margin: 8px 0 12px; }
.cal-row { background: #fff; border: 2px solid var(--ink); border-radius: var(--wobble-c); padding: 10px 14px; margin: 10px 0; }
.cal-name { display: flex; align-items: center; gap: 8px; font-size: 19px; }
.cal-row code { display: block; font-size: 13px; color: var(--ink-soft); word-break: break-all; margin: 6px 0 8px; }
.cal-row .row { flex-wrap: wrap; gap: 8px; }
.cal-help { font-size: 15px; margin-top: 4px; }

.saved { font-size: 17px; color: var(--green); transition: opacity .3s; }
.saved.busy { color: var(--ink-faint); }

/* ---------- Räume ---------- */

.room-item { display: flex; gap: 14px; align-items: center; padding: 12px 16px; background: #fff; border: 2px solid var(--ink); border-radius: var(--wobble-c); margin-bottom: 10px; flex-wrap: wrap; }
.room-item .label { font-family: var(--hand); font-size: 28px; font-weight: 700; }
.room-item code { font-size: 13px; color: var(--ink-soft); word-break: break-all; }

.settings-form { max-width: 720px; }
.infobox { background: var(--blue-soft); padding: 14px 18px; margin-top: 24px; font-size: 17px; }
.infobox code { background: rgba(255,255,255,.7); padding: 0 5px; border-radius: 4px; }
.infobox ul { margin: 6px 0 0; padding-left: 20px; }

@media (max-width: 760px) {
  .booking { grid-template-columns: 74px 1fr; }
  .booking .btns { grid-column: 1 / -1; justify-content: flex-start; }
  .panel { padding: 18px 14px; }
}

#warn { padding-top: 0; padding-bottom: 0; }
#warn:empty { display: none; }

.booking .who .names { font-size: 24px; margin-right: 12px; }

/* Anmeldung verschieben */
.move-dialog h2 { margin-bottom: 4px; }
.move-dialog .lec-legend { margin: 12px 0 4px; }
.move-slots { margin: 12px 0 6px; max-height: 46vh; overflow-y: auto; padding-right: 4px; }
.move-day { display: grid; grid-template-columns: 210px 1fr; gap: 10px; align-items: start; padding: 7px 0; border-bottom: 1.5px dashed var(--paper-3); }
.move-day > b { font-size: 17px; padding-top: 4px; }
.move-times { display: flex; flex-wrap: wrap; gap: 6px; }
.move-slot { appearance: none; font: inherit; font-size: 17px; padding: 3px 12px 2px; background: #fff; border: 2px solid var(--ink); border-radius: 9px 7px 10px 8px; cursor: pointer; box-shadow: 1.5px 1.5px 0 var(--ink); }
.move-slot:hover { background: var(--paper); }
.move-slot.on { background: var(--yellow); }
.move-slot:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.move-slot small { font-size: 12px; color: var(--ink-faint); }
.move-slot.past { border-style: dashed; box-shadow: none; color: var(--ink-soft); background: var(--paper); }
.move-slot.past.on { background: var(--yellow); color: var(--ink); }
.move-day.past > b { color: var(--ink-soft); font-weight: 400; }
.move-past-head { margin: 16px 0 2px; padding-top: 8px; border-top: 2px solid var(--paper-3); font-size: 16px; color: var(--ink-soft); }
.move-past-head b { color: var(--ink); }
.move-confirm { margin-top: 14px; padding: 12px 16px; background: var(--blue-soft); }
.move-confirm .move-what { font-size: 19px; margin-bottom: 6px; }
@media (max-width: 640px) { .move-day { grid-template-columns: 1fr; gap: 4px; } }

