:root {
  --navy: #25331f;
  --navy-soft: #526147;
  --teal: #639a00;
  --teal-dark: #416c00;
  --teal-wash: #f0f7e4;
  --paper: #fff;
  --canvas: #f5f8f0;
  --line: #dce6d3;
  --muted: #687664;
  --shadow: 0 12px 36px rgba(45,69,22,.08);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--navy);
  background: var(--canvas);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.top-stripe { height: 6px; background: linear-gradient(90deg, var(--teal), #b6d684); }
.page { width: min(1010px, calc(100% - 32px)); margin: 0 auto; padding: 35px 0 115px; }
[hidden] { display: none !important; }
.access-screen { min-height: calc(100dvh - 6px); display: flex; align-items: center; justify-content: center; padding: 28px 16px 50px; background: radial-gradient(circle at 50% 0%, #e8f3d8 0, transparent 55%), var(--canvas); }
.access-wrap { width: min(100%, 440px); }
.access-school { text-align: center; margin: 0 0 24px; }
.brand-surface { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; background: #639a00; border-radius: 12px; padding: 7px 11px; }
.brand-logo { display: block; width: 240px; max-width: 100%; height: auto; aspect-ratio: 15 / 4; object-fit: contain; }
.access-school .brand-surface { margin: 0 auto 17px; padding: 10px 15px; border-radius: 16px; }
.access-school .brand-logo { width: 288px; }
.access-school h1 { font-size: 22px; line-height: 1.3; letter-spacing: -.025em; margin: 0 0 5px; }
.access-school p { color: var(--navy-soft); margin: 0; font-size: 13px; }
.access-card { background: white; border-radius: 22px; border: 1px solid #dde9d2; padding: 36px 34px 30px; box-shadow: 0 18px 52px rgba(45,69,22,.11); text-align: center; }
.lock-symbol { width: 66px; height: 66px; background: #edf6de; color: var(--teal-dark); border-radius: 20px; display: grid; place-items: center; margin: 0 auto 19px; }
.lock-symbol svg { width: 31px; height: 31px; }
.access-card h2 { font-size: 25px; line-height: 1.2; letter-spacing: -.035em; margin: 0 0 10px; }
.access-description { font-size: 14px; color: var(--navy-soft); line-height: 1.55; margin: 0 0 27px; }
.access-card label { display: block; font-size: 13px; font-weight: 780; margin-bottom: 9px; text-align: left; }
#accessPin { text-align: center; letter-spacing: .58em; font-size: 26px; font-weight: 800; height: 64px; border-radius: 13px; padding-left: calc(14px + .58em); }
#accessPin[aria-invalid="true"] { border-color: #cb4c4c; box-shadow: 0 0 0 3px rgba(203,76,76,.1); }
.access-error { color: #a52828; font-size: 13px; min-height: 20px; text-align: left; margin: 8px 0 7px; }
.access-submit { width: 100%; height: 52px; border-radius: 12px; background: var(--teal-dark); border: 1px solid var(--teal-dark); color: white; font-weight: 780; font-size: 15px; }
.access-submit:hover { background: #315300; }
.access-footnote { font-size: 12px; line-height: 1.5; color: var(--muted); text-align: center; margin: 22px 0 0; }
.masthead { display: flex; gap: 18px; align-items: flex-start; justify-content: space-between; margin-bottom: 28px; }
.school { display: flex; align-items: center; flex-wrap: wrap; gap: 11px 18px; }
.school-title { margin: 0 0 3px; font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.school-address { margin: 0; font-size: 13px; color: var(--navy-soft); line-height: 1.5; }
.school-tag { border: 1px solid #cde1af; background: var(--teal-wash); color: var(--teal-dark); font-weight: 750; border-radius: 999px; font-size: 12px; white-space: nowrap; padding: 9px 13px; }
.intro { margin-bottom: 22px; }
.eyebrow { text-transform: uppercase; font-size: 12px; font-weight: 800; letter-spacing: .12em; color: var(--teal-dark); margin-bottom: 9px; }
h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.12; letter-spacing: -.04em; margin: 0 0 12px; }
.intro p { margin: 0; color: var(--navy-soft); line-height: 1.55; max-width: 700px; }
.info { display: flex; align-items: flex-start; gap: 12px; border: 1px solid #d3e4bb; background: var(--teal-wash); padding: 15px 17px; border-radius: 14px; margin: 21px 0 26px; }
.info-symbol { display: grid; place-items: center; width: 25px; height: 25px; flex: 0 0 25px; border-radius: 50%; background: #dcebbb; color: var(--teal-dark); font-size: 15px; font-weight: 850; }
.info p { margin: 0; color: #3e6123; font-size: 13px; line-height: 1.5; }
.progress-box { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 15px 17px; margin-bottom: 22px; display: flex; align-items: center; gap: 20px; }
.progress-text { color: var(--navy-soft); font-size: 13px; font-weight: 700; white-space: nowrap; }
.progress-track { flex: 1; min-width: 75px; height: 7px; background: #e6eddc; overflow: hidden; border-radius: 100px; }
.progress-fill { width: 0; height: 100%; border-radius: 100px; background: var(--teal); transition: width .2s ease; }
.section { background: var(--paper); box-shadow: var(--shadow); border: 1px solid #e4eaf0; border-radius: 19px; overflow: hidden; margin-bottom: 22px; }
.section-heading { display: flex; align-items: center; gap: 15px; padding: 24px 27px; border-bottom: 1px solid #e8edf2; }
.section-icon { display: grid; place-items: center; width: 43px; height: 43px; flex: 0 0 43px; background: #edf6df; color: var(--teal-dark); border-radius: 12px; }
.section-icon svg { width: 21px; height: 21px; }
.section-heading h2 { font-size: 20px; margin: 0 0 4px; letter-spacing: -.025em; }
.section-heading p { font-size: 13px; color: var(--muted); margin: 0; }
.section-body { padding: 27px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 22px; }
.field { min-width: 0; }
.full { grid-column: 1 / -1; }
.field label { display: block; font-size: 15px; font-weight: 750; letter-spacing: -.012em; margin-bottom: 9px; }
.required { color: var(--teal-dark); margin-left: 4px; }
.hint { display: block; font-size: 12px; color: var(--muted); margin: 8px 1px 0; line-height: 1.5; }
input, select, textarea { width: 100%; display: block; background: #fcfdfe; border: 1.5px solid #ccd8e1; border-radius: 11px; padding: 13px 14px; color: var(--navy); min-height: 49px; outline: none; transition: background .15s, border-color .15s, box-shadow .15s; }
select { cursor: pointer; }
select:invalid { color: #8595a5; }
select option { color: var(--navy); }
input:focus, select:focus, textarea:focus { background: #fff; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(99,154,0,.14); }
input::placeholder, textarea::placeholder { color: #98a6b5; opacity: 1; }
textarea { min-height: 104px; resize: vertical; line-height: 1.55; }
.date-time { display: grid; grid-template-columns: 1.12fr .88fr auto; align-items: end; gap: 10px; }
.small-label { display: block; font-size: 12px; font-weight: 650; margin: 0 0 8px; color: var(--navy-soft); }
.now-button { min-height: 49px; padding: 9px 13px; border: 1px solid #caddb0; border-radius: 11px; background: #f3fae9; color: var(--teal-dark); font-size: 13px; line-height: 1.3; font-weight: 750; white-space: normal; }
.now-button:hover { background: #e7f2d6; }
.actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; margin: 24px 0 0; }
.actions p { color: var(--muted); font-size: 12px; line-height: 1.5; max-width: 390px; margin: 0; }
.buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.button { border: 1px solid #d1dbe3; min-height: 48px; padding: 0 19px; border-radius: 11px; font-weight: 780; font-size: 14px; display: inline-flex; align-items: center; gap: 9px; justify-content: center; }
.button svg { width: 17px; height: 17px; }
.button.secondary { background: white; color: var(--navy-soft); }
.button.secondary:hover { background: #f9fbfc; }
.button.save { background: #eef7e1; border-color: #c5dcaa; color: var(--teal-dark); }
.button.save:hover { background: #e1f0cc; }
.button.primary { background: var(--teal-dark); border-color: var(--teal-dark); color: white; }
.button.primary:hover { background: #315300; }
.save-feedback { margin: 11px 0 0; font-size: 12px; color: var(--teal-dark); }
.screen-footer { border-top: 1px solid #e0e8ed; padding-top: 16px; margin-top: 35px; font-size: 12px; color: var(--muted); }
.print-sheet { display: none; }
@media (max-width: 900px) {
  .date-time { grid-template-columns: 1.12fr .88fr; }
  .now-button { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .page { width: min(100% - 24px, 1010px); padding-top: 22px; }
  .masthead { flex-direction: column; gap: 13px; margin-bottom: 26px; }
  .school-tag { align-self: flex-start; }
  .school-title { font-size: 16px; }
  .section-heading { padding: 21px 18px; }
  .section-body { padding: 21px 18px; display: block; }
  .field + .field { margin-top: 24px; }
  .date-time { grid-template-columns: 1fr 1fr; }
  .now-button { grid-column: 1 / -1; }
  .actions { align-items: stretch; }
  .actions p { max-width: none; }
  .buttons { width: 100%; }
  .buttons .button { flex: 1; }
}
@media (max-width: 400px) {
  .date-time { grid-template-columns: 1fr; }
  .buttons { flex-direction: column; }
  .access-card { padding: 29px 23px 25px; }
}

/* ===== Ergänzungen Server-Version ===== */
.access-card input[type=password] { text-align: center; font-size: 20px; font-weight: 700; height: 58px; border-radius: 13px; letter-spacing: .2em; }
.access-card input[aria-invalid="true"] { border-color: #cb4c4c; box-shadow: 0 0 0 3px rgba(203,76,76,.1); }
.topbar-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.link-button { background: none; border: 1px solid #d1dbe3; color: var(--navy-soft); border-radius: 999px; padding: 8px 14px; font-size: 12px; font-weight: 750; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.link-button:hover { background: white; }
.inline-form { display: inline; margin: 0; }
.field-error { color: #a52828; font-size: 12px; margin: 7px 1px 0; display: block; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: #cb4c4c; }
.alert { border-radius: 14px; padding: 15px 17px; margin: 0 0 22px; font-size: 14px; line-height: 1.5; }
.alert-error { background: #fdf0f0; border: 1px solid #f1c9c9; color: #8a2121; }
.alert-warn { background: #fff7e6; border: 1px solid #f3dca6; color: #7a5300; }
.alert-ok { background: var(--teal-wash); border: 1px solid #cde1af; color: #3e6123; }
.success-card { background: white; border-radius: 22px; border: 1px solid #dde9d2; padding: 40px 34px; box-shadow: var(--shadow); text-align: center; max-width: 560px; margin: 30px auto; }
.success-card .lock-symbol { background: var(--teal-wash); }
.success-card h1 { font-size: 28px; }
.success-card p { color: var(--navy-soft); line-height: 1.55; }
.ref { display: inline-block; font-size: 24px; font-weight: 800; letter-spacing: .04em; background: var(--teal-wash); color: var(--teal-dark); border: 1px solid #cde1af; border-radius: 12px; padding: 10px 18px; margin: 10px 0 18px; }
.success-card .buttons { justify-content: center; margin-top: 20px; }
a.button { text-decoration: none; }

/* Admin */
.admin .page { width: min(1240px, calc(100% - 32px)); }
.tabs { display: flex; gap: 6px; margin: 0 0 22px; flex-wrap: wrap; }
.tabs a { text-decoration: none; color: var(--navy-soft); font-weight: 750; font-size: 14px; padding: 9px 15px; border-radius: 10px; border: 1px solid transparent; }
.tabs a.active { background: white; border-color: var(--line); color: var(--teal-dark); box-shadow: var(--shadow); }
.card { background: var(--paper); box-shadow: var(--shadow); border: 1px solid #e4eaf0; border-radius: 19px; padding: 22px 24px; margin-bottom: 22px; }
.card h2 { font-size: 18px; margin: 0 0 14px; letter-spacing: -.02em; }
.filter-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto; gap: 12px; align-items: end; }
.filter-grid label { display: block; font-size: 12px; font-weight: 750; color: var(--navy-soft); margin-bottom: 6px; }
.filter-grid .button { min-height: 49px; }
.result-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.result-bar .count { color: var(--navy-soft); font-size: 14px; font-weight: 700; }
.table-wrap { overflow-x: auto; }
table.records { width: 100%; border-collapse: collapse; font-size: 14px; }
table.records th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 10px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; }
table.records td { padding: 11px 10px; border-bottom: 1px solid #edf1e8; vertical-align: top; }
table.records tr:hover td { background: #fafcf6; }
table.records td.nowrap { white-space: nowrap; }
table.records a { color: var(--teal-dark); font-weight: 750; text-decoration: none; }
table.records input[type=checkbox] { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--teal-dark); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.expired { display: inline-block; font-size: 11px; font-weight: 750; color: #8a5a00; background: #fff4dc; border-radius: 999px; padding: 2px 8px; margin-left: 4px; }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.pager a, .pager span { padding: 7px 12px; border-radius: 9px; border: 1px solid var(--line); text-decoration: none; color: var(--navy-soft); font-size: 13px; font-weight: 700; background: white; }
.pager span.current { background: var(--teal-dark); color: white; border-color: var(--teal-dark); }
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.detail-row { border: 1px solid #e0e8da; border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; background: white; }
.detail-row.narrative { border-left: 3px solid #9fc36a; background: #fbfdf8; }
.detail-label { font-size: 11px; color: #567146; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 5px; }
.detail-value { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.detail-value.empty { color: #82907b; font-style: italic; }
.button.danger { background: #a52828; border-color: #a52828; color: white; }
.button.danger:hover { background: #861f1f; }
.button[disabled] { opacity: .5; cursor: not-allowed; }
@media (max-width: 900px) {
  .filter-grid { grid-template-columns: 1fr 1fr; }
  .filter-grid .grow { grid-column: 1 / -1; }
  .detail-grid { grid-template-columns: 1fr; }
}
@media print {
  .top-stripe, .tabs, .topbar-actions, .no-print { display: none !important; }
  .card { box-shadow: none; }
}
.link-button svg { width: 15px; height: 15px; }
.detail-title { margin-bottom: 6px; }
.detail-meta { margin: 0 0 20px; }
.mt22 { margin-top: 22px; } .mt16 { margin-top: 16px; } .mt12 { margin: 12px 0 0; } .m0 { margin: 0; }
.confirm-row { display: flex; gap: 10px; flex-wrap: wrap; max-width: 560px; }
.confirm-row input { flex: 1; min-width: 180px; }
details.card summary { cursor: pointer; }
code { background: #f1f4ec; padding: 1px 5px; border-radius: 5px; }
.export-options { flex: 1 1 100%; order: 3; }
.format-choice { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 12px; margin: 4px 0 4px; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.format-choice legend { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 0 6px; }
.format-choice label { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 650; cursor: pointer; }
.format-choice input { width: 17px; height: 17px; min-height: 0; margin: 0; accent-color: var(--teal-dark); }
.format-choice label.duplex { flex-basis: 100%; padding-left: 24px; color: var(--navy-soft); }
.format-choice input:disabled + * , .format-choice label.duplex:has(input:disabled) { opacity: .5; }
