/* Anwesenheitserfassung Namaz — gemeinsames Styling.
   Ausgelegt auf Bedienung mit dem Finger: große Flächen, klare Zustände. */

:root {
  --akzent: #0f766e;
  --akzent-hell: #14918a;
  --akzent-weich: #e6f4f2;
  --erfolg: #15803d;
  --fehler: #b3261e;
  --fehler-weich: #fdeceb;

  --hg: #f4f6f7;
  --karte: #ffffff;
  --text: #16202a;
  --text-leise: #5c6b7a;
  --rand: #d9e0e5;

  --radius: 14px;
  --schatten: 0 1px 2px rgba(16, 32, 42, .06), 0 4px 16px rgba(16, 32, 42, .05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --akzent: #2aa198;
    --akzent-hell: #35bdb2;
    --akzent-weich: #14312f;
    --erfolg: #4ade80;
    --fehler: #ff8a80;
    --fehler-weich: #3a1e1c;

    --hg: #10151b;
    --karte: #1a212a;
    --text: #e8eef3;
    --text-leise: #9aa9b8;
    --rand: #2c3742;
    --schatten: none;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--hg);
  color: var(--text);
  line-height: 1.5;
  /* Doppeltipp-Zoom auf Tablets verhindern, sonst „springt" die Oberfläche. */
  touch-action: manipulation;
}

.huelle {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 16px 140px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

/* ------------------------------------------------------------- Kopfzeile */

.kopf {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}

.kopf h1 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: -.01em;
}

.pille {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--akzent-weich);
  color: var(--akzent);
  font-size: .9rem;
  font-weight: 600;
  white-space: nowrap;
}

.pille.ruhend { background: var(--rand); color: var(--text-leise); }

.punkt {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

/* ------------------------------------------------------------- Abschnitt */

.abschnitt { margin-bottom: 28px; }

.abschnitt h2 {
  margin: 0 0 12px;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-leise);
}

.raster {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

/* Kacheln: Mindesthöhe deutlich über der 44px-Empfehlung, damit auch
   mit Handschuhen oder in Eile sicher getroffen wird. */
.kachel {
  min-height: 78px;
  padding: 14px 12px;
  border: 2px solid var(--rand);
  border-radius: var(--radius);
  background: var(--karte);
  box-shadow: var(--schatten);
  color: var(--text);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: border-color .12s, background-color .12s, transform .08s;
}

.kachel:hover { border-color: var(--akzent-hell); }
.kachel:active { transform: scale(.975); }

.kachel[aria-checked="true"] {
  background: var(--akzent);
  border-color: var(--akzent);
  color: #fff;
}

.kachel:focus-visible {
  outline: 3px solid var(--akzent-hell);
  outline-offset: 2px;
}

/* -------------------------------------------------------------- Meldung */

.meldung {
  padding: 14px 16px;
  border-radius: var(--radius);
  border-left: 4px solid var(--fehler);
  background: var(--fehler-weich);
  color: var(--fehler);
  font-weight: 500;
}

.meldung[hidden] { display: none; }

/* ---------------------------------------------------------- Aktionsleiste */

.aktionsleiste {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--hg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--rand);
}

.aktionsleiste > * {
  max-width: 900px;
  margin: 0 auto;
}

.knopf {
  display: block;
  width: 100%;
  min-height: 62px;
  padding: 16px;
  border: none;
  border-radius: var(--radius);
  background: var(--akzent);
  color: #fff;
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .12s, transform .08s;
}

.knopf:hover:not(:disabled) { background: var(--akzent-hell); }
.knopf:active:not(:disabled) { transform: scale(.99); }

.knopf:disabled {
  background: var(--rand);
  color: var(--text-leise);
  cursor: not-allowed;
}

.knopf.sekundaer {
  background: transparent;
  border: 2px solid currentColor;
  color: var(--akzent);
}

.knopf.schmal { width: auto; min-height: 48px; padding: 12px 24px; font-size: 1rem; }

/* -------------------------------------------------------- Erfolgsanzeige */

.erfolg {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  background: var(--hg);
  text-align: center;
  animation: einblenden .2s ease-out;
}

.erfolg[hidden] { display: none; }

@keyframes einblenden { from { opacity: 0; } to { opacity: 1; } }

.haken {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: var(--erfolg);
  color: #fff;
  font-size: 3rem;
  line-height: 1;
}

.erfolg h2 { margin: 0; font-size: 1.9rem; }
.erfolg p { margin: 0; color: var(--text-leise); }
.erfolg .knopf { margin-top: 24px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------------- Admin-Panel */

.karte {
  padding: 20px;
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  background: var(--karte);
  box-shadow: var(--schatten);
}

.feld { margin-bottom: 16px; }

.feld label {
  display: block;
  margin-bottom: 6px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-leise);
}

input[type="text"],
input[type="password"],
input[type="time"] {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 2px solid var(--rand);
  border-radius: 10px;
  background: var(--karte);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
}

input:focus {
  outline: none;
  border-color: var(--akzent);
}

/* Zeiten-Tabelle: am Handy je Gebet eine Karte, ab Tablet echte Tabellenzeilen. */
.zeit-zeile {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  padding: 14px 0;
  border-bottom: 1px solid var(--rand);
}

.zeit-zeile:last-of-type { border-bottom: none; }

.zeit-zeile .name {
  align-self: center;
  font-size: 1.05rem;
  font-weight: 700;
}

.zeit-zeile .eingaben {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.zeit-zeile .eingaben > div > span {
  display: block;
  margin-bottom: 4px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-leise);
}

@media (min-width: 720px) {
  .zeit-zeile {
    grid-template-columns: 130px 1fr;
    align-items: center;
  }
  /* Spaltenüberschriften nur in der ersten Zeile zeigen */
  .zeit-zeile:not(:first-of-type) .eingaben > div > span { display: none; }
}

.kopfzeile-admin {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.hinweis {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--akzent-weich);
  color: var(--text);
  font-size: .9rem;
}

.hinweis[hidden] { display: none; }
.hinweis ul { margin: 6px 0 0; padding-left: 20px; }

.leise { color: var(--text-leise); font-size: .9rem; }

.zurueck {
  display: inline-block;
  margin-top: 20px;
  color: var(--text-leise);
  font-size: .9rem;
}
