/* Stundenbuch – «Stempelkarte»: kühler Karton, Tintenblau, ein Gummistempel als einziger Akzent. */

:root {
  --karton: #e7ecf0;
  --karte: #fbfcfd;
  --tinte: #1b2836;
  --leise: #5a6877;
  --linie: #cfd8e0;
  --blau: #1f3b5c;
  --blau-hell: #dfe8f1;
  --rot: #b3303a;
  --gruen: #2a7350;
  --gelb: #8a5a00;
  --fokus: #2f7dd1;
  --schatten: 0 1px 0 rgba(27, 40, 54, .06), 0 6px 18px -10px rgba(27, 40, 54, .35);
  --radius-karte: 14px;
  --radius-feld: 9px;
  --zahl: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --text: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --karton: #10161d; --karte: #19222c; --tinte: #e4ebf2; --leise: #97a6b5; --linie: #2c3845;
    --blau: #8db6e3; --blau-hell: #22303f; --rot: #f0727b; --gruen: #6fcf9c; --gelb: #e7b54a;
    --schatten: 0 1px 0 rgba(0, 0, 0, .3), 0 8px 20px -12px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --karton: #10161d; --karte: #19222c; --tinte: #e4ebf2; --leise: #97a6b5; --linie: #2c3845;
  --blau: #8db6e3; --blau-hell: #22303f; --rot: #f0727b; --gruen: #6fcf9c; --gelb: #e7b54a;
  --schatten: 0 1px 0 rgba(0, 0, 0, .3), 0 8px 20px -12px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--karton); color: var(--tinte);
  font: 400 17px/1.45 var(--text);
  font-variant-numeric: tabular-nums;
  min-height: 100dvh;
}
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--fokus); outline-offset: 2px; }
[hidden] { display: none !important; }
.laden { text-align: center; padding: 30vh 16px; color: var(--leise); }

/* ---------- Gerüst ---------- */
.kopf {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--karton);
  border-bottom: 1px solid var(--linie);
}
.wortmarke { font: 700 22px/1 var(--zahl); letter-spacing: .01em; margin: 0; color: var(--blau); }
.kopf select { margin-left: auto; max-width: 55%; }
main {
  max-width: 560px; margin: 0 auto;
  padding: 16px 16px calc(96px + env(safe-area-inset-bottom));
}
.demo-band {
  background: var(--blau-hell); color: var(--tinte); font-size: 14px;
  padding: 8px 16px; text-align: center;
}

.tabs {
  position: fixed; inset: auto 0 0 0; z-index: 6;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--karte); border-top: 1px solid var(--linie);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs button {
  border: 0; background: none; padding: 9px 4px 10px; min-height: 56px;
  display: grid; justify-items: center; gap: 2px;
  font-size: 13px; font-weight: 500; color: var(--leise); cursor: pointer;
}
.tabs svg { width: 24px; height: 24px; }
.tabs button[aria-current="page"] { color: var(--blau); }
.tabs button[aria-current="page"] svg { stroke-width: 2.3; }
.tabs .punkt {
  position: absolute; margin-left: 18px; width: 9px; height: 9px; border-radius: 50%; background: var(--rot);
}

/* ---------- Bausteine ---------- */
.karte {
  background: var(--karte); border-radius: var(--radius-karte); box-shadow: var(--schatten);
  padding: 18px 16px; margin-bottom: 16px; position: relative;
}
h2 { font: 600 20px/1.2 var(--text); margin: 0 0 12px; }
h3 { font: 600 17px/1.3 var(--text); margin: 18px 0 8px; }
.leise { color: var(--leise); }
.klein { font-size: 14px; }
p { margin: 0 0 10px; }

label { display: block; font-size: 14px; font-weight: 500; color: var(--leise); margin-bottom: 4px; }
input, select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px;
  background: var(--karte); border: 1.5px solid var(--linie); border-radius: var(--radius-feld);
}
input:focus, select:focus, textarea:focus { border-color: var(--blau); outline: none; box-shadow: 0 0 0 3px var(--blau-hell); }
textarea { min-height: 70px; resize: vertical; }
.feld { margin-bottom: 14px; }
.reihe { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 18px; border-radius: var(--radius-feld);
  border: 1.5px solid var(--linie); background: var(--karte); font-weight: 600; cursor: pointer;
  text-decoration: none; transition: transform .08s ease, background-color .15s ease;
}
.knopf:active { transform: scale(.98); }
.knopf:disabled { opacity: .5; cursor: default; }
.knopf.haupt { background: var(--blau); border-color: var(--blau); color: var(--karte); }
.knopf.gefahr { color: var(--rot); }
.knopf.breit { width: 100%; }
.knopf svg { width: 20px; height: 20px; flex: none; }
.knopfreihe { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.knopfreihe > .knopf { flex: 1 1 auto; white-space: nowrap; }
.stempelkarte .knopfreihe > .knopf.haupt { flex-basis: 100%; }
.link { background: none; border: 0; padding: 6px 0; color: var(--blau); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button {
  min-width: 52px; min-height: 42px; padding: 6px 12px; border-radius: 999px;
  border: 1.5px solid var(--linie); background: var(--karte); font-weight: 600; cursor: pointer;
}
.chips button[aria-pressed="true"] { background: var(--blau); border-color: var(--blau); color: var(--karte); }
.chips input { width: 90px; min-height: 42px; border-radius: 999px; text-align: center; }

/* ---------- Ergebnis beim Erfassen ---------- */
.ergebnis {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  border-top: 1.5px dashed var(--linie); margin-top: 6px; padding-top: 12px; margin-bottom: 12px;
}
.ergebnis .zahl { font: 700 44px/1 var(--zahl); color: var(--blau); }
.ergebnis.falsch .zahl { color: var(--rot); }

/* ---------- Monatsnavigation ---------- */
.monatnav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.monatnav h2 { margin: 0; text-align: center; flex: 1; }
.monatnav button {
  width: 46px; height: 46px; border-radius: 50%; border: 1.5px solid var(--linie);
  background: var(--karte); cursor: pointer; display: grid; place-items: center;
}
.monatnav button:disabled { opacity: .35; cursor: default; }
.monatnav svg { width: 22px; height: 22px; }

/* ---------- Stempelkarte (Monat) ---------- */
.stempelkarte { overflow: hidden; padding-top: 22px; }
.stempelkarte .gross { font: 700 76px/.9 var(--zahl); letter-spacing: -.01em; color: var(--tinte); margin: 0; }
.stempelkarte .gross small { font: 600 22px var(--zahl); color: var(--leise); margin-left: 6px; letter-spacing: 0; }
.stempelkarte .unter { margin-top: 8px; color: var(--leise); }

.stempel {
  position: absolute; right: 14px; top: 18px;
  transform: rotate(-9deg);
  font: 700 19px/1 var(--zahl); letter-spacing: .08em; text-transform: uppercase;
  padding: 7px 11px 6px; border: 3px solid currentColor; border-radius: 6px;
  color: var(--rot); opacity: .88;
  mask-image: radial-gradient(circle at 30% 40%, #000 60%, rgba(0,0,0,.75) 61%, #000 75%);
  -webkit-mask-image: radial-gradient(circle at 30% 40%, #000 60%, rgba(0,0,0,.75) 61%, #000 75%);
  pointer-events: none;
}
.stempel.bestaetigt { color: var(--gruen); }
.stempel.zurueckgewiesen { color: var(--rot); transform: rotate(6deg); }
.stempel.neu { animation: stempeln .38s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes stempeln {
  0% { transform: rotate(-9deg) scale(1.9); opacity: 0; }
  100% { transform: rotate(-9deg) scale(1); opacity: .88; }
}
@media (prefers-reduced-motion: reduce) {
  .stempel.neu { animation: none; }
  .knopf { transition: none; }
}

.hinweis {
  border-left: 4px solid var(--gelb); background: var(--blau-hell);
  padding: 10px 12px; border-radius: 6px; margin: 12px 0 0; font-size: 15px;
}
.hinweis.rot { border-color: var(--rot); }
.hinweis.gruen { border-color: var(--gruen); }

/* ---------- Liste der Einsätze ---------- */
.liste { list-style: none; margin: 0; padding: 0; }
.liste li + li { border-top: 1px solid var(--linie); }
.einsatz {
  display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; align-items: center; gap: 4px 12px;
  width: 100%; padding: 12px 4px; background: none; border: 0; text-align: left; cursor: pointer;
}
.einsatz[disabled] { cursor: default; }
.einsatz .tag { font: 600 17px/1.1 var(--zahl); }
.einsatz .tag span { display: block; font: 500 14px var(--text); color: var(--leise); }
.einsatz .zeiten { font-size: 16px; }
.einsatz .zeiten span { display: block; font-size: 14px; color: var(--leise); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.einsatz .dauer { font: 700 22px/1 var(--zahl); }
.leer { text-align: center; padding: 26px 8px; color: var(--leise); }

/* ---------- Jahr ---------- */
.balken { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.balken li { display: grid; grid-template-columns: 34px 1fr 64px; align-items: center; gap: 10px; font-size: 15px; }
.balken .spur { display: block; height: 14px; background: var(--blau-hell); border-radius: 3px; overflow: hidden; }
.balken .fuell { display: block; height: 100%; background: var(--blau); border-radius: 3px; }
.balken .wert { text-align: right; font: 600 17px var(--zahl); }
.balken li.jetzt { font-weight: 600; }

/* ---------- Chef ---------- */
.code {
  font: 700 40px/1 var(--zahl); letter-spacing: .18em; color: var(--blau);
  padding: 12px 0 6px; user-select: all; word-break: break-all;
}
.person {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 12px 0;
}
.person + .person { border-top: 1px solid var(--linie); }
.person .name { font-weight: 600; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; color: var(--blau); text-decoration: underline; text-underline-offset: 3px; }
.person .std { font: 700 22px var(--zahl); text-align: right; }
.person .knopfreihe { grid-column: 1 / -1; margin-top: 4px; }
.status { font-size: 14px; font-weight: 600; }
.status.eingereicht { color: var(--gelb); }
.status.bestaetigt { color: var(--gruen); }
.status.zurueckgewiesen { color: var(--rot); }
.status.offen { color: var(--leise); font-weight: 500; }

/* ---------- Anmeldung ---------- */
.anmeldung { max-width: 420px; margin: 0 auto; padding: calc(10vh + env(safe-area-inset-top)) 16px 40px; }
.anmeldung .wortmarke { font-size: 52px; }
.anmeldung .zeile { color: var(--leise); margin: 8px 0 26px; font-size: 18px; }
.umschalter { display: grid; grid-template-columns: 1fr 1fr; background: var(--blau-hell); border-radius: var(--radius-feld); padding: 4px; margin-bottom: 18px; }
.umschalter button { border: 0; background: none; min-height: 42px; border-radius: 7px; font-weight: 600; cursor: pointer; color: var(--leise); }
.umschalter button[aria-pressed="true"] { background: var(--karte); color: var(--tinte); box-shadow: var(--schatten); }
.demo-personen { display: grid; gap: 10px; }
.demo-personen .knopf { justify-content: space-between; }
.fehler { color: var(--rot); font-weight: 500; margin: 6px 0 12px; }

/* ---------- Dialog & Toast ---------- */
dialog {
  border: 0; border-radius: var(--radius-karte); padding: 20px 18px; width: min(440px, calc(100vw - 32px));
  background: var(--karte); color: var(--tinte); box-shadow: 0 20px 60px -20px rgba(0,0,0,.5);
  max-height: 85dvh;
}
dialog::backdrop { background: rgba(16, 22, 29, .5); }
dialog h2 { margin-bottom: 8px; }
#toast {
  position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 20; background: var(--tinte); color: var(--karte); padding: 11px 18px; border-radius: 999px;
  font-weight: 500; font-size: 15px; max-width: calc(100vw - 32px); box-shadow: var(--schatten);
}
.reihe.knopfrechts { grid-template-columns: minmax(0, 1fr) auto; }

/* Zeitwahl in Viertelstunden */
.zeitwahl { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 4px; }
.zeitwahl select { font: 600 20px var(--zahl); text-align: center; padding: 8px 6px; }
.zeitwahl span { font: 700 20px var(--zahl); color: var(--leise); }

/* Tageszusammenfassung bei «Zuletzt erfasst» */
.tagesblock + .tagesblock { margin-top: 14px; }
.tageskopf {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 8px 10px; border-radius: 8px; background: var(--blau-hell);
}
.tagestotal { font: 700 22px/1 var(--zahl); color: var(--blau); }
.einsatz.ohne-tag { grid-template-columns: minmax(0, 1fr) auto; padding-left: 10px; padding-right: 10px; }

/* Excel-Import */
.datei-knopf { position: relative; }
.datei-knopf input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.datei-knopf:focus-within { outline: 3px solid var(--fokus); outline-offset: 2px; }
.import-box { border-top: 1.5px dashed var(--linie); margin-top: 16px; padding-top: 14px; }
.import-zahl { font: 700 26px/1.1 var(--zahl); color: var(--blau); margin-bottom: 4px; }
.import-liste { margin-top: 10px; border-left: 4px solid var(--linie); padding: 4px 10px; background: var(--blau-hell); border-radius: 6px; font-size: 15px; }
.import-liste.rot { border-color: var(--rot); }
.import-liste.gelb { border-color: var(--gelb); }
.import-liste summary { font-weight: 600; cursor: pointer; padding: 4px 0; }
.import-liste ul { margin: 4px 0 6px; padding-left: 18px; }
label.knopf { display: inline-flex; font-size: 17px; font-weight: 600; margin-bottom: 0; }
