/* Crew – Gestaltung angelehnt an Bühnentechnik: Grafit-Flightcase, Tally-Lichter. */
:root {
  --grund: #eceef0;
  --flaeche: #ffffff;
  --tinte: #1c2430;
  --leise: #5e6875;
  --linie: #d3d7dc;
  --case: #2a3139;
  --tally-gruen: #17924a;
  --tally-rot: #d1342a;
  --bernstein: #b7790b;
  --bernstein-hell: #fbf1dc;
  --minus: #b8322a;
  --fokus: #2f6fd6;
  --radius-gross: 18px;
  --radius: 8px;
  --schrift: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --anzeige: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --grund: #14181d;
    --flaeche: #1d232a;
    --tinte: #e7eaee;
    --leise: #9aa4b0;
    --linie: #333c46;
    --case: #0f1317;
    --tally-gruen: #2bb365;
    --tally-rot: #ea4a3e;
    --bernstein: #e0a33b;
    --bernstein-hell: #3a2f1a;
    --minus: #f0776e;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--grund);
  color: var(--tinte);
  font: 16px/1.5 var(--schrift);
  font-variant-numeric: tabular-nums;
}
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--fokus); outline-offset: 2px; border-radius: 4px; }
h1 { font: 700 1.6rem/1.2 var(--anzeige); letter-spacing: -0.01em; margin: 0.4rem 0 1rem; }
h2 { font: 650 1.1rem/1.3 var(--anzeige); margin: 1.6rem 0 0.6rem; }
small { color: var(--leise); font-size: 0.82em; }
.minus { color: var(--minus); }
.klein { font-size: 0.85rem; }
.nowrap { white-space: nowrap; }

/* ---------- Kopf ---------- */
.kopf {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: calc(env(safe-area-inset-top) + 0.6rem) 1rem 0.6rem;
  background: var(--case); color: #e9edf1;
}
.kopf a { text-decoration: none; }
.marke { display: inline-flex; align-items: center; gap: 0.5rem; font: 700 1.15rem var(--anzeige); letter-spacing: 0.02em; }
.marke.gross { font-size: 2rem; margin: 0; }
.kopf-logo { height: 0.95rem; width: auto; display: block; }
.trenner { width: 1px; height: 1.2rem; background: rgba(255,255,255,0.3); margin: 0 0.15rem; }
.eingang-logo { width: min(15rem, 70%); height: auto; margin-bottom: 1.6rem; }
@media (max-width: 26rem) { .kopf-logo { height: 0.8rem; } }
.tally { width: 0.62em; height: 0.62em; border-radius: 50%; background: var(--tally-rot); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tally-rot) 25%, transparent); }
.hauptnav { display: flex; gap: 0.2rem; flex-wrap: wrap; flex: 1; }
.hauptnav a { padding: 0.35rem 0.65rem; border-radius: 6px; color: #c3cad2; }
.hauptnav a[aria-current] { background: rgba(255,255,255,0.12); color: #fff; }
.zahl { display: inline-block; min-width: 1.3em; padding: 0 0.35em; border-radius: 1em; background: var(--bernstein); color: #fff; font-size: 0.78rem; text-align: center; }
.konto { display: flex; gap: 0.8rem; align-items: center; font-size: 0.9rem; color: #c3cad2; margin-left: auto; }
.konto form { margin: 0; }
.kopf .link { color: #c3cad2; }

/* ---------- Inhalt ---------- */
.inhalt { max-width: 34rem; margin: 0 auto; padding: 1rem 1rem 2rem; }
body.breit .inhalt { max-width: 72rem; }
body.mit-tabbar .inhalt { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom)); }
.brot { color: var(--leise); margin: 0 0 0.2rem; font-size: 0.92rem; }

.meldung { background: var(--flaeche); border-left: 4px solid var(--tally-gruen); padding: 0.7rem 0.9rem; border-radius: var(--radius); margin: 0 0 1rem; }
.meldung.fehler { border-left-color: var(--tally-rot); }
.warnung { background: var(--bernstein-hell); border-left: 4px solid var(--bernstein); padding: 0.8rem 1rem; border-radius: var(--radius); }
.warnung p { margin-top: 0; }
.hinweis { color: var(--leise); font-size: 0.9rem; }
.leer { color: var(--leise); padding: 1rem 0; }
.legende { color: var(--leise); font-size: 0.82rem; }

/* ---------- Knöpfe ---------- */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: 2.75rem; padding: 0.5rem 1.05rem; border-radius: var(--radius);
  border: 1px solid var(--case); background: var(--case); color: #fff;
  font: 600 0.95rem var(--schrift); text-decoration: none; cursor: pointer;
}
.knopf.leise { background: var(--flaeche); color: var(--tinte); border-color: var(--linie); }
.knopf.gefahr { background: transparent; color: var(--minus); border-color: var(--minus); }
.knopf.voll { width: 100%; }
@media (prefers-color-scheme: dark) { .knopf { background: #e7eaee; color: #14181d; border-color: #e7eaee; } }
button.link { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.aktionen { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.8rem 0 1rem; }
.aktionen form { margin: 0; }
form.inline { display: inline; }

/* ---------- Formulare ---------- */
.formular { display: grid; gap: 0.9rem; }
.formular.schmal { max-width: 26rem; }
label { display: grid; gap: 0.25rem; font-weight: 550; font-size: 0.92rem; }
label.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 450; }
input, select, textarea {
  width: 100%; min-height: 2.75rem; padding: 0.55rem 0.7rem;
  font: 16px var(--schrift); color: var(--tinte); background: var(--flaeche);
  border: 1px solid var(--linie); border-radius: var(--radius);
}
input[type=checkbox], input[type=radio] { width: 1.2rem; min-height: 1.2rem; accent-color: var(--case); }
textarea { min-height: 3.5rem; }
.code-feld { font-size: 1.6rem; letter-spacing: 0.3em; text-align: center; }
.zweispaltig, .dreispaltig { display: grid; gap: 0.9rem; grid-template-columns: 1fr 1fr; }
.dreispaltig { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 30rem) { .dreispaltig { grid-template-columns: 1fr 1fr; } }
.zeile { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: end; }
.zeile label { flex: 1 1 10rem; }
.zeile .breit-feld { flex: 3 1 14rem; }
fieldset { border: 1px solid var(--linie); border-radius: var(--radius); padding: 0.8rem 1rem 1rem; margin: 0; display: grid; gap: 0.8rem; }
legend { font-weight: 650; padding: 0 0.3rem; }
.wochentage { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.35rem; }
.wochentage input { padding: 0.4rem 0.3rem; text-align: center; }
.verteilung:not(.tage-sichtbar) .wochentage { display: none; }
.vertrag.ist-stunde .nur-monat { display: none; }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details.erfassen[open] > summary { display: none; }
details > summary.knopf { margin-bottom: 0.8rem; }
.geheim { font-size: 1.05rem; letter-spacing: 0.08em; word-break: break-all; background: var(--flaeche); padding: 0.5rem; border-radius: var(--radius); }
.qr { display: block; width: 220px; height: 220px; image-rendering: pixelated; border-radius: var(--radius); background: #fff; }
.linkbox { display: flex; gap: 0.5rem; }
.kopierfeld { font-size: 0.9rem; }

/* ---------- Eingang ---------- */
body.eingang { min-height: 100vh; background: var(--case); color: #e9edf1; }
body.eingang .inhalt { padding-top: calc(env(safe-area-inset-top) + 12vh); }
.eingang-box { display: grid; gap: 0.6rem; }
.eingang-box h1 { color: #fff; }
.eingang-box h2 { font-size: 1rem; color: #fff; }
.eingang-box .unter { color: #aab3bd; margin: 0 0 1rem; }
.eingang-box a:not(.knopf) { color: #c3cad2; }
.eingang-box .hinweis { color: #aab3bd; }
body.eingang input { background: #39414b; border-color: #4a535e; color: #fff; }
body.eingang .knopf { background: #fff; color: var(--case); border-color: #fff; }
body.eingang .meldung { background: #39414b; color: #fff; }

/* ---------- Heute / Stempeln ---------- */
.heute { display: grid; justify-items: center; text-align: center; gap: 0.8rem; }
.datumzeile { color: var(--leise); margin: 0.2rem 0 0; font-weight: 550; }
.stempel { margin: 0.6rem 0 0.2rem; }
.stempelknopf {
  --farbe: var(--tally-gruen);
  position: relative; width: min(64vw, 15rem); aspect-ratio: 1; border-radius: 50%;
  border: 0; cursor: pointer; color: #fff;
  background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--farbe) 82%, #fff) 0%, var(--farbe) 58%, color-mix(in srgb, var(--farbe) 70%, #000) 100%);
  box-shadow: 0 0 0 10px var(--case), 0 0 0 11px var(--linie), 0 14px 30px -12px color-mix(in srgb, var(--farbe) 70%, transparent);
  display: grid; place-content: center; gap: 0.15rem;
  -webkit-tap-highlight-color: transparent;
  transition: transform 120ms ease;
}
.stempelknopf:active { transform: scale(0.97); }
.stempel.laeuft .stempelknopf { --farbe: var(--tally-rot); }
.stempelknopf .wort { font: 750 2.4rem/1 var(--anzeige); letter-spacing: 0.01em; }
.stempelknopf .seit { font-size: 0.95rem; opacity: 0.92; }
.stempelknopf .uhr-live { font: 600 1.15rem var(--anzeige); }
.stempelknopf .ring { position: absolute; inset: -10px; border-radius: 50%; pointer-events: none; }
.stempel.laeuft .ring { box-shadow: 0 0 0 0 color-mix(in srgb, var(--tally-rot) 60%, transparent); animation: puls 2.4s ease-out infinite; }
@keyframes puls { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--tally-rot) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 22px transparent; } }
@media (prefers-reduced-motion: reduce) { .stempel.laeuft .ring { animation: none; } .stempelknopf { transition: none; } }

.tageswerte { display: flex; gap: 2.2rem; margin: 0.6rem 0 0; }
.tageswerte div { display: grid; }
.tageswerte dt { color: var(--leise); font-size: 0.85rem; order: 2; }
.tageswerte dd { margin: 0; font: 700 1.6rem var(--anzeige); order: 1; }
.abw-heute { font-weight: 600; color: var(--bernstein); margin: 0; }
.zeitliste { list-style: none; padding: 0; margin: 0; width: 100%; max-width: 20rem; }
.zeitliste a { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0.2rem; border-bottom: 1px solid var(--linie); text-decoration: none; }
.zeitliste .dauer { color: var(--leise); margin-left: auto; }
.marke-nachtrag { display: inline-grid; place-items: center; width: 1.25rem; height: 1.25rem; border-radius: 4px; background: var(--linie); color: var(--tinte); font-size: 0.7rem; font-weight: 700; vertical-align: middle; }
sup.marke-nachtrag { width: 1rem; height: 1rem; font-size: 0.62rem; margin-left: 2px; }
.marke-nachtrag.offen { background: var(--bernstein); color: #fff; }
.nachtragen { font-size: 0.92rem; }

.saldi-kurz { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: 0.6rem; margin-top: 1.6rem; }
.saldo { background: var(--flaeche); border-radius: var(--radius); padding: 0.75rem 0.9rem; display: grid; border-top: 3px solid var(--case); }
.saldo .wert { font: 700 1.5rem/1.2 var(--anzeige); }
.saldo .was { color: var(--leise); font-size: 0.82rem; }
.saldo.minus { border-top-color: var(--minus); }
.saldo.minus .wert { color: var(--minus); }

/* ---------- Tabbar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: color-mix(in srgb, var(--flaeche) 92%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid var(--linie);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a { display: grid; justify-items: center; gap: 0.1rem; padding: 0.45rem 0 0.4rem; font-size: 0.72rem; font-weight: 600; text-decoration: none; color: var(--leise); }
.tabbar a[aria-current] { color: var(--tinte); }
.tabbar a[aria-current] .ico { background: var(--tinte); }
.ico { width: 24px; height: 24px; background: var(--leise); -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.ico-uhr { --m: url("icons/uhr.svg"); }
.ico-monat { --m: url("icons/monat.svg"); }
.ico-weg { --m: url("icons/weg.svg"); }
.ico-saldo { --m: url("icons/saldo.svg"); }
@media (min-width: 56rem) {
  body.breit.mit-tabbar .tabbar { display: none; }
  body.breit.mit-tabbar .inhalt { padding-bottom: 2rem; }
}

/* ---------- Monat ---------- */
.monatskopf { display: flex; align-items: center; gap: 0.6rem; }
.monatskopf h1, .monatskopf h2 { margin: 0.4rem 0; }
.monatskopf.klein { margin-top: 1.4rem; }
.pfeil { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--flaeche); text-decoration: none; font-size: 1.4rem; line-height: 1; }
.schloss { margin-left: auto; font-size: 0.8rem; padding: 0.15rem 0.6rem; border-radius: 1rem; background: var(--case); color: #fff; }
.monatswerte { display: flex; flex-wrap: wrap; gap: 0.4rem 1.6rem; margin: 0.6rem 0; }
.monatswerte div { display: grid; }
.monatswerte dt { color: var(--leise); font-size: 0.8rem; order: 2; }
.monatswerte dd { margin: 0; font: 650 1.15rem var(--anzeige); order: 1; }
.abschlussform { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; background: var(--flaeche); padding: 0.6rem 0.9rem; border-radius: var(--radius); }
.abschlussform p { margin: 0; }

.tagesliste { list-style: none; margin: 0.6rem 0; padding: 0; background: var(--flaeche); border-radius: var(--radius); }
.tag {
  display: grid; grid-template-columns: 3.7rem 1fr 3.2rem 3.2rem 3.6rem; gap: 0.4rem; align-items: baseline;
  padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--linie);
}
.tag:last-child { border-bottom: 0; }
.tag.wochenende, .tag.feiertag { color: var(--leise); background: color-mix(in srgb, var(--grund) 55%, var(--flaeche)); }
.tag.ist-heute { box-shadow: inset 4px 0 0 var(--tally-rot); }
.tag.problem { box-shadow: inset 4px 0 0 var(--bernstein); }
.tdatum { white-space: nowrap; }
.tdatum b { font-weight: 650; }
.tzeiten { display: flex; flex-wrap: wrap; gap: 0.2rem 0.7rem; align-items: baseline; min-width: 0; }
.tzeiten a { text-decoration: none; border-bottom: 1px dotted var(--leise); }
.tist, .tsoll, .tdiff { text-align: right; }
.tsoll { color: var(--leise); }
.plus { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 1px dashed var(--linie); color: var(--leise); text-decoration: none !important; border-bottom-style: dashed !important; }
.info { font-size: 0.85rem; color: var(--leise); }
.info.warn { color: var(--bernstein); font-weight: 600; }
.abw { display: inline-block; font-size: 0.8rem; font-weight: 600; padding: 0.05rem 0.5rem; border-radius: 1rem; background: var(--linie); color: var(--tinte); }
.abw-ferien { background: #d7ead9; color: #1d5a2e; }
.abw-krank, .abw-unfall { background: #f4dcd8; color: #7c2a22; }
.abw-kompensation { background: #dfe5f3; color: #2c3f6b; }
.abw.beantragt { background: transparent; border: 1px dashed currentColor; }
@media (prefers-color-scheme: dark) {
  .abw-ferien { background: #23432c; color: #bfe3c8; }
  .abw-krank, .abw-unfall { background: #4a2622; color: #f3c7c1; }
  .abw-kompensation { background: #263250; color: #c7d3f0; }
}
@media (max-width: 26rem) {
  .tag { grid-template-columns: 3.5rem 1fr 3rem 3.4rem; padding-inline: 0.55rem; }
  .tag .tsoll { display: none; }
}

/* ---------- Abwesenheiten ---------- */
.abwliste { list-style: none; padding: 0; margin: 0; background: var(--flaeche); border-radius: var(--radius); }
.abwliste li { display: flex; flex-wrap: wrap; gap: 0.3rem 0.8rem; align-items: baseline; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--linie); }
.abwliste li:last-child { border-bottom: 0; }
.abwliste .status { margin-left: auto; font-size: 0.82rem; color: var(--leise); }
.abwliste .status-beantragt .status { color: var(--bernstein); font-weight: 600; }
.abwliste .status-abgelehnt { opacity: 0.6; }
.abwliste .bemerkung { flex-basis: 100%; font-size: 0.88rem; color: var(--leise); }
.abwliste form { margin: 0; font-size: 0.85rem; }
.dauer { color: var(--leise); }

/* ---------- Tabellen ---------- */
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tabelle { width: 100%; border-collapse: collapse; background: var(--flaeche); border-radius: var(--radius); overflow: hidden; font-size: 0.93rem; }
.tabelle.schmal { max-width: 26rem; }
.tabelle th, .tabelle td { padding: 0.55rem 0.7rem; text-align: left; border-bottom: 1px solid var(--linie); vertical-align: top; }
.tabelle thead th { font-size: 0.78rem; font-weight: 650; color: var(--leise); background: color-mix(in srgb, var(--grund) 50%, var(--flaeche)); white-space: nowrap; }
.tabelle tbody th { font-weight: 600; }
.tabelle tr:last-child > * { border-bottom: 0; }
.tabelle .summe > * { font-weight: 700; border-top: 2px solid var(--tinte); }
.tabelle td small, .tabelle th small { display: block; }
.tabelle form { margin: 0; }
.team td:nth-child(n+3) { white-space: nowrap; }
.laeuft-punkt { display: inline-block; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--tally-rot); margin-right: 0.35rem; }
.protokoll code { font-size: 0.75rem; word-break: break-all; white-space: pre-wrap; }

/* ---------- Admin ---------- */
.seitenkopf { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem; }
.seitenkopf .aktionen { margin: 0; }
.aufgaben { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0 0 1rem; }
.aufgabe { background: var(--bernstein-hell); border-left: 4px solid var(--bernstein); padding: 0.6rem 0.9rem; border-radius: var(--radius); text-decoration: none; }
.aufgabe b { font-size: 1.1rem; }
.raster { display: grid; gap: 0 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr)); align-items: start; }
.block { margin-bottom: 1.2rem; }
.antraege { list-style: none; padding: 0; display: grid; gap: 0.8rem; }
.antrag { background: var(--flaeche); border-radius: var(--radius); padding: 0.4rem 1rem 1rem; border-left: 4px solid var(--bernstein); }
.antrag h2 { margin-top: 0.6rem; }
.antrag .wann { font-weight: 600; margin: 0; }
.liste { padding-left: 1.1rem; }
.stamm { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; }
.stamm dd { margin: 0; }
