*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #1a1a1a;
  background: #f5f5f5;
}

.test-kopf {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.75rem 1rem;
  text-align: left;
  background: #fff;
  border-bottom: 1px solid #ddd;
}

.test-logo {
  display: block;
  flex: 0 0 auto;
  width: 100px;
  height: auto;
}

.test-kopf__text {
  flex: 1 1 auto;
  min-width: 0;
}

.test-kopf__titel {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.test-kopf__linie {
  margin: 0.5rem 0;
  border: none;
  border-top: 1px solid #ccc;
}

.test-kopf__hinweis {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.4;
}

.test-inhalt {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1rem;
}

.test-block {
  margin-bottom: 1rem;
  padding: 1rem;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.test-block__titel {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.test-block__text {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: #444;
}

.test-feld {
  display: block;
}

.test-feld__label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.test-feld__input {
  display: block;
  width: 100%;
  max-width: 16rem;
  padding: 0.5rem 0.65rem;
  font: inherit;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  background: #fff;
}

.test-feld__input--breit {
  max-width: none;
}

.test-feld__hinweis {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: #555;
}

.test-frage {
  margin-bottom: 1rem;
}

.test-frage:last-child {
  margin-bottom: 0;
}

.test-check a {
  color: #1a4a8a;
}

.test-senden {
  margin-top: 0.25rem;
}

.test-senden__btn {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.85rem 1rem;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  background: #1a4a8a;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  box-sizing: border-box;
}

.test-senden__btn:hover {
  background: #153d72;
}

.test-senden__fehler {
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #b00020;
}

.test-zeiten {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(4.75rem, 1fr));
  gap: 0.45rem;
}

.test-zeit {
  display: block;
  cursor: pointer;
}

.test-zeit__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.test-zeit__text {
  display: block;
  padding: 0.45rem 0.35rem;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1a4a8a;
  background: #e8f1fa;
  border: 1px solid #9fc0de;
  border-radius: 4px;
}

.test-zeit__input:checked + .test-zeit__text {
  color: #fff;
  background: #1a4a8a;
  border-color: #1a4a8a;
}

.test-zeit__input:focus-visible + .test-zeit__text {
  outline: 2px solid #1a4a8a;
  outline-offset: 2px;
}

.test-checkliste {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.test-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.95rem;
  line-height: 1.35;
  cursor: pointer;
}

.test-check input {
  margin-top: 0.2rem;
  flex: 0 0 auto;
}

.edit-title {
  margin: 0;
  padding: 1rem;
  font-size: 1.25rem;
  font-weight: 600;
  background: #fff;
  border-bottom: 1px solid #ddd;
}

.edit-top-nav {
  padding: 0.75rem 1rem;
  background: #fff;
  border-bottom: 1px solid #ddd;
}

.edit-top-nav__btn {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.75rem 1rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: #1a4a8a;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  box-sizing: border-box;
}

.edit-top-nav__btn:hover {
  background: #153d72;
}

.edit-top-nav__btn:active {
  background: #0f3059;
}

.auswertung-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: #fff;
  border-bottom: 1px solid #ddd;
}

.auswertung-nav .week-nav__btn {
  width: auto;
  justify-self: start;
}

.auswertung-nav .week-nav__btn:last-of-type {
  justify-self: end;
}

.auswertung-nav__monat {
  margin: 0;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  white-space: nowrap;
}

.auswertung-wrap .auswertung-table {
  min-width: 0;
  table-layout: fixed;
}

.auswertung-table thead th {
  text-align: left;
}

.auswertung-table .auswertung-col-name,
.auswertung-table .auswertung-col-2,
.auswertung-table .auswertung-col-3 {
  text-align: left;
}

.auswertung-col-name {
  width: 35%;
  font-weight: 600;
  padding: 0.65rem 0.75rem;
}

.auswertung-col-2,
.auswertung-col-3 {
  width: 32.5%;
  padding: 0.65rem 0.75rem;
}

.auswertung-row--alt td {
  background: #ececec;
}

@media (max-width: 40rem) {
  .auswertung-nav {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "monat monat"
      "zurueck vor";
  }

  .auswertung-nav__monat {
    grid-area: monat;
  }

  .auswertung-nav #btn-monat-zurueck {
    grid-area: zurueck;
    justify-self: start;
  }

  .auswertung-nav #btn-monat-vor {
    grid-area: vor;
    justify-self: end;
  }

  .auswertung-col-name {
    width: 40%;
  }
}

.edit-page .edit-table {
  min-width: 0;
  table-layout: fixed;
}

.edit-page .edit-table th:first-child {
  width: 5rem;
}

.edit-page .edit-table__termin {
  width: 50%;
  vertical-align: top;
  padding: 0.2rem 0.35rem;
}

.edit-page .plan-table__termin-head th {
  padding: 0.35rem 0.35rem 0.15rem;
  font-weight: 600;
  text-align: left;
  vertical-align: bottom;
  background: #fff;
  border-bottom: 1px solid #ccc;
}

.edit-page .edit-table__termin-head {
  width: 50%;
}

.edit-page .ter-slot {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.edit-page .note-field {
  background: #fff;
  resize: vertical;
  overscroll-behavior: contain;
}

.slot-select {
  display: block;
  width: 100%;
  min-height: 1.6rem;
  padding: 0.25rem 0.4rem;
  font: inherit;
  font-size: 0.9rem;
  color: inherit;
  background: #e8f1fa;
  border: 1px solid #ccc;
  border-radius: 3px;
}

.edit-page .ter-slot__name {
  font-weight: 400;
}

.ter-slot__task-input {
  display: block;
  width: 100%;
  min-height: 1.6rem;
  padding: 0.25rem 0.4rem;
  font: inherit;
  font-size: 0.85rem;
  color: inherit;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 3px;
  box-sizing: border-box;
}

.edit-actions {
  padding: 0.75rem 1rem;
  margin: 0;
  background: #fff;
  border-top: 1px solid #ddd;
}

.edit-actions .save-btn {
  display: block;
  width: 100%;
  margin: 0;
  padding: 1rem;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  background: #2e7d32;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  box-sizing: border-box;
}

.edit-actions .save-btn:hover {
  background: #256628;
}

.edit-actions .cancel-btn {
  display: block;
  width: 100%;
  margin: 0.5rem 0 0;
  padding: 1rem;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a1a1a;
  background: #e0e0e0;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  box-sizing: border-box;
}

.edit-actions .cancel-btn:hover {
  background: #d0d0d0;
}

.edit-status {
  margin: 0;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  background: #fff;
}

.protokoll-wrap {
  padding: 1rem;
  background: #fff;
}

.loeschen-wrap {
  padding: 1rem;
  background: #fff;
}

.loeschen-hinweis {
  margin: 0 0 1rem;
  color: #444;
}

.loeschen-leer,
.loeschen-fehler {
  margin: 0;
  padding: 0.75rem 0;
}

.loeschen-fehler {
  color: #b00020;
  font-weight: 600;
}

.loeschen-table-wrap {
  margin-bottom: 1rem;
}

.loeschen-table {
  min-width: 0;
}

.loeschen-col-check {
  width: 2.5rem;
}

.loeschen-col-dateien {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.loeschen-row--alt td,
.loeschen-row--alt th {
  background: #f7f7f7;
}

.loeschen-badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  font-size: 0.85rem;
  background: #e8f1fa;
  border: 1px solid #b6d4ec;
  border-radius: 3px;
}

.loeschen-actions {
  padding-top: 0.5rem;
}

.loeschen-btn {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.75rem 1rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: #b00020;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  box-sizing: border-box;
}

.loeschen-btn:hover:not(:disabled) {
  background: #8f001a;
}

.loeschen-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.loeschen-status {
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
}

.loeschen-status--error {
  color: #b00020;
  font-weight: 600;
}

.protokoll-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #ddd;
}

.protokoll-filter label {
  font-weight: 600;
}

.protokoll-filter__input {
  padding: 0.35rem 0.5rem;
  font: inherit;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.protokoll-leer {
  margin: 0;
  color: #666;
}

.protokoll-liste {
  margin: 0;
  padding-left: 1.5rem;
}

.protokoll-liste li {
  margin: 0.4rem 0;
  line-height: 1.4;
  word-break: break-word;
}

.unsaved-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.45);
}

.unsaved-modal[hidden] {
  display: none;
}

.unsaved-modal__box {
  width: min(28rem, 100%);
  padding: 1.25rem;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.unsaved-modal__box p {
  margin: 0 0 0.75rem;
}

.unsaved-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.unsaved-modal__actions .save-btn,
.unsaved-modal__actions .cancel-btn,
.unsaved-modal__actions .week-nav__btn {
  width: 100%;
}

.week-nav {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.75rem 1rem;
  background: #fff;
  border-bottom: 1px solid #ddd;
}

.week-nav__col--left {
  justify-self: start;
}

.week-nav__col--center {
  justify-self: center;
  text-align: center;
}

.week-nav__col--right {
  justify-self: end;
}

.week-nav__btn {
  padding: 0.5rem 1rem;
  font: inherit;
  font-size: 0.95rem;
  color: #1a1a1a;
  background: #eee;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
}

.week-nav__btn:hover {
  background: #e0e0e0;
}

.week-nav__btn:active {
  background: #d4d4d4;
}

.current-date {
  margin: 0;
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: 1.1rem;
  background: #fff;
  border-bottom: 1px solid #ddd;
}

.plan-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
}

.plan-table {
  width: 100%;
  min-width: 36rem;
  border-collapse: collapse;
  table-layout: fixed;
}

.plan-table th,
.plan-table td {
  padding: 0.65rem 0.5rem;
  border: 1px solid #ddd;
  text-align: center;
  vertical-align: middle;
  word-wrap: break-word;
}

.plan-table thead th {
  font-weight: 600;
  background: #f0f0f0;
}

.plan-table__edit th {
  font-weight: 400;
  padding: 0.4rem 0.35rem;
}

.edit-btn {
  display: block;
  width: calc(100% - 0.7rem);
  margin: 0 auto;
  padding: 0.35rem 0.5rem;
  font: inherit;
  font-size: 0.85rem;
  color: #1a1a1a;
  background: #cfe2f3;
  border: 1px solid #9fc0de;
  border-radius: 4px;
  cursor: pointer;
  box-sizing: border-box;
}

.edit-btn:hover {
  background: #b6d4ec;
}

.plan-table thead th:first-child {
  width: 8rem;
}

.plan-table__dates td {
  font-size: 0.95rem;
  background: #fafafa;
}

.plan-table__notes th {
  text-align: left;
  font-weight: 600;
  background: #fafafa;
}

.plan-table__notes td {
  padding: 0.35rem;
}

.note-field {
  display: block;
  width: 100%;
  min-height: 6rem;
  padding: 0.4rem;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.35;
  color: inherit;
  background: #f7f7f7;
  border: 1px solid #ccc;
  border-radius: 4px;
  resize: none;
}

.note-field:read-only {
  cursor: default;
}

.plan-table__slots th {
  text-align: left;
  font-weight: 600;
  background: #fafafa;
  vertical-align: top;
}

.plan-table__slots td {
  padding: 0.35rem;
  vertical-align: top;
}

.slot-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.slot-label {
  display: block;
  min-height: 1.6rem;
  padding: 0.25rem 0.4rem;
  font-size: 0.9rem;
  line-height: 1.3;
  text-align: left;
  background: #e8f1fa;
  border-radius: 3px;
}

.plan-table__time th {
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
  vertical-align: top;
  background: #fff;
}

.plan-table__time td {
  padding: 0.2rem 0.35rem;
  vertical-align: top;
  background: #fff;
}

.plan-table__time--alt th,
.plan-table__time--alt td {
  background: #ececec;
}

.ter-cell {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ter-cell .ter-slot + .ter-slot {
  padding-top: 0.35rem;
  border-top: 1px dashed #ccc;
}

.ter-slot {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-height: 1.4rem;
  padding: 0.2rem 0.35rem;
  text-align: left;
}

.ter-slot__name,
.ter-slot__task {
  display: block;
  font-size: 0.85rem;
  line-height: 1.25;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
}

.ter-slot__name {
  font-weight: 600;
}

@media (max-width: 40rem) {
  .week-nav {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .week-nav__col--left,
  .week-nav__col--center,
  .week-nav__col--right {
    justify-self: stretch;
  }

  .week-nav__btn {
    width: 100%;
  }

  .plan-table {
    min-width: 28rem;
    font-size: 0.9rem;
  }

  .plan-table thead th:first-child {
    width: 5rem;
  }
}
