/* stil.css - Zugaenge.
   Bedienbar am Handy im Stehen: Tapziele mindestens 44 px, Eingabeschrift
   16 px (darunter zoomt iOS beim Antippen hinein), nirgends Querscroll.
   Geprueft an 320 / 360 / 412 / 430 px - dieselben vier Breiten wie beim
   Kassenzaehl-Cockpit. */

:root {
  --grund: #f4f6f8;
  --karte: #ffffff;
  --linie: #d8dee6;
  --text: #1b2430;
  --leise: #5d6b7c;
  --dunkel: #1d2b3a;
  --gruen: #1f7a4d;
  --gruen-hell: #e6f4ec;
  --rot: #a32020;
  --rot-hell: #fbecec;
  --gelb-hell: #fdf5e3;
  --rand: 10px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--grund);
  overflow-wrap: break-word;
}

/* --- Kopf --------------------------------------------------------------- */

#kopf {
  background: var(--dunkel);
  color: #fff;
  padding: env(safe-area-inset-top) 0 0;
}

.kopf-innen {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 900px;
  margin: 0 auto;
  padding: 10px 16px;
}

.marke { font-weight: 600; letter-spacing: 0.02em; }

.kopf-wer {
  margin-left: auto;
  font-size: 14px;
  color: #c6d2df;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#kopf .knopf-schlicht { color: #fff; border-color: #46586c; }

/* --- Grundgeruest ------------------------------------------------------- */

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px 16px calc(32px + env(safe-area-inset-bottom));
}

.verborgen { display: none !important; }

h1 { font-size: 22px; margin: 4px 0 6px; }
h2 { font-size: 18px; margin: 24px 0 8px; }

.hinweis { color: var(--leise); font-size: 14px; margin: 0 0 16px; }

.karte {
  background: var(--karte);
  border: 1px solid var(--linie);
  border-radius: var(--rand);
  padding: 16px;
  margin-bottom: 16px;
}

.karte-mitte { max-width: 420px; margin: 8vh auto 0; }

.zeile-oben { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }

.fusszeile { margin-top: 28px; text-align: center; }

/* --- Formulare ---------------------------------------------------------- */

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin: 12px 0 4px;
}

input, select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  font-size: 16px;          /* nie kleiner: sonst zoomt das Handy hinein */
  font-family: inherit;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--linie);
  border-radius: 8px;
}

input:focus, select:focus, button:focus-visible {
  outline: 3px solid #2f6fb0;
  outline-offset: 1px;
}

button { font-family: inherit; cursor: pointer; }

.knopf-gross {
  width: 100%;
  min-height: 48px;
  margin-top: 18px;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: var(--dunkel);
  border: 1px solid var(--dunkel);
  border-radius: 8px;
}

.knopf-schlicht {
  min-height: 44px;
  padding: 8px 14px;
  font-size: 15px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--linie);
  border-radius: 8px;
}

.knopf-zurueck {
  min-height: 44px;
  padding: 8px 12px 8px 0;
  font-size: 15px;
  color: var(--leise);
  background: none;
  border: 0;
}

.knopf-klein {
  min-height: 40px;
  padding: 7px 12px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--linie);
  border-radius: 8px;
}

.knopf-warn { color: var(--rot); border-color: #e3b7b7; }

button[disabled] { opacity: 0.5; cursor: default; }

summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 600;
  cursor: pointer;
}

/* --- Meldungen ---------------------------------------------------------- */

.meldung { margin: 14px 0 0; font-size: 15px; min-height: 1px; }
.meldung:empty { margin: 0; }
.meldung.schlecht { color: var(--rot); background: var(--rot-hell);
                    padding: 10px 12px; border-radius: 8px; }
.meldung.gut { color: var(--gruen); background: var(--gruen-hell);
               padding: 10px 12px; border-radius: 8px; }

.warnung {
  margin: 14px 0 0;
  padding: 10px 12px;
  font-size: 14px;
  background: var(--gelb-hell);
  border-radius: 8px;
}

/* --- Kacheln ------------------------------------------------------------ */

.kacheln {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.kachel {
  display: block;
  width: 100%;
  min-height: 88px;
  padding: 14px 16px;
  text-align: left;
  text-decoration: none;
  color: var(--text);
  background: var(--karte);
  border: 1px solid var(--linie);
  border-radius: var(--rand);
}

.kachel-knopf { font-size: 16px; }
.kachel-titel { display: block; font-weight: 600; margin-bottom: 4px; }
.kachel-zeile { display: block; font-size: 14px; color: var(--leise); }
.kachel-befristet { display: block; font-size: 13px; color: #8a6d1f; margin-top: 4px; }

/* --- Benutzerliste ------------------------------------------------------ */

.person {
  background: var(--karte);
  border: 1px solid var(--linie);
  border-radius: var(--rand);
  margin-bottom: 12px;
  overflow: hidden;
}

.person > summary { padding: 14px 16px; gap: 8px; }

.person-name { font-weight: 600; }
.person-kennung { color: var(--leise); font-weight: 400; font-size: 14px; }

.merker {
  margin-left: auto;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
}
.merker-gesperrt { color: var(--rot); background: var(--rot-hell); }
.merker-start { color: #8a6d1f; background: var(--gelb-hell); }

.person-innen { padding: 0 16px 16px; border-top: 1px solid var(--linie); }

.app-zeile {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 0;
  border-bottom: 1px solid var(--linie);
}
.app-zeile:last-of-type { border-bottom: 0; }

.app-name { flex: 1 1 140px; font-weight: 600; font-size: 15px; }
.app-zeile select { flex: 1 1 150px; width: auto; min-width: 0; }
.app-zeile input[type="date"] { flex: 0 1 160px; width: auto; }

.werkzeuge {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--linie);
}

/* --- Protokoll ---------------------------------------------------------- */

.protokoll-zeile {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  font-size: 14px;
  background: var(--karte);
  border: 1px solid var(--linie);
  border-radius: 8px;
  margin-bottom: 6px;
}
.protokoll-zeit { color: var(--leise); font-variant-numeric: tabular-nums; }
.protokoll-was { font-weight: 600; }

/* --- Vordergrund -------------------------------------------------------- */

.vordergrund {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(20, 28, 38, 0.6);
  z-index: 10;
}

.vg-karte { max-width: 420px; width: 100%; margin: 0; }

.passwort-anzeige {
  display: block;
  margin: 12px 0;
  padding: 14px;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 22px;
  letter-spacing: 0.06em;
  text-align: center;
  word-break: break-all;
  background: var(--grund);
  border: 1px dashed var(--linie);
  border-radius: 8px;
}

.vg-knoepfe { display: flex; gap: 10px; flex-wrap: wrap; }
.vg-knoepfe .knopf-gross { flex: 1 1 140px; width: auto; margin-top: 8px; }
.vg-knoepfe .knopf-schlicht { flex: 1 1 140px; margin-top: 8px; }

/* --- Schmale Geraete ---------------------------------------------------- */
/* Bei 320 px bleibt sonst die App-Zeile nicht mehr in der Breite. */

@media (max-width: 360px) {
  main { padding: 12px 12px 24px; }
  .karte { padding: 14px; }
  .kacheln { grid-template-columns: 1fr; }
  .app-zeile { gap: 8px; }
  .app-zeile select, .app-zeile input[type="date"] { flex: 1 1 100%; }
  .passwort-anzeige { font-size: 19px; }
}

@media (prefers-reduced-motion: no-preference) {
  .kachel { transition: border-color 0.12s ease; }
}

.kachel:hover { border-color: #9fb0c2; }
