/* Mitarbeiter-App – moderner, ruhiger Stil (angelehnt an apple.com):
   Milchglas-Leisten, weiche Karten, große Typografie, Pill-Buttons. */

:root {
  --bg: #f5f5f7;
  --flaeche: #ffffff;
  --text: #1d1d1f;
  --text2: #6e6e73;
  --akzent: #0071e3;
  --linie: #e8e8ed;
  --rand: #d2d2d7;
  --gruen: #34c759;
  --rot: #ff3b30;
  --orange: #ff9500;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  margin: 0; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased;
}
.versteckt { display: none !important; }

header {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.85rem 1.1rem; padding-top: calc(0.85rem + env(safe-area-inset-top));
  background: rgba(251, 251, 253, .85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, .08);
}
header #kopfName { font-weight: 600; letter-spacing: -.01em; }

/* Mehrfachbeschäftigung: deutlich anderes Farbschema, wenn die ZWEITE Firma
   aktiv ist – damit beim Buchen sofort klar ist, für welche Firma gestempelt wird. */
body.firma-zweit header {
  background: #7a2fbd; -webkit-backdrop-filter: none; backdrop-filter: none;
  border-bottom-color: #5f1f99;
}
body.firma-zweit header #kopfName { color: #fff; }
body.firma-zweit header .abmelden,
body.firma-zweit header .sprachwahl.klein { border-color: rgba(255,255,255,.6); color: #fff; }
body.firma-zweit header .sprachwahl.klein option { color: #1d1d1f; }
body.firma-zweit nav.unten button.aktiv { color: #7a2fbd; }

/* Aushilfe (Zweitfirma): keine Fehlzeiten/Urlaub/Anträge – nur Zeit + Kalender + Dokumente */
body.aushilfe #urlaubKarte,
body.aushilfe #krankKarte,
body.aushilfe #urlaubKonto,
body.aushilfe #antraegeKarte,
body.aushilfe #kontoUrlaubTile,
body.aushilfe .fehlzeit-knopf { display: none !important; }

header .abmelden {
  background: transparent; border: 1px solid var(--rand); color: var(--text);
  border-radius: 980px; padding: 0.3rem 0.85rem; font-size: 0.82rem;
}

/* Sprachwahl (Login-Karte und Kopfzeile) */
.sprachwahl { cursor: pointer; }
.login-karte .sprachwahl { margin: 0.4rem 0 0.2rem; }
header .sprachwahl.klein {
  width: auto; max-width: 7.5rem; padding: 0.3rem 0.4rem; font-size: 0.8rem;
  border: 1px solid var(--rand); border-radius: 980px; background: transparent;
}

main { padding: 1rem; padding-bottom: calc(5.4rem + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; }
.karte { background: var(--flaeche); border-radius: 18px; padding: 1.2rem 1.3rem; box-shadow: 0 2px 12px rgba(0,0,0,.05); margin-bottom: 1rem; }
.karte h2 { margin: 0 0 0.7rem; font-size: 1.05rem; font-weight: 600; letter-spacing: -.01em; }
.leer { color: #a1a1a6; }

/* Statuskarte + große Buchen-Knöpfe */
.statuskarte { text-align: center; padding: 1.5rem 1.3rem; }
.statustext { font-size: 1.25rem; font-weight: 600; letter-spacing: -.015em; margin: 0.2rem 0 1.2rem; }
.aktionen { display: grid; gap: 0.7rem; }
.aktionen button {
  font-size: 1.12rem; font-weight: 600; padding: 1.05rem; border: none;
  border-radius: 16px; color: #fff; transition: transform .1s, filter .15s;
}
.aktionen .kommen { background: var(--gruen); }
.aktionen .gehen { background: var(--rot); }
.aktionen .pause_start, .aktionen .pause_ende { background: var(--orange); }
.aktionen button:active { transform: scale(.97); filter: brightness(.92); }

.kontokarte { display: flex; justify-content: space-around; text-align: center; }
.kontokarte .zahl { font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.kontokarte .zahl.minus { color: var(--rot); }
.kontokarte .zahl.plus { color: #248a3d; }
.kontokarte .titel { color: var(--text2); font-size: 0.8rem; margin-top: 0.1rem; }
.kontokarte .titel small { display: block; font-size: 0.66rem; color: #a1a1a6; font-weight: 400; margin-top: 0.1rem; }

.buchungszeile { display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid var(--linie); }
.buchungszeile:last-child { border-bottom: none; }
.buchungszeile .fehl { color: var(--rot); }
.buchungszeile small { color: var(--text2); }

/* Rückfrage-Antworten & offene Rückfragen (Admin) auf „Heute" */
.rf-antwort-karte { border: 1px solid var(--linie); border-radius: 12px; padding: 0.6rem 0.75rem; margin-bottom: 0.6rem; }
.rf-antwort-karte:last-child { margin-bottom: 0; }
.rf-antwort-karte .rf-titel { font-weight: 600; }
.rf-antwort-karte .rf-frage { color: var(--text2); font-size: 0.9rem; margin: 0.15rem 0; }
.rf-antwort-karte .rf-antwort-text { background: #eef6ff; border-left: 3px solid var(--akzent); border-radius: 6px;
                                     padding: 0.4rem 0.6rem; margin: 0.3rem 0; white-space: pre-wrap; }
.rf-antwort-karte .rf-fuss { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem;
                             flex-wrap: wrap; font-size: 0.8rem; color: var(--text2); }
.rf-antwortfeld-app { display: flex; gap: 0.4rem; align-items: flex-start; margin: 0.4rem 0; }
.rf-antwortfeld-app textarea { flex: 1; min-height: 2.4rem; padding: 0.4rem 0.5rem; border: 1px solid var(--linie);
                               border-radius: 8px; font: inherit; resize: vertical; }

select { width: 100%; padding: 0.65rem 0.8rem; border: 1px solid var(--rand); border-radius: 12px;
         font-size: 1rem; background: var(--flaeche); font-family: inherit; color: var(--text); }
/* Hinweise (Tagesfenster): Fehlbuchung rot, Verspätung dezent orange */
.warnung { color: var(--rot); font-size: 0.84rem; margin-top: 0.25rem; }
.spaet-hinweis { color: #a05a00; font-size: 0.78rem; margin-top: 0.2rem; }

.status-chip { font-size: 0.78rem; border-radius: 980px; padding: 0.16rem 0.6rem; font-weight: 500; align-self: center; white-space: nowrap; }
.status-chip.offen { background: #fff4d6; color: #a05a00; }
.status-chip.genehmigt, .status-chip.bestaetigt { background: #e8f8ec; color: #1d7a35; }
.status-chip.abgelehnt { background: #fdf1f1; color: #d70015; }
.status-chip.erledigt { background: #e8f8ec; color: #1d7a35; }

/* Kalender */
.kalkopf { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; margin-bottom: 0.7rem; }
.kalpfeil { background: var(--linie); border: none; border-radius: 980px; width: 2.3rem; height: 2.3rem; font-size: 1.15rem; color: var(--text); flex-shrink: 0; }
/* Monats-Schnellsprung in der Kopfzeile (zwischen den Pfeilen) */
.kalkopf select { flex: 1; width: auto; text-align: center; font-weight: 600; padding: 0.45rem 0.6rem; }
.kalwochentage { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; color: var(--text2); font-size: 0.72rem; margin-bottom: 0.3rem; }
.kalgitter { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.kalzelle { aspect-ratio: 1; border-radius: 10px; background: var(--bg); display: flex; flex-direction: column;
            align-items: center; justify-content: center; font-size: 0.88rem; cursor: pointer; border: 2px solid transparent; }
.leerzelle { background: transparent; cursor: default; }
.kalzelle.k-heute { border-color: var(--akzent); }
.kalzelle.k-fehl { border-color: var(--rot); }   /* Fehlbuchung: roter Rahmen */
/* Kleine Marker in der Zelle: ⚠ Fehlbuchung (rot), ✎ von der Verwaltung geändert (dezent) */
.z-warn, .z-edit { font-style: normal; font-size: 0.58rem; vertical-align: super; margin-inline-start: 1px; line-height: 1; }
.z-warn { color: var(--rot); }
.z-edit { color: var(--text2); }
.kalzelle.k-gewaehlt { background: #e2e2e7; font-weight: 700; }
.kalzelle.k-feiertag { background: #fff4d6; }
.kalzelle.k-urlaub { background: #e8f8ec; }
.kalzelle.k-krank { background: #fdf1f1; }
.kalzelle.k-zeitausgleich { background: #f0e0ff; }   /* Urlaub aus Überstunden: lila */
.punktreihe { display: flex; gap: 2px; height: 6px; margin-top: 2px; }
.punkt { width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.p-termin { background: var(--akzent); }
.p-urlaub { background: var(--gruen); }
.p-krank { background: var(--rot); }
.p-zeitausgleich { background: #b57bee; }   /* Urlaub aus Überstunden: lila */
.p-offen { background: var(--orange); }
.p-feiertag { background: #d9a400; }
.p-info { background: #8e8e93; }
.tagsaldo-mini { display: block; font-size: 0.62rem; font-weight: 700; line-height: 1; margin-top: 1px; }
.tagsaldo-mini.plus { color: #248a3d; }
.tagsaldo-mini.minus { color: var(--rot); }
.kallegende { display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; margin-top: 0.7rem; font-size: 0.74rem; color: var(--text2); }
/* Monats-Summenzeile unter dem Kalender (Soll/Ist/Differenz) */
.kalsumme { display: flex; justify-content: space-around; text-align: center; margin-top: 0.85rem; padding-top: 0.8rem; border-top: 1px solid var(--linie); }
.kalsumme .zahl { font-size: 1.15rem; font-weight: 700; letter-spacing: -.015em; }
.kalsumme .zahl.plus { color: #248a3d; }
.kalsumme .zahl.minus { color: var(--rot); }
.kalsumme .titel { color: var(--text2); font-size: 0.72rem; margin-top: 0.1rem; }
.kallegende .punkt { margin-inline-end: 4px; }
#kalDetailListe .punkt { margin-inline-end: 6px; }
.klein-knopf { font-size: 0.78rem; border: 1px solid var(--rand); background: var(--flaeche); border-radius: 980px; padding: 0.2rem 0.6rem; }
input[type="file"] { padding: 0.5rem; font-size: 0.88rem; }

label { display: block; font-size: 0.83rem; color: var(--text2); margin: 0.7rem 0 0.25rem; }
input, textarea {
  width: 100%; padding: 0.65rem 0.8rem; border: 1px solid var(--rand); border-radius: 12px;
  font-size: 1rem; background: var(--flaeche); font-family: inherit; color: var(--text);
  transition: border-color .15s, box-shadow .15s; outline: none;
}
input:focus, textarea:focus { border-color: var(--akzent); box-shadow: 0 0 0 4px rgba(0,113,227,.15); }

button { cursor: pointer; font-family: inherit; transition: all .15s; }
button.primaer { background: var(--akzent); color: #fff; border: none; border-radius: 980px; padding: 0.7rem 1.2rem; font-size: 0.95rem; }
button.primaer:hover { background: #0077ed; }
button.sekundaer { background: var(--linie); color: var(--text); border: none; border-radius: 980px; padding: 0.7rem 1.2rem; font-size: 0.95rem; }
button.breit { width: 100%; margin-top: 1rem; }
.knopfzeile { display: flex; gap: 0.6rem; margin-top: 0.9rem; }
.fehler { background: #fdf1f1; color: #d70015; border-radius: 12px; padding: 0.65rem 0.9rem; margin: 0.6rem 0; font-size: 0.9rem; }

.meldung { padding: 0.6rem 0; border-bottom: 1px solid var(--linie); }
.meldung:last-child { border-bottom: none; }
.meldung.ungelesen { font-weight: 600; }
.meldung .zeit { color: #a1a1a6; font-size: 0.78rem; font-weight: 400; }
.meldung button { float: inline-end; font-size: 0.8rem; border: 1px solid var(--rand); background: var(--flaeche); border-radius: 980px; padding: 0.22rem 0.65rem; }

/* Untere Navigation: Milchglas */
nav.unten {
  position: fixed; bottom: 0; left: 0; right: 0; display: flex;
  background: rgba(251, 251, 253, .85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid rgba(0, 0, 0, .08);
  padding-bottom: env(safe-area-inset-bottom); z-index: 10;
  /* Bei vielen Tabs (Aufgaben, Lager, Werkzeug …) horizontal scrollbar,
     statt die Beschriftungen unleserlich zusammenzuquetschen. */
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
nav.unten::-webkit-scrollbar { display: none; }
nav.unten button { flex: 1 0 auto; min-width: 4.6rem; background: none; border: none;
  padding: 1rem 0.5rem; font-size: 0.82rem; color: var(--text2); position: relative; white-space: nowrap; }
nav.unten button.aktiv { color: var(--akzent); font-weight: 600; }
.badge {
  position: absolute; top: 0.4rem; inset-inline-end: 18%; background: var(--rot); color: #fff;
  border-radius: 980px; font-size: 0.68rem; padding: 0.06rem 0.38rem; font-weight: 700;
}

/* Info-Popup */
.popup-hg { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: grid; place-items: center; padding: 1.3rem; z-index: 50; }
.popup { background: var(--flaeche); border-radius: 20px; padding: 1.6rem 1.5rem; max-width: 420px; width: 100%; box-shadow: 0 12px 48px rgba(0,0,0,.2); }
.popup-kopf { font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; margin-bottom: 0.7rem; }
.popup-text { color: #333; line-height: 1.5; white-space: pre-wrap; margin-bottom: 1.2rem; }

/* Tagesfenster: farbige Buchungszeilen + prominente Soll/Ist/Saldo-Zeile */
.tf-zeile { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem;
            padding: 0.5rem 0.75rem; border-radius: 10px; margin-bottom: 0.35rem; font-size: 0.92rem; font-weight: 500; }
.tf-zeile .tf-zeit { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tf-arbeit { background: #e8f8ec; color: #1d7a35; }
.tf-pause { background: rgba(0,113,227,.08); color: #0058b0; }
.tf-fehl { background: #fdf1f1; color: #d70015; }
.tf-werte { display: flex; justify-content: space-around; text-align: center;
            margin-top: 0.8rem; padding-top: 0.75rem; border-top: 1px solid var(--linie); }
.tf-zahl { font-size: 1.35rem; font-weight: 700; letter-spacing: -.015em; }
.tf-zahl.plus { color: #248a3d; }
.tf-zahl.minus { color: var(--rot); }
.tf-titel { color: var(--text2); font-size: 0.72rem; margin-top: 0.1rem; }

/* Label „automatisch" für vom System gebuchte Mindestpausen */
.auto-label { display: inline-block; font-size: 0.68rem; font-weight: 500; background: var(--linie);
              color: var(--text2); border-radius: 980px; padding: 0.08rem 0.5rem; margin-inline-start: 0.35rem; vertical-align: middle; }

/* Hilfe-Popup (Anleitung & Datenschutz) */
.hilfe-popup { max-width: 480px; max-height: 85vh; display: flex; flex-direction: column; }
.hilfe-tabs { display: flex; gap: 0.4rem; margin: 0.3rem 0 0.8rem; }
.hilfe-tabs button { flex: 1; background: var(--linie); border: none; border-radius: 980px; padding: 0.5rem; font-size: 0.85rem; color: var(--text2); }
.hilfe-tabs button.aktiv { background: var(--akzent); color: #fff; font-weight: 600; }
.hilfe-inhalt { overflow-y: auto; flex: 1; margin-bottom: 0.9rem; -webkit-overflow-scrolling: touch; }
.hilfe-inhalt h3 { font-size: 0.98rem; margin: 1rem 0 0.3rem; color: var(--text); }
.hilfe-inhalt h3:first-child { margin-top: 0; }
.hilfe-inhalt p { margin: 0 0 0.5rem; line-height: 1.5; color: #333; font-size: 0.92rem; }

/* Info-Karten (Meldungen-Tab) */
.info-eintrag { border-inline-start: 3px solid var(--akzent); background: rgba(0,113,227,.05); border-radius: 8px; padding: 0.7rem 0.9rem; margin-bottom: 0.6rem; }
.info-eintrag .titel { font-weight: 600; }
.info-eintrag .zeitraum { color: var(--text2); font-size: 0.8rem; margin-top: 0.15rem; }
.info-eintrag .text { margin-top: 0.35rem; white-space: pre-wrap; line-height: 1.45; }

/* Urlaub aus Überstunden: lila Label in der Antragsliste */
.za-pill { display: inline-block; background: #f0e0ff; color: #7a3fbf; border-radius: 980px;
           padding: 0.08rem 0.55rem; font-size: 0.8rem; font-weight: 600; }

/* Art-Auswahl + Hinweis im Urlaubsformular */
.radio-zeile { display: flex; align-items: flex-start; gap: 0.5rem; margin: 0.35rem 0 0;
               color: var(--text); font-size: 0.9rem; }
.radio-zeile input { width: auto; margin-top: 0.15rem; }
.form-hinweis { font-size: 0.78rem; color: var(--text2); margin: 0.6rem 0 0; }

/* Tagesfenster-Kopf mit Blätter-Pfeilen */
.tf-kopf { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.tf-pfeil { width: 2rem; height: 2rem; font-size: 1rem; }

/* Urlaubsdetails-Popup (Urlaubsübersicht des Jahres) */
.ud-popup { max-height: 85vh; display: flex; flex-direction: column; }
.ud-inhalt { overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.ud-kopf { margin-bottom: 0.9rem; }
.ud-kopf .zahl { font-size: 1.35rem; }
.ud-tabelle { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.ud-tabelle th { text-align: start; color: var(--text2); font-weight: 500; font-size: 0.75rem;
                 padding: 0.3rem 0; border-bottom: 1px solid var(--linie); }
.ud-tabelle td { padding: 0.4rem 0; border-bottom: 1px solid var(--linie); }
.ud-tabelle tr:last-child td { border-bottom: none; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-karte { width: 100%; max-width: 380px; background: var(--flaeche); border-radius: 22px; padding: 2.2rem 2rem; box-shadow: 0 8px 40px rgba(0,0,0,.08); }
.login-karte h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; margin: 0 0 0.2rem; }
.login-karte .unter { color: var(--text2); font-size: 0.92rem; margin-top: 0; }
