/* Schüler-App: gleiche Farbwelt wie LenkZentrale (Navy, Glas, Orange), gebaut fürs Handy */
@font-face { font-family: 'Inter'; src: url('/app/fonts/inter.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
:root {
  --bg: #060910; --solid: #0d131c; --solid2: #141c28;
  --text: #f4f6f9; --muted: #9aa6b4; --faint: #64707f;
  --orange: #ff8a1f; --orange2: #f25f00; --orange-weich: rgba(255, 138, 31, .15);
  --verlauf: linear-gradient(135deg, #ffa043 0%, #f25f00 100%);
  --line: rgba(255, 255, 255, .08); --line2: rgba(255, 255, 255, .14);
  --ok: #34d399; --ok-weich: rgba(52, 211, 153, .14); --warn: #fbbf24; --warn-weich: rgba(251, 191, 36, .14);
  --bad: #f87171; --bad-weich: rgba(248, 113, 113, .14); --info: #7cc4ff;
  --glas: linear-gradient(155deg, rgba(255, 255, 255, .085) 0%, rgba(255, 255, 255, .03) 45%, rgba(255, 255, 255, .02) 100%);
  --glanz: inset 0 1px 0 rgba(255, 255, 255, .14);
  --r: 20px; --r-sm: 13px;
  --font: 'Inter', 'Segoe UI Variable', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  --unten: env(safe-area-inset-bottom, 0px); --oben: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(520px 400px at 95% 0%, rgba(255, 128, 20, .22), transparent 70%),
    radial-gradient(460px 380px at 0% 100%, rgba(70, 140, 255, .14), transparent 70%), var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { font-size: 16px; } /* kein Zoom beim Antippen (iOS) */
a { color: var(--orange); }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.laden { display: grid; place-items: center; min-height: 100vh; color: var(--muted); }

/* Grundgerüst */
.kopf { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: calc(12px + var(--oben)) 16px 12px;
  background: rgba(6, 9, 16, .78); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-bottom: 1px solid var(--line); }
.kopf h1 { font-size: 18px; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kopf .logo { height: 36px; width: auto; max-width: 120px; border-radius: 9px; object-fit: contain; background: #fff; padding: 3px 6px; }
.kopf .logo:not([src]) { display: none; }
.kopf .zurueck { border: 0; background: none; color: var(--orange); font-size: 26px; line-height: 1; padding: 4px 8px 4px 0; cursor: pointer; }
main { padding: 16px 16px calc(96px + var(--unten)); max-width: 640px; margin: 0 auto; }
main.chat-seite { padding-bottom: calc(80px + var(--unten)); }
.leiste { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 6px calc(6px + var(--unten)); background: rgba(9, 13, 20, .88); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: 1px solid var(--line); }
.leiste button { position: relative; border: 0; background: none; color: var(--muted); display: grid; justify-items: center; gap: 2px; padding: 6px 0; font-size: 11.5px; cursor: pointer; border-radius: 12px; }
.leiste button svg { width: 24px; height: 24px; }
.leiste button[aria-current="page"] { color: var(--orange); }
.leiste .punkt { position: absolute; top: 2px; left: calc(50% + 8px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; }

/* Karten */
.karte { background: var(--glas), rgba(13, 19, 28, .6); border: 1px solid var(--line2); border-radius: var(--r); box-shadow: var(--glanz); padding: 16px; margin-bottom: 14px; }
.karte h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 10px; font-weight: 600; }
.karte.hervor { border-color: rgba(255, 138, 31, .45); background: linear-gradient(155deg, rgba(255, 138, 31, .16), rgba(255, 138, 31, .04)), rgba(13, 19, 28, .6); }
.gruss { font-size: 24px; font-weight: 700; margin: 4px 0 2px; }
.leise { color: var(--muted); }
.klein { font-size: 13px; }
.zeile { display: flex; align-items: center; gap: 12px; }
.zeile > .wachsen { flex: 1; min-width: 0; }
.betrag { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.gross { font-size: 30px; font-weight: 750; letter-spacing: -.01em; }
.plus { color: var(--ok); } .minus { color: var(--bad); }
hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }

/* Status-Marken */
.marke { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.marke.ok { background: var(--ok-weich); color: var(--ok); }
.marke.warn { background: var(--warn-weich); color: var(--warn); }
.marke.bad { background: var(--bad-weich); color: var(--bad); }
.marke.neutral { background: rgba(255, 255, 255, .07); color: var(--muted); }
.marke::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* Termine */
.termin { display: grid; grid-template-columns: 58px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.termin:first-of-type { border-top: 0; }
.datum-block { text-align: center; background: var(--orange-weich); border-radius: 12px; padding: 6px 0; color: var(--orange); }
.datum-block b { display: block; font-size: 20px; line-height: 1.1; }
.datum-block span { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
.termin.vorbei .datum-block { background: rgba(255, 255, 255, .05); color: var(--muted); }
.termin .was { font-weight: 600; }
.aktionen { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* Knöpfe */
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 13px; border: 1px solid var(--line2);
  background: rgba(255, 255, 255, .06); color: var(--text); font-weight: 600; cursor: pointer; text-decoration: none; }
.knopf.haupt { background: var(--verlauf); border-color: transparent; color: #1a0d00; }
.knopf.klein { min-height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 11px; }
.knopf.gefahr { color: var(--bad); border-color: rgba(248, 113, 113, .4); }
.knopf.breit { width: 100%; }
.knopf:disabled { opacity: .5; cursor: default; }
.knopf:active:not(:disabled) { transform: scale(.98); }

/* Fortschritt */
.balken { height: 10px; border-radius: 6px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.balken > i { display: block; height: 100%; border-radius: 6px; background: var(--verlauf); }
.balken.ok > i { background: var(--ok); }
.balken.bad > i { background: var(--bad); }
.stand { display: grid; gap: 12px; }
.stand .zeile { font-size: 14px; }

/* Ratenplan */
.raten { list-style: none; margin: 0; padding: 0; }
.raten li { display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.raten li:first-child { border-top: 0; }
.raten .dot { width: 12px; height: 12px; border-radius: 50%; background: rgba(255, 255, 255, .18); }
.raten .bezahlt .dot { background: var(--ok); }
.raten .ueberfaellig .dot { background: var(--bad); box-shadow: 0 0 0 4px var(--bad-weich); }
.raten .heute .dot { background: var(--warn); }
.raten .ueberfaellig { color: var(--bad); }
.raten .bezahlt .betrag { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, .25); }

/* Formulare */
label.feld { display: grid; gap: 6px; margin-bottom: 14px; font-size: 13.5px; color: var(--muted); }
.feld input, .feld select, .feld textarea { width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line2); background: rgba(0, 0, 0, .25); color: var(--text); }
.feld textarea { min-height: 90px; resize: vertical; }
.wunsch { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.wunsch:last-child { border-bottom: 0; padding-bottom: 0; }
.wunsch input { min-width: 0; min-height: 44px; padding: 8px 10px; border-radius: 11px; border: 1px solid var(--line2); background: rgba(0, 0, 0, .25); color: var(--text); width: 100%; }
.wunsch input[type="date"] { grid-column: 1 / -1; }
.wunsch label { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
.fehler { color: var(--bad); font-size: 14px; min-height: 20px; margin: 4px 0 10px; }

/* Anmeldung */
.anmelden { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.anmelden .karte { width: 100%; max-width: 400px; padding: 26px 22px; }
.anmelden img { width: 170px; display: block; margin: 0 auto 14px; }
.anmelden h1 { font-size: 22px; text-align: center; margin: 0 0 4px; }
.anmelden p.leise { text-align: center; margin: 0 0 20px; }

/* Blatt (Dialog von unten) */
.blatt { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-end; justify-content: center; }
.blatt[hidden] { display: none; }
.blatt .inhalt { width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; background: var(--solid2); border: 1px solid var(--line2); border-bottom: 0;
  border-radius: 22px 22px 0 0; padding: 10px 18px calc(20px + var(--unten)); animation: hoch .22s cubic-bezier(.2, .8, .2, 1); }
.blatt .griff { width: 40px; height: 5px; border-radius: 3px; background: var(--line2); margin: 0 auto 12px; }
.blatt h3 { margin: 0 0 14px; font-size: 18px; }
@keyframes hoch { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .blatt .inhalt { animation: none; } }

/* Chat */
.chatliste button { width: 100%; display: flex; gap: 12px; align-items: center; text-align: left; padding: 12px 4px; border: 0; border-top: 1px solid var(--line); background: none; cursor: pointer; }
.chatliste button:first-child { border-top: 0; }
.avatar { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--orange-weich); color: var(--orange); font-weight: 700; }
.avatar.gruppe { background: rgba(124, 196, 255, .14); color: var(--info); }
.chatliste .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chatliste .vorschau { color: var(--muted); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chatliste .neu { background: var(--orange); color: #1a0d00; border-radius: 10px; font-size: 11.5px; font-weight: 700; padding: 1px 7px; }
.verlauf { display: flex; flex-direction: column; gap: 6px; }
.tag-trenner { align-self: center; font-size: 12px; color: var(--muted); background: rgba(255, 255, 255, .06); padding: 3px 10px; border-radius: 10px; margin: 8px 0; }
.blase { max-width: 82%; padding: 8px 12px 6px; border-radius: 16px; background: var(--solid2); border: 1px solid var(--line); word-wrap: break-word; white-space: pre-wrap; }
.blase.ich { align-self: flex-end; background: linear-gradient(155deg, rgba(255, 138, 31, .26), rgba(255, 138, 31, .14)); border-color: rgba(255, 138, 31, .35); border-bottom-right-radius: 5px; }
.blase.du { align-self: flex-start; border-bottom-left-radius: 5px; }
.blase .von { font-size: 12px; font-weight: 600; color: var(--info); margin-bottom: 2px; }
.blase .zeit { font-size: 11px; color: var(--muted); text-align: right; margin-top: 2px; }
.blase.geloescht { font-style: italic; color: var(--muted); }
.blase img { display: block; max-width: 100%; border-radius: 10px; margin: 2px 0 4px; }
.eingabe { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; gap: 8px; align-items: flex-end; padding: 8px 10px calc(8px + var(--unten));
  background: rgba(9, 13, 20, .94); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: 1px solid var(--line); }
.eingabe textarea { flex: 1; min-height: 44px; max-height: 140px; resize: none; padding: 11px 14px; border-radius: 22px; border: 1px solid var(--line2); background: rgba(0, 0, 0, .3); color: var(--text); }
.eingabe button { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 0; background: var(--verlauf); color: #1a0d00; display: grid; place-items: center; cursor: pointer; }
.eingabe button:disabled { opacity: .4; }
.eingabe .gesperrt { flex: 1; text-align: center; color: var(--muted); font-size: 14px; padding: 10px; }
.menue-knopf { border: 0; background: none; color: var(--muted); padding: 6px; cursor: pointer; border-radius: 10px; }

#toast { position: fixed; left: 50%; bottom: calc(92px + var(--unten)); transform: translateX(-50%) translateY(20px); z-index: 30; background: var(--solid2); border: 1px solid var(--line2);
  padding: 10px 16px; border-radius: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); text-align: center; }
#toast.zeigen { opacity: 1; transform: translateX(-50%); }
#toast.bad { border-color: rgba(248, 113, 113, .5); color: #fecaca; }
.leer { text-align: center; color: var(--muted); padding: 20px 8px; }
@media (hover: hover) { .knopf:hover:not(:disabled) { border-color: var(--orange); } .chatliste button:hover { background: rgba(255, 255, 255, .03); } }
