:root {
  --bg: #f4f6f9; --card: #fff; --text: #1d2330; --muted: #6b7385; --line: #e2e6ee;
  --primary: #1f6feb; --ok: #1a8f4c; --warn: #c27c00; --danger: #c93636; --radius: 12px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
header { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 16px; background: var(--primary); color: #fff; }
header a { color: #fff; text-decoration: none; }
.brand { font-weight: 700; font-size: 18px; white-space: nowrap; }
nav { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
nav a, nav button { color: #fff; background: rgba(255,255,255,.15); border: 0; border-radius: 8px; padding: 6px 10px; font: inherit; font-size: 14px; cursor: pointer; }
@media (max-width: 600px) {
  header { flex-direction: column; align-items: stretch; padding: 8px 10px; }
  nav { justify-content: flex-start; gap: 4px; }
  nav a, nav button { font-size: 13px; padding: 5px 8px; }
}
main { max-width: 820px; margin: 0 auto; padding: 16px 12px 80px; }
h1 { font-size: 22px; margin: 4px 0 14px; }
h2 { font-size: 17px; margin: 22px 0 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.muted { color: var(--muted); font-size: 14px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
label { display: block; font-weight: 600; font-size: 14px; margin: 12px 0 4px; }
input, textarea, select { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
textarea { min-height: 100px; resize: vertical; }
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600;
  padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--text); cursor: pointer; text-decoration: none; }
button.primary, .btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
button.ok, .btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
button.danger { color: var(--danger); border-color: #f0c4c4; }
button.small, .btn.small { padding: 6px 10px; font-size: 14px; }
button:disabled { opacity: .55; cursor: wait; }
.big { width: 100%; padding: 14px; font-size: 17px; margin-top: 10px; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tabs button { flex: 1; }
.tabs button.active { background: var(--text); color: #fff; border-color: var(--text); }

.task { display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit; }
.task img, .task .ph { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex: none; background: #e9edf3;
  display: flex; align-items: center; justify-content: center; font-size: 26px; }
.task .t { font-weight: 650; }
.task.done .t { text-decoration: line-through; color: var(--muted); }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: #eef1f6; color: var(--muted); }
.badge.ok { background: #dff3e7; color: var(--ok); }
.badge.late { background: #fde6e6; color: var(--danger); }
.badge.soon { background: #fff2d6; color: var(--warn); }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.media { position: relative; }
.gallery img, .gallery video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: #000; display: block; }
.media .del { position: absolute; top: 4px; right: 4px; padding: 2px 8px; font-size: 13px; background: rgba(255,255,255,.92); }
.audio { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.audio audio { flex: 1; min-width: 0; }
.meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.desc { white-space: pre-wrap; }

.rec { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rec .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.pending { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pending span { background: #eef1f6; border-radius: 8px; padding: 4px 8px; font-size: 13px; }
.pending span button { border: 0; background: none; padding: 0 0 0 6px; color: var(--danger); }

#toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: #1d2330; color: #fff; padding: 10px 16px;
  border-radius: 10px; z-index: 50; max-width: 90vw; }
#toast.err { background: var(--danger); }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.9); display: flex; align-items: center; justify-content: center; z-index: 40; }
.lightbox img { max-width: 96vw; max-height: 92vh; }
.center { max-width: 380px; margin: 40px auto; }
.clock.in { border-color: #9bd8b4; background: #f3fbf6; }
button.danger-fill { background: var(--danger); border-color: var(--danger); color: #fff; }
.day { border-top: 1px solid var(--line); padding: 10px 0 4px; margin-top: 8px; }
.block { margin: 4px 0; font-size: 14px; }
.stamp { display: inline-flex; align-items: center; gap: 4px; background: #eef1f6; border-radius: 8px; padding: 2px 8px; }
.stamp a { text-decoration: none; }
.stamp.warn { background: #fde6e6; color: var(--danger); }
.stamp.live { background: #dff3e7; color: var(--ok); }
.stamp .x { border: 0; background: none; padding: 0 0 0 4px; color: var(--danger); font-size: 12px; }
.log { padding: 6px 14px; }
.logday { font-weight: 700; font-size: 13px; color: var(--muted); margin: 12px 0 4px; text-transform: capitalize; }
.logrow { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.logrow:last-child { border-bottom: 0; }
.logrow .time { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.logrow a { text-decoration: none; }
.badge.proj { background: #e8eefc; color: #2851a3; }
.projsum { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.card.archived { opacity: .6; }
.due { background: #fff6e0; border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; }
.doc { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.doc a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; color: var(--link, var(--primary)); font-weight: 600; }
.doc .del { position: static; }
.modal { position: fixed; inset: 0; background: rgba(20,25,35,.45); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 16px; }
.modal .dialog { width: 100%; max-width: 400px; margin: 0; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.modal .dialog p { margin: 0; font-size: 16px; }
.badge.task { background: #fff2d6; color: #8a5a00; text-decoration: none; }
.timerrow { padding: 6px 0; border-bottom: 1px solid var(--line); }
.timerrow.total { border-bottom: 0; font-weight: 700; }
.dialog .big { margin-top: 8px; }
.export { gap: 6px; }
.gbtn { display: flex; justify-content: center; min-height: 44px; }
.or { text-align: center; color: var(--muted); font-size: 14px; margin: 12px 0 0; }
.langs { display: flex; gap: 6px; margin-bottom: 12px; }
.langs button { flex: 1; }
.langs button.active { background: var(--text); color: #fff; border-color: var(--text); }
a.tel { color: var(--link, var(--primary)); font-weight: 600; text-decoration: none; white-space: nowrap; }
.call { width: 100%; margin-top: 12px; font-size: 17px; padding: 12px; }
.note { background: #f7f9fc; border-radius: 10px; padding: 10px 12px; }
.filebtn { position: relative; overflow: hidden; }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- Auswertungen, Spesen, Berichte, Verwaltung ---------- */
.tabs .btn { flex: 1; text-align: center; }
.tabs .btn.active { background: var(--text); color: #fff; border-color: var(--text); }
.small-hint { font-size: 12px; margin-top: 4px; }
.err-text { color: var(--danger); font-size: 14px; margin: 6px 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 10px 0; }
.card.stats { margin-top: 0; }
.stats > div { background: #f4f6f9; border-radius: 10px; padding: 8px 10px; }
.stats span { display: block; font-size: 12px; color: var(--muted); }
.stats b { font-size: 17px; font-variant-numeric: tabular-nums; }
.neg { color: var(--danger); }
.pos { color: var(--ok); }
.diff { font-size: 13px; font-variant-numeric: tabular-nums; min-width: 52px; text-align: right; }
.weekhead { background: #f4f6f9; border-radius: 10px; padding: 8px 10px; margin-top: 12px; }
.weekhead .row { gap: 6px; }
.progress { height: 10px; background: #eef1f6; border-radius: 99px; overflow: hidden; margin-top: 8px; }
.progress > div { height: 100%; background: var(--ok); border-radius: 99px; }
.progress.warn > div { background: var(--warn); }
.progress.over > div { background: var(--danger); }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 150px; padding-top: 18px; margin-top: 8px; }
.bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; position: relative; }
.bar .fill { width: 100%; max-width: 46px; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 0; }
.bar .l { font-size: 10px; color: var(--muted); margin-top: 3px; white-space: nowrap; }
.bar .v { font-size: 10px; color: var(--text); font-weight: 700; white-space: nowrap; }
.hbar { display: grid; grid-template-columns: minmax(80px, 30%) 1fr auto; gap: 8px; align-items: center; margin: 8px 0; font-size: 14px; }
.hbar .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { height: 12px; background: #eef1f6; border-radius: 99px; overflow: hidden; }
.hbar .track > div { height: 100%; background: var(--primary); border-radius: 99px; }
.hbar b { font-variant-numeric: tabular-nums; }
a.projcard { display: block; color: inherit; text-decoration: none; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 10px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); font-weight: 600; text-align: center; }
.tile .ic { font-size: 30px; }
.tile .cnt { position: absolute; top: 8px; right: 8px; background: var(--danger); color: #fff; border-radius: 99px; font-size: 12px; padding: 1px 8px; }
.expense .amount { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.expense.rejected { opacity: .65; }
.receipts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.receipts img { width: 70px; height: 70px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; }
.receipts a { font-size: 14px; }
.rcpt { position: relative; display: inline-block; }
.rcpt .x { position: absolute; top: -6px; right: -6px; background: var(--danger); color: #fff; border: 0; border-radius: 99px; width: 22px; height: 22px; padding: 0; font-size: 12px; }
.col-btns { flex-direction: column; align-items: stretch; gap: 6px; }
.bigamount { font-size: 22px; font-weight: 700; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { display: flex; align-items: center; gap: 6px; margin: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font-weight: 500; cursor: pointer; }
.seg label:has(input:checked) { border-color: var(--primary); background: #e8eefc; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.rule { gap: 6px; margin: 6px 0; font-size: 14px; }
.vacrow { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.vacrow:last-child { border-bottom: 0; }
.absence.rejected { opacity: .6; }
details.card summary { cursor: pointer; }
pre { background: #f4f6f9; border-radius: 8px; padding: 10px; overflow-x: auto; font-size: 12px; white-space: pre-wrap; word-break: break-all; }
.modal .dialog p { white-space: pre-wrap; overflow-wrap: anywhere; }
.modal .dialog { max-height: 90vh; overflow-y: auto; }
.seg input, label.check input, .seg input[type=radio], label.check input[type=checkbox] { width: auto; flex: none; margin: 0; min-height: 0; padding: 0; }
.seg label { flex: 1 1 auto; justify-content: flex-start; }

.danger-zone { border-color: #f1c4c4; margin-top: 18px; }

/* Design: Firmenfarbe & Logo */
:root { --on-primary: #fff; }
header, header a, nav a, nav button { color: var(--on-primary); }
button.primary, .btn.primary { color: var(--on-primary); }
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand img { height: 32px; max-width: 140px; object-fit: contain; border-radius: 4px; }
.login-brand { text-align: center; margin: 6px 0 14px; font-weight: 700; font-size: 20px; }
.login-brand img { max-height: 80px; max-width: 240px; object-fit: contain; display: block; margin: 0 auto 6px; }
.logo-prev { display: flex; align-items: center; justify-content: center; min-height: 80px; padding: 10px; margin-bottom: 10px;
  border: 1px dashed var(--line); border-radius: 10px; background: var(--primary); }
.logo-prev img { max-height: 70px; max-width: 100%; object-fit: contain; }
.logo-prev .muted { color: var(--on-primary); opacity: .8; }
.colors { gap: 6px; }
.swatch { width: 36px; height: 36px; padding: 0; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.swatch.active { box-shadow: 0 0 0 3px var(--text); }
.colors input[type=color] { width: 48px; height: 36px; padding: 2px; }

/* Meldungen */
.report-btn { margin: 0 0 14px; border: 2px dashed var(--warn); color: var(--warn); background: #fffaf0; }
.tabs button.alert:not(.active) { border-color: var(--warn); color: var(--warn); }
.badge.report { background: #fff2d6; color: #8a5a00; }
.report-actions { border-color: #f3d48a; background: #fffbf0; }

/* Liegenschaften / Codes */
.secret code.val { font: 600 18px/1.3 ui-monospace, Consolas, monospace; background: #f1f3f7; padding: 6px 10px; border-radius: 8px;
  letter-spacing: 1px; word-break: break-all; user-select: all; }
