:root {
  --accent: #1f4b99; --accent-dark: #173a78; --accent-soft: #e7eefa;
  --bg: #f6f5f2; --panel: #ffffff; --line: #e4e2dc; --text: #1c2230; --muted: #667085;
  --red: #c0263b; --red-soft: #fbe9ec; --amber: #a8690a; --amber-soft: #fdf1d8; --green: #1d7a4f; --green-soft: #e3f4ea;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; color: var(--text); background: var(--panel); }
h1 { font-size: 30px; font-weight: 500; margin: 0; }
h2 { font-size: 18px; font-weight: 600; margin: 28px 0 12px; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

/* Aufbau */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { background: var(--bg); border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { font-weight: 700; font-size: 17px; padding: 4px 10px 14px; letter-spacing: .2px; }
.brand small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.side .new { margin-bottom: 12px; justify-content: center; background: var(--accent-soft); color: var(--accent); border: 0; border-radius: 999px; }
.nav { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 6px; color: #3d4556; font-size: 15.5px; }
.nav:hover { background: #ecebe6; }
.nav.active { background: #23272f; color: #fff; font-weight: 600; }
.nav svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.side .spacer { flex: 1; }
.me { border-top: 1px solid var(--line); padding: 12px 10px 0; margin-top: 10px; font-size: 14px; }
.profil { position: relative; border-top: 1px solid var(--line); margin-top: 10px; padding-top: 8px; }
.profil > button { display: flex; gap: 10px; align-items: center; width: 100%; background: none; border: 0; padding: 8px 6px; border-radius: 8px; cursor: pointer; text-align: left; color: var(--text); font: inherit; }
.profil > button:hover { background: #ecebe6; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13.5px; flex: none; position: relative; }
.avatar .punkt { position: absolute; top: -1px; right: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--red); border: 2px solid var(--bg); }
.profil .wer { min-width: 0; } .profil .wer b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .profil .wer small { color: var(--muted); font-size: 12.5px; }
.profilmenu { position: absolute; bottom: calc(100% + 6px); left: 0; right: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.16); padding: 6px; z-index: 40; }
.profilmenu a { display: flex; align-items: center; gap: 10px; padding: 10px 10px; white-space: nowrap; border-radius: 6px; color: var(--text); cursor: pointer; font-size: 14.5px; }
.profilmenu a:hover { background: var(--bg); }
.profilmenu svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.profilmenu .zahl { margin-left: auto; background: #23272f; color: #fff; border-radius: 999px; font-size: 12px; padding: 1px 8px; }
.profilmenu .mail { border-top: 1px solid var(--line); margin-top: 4px; padding: 10px 10px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 13px; }
.einst { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 28px; align-items: start; }
.einst-nav { position: sticky; top: 10px; }
.einst-nav .gruppe { font-size: 12.5px; color: var(--muted); margin: 16px 10px 4px; }
.einst-nav .gruppe:first-child { margin-top: 0; }
.einst-nav a { display: block; padding: 8px 10px; border-radius: 6px; color: var(--text); font-size: 14.5px; }
.einst-nav a:hover { background: #ecebe6; }
.einst-nav a.active { background: var(--panel); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
ul.list li.klickbar { cursor: pointer; } ul.list li.klickbar:hover { background: var(--bg); }
details.faq { border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin-bottom: 10px; background: var(--panel); max-width: 900px; }
details.faq summary { cursor: pointer; font-weight: 600; }
details.faq p { margin: 10px 0 0; }
dialog.abschnitte { width: min(1020px, 96vw); }
dialog.breit { width: min(980px, 96vw); }
dialog.abschnitte .dlg-body { display: grid; grid-template-columns: 220px minmax(0, 1fr); padding: 0; max-height: calc(92vh - 140px); overflow: hidden; }
dialog.abschnitte nav { background: var(--bg); padding: 18px 12px; border-right: 1px solid var(--line); overflow-y: auto; }
dialog.abschnitte nav .gruppe { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin: 2px 12px 10px; }
dialog.abschnitte nav a { display: block; padding: 9px 12px; border-radius: 6px; color: var(--text); cursor: pointer; font-size: 15px; }
dialog.abschnitte nav a:hover { background: #ecebe6; }
dialog.abschnitte nav a.active { background: var(--panel); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
dialog.abschnitte .inhalt { padding: 18px 26px 30px; overflow-y: auto; max-height: calc(92vh - 140px); position: relative; }
dialog.abschnitte section { margin-bottom: 28px; }
dialog.abschnitte section h3 { margin: 0 0 12px; font-size: 17px; }
dialog.abschnitte .dlg-foot .err { margin-right: auto; }
.formgrid.drei { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.formgrid label.halb, .formgrid label.gross { grid-column: span 1; }
.zusatzadresse { border-top: 1px solid var(--line); padding-top: 14px; margin-bottom: 14px; }
.zusatzadresse .cardhead { margin-bottom: 8px; }
@media (max-width: 860px) { dialog.abschnitte .dlg-body { grid-template-columns: 1fr; } dialog.abschnitte nav { display: none; } .formgrid.drei { grid-template-columns: 1fr 1fr; } }
.note.fehlt { background: var(--amber-soft); border-left: 3px solid var(--amber); }
input.markiert, textarea.markiert, select.markiert { outline: 3px solid var(--amber); outline-offset: 1px; }
.qr { display: flex; justify-content: center; margin: 8px 0; }
.qr svg { width: 210px; height: 210px; }
ol.schritte { margin: 0 0 6px; padding-left: 20px; } ol.schritte li { margin-bottom: 4px; }
.notfallcodes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 24px; font: 600 17px/1.4 Consolas, monospace; background: var(--bg); border-radius: 8px; padding: 14px 20px; margin: 10px 0; }
.me b { display: block; }
.me .links { display: flex; gap: 12px; margin-top: 4px; font-size: 13px; }
.me .links a { cursor: pointer; }
main { padding: 34px 40px 60px; min-width: 0; }

/* Kopf, Knöpfe */
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-weight: 600; font-size: 14.5px; color: var(--text); }
.btn:hover { background: var(--bg); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.danger { color: var(--red); }
.btn.small { padding: 4px 10px; font-size: 13px; font-weight: 500; }
.btn.big { padding: 18px 44px; font-size: 20px; border-radius: 10px; }
.btn.stop { background: var(--red); border-color: var(--red); color: #fff; }

/* Reiter, Kacheln */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 16px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--text); border-color: var(--text); font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 16px 20px; }
.tile.click { cursor: pointer; }
.tile.sel { background: var(--panel); border-color: var(--accent); }
.tile .n { font-size: 32px; line-height: 1.1; color: var(--accent); }
.tile .n.red { color: var(--red); } .tile .n.amber { color: var(--amber); } .tile .n.green { color: var(--green); }
.tile .l { color: #3d4556; margin-top: 4px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 22px 26px; }
.card h3 { margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.card .kicker { color: var(--accent); font-size: 14px; margin-bottom: 8px; }
.card p { color: #4a5263; margin: 0 0 14px; }
.kpi { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; }
.kpi .big { font-size: 28px; color: var(--accent-dark); line-height: 1.1; }
.kpi small { color: #4a5263; font-size: 14px; }
.ring { width: 84px; height: 84px; flex: none; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.muted { color: var(--muted); }

/* Tabellen */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input[type=search], .toolbar select, .toolbar input[type=month] { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); min-width: 150px; }
.toolbar input[type=search] { min-width: 240px; }
.tablebox { border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th { text-align: left; background: var(--bg); padding: 11px 14px; font-weight: 600; white-space: nowrap; border-bottom: 1px solid var(--line); cursor: pointer; user-select: none; }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover { background: #faf9f6; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
td small { display: block; color: var(--muted); }
tfoot td { font-weight: 600; background: var(--bg); }
.neg { color: var(--red); } .pos { color: var(--green); }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 10px 2px; color: var(--muted); font-size: 14px; }
.pager .btn { padding: 4px 12px; }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 13px; font-weight: 600; background: #ecebe6; color: #3d4556; white-space: nowrap; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.blue { background: var(--accent-soft); color: var(--accent); }

/* Dialoge, Formulare */
dialog { border: 0; border-radius: 10px; padding: 0; width: min(720px, 94vw); max-height: 92vh; box-shadow: 0 20px 60px rgba(0,0,0,.25); color: var(--text); }
dialog::backdrop { background: rgba(20, 24, 33, .45); }
.dlg-head { padding: 20px 26px 0; font-size: 21px; font-weight: 600; }
.dlg-body { padding: 16px 26px; overflow-y: auto; max-height: calc(92vh - 150px); }
.dlg-foot { padding: 14px 26px 20px; display: flex; gap: 10px; justify-content: flex-end; }
.dlg-foot .left { margin-right: auto; }
.formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.formgrid label.full { grid-column: 1 / -1; }
label > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
label input, label select, label textarea { width: 100%; padding: 9px 11px; border: 1px solid #cfccc4; border-radius: 6px; background: #fff; }
label textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.err { color: var(--red); margin-top: 12px; min-height: 1em; }
.note { background: var(--bg); border-radius: 6px; padding: 10px 12px; margin-top: 8px; }
.note small { color: var(--muted); display: block; }
.inline { display: flex; gap: 8px; margin-top: 10px; }
.inline input { flex: 1; padding: 9px 11px; border: 1px solid #cfccc4; border-radius: 6px; min-width: 0; }
.hint { color: var(--muted); font-size: 13.5px; margin: 10px 0; }

/* Ablagefläche für Belege */
.drop { border: 2px dashed #b9c4d8; border-radius: 10px; padding: 26px 20px; text-align: center; background: var(--accent-soft); cursor: pointer; color: var(--accent-dark); }
.drop.over { border-color: var(--accent); background: #d6e3f8; }
.drop b { display: block; font-size: 17px; margin-bottom: 4px; }
.drop.busy { opacity: .6; pointer-events: none; }
dialog.wide { width: min(1080px, 96vw); }
.review td { vertical-align: top; }
.review input[type=text], .review input[type=number], .review select { width: 100%; padding: 7px 9px; border: 1px solid #cfccc4; border-radius: 6px; background: #fff; }
.review .chips { margin-top: 4px; display: flex; gap: 4px; flex-wrap: wrap; }
.review .chips a { font-size: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; cursor: pointer; color: var(--text); }
.review .warn { color: var(--amber); font-size: 13px; }

/* Zweispaltige Ansichten (Objekt, Bankkonto) */
.split { display: grid; grid-template-columns: 330px 1fr; gap: 26px; align-items: start; }
.split > * { min-width: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; margin-bottom: 12px; }
.panel.click { cursor: pointer; }
.panel.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.panel h3 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.panel .row { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.panel small { color: var(--muted); display: block; }
.grouphead { text-transform: uppercase; font-size: 12.5px; letter-spacing: .4px; color: var(--muted); margin: 18px 4px 8px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 18px; margin: 6px 0 4px; }
.facts .v { font-size: 20px; }
.facts .k { color: var(--muted); font-size: 13.5px; }
.zweck { max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1000px) { .split { grid-template-columns: 1fr; } }

.updatebar { background: var(--amber-soft); color: var(--amber); padding: 10px 18px; font-weight: 600; text-align: center; }

/* Aufklappmenü und Einheitenansicht */
.menuwrap { position: relative; display: inline-block; }
.menu { position: absolute; right: 0; top: calc(100% + 4px); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.14); min-width: 250px; z-index: 30; padding: 6px; text-align: left; }
.menu a { display: block; padding: 9px 12px; border-radius: 6px; color: var(--text); cursor: pointer; white-space: nowrap; font-weight: 400; }
.menu a:hover { background: var(--bg); }
.menu a.danger { color: var(--red); }
.menu label.wahl { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 6px; cursor: pointer; white-space: nowrap; color: var(--text); font-size: 14px; margin: 0; }
.menu label.wahl:hover { background: var(--bg); }
.menu label.wahl input { width: auto; margin: 0; }
.personen { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle; }
.cols2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.cols2 > div > .card { margin-bottom: 20px; }
.cardhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.cardhead h3 { margin: 0; }
.haken { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #c3cad6; background: var(--panel); color: transparent; cursor: pointer; font-weight: 700; font-size: 14px; line-height: 1; padding: 0; flex: none; }
.haken:hover { border-color: var(--green); color: var(--green); }
.haken.an { background: var(--green); border-color: var(--green); color: #fff; }
.auswahlbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: var(--accent-soft); border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; }
.auswahlbar select, select.mini { width: auto; padding: 4px 8px; font-size: 13px; max-width: 170px; }
tr.erledigt td { color: var(--muted); }
.mailtext { font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; background: var(--bg); border-radius: 6px; padding: 12px 14px; max-height: 46vh; overflow: auto; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; color: var(--muted); user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch i { width: 42px; height: 24px; border-radius: 999px; background: #c3cad6; position: relative; transition: background .15s; flex: none; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { left: 21px; }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.bilder { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-bottom: 14px; }
.bild { position: relative; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.bild img { width: 100%; height: 96px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.bild > .badge { position: absolute; top: 6px; left: 6px; }
.card table { background: var(--panel); }
.chips2 { display: flex; gap: 6px; flex-wrap: wrap; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.checks label { display: flex; gap: 8px; align-items: center; }
.checks input { width: auto; }
@media (max-width: 1100px) { .cols2 { grid-template-columns: minmax(0, 1fr); } }
.cols2 > div { min-width: 0; }

/* Anmeldung */
.login { min-height: 100vh; display: grid; place-items: center; background: var(--bg); padding: 16px; }
.login form, .login .loginbox { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 34px; width: min(420px, 100%); display: grid; gap: 14px; }
.login h1 { font-size: 24px; font-weight: 600; }
.check { display: flex; gap: 10px; align-items: center; }
.check input { width: auto; }
.check span { margin: 0; font-size: 14px; color: var(--text); }

/* Stempeluhr */
.clock { text-align: center; padding: 34px 20px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 22px; }
.clock .time { font-size: 64px; font-weight: 300; font-variant-numeric: tabular-nums; line-height: 1; }
.clock .date { color: var(--muted); margin: 8px 0 18px; }
.clock .state { margin: 0 0 20px; font-size: 17px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #23272f; color: #fff; padding: 11px 20px; border-radius: 8px; z-index: 99; box-shadow: 0 6px 24px rgba(0,0,0,.25); }

.topbar, .schleier { display: none; }
.suchknopf { display: flex; align-items: center; justify-content: space-between; width: 100%; margin: 0 0 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); cursor: pointer; font: inherit; font-size: 14px; }
.suchknopf kbd { font-size: 11px; border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; color: var(--muted); font-family: inherit; }
.suchtreffer a { display: block; padding: 8px 10px; border-radius: 6px; text-decoration: none; color: var(--text); }
.suchtreffer a:hover, .suchtreffer a.aktiv { background: var(--bg); }
.suchtreffer small { display: block; color: var(--muted); }
dialog.suche { margin-top: 8vh; width: min(640px, 96vw); }
.suchtreffer h4 { margin: 12px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
tr.klickbar { cursor: pointer; }
tr.klickbar:hover td { background: var(--bg); }
dialog.seite { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(560px, 100vw); border-radius: 0; flex-direction: column; }
dialog.seite[open] { display: flex; }
dialog.seite .dlg-body { flex: 1; overflow-y: auto; max-height: none; }
.buchkopf { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.abschn { padding: 14px 0; border-bottom: 1px solid var(--line); }
.abschn h3 { margin: 0 0 8px; font-size: 15px; }
.volltext { white-space: pre-wrap; word-break: break-word; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 14px; line-height: 1.5; margin-bottom: 8px; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 3px 0; }
.kv span { color: var(--muted); }
.kv b { text-align: right; font-weight: 600; word-break: break-word; }
.ablage { border: 2px dashed var(--line); border-radius: 8px; padding: 14px; text-align: center; cursor: pointer; color: var(--muted); }
.ablage.drueber { border-color: var(--accent); background: rgba(31,75,153,.06); }
.aktionen { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.aktionen a, .aktionen button { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.aktionen .anruf { background: #1f7a4d; border-color: #1f7a4d; color: #fff; }
.unterwegs { display: none; }
.unterwegs .tile { text-align: center; text-decoration: none; color: var(--text); }
.unterwegs .tile .sym { font-size: 26px; line-height: 1; margin-bottom: 6px; }
a.tel { white-space: nowrap; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .topbar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 50; background: var(--accent); color: #fff;
    padding: 6px 10px; padding-top: calc(6px + env(safe-area-inset-top)); box-shadow: 0 1px 6px rgba(0,0,0,.15); }
  .topbar .titel { font-weight: 600; font-size: 17px; }
  .menuknopf { background: none; border: 0; color: #fff; font-size: 24px; line-height: 1; padding: 8px 10px; cursor: pointer; border-radius: 6px; }
  .menuknopf:active { background: rgba(255,255,255,.15); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: min(290px, 86vw); height: 100%; z-index: 70; transform: translateX(-105%);
    transition: transform .2s ease; box-shadow: 0 0 30px rgba(0,0,0,.25); padding-top: calc(18px + env(safe-area-inset-top)); padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .shell.offen .side { transform: none; }
  .shell.offen .schleier { display: block; position: fixed; inset: 0; background: rgba(20, 24, 33, .45); z-index: 60; }
  .einst { grid-template-columns: 1fr; }
  .einst-nav { position: static; }
  main { padding: 18px 14px calc(50px + env(safe-area-inset-bottom)); }
  h1 { font-size: 22px; }
  .formgrid { grid-template-columns: 1fr; }
  .clock .time { font-size: 48px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile .n { font-size: 24px; }
  .toolbar input[type=search] { min-width: 0; flex: 1 1 100%; }
  .toolbar select { min-width: 0; flex: 1 1 auto; }
  .pagehead .actions { flex-wrap: wrap; }
  dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
  .dlg-body { padding: 14px 16px; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .tabs a { flex: none; white-space: nowrap; }
  .unterwegs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 22px; }
  .unterwegs .tile { padding: 14px 6px; font-size: 13.5px; font-weight: 600; }
  .aktionen a, .aktionen button { flex: 1 1 calc(50% - 8px); justify-content: center; padding: 12px 10px; font-size: 15px; }
}

/* Dokument-Editor (Vorlagen, Verträge) – Blatt wie beim Drucken */
dialog.dok-dialog { width: min(1080px, 98vw); }
dialog.dok-dialog .dlg-body { max-height: calc(94vh - 130px); }
.dok-editor { border: 1px solid var(--line); border-radius: 10px; background: #e9ebef; }
.dok-leiste { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; background: var(--panel); border-bottom: 1px solid var(--line); border-radius: 10px 10px 0 0; }
.dok-leiste .btn.small { min-width: 34px; padding: 5px 9px; }
.dok-leiste select { width: auto; padding: 5px 8px; font-size: 13.5px; }
.dok-rahmen { padding: 18px 10px; overflow-x: auto; }
.dok-blatt { background: #fff; width: 190mm; max-width: 100%; min-height: 270mm; margin: 0 auto; padding: 16mm 14mm; box-sizing: border-box; box-shadow: 0 1px 6px rgba(0,0,0,.15);
  font-family: Arial, Helvetica, sans-serif; color: #1d2433; font-size: 13px; line-height: 1.5; outline: none; }
.dok-blatt h1 { font-size: 19px; margin: 0 0 12px; text-align: center; } .dok-blatt h2 { font-size: 14px; margin: 18px 0 6px; } .dok-blatt h3 { font-size: 13px; margin: 12px 0 4px; }
.dok-blatt p { margin: 0 0 8px; } .dok-blatt ul, .dok-blatt ol { margin: 0 0 8px; padding-left: 22px; }
.dok-blatt table { border-collapse: collapse; width: 100%; margin: 6px 0 10px; } .dok-blatt td, .dok-blatt th { border: 1px solid #9aa3b2; padding: 4px 6px; vertical-align: top; min-width: 20px; }
.dok-blatt table.ohne td, .dok-blatt table.ohne th { border-color: transparent; outline: 1px dashed #d5d9e0; }
.dok-blatt .seitenumbruch { border: 0; border-top: 2px dashed #9aa3b2; margin: 18px -14mm; height: 0; }
.dok-blatt img { max-width: 100%; }
@media (max-width: 760px) { .dok-blatt { padding: 8mm 6mm; min-height: 0; } }

/* Unterschriftsfelder und Unterschriften-Pad */
.dok-blatt .u-reihe { display: flex; gap: 36px; margin: 34px 0 10px; }
.dok-blatt .u-feld { flex: 1; min-width: 0; cursor: pointer; border-radius: 6px; }
.dok-blatt .u-bild { height: 64px; display: flex; align-items: flex-end; }
.dok-blatt .u-bild img { max-height: 64px; max-width: 100%; }
.dok-blatt .u-text { border-top: 1px solid #1d2433; padding-top: 3px; font-size: 11.5px; }
.dok-blatt .u-feld:hover { background: #f3f6fb; }
.dok-blatt .u-bild:empty { background: repeating-linear-gradient(135deg, transparent 0 8px, #eef1f6 8px 10px); }
.dok-blatt.unterschreibbar .u-bild:empty::after { content: '✍ Hier tippen zum Unterschreiben'; color: #6b7a99; font-size: 12px; margin: 0 auto 6px; }
dialog.u-pad { width: min(760px, 98vw); }
.u-flaeche { position: relative; border: 1px solid var(--line); border-radius: 10px; background: #fff; margin-bottom: 10px; }
.u-flaeche canvas { display: block; width: 100%; height: auto; aspect-ratio: 3 / 1; touch-action: none; cursor: crosshair; }
.u-grundlinie { position: absolute; left: 6%; right: 6%; bottom: 22%; border-bottom: 1px dashed #b5bfd0; pointer-events: none; }
@media (max-width: 760px) {
  dialog.dok-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  dialog.dok-dialog .dlg-body { max-height: calc(100dvh - 120px); padding: 10px; }
  .dok-rahmen { padding: 8px 0; }
  .dok-leiste { gap: 3px; padding: 6px; }
  .dok-leiste select { max-width: 46vw; }
  .dok-blatt .u-reihe { gap: 14px; }
}

/* Bildnachweise im Dokument */
.dok-blatt .foto-anhang { margin-top: 24px; }
.dok-blatt .foto-seite { border-top: 2px dashed #9aa3b2; margin: 18px -14mm 0; padding: 14px 14mm 6px; text-align: center; cursor: pointer; }
.dok-blatt .foto-titel { font-weight: 700; font-size: 15px; margin-bottom: 8px; text-align: left; }
.dok-blatt .foto-seite img { max-width: 100%; max-height: 520px; object-fit: contain; border-radius: 4px; }
.dok-blatt .foto-zeit { font-size: 11px; color: #667085; margin-top: 6px; }
@media (max-width: 760px) { .dok-blatt .foto-seite { margin: 14px -6mm 0; padding: 12px 6mm 4px; } }
