/* KR Smart – dunkles Design mit rotem Akzent, zuerst fürs Handy gebaut. */

:root {
  color-scheme: dark;
  --bg: #121315;
  --panel: #1a1b1e;
  --panel-2: #202126;
  --line: #2c2d32;
  --text: #f2f1ee;
  --muted: #9a9a9f;
  --accent: #e63946;
  --accent-hover: #f04856;
  --accent-soft: rgba(230, 57, 70, 0.14);
  --green: #3fae5c;
  --green-soft: rgba(63, 191, 111, 0.14);
  --yellow: #d9a23b;
  --yellow-soft: rgba(226, 169, 59, 0.14);
  --blue: #3b82c4;
  --blue-soft: rgba(76, 141, 255, 0.14);
  --radius: 16px;
  --radius-s: 10px;
  --menu-w: 284px;
  --top-h: 60px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
body.dialog-offen, body.menue-offen { overflow: hidden; }
img { max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75rem; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- Rahmen, Menü, Kopfzeile ---------- */

.rahmen { min-height: 100dvh; }
.hauptbereich { min-width: 0; }

.kopfzeile {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  min-height: calc(var(--top-h) + var(--safe-top));
  padding: var(--safe-top) 16px 0;
  background: rgba(18, 19, 21, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.kopf-titel { flex: 1; min-width: 0; font-weight: 700; font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.burger { display: grid; gap: 4px; width: 18px; }
.burger span { display: block; height: 2px; background: currentColor; border-radius: 2px; }

.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--panel-2); border: 1px solid var(--line);
  font-weight: 700; font-size: .9rem; text-decoration: none;
}
.avatar.gross { width: 72px; height: 72px; font-size: 1.5rem; }

.seitenmenue {
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  width: min(var(--menu-w), 86vw);
  display: flex; flex-direction: column;
  background: #0d0e10;
  border-right: 1px solid var(--line);
  padding: calc(12px + var(--safe-top)) 12px calc(12px + var(--safe-bottom));
  overflow-y: auto; overscroll-behavior: contain;
  transform: translateX(-102%);
  transition: transform .22s ease;
}
.menue-offen .seitenmenue { transform: none; }
.schleier { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .55); opacity: 0; pointer-events: none; transition: opacity .2s; }
.menue-offen .schleier { opacity: 1; pointer-events: auto; }
.menue-kopf { display: flex; align-items: center; gap: 10px; padding: 8px 8px 16px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.logo-kachel { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 800; font-size: 15px; }
.marke { display: grid; line-height: 1.2; }
.marke strong { font-size: 1.05rem; }
.marke small { color: var(--muted); font-size: .8rem; }
.angemeldet { display: grid; gap: 2px; padding: 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.angemeldet strong { color: var(--text); font-size: .95rem; }
.seitenmenue ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.seitenmenue a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 12px;
  color: var(--muted); text-decoration: none; font-weight: 600;
}
.seitenmenue a:hover { background: var(--panel-2); color: var(--text); }
.seitenmenue a.aktiv { background: var(--accent); color: #fff; }
.seitenmenue a.spaeter { opacity: .55; }
.menue-icon { width: 26px; flex: none; text-align: center; font-size: 1.2rem; }
.menue-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-badge { flex: none; font-size: .68rem; padding: 2px 7px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); }
.menue-fuss { margin-top: auto; padding: 16px 10px 4px; color: var(--muted); font-size: .8rem; display: grid; gap: 6px; }
.demo-hinweis { color: var(--yellow); }

@media (min-width: 1024px) {
  .seitenmenue { transform: none; }
  .schleier, .kopfzeile .menue-btn { display: none; }
  .hauptbereich { margin-left: var(--menu-w); }
  .seitenmenue { width: var(--menu-w); }
  body.menue-offen { overflow: auto; }
}

.inhalt {
  width: 100%; max-width: 1200px; margin: 0 auto;
  padding: 20px 16px calc(40px + var(--safe-bottom));
  outline: none;
}

.offline-leiste { background: var(--yellow); color: #1b1300; padding: 8px 16px; font-weight: 600; font-size: .9rem; }
.update-leiste {
  position: fixed; left: 16px; right: 16px; bottom: calc(16px + var(--safe-bottom)); z-index: 90;
  border: 0; border-radius: 14px; padding: 14px; background: var(--blue); color: #fff; font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}

/* ---------- Bausteine ---------- */

.karte {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 16px; min-width: 0;
}
.karte-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.karte-kopf h3 { margin: 0; }

.seiten-kopf { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.seiten-kopf > div:first-child { min-width: 0; flex: 1 1 260px; }
.seiten-kopf h1 { overflow-wrap: anywhere; }
.seiten-aktionen { display: flex; flex-wrap: wrap; gap: 8px; }
.untertitel { color: var(--muted); margin: 0; }
.gedimmt { color: var(--muted); font-size: .92rem; }
.vorformatiert { white-space: pre-wrap; overflow-wrap: anywhere; }
.zurueck { display: inline-block; color: var(--muted); text-decoration: none; margin-bottom: 10px; }

.raster-2 { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.raster-2 > .karte, .raster-2 > div > .karte:last-child { margin-bottom: 0; }
.raster-2 { margin-bottom: 16px; }
.raster-2.eng { gap: 12px; margin-bottom: 0; }
.raster-kalender { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) {
  .raster-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .raster-kalender { grid-template-columns: minmax(0, 360px) minmax(0, 1fr); align-items: start; }
}

.raster-kacheln { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 16px; }
@media (min-width: 760px) { .raster-kacheln:not(.zwei) { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.raster-kacheln.zwei { margin-bottom: 0; }
.kachel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; min-width: 0; text-align: left; text-decoration: none; color: inherit;
}
.kachel-knopf { cursor: pointer; }
.kachel-knopf:hover { border-color: #3a3c44; }
.kachel-knopf.aktiv { background: var(--yellow-soft); }
.kachel-zahl { font-size: 1.8rem; font-weight: 800; line-height: 1.1; overflow-wrap: anywhere; }
.kachel-zahl.klein { font-size: 1.3rem; }
.kachel-text { color: var(--muted); font-weight: 600; font-size: .9rem; margin-top: 4px; }
.gruen-rand { border-color: var(--green); }
.gelb-rand { border-color: rgba(226, 169, 59, .5); }
.rot { color: var(--accent); }
.gruen { color: var(--green); }
.gelb { color: var(--yellow); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 16px;
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text);
  font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { border-color: #40434c; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.laedt { position: relative; color: transparent !important; }
.btn.laedt::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: dreh .7s linear infinite;
}
.btn-primaer { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primaer:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-erfolg { background: var(--green); border-color: var(--green); color: #06170d; }
.btn-gefahr { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-gefahr-leise { background: var(--accent-soft); border-color: transparent; color: #ff7b85; }
.btn-klein { min-height: 38px; padding: 7px 12px; font-size: .9rem; }
.btn-voll { width: 100%; }
.btn-riesig { width: 100%; min-height: 64px; font-size: 1.25rem; border-radius: 16px; }
.knopf-reihe { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.links { margin-right: auto; }

.icon-btn {
  display: inline-grid; place-items: center; flex: none;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--panel-2); border: 1px solid var(--line); cursor: pointer; font-size: 1.2rem;
}
.icon-btn.gross { font-size: 1.4rem; font-weight: 700; }
.link { background: none; border: 0; padding: 4px 0; color: #ff7b85; font-weight: 600; cursor: pointer; text-decoration: none; }

.badge {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 99px;
  font-size: .8rem; font-weight: 700; white-space: nowrap;
}
.badge-rot { background: var(--accent-soft); color: #ff7b85; }
.badge-gruen { background: var(--green-soft); color: var(--green); }
.badge-gelb { background: var(--yellow-soft); color: var(--yellow); }
.badge-blau { background: var(--blue-soft); color: #86b0ff; }
.badge-grau { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }

.reiter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip {
  min-height: 40px; padding: 8px 16px; border-radius: 99px;
  background: var(--panel); border: 1px solid var(--line); color: var(--muted);
  font-weight: 700; cursor: pointer;
}
.chip.aktiv { background: var(--accent); border-color: var(--accent); color: #fff; }

.segment { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--panel-2); border-radius: 12px; margin-bottom: 14px; }
.segment button { border: 0; background: none; padding: 9px 4px; border-radius: 9px; font-weight: 700; color: var(--muted); cursor: pointer; }
.segment button.aktiv { background: var(--accent); color: #fff; }

.leer { color: var(--muted); padding: 14px 0; text-align: center; }
.leer-gross { text-align: center; padding: 32px 18px; }
.gross-emoji { font-size: 3rem; margin-bottom: 8px; }
.hinweis-box { background: var(--yellow-soft); color: #f3cf86; border-radius: 12px; padding: 12px; font-size: .9rem; margin-bottom: 16px; }
.hinweis-gelb { color: var(--yellow); font-weight: 600; margin: 12px 0 0; }
.fehler-box { border-color: var(--accent); }

.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: dreh .8s linear infinite; }
.lade-bereich { display: grid; place-items: center; padding: 60px 0; }
@keyframes dreh { to { transform: rotate(360deg); } }

.einfach-liste { list-style: none; margin: 0; padding: 0; }
.einfach-liste > li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.einfach-liste > li:last-child { border-bottom: 0; }
.einfach-liste a { text-decoration: none; display: block; }
.zeile-mit-knoepfen { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; }
.zeile-mit-knoepfen > div:first-child { min-width: 0; flex: 1 1 200px; overflow-wrap: anywhere; }

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

.formular { display: grid; gap: 14px; }
.raster-formular { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) {
  .raster-formular { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .raster-formular .feld-breit { grid-column: 1 / -1; }
}
.feld { display: grid; gap: 6px; min-width: 0; }
.feld label { font-weight: 600; color: var(--muted); font-size: .92rem; }
.pflicht { color: var(--accent); }
.hinweis { color: var(--muted); font-size: .82rem; }
.feld-paar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
input, select, textarea {
  width: 100%; min-width: 0; min-height: 48px;
  padding: 11px 14px; border-radius: 12px;
  background: var(--panel-2); border: 1px solid var(--line);
  outline: none; font-size: 16px; /* verhindert Zoom auf iPhone */
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="date"], input[type="time"], input[type="datetime-local"] { -webkit-appearance: none; appearance: none; }
input::-webkit-date-and-time-value { text-align: left; }
.suche { margin-bottom: 14px; }
.status-text { color: var(--muted); font-size: .9rem; }
.abschnitt-titel { color: var(--accent); text-transform: uppercase; letter-spacing: .03em; font-size: .95rem; margin-bottom: 14px; }
.abschnitt { display: grid; gap: 14px; }
.abschnitt > .abschnitt-titel { margin-bottom: 0; }
details.mehr { margin-top: 14px; }
details.mehr summary { cursor: pointer; color: var(--muted); font-weight: 600; padding: 6px 0; }
details.mehr[open] { display: grid; gap: 12px; }

/* ---------- Login ---------- */

.vollbild { min-height: 100dvh; display: grid; place-items: center; padding: calc(20px + var(--safe-top)) 16px calc(20px + var(--safe-bottom)); }
.login-karte { width: 100%; max-width: 420px; text-align: center; display: grid; gap: 12px; }
.login-karte .formular { text-align: left; }
.login-links { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: center; }
.logo img { border-radius: 16px; }

/* ---------- Dialog & Hinweise ---------- */

.overlay {
  position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .6);
  display: flex; align-items: flex-end; justify-content: center;
}
.dialog {
  width: 100%; max-width: 560px; max-height: 92dvh;
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 20px 20px 0 0;
  padding-bottom: var(--safe-bottom);
  animation: hoch .2s ease;
}
@media (min-width: 640px) {
  .overlay { align-items: center; padding: 20px; }
  .dialog { border-radius: 20px; }
}
@keyframes hoch { from { transform: translateY(30px); opacity: 0; } }
.dialog-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 8px 18px; }
.dialog-kopf h2 { margin: 0; overflow-wrap: anywhere; }
.dialog-inhalt { padding: 6px 18px 12px; overflow-y: auto; }
.dialog-fuss { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding: 12px 18px 16px; border-top: 1px solid var(--line); }

#toast { position: fixed; left: 0; right: 0; top: calc(10px + var(--safe-top)); z-index: 100; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  max-width: 480px; padding: 12px 16px; border-radius: 12px; font-weight: 600;
  background: #23252c; border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  transition: opacity .3s, transform .3s;
}
.toast-ok { border-left: 4px solid var(--green); }
.toast-fehler { border-left: 4px solid var(--accent); }
.toast-hinweis { border-left: 4px solid var(--blue); }
.toast.weg { opacity: 0; transform: translateY(-8px); }

/* ---------- Stempeluhr ---------- */

.uhr-karte { text-align: center; }
.uhr-zeit { font-size: clamp(2.6rem, 12vw, 3.6rem); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.uhr-datum { color: var(--muted); margin-bottom: 16px; }
.stempel-karte { display: grid; gap: 12px; text-align: left; }
.stempel-status { font-weight: 700; display: flex; align-items: center; gap: 8px; justify-content: center; }
.stempel-karte.an .stempel-status { color: var(--green); }
.laufzeit { text-align: center; font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--green); }
.stempel-auftrag { text-align: center; color: var(--muted); }
.puls { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--green); margin-right: 6px; animation: puls 1.6s infinite; }
@keyframes puls { 50% { opacity: .3; } }
.summen { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.summen div { background: var(--panel-2); border-radius: 12px; padding: 12px; display: grid; }
.summen span { color: var(--muted); font-size: .85rem; font-weight: 600; }
.summen strong { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.zeit-liste { list-style: none; margin: 0; padding: 0; }
.zeit-zeile {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.zeit-zeile:last-child { border-bottom: 0; }
.zeit-zeile.klickbar { cursor: pointer; }
.zeit-von-bis { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.zeit-info { display: flex; flex-wrap: wrap; gap: 4px 8px; min-width: 0; font-size: .92rem; overflow-wrap: anywhere; }
.zeit-dauer { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.zeit-dauer.laeuft { color: var(--green); }
@media (max-width: 480px) {
  .zeit-zeile { grid-template-columns: minmax(0, 1fr) auto; }
  .zeit-info { grid-column: 1 / -1; grid-row: 2; }
}
.werkzeugleiste { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 12px; }
.werkzeugleiste .reiter { margin: 0; }
.werkzeugleiste select { width: auto; flex: 1 1 180px; }
.blaettern { display: flex; align-items: center; gap: 10px; }
.blaettern strong { min-width: 0; text-align: center; flex: 1; }
.tag-karte { padding-top: 12px; padding-bottom: 8px; }
.tag-kopf { display: flex; justify-content: space-between; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.stempel-mini { display: grid; gap: 10px; margin-bottom: 0; }
.stempel-mini p { margin: 0; }
.begruessung { margin-bottom: 18px; }

/* ---------- Aufträge ---------- */

.karten-liste { display: grid; gap: 12px; }
.karten-liste > .karte { margin: 0; }
.auftrag-karte { display: block; text-decoration: none; }
.auftrag-karte:hover { border-color: #3a3c44; }
.auftrag-karte-kopf { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.nummer { color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.auftrag-titel { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.auftrag-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: .92rem; }
.info-liste { display: grid; gap: 10px; }
.info-zeile { display: grid; grid-template-columns: minmax(0, 8.5rem) minmax(0, 1fr); gap: 12px; }
.info-zeile > span { overflow-wrap: anywhere; hyphens: auto; }
.info-zeile > span { color: var(--muted); font-weight: 600; font-size: .9rem; }
.info-zeile > div { overflow-wrap: anywhere; }
.info-zeile a { color: #ff9aa2; }
.foto-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 10px; }
.foto-raster .leer { grid-column: 1 / -1; }
.foto { position: relative; padding: 0; border: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 1; background: var(--panel-2); cursor: pointer; }
.foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto-weg { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .7); color: #fff; cursor: pointer; }
.foto-waehler { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.foto-betrachter { display: grid; gap: 10px; }
.foto-gross { width: 100%; max-height: 62dvh; object-fit: contain; background: #000; border-radius: 12px; touch-action: pan-y; }
.foto-navi { display: flex; align-items: center; justify-content: center; gap: 16px; }

/* ---------- Kalender ---------- */

.monat .blaettern { margin-bottom: 12px; }
.monat-raster { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.wtag { color: var(--muted); font-weight: 700; font-size: .8rem; padding-bottom: 6px; }
.tag {
  position: relative; aspect-ratio: 1; border: 0; border-radius: 50%; background: none;
  font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums;
}
.tag:hover { background: var(--panel-2); }
.tag.vergangen { color: #5d6069; }
.tag.heute { background: var(--blue); color: #fff; }
.tag.gewaehlt { outline: 2px solid var(--accent); }
.tag .punkt { position: absolute; bottom: 12%; left: 50%; transform: translateX(-50%); }
.punkt { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.punkt.blau { background: var(--blue); }
.legende { display: flex; gap: 16px; color: var(--muted); font-size: .85rem; margin-top: 12px; }
.termin-liste { display: grid; gap: 12px; }
.termin { background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 10px; }
.termin.erledigt { opacity: .6; }
.termin-kopf { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.termin-kopf strong { overflow-wrap: anywhere; }
.termin-info { display: grid; gap: 4px; color: #d4d6dc; overflow-wrap: anywhere; }

/* ---------- Mietvertrag ---------- */

.unterschrift-box { position: relative; border: 2px dashed #454852; border-radius: 12px; overflow: hidden; background: #fff; }
.unterschrift { display: block; width: 100%; height: 150px; touch-action: none; cursor: crosshair; }
.unterschrift-hinweis { position: absolute; inset: 0; display: grid; place-items: center; color: #777; font-weight: 600; pointer-events: none; text-align: center; padding: 8px; }

/* ---------- Warenbestand ---------- */

.artikel-liste { display: grid; gap: 10px; }
.artikel { display: flex; align-items: center; gap: 12px; margin: 0; padding: 14px; }
.artikel.knapp { border-color: rgba(226, 169, 59, .6); }
.artikel-info { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; overflow-wrap: anywhere; }
.artikel-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .88rem; color: var(--muted); margin-top: 4px; }
.artikel-meta .gelb { font-weight: 700; }
.bestand { display: flex; align-items: center; gap: 6px; flex: none; }
.bestand-zahl { display: grid; text-align: center; min-width: 52px; }
.bestand-zahl strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.bestand-zahl small { color: var(--muted); font-size: .72rem; }
.artikel.knapp .bestand-zahl strong { color: var(--yellow); }

/* ---------- Tabellen, Profil, Team, Dokumente ---------- */

.tabelle-rahmen { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tabelle { width: 100%; border-collapse: collapse; }
.tabelle th, .tabelle td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tabelle th { color: var(--muted); font-size: .85rem; }
.tabelle .zahl { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.profil-karte { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.profil-karte > div:last-child { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.person { display: flex; gap: 12px; align-items: center; }
.anleitung { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.hinweis-karte { border-color: rgba(226, 169, 59, .5); }
.dokument { display: grid; gap: 6px; }
.dokument-titel { font-size: 1.05rem; overflow-wrap: anywhere; }
.dokument .gedimmt { overflow-wrap: anywhere; }

/* ---------- Erweiterungen: Aufträge, Qualität, Lager, Dokumente, Kalkulator ---------- */

.mono { font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace; letter-spacing: .02em; }
.klein { font-size: .85rem; }
.gross-text { font-size: 1.05rem; }
.hinweis.rot, small.rot { color: #ff7b85; }
.hinweis.gruen, small.gruen { color: var(--green); }
.fuss-leiste { margin-top: 4px; }
.feld-paar.plz-ort { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.feld-drei { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.vin-zeile { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.vin-zeile .mono { overflow-wrap: anywhere; }
.foto-kategorien { display: grid; gap: 18px; }
.foto-kategorie h4 { margin: 0; font-size: .95rem; }
.foto-kategorie .karte-kopf { margin-bottom: 0; }
.status-punkt { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); display: inline-block; }
.status-punkt.gruen { background: var(--green); } .status-punkt.rot { background: var(--accent); } .status-punkt.blau { background: var(--blue); }
.zeile-mit-knoepfen select { width: auto; min-height: 38px; padding: 6px 10px; font-size: .9rem; }

/* Checklisten */
.balken { height: 6px; border-radius: 99px; background: var(--panel-2); overflow: hidden; margin: 4px 0 8px; }
.balken span { display: block; height: 100%; background: var(--green); transition: width .2s; }
.checkliste { padding: 12px 0; border-top: 1px solid var(--line); }
.checkliste:first-of-type { border-top: 0; }
.checkliste h4 { margin: 0; font-size: 1rem; }
.check-liste { list-style: none; margin: 0; padding: 0; }
.check-liste li { border-bottom: 1px solid var(--line); }
.check-liste li:last-child { border-bottom: 0; }
.check-punkt { display: flex; gap: 12px; align-items: flex-start; padding: 10px 2px; cursor: pointer; font-weight: 600; }
.check-punkt input { width: 24px; height: 24px; min-height: 0; flex: none; margin: 1px 0 0; accent-color: var(--green); }
.check-punkt small { font-weight: 400; }

/* Reparaturcenter */
.punkt-liste { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: #cfd0d4; }
.schritte { list-style: none; margin: 0; padding: 0; }
.schritte li { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.schritte li:last-child { border-bottom: 0; }
.schritte p { margin: 4px 0 0; }
.schritt-nr { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel-2); color: var(--accent); font-weight: 800; }

/* Lager */
.bestand-gross { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; margin-bottom: 14px; }
.bestand-gross span { color: var(--muted); font-weight: 600; }
.bestand-gross strong { font-size: 2rem; }
.artikel-info { text-decoration: none; color: inherit; }
.import-tabelle { margin-bottom: 16px; }
.tabelle.import { min-width: 760px; }
.tabelle.import td { padding: 6px 4px; }
.tabelle.import input, .tabelle.import select { min-height: 40px; padding: 8px 10px; font-size: 15px; }
.tabelle.import .breit { min-width: 220px; }
.tabelle.import .zahl-feld { width: 84px; text-align: right; }
.tabelle.import .kurz-feld { width: 80px; }
.tabelle.import tr.aus { opacity: .45; }
.tabelle.import input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; }

/* Dokumente */
.dokument.wichtig { border-color: rgba(230, 57, 70, .55); }
.einfach-liste.klein li { padding: 6px 0; }

/* Kundenseite */
.kunden-seite { max-width: 1000px; }
.kunden-kopf { display: flex; align-items: center; gap: 12px; padding: calc(8px + var(--safe-top)) 0 18px; }
.logo-kachel.gross { width: 64px; height: 64px; font-size: 20px; margin: 0 auto; border-radius: 14px; }
.foto-raster.gross { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.kunden-foto { margin: 0; display: grid; gap: 4px; justify-items: start; }
.kunden-foto img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; display: block; }

/* Kalkulator */
.kalkulator { padding-bottom: 90px; }
.kalk-abschnitt { margin-bottom: 26px; }
.kalk-abschnitt.karte { margin-bottom: 26px; }
.kalk-kopf { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.kalk-kopf h2 { margin: 0; font-size: 1.3rem; }
.kalk-nr { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 800; font-family: ui-monospace, Menlo, Consolas, monospace; }
.kalk-raster { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kalk-raster.drei { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 900px) { .kalk-raster:not(.drei) { grid-template-columns: repeat(3, minmax(0, 1fr)); } .kalk-raster.bauteile { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kalk-karte, .kalk-bauteil {
  position: relative; display: grid; gap: 4px; align-content: start; text-align: left;
  padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; min-width: 0;
}
.kalk-karte strong, .kalk-bauteil strong { font-size: 1.02rem; overflow-wrap: anywhere; }
.kalk-karte small { color: var(--muted); }
.kalk-karte.aktiv, .kalk-bauteil.aktiv { border-color: var(--accent); background: rgba(230, 57, 70, .1); box-shadow: 0 0 0 1px var(--accent); }
.kalk-karte.aktiv strong { color: #ff7b85; }
.kalk-karte.mitte { justify-items: center; text-align: center; }
.kalk-icon { font-size: 1.8rem; line-height: 1; margin: 6px 0 4px; }
.kalk-faktor { position: absolute; top: 12px; right: 12px; padding: 2px 8px; border-radius: 8px; background: var(--panel-2); color: var(--muted); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; }
.kalk-faktor.unten { position: static; margin-top: 6px; }
.kalk-karte.aktiv .kalk-faktor { background: var(--accent); color: #fff; }
.lack-punkt { width: 34px; height: 34px; border-radius: 50%; margin-bottom: 6px; box-shadow: 0 0 12px rgba(255, 255, 255, .12); }
.kalk-preis { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--text); font-size: .95rem; }
.kalk-bauteil.aktiv .kalk-preis { color: #ff9aa2; }
.kalk-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.kalk-tabs .chip { flex: none; }
.kalk-zusatz { display: grid; gap: 10px; }
@media (min-width: 760px) { .kalk-zusatz { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kalk-zusatz-karte { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; }
.kalk-zusatz-karte.aktiv { border-color: var(--accent); background: rgba(230, 57, 70, .08); }
.kalk-zusatz-karte input { width: 24px; height: 24px; min-height: 0; flex: none; accent-color: var(--accent); }
.kalk-zusatz-karte div { display: grid; gap: 2px; }
.kalk-zusatz-karte small { color: var(--muted); }
.kalk-summe { border: 1px solid rgba(230, 57, 70, .4); border-radius: 18px; overflow: hidden; background: var(--panel); margin-bottom: 12px; }
.kalk-summe-kopf { display: flex; justify-content: space-between; gap: 10px; padding: 14px 18px; background: var(--accent); color: #fff; font-family: ui-monospace, Menlo, Consolas, monospace; }
.kalk-summe-inhalt { padding: 16px 18px; display: grid; gap: 10px; }
.kalk-summe hr { border: 0; border-top: 1px solid rgba(230, 57, 70, .35); margin: 4px 0; width: 100%; }
.kalk-zeile { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }
.kalk-zeile span:last-child { color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.kalk-zeile.fett { color: var(--text); font-weight: 700; font-size: 1.05rem; }
.kalk-positionen { list-style: none; margin: 0; padding: 0 0 0 10px; display: grid; gap: 4px; font-size: .88rem; color: var(--muted); border-left: 2px solid var(--line); }
.kalk-positionen li { display: flex; justify-content: space-between; gap: 10px; }
.kalk-gesamt { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px; border-radius: 14px; background: var(--accent); color: #fff; font-weight: 700; }
.kalk-gesamt strong { font-size: 1.6rem; font-family: ui-monospace, Menlo, Consolas, monospace; }
.kalk-leiste {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  display: flex; align-items: center; gap: 12px; padding: 10px 16px calc(10px + var(--safe-bottom));
  background: rgba(18, 19, 21, .96); border-top: 1px solid var(--line); backdrop-filter: blur(10px);
}
@media (min-width: 1024px) { .kalk-leiste { left: var(--menu-w); } }
.kalk-leiste .btn { width: auto; flex: none; }
.kalk-status { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kalk-leiste-preis { color: #ff4d5a; font-size: 1.35rem; font-family: ui-monospace, Menlo, Consolas, monospace; white-space: nowrap; }
.punkt.gruen-bg { background: var(--green); } .punkt.grau-bg { background: var(--muted); }
body:has(.kalk-leiste) .update-leiste { bottom: calc(80px + var(--safe-bottom)); }

/* Logo */
.menue-kopf { flex-direction: column; align-items: flex-start; gap: 4px; }
.menue-logo { width: 150px; height: auto; display: block; border-radius: 6px; }
.menue-unter { color: var(--muted); font-size: .8rem; padding-left: 6px; }
.logo img { width: 220px; height: auto; border-radius: 12px; }
.kunden-logo { width: 150px; height: auto; border-radius: 8px; display: block; }
.vollbild .kunden-logo { margin: 0 auto 8px; width: 180px; }

/* Online-Buchung */
.tage-leiste { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.tag-karte-wahl { flex: none; display: grid; justify-items: center; gap: 2px; width: 64px; padding: 10px 4px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); cursor: pointer; }
.tag-karte-wahl strong { font-size: 1.35rem; }
.tag-karte-wahl small { color: var(--muted); font-size: .75rem; }
.tag-karte-wahl.aktiv { background: var(--accent); border-color: var(--accent); }
.tag-karte-wahl.aktiv small { color: #fff; }
.zeiten-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.zeiten-raster .chip { font-variant-numeric: tabular-nums; }
.buchung-fuss { display: grid; gap: 12px; position: sticky; bottom: calc(8px + var(--safe-bottom)); box-shadow: 0 -8px 30px rgba(0, 0, 0, .5); }
.buchung-auswahl { text-align: center; }
.status-karte { display: grid; gap: 12px; justify-items: start; }
.badge.gross { font-size: 1rem; padding: 8px 14px; }

/* Nachrichten */
.nachrichten-liste { list-style: none; margin: 0; padding: 0; }
.nachrichten-liste li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 8px; border-bottom: 1px solid var(--line); border-radius: 10px; }
.nachrichten-liste li:last-child { border-bottom: 0; }
.nachrichten-liste li.neu { background: var(--accent-soft); }
.nachricht-icon { font-size: 1.4rem; flex: none; width: 32px; text-align: center; }
.nachricht-inhalt { flex: 1; min-width: 0; display: grid; gap: 2px; overflow-wrap: anywhere; }
.nachricht-inhalt p { margin: 0; }
.zaehler { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 800; margin-left: auto; }
.glocke { position: relative; text-decoration: none; }
.glocke .zaehler { position: absolute; top: -4px; right: -4px; margin: 0; }

/* Unterschrift & AGB */
.agb-box { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: var(--panel-2); }
.agb-box summary { cursor: pointer; font-weight: 700; }
.agb-text { white-space: pre-wrap; font-size: .85rem; color: #cfd0d4; max-height: 45vh; overflow-y: auto; margin-top: 10px; line-height: 1.5; }
.unterschrift-formular .unterschrift { height: 190px; }
.dialog.breit { max-width: 760px; }

/* Einstellungen */
.speicher-leiste { position: sticky; bottom: calc(10px + var(--safe-bottom)); z-index: 5; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 16px; background: rgba(26, 27, 30, .96); border: 1px solid var(--line); box-shadow: 0 -8px 30px rgba(0, 0, 0, .45); }
.tabelle.editor { min-width: 520px; }
.oeffnung-liste { display: grid; gap: 8px; }
.oeffnung-zeile { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: center; }
.oeffnung-zeile .check-punkt { padding: 4px 0; }

/* ---------- Dashboard (modern) ---------- */
.dashboard { display: grid; gap: 16px; }
.dashboard > .karte, .dashboard > .raster-2 { margin-bottom: 0; }
.hero {
  position: relative; overflow: hidden; display: grid; gap: 18px; padding: 22px;
  border-radius: 22px; border: 1px solid rgba(230, 57, 70, .35);
  background: radial-gradient(120% 140% at 100% 0%, rgba(230, 57, 70, .35) 0%, rgba(230, 57, 70, .08) 45%, rgba(26, 27, 30, 1) 75%), var(--panel);
}
.hero::after { content: ""; position: absolute; right: -40px; bottom: -40px; width: 180px; height: 180px; border-radius: 50%; border: 22px solid rgba(255, 255, 255, .03); }
@media (min-width: 760px) { .hero { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 28px 30px; } }
.hero h1 { font-size: clamp(1.6rem, 6vw, 2.2rem); margin: 2px 0 4px; }
.hero-datum { color: #ffb3b9; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; margin: 0; }
.hero-unter { color: var(--muted); margin: 0; }
.hero-stempel { display: grid; gap: 8px; justify-items: stretch; min-width: 240px; padding: 16px; border-radius: 18px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); position: relative; z-index: 1; }
.hero-stempel.an { border-color: rgba(63, 174, 92, .6); }
.hero-uhr { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; text-align: center; letter-spacing: .02em; }
.hero-status { text-align: center; font-size: .92rem; }
.hero-laufzeit { color: var(--green); font-variant-numeric: tabular-nums; }
.hero-knopf { min-height: 54px; font-size: 1.1rem; border-radius: 14px; }
.schnell-leiste { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.schnell-leiste::-webkit-scrollbar { display: none; }
.schnell {
  flex: none; display: grid; justify-items: center; gap: 6px; width: 92px; padding: 14px 6px;
  border-radius: 18px; border: 1px solid var(--line); background: var(--panel); color: var(--text);
  text-decoration: none; font-weight: 700; font-size: .8rem; cursor: pointer; text-align: center;
}
.schnell:hover { border-color: var(--accent); }
.schnell-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--panel-2); font-size: 1.35rem; }
@media (min-width: 900px) { .schnell-leiste { display: grid; grid-template-columns: repeat(6, 1fr); } .schnell { width: auto; } }
.aufgaben { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.aufgabe { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 12px; border-radius: 14px; background: var(--panel-2); border-left: 4px solid var(--line); }
.aufgabe.rot { border-left-color: var(--accent); }
.aufgabe.gelb { border-left-color: var(--yellow); }
.aufgabe-icon { font-size: 1.3rem; }
.aufgabe-text { flex: 1 1 180px; min-width: 0; display: grid; overflow-wrap: anywhere; }
.alles-gut { display: flex; align-items: center; gap: 14px; }
.alles-gut .gross-emoji { font-size: 2rem; margin: 0; }
.alles-gut p { margin: 0; }
.kpi-raster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 900px) { .kpi-raster { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.kpi { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); text-decoration: none; color: inherit; min-width: 0; }
.kpi:hover { border-color: #3a3c44; }
.kpi-icon { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 12px; background: var(--panel-2); font-size: 1.25rem; }
.kpi-zahl { font-size: 1.45rem; font-weight: 800; line-height: 1.1; overflow-wrap: anywhere; }
.kpi-text { color: var(--muted); font-size: .8rem; font-weight: 600; }
.plan { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.plan-eintrag { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.plan-eintrag:last-child { border-bottom: 0; }
.plan-eintrag time { font-weight: 800; font-variant-numeric: tabular-nums; color: #ff9aa2; }
.plan-eintrag div, .plan-eintrag a { display: grid; min-width: 0; text-decoration: none; overflow-wrap: anywhere; }
.auftrag-zeile { display: flex !important; justify-content: space-between; gap: 10px; align-items: center; }
.auftrag-zeile > div { display: grid; min-width: 0; }
li.ungelesen strong::before { content: "● "; color: var(--accent); }

.zugang-karte { display: grid; gap: 10px; padding: 14px; border-radius: 14px; background: var(--panel-2); border: 1px dashed #4a4c54; }
.zugang-karte > div { display: grid; overflow-wrap: anywhere; }

.kontakt-fuss { text-align: center; margin-top: 8px; line-height: 1.6; }

/* ---------- Formatierter Text (Wissensdatenbank, Schulungen) ---------- */
.text-bloecke { line-height: 1.55; }
.text-bloecke p { margin: 0 0 10px; }
.text-bloecke ul, .text-bloecke ol { margin: 0 0 10px; padding-left: 22px; }
.text-bloecke li { margin: 3px 0; }
.text-bloecke .text-zwischen { margin: 14px 0 6px; font-size: 1rem; }
.text-hinweis { border-left: 4px solid var(--accent); background: var(--accent-soft); padding: 10px 12px; border-radius: 8px; margin: 0 0 10px; font-weight: 600; }

/* ---------- Wissensdatenbank ---------- */
.wissen-kategorie { margin: 22px 0 8px; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.wissen-eintrag { padding: 0; overflow: hidden; margin-bottom: 10px; }
.wissen-eintrag > summary { list-style: none; cursor: pointer; padding: 18px 20px; font-weight: 700; font-size: 1.05rem; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.wissen-eintrag > summary::-webkit-details-marker { display: none; }
.wissen-eintrag > summary::after { content: '›'; font-size: 1.4rem; color: var(--muted); transition: transform .2s; }
.wissen-eintrag[open] > summary::after { transform: rotate(90deg); }
.wissen-antwort { padding: 0 20px 18px; }
.wissen-antwort .knopf-reihe { margin-top: 12px; }

/* ---------- Schulungscenter & Onboarding ---------- */
.schulung-banner { border-color: var(--line); }
.schulung-banner strong { font-size: 1.1rem; display: block; margin-bottom: 4px; }
.schulung-banner.fertig { border-color: rgba(63, 174, 92, .5); background: var(--green-soft); }
.schulung-banner.nicht { border-color: rgba(217, 162, 59, .5); background: var(--yellow-soft); }
.schulung-banner p { margin: 4px 0 0; }
.schulung-karte { display: block; text-decoration: none; color: inherit; }
.schulung-karte:hover { border-color: var(--accent); }
.schulung-karte p { margin: 6px 0; }
.schulung-titel { font-size: 1.1rem; }
.schulung-einheiten { padding-left: 22px; margin: 6px 0 12px; }
.schulung-einheiten li { margin: 6px 0; }
.schulung-einheiten li.gelesen .link { color: var(--muted); }
.schulung-einheit h2 { margin: 10px 0 12px; }
.schulung-navi { justify-content: space-between; margin-top: 16px; }
.pruef-frage { border: 1px solid var(--line); margin: 0 0 12px; }
.pruef-frage legend { font-weight: 700; padding: 0 6px; }
.pruef-frage .check-punkt input { accent-color: var(--accent); }
.schulung-tabelle td, .schulung-tabelle th { white-space: nowrap; }
.onboarding-liste { list-style: none; padding: 0; margin: 0 0 12px; }
.onboarding-schritt { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; margin-bottom: 10px; }
.onboarding-schritt p { margin: 2px 0 0; }
.onboarding-schritt.erledigt .schritt-nr { background: var(--green); color: #fff; }
@media (max-width: 520px) { .onboarding-schritt { grid-template-columns: auto 1fr; } .onboarding-schritt .btn { grid-column: 2; justify-self: start; } }

/* ---------- Änderungsprotokoll ---------- */
.filter-reihe { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.filter-reihe select { flex: 1 1 180px; }
.protokoll-liste { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.protokoll-eintrag { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: var(--radius-s); padding: 10px 14px; }
.protokoll-eintrag.aktion-neu { border-left-color: var(--green); }
.protokoll-eintrag.aktion-geloescht { border-left-color: var(--accent); }
.protokoll-kopf { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; }
.protokoll-felder { margin: 6px 0 0; padding-left: 18px; font-size: .92rem; }
.protokoll-felder li { margin: 2px 0; overflow-wrap: anywhere; }
.alt-wert { color: var(--muted); }
.verlauf summary { cursor: pointer; font-weight: 700; }
.verlauf .protokoll-liste { margin-bottom: 0; }

/* ---------- Übersichtlicheres Menü & untere Leiste (Handy) ---------- */
.menue-gruppe { margin-bottom: 10px; }
.menue-gruppe-titel { padding: 8px 12px 4px; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #6f7076; }
details.menue-gruppe > summary { cursor: pointer; list-style: none; }
details.menue-gruppe > summary::-webkit-details-marker { display: none; }
details.menue-gruppe > summary::after { content: ' ›'; }
details.menue-gruppe[open] > summary::after { content: ' ⌄'; }
.unten-leiste { display: none; }
@media (max-width: 1023px) {
  body.mit-unten { --unten-h: 64px; }
  /* Beim automatischen Scrollen (Eingabefelder, Knöpfe) nichts unter der Leiste verstecken */
  html:has(body.mit-unten) { scroll-padding-bottom: calc(76px + var(--safe-bottom)); }
  .unten-leiste {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 26;
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 4px 4px var(--safe-bottom); background: rgba(13, 14, 16, .97); border-top: 1px solid var(--line); backdrop-filter: blur(10px);
  }
  .unten-leiste a { display: grid; justify-items: center; gap: 1px; padding: 7px 2px 6px; border-radius: 12px; color: var(--muted); text-decoration: none; font-size: .7rem; font-weight: 700; }
  .unten-leiste a.aktiv { color: #fff; background: var(--accent-soft); }
  .unten-leiste a.aktiv .unten-icon { transform: scale(1.1); }
  .unten-icon { position: relative; font-size: 1.35rem; line-height: 1.2; }
  .unten-icon .zaehler { position: absolute; top: -4px; right: -12px; }
  body.mit-unten .inhalt { padding-bottom: calc(40px + var(--unten-h) + var(--safe-bottom)); }
  body.mit-unten .kalk-leiste { bottom: calc(var(--unten-h) + var(--safe-bottom)); padding-bottom: 10px; }
  body.mit-unten .speicher-leiste { bottom: calc(10px + var(--unten-h) + var(--safe-bottom)); }
  body.mit-unten .update-leiste { bottom: calc(16px + var(--unten-h) + var(--safe-bottom)); }
}
.such-reihe { display: flex; gap: 10px; align-items: stretch; }
.such-reihe .suche { flex: 1; min-width: 0; }
.such-reihe .jahr-wahl { flex: none; width: auto; margin-bottom: 12px; }

/* ---------- Arbeitsablauf: Stationen & Endkontrolle ---------- */
.ablauf-karte h3 { margin: 0; }
.ablauf-auswahl { display: grid; gap: 0; margin-bottom: 8px; }
.ablauf-auswahl .check-punkt { padding: 6px 2px; }
.stationen { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 8px; }
.station { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--panel-2); }
.station-nr { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); font-weight: 800; color: var(--muted); }
.station-in_arbeit { border-color: var(--blue); }
.station-in_arbeit .station-nr { background: var(--blue); color: #fff; border-color: var(--blue); }
.station-erledigt { border-color: var(--yellow); }
.station-erledigt .station-nr { background: var(--yellow); color: #1b1300; border-color: var(--yellow); }
.station-ok .station-nr { background: var(--green); color: #fff; border-color: var(--green); }
.station-inhalt { display: grid; gap: 4px; min-width: 0; }
.station-kopf { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.station-kopf strong { flex: 1; min-width: 0; }
.station-notiz { margin: 2px 0; padding: 6px 10px; border-left: 3px solid var(--line); color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.station .knopf-reihe { margin-top: 4px; }
.endkontrolle-kopf { margin-top: 18px; }
.endkontrolle { list-style: none; padding: 0; margin: 6px 0 14px; }
.endkontrolle li { border-bottom: 1px solid var(--line); }
.endkontrolle li.ok span { color: var(--text); }
.fertig-box { display: grid; gap: 2px; padding: 14px; border-radius: var(--radius-s); background: var(--green-soft); border: 1px solid rgba(63, 174, 92, .5); }
.ablauf-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 8px; font-size: .88rem; color: var(--muted); }
.ablauf-zeile .balken.klein { flex: 1 1 100%; height: 4px; margin: 0; }
.ablauf-zeile.gruen { color: var(--green); font-weight: 700; }
.kunden-schritte { padding-left: 20px; margin: 8px 0 0; display: grid; gap: 8px; }
.kunden-schritte li.ok strong { color: var(--green); }

/* ---------- Jahresarchiv ---------- */
.archiv-jahr h2 { margin: 0; }
.archiv-jahr.fehlt { border-color: rgba(230, 57, 70, .6); }
.archiv-dateien { margin: 10px 0; }
.archiv-stand { display: block; margin-top: 6px; min-height: 1.2em; }
.archiv-jahr .btn { white-space: normal; max-width: 100%; text-align: center; }

/* ---------- Foto-Aufnahme: Kamera/Galerie, Rundum-Fotos ---------- */
/* Datei-Feld unsichtbar, aber vorhanden: ein Tipp auf das umgebende <label> öffnet Kamera bzw. Galerie */
.unsichtbar-datei { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); pointer-events: none; }
.foto-waehler { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 10px; }
.foto-knopf { position: relative; cursor: pointer; }
.foto-knopf.gesperrt { opacity: .45; cursor: not-allowed; }
.foto-knopf.laedt, .rundum-feld.laedt { opacity: .6; pointer-events: none; }
.gesperrt-hinweis { color: var(--yellow); font-weight: 700; flex-basis: 100%; }
.rundum { display: grid; gap: 10px; margin: 6px 0 14px; }
.rundum-kopf { display: grid; gap: 6px; }
.rundum-kopf .balken { margin: 0; }
.rundum-raster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rundum-raster.extra { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .rundum-raster { grid-template-columns: repeat(4, minmax(0, 1fr)); } .rundum-raster.extra { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.rundum-zelle { position: relative; }
.rundum-feld {
  position: relative; display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 128px; padding: 10px; text-align: center; cursor: pointer;
  border: 2px dashed var(--line); border-radius: var(--radius-s); background: var(--panel-2); overflow: hidden;
}
.rundum-feld.extra { min-height: 84px; border-style: dotted; }
.rundum-feld.ok { border: 2px solid var(--green); padding: 0; align-content: end; }
.rundum-feld.ok img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.rundum-feld.ok .rundum-titel, .rundum-feld.ok .rundum-status { position: relative; z-index: 1; width: 100%; background: rgba(0, 0, 0, .6); color: #fff; padding: 2px 6px; }
.rundum-feld.ok .rundum-text, .rundum-feld.ok .rundum-symbol { display: none; }
.rundum-symbol { font-size: 1.8rem; }
.rundum-titel { font-weight: 800; }
.rundum-text, .rundum-status { color: var(--muted); font-size: .78rem; }
.rundum-feld.ok .rundum-status { color: #9ef0b4; }
.rundum-galerie { position: absolute; top: 6px; right: 6px; z-index: 2; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: rgba(0, 0, 0, .55); cursor: pointer; font-size: .95rem; }
.schaden-schritt.gesperrt p { opacity: .6; }
.foto { position: relative; }
.foto-marke { position: absolute; left: 4px; bottom: 4px; padding: 1px 6px; border-radius: 6px; background: rgba(0, 0, 0, .65); color: #fff; font-size: .7rem; font-weight: 700; }
.fehlerhaft { border-color: var(--accent) !important; box-shadow: 0 0 0 3px var(--accent-soft); }

/* Live-Anzeige: grün = verbunden, gelb blinkend = wird wiederhergestellt */
.live-punkt { width: 10px; height: 10px; border-radius: 50%; background: var(--green); flex: none; box-shadow: 0 0 0 3px var(--green-soft); }
.live-punkt.getrennt { background: var(--yellow); box-shadow: 0 0 0 3px var(--yellow-soft); animation: live-blinken 1.2s infinite; }
@keyframes live-blinken { 50% { opacity: .35; } }

/* ---------- Rechte pro Mitarbeiter (Team → Rechte & Daten) ---------- */
.rechte-titel { margin: 8px 0 0; }
.rechte-auswahl { display: grid; gap: 14px; }
.rechte-gruppe { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 6px; margin: 0; min-width: 0; }
.rechte-gruppe legend { font-weight: 700; padding: 0 6px; }
.rechte-gruppe-kopf { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; align-items: baseline; }
.rechte-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 0 18px; }
.recht-punkt span { display: grid; gap: 2px; }
.recht-punkt small { font-size: 0.82rem; line-height: 1.35; }
.recht-punkt input:disabled + span { opacity: 0.7; }
.rechte-liste { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }

/* Lager-Kategorien verwalten */
.kategorie-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.kategorie-zeile { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kategorie-zeile input { flex: 1 1 180px; min-width: 0; }
.kategorie-zeile small { min-width: 70px; }
