/* Verwaltung — Ergänzung zum öffentlichen Stylesheet */

/* ---------- Anmeldung ---------- */

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1200px 420px at 50% -180px, rgba(244, 185, 30, 0.22), transparent 70%),
    var(--bg);
}

.login-card {
  width: min(420px, 100%);
  background: var(--paper);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 34px 30px 26px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: linear-gradient(90deg, var(--sun-red), var(--sun-orange) 45%, var(--sun-yellow));
}

.login-card img { width: 128px; height: auto; margin: 6px auto 14px; display: block; }
.login-card h1 { margin: 0 0 6px; font-size: 23px; color: var(--hill-dark); }
.login-hint { margin: 0 0 20px; color: var(--ink-soft); font-size: 14.5px; line-height: 1.45; }

.login-card label {
  display: block;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 14px;
}

.login-card input {
  display: block;
  width: 100%;
  margin-top: 6px;
  font: inherit;
  font-size: 16px;
  padding: 11px 13px;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  background: #fcfdfb;
}

.login-card input:focus {
  outline: none;
  border-color: var(--hill-light);
  box-shadow: 0 0 0 3px rgba(107, 174, 31, 0.16);
}

.btn-block { width: 100%; justify-content: center; padding: 12px; font-size: 15px; }

.login-error {
  background: #fde8e2;
  color: #a82a0c;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  margin: 0 0 16px;
  text-align: left;
}

.login-note { font-size: 12.5px; color: var(--ink-soft); margin: -6px 0 14px; text-align: left; }
.login-back { margin: 18px 0 0; font-size: 13.5px; }
.login-back a { color: var(--hill-dark); }

/* ---------- Kopfbereich ---------- */

/* In der Verwaltung teilt sich die Kopfzeile den Platz mit vielen Schaltflächen */
.admin-body .brand { flex: 0 1 auto; }
.admin-body .brand h1 { font-size: clamp(17px, 1.5vw, 22px); }
.admin-body .brand img { width: 92px; }
.admin-body .controls { gap: 8px; }
.btn-quiet { border-color: transparent; color: var(--ink-soft); }
.btn-quiet:hover { border-color: var(--line); }
.btn-small { padding: 7px 12px; font-size: 13px; }
.btn.is-danger { color: #a82a0c; border-color: #f6c3b4; }
.btn.is-danger:hover { border-color: #f53a19; }

.save-state { color: var(--hill-light); font-weight: 600; }
.save-state.is-busy { color: var(--sun-orange); }

.admin-hint {
  margin: 18px 4px 0;
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.public-hint {
  font-size: 12px;
  font-weight: 700;
  color: #8f5205;
  background: #fdeeda;
  border-radius: 999px;
  padding: 2px 9px;
  margin-left: 4px;
}

.btn#undoBtn:disabled { opacity: 0.42; cursor: default; }
.btn#undoBtn:disabled:hover { border-color: var(--line); box-shadow: none; }

/* Hinweis auf Felder, die im Druck zu klein werden */
.warn-banner {
  margin: 12px 4px 0;
  padding: 10px 14px;
  border-radius: 11px;
  background: #fdf4dc;
  border: 1.5px solid #f3dda0;
  color: #8a6108;
  font-size: 13.5px;
  font-weight: 600;
}

.cell.is-tight { box-shadow: inset 0 0 0 1.5px #f4b91e; }

.cell-warn {
  position: absolute;
  top: 2px;
  left: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--sun-yellow);
  color: #5c4106;
  font-size: 11px;
  font-weight: 800;
  line-height: 15px;
  text-align: center;
  cursor: help;
}

/* Termin in weitere Monate übernehmen */
.dup-preview {
  margin: 0 0 12px;
  font-size: 15.5px;
  font-weight: 650;
  color: var(--hill-dark);
}

.dup-months {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
  margin-bottom: 18px;
}

.dup-month {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  font-size: 14px;
  cursor: pointer;
  background: #fcfdfb;
}

.dup-month:hover { border-color: var(--hill-light); }
.dup-month input { accent-color: var(--hill-dark); }
.dup-month.is-set { color: var(--ink-soft); background: #f1f4ee; cursor: default; }

/* ---------- Redigierbares Raster ---------- */

.grid.is-editable .cell {
  position: relative;
  min-height: 104px;
  padding-bottom: 20px;
  justify-content: flex-start;
  gap: 5px;
}

.grid.is-editable .card {
  position: relative;
  cursor: text;
  padding-right: 52px;   /* Platz für «i», ⧉ und × */
  transition: box-shadow 0.12s, transform 0.12s;
}

/* Zusatzinfo: das Zeichen bleibt sichtbar, wenn eine hinterlegt ist */
.card-note {
  position: absolute;
  top: 3px;
  right: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--area-ink);
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.12s;
}

.card-note .note-icon { width: 13px; height: 13px; display: block; }

.card:hover .card-note { opacity: 0.5; }
.card-note:hover { opacity: 0.8; }

.card-note.is-set,
.card:hover .card-note.is-set,
.card-note.is-set:hover {
  opacity: 1;
  color: var(--area-base);
}

.card-copy {
  position: absolute;
  top: 2px;
  right: 19px;
  width: 16px;
  height: 16px;
  line-height: 1;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--area-ink);
  opacity: 0;
  cursor: pointer;
  font-size: 12px;
  transition: opacity 0.12s, background 0.12s;
}

.card:hover .card-copy { opacity: 0.55; }
.card-copy:hover { opacity: 1; background: rgba(255, 255, 255, 0.75); }

.grid.is-editable .card:hover {
  box-shadow: 0 2px 10px rgba(31, 42, 27, 0.16);
}

.grid.is-editable .card.is-dragging { opacity: 0.4; }

.card-remove {
  position: absolute;
  top: 2px;
  right: 3px;
  width: 16px;
  height: 16px;
  line-height: 1;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--area-ink);
  opacity: 0;
  cursor: pointer;
  font-size: 15px;
  transition: opacity 0.12s, background 0.12s;
}

.card:hover .card-remove { opacity: 0.55; }
.card-remove:hover { opacity: 1; background: rgba(255, 255, 255, 0.75); }

.card-input {
  width: 100%;
  font: inherit;
  font-size: 12.5px;
  line-height: 1.25;
  color: var(--area-ink);
  background: rgba(255, 255, 255, 0.9);
  border: 0;
  border-radius: 3px;
  padding: 2px 3px;
  resize: vertical;
}

.card-input:focus { outline: 2px solid var(--area-base); outline-offset: 1px; }

/* Eingabefeld der Zusatzinfo im Fenster */
.note-input {
  width: 100%;
  font: inherit;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  resize: vertical;
}

.note-input:focus { outline: 2px solid var(--hill-light); outline-offset: 1px; }

.modal-actions { display: flex; gap: 10px; margin-top: 14px; }

.cell-add {
  position: absolute;
  left: 50%;
  bottom: 3px;
  transform: translateX(-50%);
  width: 22px;
  height: 18px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--area-base);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s, background 0.12s;
}

.cell:hover .cell-add { opacity: 0.75; }
.cell-add:hover { opacity: 1; background: var(--area-tint); }

.cell.is-drop {
  background: var(--area-tint) !important;
  box-shadow: inset 0 0 0 2px var(--area-base);
}

/* Zeigt beim Ziehen, zwischen welche Termine die Karte rutscht */
.drop-line {
  height: 3px;
  margin: -1px 0;
  border-radius: 2px;
  background: var(--area-base);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6);
  pointer-events: none;
}

/* ---------- Modale Fenster ---------- */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(31, 42, 27, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 18px;
  overflow-y: auto;
  z-index: 40;
}

.modal[hidden] { display: none; }

.modal-card {
  width: min(720px, 100%);
  background: var(--paper);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(31, 42, 27, 0.3);
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(100deg, var(--hill-dark), var(--hill-light));
  color: #fff;
}

.modal-head h2 { margin: 0; font-size: 18px; }

.modal-close {
  border: 0;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover { background: rgba(255, 255, 255, 0.32); }
.modal-body { padding: 20px; }
.modal-hint { margin: 0 0 16px; color: var(--ink-soft); font-size: 14px; }

/* ---------- Bereiche ---------- */

.area-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }

.area-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 11px;
  background: var(--area-tint);
  border: 1.5px solid var(--area-line);
}

.area-preview { display: flex; color: var(--area-base); }
.area-preview .icon { width: 24px; height: 24px; }

.area-name-input {
  flex: 1 1 160px;
  min-width: 110px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 650;
  color: var(--area-ink);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px 9px;
}

.area-name-input:focus { outline: none; border-color: var(--area-base); background: #fff; }

.area-select {
  font: inherit;
  font-size: 13px;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid var(--area-line);
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
}

.row-btn {
  width: 28px;
  height: 28px;
  flex: none;
  border: 1px solid var(--area-line);
  background: rgba(255, 255, 255, 0.75);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  color: var(--area-ink);
}

.row-btn:hover { background: #fff; }
.row-btn.is-danger { color: #a82a0c; }

/* ---------- Schuljahre ---------- */

.year-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }

.year-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  background: #fcfdfb;
}

.year-row.is-active { border-color: var(--hill-light); background: #f2f8ea; }
.year-row strong { font-size: 15px; }
.year-count { color: var(--ink-soft); font-size: 13px; flex: 1; }

.year-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--hill-dark);
  background: #e2f0d0;
  padding: 4px 10px;
  border-radius: 999px;
}

/* ---------- Formulare ---------- */

.form-block {
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px 18px;
  margin: 0 0 18px;
}

.form-block legend { font-size: 13px; font-weight: 700; color: var(--hill-dark); padding: 0 6px; }

.form-block label {
  display: block;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink-soft);
  margin-bottom: 12px;
}

.form-block label.check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
}

.form-block input[type="text"],
.form-block input[type="password"] {
  display: block;
  width: 100%;
  margin-top: 5px;
  font: inherit;
  font-size: 15px;
  padding: 9px 11px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fcfdfb;
}

.form-block input[type="checkbox"] { margin-top: 3px; }

.form-block input:focus {
  outline: none;
  border-color: var(--hill-light);
  box-shadow: 0 0 0 3px rgba(107, 174, 31, 0.16);
}

.form-msg { margin: 10px 0 0; font-size: 13.5px; }
.form-msg.is-ok { color: var(--hill-dark); }
.form-msg.is-error { color: #a82a0c; }

/* ---------- Meldung ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: var(--hill-dark);
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  box-shadow: 0 8px 26px rgba(31, 42, 27, 0.28);
  z-index: 60;
}

.toast.is-error { background: #a82a0c; }
.toast[hidden] { display: none; }

@media (max-width: 900px) {
  .admin-body .desktop-view,
  .admin-body #sheets { display: block; }
  .area-row { flex-wrap: wrap; }
  .area-name-input { flex: 1 1 100%; }
}
