/* Stunden-App — Design-System 2026: Dashboard-Aufbau, heller & dunkler Modus.
   Firmenfarbe (--akzent) wird pro Betrieb gesetzt. */
:root {
  --akzent: #1f6f54;
  --akzent-dunkel: #164f3c;          /* wird in app.js aus der Firmenfarbe berechnet */
  --akzent-hell: rgba(31, 111, 84, .12);
  --tinte: #10161f;
  --dezent: #6a7686;
  --linie: rgba(16, 22, 31, .07);
  --flaeche: #f2f4f8;
  --karte: #ffffff;
  --eingabe: #eceff4;
  --gefahr: #d5423b;
  --radius: 18px;
  --schatten: 0 1px 2px rgba(15,23,42,.04), 0 10px 30px rgba(15,23,42,.07);
  --schatten-gross: 0 24px 60px rgba(15,23,42,.18);
  --glas: rgba(255, 255, 255, .82);
}

/* Automatischer Dark Mode — folgt der Systemeinstellung des Geräts */
@media (prefers-color-scheme: dark) {
  :root {
    --tinte: #eaeef5;
    --dezent: #8e9aac;
    --linie: rgba(255, 255, 255, .08);
    --flaeche: #0d1117;
    --karte: #171d26;
    --eingabe: #212936;
    --schatten: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
    --schatten-gross: 0 24px 60px rgba(0,0,0,.5);
    --glas: rgba(23, 29, 38, .85);
  }
}

* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Inter", "SF Pro Text", "Segoe UI Variable", system-ui, -apple-system, sans-serif;
  background: var(--flaeche);
  color: var(--tinte);
  min-height: 100vh;
  line-height: 1.45;
}
h1 { font-size: 1.45rem; letter-spacing: -.02em; }
h2 { font-size: 1.2rem; letter-spacing: -.015em; }
h3 { font-size: 1rem; margin-bottom: .6rem; }
.klein { font-size: .82rem; }
.dezent { color: var(--dezent); }
.zentriert { text-align: center; }
.zeile-zwischen { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.laden { display: flex; justify-content: center; padding: 4rem 1rem; color: var(--dezent); font-size: 1.05rem; }

.tab-sektion { animation: erscheinen .28s ease; }
@keyframes erscheinen { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Bausteine ---------- */
.logo-kreis {
  width: 36px; height: 36px; border-radius: 12px;
  background: linear-gradient(135deg, var(--akzent), var(--akzent-dunkel));
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; flex: none;
}
.logo-kreis.gross { width: 60px; height: 60px; font-size: 1.5rem; border-radius: 18px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: var(--akzent-hell); color: var(--akzent);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .78rem; letter-spacing: .02em;
}
.zelle-person { display: flex; align-items: center; gap: .65rem; }
.karte {
  background: var(--karte); border-radius: var(--radius);
  padding: 1.15rem 1.25rem; margin-top: 1rem; box-shadow: var(--schatten);
}
input, select {
  padding: .7rem .85rem; border: 1.5px solid transparent; border-radius: 12px;
  font-size: .95rem; font-family: inherit; color: var(--tinte);
  background: var(--eingabe); width: 100%; transition: border-color .15s, background .15s;
}
input:focus, select:focus { outline: none; background: var(--karte); border-color: var(--akzent); }
label { display: flex; flex-direction: column; gap: .35rem; font-size: .82rem; font-weight: 600; color: var(--dezent); flex: 1; }
.form-reihe { display: flex; gap: .8rem; align-items: flex-end; flex-wrap: wrap; }

.knopf-primaer {
  background: linear-gradient(135deg, var(--akzent), var(--akzent-dunkel));
  color: #fff; border: none; border-radius: 12px;
  padding: .7rem 1.2rem; font-size: .95rem; font-weight: 700; font-family: inherit;
  cursor: pointer; box-shadow: 0 6px 16px var(--akzent-hell);
  transition: transform .12s, filter .12s;
}
.knopf-primaer:hover { filter: brightness(1.06); }
.knopf-primaer:active { transform: scale(.97); }
.knopf-neutral {
  background: var(--karte); color: var(--tinte); border: 1.5px solid var(--linie); border-radius: 12px;
  padding: .7rem 1.2rem; font-size: .95rem; font-family: inherit; cursor: pointer;
  transition: border-color .15s, transform .12s;
}
.knopf-neutral:active { transform: scale(.97); }
.knopf-gefahr {
  background: none; color: var(--gefahr); border: 1.5px solid currentColor; border-radius: 12px;
  padding: .6rem 1rem; font-size: .9rem; font-family: inherit; cursor: pointer; margin-top: .4rem;
}
.knopf-primaer.gross, .knopf-neutral.gross { padding: .95rem 1.3rem; font-size: 1rem; }
.klein-knopf {
  background: var(--akzent-hell); color: var(--akzent); border: none; border-radius: 10px;
  padding: .45rem .8rem; font-weight: 700; font-family: inherit; cursor: pointer; font-size: .85rem;
}
.breit { width: 100%; margin-top: .4rem; }
.feld-label { font-size: .78rem; font-weight: 700; color: var(--dezent); margin-bottom: .5rem; text-transform: uppercase; letter-spacing: .07em; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.chip {
  border: 1.5px solid var(--linie); background: var(--karte); border-radius: 999px;
  padding: .5rem 1rem; font-size: .85rem; font-family: inherit; color: var(--tinte); cursor: pointer;
  transition: border-color .15s, background .15s, transform .12s;
}
.chip:active { transform: scale(.96); }
.chip.gewaehlt { border-color: var(--akzent); background: var(--akzent-hell); color: var(--akzent); font-weight: 700; }

/* ---------- Anmeldung ---------- */
.auth-buehne {
  display: flex; justify-content: center; align-items: flex-start;
  padding: 3.5rem 1rem;
  background: radial-gradient(1100px 480px at 50% -8%, var(--akzent-hell), transparent), var(--flaeche);
  min-height: 100vh;
}
.auth-karte {
  width: 430px; max-width: 100%; background: var(--karte);
  border-radius: 26px; padding: 2rem 1.7rem; box-shadow: var(--schatten-gross);
}
.auth-kopf { text-align: center; display: flex; flex-direction: column; align-items: center; gap: .45rem; margin-bottom: 1.4rem; }
.auth-tabs { display: flex; gap: .35rem; margin-bottom: 1.2rem; background: var(--eingabe); padding: .3rem; border-radius: 13px; }
.auth-tabs button {
  flex: 1; border: none; background: none; color: var(--dezent);
  padding: .55rem; border-radius: 10px; cursor: pointer; font-size: .88rem; font-family: inherit; font-weight: 600;
  transition: background .15s, color .15s;
}
.auth-tabs button.aktiv { background: var(--karte); color: var(--tinte); box-shadow: 0 2px 8px rgba(15,23,42,.1); }
.auth-form { display: flex; flex-direction: column; gap: .9rem; }
.auth-meldung { margin-top: 1rem; padding: .7rem .9rem; border-radius: 12px; background: rgba(213,66,59,.12); color: var(--gefahr); font-size: .88rem; }
.einladung-hinweis { background: var(--akzent-hell); color: var(--akzent); padding: .8rem 1rem; border-radius: 12px; font-size: .9rem; }

/* ---------- App-Rahmen: heller, ruhiger Kopf ---------- */
.app-kopf {
  position: sticky; top: 0; z-index: 15;
  display: flex; align-items: center; gap: .7rem; padding: .75rem 1.1rem;
  background: var(--glas);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--linie);
}
.betrieb-name { font-weight: 800; letter-spacing: -.01em; }
.kopf-rechts { margin-left: auto; color: var(--dezent); }
.haupt-nav {
  display: flex; gap: .2rem; padding: .4rem .6rem;
  background: var(--glas);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--linie);
}
.haupt-nav button {
  display: flex; flex-direction: column; align-items: center; gap: .18rem;
  border: none; background: none; padding: .5rem .85rem; border-radius: 12px;
  cursor: pointer; color: var(--dezent); white-space: nowrap; font-family: inherit;
  transition: background .15s, color .15s;
}
.haupt-nav .nav-icon { font-size: 1.15rem; line-height: 1; }
.haupt-nav .nav-titel { font-size: .68rem; font-weight: 700; }
.haupt-nav button.aktiv { background: var(--akzent-hell); color: var(--akzent); }

.mehr-menue {
  position: fixed; right: .8rem; bottom: calc(5rem + env(safe-area-inset-bottom));
  background: var(--karte); border-radius: 18px;
  box-shadow: var(--schatten-gross); padding: .45rem; z-index: 30;
  display: flex; flex-direction: column; min-width: 210px;
  animation: erscheinen .18s ease;
}
.mehr-menue button {
  display: flex; flex-direction: row; align-items: center; gap: .75rem;
  border: none; background: none; padding: .8rem 1rem; border-radius: 12px;
  cursor: pointer; color: var(--tinte); font-size: .95rem; font-family: inherit; text-align: left;
}
.mehr-menue button.aktiv { background: var(--akzent-hell); color: var(--akzent); font-weight: 700; }
.mehr-menue .nav-icon { font-size: 1.1rem; }
.app-inhalt { max-width: 860px; margin: 0 auto; padding: 1.4rem 1rem 4rem; }

/* ---------- Dashboard: Stempeln ---------- */
.dash-kopf { margin-bottom: 1rem; }
.dash-gruss { font-size: 1.35rem; font-weight: 400; letter-spacing: -.02em; }
.dash-gruss strong { font-weight: 800; }

.uhr-karte {
  background: var(--karte); border-radius: 22px; padding: 1.6rem 1.2rem 1.4rem;
  box-shadow: var(--schatten); text-align: center;
}
.uhr-status {
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  margin-bottom: 1.2rem; min-height: 2.4rem;
}
.status-punkt {
  width: 10px; height: 10px; border-radius: 50%; background: var(--dezent); flex: none;
  transition: background .2s;
}
.status-punkt.laeuft { background: #22c55e; animation: blinken 1.6s ease-in-out infinite; }
.status-punkt.pausiert { background: #f59e0b; }
@keyframes blinken { 50% { opacity: .35; } }
.uhr-stand { color: var(--dezent); font-variant-numeric: tabular-nums; }
.uhr-stand.laeuft { color: var(--tinte); font-weight: 800; font-size: 2.3rem; letter-spacing: -.02em; line-height: 1; }

.stempel-knopf {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem;
  width: 168px; height: 168px; margin: 0 auto 1rem; border-radius: 50%;
  border: none; font-family: inherit;
  background: linear-gradient(160deg, var(--akzent), var(--akzent-dunkel));
  color: #fff; font-size: 1.1rem; font-weight: 700;
  cursor: pointer; box-shadow: 0 18px 45px var(--akzent-hell), 0 6px 18px rgba(15,23,42,.16);
  transition: transform .12s, box-shadow .2s;
}
.stempel-knopf:disabled { opacity: .55; cursor: wait; }
.stempel-knopf:active { transform: scale(.95); }
.stempel-knopf.laeuft {
  background: linear-gradient(160deg, #d5423b, #a92f29);
  animation: pulsieren 2.2s ease-in-out infinite;
}
@keyframes pulsieren {
  0%, 100% { box-shadow: 0 18px 45px rgba(213,66,59,.25), 0 0 0 0 rgba(213,66,59,.28); }
  50%      { box-shadow: 0 18px 45px rgba(213,66,59,.25), 0 0 0 18px rgba(213,66,59,0); }
}
.stempel-icon { font-size: 1.9rem; }
.pause-knopf {
  display: inline-block; margin: 0 auto 1rem; padding: .6rem 1.4rem;
  border: 1.5px solid var(--linie); border-radius: 999px; background: var(--karte);
  font-size: .92rem; font-weight: 600; font-family: inherit; color: var(--tinte); cursor: pointer;
  transition: transform .12s;
}
.pause-knopf:active { transform: scale(.96); }
.pause-knopf.pausiert { border-color: #f59e0b; background: rgba(245,158,11,.12); color: #b45309; }
.auftrag-wahl { margin: .4rem auto 0; max-width: 440px; }

.statistik-reihe { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin-top: 1rem; }
.stat-kachel {
  background: var(--karte); border-radius: var(--radius); padding: .95rem .6rem .8rem;
  box-shadow: var(--schatten); display: flex; flex-direction: column; align-items: center; gap: .15rem;
}
.stat-wert { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-titel { font-size: .72rem; font-weight: 700; color: var(--dezent); text-transform: uppercase; letter-spacing: .06em; }

.wochen-balken { display: flex; align-items: flex-end; gap: .55rem; height: 90px; padding-top: .4rem; }
.wb-spalte { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .35rem; height: 100%; justify-content: flex-end; }
.wb-balken {
  width: 100%; max-width: 34px; border-radius: 8px 8px 4px 4px; min-height: 4px;
  background: linear-gradient(180deg, var(--akzent), var(--akzent-dunkel));
  transition: height .3s ease;
}
.wb-balken.leer { background: var(--eingabe); }
.wb-tag { font-size: .68rem; font-weight: 700; color: var(--dezent); }
.wb-spalte.heute .wb-tag { color: var(--akzent); }

/* ---------- Listen ---------- */
.zeit-liste, .team-liste, .auftrag-liste, .einladung-liste { list-style: none; display: flex; flex-direction: column; gap: .55rem; padding: 0; }
.zeit-liste li, .team-liste li, .auftrag-liste li, .einladung-liste li {
  background: var(--karte); border-radius: 14px; padding: .8rem 1rem;
  display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap;
  box-shadow: var(--schatten);
}
.zeit-liste li { cursor: pointer; transition: transform .12s; }
.zeit-liste li:active { transform: scale(.985); }
.zl-tag { font-weight: 700; font-size: .9rem; }
.zl-detail { font-size: .8rem; color: var(--dezent); }
.zl-summe { font-weight: 800; color: var(--akzent); white-space: nowrap; font-variant-numeric: tabular-nums; }
.eintrag-form { display: flex; flex-direction: column; gap: .9rem; margin-top: 1rem; max-width: 480px; }

/* ---------- Büro ---------- */
.tabellen-rahmen { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--schatten); }
.ueb-tabelle { width: 100%; min-width: 480px; border-collapse: collapse; background: var(--karte); }
.ueb-tabelle th, .ueb-tabelle td { text-align: left; padding: .75rem 1rem; border-bottom: 1px solid var(--linie); font-size: .92rem; }
.ueb-tabelle tbody tr:last-child td { border-bottom: none; }
.ueb-tabelle th { font-size: .72rem; color: var(--dezent); text-transform: uppercase; letter-spacing: .07em; }
.ueb-tabelle td strong { font-variant-numeric: tabular-nums; }
.badge-laeuft { background: rgba(34,197,94,.14); color: #16a34a; border-radius: 999px; padding: .2rem .65rem; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.monat-wahl { width: auto; }
.export-karte { display: flex; flex-direction: column; gap: 1rem; max-width: 560px; }
.einst-karte { display: flex; flex-direction: column; gap: 1rem; max-width: 480px; }
.schalter-zeile { flex-direction: row !important; align-items: center; gap: .6rem; color: var(--tinte); font-size: .95rem; }
.schalter-zeile input { width: auto; transform: scale(1.35); accent-color: var(--akzent); }
.profil-karte { margin-bottom: 1rem; }

/* ---------- Netz-Banner + Status-Badges ---------- */
.netz-banner {
  background: rgba(245, 158, 11, .15); color: #b45309;
  padding: .5rem 1rem; font-size: .85rem; font-weight: 600; text-align: center;
}
.badge { border-radius: 999px; padding: .2rem .65rem; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.badge-offen { background: rgba(245, 158, 11, .15); color: #b45309; }
.badge-ok { background: rgba(34, 197, 94, .14); color: #16a34a; }
.badge-nein { background: rgba(213, 66, 59, .13); color: var(--gefahr); }

/* ---------- Vergessen-Schutz ---------- */
.vergessen-hinweis {
  background: rgba(245, 158, 11, .13); border-radius: 14px;
  padding: .9rem 1rem; margin-bottom: 1.1rem; text-align: left;
}
.vergessen-hinweis p { font-size: .92rem; font-weight: 600; color: #b45309; margin-bottom: .7rem; }
.vergessen-hinweis .form-reihe { gap: .6rem; }
.vergessen-hinweis button { flex: 1; font-size: .88rem; padding: .6rem .8rem; }

/* ---------- Druck: PDF-Stundenzettel ---------- */
#druckBereich { display: none; }
@media print {
  body > *:not(#druckBereich) { display: none !important; }
  #druckBereich { display: block; }
  body { background: #fff; }
  .druck-seite { page-break-after: always; color: #000; font-size: 12px; padding: 8mm 2mm; }
  .druck-kopf { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2.5px solid #000; padding-bottom: 3mm; margin-bottom: 6mm; }
  .druck-firma { font-size: 17px; font-weight: 800; }
  .druck-titel { font-size: 13px; }
  .druck-person { margin-bottom: 4mm; font-size: 13px; }
  .druck-tabelle { width: 100%; border-collapse: collapse; }
  .druck-tabelle th, .druck-tabelle td { border: 1px solid #999; padding: 1.6mm 2.2mm; text-align: left; font-size: 11px; }
  .druck-tabelle th { background: #eee; font-weight: 700; }
  .druck-summe { margin-top: 4mm; font-size: 13px; font-weight: 800; text-align: right; }
  .druck-unterschriften { display: flex; gap: 14mm; margin-top: 22mm; }
  .druck-unterschriften div { flex: 1; border-top: 1px solid #000; padding-top: 2mm; font-size: 10px; color: #333; }
  .druck-fuss { margin-top: 10mm; font-size: 9px; color: #666; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  background: rgba(15,23,42,.92); color: #fff; padding: .8rem 1.3rem; border-radius: 14px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-size: .9rem; max-width: 90%; box-shadow: var(--schatten-gross); z-index: 50;
  animation: erscheinen .2s ease;
}

/* ---------- Handy ---------- */
@media (max-width: 700px) {
  .haupt-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
    border-top: 1px solid var(--linie); border-bottom: none;
    justify-content: space-around; gap: 0;
    padding: .35rem .2rem calc(.35rem + env(safe-area-inset-bottom));
  }
  .haupt-nav button { padding: .4rem .5rem; flex: 1; max-width: 5.5rem; }
  .app-inhalt { padding-bottom: calc(6.5rem + env(safe-area-inset-bottom)); }
  .kopf-rechts { display: none; }
  .toast { bottom: calc(5.8rem + env(safe-area-inset-bottom)); }
  .auth-buehne { padding: 2rem .9rem; }
  .auth-karte { padding: 1.6rem 1.3rem; }
  .zeile-zwischen h2 { font-size: 1.05rem; }
  .form-reihe { gap: .6rem; }
  .knopf-primaer, .knopf-neutral { padding: .8rem 1.1rem; }
  .statistik-reihe { gap: .6rem; }
  /* Formulare mit vielen Feldern: am Handy untereinander statt gequetscht */
  .form-stapel label { flex: 1 1 100%; }
}
