/* Zeiterfassung – Beton, Stahl und Signalgelb. Keine externen Schriften (DSGVO). */
:root {
  --beton: #E6E9EB;
  --flaeche: #FFFFFF;
  --tinte: #1D2A33;
  --stahl: #55697A;
  --linie: #C9D0D5;
  --signal: #F0B323;
  --signal-tinte: #2A2100;
  --rot: #B5372B;
  --kopf: #1D2A33;
  --schmal: "Bahnschrift SemiCondensed", "Bahnschrift", "DIN Alternate", "DIN Condensed", "Roboto Condensed", "Arial Narrow", sans-serif;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --beton: #141B20;
    --flaeche: #1E2830;
    --tinte: #E7ECEF;
    --stahl: #9AABB8;
    --linie: #33424D;
    --rot: #E06A5C;
    --kopf: #0E1418;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--beton);
  color: var(--tinte);
  font: 16px/1.5 var(--text);
  padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  -webkit-text-size-adjust: 100%;
}
h1, h2 { font-family: var(--schmal); font-weight: 600; line-height: 1.15; margin: 0; }
h1 { font-size: 34px; }
h2 { font-size: 22px; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
a { color: inherit; }

/* Kopf und Navigation */
.kopf {
  background: var(--kopf);
  color: #E7ECEF;
  display: flex; justify-content: space-between; align-items: baseline;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 18px 12px;
}
.kopf .marke { font-family: var(--schmal); font-size: 20px; font-weight: 600; }
.kopf .wer { font-size: 14px; color: #A9B8C3; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; overflow-x: auto;
  background: var(--flaeche); border-top: 1px solid var(--linie);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabs button {
  flex: 1 0 auto; min-height: 56px; padding: 0 14px;
  border: 0; background: none; color: var(--stahl);
  font: 600 15px var(--schmal); cursor: pointer;
  border-top: 4px solid transparent;
}
.tabs button.aktiv { color: var(--tinte); border-top-color: var(--signal); }
@media (min-width: 760px) {
  body { padding-bottom: 40px; }
  .tabs { position: sticky; top: 0; bottom: auto; border-top: 0; border-bottom: 1px solid var(--linie); padding: 0 8px; }
  .tabs button { flex: 0 0 auto; border-top: 0; border-bottom: 4px solid transparent; }
  .tabs button.aktiv { border-bottom-color: var(--signal); }
}

main { max-width: 860px; margin: 0 auto; padding: 18px 14px; }
.block { margin-top: 28px; }
.block-kopf { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.summe { font-family: var(--schmal); font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Stempeluhr – das Herzstück */
.uhr {
  background: var(--flaeche);
  border: 2px solid var(--tinte);
  padding: 20px 18px 18px;
}
.uhr.laeuft { background: var(--signal); color: var(--signal-tinte); border-color: var(--signal-tinte); }
.uhr.laeuft :focus-visible { outline-color: var(--signal-tinte); }
.uhr-status { margin: 0; font-weight: 600; }
.zeit {
  font-family: var(--schmal); font-weight: 600;
  font-size: clamp(64px, 20vw, 120px); line-height: 1;
  font-variant-numeric: tabular-nums; margin: 6px 0 4px;
}
.uhr-ort { margin: 0 0 14px; font-size: 18px; }
.uhr-form { display: grid; gap: 12px; margin-top: 14px; }
.uhr.laeuft input { border-color: var(--signal-tinte); background: #FFF8E3; color: var(--signal-tinte); }
.stempel {
  width: 100%; min-height: 64px; margin-top: 4px;
  border: 0; cursor: pointer;
  background: var(--tinte); color: var(--beton);
  font: 600 26px var(--schmal);
}
.uhr.laeuft .stempel { background: var(--signal-tinte); color: var(--signal); }
.stempel:active { transform: translateY(1px); }
.hinweis { margin: 12px 0 0; color: var(--stahl); }

/* Formulare */
label { display: grid; gap: 4px; font-size: 14px; font-weight: 600; }
input, select, textarea {
  font: 16px var(--text); color: var(--tinte);
  min-height: 46px; padding: 8px 10px; width: 100%;
  background: var(--flaeche); border: 1.5px solid var(--linie); border-radius: 3px;
}
textarea { min-height: 80px; resize: vertical; }
label.haken { display: flex; align-items: center; gap: 10px; font-weight: 500; }
label.haken input { width: 22px; min-height: 22px; }
.reihe { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.reihe.drei { grid-template-columns: 1fr 1fr 1fr; }
.fehler { color: var(--rot); font-weight: 600; margin: 0; }

.btn {
  min-height: 44px; padding: 8px 16px; cursor: pointer;
  font: 600 16px var(--schmal);
  border: 1.5px solid var(--tinte); border-radius: 3px;
  background: transparent; color: var(--tinte);
}
.btn.haupt { background: var(--tinte); color: var(--beton); }
.btn.gefahr { border-color: var(--rot); color: var(--rot); }
.btn.breit { width: 100%; }
.btn.klein { min-height: 36px; padding: 4px 10px; font-size: 15px; }

/* Filter */
.filter { display: grid; gap: 10px; background: var(--flaeche); padding: 14px; border: 1px solid var(--linie); }
.filter .knoepfe { display: flex; gap: 8px; flex-wrap: wrap; }
.umschalter { display: flex; margin-bottom: 12px; border: 1.5px solid var(--tinte); border-radius: 3px; overflow: hidden; width: fit-content; }
.umschalter button { border: 0; background: none; color: var(--tinte); font: 600 15px var(--schmal); padding: 8px 14px; min-height: 40px; cursor: pointer; }
.umschalter button.aktiv { background: var(--tinte); color: var(--beton); }

/* Auswertung */
.auswertung { display: grid; gap: 18px; grid-template-columns: 1fr; margin-top: 18px; }
@media (min-width: 640px) { .auswertung.zwei { grid-template-columns: 1fr 1fr; } }
.gesamt { font-family: var(--schmal); font-size: 44px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.gesamt small { display: block; font: 500 14px var(--text); color: var(--stahl); margin-top: 6px; }
.tabelle { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tabelle td { padding: 6px 0; border-bottom: 1px solid var(--linie); }
.tabelle td:last-child { text-align: right; font-weight: 600; white-space: nowrap; padding-left: 12px; }
.tabelle caption { text-align: left; font: 600 16px var(--schmal); padding-bottom: 4px; }

/* Listen */
.liste { list-style: none; margin: 0; padding: 0; background: var(--flaeche); border: 1px solid var(--linie); }
.zeile { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--linie); }
.zeile:first-child { border-top: 0; }
.zeile-haupt { display: grid; gap: 2px; min-width: 0; }
.zeile-haupt strong { overflow-wrap: anywhere; }
.zeile-rechts { display: grid; justify-items: end; align-content: start; gap: 6px; text-align: right; }
.klein { font-size: 14px; color: var(--stahl); overflow-wrap: anywhere; }
.dauer { font-family: var(--schmal); font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dauer.laeuft { background: var(--signal); color: var(--signal-tinte); padding: 0 6px; }
.knoepfe { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.zeile.abgeschlossen strong { color: var(--stahl); }
.etikett { font-size: 12px; font-weight: 600; border: 1px solid var(--stahl); color: var(--stahl); padding: 0 6px; border-radius: 2px; width: fit-content; }
.tag { display: flex; justify-content: space-between; margin: 20px 0 6px; font-family: var(--schmal); font-weight: 600; font-size: 17px; }
.tag:first-child { margin-top: 0; }
.leer { color: var(--stahl); padding: 8px 0; }

/* Anmeldung */
.anmeldung { max-width: 380px; margin: 0 auto; padding: calc(48px + env(safe-area-inset-top, 0px)) 18px 40px; }
.anmeldung h1 { margin-bottom: 4px; }
.anmeldung p { color: var(--stahl); margin: 0 0 20px; }
.karte { display: grid; gap: 14px; background: var(--flaeche); border-top: 6px solid var(--signal); padding: 20px; }

/* Dialog */
dialog.dlg {
  border: 0; padding: 0; width: min(520px, calc(100% - 20px));
  background: var(--flaeche); color: var(--tinte);
  border-top: 6px solid var(--signal); max-height: calc(100% - 20px);
}
dialog.dlg::backdrop { background: rgba(20, 27, 32, .6); }
.dlg-form { display: grid; gap: 12px; padding: 20px; }
.aktionen { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

#toast {
  position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--kopf); color: #E7ECEF; padding: 10px 16px; border-radius: 3px;
  transition: opacity .2s, transform .2s; max-width: calc(100% - 28px); z-index: 50;
}
#toast.zeigen { opacity: 1; transform: translate(-50%, 0); }
#toast.fehler-toast { background: var(--rot); color: #fff; }
@media (min-width: 760px) { #toast { bottom: 24px; } }
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }
