/* Lernserver – eigenes, nüchternes Stylesheet (keine externen Schriften oder CDNs). */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #1d2733;
  --muted: #5f6b7a;
  --border: #dce1e7;
  --accent: #1f6a85;
  --accent-dark: #16526a;
  --accent-soft: #e6f0f4;
  --danger: #b3261e;
  --danger-soft: #fbeaea;
  --ok: #276a3a;
  --ok-soft: #e7f3ea;
  --warn: #8a5a00;
  --warn-soft: #fdf3e0;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 .25rem; }
h2 { font-size: 1.2rem; margin: 2rem 0 .75rem; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
code, .mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }

/* Kopfzeile */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1100px; margin: 0 auto; padding: .75rem 1.25rem; display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); font-weight: 650; font-size: 1.1rem; }
.brand-mark { width: 28px; height: 28px; border-radius: 7px; background: var(--accent); position: relative; flex: none; }
.brand-mark::after { content: ""; position: absolute; left: 7px; top: 9px; width: 8px; height: 8px; border-left: 3px solid #fff; border-bottom: 3px solid #fff; transform: rotate(-135deg) translate(-1px, -1px); }
.brand-mark::before { content: ""; position: absolute; left: 15px; bottom: 7px; width: 7px; height: 3px; background: #fff; }
.area-tag { font-size: .75rem; font-weight: 600; color: var(--accent-dark); background: var(--accent-soft); padding: .1rem .5rem; border-radius: 999px; }
.nav { display: flex; gap: 1rem; flex: 1; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--muted); font-weight: 500; }
.nav a.active, .nav a:hover { color: var(--text); }
.top-actions { display: flex; align-items: center; gap: .75rem; font-size: .875rem; }
.lang a { text-decoration: none; color: var(--muted); padding: .1rem .3rem; border-radius: 4px; }
.lang a.current { color: var(--text); font-weight: 650; background: var(--bg); }
.who { color: var(--muted); max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Inhalt */
main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 2rem 1.25rem 3rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head p { margin: 0; }
.footer { border-top: 1px solid var(--border); background: var(--surface); }
.footer-inner { max-width: 1100px; margin: 0 auto; padding: 1rem 1.25rem; font-size: .8rem; color: var(--muted); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; }
.card + .card { margin-top: 1rem; }
.narrow { max-width: 440px; margin: 1rem auto; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; align-items: start; }

/* Kennzahlen */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow); }
.tile-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.tile-value { font-size: 2rem; font-weight: 650; line-height: 1.2; margin-top: .25rem; }
.tile-note { font-size: .8rem; color: var(--muted); }
.tile.placeholder .tile-value { color: #a3adb9; }

/* Tabellen */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: .65rem .9rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafbfc; font-weight: 600; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.actions { white-space: nowrap; text-align: right; }
td.actions form { display: inline; }
.empty { padding: 2rem; text-align: center; color: var(--muted); }

/* Formulare */
form.stack { display: grid; gap: 1rem; }
label { display: grid; gap: .3rem; font-weight: 550; font-size: .95rem; }
label .hint { font-weight: 400; color: var(--muted); font-size: .85rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date] {
  font: inherit; padding: .6rem .75rem; border: 1px solid #c5ccd5; border-radius: 6px; background: #fff; color: var(--text); width: 100%;
}
input:focus-visible, .btn:focus-visible, a:focus-visible { outline: 3px solid rgba(31, 106, 133, .35); outline-offset: 1px; border-color: var(--accent); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
input.code { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .1em; font-size: 1.2rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-weight: 600; padding: .6rem 1.1rem; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: #fff; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn-secondary { background: #fff; color: var(--text); border-color: #c5ccd5; }
.btn-secondary:hover { background: var(--bg); color: var(--text); border-color: #aeb7c2; }
.btn-danger { background: #fff; color: var(--danger); border-color: #e3b5b2; }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.btn-small { padding: .3rem .6rem; font-size: .85rem; font-weight: 550; }
.btn-large { padding: .9rem 1.4rem; font-size: 1.05rem; }
.btn[aria-disabled=true] { opacity: .5; pointer-events: none; }
.btn-link { background: none; border: none; color: var(--muted); padding: 0; font: inherit; cursor: pointer; text-decoration: underline; }
.btn-row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }

/* Hinweise */
.alert { padding: .8rem 1rem; border-radius: 6px; margin-bottom: 1rem; border: 1px solid; }
.alert-error { background: var(--danger-soft); border-color: #eec4c1; color: #7a1a14; }
.alert-ok { background: var(--ok-soft); border-color: #bfdcc7; color: #1d4f2b; }
.alert-info { background: var(--accent-soft); border-color: #c3dbe5; color: #16445a; }
.alert-warn { background: var(--warn-soft); border-color: #f0d9a8; color: #6b4600; }
.copy { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; background: #fff; border: 1px dashed #c5ccd5; padding: .6rem; border-radius: 6px; word-break: break-all; user-select: all; margin-top: .5rem; }

.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: #bfdcc7; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: #f0d9a8; }
.badge-error { background: var(--danger-soft); color: var(--danger); border-color: #eec4c1; }
.badge-accent { background: var(--accent-soft); color: var(--accent-dark); border-color: #c3dbe5; }

/* Startseite */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2rem; align-items: center; padding: 1rem 0 2rem; }
.hero h1 { font-size: 2.1rem; }
.hero p.lead { font-size: 1.1rem; color: var(--muted); }
.points { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: .6rem; }
.points li { padding-left: 1.6rem; position: relative; }
.points li::before { content: ""; position: absolute; left: 0; top: .45rem; width: .7rem; height: .7rem; border-radius: 50%; background: var(--accent-soft); border: 2px solid var(--accent); }

/* Schülerseite */
.launch { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.launch .card h3 { font-size: 1.15rem; }
.seat-id { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.1rem; letter-spacing: .08em; background: var(--accent-soft); padding: .1rem .5rem; border-radius: 4px; }
.qr { color-scheme: light; background: #fff; display: inline-block; padding: 0; margin: .5rem 0; }
.qr svg { width: 240px; height: 240px; display: block; }

/* Zugangskarten (Druckansicht) */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; }
.access-card { border: 1.5px dashed #9aa5b1; border-radius: 6px; padding: 5mm 6mm; background: #fff; break-inside: avoid; page-break-inside: avoid; min-height: 62mm; display: flex; flex-direction: column; gap: 2.5mm; }
.access-card .head { display: flex; justify-content: space-between; align-items: center; font-weight: 650; }
.access-card .head .num { font-size: .8rem; color: var(--muted); font-weight: 500; }
.access-card .name { border-bottom: 1px solid #556270; height: 8mm; font-size: .75rem; color: var(--muted); display: flex; align-items: flex-end; }
.access-card dl { display: grid; grid-template-columns: auto 1fr; gap: 1mm 4mm; margin: 0; }
.access-card dt { font-size: .78rem; color: var(--muted); }
.access-card dd { margin: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.05rem; font-weight: 600; letter-spacing: .04em; }
.access-card .note { font-size: .7rem; color: var(--muted); line-height: 1.35; margin-top: auto; }

@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; }
  .row-2 { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  main { padding-top: 1.25rem; }
  .who { display: none; }
}

@media print {
  @page { size: A4; margin: 10mm; }
  body { background: #fff; }
  .topbar, .footer, .no-print { display: none !important; }
  main { padding: 0; max-width: none; }
  .cards { gap: 5mm; }
  .access-card { min-height: 64mm; }
}

/* Abstände (keine Inline-Styles wegen CSP) */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 1rem; }
.mb-0 { margin-bottom: 0; }

/* Budgetanzeige */
.budget { display: grid; gap: .6rem; }
.budget meter { width: 100%; height: 1.1rem; }
