/* Stempeluhr-App (Torlema). Ruhig, groß, daumentauglich: Systemschrift, viel Weiß, eine sonnig-warme
   Akzentfarbe. Eigenbau; Grundaufbau (Variablen, Meldung, Knöpfe) nach dem Vorbild von stil.css der
   Baustellen-App Minderlein (Stand 18.10.2026). */

:root {
  --akzent: #F5A623;
  --akzent-dunkel: #8F5B00;
  --akzent-hell: #FFF1D6;
  --tinte: #2B2118;
  --tinte-leicht: #6B5F52;
  --grund: #FFFBF2;
  --flaeche: #FFFFFF;
  --linie: #EADFCB;
  --gut: #2E7D4F;
  --gut-hell: #E3F3E8;
  --pause: #9A6B00;
  --pause-hell: #FFF4DB;
  --weg: #5E564E;
  --weg-hell: #F1EDE6;
  --schlecht: #B3261E;
  --schlecht-hell: #FBE9E7;
  --radius: 18px;
  --schatten: 0 1px 2px rgba(43, 33, 24, 0.06), 0 6px 18px rgba(43, 33, 24, 0.06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--grund); color: var(--tinte);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 18px; line-height: 1.4;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
}
.unsichtbar { position: absolute; width: 0; height: 0; overflow: hidden; }
.laden { padding: 40px 20px; color: var(--tinte-leicht); text-align: center; }
h1, h2, h3 { margin: 0 0 8px; line-height: 1.2; }
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
p { margin: 0 0 10px; }
a { color: var(--akzent-dunkel); }
svg { width: 1.2em; height: 1.2em; vertical-align: -0.25em; fill: none; }
.leise { color: var(--tinte-leicht); font-size: 16px; }
.klein { font-size: 15px; }
.rechts { text-align: right; }
.zeile { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.zeile.auseinander { justify-content: space-between; }
.abstand { height: 16px; }
hr { border: 0; border-top: 1px solid var(--linie); margin: 14px 0; }

/* Kopf */
.kopf {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; background: var(--flaeche); border-bottom: 1px solid var(--linie);
  position: sticky; top: 0; z-index: 5;
}
.kopf .marke { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.kopf .marke svg { width: 30px; height: 30px; color: var(--akzent); }
.kopf .marke small { display: block; font-weight: 500; font-size: 14px; color: var(--tinte-leicht); }
.kopf .wer { font-size: 15px; color: var(--tinte-leicht); text-align: right; }
.abzeichen { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--akzent-hell); color: var(--akzent-dunkel); }
.abzeichen.grau { background: var(--weg-hell); color: var(--weg); }
.abzeichen.rot { background: var(--schlecht-hell); color: var(--schlecht); }

/* Inhalt */
.inhalt { padding: 18px; max-width: 560px; margin: 0 auto; }
.inhalt.breit { max-width: 1120px; }
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; box-shadow: var(--schatten); }
.karte.leicht { box-shadow: none; }
.karte.hinweis { background: var(--akzent-hell); border-color: #F2D59A; }
.karte.warnung { background: var(--schlecht-hell); border-color: #F0B6B2; }

/* Knöpfe */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 56px; padding: 12px 20px; border-radius: 14px; border: 2px solid var(--tinte);
  background: var(--flaeche); color: var(--tinte); font: inherit; font-weight: 700; font-size: 18px;
  cursor: pointer; text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.knopf:active { transform: translateY(1px); }
.knopf:disabled { opacity: 0.5; cursor: default; }
.knopf.voll { width: 100%; }
.knopf.akzent { background: var(--akzent); border-color: var(--akzent); }
.knopf.dunkel { background: var(--tinte); border-color: var(--tinte); color: #fff; }
.knopf.leicht { border-color: var(--linie); font-weight: 600; }
.knopf.klein { min-height: 44px; padding: 8px 14px; font-size: 16px; border-radius: 12px; }
.knopf.rot { border-color: var(--schlecht); color: var(--schlecht); }
.knopf:focus-visible, .pinpad button:focus-visible, .stempelknopf:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--akzent-dunkel); outline-offset: 2px; }

/* Stempeln */
.stand { text-align: center; padding: 10px 0 6px; }
.stand .status { font-size: 15px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.stand .status.da { color: var(--gut); }
.stand .status.pause { color: var(--pause); }
.stand .status.weg { color: var(--weg); }
.stand .seit { font-size: 38px; font-weight: 800; line-height: 1.1; margin: 4px 0; }
.stand .uhrzeit { font-size: 16px; color: var(--tinte-leicht); }
.stempelknopf {
  display: block; width: min(76vw, 280px); aspect-ratio: 1; margin: 18px auto; border-radius: 50%;
  border: 0; font: inherit; font-weight: 800; font-size: 34px; cursor: pointer; color: var(--tinte);
  background: var(--akzent); box-shadow: 0 10px 30px rgba(245, 166, 35, 0.4), inset 0 -6px 0 rgba(0, 0, 0, 0.08);
  -webkit-tap-highlight-color: transparent;
}
.stempelknopf.gehen { background: var(--tinte); color: #fff; box-shadow: 0 10px 30px rgba(43, 33, 24, 0.3), inset 0 -6px 0 rgba(255, 255, 255, 0.1); }
.stempelknopf:active { transform: scale(0.98); }
.stempelknopf:disabled { opacity: 0.6; cursor: wait; }
.stempelknopf small { display: block; font-size: 16px; font-weight: 600; opacity: 0.8; margin-top: 4px; }
.pausezeile { display: flex; gap: 10px; }
.pausezeile .knopf { flex: 1; }

/* Listen */
.liste { list-style: none; margin: 0; padding: 0; }
.liste li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--linie); }
.liste li:last-child { border-bottom: 0; }
.liste .zeit { font-weight: 800; font-size: 20px; min-width: 64px; font-variant-numeric: tabular-nums; }
.liste .art { flex: 1; }
.liste .art small { display: block; color: var(--tinte-leicht); font-size: 14px; }
.liste .punkt { width: 12px; height: 12px; border-radius: 50%; background: var(--weg); flex: none; }
.liste .punkt.kommen, .liste .punkt.pause_ende { background: var(--gut); }
.liste .punkt.pause { background: var(--akzent); }
.liste .punkt.gehen { background: var(--tinte); }
.wartet { color: var(--pause); font-size: 14px; font-weight: 600; }
.fehler { color: var(--schlecht); font-size: 14px; font-weight: 600; }

/* Personenwahl und PIN */
.personen { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.personen button { min-height: 64px; border-radius: 14px; border: 2px solid var(--linie); background: var(--flaeche); font: inherit; font-weight: 700; font-size: 18px; padding: 8px 10px; cursor: pointer; color: var(--tinte); }
.personen button.chef { border-color: var(--akzent); }
.personen button small { display: block; font-size: 13px; font-weight: 500; color: var(--tinte-leicht); }
.pinfeld { display: flex; justify-content: center; gap: 14px; margin: 18px 0; }
.pinfeld span { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--tinte); }
.pinfeld span.voll { background: var(--tinte); }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 330px; margin: 0 auto; }
.pinpad button { min-height: 68px; border-radius: 16px; border: 2px solid var(--linie); background: var(--flaeche); font: inherit; font-size: 28px; font-weight: 700; cursor: pointer; color: var(--tinte); }
.pinpad button.leicht { border-color: transparent; background: transparent; font-size: 17px; font-weight: 600; }

/* Formulare */
label { display: block; font-weight: 600; font-size: 16px; margin: 10px 0 4px; }
input, select, textarea { width: 100%; min-height: 52px; padding: 10px 14px; border: 2px solid var(--linie); border-radius: 12px; font: inherit; background: var(--flaeche); color: var(--tinte); }
textarea { min-height: 80px; resize: vertical; }
.felder { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.felder .ganz { grid-column: 1 / -1; }

/* Tabellen */
.tabelle { width: 100%; border-collapse: collapse; font-size: 16px; }
.tabelle th, .tabelle td { padding: 10px 8px; border-bottom: 1px solid var(--linie); text-align: left; vertical-align: top; }
.tabelle th { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--tinte-leicht); font-weight: 700; }
.tabelle td.zahl, .tabelle th.zahl { text-align: right; font-variant-numeric: tabular-nums; }
.tabelle tr.summe td { font-weight: 800; border-top: 2px solid var(--tinte); }
.tabelle tr.auf { cursor: pointer; }
.tabelle tr.auf:hover { background: var(--akzent-hell); }
.tagknopf { font: inherit; font-weight: 600; background: none; border: 0; padding: 0; color: inherit; cursor: pointer; text-align: left; }
.tabelle .hinweis-text { color: var(--schlecht); font-size: 14px; }
.detail { background: var(--grund); }
.detail td { padding: 6px 8px 12px; }
.stempelzeile { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 6px 0; border-bottom: 1px dashed var(--linie); font-size: 15px; }
.stempelzeile:last-child { border-bottom: 0; }
.stempelzeile .zeit { font-weight: 800; font-size: 17px; min-width: 56px; }
.stempelzeile .artname { min-width: 96px; font-weight: 600; }
.stempelzeile .ort { color: var(--tinte-leicht); flex: 1; min-width: 180px; }
.stempelzeile .ort a { white-space: nowrap; }
.stempelzeile .vermerk { width: 100%; color: var(--akzent-dunkel); font-size: 14px; }
.stempelzeile .vermerk.alt { color: var(--weg); text-decoration: line-through; }

/* Anwesenheit */
.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.kachel { border-radius: 14px; padding: 14px; border: 1px solid var(--linie); background: var(--flaeche); }
.kachel.da { background: var(--gut-hell); border-color: #BFE3CC; }
.kachel.pause { background: var(--pause-hell); border-color: #F2D59A; }
.kachel.weg { background: var(--weg-hell); }
.kachel .name { font-weight: 800; font-size: 18px; }
.kachel .lage { font-size: 14px; color: var(--tinte-leicht); margin-top: 4px; }
.kachel .lage b { color: var(--tinte); }
.zahlen { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.zahl-kachel { flex: 1; min-width: 120px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 14px; padding: 12px 14px; }
.zahl-kachel b { display: block; font-size: 30px; line-height: 1.1; }
.zahl-kachel span { font-size: 14px; color: var(--tinte-leicht); }

/* Navigation */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; justify-content: space-around;
  background: var(--flaeche); border-top: 1px solid var(--linie); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; text-decoration: none; color: var(--tinte-leicht); font-size: 12px; font-weight: 600; border-radius: 12px; }
.nav a svg { width: 26px; height: 26px; }
.nav a.aktiv { color: var(--akzent-dunkel); background: var(--akzent-hell); }

/* Chef am Rechner */
@media (min-width: 900px) {
  body { padding-bottom: 20px; }
  .nav { position: sticky; top: 61px; bottom: auto; border-top: 0; border-bottom: 1px solid var(--linie); justify-content: center; gap: 6px; padding: 8px; }
  .nav a { flex: none; flex-direction: row; gap: 8px; padding: 8px 16px; font-size: 16px; }
  .nav a svg { width: 20px; height: 20px; }
  .chef .inhalt { max-width: 1120px; }
  .spalten { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
}

.meldung {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 10;
  max-width: 92vw; padding: 12px 18px; border-radius: 14px; background: var(--tinte); color: #fff; font-weight: 600; box-shadow: var(--schatten);
}
.meldung.gut { background: var(--gut); }
.meldung.schlecht { background: var(--schlecht); }
@media (min-width: 900px) { .meldung { bottom: 24px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
