/* Gemeinsame Styles für alle Seiten. Aufbau:
   1. Schriften und Farben (Design-Grundlagen)   2. Grundelemente (Text, Felder, Knöpfe, Tabellen)
   3. Bausteine (Karten, Kennzahlen, Abzeichen …)   4. Seitenrahmen (Seitenleiste, Kopfzeile, schwebende Leiste)
   5. Formulare und Sonderfelder (Datum, Uhrzeit, Passwort, Gruppe …)
   Abstände überall gleich: 4px innerhalb einer Kachel, 8px zwischen Feldern und Knöpfen, 12–16px zwischen Karten */

/* ============================================================ 1. Schriften und Farben */
/* Schriften liegen auf unserem Server (nicht bei Google), damit keine Besucherdaten an Dritte gehen (DSGVO) */
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('/schriften/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url('/schriften/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('/schriften/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Sora'; font-weight: 500; font-display: swap; src: url('/schriften/sora-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Sora'; font-weight: 600; font-display: swap; src: url('/schriften/sora-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Sora'; font-weight: 700; font-display: swap; src: url('/schriften/sora-latin-700-normal.woff2') format('woff2'); }

/* Dunkles Farbschema: Scrollbalken, Kalender usw. vom Browser passen zum dunklen Design */
:root {
    color-scheme: dark;
    --hintergrund: #0a0a0b;
    --flaeche: #131315;
    --flaeche-2: #1a1a1d;
    --flaeche-hover: #222226;
    --linie: rgba(255, 255, 255, 0.08);
    --linie-stark: rgba(255, 255, 255, 0.14);
    --text: #f4f2ef;
    --text-2: #b4b0aa;
    --text-3: #85817b;
    --orange: #ff8a00;
    --orange-hell: #ffa53d;
    --orange-dunkel: #e07400;
    --orange-glanz: rgba(255, 138, 0, 0.14);
    --gruen: #3ecf8e;
    --gruen-flaeche: rgba(62, 207, 142, 0.12);
    --gelb: #f5b83d;
    --gelb-flaeche: rgba(245, 184, 61, 0.13);
    --rot: #ff6b6b;
    --rot-flaeche: rgba(255, 107, 107, 0.12);
    --blau: #6cb6ff;
    --blau-flaeche: rgba(108, 182, 255, 0.12);
    --radius: 14px;
    --radius-klein: 10px;
    --schrift-titel: 'Sora', system-ui, sans-serif;
    --schrift: 'Inter', system-ui, sans-serif;
}

/* ============================================================ 2. Grundelemente */
/* "hidden" gilt immer, auch für Elemente mit display: flex/grid (sonst würde z. B. eine Kennzahlen-Reihe nicht verschwinden) */
[hidden] {
    display: none !important;
}
body {
    margin: 0;
    font-family: var(--schrift);
    font-size: 15px;
    line-height: 1.55;
    text-align: center;
    color: var(--text);
    background-color: var(--hintergrund);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3 {
    font-family: var(--schrift-titel);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
h1 {
    font-size: 2em;
    color: var(--text);
}
h2 {
    font-size: 1.35em;
}
h3 {
    font-size: 1.05em;
    font-weight: 600;
}
a {
    color: var(--orange);
}

/* Inhalt jeder Seite ohne Seitenleiste in der Mitte: kürzer als das Fenster -> senkrecht mittig, länger -> oben */
body.mittig {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.seite {
    width: 100%;
    margin: auto 0;
    padding: 24px 16px;
    box-sizing: border-box;
}

/* Eingabefelder */
input, select, textarea {
    min-height: 42px;
    padding: 9px 13px;
    box-sizing: border-box;
    font: inherit;
    color: var(--text);
    background-color: var(--hintergrund);
    border: 1px solid var(--linie-stark);
    border-radius: var(--radius-klein);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
textarea {
    min-height: 0;
}
input::placeholder, textarea::placeholder {
    color: var(--text-3);
}
input:focus, select:focus, textarea:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px var(--orange-glanz);
}
/* Auswahlfeld wie die anderen Felder: gleiches Innenmaß, eigener Pfeil statt dem des Browsers */
select {
    appearance: none;
    padding-right: 38px;
    background: var(--hintergrund) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e8e6e3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 13px center / 16px;
    cursor: pointer;
}
input[type="checkbox"] {
    min-height: 0;
    box-shadow: none;
}
input::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

/* Knöpfe: Absenden orange gefüllt, alle anderen dunkelgrau mit Rand */
button, .knopf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 18px;
    box-sizing: border-box;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    background-color: var(--flaeche-2);
    border: 1px solid var(--linie-stark);
    border-radius: var(--radius-klein);
    cursor: pointer;
    transition: background-color .15s, border-color .15s, transform .1s;
}
button:hover, .knopf:hover {
    background-color: var(--flaeche-hover);
}
button:active, .knopf:active {
    transform: translateY(1px);
}
button:focus-visible, .knopf:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: 2px;
}
button[type="submit"], .knopf-primaer {
    color: #111;
    background-color: var(--orange);
    border-color: var(--orange);
    box-shadow: 0 6px 22px rgba(255, 138, 0, 0.22);
}
button[type="submit"]:hover, .knopf-primaer:hover {
    background-color: var(--orange-hell);
}
button:disabled {
    opacity: .55;
    cursor: default;
}
button svg, .knopf svg, .symbol {
    width: 18px;
    height: 18px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Tabellen: ruhig, ohne Gitter; Kopf klein und grau, Zeilen durch feine Linien getrennt */
.tabelle-scroll {
    overflow-x: auto;
    max-width: 100%;
}
table {
    margin: 0 auto;
    border-collapse: collapse;
    text-align: left;
}
th {
    padding: 11px 16px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-3);
    border-bottom: 1px solid var(--linie);
    white-space: nowrap;
}
td {
    padding: 12px 16px;
    font-size: 14px;
    vertical-align: middle;
    border-bottom: 1px solid var(--linie);
}
tbody tr:last-child td {
    border-bottom: 0;
}
tbody tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

/* ============================================================ 3. Bausteine */
.karte {
    max-width: 1100px;
    margin: 16px auto;
    padding: 22px 24px;
    background-color: var(--flaeche);
    border: 1px solid var(--linie);
    border-radius: var(--radius);
}
.karte h2 {
    margin-top: 0;
}

/* Meldungen als grüne bzw. rote Box */
.meldung {
    display: inline-block;
    padding: 9px 14px;
    font-size: 14px;
    border-radius: var(--radius-klein);
}
.meldung.ok     { color: var(--gruen); background-color: var(--gruen-flaeche); }
.meldung.fehler { color: var(--rot); background-color: var(--rot-flaeche); }

/* Sprachumschalter DE | EN (Knöpfe setzt sprache.js ein); so hoch wie die anderen Knöpfe (button, min-height) */
.sprachwahl {
    display: inline-flex;
    box-sizing: border-box;
    height: 42px;
    gap: 2px;
    padding: 3px;
    background-color: var(--flaeche-2);
    border: 1px solid var(--linie);
    border-radius: var(--radius-klein);
}
.sprachwahl button {
    min-height: 0;
    padding: 5px 11px;
    font-size: 13px;
    color: var(--text-2);
    background: transparent;
    border: 0;
    border-radius: 7px;
    box-shadow: none;
}
.sprachwahl button:hover {
    color: var(--text);
    background: transparent;
}
.sprachwahl button.aktiv {
    color: #111;
    background-color: var(--orange);
}

/* Kleine graue Erklärung, z. B. unter einer Überschrift */
.hinweis {
    font-size: 13px;
    color: var(--text-3);
}

/* Überblick: Kennzahlen als Karten; Beschriftung oben, große Zahl darunter */
.uebersicht {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 20px;
}
.kennzahl {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 22px 24px;
    text-align: left;
    color: inherit;
    text-decoration: none;
    background-color: var(--flaeche);
    border: 1px solid var(--linie);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color .15s, background-color .15s;
}
/* Beschriftung, Zahl und Hinweis stehen in allen Kacheln einer Reihe auf gleicher Höhe,
   auch wenn eine Beschriftung zwei Zeilen braucht (die Reihen kommen aus .uebersicht) */
.uebersicht > .kennzahl {
    display: grid;
    grid-row: span 3;
    grid-template-rows: subgrid;
    row-gap: 6px;
    align-content: start;
}
.kennzahl > span {
    order: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
}
.kennzahl .zahl {
    order: 1;
    font-family: var(--schrift-titel);
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
}
.kennzahl .hinweis {
    order: 2;
    font-size: 12px;
    color: var(--text-3);
}
/* Symbol oben rechts in der Kennzahl; Platz dafür, damit die Beschriftung nicht darunter läuft */
.kennzahl:has(.kennzahl-symbol) {
    padding-right: 64px;
}
.kennzahl-symbol {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 18px;
    height: 18px;
    padding: 9px;
    fill: none;
    stroke: var(--text-2);
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    background-color: var(--flaeche-2);
    border-radius: 10px;
}
.uebersicht > .kennzahl:first-child .kennzahl-symbol {
    stroke: var(--orange);
    background-color: var(--orange-glanz);
}
.kennzahl:hover, .kennzahl:focus-visible {
    border-color: rgba(255, 138, 0, 0.35);
    background-color: var(--flaeche-2);
}
/* Die erste Kennzahl ist hervorgehoben (z. B. "Gerade im Haus") */
.uebersicht > .kennzahl:first-child {
    background: linear-gradient(150deg, rgba(255, 138, 0, .16), rgba(255, 138, 0, .03) 60%), var(--flaeche);
    border-color: rgba(255, 138, 0, .28);
}

/* Kopf eines Bereichs: Überschrift links, Filter rechts, darunter eine feine Linie */
.bereich-kopf {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    margin: -2px 0 18px;
    padding-bottom: 16px;
    text-align: left;
    border-bottom: 1px solid var(--linie);
}
.bereich-kopf h2 {
    margin: 0;
    font-size: 1.35em;
}
.bereich-kopf .werkzeuge {
    margin: 0;
}
/* "Zurück" braucht es nur ohne Seitenleiste (die Seitenleiste ist die Navigation) */
.zurueck {
    min-height: 34px;
    padding: 0 12px;
    font-size: 13px;
}
.app .zurueck {
    display: none;
}
.werkzeuge {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.werkzeuge label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-2);
}

/* Status als Pille mit Punkt: gelb = wartet, grün = gut, blau = unterbrochen, grau = vorbei, rot = abgelehnt */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    border-radius: 999px;
}
.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
}
.badge-offen, .badge-eingeladen, .badge-ungeklaert { color: var(--gelb); background-color: var(--gelb-flaeche); }
.badge-angenommen, .badge-aktiv, .badge-geklaert   { color: var(--gruen); background-color: var(--gruen-flaeche); }
.badge-ausgecheckt                                  { color: var(--blau); background-color: var(--blau-flaeche); }
.badge-beendet, .badge-frei                         { color: var(--text-2); background-color: rgba(255, 255, 255, .06); }
.badge-abgelehnt, .badge-gesperrt, .badge-abgesagt  { color: var(--rot); background-color: var(--rot-flaeche); }

/* Kleine Knöpfe in Tabellen (PDF, Verschieben, Absagen …) */
.klein-knopf, .ausweis-knopf {
    min-height: 30px;
    margin: 2px;
    padding: 0 11px;
    font-size: 12px;
    border-radius: 8px;
}
/* Aktionen unter dem Status in Tabellen: kleine Symbol-Knöpfe nebeneinander (Text im Tooltip) */
.zellen-aktionen {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}
.symbol-knopf {
    width: 32px;
    min-height: 32px;
    padding: 0;
    color: var(--text-2);
    border-radius: 8px;
}
.symbol-knopf svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.symbol-knopf:hover, .symbol-knopf.an {
    color: var(--text);
}
.symbol-knopf.an {
    border-color: rgba(255, 138, 0, .45);
    color: var(--orange);
}
/* Rote Knöpfe für etwas, das sich nicht rückgängig machen lässt (Absagen, Löschen) */
.gefahr {
    color: var(--rot);
    border-color: rgba(255, 107, 107, .4);
}
.gefahr:hover {
    background-color: var(--rot-flaeche);
}

/* Mitarbeiter- und Praktikantenzeiten: der letzte Aufenthalt des Tages */
.letzte-zeit {
    color: var(--orange);
    font-weight: 600;
}

/* Fenster (dialog), z. B. "Schaden melden", "Besuch verschieben" */
dialog, .fenster {
    width: min(420px, calc(100vw - 32px));
    box-sizing: border-box;
    padding: 24px;
    color: var(--text);
    background-color: var(--flaeche);
    border: 1px solid var(--linie-stark);
    border-radius: var(--radius);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(3px);
}
dialog h2 {
    margin-top: 0;
    font-size: 1.2em;
}
.fenster form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}
.fenster label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.fenster .hinweis, .fenster p {
    margin: 0;
}
.dialog-knoepfe {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
}

/* Logo statt "EXP" in Überschriften und neben "ass" (sprache.js), so hoch wie die Großbuchstaben */
.titel-logo {
    height: 0.72em;
    margin-right: 0.04em;
    vertical-align: baseline;
}
.logo {
    display: inline-flex;
    align-items: baseline;
    font-family: var(--schrift-titel);
    font-size: 22px;
    font-weight: 700;
    color: var(--orange);
    text-decoration: none;
    white-space: nowrap;
}

/* ============================================================ 4. Seitenrahmen */
/* Mit Seitenleiste (Verwaltung, Accounts, Mitarbeiter): Leiste links, Inhalt rechts.
   Die Seitenleiste baut seitenleiste.js */
body.app {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    min-height: 100vh;
    text-align: left;
}
.seitenleiste {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 22px 14px;
    box-sizing: border-box;
    overflow-y: auto;
    background-color: #0e0e10;
    border-right: 1px solid var(--linie);
}
.seitenleiste > .logo {
    padding: 0 10px 22px;
}
.menue-gruppe {
    padding: 18px 12px 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-3);
}
.menue a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-2);
    text-decoration: none;
    border-radius: 9px;
}
.menue a[hidden] {
    display: none;
}
.menue a:hover {
    color: var(--text);
    background-color: var(--flaeche-2);
}
.menue a.an {
    color: var(--orange);
    background-color: var(--orange-glanz);
}
.menue .zaehler {
    margin-left: auto;
    padding: 1px 8px;
    font-size: 12px;
    font-weight: 600;
    color: #111;
    background-color: var(--orange);
    border-radius: 999px;
}
.menue .zaehler:empty, .menue .zaehler[data-null] {
    display: none;
}
.nutzer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    padding: 12px;
    background-color: var(--flaeche);
    border: 1px solid var(--linie);
    border-radius: 12px;
}
.nutzer > div {
    min-width: 0;
}
.nutzer b {
    display: block;
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* Rolle unter dem Namen, dahinter ggf. die Marke "Admin" (bricht bei Platzmangel in die nächste Zeile) */
.nutzer > div > span {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 6px;
    font-size: 12px;
    line-height: 1.35;
    color: var(--text-3);
}
.nutzer form {
    margin: 0 0 0 auto;
}
.nutzer button {
    min-height: 34px;
    padding: 0 9px;
    color: var(--text-2);
    background: transparent;
    border: 0;
    box-shadow: none;
}
.nutzer button:hover {
    color: var(--text);
    background-color: var(--flaeche-2);
}
.avatar {
    display: grid;
    flex: none;
    place-items: center;
    width: 34px;
    height: 34px;
    font-size: 13px;
    font-weight: 700;
    color: #111;
    background: linear-gradient(135deg, var(--orange-hell), var(--orange-dunkel));
    border-radius: 50%;
}
/* Kleiner, ruhiger Avatar in Listen (z. B. Besucher heute) */
.avatar-klein {
    width: 34px;
    height: 34px;
    font-size: 12px;
    color: var(--orange);
    background: var(--orange-glanz);
}
/* "Admin" als kleine Marke hinter der Rolle */
.admin-marke {
    display: inline-block;
    padding: 0 6px;
    font-size: 10px;
    font-style: normal;
    font-weight: 600;
    line-height: 16px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--orange);
    background-color: var(--orange-glanz);
    border-radius: 999px;
    vertical-align: 1px;
}

/* Rechte Seite: Kopfzeile (Suche, Sprache) und Inhalt */
.app-haupt {
    min-width: 0;
}
.kopfzeile {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 72px;
    padding: 0 32px;
    box-sizing: border-box;
    background-color: rgba(10, 10, 11, 0.85);
    border-bottom: 1px solid var(--linie);
    backdrop-filter: blur(12px);
}
.kopfzeile form {
    margin: 0;
}
.kopfzeile .rechts {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}
.app-inhalt {
    max-width: 1440px;
    margin: 0 auto;
    padding: 36px 40px 56px;
    box-sizing: border-box;
}
.app-inhalt .karte {
    max-width: none;
    margin: 0 0 24px;
    padding: 28px 30px;
}
/* Kopf einer Karte: Überschrift mit Erklärung links, Link oder Knopf rechts */
.karte-kopf {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    text-align: left;
}
.karte-kopf h2 {
    margin: 0;
    font-size: 1.1em;
}
.karte-kopf .hinweis {
    margin: 4px 0 0;
}
.mehr-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--orange);
    text-decoration: none;
    white-space: nowrap;
}
.mehr-link:hover {
    color: var(--orange-hell);
}
/* "(optional)" hinter einer Feldbeschriftung */
.optional {
    font-weight: 400;
    color: var(--text-3);
}
/* Begrüßung über dem Inhalt ("Guten Morgen, Markus") */
.seitenkopf {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 32px;
}
.seitenkopf h1 {
    margin: 0;
    font-size: 28px;
}
.seitenkopf p {
    margin: 6px 0 0;
    color: var(--text-3);
}
.seitenkopf .aktionen {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
/* Zwei Karten nebeneinander (z. B. Ausweis und Meine Zeiten); Spalten dürfen schmaler werden als ihr Inhalt */
.raster-2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
    gap: 24px;
    align-items: start;
}
.raster-2 > .karte {
    margin: 0;
}
.ausweis-karte h2, .raster-2 h2 {
    font-size: 1.1em;
}
.ausweis-karte .knopf {
    margin-top: 8px;
}
/* Praktikantenseite: Ausweis und Zeiten nebeneinander, in der Mitte */
.praktikant-inhalt {
    max-width: 1000px;
    margin: 0 auto;
    text-align: left;
}
/* Menü-Knopf: nur auf dem Handy, öffnet die Seitenleiste */
.menue-oeffnen {
    display: none;
}

/* Ohne Seitenleiste (Startseite, Anmeldung, Praktikant, Scanner): schwebende Leiste oben wie auf explore.de */
.leiste {
    position: sticky;
    top: 12px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    width: min(1180px, calc(100% - 32px));
    margin: 12px auto 0;
    padding: 10px 12px 10px 20px;
    box-sizing: border-box;
    background-color: rgba(19, 19, 21, 0.8);
    border: 1px solid var(--linie);
    border-radius: 18px;
    backdrop-filter: blur(14px);
}
.leiste > .logo {
    margin-right: auto;
}
.leiste form {
    margin: 0;
}
/* Knöpfe mit Symbol und Text in Leisten; auf dem Handy oft nur das Symbol */
.leisten-knopf {
    white-space: nowrap;
}
.leisten-knopf[hidden] {
    display: none;
}
/* Warmer Schein hinter dem Inhalt (Startseite, Anmeldung …), wie auf explore.de */
body.schein {
    background:
        radial-gradient(ellipse 55% 50% at 50% 45%, rgba(255, 138, 0, 0.12), transparent 70%) fixed,
        var(--hintergrund);
}

/* ============================================================ 5. Formulare und Sonderfelder */
/* Datumsfeld mit "Heute"-Knopf daneben */
.mit-heute {
    display: flex;
    gap: 8px;
}
.mit-heute input, .mit-heute .datum-feld {
    flex: 1;
    min-width: 0;
}

/* Formular als Raster: Beschriftung über jedem Feld, drei Spalten; Checkbox, Wiederholung und
   der Fuß mit dem Absende-Knopf (rechts) über die ganze Breite (z. B. Besucher hinzufügen / einladen) */
.formular-raster {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    text-align: left;
}
.formular-raster > label:not(.auswahl) {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
}
.formular-raster > label:not(.auswahl) input, .formular-raster > label select, .formular-raster > label .datum-feld, .formular-raster > label .datum-anzeige {
    width: 100%;
    box-sizing: border-box;
}
/* Uhrzeit mit "Jetzt"-Knopf daneben */
.mit-jetzt {
    display: flex;
    gap: 8px;
}
.formular-raster .mit-jetzt .zeit-anzeige {
    flex: 1;
    width: auto;
    min-width: 0;
}
.formular-raster > .auswahl, .formular-raster > .wiederholung, .formular-raster > .formular-fuss,
.formular-raster > .breit {
    grid-column: 1 / -1;
}
.formular-raster > .auswahl {
    justify-self: start;
    font-size: 14px;
}
.formular-raster .wiederholung label {
    display: flex;
    align-items: center;
    gap: 8px;
}
.formular-fuss {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--linie);
}
/* Steht links ein Häkchen (z. B. "Regelmäßiger Besuch"), bleibt der Knopf trotzdem rechts */
.formular-fuss button {
    min-width: 160px;
    margin-left: auto;
}
.formular-fuss .auswahl {
    font-size: 14px;
}

/* Checkbox mit Text daneben (z. B. "Ankunftszeit und Anlass gelten für alle") */
.auswahl {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.auswahl input {
    width: 18px;
    height: 18px;
    accent-color: var(--orange);
}

/* Gruppe einladen per CSV (gruppe.js), auf der Mitarbeiter- und der Verwaltungsseite */
#gruppe-formular, #gruppe-import {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 340px;
    margin: 0 auto;
    text-align: left;
}
/* display: flex oben würde sonst das hidden-Attribut überschreiben */
#gruppe-import[hidden], #gruppe-einzeln[hidden] {
    display: none;
}
#gruppe-vorschau table, #gruppe-ergebnis table {
    margin: 16px auto;
}
#gruppe-vorschau td, #gruppe-ergebnis td {
    vertical-align: top;
}
#gruppe-vorschau .ok { color: var(--gruen); }
#gruppe-vorschau .fehler, #gruppe-ergebnis .fehler { color: var(--rot); }
#gruppe-vorschau .hinweis { color: var(--gelb); }
#gruppe-vorschau p, #gruppe-ergebnis p {
    text-align: center;
}
#gruppe-formular p {
    margin: 0 0 4px;
    text-align: center;
}
/* Weitere Mitarbeiter als Teilnehmer: bei vielen Accounts scrollt die Liste */
#gruppe-teilnehmer summary {
    cursor: pointer;
    text-align: center;
}
#gruppe-teilnehmer .hinweis {
    text-align: center;
}
#gruppe-teilnehmer-liste {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
    padding: 4px 0;
}
/* Bisher eingeladene Gruppen, jede zum Aufklappen */
#gruppe-liste details {
    border-bottom: 1px solid var(--linie);
}
#gruppe-liste summary {
    padding: 10px 0;
    cursor: pointer;
}
/* Feste Spaltenbreiten, damit die Spalten aller Gruppen genau untereinander stehen */
#gruppe-liste table {
    width: 100%;
    margin: 4px 0 12px;
    table-layout: fixed;
}
#gruppe-liste th:nth-child(1) { width: 22%; }
#gruppe-liste th:nth-child(2) { width: 30%; }
#gruppe-liste th:nth-child(3) { width: 20%; }
#gruppe-liste th:nth-child(4) { width: 12%; }
#gruppe-liste th:nth-child(5) { width: 16%; }
#gruppe-liste td {
    overflow-wrap: anywhere;
}
#gruppe-liste p {
    text-align: center;
}
.einzeln-zeile {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 0;
    border-bottom: 1px solid var(--linie);
}
.einzeln-zeile .felder {
    display: flex;
    gap: 8px;
}
.einzeln-zeile .felder input[type="text"]:not(.zeit-anzeige) {
    flex: 1;
    min-width: 0;
}

/* Einheitlich in allen Formularen: Beschriftung und Feld (Datum, Uhrzeit, Dateiauswahl, Häkchen) mittig,
   Erklärtexte mittig. Gilt für Gruppe einladen, Schaden melden (Seite und Fenster) */
#gruppe-formular > label, #gruppe-import > label, #schaden-formular > label {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
#gruppe-import > p, #gruppe-einzeln > .hinweis {
    text-align: center;
}
/* Fenster "Schaden melden" und "Als geklärt markieren" (verwaltung.html): alle Felder gleich breit untereinander,
   Beschriftung über dem Feld */
#schaden-dialog form, #klaeren-dialog form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}
#schaden-dialog form > textarea, #schaden-dialog form > input, #klaeren-dialog form > textarea {
    width: 100%;
    box-sizing: border-box;
}
#schaden-dialog form > label:not(.datei-wahl) {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    font-size: 13px;
    color: var(--text-2);
}

/* Dateiauswahl: das Browser-Feld ist unsichtbar (aber noch fokussierbar für "required"), sichtbar ist ein .knopf */
.datei-wahl {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}
.datei-wahl input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}
.datei-wahl input:focus-visible + .knopf {
    outline: 2px solid var(--orange);
    outline-offset: 2px;
}
/* Status eines Schadens: Abzeichen, ggf. wer es geklärt hat, und der Knopf, alles mittig untereinander */
.schaden-status {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}
.foto-link {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: var(--orange);
}
.datei-name {
    min-width: 0;
    overflow: hidden;
    font-size: 13px;
    color: var(--text-3);
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Regelmäßiger Besuch: Wochentage als anklickbare Kästchen, darunter das Enddatum */
.wiederholung {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 4px 0;
}
.wiederholung[hidden] {
    display: none;
}
.wochentage {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.tag-chip input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}
.tag-chip span {
    display: inline-block;
    min-width: 2.6em;
    padding: 7px 8px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    color: var(--text-2);
    background-color: var(--flaeche-2);
    border: 1px solid var(--linie-stark);
    border-radius: 8px;
    cursor: pointer;
}
.tag-chip input:checked + span {
    color: #111;
    background-color: var(--orange);
    border-color: var(--orange);
}
.tag-chip input:focus-visible + span {
    outline: 2px solid var(--orange);
    outline-offset: 2px;
}

/* Meine Zeiten, Meine Meldungen, Meine Einladungen (Mitarbeiter- und Praktikantenseite) */
#meine-zeiten table, #meine-schaeden table, #meine-einladungen table {
    margin: 8px auto;
}
#meine-zeiten td, #meine-schaeden td {
    vertical-align: top;
}

/* Passwortfeld mit Auge rechts im Feld (passwort.js) */
.passwort-feld {
    position: relative;
    display: flex;
}
.passwort-feld input {
    flex: 1;
    min-width: 0;
    padding-right: 44px;
}
.passwort-auge, .datum-knopf {
    position: absolute;
    top: 50%;
    right: 4px;
    min-height: 0;
    padding: 6px 8px;
    color: var(--text-3);
    background: transparent;
    border: none;
    box-shadow: none;
    transform: translateY(-50%);
}
.passwort-auge:hover, .passwort-auge:focus-visible, .datum-knopf:hover, .datum-knopf:focus-visible {
    color: var(--orange);
    background-color: transparent;
}
.passwort-auge:active, .datum-knopf:active {
    transform: translateY(-50%);
}
.passwort-auge svg, .datum-knopf svg {
    stroke-width: 2;
}

/* Uhrzeit-Felder (sprache.js ersetzt <input type="time"> durch ein Textfeld): so breit wie "12:45 PM" */
.zeit-anzeige {
    width: 7.5em;
    flex: none;
}

/* Datumsfelder (sprache.js zeigt statt <input type="date"> ein Textfeld in der Sprache der Seite):
   Kalender-Knopf rechts im Feld wie das Auge im Passwortfeld; das Original ist unsichtbar und öffnet den Kalender */
.datum-feld {
    position: relative;
    display: inline-flex;
    align-self: flex-start;
    min-width: 0;
}
.datum-anzeige {
    width: 11em;
    min-width: 0;
    padding-right: 40px;
}
.mit-heute .datum-anzeige {
    width: 100%;
}
.datum-original {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 1px;
    height: 1px;
    min-height: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

/* ============================================================ Handy */
@media (max-width: 900px) {
    body.app {
        grid-template-columns: minmax(0, 1fr);
    }
    /* Seitenleiste als Schublade von links, öffnet über den Menü-Knopf */
    .seitenleiste {
        position: fixed;
        inset: 0 auto 0 0;
        width: 272px;
        transform: translateX(-100%);
        transition: transform .2s;
        box-shadow: 20px 0 60px rgba(0, 0, 0, .6);
    }
    body.menue-offen .seitenleiste {
        transform: none;
    }
    body.menue-offen::after {
        content: '';
        position: fixed;
        inset: 0;
        z-index: 15;
        background: rgba(0, 0, 0, .55);
    }
    .menue-oeffnen {
        display: inline-flex;
        min-height: 40px;
        padding: 0 10px;
    }
    .kopfzeile {
        gap: 8px;
        min-height: 60px;
        padding: 0 14px;
    }
    .app-inhalt {
        padding: 20px 14px 40px;
    }
    .raster-2 {
        grid-template-columns: minmax(0, 1fr);
    }
    .seitenkopf h1 {
        font-size: 24px;
    }
}
@media (max-width: 700px) {
    h1 {
        overflow-wrap: break-word;
    }
    .karte, .app-inhalt .karte {
        padding: 18px;
    }
    /* Formular-Raster untereinander, Absende-Knopf über die ganze Breite */
    .formular-raster {
        grid-template-columns: minmax(0, 1fr);
    }
    .formular-fuss button {
        flex: 1;
    }
    th, td {
        padding-left: 12px;
        padding-right: 12px;
    }
    .uebersicht {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
    .kennzahl, .kennzahl:has(.kennzahl-symbol) {
        padding: 14px;
    }
    /* Auf dem Handy ist die Karte zu schmal für das Symbol */
    .kennzahl-symbol {
        display: none;
    }
    .kennzahl .zahl {
        font-size: 26px;
    }
    .leiste {
        width: calc(100% - 20px);
        padding: 8px 8px 8px 14px;
    }
    .leiste .leisten-knopf span {
        display: none;
    }
    .leiste .leisten-knopf {
        padding: 0 11px;
    }
}
