/* Schriften lokal statt von Google (sonst geht bei jedem Aufruf die IP der Nutzer an Google).
   Albert Sans / Figtree: SIL Open Font License 1.1, Lizenztexte in fonts/OFL-*.txt; Dateien aus @fontsource-variable 5.3.0.
   Bereiche latin + latin-ext (Umlaute, ß, €); unicode-range wie im Fontsource-Paket. */
@font-face { font-family: 'Albert Sans'; font-style: normal; font-display: swap; font-weight: 100 900; src: url(fonts/albert-sans-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Albert Sans'; font-style: normal; font-display: swap; font-weight: 100 900; src: url(fonts/albert-sans-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Figtree'; font-style: normal; font-display: swap; font-weight: 300 900; src: url(fonts/figtree-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Figtree'; font-style: normal; font-display: swap; font-weight: 300 900; src: url(fonts/figtree-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
  /* Farben & Schriften nach www.deralltagsservice.de */
  --navy: #042244; --navy-2: #0a2f5a; --green: #42fd0c; --green-ink: #1f7a05; --pink: #c98b93; --pink-soft: #f4e4e6; --pink-mid: #e5c4c8; --pink-ink: #8c4b55; --pink-deep: #a8636c; --sky: #43affc; --ocean: #0078a8;
  /* Akzent statt Neongrün (Wunsch Kunde 26.10.: Altrosa bleibt, Neongrün raus); --green bleibt definiert, wird aber nicht mehr verwendet */
  --accent: #a8636c; --accent-hover: #8c4b55; --accent-ink: #fff;
  /* Layout 26.10.: ruhiger, mehr Luft, runde Karten ohne Farbstreifen (Vorlage nicht mehr verbindlich) */
  --bg: #f7f4f5; --card: #fff; --ink: #1d2026; --muted: #5f6b7a; --line: #ebe1e3; --line2: #f2ebec; --head: #faf7f8;
  --brand: #042244; --brand-2: #0a2f5a; --brand-soft: #f1e3e5;
  --warn: #b45309; --warn-soft: #fef3c7; --bad: #b42318; --bad-soft: #fee4e2; --ok: #1f7a05; --ok-soft: #e3fbd9;
  --u: #dbeefe; --u-ink: #0060a0; --k: #fee2e2; --k-ink: #b91c1c; --r: #ede9fe; --r-ink: #6d28d9;
  --radius: 12px; --radius-s: 8px; --shadow: 0 1px 2px rgba(4,34,68,.04), 0 4px 14px rgba(4,34,68,.05);
  --focus: 0 0 0 3px rgba(168,99,108,.25);
  --font-head: "Albert Sans", "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-family: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px; color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
[hidden] { display: none !important; }
a { color: var(--brand); }
h1 { font-family: var(--font-head); font-size: 24px; margin: 0; font-weight: 600; color: var(--navy); letter-spacing: -.015em; }
h2 { font-family: var(--font-head); font-size: 17px; margin: 0 0 16px; font-weight: 600; color: var(--navy); }
h3 { font-family: var(--font-head); font-size: 15px; margin: 0 0 12px; font-weight: 600; color: var(--navy); display: flex; align-items: center; gap: 8px; }
h3::before { content: ''; width: 4px; height: 14px; border-radius: 2px; background: var(--pink-deep); flex: 0 0 auto; }

/* Shell */
#shell { display: flex; min-height: 100vh; }
#nav { width: 264px; background: var(--navy); color: #d6e2ee; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; flex-shrink: 0; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 16px 8px; font-family: var(--font-head); font-weight: 600; color: #fff; font-size: 13px; text-align: center; }
.wordmark { display: flex; align-items: center; gap: 8px; text-decoration: none; color: #fff; font-family: var(--font-head); font-size: 21px; font-weight: 500; letter-spacing: -.01em; }
.wordmark b { font-weight: 800; color: var(--pink); }
.wordmark b::after { content: '.'; color: var(--pink-mid); }
.brand #firma { font-size: 12px; font-weight: 500; color: var(--pink-mid); }
.brand .logo-card { background: #fff; border-radius: 6px; padding: 8px 16px; display: flex; align-items: center; justify-content: center; width: 100%; }
.brand .logo-card img { height: 64px; width: auto; display: block; }
.logo { background: var(--pink); color: var(--navy); width: 30px; height: 30px; border-radius: 99px; display: grid; place-items: center; font-size: 15px; }
#nav nav { flex: 1; overflow-y: auto; padding: 4px 12px; }
/* Scrollbalken der Seitenleiste in Altrosa auf Navy statt hellem Systemstandard */
#nav nav { scrollbar-width: thin; scrollbar-color: rgba(201,139,147,.5) transparent; }
#nav nav::-webkit-scrollbar { width: 8px; }
#nav nav::-webkit-scrollbar-track { background: transparent; }
#nav nav::-webkit-scrollbar-thumb { background: rgba(201,139,147,.5); border-radius: 99px; }
#nav nav::-webkit-scrollbar-thumb:hover { background: var(--pink); }
/* Mitarbeiter-Logins: nur Tour & Erfassung und Einstellungen (Passwort); Rechte prüft zusätzlich der Server */
/* „Problem melden“ (meldungen) seit 18.11.2026 für alle Rollen */
body.role-mitarbeiter #nav a[data-r]:not([data-r="tour"]):not([data-r="termine"]):not([data-r="meine-zeiten"]):not([data-r="einstellungen"]):not([data-r="meldungen"]), body.role-mitarbeiter #nav .navlabel { display: none; }
body.role-mitarbeiter #bottomNav a:not([data-r="tour"]):not([data-r="termine"]):not([data-r="meine-zeiten"]) { display: none; }
/* „Meine Zeiten“ (seit 02.11.2026) und „Meine Termine“ (seit 17.11.2026) nur für Mitarbeiter, Teamleitungen und Zugänge mit
   eigenen Einsätzen – das Büro hat die vollständigen Seiten */
body:not(.role-mitarbeiter):not(.role-teamleiter):not(.hat-ma) #nav a[data-r="meine-zeiten"], body:not(.role-mitarbeiter):not(.role-teamleiter):not(.hat-ma) #bottomNav a[data-r="meine-zeiten"],
body:not(.role-mitarbeiter):not(.role-teamleiter):not(.hat-ma) #nav a[data-r="termine"], body:not(.role-mitarbeiter):not(.role-teamleiter):not(.hat-ma) #bottomNav a[data-r="termine"] { display: none; }
/* Neue Version ausgeliefert (app.js versionPruefen) – über der Handy-Leiste, damit es auch dort zu sehen ist */
.neue-version { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 16px;
  padding: 12px 12px 12px 16px; border-radius: 12px; background: var(--card, #fff); box-shadow: 0 10px 30px rgba(0,0,0,.2); border: 1px solid var(--line, #ddd); max-width: calc(100vw - 32px); }
/* Lizenz gesperrt: Hinweis über jeder Seite (Admins sehen alles, ändern nichts) */
#lizenzBanner { margin: 0 0 16px; }
/* Teamleiter: nur die Seiten aus TEAMLEITER_ROUTEN (js/router.js) */
body.role-teamleiter #nav a[data-r]:not([data-r="plan"]):not([data-r="tour"]):not([data-r="termine"]):not([data-r="meine-zeiten"]):not([data-r="kunden"]):not([data-r="warteliste"]):not([data-r="mitarbeiter"]):not([data-r="stunden"]):not([data-r="urlaub"]):not([data-r="einstellungen"]):not([data-r="meldungen"]),
body.role-teamleiter #nav .navgroup[data-g="abr"], body.role-teamleiter #nav .navgroup[data-g="fin"], body.role-teamleiter #nav .navgroup[data-g="verw"], body.role-teamleiter #bottomNav a[data-r=""] { display: none; }
/* Menüeinträge: etwas größer als vorher (Klickfläche 40 px), Zähler rechts */
#nav a[data-r] { display: flex; align-items: center; gap: 12px; padding: 8px 12px; min-height: 38px; border-radius: 10px; color: #d6e2ee; font-family: var(--font-head); font-weight: 500; font-size: 15px; text-decoration: none; margin: 2px 0; position: relative; }
#nav a[data-r] .nt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#nav a[data-r]:hover { background: rgba(255,255,255,.07); color: #fff; }
#nav a[data-r].active { background: var(--accent); color: var(--accent-ink); font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
#nav .ni { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
#nav a.active .ni { opacity: 1; }
.nb { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 99px; background: rgba(255,255,255,.14); color: #fff; font-size: 12px; font-weight: 600; display: inline-grid; place-items: center; }
.nb.warn { background: #d97706; }
.nb.bad { background: #dc2626; }
#nav a.active .nb { background: rgba(255,255,255,.25); }
/* Gruppen mit Überschrift zum Zuklappen */
.navgroup { margin-top: 6px; }
.navlabel { width: 100%; display: flex; align-items: center; justify-content: space-between; background: none; border: 0; min-height: 0; font-family: var(--font-head); font-size: 11px; font-weight: 600; color: rgba(229,196,200,.75); padding: 8px 12px 4px; border-radius: 6px; cursor: pointer; }
.navlabel:hover { background: none; color: var(--pink-mid); }
.navlabel .chev { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.navgroup.zu .chev { transform: rotate(-90deg); }
.navgroup.zu .navitems { display: none; }
/* Fuß: Einstellungen, Benutzer mit Abmelden, Menü schmal/breit */
.navfoot { padding: 8px 12px 12px; border-top: 1px solid rgba(255,255,255,.08); }
.me { padding: 8px 4px 4px 6px; display: flex; align-items: center; font-size: 13px; gap: 12px; color: #fff; }
.me-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.me #meName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
#meRole { font-size: 12px; color: var(--pink-mid); }
.me .link { color: var(--pink-mid); font-size: 13px; }
.me #logout { background: none; border: 0; color: #b9c9d8; min-height: 0; padding: 8px; border-radius: 8px; }
.me #logout:hover { background: rgba(255,255,255,.08); color: #fff; }
/* Einstellungen als Zahnrad neben Abmelden – spart eine Menüzeile */
#nav .me a.me-set { min-height: 0; padding: 8px; margin: 0; flex: 0 0 auto; color: #b9c9d8; }
#nav .me a.me-set .nt { display: none; }
#nav .me a.me-set.active { color: #fff; }
/* Ein-/Ausklappen: runder Knopf auf der Kante zwischen Menü und Inhalt */
#nav { transition: width .18s ease; }
.navrail-btn { position: absolute; right: -14px; top: 64px; z-index: 20; width: 28px; height: 28px; min-height: 0; padding: 0; border-radius: 99px; background: #fff; border: 1px solid var(--line); color: var(--navy); box-shadow: 0 2px 8px rgba(4,34,68,.18); display: grid; place-items: center; opacity: .85; transition: opacity .15s, transform .15s, background .15s; }
.navrail-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .18s; }
#nav:hover .navrail-btn, .navrail-btn:focus-visible { opacity: 1; }
.navrail-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
/* Schmale Symbolleiste: mehr Platz für Planung/Stundentabelle; Namen als Tooltip */
body.navrail #nav { width: 76px; }
body.navrail #nav .nt, body.navrail #nav .chev, body.navrail .brand #firma, body.navrail .wordmark span { display: none; }
body.navrail #nav a[data-r] { justify-content: center; padding: 12px 0; }
body.navrail #nav .nb { position: absolute; top: 2px; right: 6px; min-width: 18px; height: 18px; font-size: 11px; padding: 0 4px; }
body.navrail .navlabel { justify-content: center; padding: 6px 0; }
body.navrail .navlabel::after { content: ''; display: block; width: 22px; height: 1px; background: rgba(255,255,255,.15); }
body.navrail .navgroup.zu .navitems { display: block; }
body.navrail .me { flex-direction: column; padding: 8px 0 0; }
body.navrail .navrail-btn svg { transform: rotate(180deg); }
/* Bereich über dem Seitentitel */
.titlewrap { flex: 1; min-width: 0; }
#crumb { font-family: var(--font-head); font-size: 12px; font-weight: 600; color: var(--pink-deep); min-height: 0; }
#crumb:empty { display: none; }
.avatar { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 99px; background: var(--pink); color: var(--navy); display: grid; place-items: center; font-family: var(--font-head); font-weight: 600; font-size: 12px; }
main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 20px 32px; background: rgba(247,244,245,.92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar h1 { flex: 1; }
#topActions { display: flex; gap: 8px; flex-wrap: wrap; }
#navToggle { display: none; }
#view { padding: 24px 32px 48px; }
/* Übersicht */
.dash-head { margin: 0 0 20px; }
.dash-head h2 { font-size: 22px; margin: 0; }
.dash-head p { margin: 4px 0 0; color: var(--muted); }
/* Übersicht (26.10.): Kopfbereich, Tagesliste + Aufgaben, Kennzahlen, Karten */
.hero { position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; padding: 24px 28px; margin-bottom: 20px; border-radius: 16px; color: #fff; background: var(--navy); box-shadow: 0 8px 24px rgba(4,34,68,.18); }
.hero-txt { position: relative; z-index: 1; }
.hero-date { font-family: var(--font-head); font-size: 12px; font-weight: 600; color: var(--pink-mid); }
.hero h2 { color: #fff; font-size: 27px; margin: 4px 0 6px; letter-spacing: -.015em; }
.hero p { margin: 0; color: #d6e2ee; font-size: 15px; }
.hero-actions { position: relative; z-index: 1; display: flex; gap: 8px; flex-wrap: wrap; }
.hero .hero-btn { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.25); color: #fff; }
.hero .hero-btn:hover { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.4); }
.dash-main { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 20px; margin-bottom: 20px; align-items: start; }
.dash-main > .dash-todo:only-child, .dash-main > [hidden] + .dash-todo { grid-column: 1 / -1; }
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { display: grid; grid-template-columns: 104px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--line2); }
.tl li:last-child { border-bottom: 0; }
.tl li.weg { opacity: .55; }
.tl-zeit { font-family: var(--font-head); font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; }
.tl-wer { display: flex; flex-direction: column; min-width: 0; }
.tl-wer b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.todo > li > a, .todo summary { display: flex; align-items: center; gap: 12px; padding: 12px 12px; border-radius: 10px; background: var(--head); border: 1px solid var(--line2); color: var(--ink); text-decoration: none; cursor: pointer; list-style: none; }
.todo summary::-webkit-details-marker { display: none; }
.todo > li > a:hover, .todo summary:hover { border-color: var(--pink); background: var(--pink-soft); }
.todo-dot { width: 8px; height: 8px; border-radius: 99px; background: var(--pink); flex: 0 0 8px; }
.todo .warn .todo-dot, .todo li.warn .todo-dot { background: #d97706; }
.todo li.bad .todo-dot { background: var(--bad); }
.todo-t { flex: 1; min-width: 0; }
.todo-n { min-width: 26px; height: 22px; padding: 0 8px; border-radius: 99px; background: var(--navy); color: #fff; font-size: 12px; font-weight: 600; display: inline-grid; place-items: center; }
.todo li.bad .todo-n { background: var(--bad); }
.todo li.warn .todo-n { background: #d97706; }
.todo-sub { margin: 8px 0 6px 32px; padding: 0; font-size: 13px; color: var(--muted); }
.todo details > a { margin-left: 32px; font-size: 13px; }
.todo-leer { margin: 4px 0 0; color: var(--ok); font-weight: 600; }
.kpi-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.kpi-s { display: flex; flex-direction: column; gap: 2px; padding: 16px 20px; text-decoration: none; color: inherit; border-right: 1px solid var(--line2); }
.kpi-s:last-child { border-right: 0; }
.kpi-s:hover { background: var(--head); }
.kpi-s.warn { background: var(--warn-soft); }
.kpi-s.warn .v { color: var(--warn); }
.kpi-s .v { font-family: var(--font-head); font-size: 24px; font-weight: 600; color: var(--navy); letter-spacing: -.02em; white-space: nowrap; }
.kpi-s .l { font-size: 13px; color: var(--muted); }
.dash-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 20px; align-items: start; }
#geburtstage td { white-space: nowrap; }
/* Wer am System „Bewegung reduzieren“ eingestellt hat, bekommt das Menü ohne Animation */
@media (prefers-reduced-motion: reduce) { #nav, .navrail-btn, .navrail-btn svg { transition: none; } }
@media (max-width: 1000px) { .dash-main { grid-template-columns: 1fr; } }
/* Einstellungen */
.settabs { margin-bottom: 20px; }
.setpane { max-width: 980px; }

/* Controls */
button, .btn { font: inherit; font-family: var(--font-head); font-weight: 600; border: 1px solid var(--line); background: var(--card); color: var(--navy); padding: 8px 16px; min-height: 38px; border-radius: var(--radius-s); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s; }
button:hover, .btn:hover { border-color: var(--pink); background: var(--pink-soft); }
/* ein Hauptknopf-Stil überall (vorher Navy-eckig und Grün-rund gemischt) */
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; box-shadow: 0 1px 2px rgba(140,75,85,.25); }
#topActions button.primary, #topActions .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
#topActions button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.primary:hover, .btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.danger { color: var(--bad); border-color: #f5c2bd; }
button.danger:hover { background: var(--bad-soft); }
button.link { border: 0; background: none; padding: 0; min-height: 0; color: var(--brand); }
button.link:hover { text-decoration: underline; background: none; }
button.icon { padding: 6px 8px; }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; border: 1px solid #ddd0d3; border-radius: var(--radius-s); padding: 8px 12px; min-height: 38px; background: #fff; color: var(--ink); min-width: 0; transition: border-color .12s, box-shadow .12s; }
input[type=checkbox], input[type=radio] { min-height: 0; accent-color: var(--accent); width: 16px; height: 16px; }
input:hover, select:hover, textarea:hover { border-color: var(--pink); }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
textarea { min-height: 80px; resize: vertical; width: 100%; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #4a5260; font-weight: 600; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); font-weight: 400; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .search { flex: 1; min-width: 200px; max-width: 360px; }
.toolbar .spacer { flex: 1; }
.muted { color: #7a6a6e; }
.small { font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.grid { display: grid; gap: 20px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 20px; }
.kpi { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; position: relative; overflow: hidden; transition: transform .12s, box-shadow .12s; }
.kpi-warn::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.kpi .v { font-family: var(--font-head); font-size: 30px; font-weight: 600; letter-spacing: -.02em; color: var(--navy); }
.kpi:hover { box-shadow: 0 2px 8px rgba(4,34,68,.08); }
.kpi .l { color: var(--muted); font-size: 13px; }
/* Büro-Zahlen auf der Übersicht: kleiner als die Tageszahlen darüber */
.kpis-small .kpi { padding: 16px 16px; flex-direction: row; align-items: baseline; gap: 12px; }
.kpis-small .kpi .v { font-size: 22px; white-space: nowrap; }
.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 1000px) { .two { grid-template-columns: 1fr; } }

/* Tables */
.tablewrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: auto; max-height: calc(100vh - 200px); }
.card .tablewrap { box-shadow: none; border-radius: var(--radius-s); }
table { border-collapse: separate; border-spacing: 0; width: 100%; }
th, td { padding: 12px 12px; border-bottom: 1px solid var(--line2); text-align: left; vertical-align: middle; }
th { position: sticky; top: 0; background: var(--head); border-bottom: 1px solid var(--line); font-family: var(--font-head); font-size: 12px; color: #5b6472; font-weight: 600; z-index: 2; white-space: nowrap; user-select: none; }
tbody tr:last-child td { border-bottom: 0; }
th.sortable { cursor: pointer; }
th.sortable:hover { color: var(--ink); }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td { background: #faf3f4; }
tr.inactive td { color: #98a2b3; }
th.wahl, td.wahl { width: 34px; text-align: center; cursor: default; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.count { color: var(--pink-ink); font-size: 13px; font-weight: 600; }

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--line2); color: var(--muted); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.brand { background: var(--brand-soft); color: var(--navy); }
.badge.pink { background: var(--pink-soft); color: var(--pink-ink); }
.badge.U { background: var(--u); color: var(--u-ink); }
.badge.K { background: var(--k); color: var(--k-ink); }
.badge.R { background: var(--r); color: var(--r-ink); }

/* Stunden-Grid */
.hgrid td, .hgrid th { padding: 0; border-right: 1px solid var(--line2); }
.hgrid th { padding: 8px 6px; text-align: center; }
.hgrid td.name, .hgrid th.name { position: sticky; left: 0; background: #fff; z-index: 1; padding: 6px 12px; min-width: 200px; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hgrid th.name { z-index: 3; background: var(--brand-soft); }
.hgrid input { width: 100%; min-width: 64px; border: 0; border-radius: 0; text-align: right; padding: 8px 8px; background: transparent; font-variant-numeric: tabular-nums; }
.hgrid input:focus { background: #eef7ff; outline: 2px solid var(--sky); outline-offset: -2px; }
.hgrid input.U { background: var(--u); color: var(--u-ink); font-weight: 600; }
.hgrid input.K { background: var(--k); color: var(--k-ink); font-weight: 600; }
.hgrid input.R { background: var(--r); color: var(--r-ink); font-weight: 600; }
.hgrid input.err { background: var(--bad-soft); }
.hgrid td.calc { padding: 8px 12px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; background: #fbf7f8; }
.hgrid td.sum { font-weight: 600; }
.hgrid tfoot td { font-weight: 600; background: var(--pink-soft); color: var(--pink-ink); position: sticky; bottom: 0; }
.pos { color: var(--ok); }
.neg { color: var(--bad); }
.over { color: var(--warn); font-weight: 600; }
.legend { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); }

/* AZK */
.azk input { width: 64px; border: 0; text-align: right; padding: 8px 6px; background: transparent; font-variant-numeric: tabular-nums; border-radius: 0; }
.azk input:focus { background: #fdf5f6; outline: 2px solid var(--accent); outline-offset: -2px; box-shadow: none; }
.azk input.minus { color: var(--bad); }
.azk td.calc.neg { color: var(--bad); }
.azk td { padding: 0; border-right: 1px solid var(--line2); }
.azk td.name, .azk th.name { position: sticky; left: 0; background: #fff; z-index: 1; padding: 6px 12px; white-space: nowrap; min-width: 190px; }
.azk th.name { z-index: 3; background: var(--brand-soft); }
.azk th { text-align: center; padding: 6px; }
.azk td.calc { padding: 6px 12px; text-align: right; font-weight: 600; background: #fbf7f8; color: var(--pink-ink); }
.azk .hint { display: block; font-size: 10px; color: var(--muted); text-align: right; padding: 0 6px 4px; }
.azk td.has-note input { background: #fffbeb; }

/* Kalender */
.cal td, .cal th { padding: 0; text-align: center; border-right: 1px solid var(--line2); min-width: 26px; }
.cal th { padding: 6px 2px; font-size: 11px; }
.cal th.we, .cal td.we { background: #f7eef0; }
.cal th.today { background: var(--accent); color: var(--accent-ink); }
.cal td.name, .cal th.name { position: sticky; left: 0; background: #fff; z-index: 1; text-align: left; padding: 6px 12px; white-space: nowrap; min-width: 190px; }
.cal th.name { z-index: 3; background: var(--brand-soft); }
.cal td.U { background: var(--u); color: var(--u-ink); font-weight: 600; font-size: 11px; }
.cal td.K { background: var(--k); color: var(--k-ink); font-weight: 600; font-size: 11px; }
.cal td.R { background: var(--r); color: var(--r-ink); font-weight: 600; font-size: 11px; }
.cal td.S { background: #fef3c7; color: #92400e; font-weight: 600; font-size: 11px; }
.cal td.F, .badge.F { background: #e0f2fe; color: #075985; font-weight: 600; font-size: 11px; }
/* Feiertag: wie Wochenende hinterlegt, zählt nicht als Arbeitstag */
.cal th.ft, .cal td.ft, .badge.ft { background: #ede9fe; color: #5b21b6; }
.cal td { height: 30px; }

/* Tabs */
.tabs { display: inline-flex; background: #efe6e8; padding: 4px; border-radius: 10px; gap: 2px; }
.tabs button { border: 0; background: none; padding: 6px 16px; min-height: 34px; border-radius: 8px; color: var(--navy); font-weight: 600; }
.tabs button:hover { background: rgba(255,255,255,.6); }
.tabs button.on { background: #fff; color: var(--accent-hover); box-shadow: 0 1px 3px rgba(4,34,68,.12); }

/* Modal */
#modal { position: fixed; inset: 0; background: rgba(4,34,68,.55); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal-card { background: #fff; border-radius: 14px; width: min(760px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 24px 60px rgba(4,34,68,.3); }
/* seit 11.11.2026 (Wunsch Nutzer, Kunde bearbeiten): nie waagerecht scrollen; senkrechte Leiste schmal wie in der Navigation */
.modal-card { overflow-x: hidden; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(201,139,147,.55) transparent; }
.modal-card::-webkit-scrollbar { width: 8px; }
.modal-card::-webkit-scrollbar-track { background: transparent; margin: 16px 0; }
.modal-card::-webkit-scrollbar-thumb { background: rgba(201,139,147,.55); border-radius: 99px; }
.modal-card::-webkit-scrollbar-thumb:hover { background: var(--pink); }
.modal-head { padding: 16px 24px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: #fff; z-index: 2; }
.modal-head button.icon { border: 0; background: none; font-size: 16px; color: var(--muted); }
.modal-head button.icon:hover { background: var(--line2); }
.modal-body { padding: 20px 24px; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; position: sticky; bottom: 0; background: var(--head); }
.modal-foot .left { margin-right: auto; }
/* minmax(0, …) und min-width: 0, weil eine Spalte sonst nie schmaler wird als ihr breitester Inhalt: eine Auswahl ist so
   breit wie ihr längster Eintrag und schob den Dialog über den Rand (11.11.2026) */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 16px; }
.form > * { min-width: 0; }
.form select { width: 100%; text-overflow: ellipsis; }
.form .wide { grid-column: 1 / -1; }
@media (max-width: 640px) { .form { grid-template-columns: minmax(0, 1fr); } }

/* Toast */
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--navy); font-family: var(--font-head); font-weight: 600; color: #fff; padding: 12px 20px; border-radius: 12px; z-index: 100; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: 90vw; }
#toast.err { background: var(--bad); }

/* Auth */
#auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--navy); }
.authcard { background: #fff; border-radius: 16px; padding: 32px; width: min(400px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.3); display: grid; gap: 16px; }
.authcard h1 { font-size: 22px; }
.authcard input { width: 100%; }
.err-text { color: var(--bad); font-size: 13px; }
/* Speicherleiste langer Formulare (seit 10.11.2026, Einstellungen): bleibt beim Blättern unten sichtbar */
.speicherleiste { position: sticky; bottom: 0; z-index: 3; background: var(--card); border-top: 1px solid var(--line2); padding: 12px 0; margin: 12px 0 0; align-items: center; }
.speicherleiste [data-ungespeichert] { color: var(--bad); font-size: 13px; font-weight: 600; }

/* Bars */
.bar { height: 8px; background: var(--pink-soft); border-radius: 99px; overflow: hidden; min-width: 80px; }
.bar > span { display: block; height: 100%; background: var(--pink-deep); border-radius: 99px; }
.bar.over > span { background: var(--warn); }
.progress { display: flex; align-items: center; gap: 12px; }
.progress .bar { flex: 1; height: 10px; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 8px 0; border-bottom: 1px solid var(--line2); display: flex; justify-content: space-between; gap: 12px; }
.list li:last-child { border: 0; }
.report pre { white-space: pre-wrap; background: #f8fafb; padding: 12px; border-radius: 8px; max-height: 300px; overflow: auto; font-size: 12px; }
.dropzone { border: 2px dashed #b9c6d3; border-radius: 12px; padding: 28px; text-align: center; background: #fafcfd; }
.dropzone.drag { border-color: var(--pink); background: var(--pink-soft); }

/* Einsatzplanung */
.week td, .week th { border-right: 1px solid var(--line2); vertical-align: top; }
.week th { text-align: center; }
.week th.today { background: var(--accent); color: var(--accent-ink); }
.week th.we, .week td.we { background: #f7eef0; }
.week td.todaycol { background: #fcf5f6; }
.week td.day { min-width: 128px; height: 58px; cursor: copy; padding: 4px; }
.week td.name, .week th.name { position: sticky; left: 0; background: #fff; z-index: 1; white-space: nowrap; min-width: 170px; }
.week th.name { z-index: 3; background: var(--brand-soft); }
.chip { background: var(--pink-soft); border-left: 4px solid var(--navy); border-radius: 4px; padding: 4px 6px; margin: 2px 0; font-size: 12px; line-height: 1.3; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip:hover { filter: brightness(.96); }
.chip.st-erledigt, .chip-l.st-erledigt { background: #e3fbd9; }
.chip.st-abgesagt, .chip-l.st-abgesagt { background: #f1f3f5; color: #98a2b3; text-decoration: line-through; }
.chip.st-ausgefallen, .chip-l.st-ausgefallen { background: #fff1e6; color: #b54708; text-decoration: line-through; }
.chip.conflict, .chip-l.conflict { outline: 2px solid var(--bad); }
.chip.unassigned { border-left-color: var(--pink-deep); background: var(--pink-mid); }
.chip.st-geplant { cursor: grab; }
/* Druckvorschau (Rechnungen, Mahnungen, Leistungsnachweise) als Overlay über der App */
.druck { position: fixed; inset: 0; z-index: 900; display: flex; flex-direction: column; background: #e9edf2; }
.druck-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 1px 6px rgba(4,34,68,.08); }
.druck-titel { font-size: 15px; }
.druck-hinweis { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 4px 12px; font-size: 13px; }
.druck iframe { flex: 1; width: 100%; border: 0; background: #e9edf2; }
/* Auswahl durch Eintippen (seit 11.11.2026 ein Feld, js/listen.js auswahlSuche): die eigentliche Auswahl hält nur den Wert.
   Nicht display:none – sie bleibt im Formular und für automatische Tests bedienbar, ist aber weder sichtbar noch anklickbar */
.auswahl-versteckt { position: absolute; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; opacity: 0; pointer-events: none; overflow: hidden; }
.toolbar .auswahl-wrap { width: 210px; max-width: 100%; }
/* Eigene Vorschlagsliste (vorschlagListe, statt <datalist>, das Handys nicht als Liste zeigen); Aussehen wie die Suche oben */
.auswahl-wrap { position: relative; display: block; min-width: 0; }
.auswahl-wrap > input { width: 100%; }
.auswahl-liste { position: absolute; top: calc(100% + 4px); left: 0; right: 0; min-width: 220px; max-height: 260px; overflow-y: auto; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(4,34,68,.22); z-index: 60; font-weight: 400; }
.auswahl-eintrag { padding: 8px 12px; border-radius: 8px; cursor: pointer; color: var(--ink); font-size: 14px; }
.auswahl-eintrag.an, .auswahl-eintrag:hover { background: var(--pink-soft); }
.auswahl-leer { padding: 8px 12px; color: var(--muted); font-size: 13px; }
/* Kosten und Budget des Termins im Einsatz-Dialog (09.11.2026, js/einsatz-dialog.js terminBudgetHtml) */
.budget-box { margin-top: 12px; line-height: 1.6; }
/* Einzeldruck je Rechnung (06.11.2026): Liste mit Knöpfen Rechnung / Leistungsnachweis, Druckdokument unsichtbar */
.druck-liste { max-height: 30vh; overflow: auto; background: #fff; border-bottom: 1px solid var(--line); padding: 4px 16px; }
.druck-doc { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.druck-doc:last-child { border-bottom: 0; }
.druck iframe.druck-einzel { position: absolute; width: 1px; height: 1px; flex: none; opacity: 0; pointer-events: none; }
.week td.day.drop { outline: 2px dashed var(--accent); outline-offset: -3px; background: var(--pink-soft); }
.week td.day.nodrop { outline: 2px dashed var(--bad); outline-offset: -3px; background: var(--bad-soft); cursor: not-allowed; }
.chip-l { display: inline-block; padding: 1px 8px; border-radius: 4px; background: var(--pink-soft); font-size: 11px; margin-right: 4px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 99px; margin-right: 6px; vertical-align: middle; }
.tour { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.tourcard { border-left: 5px solid var(--pink); }
.tourcard.st-erledigt { border-left-color: var(--ok); }
.tourcard .tt { display: flex; gap: 8px; align-items: center; }
.tourcard .time { font-family: var(--font-head); font-weight: 600; font-size: 18px; color: var(--navy); margin-right: auto; }
.tourcard a { text-decoration: none; line-height: 1.7; }
.sigpad { width: 100%; height: 170px; border: 2px dashed #b9c6d3; border-radius: 6px; background: #fff; display: block; cursor: crosshair; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tchip { border-radius: 99px; padding: 4px 12px; font-weight: 500; }
.tchip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.warnbox { background: var(--warn-soft); border-color: #f5d48a; margin-bottom: 20px; padding: 12px 16px; box-shadow: none; }
/* Ansicht als Rolle (seit 01.12.2026): Text links, „Ansicht beenden“ rechts, am Handy untereinander */
.ansicht-balken { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.ansicht-balken span { flex: 1 1 200px; }
.kpi-warn::before { background: var(--bad); }
.kpi-warn .v { color: var(--bad); }
td.neg { color: var(--bad); }

/* Vorführversion */
.demobar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: var(--accent); color: var(--accent-ink); padding: 8px 28px; font-family: var(--font-head); font-size: 13px; }
.demobar button { background: var(--navy); color: #fff; border-color: var(--navy); border-radius: 99px; padding: 4px 16px; }
.flow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 24px; }
.flow.small3 { grid-template-columns: repeat(3, 1fr); margin-bottom: 8px; }
.fstep { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 16px 12px; border: 1px solid var(--line); border-top: 4px solid var(--navy); border-radius: 6px; background: #fff; text-decoration: none; color: var(--ink); font-size: 13px; }
.fstep:hover { border-top-color: var(--accent); box-shadow: 0 4px 14px rgba(4,34,68,.1); }
.fstep b { font-family: var(--font-head); color: var(--navy); font-size: 14px; }
.fstep span:last-child { color: var(--muted); }
.flow.small3 .fstep .fn { background: var(--pink-deep); color: #fff; }
.flow.small3 .fstep { border-top-color: var(--pink-ink); }
.fstep .fn { width: 28px; height: 28px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 600; font-family: var(--font-head); }
.fstep:not(:last-child)::after { content: '→'; position: absolute; right: -19px; top: 44%; font-size: 18px; color: var(--navy); font-weight: 600; }
@media (max-width: 1200px) { .flow { grid-template-columns: repeat(4, 1fr); } .fstep::after { display: none; } }
#demoTour { position: fixed; right: 20px; bottom: 20px; width: min(400px, calc(100vw - 32px)); background: #fff; border-radius: 8px; border-top: 5px solid var(--pink-deep); box-shadow: 0 16px 48px rgba(4,34,68,.35); z-index: 60; padding: 16px 16px; }
#demoTour .dt-hint { display: none; font-weight: 400; text-transform: none; letter-spacing: 0; }
@media (max-width: 860px) { #demoTour .dt-hint { display: inline; } }
#demoTour .dt-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); font-family: var(--font-head); font-weight: 600; }
#demoTour h3 { text-transform: none; letter-spacing: 0; font-size: 17px; margin: 6px 0 8px; }
#demoTour .dt-body { font-size: 14px; line-height: 1.5; max-height: 42vh; overflow: auto; }
#demoTour .dt-foot { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
#demoTour .dt-dots { flex: 1; display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }
#demoTour .dt-dots i { width: 7px; height: 7px; border-radius: 99px; background: var(--line); }
#demoTour .dt-dots i.on { background: var(--pink-deep); }

@media (max-width: 860px) {
  :root { font-size: 15px; }
  #nav { position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; width: min(300px, 84vw); height: 100dvh; box-shadow: none; }
  body.navopen #nav { transform: none; box-shadow: 0 0 0 100vmax rgba(4,34,68,.5); }
  #nav nav { padding-bottom: 24px; }
  #nav a[data-r] { padding: 12px 12px; font-size: 15px; }
  /* Handy: Menü ist eine Schublade – schmale Leiste dort nicht sinnvoll */
  body.navrail #nav { width: min(300px, 84vw); }
  body.navrail #nav .nt, body.navrail .brand #firma, body.navrail .wordmark span { display: initial; }
  body.navrail #nav a[data-r] { justify-content: flex-start; padding: 12px 12px; }
  .navrail-btn { display: none; }
  .hero { padding: 20px; border-radius: 14px; }
  .hero h2 { font-size: 22px; }
  .hero-actions { width: 100%; }
  .hero-actions > * { flex: 1 1 auto; }
  .tl li { grid-template-columns: 1fr auto; }
  .tl-zeit { grid-column: 1 / -1; }
  .kpi-s { border-right: 0; border-bottom: 1px solid var(--line2); }
  .dash-cards { grid-template-columns: 1fr; }
  #crumb { display: none; }
  main { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .speicherleiste { bottom: calc(64px + env(safe-area-inset-bottom)); }
  .topbar { flex-wrap: wrap; padding: 8px 12px; gap: 8px; position: sticky; top: 0; }
  .topbar h1 { font-size: 17px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #navToggle { display: none; } /* Menü über die untere Leiste */
  #topActions button, #topActions .btn { padding: 8px 12px; min-height: 36px; font-size: 14px; }
  /* umbrechen statt seitlich wischen (04.11.2026): beim Wischen sah der letzte Knopf abgeschnitten aus, ohne Hinweis auf mehr */
  #topActions { flex: 0 0 100%; order: 3; display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 2px; }
  #topActions:empty { display: none; }
  #topActions::-webkit-scrollbar { display: none; }
  #topActions > * { flex: 0 0 auto; }
  #view { padding: 12px 12px 24px; }
  .toolbar { gap: 8px; margin-bottom: 12px; }
  .toolbar .search { min-width: 0; flex: 1 1 100%; max-width: none; }
  .toolbar .legend { display: none; }
  .toolbar > select, .toolbar > input:not(.search) { flex: 1 1 40%; min-width: 0; }
  .tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; flex: 0 0 auto; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { white-space: nowrap; padding: 8px 12px; }
  input, select, textarea, button, .btn { font-size: 16px; } /* verhindert Auto-Zoom auf iOS */
  button, .btn { padding: 12px 16px; min-height: 42px; }
  button.icon { min-width: 42px; }
  label.check { min-height: 42px; }
  .card { padding: 16px; }
  .kpis { grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 12px; }
  .kpi .v { font-size: 24px; }
  .kpi .l { font-size: 12px; }
  .grid { gap: 12px; }
  .tablewrap { max-height: none; border-radius: 6px; }
  th, td { padding: 8px 8px; font-size: 14px; }
  .hgrid input { min-width: 58px; padding: 12px 6px; }
  .hgrid td.name, .hgrid th.name { min-width: 140px; max-width: 160px; }
  .azk td.name, .azk th.name, .cal td.name, .cal th.name, .week td.name, .week th.name { min-width: 130px; }
  .week td.day { min-width: 110px; }
  .modal-card { width: 100%; max-height: 100dvh; height: 100dvh; border-radius: 0; border-top-width: 6px; }
  #modal { padding: 0; place-items: stretch; }
  .modal-head { padding: 12px 16px; }
  .modal-body { padding: 16px; }
  .modal-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .modal-foot button { flex: 1 1 auto; }
  .modal-foot .left { flex-basis: 100%; margin-right: 0; order: 9; }
  .form { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .tour { grid-template-columns: 1fr; }
  .tourcard .time { font-size: 20px; }
  .tourcard .toolbar button { flex: 1; }
  .sigpad { height: 200px; }
  .chips { gap: 8px; }
  .tchip { padding: 8px 16px; }
  #toast { bottom: calc(76px + env(safe-area-inset-bottom)); width: calc(100vw - 32px); text-align: center; }
  .me { padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
  .topbar { background: #fff; }
  .settabs { display: flex; }
  .flow, .flow.small3 { grid-template-columns: 1fr; gap: 12px; }
  .fstep::after { display: none; }
  /* Demo */
  .demobar { padding: 4px 12px; font-size: 11px; gap: 6px; flex-wrap: nowrap; }
  .demobar > b { font-size: 11px; white-space: nowrap; }
  .demobar > span:not(.spacer) { display: none; }
  .demobar button { padding: 4px 8px; font-size: 12px; min-height: 28px; white-space: nowrap; }
  #demoTour { right: 8px; left: 8px; bottom: calc(68px + env(safe-area-inset-bottom)); width: auto; padding: 12px 12px; }
  #demoTour h3 { font-size: 15px; margin: 4px 0 6px; }
  #demoTour .dt-body { font-size: 13px; max-height: 22vh; line-height: 1.4; }
  #demoTour h3 { display: none; }
  #demoTour .dt-head { font-size: 11px; }
  #demoTour .dt-foot { margin-top: 12px; }
  #demoTour .dt-dots { display: none; }
  #demoTour.min .dt-body, #demoTour.min .dt-foot, #demoTour.min h3 { display: none; }
  #demoTour .dt-head { cursor: pointer; }
  /* Untere Navigation */
  body.app #bottomNav { display: flex; }
}
#bottomNav { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--navy); border-top: 1px solid rgba(255,255,255,.08); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
#bottomNav a, #bottomNav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; color: #b9c9d8; text-decoration: none; font-size: 11px; font-family: var(--font-head); font-weight: 600; background: none; border: 0; padding: 4px 0; min-height: 0; border-radius: 8px; }
#bottomNav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#bottomNav .active { color: var(--pink-mid); }
#bottomNav { border-top: 2px solid var(--pink-deep); }
@media (min-width: 861px) { #bottomNav { display: none !important; } }

@media print {
  #nav, .topbar #topActions, .toolbar, #navToggle { display: none !important; }
  .tablewrap { max-height: none; overflow: visible; box-shadow: none; }
  body { background: #fff; }
}

/* ---------- Dunkelmodus (Einstellungen → Mein Konto → Darstellung; je Gerät) ----------
   Nur am Bildschirm – gedruckt wird immer hell. Überschreibt die Farbwerte oben und die Regeln mit festen hellen Farben.
   Bewusst hell bleiben: Unterschriftenfeld (Unterschrift dunkel auf Weiß) und die Rechnungsvorschau (Papier). */
@media screen {
  :root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #12161d; --card: #1b2029; --ink: #e4e7ec; --muted: #9aa3b2; --line: #2d3440; --line2: #252b35; --head: #20262f;
    --brand: #9cc0ea; --brand-soft: #33262b;
    --pink: #8a5c63; --pink-soft: #33262b; --pink-mid: #e5c4c8; --pink-ink: #e8b3ba;
    --accent: #b0707a; --accent-hover: #c2858e;
    --warn: #f0a94b; --warn-soft: #3a2e14; --bad: #f2867f; --bad-soft: #3d1f1d; --ok: #7bd463; --ok-soft: #1d3319;
    --u: #13304a; --u-ink: #8cc4f0; --k: #3d1d1d; --k-ink: #f19a9a; --r: #2b2547; --r-ink: #c4b5fd;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 14px rgba(0,0,0,.25); --focus: 0 0 0 3px rgba(194,133,142,.35);
  }
  [data-theme="dark"] body { background: var(--bg); }
  [data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3 { color: #eef1f5; }
  /* Texte, die oben direkt Dunkelblau (--navy) nutzen – im Dunkeln sonst unlesbar */
  [data-theme="dark"] .tl-zeit, [data-theme="dark"] .tourcard .time { color: #9cc0ea; }
  [data-theme="dark"] .kpi-s .v, [data-theme="dark"] .kpi .v, [data-theme="dark"] .fstep b, [data-theme="dark"] .fstep:not(:last-child)::after { color: #eef1f5; }
  [data-theme="dark"] .badge.brand { color: #cfe0f5; }
  [data-theme="dark"] .tabs button { color: #dfe5ee; }
  [data-theme="dark"] #nav, [data-theme="dark"] #bottomNav { background: #0b1626; }
  [data-theme="dark"] button, [data-theme="dark"] .btn { color: #dfe5ee; }
  [data-theme="dark"] button.primary, [data-theme="dark"] .btn.primary { color: #fff; }
  [data-theme="dark"] button.danger { color: var(--bad); border-color: #6b2b27; }
  [data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea { background: #12161d; border-color: #39414e; color: var(--ink); }
  [data-theme="dark"] label { color: #b8c0cc; }
  [data-theme="dark"] label.check { color: var(--ink); }
  [data-theme="dark"] .muted { color: #9aa3b2; }
  [data-theme="dark"] th { color: #aab3c0; }
  [data-theme="dark"] tbody tr.click:hover td { background: #262d38; }
  [data-theme="dark"] tr.inactive td { color: #6b7482; }
  [data-theme="dark"] .hgrid td.name, [data-theme="dark"] .hgrid th.name, [data-theme="dark"] .azk td.name, [data-theme="dark"] .azk th.name,
  [data-theme="dark"] .cal td.name, [data-theme="dark"] .cal th.name, [data-theme="dark"] .week td.name, [data-theme="dark"] .week th.name { background: var(--card); }
  [data-theme="dark"] .hgrid input:focus { background: #1b2a3b; }
  [data-theme="dark"] .hgrid td.calc, [data-theme="dark"] .azk td.calc { background: #20262f; }
  [data-theme="dark"] .azk input:focus { background: #2a2025; }
  [data-theme="dark"] .azk td.has-note input { background: #3a3214; }
  [data-theme="dark"] .cal th.we, [data-theme="dark"] .cal td.we, [data-theme="dark"] .week th.we, [data-theme="dark"] .week td.we { background: #1e2128; }
  [data-theme="dark"] .week td.todaycol { background: #2a2227; }
  [data-theme="dark"] .cal td.S { background: #3a2f12; color: #f6c56b; }
  [data-theme="dark"] .cal td.F, [data-theme="dark"] .badge.F { background: #10304a; color: #8cc8f5; }
  [data-theme="dark"] .cal th.ft, [data-theme="dark"] .cal td.ft, [data-theme="dark"] .badge.ft { background: #2b2547; color: #c4b5fd; }
  [data-theme="dark"] .tabs { background: #222831; }
  [data-theme="dark"] .tabs button:hover { background: rgba(255,255,255,.06); }
  [data-theme="dark"] .tabs button.on { background: #2f3642; color: #f0c4ca; }
  [data-theme="dark"] .modal-card, [data-theme="dark"] .modal-head, [data-theme="dark"] .authcard, [data-theme="dark"] .druck-bar, [data-theme="dark"] .druck-liste,
  [data-theme="dark"] .fstep, [data-theme="dark"] #demoTour, [data-theme="dark"] .topbar, [data-theme="dark"] .navrail-btn { background: var(--card); }
  [data-theme="dark"] .navrail-btn { color: #dfe5ee; }
  [data-theme="dark"] .report pre { background: #12161d; }
  [data-theme="dark"] .dropzone { background: #161b22; border-color: #3a424f; }
  [data-theme="dark"] .chip.st-erledigt, [data-theme="dark"] .chip-l.st-erledigt { background: #1d3319; }
  [data-theme="dark"] .chip.st-abgesagt, [data-theme="dark"] .chip-l.st-abgesagt { background: #22262d; color: #6b7482; }
  [data-theme="dark"] .chip.st-ausgefallen, [data-theme="dark"] .chip-l.st-ausgefallen { background: #3a2414; color: #f0a35e; }
  [data-theme="dark"] .chip { color: var(--ink); }
  [data-theme="dark"] .chip.unassigned { background: #4a3138; }
  [data-theme="dark"] .warnbox { border-color: #6b5317; }
  [data-theme="dark"] .druck, [data-theme="dark"] .druck iframe { background: #0f1318; }
  [data-theme="dark"] .sigpad { background: #fff; }
}

/* ---------- Gerüst mit Farbverlauf (Entwurf F, 29.10.; seit 03.12.2026 einfarbig, Verläufe wirkten unruhig) ----------
   Navy → Altrosa als Fläche hinter Menü und Kopfzeile; der Inhalt liegt auf einem hellen Blatt, damit alle Seiten
   (Listen, Tabellen, Hinweistexte) ohne eigene Anpassung lesbar bleiben. Nur Bildschirm ab Tablet-Breite –
   Handy behält die weiße Kopfzeile, gedruckt wird ohne Verlauf. */
@media screen and (min-width: 861px) {
  :root { --verlauf: #042244; }
  :root[data-theme="dark"] { --verlauf: #07111f; }
  /* fixed: Menü, Kopfzeile und Hintergrund zeigen denselben Ausschnitt des Verlaufs – keine sichtbaren Kanten */
  #shell { background: var(--verlauf) fixed; }
  #nav, [data-theme="dark"] #nav { background: transparent; border-right: 1px solid rgba(255,255,255,.07); }
  .topbar, [data-theme="dark"] .topbar { background: var(--verlauf) fixed; backdrop-filter: none; border-bottom: 1px solid rgba(255,255,255,.08); padding: 16px 28px; }
  .topbar h1, [data-theme="dark"] .topbar h1 { color: #fff; }
  #crumb { color: var(--pink-mid); }
  #topActions button:not(.primary), #topActions .btn:not(.primary) { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.25); color: #fff; }
  #topActions button:not(.primary):hover, #topActions .btn:not(.primary):hover { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.4); }
  #topActions select, #topActions input { background: rgba(255,255,255,.95); }
  /* Inhalt als helles Blatt auf dem Verlauf */
  #view { flex: 1; margin: 0 20px 20px 16px; padding: 24px 28px 40px; background: var(--bg); border-radius: 16px; box-shadow: 0 12px 32px rgba(0,0,0,.18); }
  /* schmale Symbolleiste: Knopf zum Ausklappen dezent auf dem Verlauf */
  .navrail-btn, [data-theme="dark"] .navrail-btn { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.25); color: #fff; backdrop-filter: blur(6px); }
}
@media screen and (min-width: 861px) {
  /* Hintergrund unter dem Gerüst dunkel, falls der Inhalt länger als das Fenster ist */
  body { background: #0d3560; }
  [data-theme="dark"] body { background: #0b1f38; }
  /* Übersicht wie Entwurf F: kein Blatt, Kennzahlen durchscheinend auf dem Verlauf, Karten in warmem Altweiß
     (reines Weiß wirkte auf dem Verlauf zu hart) */
  #view:has(> .dash-kpis) { background: transparent; box-shadow: none; padding-top: 16px; }
  #view > .dash-kpis .kpi-s { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); color: #fff; }
  #view > .dash-kpis .kpi-s:hover { background: rgba(255,255,255,.14); }
  #view > .dash-kpis .kpi-s .v { color: #fff; }
  #view > .dash-kpis .kpi-s .l { color: #b9c9d8; }
  #view > .dash-kpis .kpi-ic { background: rgba(201,139,147,.22); color: var(--pink-mid); }
  #view > .dash-kpis .kpi-s.warn .kpi-ic { background: rgba(217,119,6,.25); color: #fbbf24; }
  #view:has(> .dash-kpis) .card { background: rgba(250,246,247,.94); border-color: rgba(255,255,255,.45); backdrop-filter: blur(8px); box-shadow: 0 10px 30px rgba(0,0,0,.18); }
  [data-theme="dark"] #view:has(> .dash-kpis) .card { background: rgba(27,32,41,.88); border-color: rgba(255,255,255,.06); }
  .topbar .title-datum { color: var(--pink-mid); }
}

/* ---------- Übersicht (29.10., Entwurf A/F): Kennzahl-Kacheln, Tagesplan als Zeitleiste, rechte Spalte ---------- */
.title-datum { font-family: var(--font-head); font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--muted); margin-left: 16px; }
.dash-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; background: none; border: 0; box-shadow: none; overflow: visible; }
.dash-kpis .kpi-s { flex-direction: row; align-items: center; gap: 12px; padding: 12px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.dash-kpis .kpi-s:last-child { border-right: 1px solid var(--line); }
.dash-kpis .kpi-s > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.dash-kpis .kpi-s .v { font-size: 22px; }
.kpi-ic { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 10px; display: grid; place-items: center; background: var(--pink-soft); color: var(--pink-deep); }
.kpi-ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dash-kpis .kpi-s.warn .kpi-ic { background: var(--warn-soft); color: var(--warn); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.dash-links, .dash-seite { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dash-unten { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.dash-scroll { max-height: 300px; overflow: auto; }
.dash-summe { display: flex; gap: 20px; flex-wrap: wrap; margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.dash-summe b { color: var(--ink); }
.gb-liste { list-style: none; margin: 0; padding: 0; }
.gb-liste li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line2); }
.gb-liste li:last-child { border-bottom: 0; }
.gb-wer, .gb-wann { display: flex; flex-direction: column; min-width: 0; }
.gb-wer b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gb-wann { flex: 0 0 auto; text-align: right; }
/* Zeitleiste: Spalte Name 170 px, Rest = Stunden; Linien über --std (Anzahl Stunden) */
.zl-kopf { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.zl-kopf h3 { margin: 0; }
.zl-kopf .spacer { flex: 1; }
.zl-kopf select { min-height: 32px; padding: 4px 8px; }
.zl-tag { display: flex; gap: 4px; }
.zl-tag button { min-height: 32px; padding: 4px 12px; }
.zl-tag button.on { background: var(--pink-soft); border-color: var(--pink); }
.zl-ohne { color: var(--warn); }
.zl-datum { font-family: var(--font-head); font-size: 12px; font-weight: 600; color: var(--pink-deep); margin: 12px 0 4px; }
.zl-rahmen { overflow-x: auto; }
.zl { position: relative; min-width: 640px; }
.zl-z { display: grid; grid-template-columns: 170px 1fr; align-items: stretch; min-height: 44px; border-top: 1px solid var(--line2); }
.zl-std { min-height: 24px; border-top: 0; }
.zl-std .zl-bahn { display: grid; grid-template-columns: repeat(var(--std), 1fr); background: none; min-height: 24px; font: 600 11px var(--font-head); color: var(--muted); align-items: center; }
.zl-name { display: grid; grid-template-columns: auto 1fr; column-gap: 6px; align-content: center; min-width: 0; padding-right: 8px; font-size: 13px; }
.zl-name .dot { grid-row: 1 / span 2; }
.zl-name b, .zl-name small { grid-column: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zl-name small { color: var(--muted); font-size: 12px; }
.zl-bahn { position: relative; min-height: 44px; background: repeating-linear-gradient(90deg, transparent 0 calc(100% / var(--std) - 1px), var(--line2) calc(100% / var(--std) - 1px) calc(100% / var(--std))); }
.zl .zl-blk { position: absolute; top: 7px; bottom: 7px; display: block; min-height: 0; padding: 2px 8px; border: 0; border-left: 3px solid #3b6fb0; border-radius: 8px; background: #e4edf8; color: var(--navy); font-size: 12px; font-weight: 600; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.zl .zl-blk:hover { box-shadow: 0 2px 8px rgba(4,34,68,.2); }
.zl .zl-blk.ok { background: var(--ok-soft); border-left-color: #3fa21a; }
.zl .zl-blk.faellig { background: var(--pink-mid); border-left-color: var(--pink-deep); }
[data-theme="dark"] .zl .zl-blk.faellig { background: #4a3138; }
.zl .zl-blk.weg { background: var(--line2); border-left-color: #98a2b3; color: var(--muted); text-decoration: line-through; }
.zl .zl-blk.leer { background: repeating-linear-gradient(45deg, var(--warn-soft) 0 6px, transparent 6px 12px); border-left-color: #d97706; color: var(--warn); }
.zl-jetzt { position: absolute; top: 0; bottom: 0; width: 2px; background: #dc2626; left: calc(170px + (100% - 170px) * var(--pos) / 100); pointer-events: none; }
.zl-leer-hinweis { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 0 6px; }
[data-theme="dark"] .zl .zl-blk { color: var(--ink); }
[data-theme="dark"] .zl .zl-blk:not(.ok):not(.faellig):not(.weg):not(.leer) { background: #1e3350; }
@media (max-width: 1200px) { .dash-grid { grid-template-columns: 1fr; } }
@media (max-width: 1000px) { .dash-unten { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .title-datum { display: none; } .dash-kpis { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Suche in der Kopfzeile (29.10.; Logik in js/menue.js) ---------- */
.suche-oben { position: relative; display: flex; align-items: center; gap: 8px; width: 320px; flex: 0 1 320px; height: 38px; padding: 0 12px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); color: var(--muted); }
.suche-oben:focus-within { border-color: var(--pink); box-shadow: var(--focus); }
.suche-oben > svg, #sucheKnopf svg { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.suche-oben input { flex: 1; min-width: 0; min-height: 0; padding: 0; border: 0; background: none; color: var(--ink); box-shadow: none; outline: none; }
.suche-oben input:focus { box-shadow: none; }
.suche-oben kbd { font: 600 11px var(--font-head); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; white-space: nowrap; }
.suche-treffer { position: absolute; top: calc(100% + 6px); left: 0; width: max(100%, 380px); max-height: 60vh; overflow: auto; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(4,34,68,.28); z-index: 50; }
.st { display: grid; grid-template-columns: 92px minmax(0, 1fr); column-gap: 12px; padding: 8px 12px; border-radius: 8px; cursor: pointer; color: var(--ink); }
.st b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st small { grid-column: 2; color: var(--muted); font-size: 12px; }
.st-art { grid-row: span 2; align-self: center; font: 600 11px var(--font-head); color: var(--pink-deep); }
.st.on, .st:hover { background: var(--pink-soft); }
.st-leer { padding: 12px; color: var(--muted); }
#sucheKnopf { display: none; }
.topbar h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media screen and (min-width: 861px) {
  .topbar .suche-oben { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); color: #9fb2c6; }
  .topbar .suche-oben input { color: #fff; }
  .topbar .suche-oben input::placeholder { color: #9fb2c6; }
  .topbar .suche-oben kbd { border-color: rgba(255,255,255,.25); color: #c9d6e3; }
}
/* zu schmal für Datum + Suche + Knöpfe: Tagessatz hinter dem Datum zuerst weglassen */
@media (max-width: 1500px) { .title-datum #dashSum { display: none; } }
@media (max-width: 1150px) { .title-datum { display: none; } .suche-oben kbd { display: none; } }
@media (max-width: 860px) {
  #sucheKnopf { display: inline-flex; }
  .suche-oben { display: none; order: 4; flex: 0 0 100%; width: auto; }
  body.suche-auf .suche-oben { display: flex; }
  .suche-oben kbd { display: none; }
  .suche-treffer { width: 100%; }
}
/* Browser-eigene Zeichen im Suchfeld (Pfeil, Löschen-Kreuz) passen nicht auf den Verlauf */
.suche-oben input::-webkit-calendar-picker-indicator, .suche-oben input::-webkit-search-cancel-button { display: none; }

/* ---------- Heller Modus nach Entwurf G (29.10.): Pastell-Verlauf statt Navy-Fläche (seit 03.12.2026 einfarbig) ----------
   Das kräftige Navy → Altrosa bleibt nur in der Menüleiste; Kopfzeile und Hintergrund hell, Karten weiß.
   Der Dunkelmodus behält den dunklen Verlauf (Regeln oben). */
@media screen and (min-width: 861px) {
  :root:not([data-theme="dark"]) { --verlauf: #eef0f6; }
  :root:not([data-theme="dark"]) body { background: #eef0f6; }
  :root:not([data-theme="dark"]) #nav { background: #042244; border-right: 0; }
  :root:not([data-theme="dark"]) .topbar { border-bottom-color: rgba(4,34,68,.08); }
  :root:not([data-theme="dark"]) .topbar h1 { color: var(--navy); }
  :root:not([data-theme="dark"]) #crumb { color: var(--pink-deep); }
  :root:not([data-theme="dark"]) .topbar .title-datum { color: var(--muted); }
  :root:not([data-theme="dark"]) #topActions button:not(.primary), :root:not([data-theme="dark"]) #topActions .btn:not(.primary) { background: var(--card); border-color: var(--line); color: var(--navy); }
  :root:not([data-theme="dark"]) #topActions button:not(.primary):hover, :root:not([data-theme="dark"]) #topActions .btn:not(.primary):hover { background: var(--pink-soft); border-color: var(--pink); }
  :root:not([data-theme="dark"]) .topbar .suche-oben { background: rgba(255,255,255,.75); border-color: rgba(4,34,68,.1); color: var(--muted); }
  :root:not([data-theme="dark"]) .topbar .suche-oben input { color: var(--ink); }
  :root:not([data-theme="dark"]) .topbar .suche-oben input::placeholder { color: var(--muted); }
  :root:not([data-theme="dark"]) .topbar .suche-oben kbd { border-color: var(--line); color: var(--muted); }
  :root:not([data-theme="dark"]) .navrail-btn { background: #fff; border-color: var(--line); color: var(--navy); backdrop-filter: none; }
  :root:not([data-theme="dark"]) #view { box-shadow: 0 4px 16px rgba(4,34,68,.07); }
  /* Übersicht: Kennzahlen als weiße Kacheln mit rosa Symbol, Karten weiß */
  :root:not([data-theme="dark"]) #view > .dash-kpis .kpi-s { background: var(--card); border-color: rgba(255,255,255,.8); color: inherit; box-shadow: 0 4px 16px rgba(4,34,68,.07); }
  :root:not([data-theme="dark"]) #view > .dash-kpis .kpi-s:hover { background: var(--head); }
  :root:not([data-theme="dark"]) #view > .dash-kpis .kpi-s .v { color: var(--navy); }
  :root:not([data-theme="dark"]) #view > .dash-kpis .kpi-s .l { color: var(--muted); }
  :root:not([data-theme="dark"]) #view > .dash-kpis .kpi-ic { background: var(--pink-soft); color: var(--pink-deep); }
  :root:not([data-theme="dark"]) #view > .dash-kpis .kpi-s.warn .kpi-ic { background: var(--warn-soft); color: var(--warn); }
  :root:not([data-theme="dark"]) #view:has(> .dash-kpis) .card { background: var(--card); border-color: rgba(255,255,255,.8); backdrop-filter: none; box-shadow: 0 4px 16px rgba(4,34,68,.07); }
}

/* ---------- Handy für Büro/Admin (29.10.): Übersicht kompakt, Listen als Karten, Planung als Tagesansicht ---------- */
.zl-liste { display: none; list-style: none; margin: 8px 0 0; padding: 0; }
.filter-knopf { display: none; }
.tag-titel { flex: 1; text-align: center; font-family: var(--font-head); }
.tag-gruppe { margin-bottom: 12px; }
.tag-gruppe h3 .muted { margin-left: auto; font-weight: 500; font-family: inherit; }
.tag-gruppe.ohne { border-color: #f5c97a; }
.tag-einsatz { display: flex; align-items: flex-start; justify-content: flex-start; gap: 12px; width: 100%; margin-top: 8px; padding: 12px 12px; text-align: left; white-space: normal;
  background: var(--head); border: 1px solid var(--line2); border-left: 3px solid #3b6fb0; border-radius: 10px; font-weight: 500; }
.tag-einsatz b { flex: 0 0 auto; color: var(--navy); font-variant-numeric: tabular-nums; }
.tag-einsatz > span { display: flex; flex-direction: column; min-width: 0; }
.tag-einsatz small { color: var(--muted); font-weight: 400; }
.tag-einsatz.st-erledigt { border-left-color: #3fa21a; }
.tag-einsatz.st-ausgefallen { border-left-color: #d97706; }
.tag-einsatz.st-abgesagt { border-left-color: #98a2b3; opacity: .6; }
.tag-einsatz.st-abgesagt .tag-kunde { text-decoration: line-through; }
[data-theme="dark"] .tag-einsatz b, [data-theme="dark"] .zl-li-zeit { color: #9cc0ea; }
@media (max-width: 860px) {
  /* Übersicht: Kennzahlen als eine wischbare Reihe, Tagesplan als Liste */
  .dash-kpis { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; margin: 0 -12px 12px; padding: 0 12px 4px; scrollbar-width: none; }
  .dash-kpis::-webkit-scrollbar { display: none; }
  .dash-kpis .kpi-s { flex: 0 0 auto; min-width: 150px; padding: 12px 12px; gap: 12px; scroll-snap-align: start; border-bottom: 1px solid var(--line); }
  .dash-kpis .kpi-ic { width: 32px; height: 32px; flex-basis: 32px; }
  .dash-kpis .kpi-s .v { font-size: 18px; }
  .dash-kpis .kpi-s .l { font-size: 12px; white-space: nowrap; }
  .zl-rahmen { display: none; }
  .zl-liste { display: block; }
  .zl-kopf .spacer { display: none; }
  .zl-li { display: flex; align-items: center; justify-content: flex-start; gap: 12px; width: 100%; min-height: 0; padding: 12px 2px; text-align: left; white-space: normal;
    background: none; border: 0; border-bottom: 1px solid var(--line2); border-radius: 0; font-weight: 500; }
  .zl-liste li:last-child .zl-li { border-bottom: 0; }
  .zl-li-zeit { flex: 0 0 96px; font-family: var(--font-head); font-weight: 600; font-size: 14px; color: var(--navy); font-variant-numeric: tabular-nums; }
  .zl-li-wer { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .zl-li-wer b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .zl-li-wer small { color: var(--muted); }
  .zl-li.leer small { color: var(--warn); }
  .zl-li.weg { opacity: .55; }
  /* Listen: Filter hinter dem Knopf, Suche und Knopf in einer Zeile */
  .filter-knopf { display: inline-flex; }
  .toolbar:has(.filter-knopf) .search { flex: 1 1 0; }
  .toolbar:has(.filter-knopf) > select { display: none; }
  .toolbar.filter-auf > select { display: block; }
  /* Listen: jede Zeile eine Karte – Name oben, übrige Felder zweispaltig mit kleiner Beschriftung */
  table.karten-handy thead { display: none; }
  table.karten-handy, table.karten-handy tbody { display: block; }
  table.karten-handy tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; padding: 12px 16px; border-bottom: 1px solid var(--line2); }
  table.karten-handy td { display: block; flex: 0 0 calc(50% - 6px); min-width: 0; padding: 0; border: 0; font-size: 14px; text-align: left; overflow-wrap: anywhere; }
  table.karten-handy td::before { content: attr(data-l); display: block; font-size: 11px; font-weight: 600; color: var(--muted); }
  table.karten-handy td:empty { display: none; }
  table.karten-handy td.k-nachname, table.karten-handy td.k-vorname, table.karten-handy td.k-name { order: -1; font-size: 16px; font-weight: 600; color: var(--navy); }
  /* Name in einer Zeile („Albers, Anna“), danach die übrigen Felder zweispaltig */
  table.karten-handy td.k-nachname { flex: 0 0 auto; }
  table.karten-handy td.k-nachname:has(+ td.k-vorname:not(:empty))::after { content: ','; }
  table.karten-handy td.k-vorname { flex: 1 0 55%; margin-left: -6px; }
  table.karten-handy td.k-name { flex: 1 1 100%; }
  table.karten-handy td.k-nachname::before, table.karten-handy td.k-vorname::before, table.karten-handy td.k-name::before, table.karten-handy td.wahl::before { display: none; }
  table.karten-handy td.wahl { order: -2; flex: 0 0 auto; align-self: center; }
  [data-theme="dark"] table.karten-handy td.k-nachname, [data-theme="dark"] table.karten-handy td.k-vorname, [data-theme="dark"] table.karten-handy td.k-name { color: #eef1f5; }
}

/* ---------- Erinnerung an nicht erfasste Einsätze (Tour, 30.10.) ---------- */
.erinnerung { border: 2px solid #d97706; display: flex; flex-direction: column; gap: 8px; }
.erinnerung > b { font-size: 15px; }
.erinnerung-liste { display: flex; flex-direction: column; gap: 6px; }
.erinnerung-liste button { justify-content: flex-start; text-align: left; white-space: normal; width: 100%; background: var(--card); border-color: #f5c97a; font-weight: 600; }
.erinnerung-liste button:hover { background: var(--warn-soft); border-color: #d97706; }

/* ---------- Stundentabelle am Handy: Karten statt Tabelle (30.10.) ---------- */
.std-handy { display: none; }
.std-karte { padding: 12px 16px; margin-bottom: 12px; }
.std-karte summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.std-karte summary::-webkit-details-marker { display: none; }
.std-karte summary b { flex: 1 1 auto; }
.std-karte .std-zahlen { font-size: 13px; color: var(--muted); }
.std-karte .bar { flex: 1 1 100%; margin-top: 6px; }
.std-perioden { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 13px; }
.std-perioden li { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line2); padding: 4px 0; }
.std-karte.inactive { opacity: .6; }
@media (max-width: 860px) {
  .tablewrap:has(> table.hgrid) { display: none; }
  .std-handy { display: block; }
}
/* Abwesenheit im Wochenraster, Warnung im Einsatz-Dialog (seit 02.11.2026) */
.week td.day.abw { background: repeating-linear-gradient(135deg, var(--warn-soft) 0 8px, transparent 8px 16px); }
.abw-l { display: inline-block; padding: 0 6px; border-radius: 4px; background: var(--warn-soft); color: var(--warn); font-size: 11px; font-weight: 600; margin: 0 4px 4px 0; }
.konflikt-box { margin: 12px 0 0; }
.konflikt-box ul { margin: 6px 0 0; padding-left: 20px; }
/* Meine Zeiten (seit 02.11.2026): drei Karten, am Handy untereinander */
.mz-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.mz-karte { margin: 0; padding: 16px 16px; }
.mz-karte h3 { margin: 0 0 6px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.mz-breit { grid-column: 1 / -1; }
.mz-gross { font-family: var(--font-head); font-size: 26px; font-weight: 600; margin: 2px 0 6px; }
.mz-karte .std-perioden { grid-template-columns: 1fr; }
.mz-karte details summary { cursor: pointer; margin-top: 8px; }
.mz-monat summary { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line2); }
/* Dokumente im Bearbeiten-Dialog (seit 02.11.2026) */
.dok-box { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line2); }
.dok-box h3 { margin: 0 0 8px; }
.dok-liste { list-style: none; margin: 0 0 12px; padding: 0; }
.dok-liste li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 4px 0; border-bottom: 1px solid var(--line2); }
.dok-liste li a { font-weight: 600; word-break: break-all; }
.dok-liste li .link { margin-left: auto; }
.dok-liste li .link.sicher { color: var(--bad); font-weight: 600; }
.dok-neu { cursor: pointer; margin-right: 8px; }
/* Rollen als Schilder im Benutzer-Dialog (seit 02.11.2026): × beim Darüberfahren, auf Touch-Geräten immer sichtbar */
.rollen-feld { display: flex; flex-direction: column; gap: 6px; }
.rollen-titel { font-size: 13px; font-weight: 600; color: var(--muted); }
.rollen-tags { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; align-items: center; }
.rtag { display: inline-flex; align-items: center; gap: 2px; padding: 4px 6px 4px 12px; border-radius: 99px; background: var(--pink-soft); color: var(--pink-ink); font-weight: 600; font-size: 13px; border: 1px solid var(--line); }
.rtag-x { min-height: 0; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 15px; line-height: 1; opacity: 0; transition: opacity .12s, background .12s; }
.rtag:hover .rtag-x, .rtag:focus-within .rtag-x { opacity: 1; }
.rtag-x:hover, .rtag-x:focus-visible { background: var(--bad); color: #fff; }
@media (hover: none) { .rtag-x { opacity: 1; } }
/* Umsatz-Übersicht (seit 02.11.2026, nur Geschäftsführung/Admin) */
.um-tab .um-bar-th, .um-tab .um-bar-td { width: 28%; min-width: 120px; }
.um-tab .um-bar-td .bar { margin: 0; }
.gf-only[hidden] { display: none !important; }
/* Zeiterfassung (seit 02.11.2026): Karte auf der Tour, Wochenübersicht im Büro */
.zeitkarte { margin-bottom: 16px; padding: 16px 16px; border-left: 4px solid var(--line); }
.zeitkarte.zk-arbeit { border-left-color: var(--ok); }
.zeitkarte.zk-pause { border-left-color: var(--warn); }
.zeitkarte.zk-fertig { border-left-color: var(--pink-deep); }
.zk-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.zk-stand { margin: 4px 0 8px; font-size: 15px; }
.zk-warn { color: var(--warn); font-weight: 600; }
.zk-knoepfe { margin: 0; gap: 8px; }
/* Laufende Uhr der Stempelkarte (seit 16.11.2026): groß, gleich breite Ziffern, damit sie beim Zählen nicht springt */
.zk-uhr { font-family: var(--font-head); font-weight: 600; font-size: 40px; line-height: 1.1; letter-spacing: .02em; font-variant-numeric: tabular-nums; margin: 6px 0 2px; }
/* In der Pause zählt die große Uhr die Pause (seit 17.11.2026), die Arbeitszeit steht klein darunter */
.zeitkarte.zk-fertig .zk-uhr { color: var(--muted); }
.zeitkarte.zk-pause .zk-uhr, .zeitkarte.zk-pause .zk-uhrlabel { color: var(--warn); }
.zk-uhrlabel { margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.zk-uhrlabel + .zk-uhr { margin-top: 0; }
.zk-nebenuhr { margin: 0; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
/* Meine Termine (seit 17.11.2026): je Tag eine Karte, Termine als große Tippflächen (öffnen die Tour an dem Tag) */
.mt-tag { margin-bottom: 12px; padding: 12px 16px; }
.mt-tag h3 { margin: 0 0 8px; font-size: 15px; }
.mt-tag.mt-heute { border-left: 4px solid var(--pink-deep); }
.mt-termin { display: flex; gap: 12px; align-items: flex-start; justify-content: flex-start; width: 100%; text-align: left; padding: 12px 12px; margin: 6px 0 0; min-height: 48px;
  background: var(--card, #fff); border: 1px solid var(--line); border-radius: 10px; color: inherit; font: inherit; cursor: pointer; }
.mt-termin:hover { border-color: var(--pink-deep); }
.mt-zeit { font-family: var(--font-head); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 92px; }
.mt-kunde { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mt-kunde .badge { align-self: flex-start; }
/* Meine Arbeitszeit (seit 16.11.2026): Woche Tag für Tag, heute hervorgehoben */
.az-tab tr.az-heute, .az-tab tr.az-heute td { background: var(--pink-soft); }
@media (max-width: 760px) { .az-tab tr.az-heute td { background: transparent; } }
.az-tab td:last-child { text-align: right; }
.az-tab tfoot td { border-top: 2px solid var(--line); }
.az-tab tr[data-nachtrag] { cursor: pointer; }
/* Pausen als Zeitspannen unter der Minutenzahl (17.11.2026) */
.az-pausen { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; }
/* Nachtrag-Dialog: Arbeitszeit und Pause je von/bis nebeneinander, auch auf dem Handy (17.11.2026) */
.nt-form { display: grid; gap: 16px; }
.nt-summe { margin: 0; color: var(--muted); }
.nt-gruppe { border: 0; padding: 0; margin: 0; min-width: 0; }
.nt-gruppe legend { padding: 0; margin-bottom: 6px; font-weight: 600; }
.nt-zeile { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.nt-zeile input { width: 100%; }
.nt-zeile input.nt-falsch { border-color: var(--bad); }
.nt-fehler { margin: 6px 0 0; color: var(--bad); font-size: 13px; }
/* Tag als Formular (17.11.2026): je Pause eine Zeile von/bis mit ✕, darunter „+ Pause hinzufügen“ */
.tf-block { display: grid; gap: 8px; }
.tf-pausen { display: grid; gap: 8px; }
.tf-plabel { font-weight: 600; margin-bottom: 4px; }
/* gleiche Spalten wie die Pausenzeile (rechts Platz für ✕), damit alle Felder bündig untereinander stehen */
.tf-block > .nt-zeile, .tf-pzeile { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px; gap: 12px; align-items: center; }
.tf-weg { width: 36px; padding: 0; justify-content: center; }
.tf-pzeile input { width: 100%; }
.tf-pzeile input.nt-falsch { border-color: var(--bad); }
.tf-block [data-tfplus], .tf-blockplus { justify-self: start; }
.zt-herkunft { margin-top: 12px; }
@media (max-width: 860px) { .zk-knoepfe button { flex: 1 1 40%; min-height: 46px; } }
.zt-tab td.zt-tag { cursor: pointer; font-size: 13px; line-height: 1.35; }
.zt-tab td.zt-tag:hover { background: var(--pink-soft); }
.zt-tab td.zt-warn { background: var(--warn-soft); }
.zt-i { font-size: 12px; }
.zt-pause { color: var(--muted); }
.zt-stempel { width: 100%; border-collapse: collapse; }
.zt-stempel td { padding: 4px 6px 4px 0; border-bottom: 1px solid var(--line2); vertical-align: middle; }
/* Umsatz je Mitarbeiter / je Kunde (seit 02.11.2026) */
.um-reiter { margin-bottom: 12px; }
.um-ma tbody tr[data-ma] { cursor: pointer; }
.um-ma tbody tr[data-ma]:hover { background: var(--head); }
.um-ma .um-bar-td { display: flex; align-items: center; gap: 8px; }
.um-ma .um-bar-td .bar { flex: 1; }
.bar.ok > span { background: var(--ok); }
/* Kostensätze je Beschäftigungsart (Umsatz → Je Mitarbeiter, seit 02.11.2026) */
.um-saetze { margin-bottom: 16px; padding: 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.um-saetze-felder { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.um-saetze-felder label { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); gap: 4px; }
.um-saetze-felder input { width: 120px; }
/* Eingangsrechnungen (seit 03.11.2026) */
.er-tabs { margin-bottom: 12px; }
.er-tab td.er-ueber { color: var(--bad); font-weight: 600; }
.er-tab td.er-aktion { white-space: nowrap; text-align: right; }
.er-tab td.er-aktion button { margin-left: 4px; }
.kpi-s .v.neg { color: var(--bad); }
/* Übersicht: „Zur Freigabe“ (seit 03.11.2026) */
.dash-freigabe h3 { display: flex; align-items: baseline; gap: 8px; }
.dash-freigabe h3 a { margin-left: auto; }
/* Kontostand (seit 18.11.2026, js/bank.js): Kopf wie „Zur Freigabe“, Beträge rechtsbündig */
.dash-bank h3 { display: flex; align-items: baseline; gap: 8px; }
.dash-bank h3 a { margin-left: auto; }
.bank-konten td.num { white-space: nowrap; }
.bank-neu summary { cursor: pointer; color: var(--muted); margin-bottom: 12px; }
.fg-liste { list-style: none; margin: 0; padding: 0; }
.fg-liste li { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "wer betrag" "knoepfe knoepfe"; gap: 4px 12px; padding: 8px 0; border-bottom: 1px solid var(--line2); }
.fg-wer { grid-area: wer; display: flex; flex-direction: column; min-width: 0; }
.fg-wer b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fg-betrag { grid-area: betrag; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.fg-knoepfe { grid-area: knoepfe; display: flex; gap: 6px; justify-content: flex-end; }
.fg-knoepfe button { min-height: 30px; padding: 4px 12px; }

/* Datenschutz im Kunden-Dialog (seit 03.11.2026) */
.ds-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.ds-verlauf { list-style: none; margin: 8px 0 0; padding: 0; max-height: 260px; overflow-y: auto; border-top: 1px solid var(--line, #e3e8ee); }
.ds-verlauf li { padding: 6px 0; border-bottom: 1px solid var(--line, #e3e8ee); font-size: 13px; overflow-wrap: anywhere; }

/* Administration (seit 03.11.2026) */
.adm-reiter { margin-bottom: 16px; }
.adm-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin-top: 16px; }
.adm-kv { width: 100%; }
.adm-kv td { padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.adm-kv td:first-child { color: var(--muted); }
.adm-fehler tr[data-adm-f] { cursor: pointer; }
.adm-details pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; max-height: 260px; overflow-y: auto; }
.adm-filter { flex-wrap: wrap; gap: 8px; }
.adm-filter input[type=search] { min-width: 140px; }
/* „von“/„bis“ neben das Datumsfeld statt darüber, sonst standen die Felder tiefer als der Rest der Leiste (17.11.2026) */
.adm-filter label { flex-direction: row; align-items: center; gap: 6px; }
.adm-reiter { flex-wrap: wrap; }

/* Seiten-Reiter (seit 03.11.2026): verwandte Seiten einer Menügruppe, z. B. Stundentabelle | Zeiterfassung | Arbeitszeitkonto.
   Liegt vor #view (die Seiten schreiben #view jedes Mal neu) und sieht aus wie dessen oberer Rand. */
#seitenReiter { display: flex; flex-wrap: wrap; gap: 2px; padding: 12px 32px 0; border-bottom: 1px solid var(--line); background: var(--bg); }
#seitenReiter a { padding: 8px 16px 8px; color: var(--muted); font-weight: 600; text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; }
#seitenReiter a:hover { color: var(--ink); }
#seitenReiter a.on { color: var(--accent-hover); border-bottom-color: var(--accent); }
@media (max-width: 860px) { #seitenReiter { padding: 6px 12px 0; } #seitenReiter a { padding: 8px 12px 8px; } }
@media screen and (min-width: 861px) {
  #seitenReiter { margin: 0 20px 0 16px; padding: 12px 28px 0; border-radius: 16px 16px 0 0; }
  #seitenReiter:not([hidden]) + #view { border-top-left-radius: 0; border-top-right-radius: 0; }
}

/* Mitarbeiter zusammenführen (seit 03.11.2026) */
.zus-vorschau { margin-top: 16px; }

/* Arbeitstage je Mitarbeiter (seit 03.11.2026) */
.wt-box { display: flex; flex-direction: column; gap: 6px; }
.wt-titel { font-size: 13px; font-weight: 600; color: var(--muted); }
.wt-tage { display: flex; flex-wrap: wrap; gap: 4px 16px; }
/* Terminanträge (seit 11.11.2026): beantragt = gestrichelt (wartet auf Freigabe), abgelehnt = blass und durchgestrichen.
   Nur Rahmen und Deckkraft, damit helles und dunkles Design ohne eigene Farben auskommen */
.chip.st-beantragt, .chip-l.st-beantragt, .tag-einsatz.st-beantragt { outline: 2px dashed #d97706; outline-offset: -2px; }
.chip.st-abgelehnt, .chip-l.st-abgelehnt, .tag-einsatz.st-abgelehnt { opacity: .55; text-decoration: line-through; }
.tourcard.st-beantragt { border-left-style: dashed; border-left-color: #d97706; }
.tourcard.st-abgelehnt { opacity: .7; }
.antrag-liste { display: flex; flex-direction: column; gap: 8px; }
.antrag-zeile { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.antrag-zeile:first-child { border-top: 0; }
.antrag-zeile .antrag-text { flex: 1 1 260px; min-width: 0; }
/* Termine zur Freigabe (seit 16.11.2026): Karte je Antrag, linker Rand und Schild in Ampelfarbe, Budgetbalken
   (grau = schon verplant, Akzent = dieser Termin, rot = darüber hinaus, hell = Rest danach) */
.fg-leiste { margin-bottom: 4px; }
.fg-tag { margin: 20px 0 8px; font-size: 14px; color: var(--muted); }
.fg-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 12px; }
.fg-karte { display: flex; flex-direction: column; gap: 6px; padding: 16px 16px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.fg-karte.fg-ok { border-left-color: var(--ok); }
.fg-karte.fg-ueber { border-left-color: var(--bad); }
.fg-karte.fg-pruefen { border-left-color: var(--warn); }
.fg-kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.fg-zeit { font-size: 16px; }
.fg-wer { flex: 1 1 160px; min-width: 0; }
.fg-kopf .badge { margin-left: auto; }
.fg-balken { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--line2); }
.fg-balken span { height: 100%; }
.fg-alt { background: var(--muted); opacity: .45; }
.fg-dieser { background: var(--accent); }
.fg-ueber { background: var(--bad); }
.fg-rest { background: var(--ok-soft); }
.fg-zeile { margin: 0; font-size: 13px; line-height: 1.5; }
/* Kosten und Rest danach groß (seit 16.11.2026, Wunsch Nutzer „mehr hervorheben“); Rest grün, im Minus rot */
.fg-zahlen { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 2px 0; }
.fg-zahl { display: flex; flex-direction: column; }
.fg-zahl small { font-size: 11px; color: var(--muted); }
.fg-zahl b { font-family: var(--font-head); font-size: 22px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.fg-zahl.fg-gut b { color: var(--ok); }
.fg-zahl.fg-schlecht b { color: var(--bad); }
.fg-konflikt { margin: 0; }
.fg-knoepfe { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
/* Serie (seit 17.11.2026): alle Termine aufklappbar, je Termin Kosten und Rest wie bei Einzelanträgen */
.fg-termine summary { cursor: pointer; color: var(--muted); }
.fg-termin { display: flex; flex-direction: column; gap: 4px; padding: 8px 0; border-top: 1px solid var(--line2); }
.fg-termin .fg-zahl b { font-size: 16px; }
/* 10 Reiter (seit 03.11.2026) – schmaler, damit sie auf üblichen Bildschirmen in eine Zeile passen */
.adm-reiter button { padding: 6px 12px; }

/* Startseite der Geschäftsführung (seit 04.11.2026) */
.gf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin: 20px 0; align-items: start; }
.gf-grid .dash-seite { display: flex; flex-direction: column; gap: 20px; }
.gf-budget { margin: 12px 0 0; }

/* Eingangsrechnungen als Karten auf dem Handy (04.11.2026): Knöpfe in voller Breite unter den Angaben */
@media (max-width: 860px) {
  table.karten-handy td.er-aktion { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 6px; }
  table.karten-handy td.er-aktion::before { display: none; }
  table.karten-handy td.num { text-align: left; }
}

/* Weitere Tabellen als Karten auf dem Handy (04.11.2026: Umsatz, Rechnungen, Abrechnungslauf, Budgets) – statt seitlich wischen */
@media (max-width: 860px) {
  table.karten-handy tfoot { display: block; }
  table.karten-handy tfoot tr { background: var(--head); border-top: 2px solid var(--line); }
  table.karten-handy td.k-knoepfe { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 6px; white-space: normal; }
  table.karten-handy td.k-knoepfe::before { display: none; }
  table.karten-handy td.um-bar-td:not(.um-ziel), table.karten-handy tr.um-leer { display: none; }
  table.karten-handy td[colspan] { flex: 1 1 100%; }
}

/* Mitarbeiter „Mögliche Doppelte“ (04.11.2026): jede zweite Gruppe hinterlegt; am Handy die Karte */
tr.gruppe-b td { background: var(--brand-soft); }
@media (max-width:860px) { table.karten-handy tr.gruppe-b { background: var(--brand-soft); } }

/* Handy ohne seitliches Wischen (05.11.2026): Arbeitszeitkonto, Zeiterfassung und Urlaubskalender als Karten */
@media (max-width:860px) {
  table.karten-handy tr.inactive { opacity: .6; }
  .azk-handy input { width: 100%; text-align: right; font-variant-numeric: tabular-nums; }
  .azk-handy input.minus { color: var(--bad); }
  .azk-handy td.has-note input { background: var(--warn-soft); }
  .azk-handy td.calc { font-weight: 600; color: var(--pink-ink); align-self: end; }
  .azk-handy td.calc.neg { color: var(--bad); }
  .tag-wahl { display: flex; gap: 4px; margin: 0 0 12px; }
  .tag-wahl button { flex: 1 1 0; min-width: 0; padding: 6px 0; font-size: 12px; line-height: 1.3; flex-direction: column; }
  .tag-wahl button.we { color: var(--muted); }
  .tag-wahl button.heute { border-color: var(--accent); }
  .tag-wahl button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
  .zt-handy td.zt-tag { flex: 1 1 60%; }
  .zt-handy td.zt-hinweis { flex: 1 1 100%; color: var(--warn); }
  .zt-handy tr.zt-warn { background: var(--warn-soft); }
  .urlaub-handy td.uh-liste { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
  .urlaub-handy td.uh-liste::before { display: none; }
  .urlaub-handy .uh-abs { padding: 4px 12px; font-size: 13px; gap: 6px; }
  .urlaub-handy .uh-neu { padding: 4px 12px; font-weight: 600; }
}

/* ---------- Problem melden (seit 18.11.2026, js/meldungen.js): Maße und Aufbau 1:1 wie RLS Connect (js/meldung.js CSS),
   Farben aus den AlltagsPilot-Variablen (Entscheidung Nutzer), damit auch das dunkle Thema passt ---------- */
.md-badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; color: #fff; white-space: nowrap; }
.md-neu { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--bad); flex-shrink: 0; margin-left: 6px; vertical-align: middle; }
.md-vermerk { font-size: 11px; font-weight: 600; border-radius: 5px; padding: 1px 4px; white-space: nowrap; }
.md-wartet { color: #1c5c8a; background: #e8f1f8; border: 1px solid #bcd6e8; }
.md-erledigt { color: #1d6b3a; background: #e6f4ea; border: 1px solid #b7dfc4; }
.md-wieder { color: #8a5c1c; background: #fdf3e0; border: 1px solid #f0dcb8; }
.md-kopf .md-vermerk { font-size: 12px; border-radius: 8px; padding: 4px 8px; }
.md-stand { font-size: 12px; color: var(--muted); }
/* Meldedialog */
#mdOv { position: fixed; inset: 0; background: rgba(4,34,68,.45); z-index: 200; display: none; align-items: center; justify-content: center; padding: 12px; }
#mdOv.auf { display: flex; }
#mdDlg { background: var(--card); color: var(--ink); border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.3); width: min(560px, 96vw); max-height: 94vh; overflow: auto; padding: 24px 24px; }
#mdDlg h2 { font-size: 17px; margin: 0 0 16px; font-weight: 600; }
#mdDlg label { display: block; font-size: 11px; font-weight: 600; color: var(--muted); margin: 12px 0 4px; }
#mdDlg input[type=text], #mdDlg textarea { width: 100%; box-sizing: border-box; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; font-family: inherit; background: var(--head); }
#mdDlg input:focus, #mdDlg textarea:focus { border-color: var(--accent); background: var(--card); outline: none; box-shadow: var(--focus); }
#mdDlg textarea { min-height: 110px; resize: vertical; }
#mdDlg .md-zeile2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#mdDlg .md-wahl { display: flex; gap: 6px; flex-wrap: wrap; }
#mdDlg .md-wahl button { flex: 1; padding: 8px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--head); font-size: 13px; color: var(--ink); min-height: 0; }
#mdDlg .md-wahl button.aktiv { background: var(--brand-soft); border-color: var(--accent); color: var(--accent-hover); font-weight: 600; }
#mdBild { border: 2px dashed var(--line); border-radius: 10px; padding: 16px; text-align: center; font-size: 13px; color: var(--muted); cursor: pointer; background: var(--head); transition: border-color .15s; }
#mdBild.ueber { border-color: var(--accent); background: var(--brand-soft); }
#mdBild img { max-width: 100%; max-height: 220px; border-radius: 6px; display: block; margin: 0 auto 8px; }
#mdDlg .md-umgebung { font-size: 11px; color: var(--muted); opacity: .8; margin-top: 12px; line-height: 1.5; }
#mdDlg .md-fuss { display: flex; gap: 12px; justify-content: flex-end; margin-top: 16px; align-items: center; }
#mdDlg .md-fuss .md-stand { margin-right: auto; }
.md-btn { padding: 8px 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); font-size: 14px; min-height: 0; }
.md-btn.primaer { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.md-btn:disabled { opacity: .6; cursor: default; }
@media (max-width: 600px) { #mdDlg .md-zeile2 { grid-template-columns: 1fr; } }
/* Seite: Liste links, Details rechts; Höhe fensterhoch, gescrollt wird in den Karten (RLS M:434–456) */
.md-filter { margin: 0 0 16px; max-width: 100%; overflow-x: auto; }
.md-filter button { flex: 0 0 auto; }
.md-raster { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(0, 1.6fr); grid-template-rows: minmax(0, 1fr); gap: 16px; height: calc(100dvh - 190px); min-height: 420px; }
.md-karte { display: flex; flex-direction: column; min-height: 0; overflow: hidden; padding: 0; margin: 0; }
.md-karte > :last-child { flex: 1; min-height: 0; overflow: auto; }
.md-kartenkopf { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 600; color: var(--muted); }
.md-leer { color: var(--muted); padding: 20px; margin: 0; }
.md-leer-klein { font-size: 13px; color: var(--muted); margin-top: 12px; }
@media (max-width: 1100px) {
  .md-raster { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .md-karte { overflow: visible; }
  .md-karte > :last-child { overflow: visible; }
}
/* Liste */
#mdListe .md-zeile { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line2); cursor: pointer; }
#mdListe .md-zeile > div { min-width: 0; }
#mdListe .md-zeile:hover { background: var(--head); }
#mdListe .md-zeile.aktiv { background: var(--brand-soft); }
#mdListe .md-art { font-size: 18px; }
#mdListe .md-titel { font-size: 15px; font-weight: 600; }
#mdListe .md-meta { font-size: 13px; color: var(--muted); margin-top: 4px; }
#mdListe .md-dringend { color: var(--bad); }
#mdListe .md-vorschau { font-size: 13px; color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#mdListe .md-rechts { display: flex; align-items: center; }
/* Details: Kopf und Fuß kleben, Verlauf als Chat (RLS M:327–406) */
#mdDetail { padding: 0 20px; }
#mdDetail, #mdDetail * { overflow-wrap: anywhere; }
#mdDetail img { max-width: 100%; height: auto; }
#mdDetail .md-kopf { position: sticky; top: 0; background: var(--card); z-index: 3; padding: 20px 0 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
#mdDetail .md-kopfzeile { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
#mdDetail .md-nr { font-size: 12px; color: var(--muted); }
#mdDetail .md-notizknopf { margin-left: auto; padding: 6px 12px; min-height: 0; font-size: 13px; }
#mdDetail h3 { font-size: 16px; margin: 8px 0 0; display: block; }
#mdDetail h3::before { display: none; } /* Titel schlicht wie RLS, ohne den Balken der allgemeinen Überschrift */
#mdDetail .md-wer-zeile { font-size: 12px; color: var(--muted); }
#mdDetail .md-text { white-space: pre-wrap; font-size: 15px; line-height: 1.6; margin: 12px 0; padding: 16px; background: var(--head); border-radius: 8px; }
#mdDetail img.md-shot { max-width: 100%; border-radius: 8px; border: 1px solid var(--line); margin-top: 8px; cursor: zoom-in; }
#mdDetail .md-verlauf { display: flex; flex-direction: column; margin-top: 4px; }
/* Zeilenumbrüche nur im Nachrichtentext erhalten, nicht in der ganzen Blase – sonst zeigen sich die Umbrüche des Gerüsts */
#mdDetail .md-bubble { margin-top: 12px; padding: 12px 16px; border-radius: 10px; font-size: 15px; line-height: 1.5; max-width: 85%; box-sizing: border-box; }
#mdDetail .md-text-inhalt { white-space: pre-wrap; }
#mdDetail .md-bubble.fremd { background: #eaf5ef; color: #1d2026; align-self: flex-start; border-bottom-left-radius: 3px; }
#mdDetail .md-bubble.eigen { background: #e6edf8; color: #1d2026; align-self: flex-end; border-bottom-right-radius: 3px; }
#mdDetail .md-bubble.notiz { background: #fdf6e7; color: #1d2026; border: 1px dashed #d9b36a; align-self: stretch; max-width: 100%; font-size: 14px; margin-top: 8px; }
#mdDetail .md-bubble .md-wer { font-size: 12px; color: #5f6b7a; margin-bottom: 4px; white-space: normal; }
#mdDetail .md-stift { color: inherit; text-decoration: none; }
#mdDetail .md-bubble-bild { display: block; max-width: 100%; max-height: 320px; border-radius: 8px; margin-top: 8px; cursor: zoom-in; }
#mdDetail .md-bubble-bild.ohne-text { margin-top: 2px; }
#mdDetail .md-bearb { width: 100%; box-sizing: border-box; font-family: inherit; font-size: 13px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
#mdDetail .md-bearb-knoepfe { display: flex; gap: 8px; margin-top: 6px; }
#mdDetail .md-bearb-knoepfe button { padding: 4px 12px; min-height: 0; }
#mdHaupt { display: flex; flex-direction: column; min-height: 100%; box-sizing: border-box; }
#mdHaupt .md-umgebung { margin-top: auto; padding-top: 12px; }
#mdHaupt .md-umgebung summary { cursor: pointer; font-size: 13px; color: var(--muted); }
#mdHaupt.ohneUmgebung .md-fuss { margin-top: auto; }
#mdDetail .md-env { font-size: 12px; color: var(--muted); line-height: 1.6; word-break: break-all; }
#mdDetail .md-konsole { font-family: ui-monospace, Menlo, monospace; font-size: 11px; background: #1a1a18; color: #c8cfc8; padding: 12px; border-radius: 8px; white-space: pre-wrap; max-height: 160px; overflow: auto; margin-top: 6px; }
#mdDetail .md-fuss { position: sticky; bottom: 0; background: var(--card); z-index: 2; margin-top: 12px; padding: 12px 0 20px; border-top: 1px solid var(--line); }
#mdDetail .md-admin { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0 0 12px; }
/* „Status speichern“ und „Auf Antwort warten“ zusammen rechts in einer Zeile (Wunsch Nutzer 18.11.2026) */
/* in schmaler Spalte (Notizen offen) bricht der Text im Knopf um, statt dass ein Knopf abgeschnitten wird oder in die
   nächste Zeile rutscht */
#mdDetail .md-admin-knoepfe { display: flex; gap: 12px; margin-left: auto; flex-wrap: nowrap; max-width: 100%; }
#mdDetail .md-admin-knoepfe button { padding: 8px 12px; min-height: 0; flex: 0 1 auto; }
#mdDetail .md-status { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 0; }
#mdDetail .md-status button { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); font-size: 13px; min-height: 0; }
#mdDetail .md-status button.aktiv { color: #fff; border-color: transparent; }
#mdDetail .md-zu { display: flex; gap: 8px; align-items: center; background: var(--head); border: 1px solid var(--line); border-radius: 9px; padding: 12px 12px; font-size: 13px; color: var(--muted); }
#mdDetail .md-zu button { white-space: nowrap; padding: 8px 12px; min-height: 0; }
#mdDetail .md-anhangzeile { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; background: var(--head); border: 1px solid var(--line); border-radius: 9px; padding: 6px 8px; font-size: 13px; }
#mdDetail .md-anhangzeile[hidden] { display: none; }
#mdDetail .md-anhangzeile .md-btn { padding: 4px 8px; }
.md-eingabe { display: flex; gap: 12px; align-items: flex-end; }
.md-eingabe textarea { flex: 1; min-height: 62px; max-height: 260px; margin: 0; resize: none; overflow-y: auto; width: 100%; box-sizing: border-box; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; font-family: inherit; font-size: 14px; background: var(--head); }
.md-send { flex: 0 0 auto; width: 42px; height: 42px; min-height: 0; border-radius: 50%; border: none; background: var(--accent); color: var(--accent-ink); font-size: 17px; line-height: 1; display: flex; align-items: center; justify-content: center; padding: 0; }
.md-send:hover { background: var(--accent-hover); }
.md-send:disabled { opacity: .45; cursor: default; }
.md-anhang { flex: 0 0 auto; width: 42px; height: 42px; min-height: 0; border-radius: 50%; padding: 0; border: 1px solid var(--line); background: var(--card); color: var(--muted); display: flex; align-items: center; justify-content: center; }
.md-anhang:hover { background: var(--head); color: var(--ink); }
.md-anhang svg { width: 20px; height: 20px; }
/* Notizfeld rechts (nur Admin), auf- und zuklappbar; offen scrollt jede Spalte für sich (RLS M:407–430) */
#mdNotizen { display: none; }
#mdDetail.mitNotizen { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 320px); gap: 20px; align-items: stretch; overflow: hidden; height: 100%; box-sizing: border-box; }
#mdDetail.mitNotizen #mdHaupt { overflow: auto; min-height: 0; padding-right: 6px; }
#mdDetail.mitNotizen #mdNotizen { display: flex; flex-direction: column; overflow: auto; min-height: 100%; box-sizing: border-box; border-left: 1px solid var(--line); padding: 20px 0 0 16px; }
#mdNotizen .md-notiztitel { font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
#mdNotizen .md-notizhinweis { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
#mdNotizen .md-notizzu { font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
#mdNotizen .md-notizfuss { position: sticky; bottom: 0; background: var(--card); padding: 12px 0 20px; border-top: 1px solid var(--line); margin-top: auto; }
#mdNotizen textarea.md-klein { min-height: 42px; max-height: 160px; }
#mdNotizen .md-send { width: 38px; height: 38px; font-size: 15px; }
/* Handy (seit 18.11.2026, Wunsch Nutzer): geöffnete Meldung auf dem ganzen Bildschirm, „← Zurück“ oben links */
.md-zurueck { display: none; }
@media (max-width: 860px) {
  .md-seite.detail-offen .md-filter, .md-seite.detail-offen .md-raster > .md-karte:first-child, .md-seite.detail-offen .md-raster > .md-karte:last-child > .md-kartenkopf { display: none; }
  .md-seite.detail-offen .md-raster { margin: 0; }
  .md-zurueck { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--accent-hover); font-weight: 600; font-size: 15px; padding: 2px 0 8px; min-height: 0; }
  #mdDetail .md-admin-knoepfe { margin-left: 0; flex-wrap: wrap; }
  /* Chat ganz offen wie WhatsApp (seit 18.11.2026, Wunsch Nutzer): Kopfzeile („Problem melden“, „+ Neue Meldung“) und untere
     Leiste weg, das Ticket füllt den Bildschirm; oben klebt der Kopf mit „← Zurück“, unten klebt das Antwortfeld am Rand
     (#mdHaupt drückt den Fuß mit margin-top:auto nach unten, bei langem Verlauf klebt er) */
  body.md-chat-offen .topbar, body.md-chat-offen #bottomNav, body.md-chat-offen #seitenReiter { display: none !important; }
  body.md-chat-offen .md-seite.detail-offen .md-raster > .md-karte:last-child {
    position: fixed; inset: 0; z-index: 70; margin: 0; border: 0; border-radius: 0; box-shadow: none; overflow: hidden; height: 100dvh; }
  body.md-chat-offen .md-seite.detail-offen .md-raster > .md-karte:last-child > #mdDetail { flex: 1; min-height: 0; overflow: auto; padding: 0 16px; }
  body.md-chat-offen #mdDetail .md-kopf { padding-top: calc(12px + env(safe-area-inset-top)); }
  body.md-chat-offen #mdDetail .md-fuss { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
}
@media (max-width: 900px) {
  #mdDetail.mitNotizen { grid-template-columns: 1fr; height: auto; overflow: visible; }
  #mdDetail.mitNotizen #mdNotizen { border-left: none; padding-left: 0; border-top: 1px solid var(--line); padding-top: 16px; }
}
