:root {
  --green: #76b728;
  --green-dark: #5e9420;
  --blue: #0091a7;
  --blue-dark: #00788a;
  --blue-soft: #e5f4f6;
  --bg: #f4f6f7;
  --panel: #ffffff;
  --side: #eef1f2;
  --text: #1f2a30;
  --muted: #6b7880;
  --line: #dde3e6;
  --red: #d64545;
  --red-soft: #fdecec;
  --orange: #d9822b;
  --orange-soft: #fdf2e6;
  --radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  color: var(--text);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-card { width: 100%; max-width: 380px; background: var(--panel); border-radius: 12px; padding: 32px; box-shadow: 0 6px 30px rgba(0,0,0,.08); }
.auth-card img { width: 220px; display: block; margin: 0 auto 24px; }
.auth-card h1 { font-size: 18px; margin: 0 0 4px; text-align: center; }
.auth-card p { color: var(--muted); text-align: center; margin: 0 0 20px; font-size: 14px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel);
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .addbar input:focus { outline: 2px solid var(--blue); outline-offset: -1px; border-color: transparent; }
.btn { border: 0; border-radius: 6px; padding: 9px 16px; background: var(--blue); color: #fff; font-weight: 600; }
.btn:hover { background: var(--blue-dark); }
.btn.full { width: 100%; }
.btn.secondary { background: var(--panel); color: var(--text); border: 1px solid var(--line); }
.btn.secondary:hover { background: var(--bg); }
.btn.danger { background: var(--panel); color: var(--red); border: 1px solid #f0c4c4; }
.btn.danger:hover { background: var(--red-soft); }
.btn.small { padding: 5px 10px; font-size: 13px; font-weight: 500; }
.error { color: var(--red); font-size: 14px; min-height: 20px; margin: 4px 0 10px; }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: 290px 1fr auto; height: 100vh; }
.sidebar { background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.side-head { padding: 18px 18px 10px; }
.side-head img { width: 170px; display: block; }
.side-user { font-size: 13px; color: var(--muted); margin-top: 10px; }
.side-search { margin: 6px 14px 8px; }
.side-search input { width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.side-scroll { overflow-y: auto; flex: 1; padding: 4px 8px 8px; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px; }
.nav-item:hover { background: rgba(0,0,0,.05); }
.nav-item.active { background: var(--panel); box-shadow: 0 1px 2px rgba(0,0,0,.06); font-weight: 600; }
.nav-item .ico { width: 18px; text-align: center; color: var(--blue); flex: none; }
.nav-item .label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .count { font-size: 12px; color: var(--muted); }
.nav-item .count.red { color: #fff; background: var(--red); border-radius: 10px; padding: 0 7px; font-weight: 600; }
.nav-sep { height: 1px; background: var(--line); margin: 8px 10px; }
.nav-title { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 6px 10px 4px; }
.side-foot { border-top: 1px solid var(--line); padding: 8px; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.main-head { padding: 22px 28px 12px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.main-head h1 { font-size: 26px; margin: 0; flex: 1 1 320px; color: var(--blue); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main-head .actions { display: flex; gap: 8px; }
.main-body { flex: 1; overflow-y: auto; padding: 0 28px 16px; }
.empty { color: var(--muted); text-align: center; padding: 60px 20px; }

/* ---------- Fristen ---------- */
.task { display: flex; align-items: center; gap: 12px; background: var(--panel); border-radius: var(--radius); padding: 11px 14px; margin-bottom: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.05); cursor: pointer; border-left: 4px solid transparent; }
.task:hover { background: light-dark(#fafcfc, var(--soft)); }
.task.selected { background: var(--blue-soft); }
.task.overdue { border-left-color: var(--red); }
.task.soon { border-left-color: var(--orange); }
.task.done .t-title { color: var(--muted); }
.check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--blue); background: var(--panel); flex: none; display: grid; place-items: center; padding: 0; }
.check:hover { background: var(--blue-soft); }
.check.on { background: var(--green); border-color: var(--green); color: #fff; }
.check.on::after { content: "✓"; font-size: 13px; font-weight: 700; }
.t-main { flex: 1; min-width: 0; }
.t-title { font-weight: 500; }
.t-meta { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 3px; }
.chip { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 10px; background: var(--bg); color: var(--muted); }
.chip.red { background: var(--red-soft); color: var(--red); font-weight: 600; }
.chip.orange { background: var(--orange-soft); color: var(--orange); font-weight: 600; }
.chip.src { background: var(--blue-soft); color: var(--blue-dark); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: light-dark(#d8ecc0, var(--soft)); color: var(--green-dark); font-size: 12px; font-weight: 700; display: grid; place-items: center; flex: none; }
.star { border: 0; background: none; font-size: 18px; color: #b8c2c7; padding: 2px; }
.star.on { color: var(--blue); }
.group-toggle { border: 0; background: none; color: var(--muted); padding: 12px 4px 6px; font-weight: 600; }

.addbar { margin: 0 28px 20px; display: flex; gap: 8px; background: var(--panel); border-radius: var(--radius); padding: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.addbar input { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
.addbar input[name=title] { flex: 1; min-width: 0; }
.addbar input[name=source] { width: 130px; }

/* ---------- Detail ---------- */
.detail { width: 380px; background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.detail-head { display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); gap: 8px; }
.detail-head strong { flex: 1; }
.icon-btn { border: 0; background: none; font-size: 20px; color: var(--muted); padding: 2px 6px; border-radius: 6px; }
.icon-btn:hover { background: var(--bg); }
.detail-body { padding: 16px; overflow-y: auto; flex: 1; }
.detail-body .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.detail-foot { padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.detail-foot span { flex: 1; }

/* ---------- Einstellungen ---------- */
.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tab { border: 0; background: none; padding: 8px 14px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; }
.tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.card { background: var(--panel); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(0,0,0,.05); padding: 16px; margin-bottom: 16px; }
.perm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.perm-table th { font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: bottom; }
.perm-table th:first-child { text-align: left; }
.perm-table td { padding: 10px 6px; border-bottom: 1px solid var(--line); text-align: center; }
.perm-table td:first-child { text-align: left; }
.perm-table tr.inactive td { opacity: .5; }
.perm-table input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--green); cursor: pointer; }
.perm-table .sub { color: var(--muted); font-size: 12px; }
.table-scroll { overflow-x: auto; }
.inline-form { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 10px; align-items: end; }
.inline-form .field { margin: 0; }
.audit-row { display: grid; grid-template-columns: 150px 140px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.audit-row .when { color: var(--muted); }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 12px; }

/* ---------- Modal & Toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(20,30,35,.35); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--panel); border-radius: 12px; padding: 22px; width: 100%; max-width: 420px; box-shadow: 0 10px 40px rgba(0,0,0,.2); max-height: 90vh; overflow-y: auto; }
.modal h2 { margin: 0 0 12px; font-size: 18px; }
.modal .buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.checklist label { display: flex; gap: 8px; align-items: center; padding: 4px 0; }
.toast { position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 60; font-size: 14px; }

/* ---------- Schmal (Tablet/Handy) ---------- */
.menu-btn { display: none; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 290px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  .menu-btn { display: inline-block; }
  .detail { position: fixed; inset: 0; width: auto; z-index: 45; }
  .main-head, .main-body { padding-left: 16px; padding-right: 16px; }
  .addbar { margin: 0 16px 16px; flex-wrap: wrap; }
  .addbar input[name=title] { flex-basis: 100%; }
  .addbar input[name=source] { flex: 1; width: auto; }
  .main-head { flex-wrap: wrap; }
  .main-head h1 { flex: 1 1 calc(100% - 60px); font-size: 22px; }
  .main-head .actions { width: 100%; flex-wrap: wrap; }
  .inline-form { grid-template-columns: 1fr; }
}

/* ---------- KI / Prüfschritt ---------- */
.warn { background: var(--orange-soft); color: #8a4b0f; border-radius: 6px; padding: 8px 12px; font-size: 14px; margin-bottom: 10px; }
.or { text-align: center; color: var(--muted); font-size: 13px; margin: 14px 0 10px; }
.progress { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; margin: 10px 0; }
.progress div { height: 100%; background: var(--green); transition: width .3s; }
.nav-item .count.orange { color: #fff; background: var(--orange); border-radius: 10px; padding: 0 7px; font-weight: 600; font-size: 11px; }
.section-title { font-size: 17px; margin: 22px 0 10px; color: var(--text); }
.section-title .hint { font-weight: 400; font-size: 13px; }
.review-meta { font-size: 13px; color: var(--muted); }
.rv-row { background: var(--panel); border-radius: var(--radius); padding: 14px; margin-bottom: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.05); border-left: 4px solid var(--line); }
.rv-row.accept { border-left-color: var(--green); background: light-dark(#f6fbef, var(--soft)); }
.rv-row.reject { border-left-color: var(--red); opacity: .55; }
.rv-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0 10px; }
.rv-grid .field { margin-bottom: 8px; }
.rv-title { grid-column: 1 / 2; }
.rv-ref { grid-column: 2 / 4; }
.rv-note { grid-column: 1 / 4; }
.rv-note textarea { min-height: 64px; font-size: 13px; }
.rv-actions { display: flex; gap: 8px; justify-content: flex-end; }
.btn.ok { background: var(--panel); color: var(--green-dark); border: 1px solid #cfe5b5; }
.btn.ok.on, .btn.ok:hover { background: var(--green); color: #fff; border-color: var(--green); }
.btn.no { background: var(--panel); color: var(--red); border: 1px solid #f0c4c4; }
.btn.no.on, .btn.no:hover { background: var(--red); color: #fff; border-color: var(--red); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.facts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.check-line { display: flex; gap: 8px; align-items: center; font-weight: 600; margin-top: 6px; }
.check-line input { width: 18px; height: 18px; accent-color: var(--green); }
.rv-footer { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0 4px; display: flex; gap: 10px; align-items: center; border-top: 1px solid var(--line); margin-top: 12px; }
.rv-footer span { flex: 1; font-size: 14px; }
.modal.wide { max-width: 640px; }
@media (max-width: 900px) {
  .rv-grid, .facts-grid { grid-template-columns: 1fr; }
  .rv-title, .rv-ref, .rv-note { grid-column: auto; }
  .rv-footer { flex-wrap: wrap; }
}

/* ---------- Frist im Mittelpunkt (Entwurf A + C) ---------- */
.head-title { flex: 1 1 320px; min-width: 0; }
.head-title h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subtitle { color: var(--muted); font-size: 14px; margin-top: 2px; }
.main-head h1 { flex: none; }
.cd { font-size: 12px; font-weight: 700; border-radius: 10px; padding: 1px 8px; white-space: nowrap; flex: none; }
.cd.r { background: var(--red); color: #fff; }
.cd.o { background: var(--orange-soft); color: var(--orange); }
.cd.g { background: light-dark(#eaf4dd, var(--soft)); color: var(--green-dark); }
.cd.n { background: light-dark(#e3e8ea, var(--soft)); color: var(--muted); font-weight: 500; }

.hero { display: flex; gap: 14px; margin: 4px 0 6px; }
.hcard { background: var(--panel); border-radius: 12px; padding: 14px 18px; box-shadow: 0 1px 3px rgba(0,0,0,.06); flex: 1; min-width: 0; border-top: 4px solid var(--line); }
.hcard .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.hcard .v { font-size: 28px; font-weight: 800; margin-top: 4px; line-height: 1.15; }
.hcard .t { font-size: 14px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hcard.r { border-top-color: var(--red); } .hcard.r .v { color: var(--red); }
.hcard.o { border-top-color: var(--orange); }
.hcard.b { border-top-color: var(--blue); }
.hcard.g { border-top-color: var(--green); } .hcard.g .v { color: var(--green-dark); }

.pills-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 14px 0; }
.pills-row .pills { margin: 0; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0; }
.pill { padding: 6px 14px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); font-size: 14px; }
.pill:hover { background: var(--blue-soft); }
.pill.act { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 600; }

.grp { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 18px 0 8px; }
.grp span { font-weight: 500; }
.grp.r { color: var(--red); }
.row { display: flex; align-items: center; gap: 14px; background: var(--panel); border-radius: 10px; padding: 10px 16px 10px 12px; margin-bottom: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.05); cursor: pointer; }
.row:hover { background: light-dark(#fafcfc, var(--soft)); }
.row.selected { background: var(--blue-soft); }
.rt { flex: 1; min-width: 0; }
.t-meta { align-items: center; }
.dt { width: 78px; text-align: center; border-radius: 10px; padding: 7px 0 6px; background: var(--blue-soft); color: var(--blue-dark); flex: none; }
.dt .m { font-size: 20px; font-weight: 800; line-height: 1.05; text-transform: uppercase; letter-spacing: .02em; }
.dt .y { font-size: 18px; font-weight: 800; line-height: 1.1; }
.dt .d { font-size: 11px; font-weight: 500; opacity: .75; margin-top: 2px; }
.dt.r { background: var(--red); color: #fff; }
.dt.o { background: var(--orange); color: #fff; }
.dt.none { background: var(--bg); color: var(--muted); }
.dt.none .m { font-size: 18px; }
.big { font-size: 18px; font-weight: 800; white-space: nowrap; text-align: right; min-width: 120px; flex: none; }
.big small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.big.r { color: var(--red); }
.big.o { color: var(--orange); }
.tag { font-size: 12px; padding: 1px 8px; border-radius: 10px; font-weight: 600; white-space: nowrap; }
.tag.bau { background: light-dark(#eaf4dd, var(--soft)); color: var(--green-dark); }
.tag.vertrag { background: var(--blue-soft); color: var(--blue-dark); }
.tag.kfm { background: light-dark(#efe9f7, var(--soft)); color: #6b4fa0; }

.ov-head, .ov-row { display: grid; grid-template-columns: minmax(160px, 1.3fr) minmax(200px, 2fr) 140px minmax(150px, 1fr) 110px; gap: 14px; align-items: center; }
.ov-head { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 0 16px 4px 21px; }
.ov-row { background: var(--panel); border-radius: 10px; padding: 12px 16px; margin-bottom: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.05); border-left: 5px solid var(--line); cursor: pointer; }
.ov-row:hover { background: light-dark(#fafcfc, var(--soft)); }
.ov-row.r { border-left-color: var(--red); }
.ov-row.o { border-left-color: var(--orange); }
.ov-row.g { border-left-color: var(--green); }
.ov-row .pn { font-weight: 700; min-width: 0; }
.ov-row .pn small, .ov-row .nx > span { display: block; font-weight: 400; color: var(--muted); font-size: 12px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-row .nx { min-width: 0; }
.ov-row .nx b { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-row .big { text-align: left; min-width: 0; }
.ov-row .cnt { display: flex; gap: 4px; flex-wrap: wrap; }
.ov-row .ho { font-size: 14px; }

.addbar { flex-wrap: wrap; }
.addbar input[name=title] { flex: 1 1 260px; }
.addbar select { border: 1px solid var(--line); border-radius: 6px; padding: 8px; background: var(--panel); max-width: 190px; }
.small-select { padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); font-size: 13px; }

@media (max-width: 900px) {
  .hero { gap: 6px; }
  .hcard { padding: 10px; }
  .hcard .k { font-size: 10px; letter-spacing: 0; }
  .hcard .v { font-size: 16px; }
  .hcard .t { display: none; }
  .ov-head { display: none; }
  .ov-row { grid-template-columns: 1fr auto; gap: 6px 10px; }
  .ov-row .pn { grid-column: 1; }
  .ov-row .big { grid-column: 2; grid-row: 1; text-align: right; }
  .ov-row .nx, .ov-row .cnt { grid-column: 1 / 3; }
  .ov-row .ho { display: none; }
  .row { gap: 10px; padding: 10px; flex-wrap: wrap; }
  .row .rt { flex: 1 1 calc(100% - 120px); }
  .row .big { flex-basis: 100%; min-width: 0; font-size: 15px; text-align: right; margin-top: -4px; }
  .row .big small { display: inline; margin-left: 6px; }
  .subtitle { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; }
  .addbar { gap: 6px; }
  .addbar input[name=source] { display: none; }
  .addbar input[name=title] { flex: 1 1 100%; }
  .addbar select, .addbar input[name=due_date] { flex: 1 1 40%; min-width: 0; max-width: none; }
  .addbar .btn { flex: 1 1 40%; }
}
.steps { padding-left: 20px; margin: 0 0 14px; font-size: 14px; }
.steps li { margin-bottom: 8px; }

/* ---------- Version 3: Zeitstrahl, Kurznamen, Mieter ---------- */
.t-title { font-size: 16px; font-weight: 700; }
.t-desc { font-size: 13px; color: var(--muted); margin-top: 1px; }
.big { font-size: 19px; }
.tag.tenant { background: var(--text); color: #fff; }
.check.ro { border-color: var(--line); cursor: default; }
.pills-label { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; align-self: center; margin-right: 4px; }
.tenant-pills { margin-top: -6px; }
.ho-line { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ho-line + .ho-line { margin-top: 2px; }
.ho-line .v { font-size: 24px; }
.hcard .v { font-size: 26px; }
.demo-list { display: flex; flex-direction: column; gap: 6px; }
.facts-sub { grid-column: 1 / -1; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--blue-dark); font-weight: 700; margin: 10px 0 6px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.rv-short input { font-weight: 700; font-size: 16px; }
.rv-short { grid-column: 1 / 2; }

.tl { position: relative; background: var(--panel); border-radius: 12px; padding: 14px 22px 12px; box-shadow: 0 1px 3px rgba(0,0,0,.06); margin: 6px 0 14px; }
.tl-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tl-head strong { flex: 1; font-size: 15px; }
.tl-head .pills { margin: 0; }
.tl-empty { color: var(--muted); padding: 24px 0 8px; text-align: center; }
/* --ly: Höhe der Linie; darüber die Klammern „noch X Monate“ (je Zeile 26px) und die Übergabe-Fähnchen */
.tl-track { --rows: 0; --ly: calc(var(--rows) * 26px + 54px); position: relative; height: calc(var(--ly) + 50px); margin: 10px 6px 0; }
.tl-line { position: absolute; left: 0; right: 0; top: var(--ly); height: 6px; margin-top: -3px; border-radius: 3px; background: linear-gradient(90deg, var(--green), var(--blue)); }
.tl-past { position: absolute; left: 0; top: var(--ly); height: 6px; margin-top: -3px; border-radius: 3px 0 0 3px; background: rgba(255,255,255,.6); }
.tl-tick { position: absolute; top: calc(var(--ly) + 6px); height: 6px; border-left: 1px solid #cfd7db; }
.tl-tick span { position: absolute; top: 7px; left: 0; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
.tl-tick.year { height: 30px; border-left-color: #9aa6ad; }
.tl-year { position: absolute; top: calc(var(--ly) + 26px); padding-left: 4px; font-size: 12px; font-weight: 800; color: var(--text); white-space: nowrap; }
.tl-today { position: absolute; top: calc(var(--ly) - 26px); height: 32px; border-left: 2px dashed var(--text); margin-left: -1px; z-index: 1; }
.tl-today span { position: absolute; top: -15px; left: 0; transform: translateX(-50%); font-size: 11px; font-weight: 700; white-space: nowrap; background: var(--panel); padding: 0 3px; }
.tl-br { position: absolute; top: calc(var(--row) * 26px + 12px); height: 10px; border: 2px solid var(--blue); border-bottom: 0; border-radius: 5px 5px 0 0; }
.tl-br.latest { border-color: var(--red); }
.tl-br span { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: var(--panel); padding: 0 8px; font-size: 12.5px; font-weight: 800; color: var(--blue-dark); white-space: nowrap; }
.tl-br.latest span { color: var(--red); }
.tl-band { position: absolute; top: calc(var(--ly) - 10px); height: 20px; border-radius: 4px; background: repeating-linear-gradient(45deg, rgba(214,69,69,.13) 0 5px, transparent 5px 10px); }
.tl-flag { position: absolute; top: calc(var(--ly) - 26px); height: 26px; border-left: 2px solid var(--blue); margin-left: -1px; }
.tl-flag.latest { border-left-color: var(--red); }
.tl-flag.done { border-left-color: #c3cbd0; }
.tl-flag span { position: absolute; bottom: 26px; left: 0; white-space: nowrap; font-size: 11px; font-weight: 700; color: var(--blue-dark); line-height: 1.2; }
.tl-flag.latest span { color: var(--red); }
.tl-flag.done span { color: var(--muted); }
.tl-flag b { margin-left: 4px; font-weight: 800; }
.tl-pt { --lvl: 0; position: absolute; top: calc(var(--ly) - var(--lvl) * 15px); width: 16px; height: 16px; margin: -8px 0 0 -8px; padding: 0; border: 3px solid #fff;
  border-radius: 4px; transform: rotate(45deg); background: #9aa6ad; box-shadow: 0 1px 3px rgba(0,0,0,.25); cursor: pointer; transition: transform .1s; z-index: 2; }
.tl-pt.bau { background: var(--green); }
.tl-pt.vertrag { background: var(--blue); }
.tl-pt.kfm { background: #4c5a62; }
.tl-pt.r { box-shadow: 0 0 0 2px var(--red), 0 1px 3px rgba(0,0,0,.25); }
.tl-pt.done { background: #d3d9dd; box-shadow: none; }
.tl-pt.ho { width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; }
.tl-pt.ho.latest:not(.done) { box-shadow: 0 0 0 3px var(--red), 0 1px 3px rgba(0,0,0,.25); }
.tl-pt.ho.agreed:not(.done) { box-shadow: 0 0 0 3px var(--blue-dark), 0 1px 3px rgba(0,0,0,.25); }
.tl-pt:hover, .tl-pt.on, .tl-pt:focus-visible { transform: rotate(45deg) scale(1.35); outline: none; z-index: 3; opacity: 1; }
.tl-pop { position: absolute; z-index: 10; width: 260px; background: var(--panel); border-radius: 10px; padding: 10px 12px; box-shadow: 0 8px 30px rgba(0,0,0,.18); cursor: pointer; border-top: 4px solid var(--blue); }
.tl-pop.done { border-top-color: #c3cbd0; }
.tl-pop:hover { background: light-dark(#fafcfc, var(--soft)); }
.pop-date { font-size: 12px; font-weight: 700; color: var(--blue-dark); }
.pop-date.r { color: var(--red); } .pop-date.o { color: var(--orange); } .pop-date.g { color: var(--muted); }
.pop-title { font-size: 15px; font-weight: 800; margin-top: 2px; }
.pop-desc { font-size: 13px; color: var(--muted); margin-top: 2px; }
.pop-meta { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.pop-open { font-size: 12px; font-weight: 700; color: var(--blue); margin-top: 8px; }
.tag.ho { background: var(--red-soft); color: var(--red); }
.tl-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 4px; }
.tl-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; transform: rotate(45deg); margin-right: 6px; background: #9aa6ad; }
.tl-legend i.bau { background: var(--green); } .tl-legend i.vertrag { background: var(--blue); } .tl-legend i.kfm { background: #4c5a62; }
.tl-legend i.ring { background: var(--panel); box-shadow: 0 0 0 2px var(--red); }
.tl-legend i.done { background: #d3d9dd; }
.tl-legend i.flag { width: 2px; height: 12px; transform: none; border-radius: 0; background: var(--red); vertical-align: -1px; }
.list-tools { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; align-items: center; margin: -4px 0 6px; }
.list-tools .pills { margin: 0; }

/* Erledigte bleiben stehen: grün, leicht ausgegraut */
.row.done { opacity: 1; background: light-dark(#eef1f3, var(--soft)); box-shadow: none; color: #8a969d; }
.row.done .t-title { color: #7d8a91; font-weight: 600; }
.row.done .t-desc, .row.done .t-meta { color: #9aa5ab; }
.row.done .tag { opacity: .6; }
.row.done .big { color: #8a969d; font-size: 15px; }
.row.done .check.on { background: #aab4ba; border-color: #aab4ba; }
.row.done:hover { background: light-dark(#e7ebee, var(--soft)); }
.dt.done { background: light-dark(#e1e6e9, var(--soft)); color: #8a969d; }
.grp.g { color: var(--muted); }
.pill.done-toggle { border-style: dashed; }
.pill.done-toggle.act { background: light-dark(#eef1f3, var(--soft)); color: var(--text); border-color: #c3cbd0; }

/* Reiter im Projekt */
.ptabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin: 0 0 14px; overflow-x: auto; }
.ptab { border: 0; background: none; padding: 9px 14px; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.ptab span { font-size: 12px; background: var(--side); color: var(--muted); border-radius: 10px; padding: 1px 7px; margin-left: 4px; }
.ptab.act { color: var(--blue-dark); border-bottom-color: var(--blue); }
.ptab.act span { background: var(--blue-soft); color: var(--blue-dark); }

/* Aufgaben */
.todo-add { display: flex; gap: 8px; flex-wrap: wrap; background: var(--panel); border-radius: 10px; padding: 10px; box-shadow: 0 1px 2px rgba(0,0,0,.05); margin-bottom: 10px; }
.todo-add input, .todo-add select { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; background: var(--panel); }
.todo-add input[name=title] { flex: 1 1 200px; min-width: 0; }
.todo-add select[name=project_id] { flex: 0 1 220px; }
.row.todo { padding-top: 9px; padding-bottom: 9px; }
.row.todo .t-title { font-size: 15px; font-weight: 600; }
.row .due { min-width: 110px; text-align: right; font-weight: 800; font-size: 15px; }
.row .due small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
.row .due.r { color: var(--red); } .row .due.o { color: var(--orange); }
.row.done .due { color: #8a969d; }
.tag.proj { background: var(--blue-soft); color: var(--blue-dark); }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.plan-card { text-align: left; border: 0; background: var(--panel); border-radius: 10px; padding: 12px 14px; box-shadow: 0 1px 2px rgba(0,0,0,.06); display: flex; flex-direction: column; gap: 4px; border-left: 4px solid var(--orange); }
.plan-card b { font-size: 15px; }
.plan-card span { font-size: 13px; color: var(--muted); }
.plan-card .chip { align-self: flex-start; }

/* Projektakte */
.akte-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.akte-head .hint { flex: 1; margin: 0; }
.akte-sec { background: var(--panel); border-radius: 12px; padding: 12px 16px 12px; box-shadow: 0 1px 3px rgba(0,0,0,.06); margin-bottom: 12px; }
.akte-sec-head { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 8px; }
.akte-sec-head h3 { margin: 0; font-size: 16px; color: var(--blue-dark); }
.akte-sec-head .cnt { font-size: 12px; color: var(--muted); flex: 1; }
.entry { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed #edf0f2; }
.entry .avatar, .akte-new .avatar { flex: none; color: #fff; }
.entry-main { flex: 1; min-width: 0; }
.entry-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 13px; }
.entry-head span { color: var(--muted); font-size: 12px; }
.entry-body { margin-top: 2px; line-height: 1.45; overflow-wrap: anywhere; }
.entry-body p { margin: 0 0 4px; }
.entry-body ul { margin: 2px 0 4px; padding-left: 20px; }
.entry.editing textarea, .akte-new textarea { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; resize: vertical; font: inherit; }
.entry.editing .buttons { margin-top: 6px; }
.akte-new { display: flex; gap: 10px; align-items: flex-start; padding-top: 10px; }
.akte-new textarea { flex: 1; min-height: 38px; }
button.link { border: 0; background: none; padding: 0; color: var(--blue); font-size: 12px; font-weight: 600; }
button.link.danger { color: var(--red); }

/* KI-Zugang */
.token-list { margin: 10px 0; }
.token-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.token-row span { flex: 1; font-size: 12px; color: var(--muted); }
code.token { display: block; background: var(--side); border-radius: 6px; padding: 8px 10px; margin: 6px 0; font-size: 13px; overflow-wrap: anywhere; user-select: all; }
pre.config { white-space: pre-wrap; word-break: break-all;  background: #1f2a30; color: #e6eef0; border-radius: 8px; padding: 10px 12px; font-size: 12px; overflow-x: auto; }
@media (max-width: 900px) {
  .tl { padding: 10px 10px; }
  .tl-head .pills { width: 100%; }
  .dt { width: 66px; }
  .dt .m { font-size: 17px; } .dt .y { font-size: 15px; }
  .ho-line .v, .hcard .v { font-size: 16px; }
}
@media (max-width: 700px) {
  .row .due { min-width: 0; flex-basis: 100%; text-align: right; margin-top: -4px; }
  .row .due small { display: inline; margin-left: 6px; }
  .akte-head { flex-direction: column; align-items: stretch; }
}
.row .avatar[style] { color: #fff; }
.role { font-size: 12px; color: var(--blue-dark); background: var(--blue-soft); border-radius: 10px; padding: 1px 7px; margin-left: 4px; white-space: nowrap; }
/* Projektakte: „＋ Aufgabe“ hinter jedem Punkt, sichtbar beim Drüberfahren */
.mk-todo { border: 1px solid var(--blue); background: var(--panel); color: var(--blue-dark); border-radius: 10px; font-size: 11.5px; font-weight: 700; padding: 0 7px; margin-left: 6px; opacity: 0; transition: opacity .1s; vertical-align: 1px; }
.entry-body li:hover .mk-todo, .entry-body p:hover .mk-todo, .mk-todo:focus { opacity: 1; }
.mk-todo:hover { background: var(--blue); color: #fff; }
@media (hover: none) { .mk-todo { opacity: 1; } }
.row.done .avatar { filter: grayscale(1); opacity: .55; }

/* ---------- Kompakt (v8): kleinere Schriften, mehr Einträge pro Seite, ruhigere Optik ---------- */
:root { font-size: 13.5px; }
.main-head h1 { font-size: 20px; }
.subtitle { font-size: 12.5px; }
.nav-item { padding-top: 6px; padding-bottom: 6px; }
.main-body { padding: 0 24px 14px; }

.hero { gap: 10px; margin: 2px 0 4px; }
.hcard { padding: 8px 14px; border-radius: 10px; border-top-width: 3px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.hcard .k { font-size: 10.5px; }
.hcard .v, .ho-line .v { font-size: 18px; margin-top: 1px; }
.hcard .t { font-size: 12.5px; }

.pills, .pills-row { margin: 8px 0; gap: 4px; }
.pill { padding: 3px 10px; font-size: 12.5px; border-radius: 12px; }
.pills-label { font-size: 10.5px; }
.grp { font-size: 11px; margin: 12px 0 4px; }

.row { gap: 10px; padding: 5px 12px 5px 10px; margin-bottom: 2px; border-radius: 6px; box-shadow: none; border-bottom: 1px solid var(--line); }
.row.todo { padding-top: 5px; padding-bottom: 5px; }
.check { width: 18px; height: 18px; border-width: 1.5px; }
.check.on::after { font-size: 11px; }
.t-title, .row.todo .t-title { font-size: 13.5px; font-weight: 600; }
.t-desc { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-meta { font-size: 11.5px; gap: 2px 8px; margin-top: 1px; }
.tag, .chip, .cd { font-size: 10.5px; padding: 0 6px; }
.avatar { width: 24px; height: 24px; font-size: 10px; }
.big { font-size: 13.5px; min-width: 96px; }
.big small, .row .due small { font-size: 11px; }
.row .due { font-size: 13px; min-width: 90px; }
.row.done .big { font-size: 13px; }

/* Datumskachel: Monat + Jahr in einer Zeile, Tag klein darunter */
.dt { width: 64px; padding: 3px 0; border-radius: 6px; }
.dt .m, .dt .y { display: inline; font-size: 12px; font-weight: 800; letter-spacing: 0; line-height: 1.2; }
.dt .y { margin-left: 3px; }
.dt .d { font-size: 10px; margin-top: 0; line-height: 1.2; }
.dt.none .m { font-size: 12px; }

.ov-head { font-size: 10.5px; }
.ov-row { padding: 7px 14px; margin-bottom: 3px; border-radius: 6px; border-left-width: 4px; }
.ov-row .ho { font-size: 12.5px; }
.plan-card { padding: 8px 12px; }
.plan-card b { font-size: 13.5px; }
.ptab { padding: 6px 12px; font-size: 13px; }
.ptabs { margin-bottom: 10px; }
.akte-sec { padding: 8px 14px; margin-bottom: 8px; }
.akte-sec-head h3 { font-size: 14px; }
.entry { padding: 5px 0; }
.todo-add { padding: 6px; margin-bottom: 6px; }
.todo-add input, .todo-add select { padding: 5px 8px; }

/* Zeitstrahl kompakter */
.tl { padding: 8px 16px 8px; margin: 4px 0 10px; border-radius: 10px; }
.tl-head strong { font-size: 13px; }
.tl-track { --ly: calc(var(--rows) * 20px + 42px); height: calc(var(--ly) + 42px); margin-top: 6px; }
.tl-line { height: 4px; margin-top: -2px; }
.tl-past { height: 4px; margin-top: -2px; }
.tl-br { top: calc(var(--row) * 20px + 8px); height: 8px; }
.tl-br span { font-size: 11px; top: -8px; padding: 0 6px; }
.tl-tick span { font-size: 10px; }
.tl-year { font-size: 11px; top: calc(var(--ly) + 22px); }
.tl-tick.year { height: 26px; }
.tl-pt { width: 12px; height: 12px; margin: -6px 0 0 -6px; border-width: 2px; top: var(--ly); }
.tl-pt.ho { width: 16px; height: 16px; margin: -8px 0 0 -8px; }
.tl-legend { font-size: 11px; margin-top: 0; }
/* Bündel eng beieinander liegender Fristen */
.tl-cl { position: absolute; top: var(--ly); min-width: 22px; height: 22px; margin: -11px 0 0 -11px; padding: 0 5px; border-radius: 11px; border: 2px solid #fff;
  background: var(--blue-dark); color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.3); z-index: 2; cursor: pointer; }
.tl-cl.r { box-shadow: 0 0 0 2px var(--red), 0 1px 3px rgba(0,0,0,.25); }
.tl-cl.ho:not(.r) { box-shadow: 0 0 0 2px var(--blue-dark), 0 1px 3px rgba(0,0,0,.25); }
.tl-cl.done { background: #c3cbd0; box-shadow: none; }
.tl-cl:hover, .tl-cl.on { transform: scale(1.15); z-index: 3; }
.tl-pop.list { width: 300px; cursor: default; }
.pop-item { display: flex; align-items: center; gap: 8px; padding: 4px 4px; border-radius: 4px; font-size: 12.5px; cursor: pointer; }
.pop-item:hover { background: var(--blue-soft); }
.pop-item i { width: 8px; height: 8px; border-radius: 2px; transform: rotate(45deg); background: #9aa6ad; flex: none; }
.pop-item i.bau { background: var(--green); } .pop-item i.vertrag { background: var(--blue); } .pop-item i.kfm { background: #4c5a62; } .pop-item i.done { background: #d3d9dd; }
.pop-item span { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-item small { color: var(--muted); font-weight: 500; }
.pop-item b { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.pop-item.r b { color: var(--red); } .pop-item.o b { color: var(--orange); }
.pop-item.done span { color: var(--muted); font-weight: 500; }
@media (max-width: 900px) {
  .dt { width: 58px; } .dt .m, .dt .y { font-size: 11px; }
  .hcard .v, .ho-line .v { font-size: 15px; }
}
/* Fristen außerhalb des Ausschnitts als Bündel am Rand */
.tl-cl.out { background: var(--panel); color: var(--blue-dark); border: 1.5px solid var(--blue); box-shadow: none; font-size: 10.5px; white-space: nowrap; }
.tl-cl.out.after { margin-left: 0; transform: translateX(-100%); }
.tl-cl.out.before { margin-left: 0; }
.tl-cl.out.after:hover, .tl-cl.out.after.on { transform: translateX(-100%) scale(1.08); }
.tl-cl.out.done { color: var(--muted); border-color: #c3cbd0; }

/* Einzeilige Listenzeilen */
.row.line { min-height: 34px; padding-top: 4px; padding-bottom: 4px; }
.row.line .rt { display: flex; align-items: baseline; gap: 8px; min-width: 0; overflow: hidden; white-space: nowrap; }
.row.line .t-title { flex: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.row.line .t-desc { flex: 1 1 auto; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-weight: 400; }
.t-tags { display: flex; gap: 4px; align-items: center; flex: none; }
.t-ic { color: var(--muted); font-size: 12px; }
.row.line .dt { width: 66px; padding: 2px 0; font-size: 11.5px; font-weight: 800; white-space: nowrap; }
.row.line .due { min-width: 150px; font-size: 12.5px; font-weight: 700; white-space: nowrap; display: flex; gap: 8px; justify-content: flex-end; align-items: baseline; }
.row.line .due small { display: inline; font-weight: 600; min-width: 74px; text-align: right; }
.avatar.none { background: transparent; }
@media (max-width: 700px) {
  .row.line { flex-wrap: wrap; }
  .row.line .rt { flex-basis: calc(100% - 110px); }
  .row.line .t-tags { display: none; }
  .row.line .due { flex-basis: 100%; min-width: 0; margin-top: 0; }
}

/* ---------- v9: ruhiger und edler – gedeckte Farben, weißer Grund, mehr Luft ---------- */
:root {
  --green: #8aa66a; --green-dark: #5f7a48;
  --blue: #3f7f88; --blue-dark: #2f6870; --blue-soft: #eef3f3;
  --bg: #faf9f7; --panel: #ffffff; --side: #f4f3f0;
  --text: #2a3033; --muted: #8a9196; --line: #e8e6e1;
  --red: #b5524a; --red-soft: #f7ecea;
  --orange: #b9874f; --orange-soft: #f7f0e6;
}
.sidebar { border-right-color: var(--line); }
.nav-item.active { box-shadow: none; border: 1px solid var(--line); }
.main-head h1 { color: var(--text); font-weight: 650; letter-spacing: -.01em; }
.main-body { padding: 4px 32px 18px; }

/* Kacheln: weiß mit feiner Linie statt Schatten und Farbbalken */
.hero { gap: 16px; margin: 6px 0 14px; }
.hcard, .hcard.r, .hcard.o, .hcard.b, .hcard.g { border: 1px solid var(--line); border-top: 1px solid var(--line); box-shadow: none; padding: 12px 16px; }
.hcard .k { color: var(--muted); font-weight: 600; letter-spacing: .06em; }
.hcard .v { font-weight: 650; }
.hcard.r .v { color: var(--red); } .hcard.g .v { color: var(--text); }
.tl { border: 1px solid var(--line); box-shadow: none; padding: 12px 20px 10px; margin: 6px 0 18px; }
.tl-line { background: linear-gradient(90deg, #b9c9a6, #9dbcc0); }
.tl-pt { box-shadow: 0 0 0 1px rgba(0,0,0,.06); }
.tl-pt.kfm { background: #7d878c; }
.tl-cl { background: var(--blue); box-shadow: none; }
.tl-br, .tl-flag { border-color: var(--blue); }
.tl-band { background: repeating-linear-gradient(45deg, rgba(181,82,74,.08) 0 5px, transparent 5px 10px); }
.tl-legend i.kfm { background: #7d878c; }

/* Listen: mehr Abstand, Zeilen als ruhige weiße Karten */
.row, .row.line { margin-bottom: 6px; padding: 8px 16px 8px 12px; min-height: 42px; border: 1px solid var(--line); border-radius: 8px; box-shadow: none; }
.row:hover { background: light-dark(#fcfcfb, var(--soft)); border-color: #dcd9d2; }
.row.selected { background: var(--blue-soft); border-color: #cfdcdd; }
.grp { margin: 20px 0 8px; font-weight: 600; letter-spacing: .07em; }
.grp.r { color: var(--red); }
.row.done, .row.done:hover { background: light-dark(#f4f3f0, var(--soft)); border-color: transparent; }
.check { border-color: #aab5b8; }
.check.on { background: var(--green); border-color: var(--green); }

/* Datumskachel und Hervorhebungen gedeckt: Text farbig, Flächen hell */
.dt, .row.line .dt { background: light-dark(#f3f2ee, var(--soft)); color: var(--text); font-weight: 650; }
.dt.r { background: var(--red-soft); color: var(--red); }
.dt.o { background: var(--orange-soft); color: #94693a; }
.dt.done { background: transparent; color: var(--muted); }
.big.o, .row .due.o { color: #94693a; }
.tag, .chip { font-weight: 500; }
.tag.bau { background: light-dark(#f0f3ec, var(--soft)); color: #62744f; }
.tag.vertrag { background: light-dark(#edf2f2, var(--soft)); color: #4c6e73; }
.tag.kfm { background: light-dark(#f1eff3, var(--soft)); color: #6e6680; }
.tag.tenant { background: light-dark(#e9e7e2, var(--soft)); color: var(--text); }
.tag.proj { background: light-dark(#f0efeb, var(--soft)); color: #5c6367; }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.orange { background: var(--orange-soft); color: #94693a; }
.cd.r { background: var(--red-soft); color: var(--red); }
.cd.o { background: var(--orange-soft); color: #94693a; }
.cd.g { background: light-dark(#f0f3ec, var(--soft)); color: #62744f; }
.cd.n { background: light-dark(#edece8, var(--soft)); }
.nav-item .count.orange { background: #c9a27a; }
.avatar { background: light-dark(#e6ebe0, var(--soft)); color: #5f7a48; }
.pill { border-color: var(--line); }
.pill.act { background: var(--text); border-color: var(--text); font-weight: 500; }
.pill.done-toggle.act { background: light-dark(#f4f3f0, var(--soft)); color: var(--text); border-color: var(--line); }
.ptab.act { color: var(--text); border-bottom-color: var(--text); }
.ptab.act span { background: light-dark(#edece8, var(--soft)); color: var(--text); }
.ov-row { border: 1px solid var(--line); border-left-width: 3px; box-shadow: none; padding: 10px 16px; margin-bottom: 6px; }
.ov-row.r { border-left-color: var(--red); } .ov-row.o { border-left-color: var(--orange); } .ov-row.g { border-left-color: var(--green); }
.plan-card { border: 1px solid var(--line); border-left: 3px solid #c9a27a; box-shadow: none; }
.plan-grid { gap: 12px; }
.akte-sec { border: 1px solid var(--line); box-shadow: none; padding: 12px 18px; margin-bottom: 14px; }
.akte-sec-head h3 { color: var(--text); }
.todo-add { border: 1px solid var(--line); box-shadow: none; padding: 8px; margin-bottom: 12px; }
.btn { background: var(--blue); }

/* ---------- v10: kleinere Schrift, fast weißer Hintergrund ---------- */
:root { font-size: 12.5px; --bg: #fdfdfd; --side: #f8f8f8; --line: #ebebeb; }
.sidebar { background: var(--side); }
.nav-item { font-size: 12.5px; padding-top: 5px; padding-bottom: 5px; }
.nav-title { font-size: 10.5px; }
.main-head h1 { font-size: 18px; }
.subtitle { font-size: 11.5px; }
.hcard .k { font-size: 10px; }
.hcard .v, .ho-line .v { font-size: 16px; }
.hcard .t { font-size: 11.5px; }
.t-title, .row.todo .t-title { font-size: 12.5px; }
.t-desc { font-size: 11.5px; }
.tag, .chip, .cd { font-size: 10px; }
.row.line .dt { font-size: 10.5px; width: 60px; }
.row.line .due { font-size: 11.5px; min-width: 140px; }
.row.line .due small, .big small { font-size: 10.5px; }
.big { font-size: 12.5px; }
.pill { font-size: 11.5px; }
.ptab { font-size: 12px; }
.grp { font-size: 10.5px; }
.ov-row .ho { font-size: 11.5px; }
.plan-card b { font-size: 12.5px; } .plan-card span { font-size: 11.5px; }
.akte-sec-head h3 { font-size: 13px; }
.entry-head { font-size: 11.5px; }
.tl-head strong { font-size: 12px; }
.btn { font-size: 12.5px; padding: 7px 14px; }
.btn.small { font-size: 11.5px; }
.hcard, .tl, .row, .row.line, .ov-row, .plan-card, .akte-sec, .todo-add { background: var(--panel); }
.row.done, .row.done:hover { background: light-dark(#f7f7f7, var(--soft)); }
.dt, .row.line .dt { background: light-dark(#f4f4f4, var(--soft)); }
.row:hover { background: light-dark(#fcfcfc, var(--soft)); }

/* v11: verstrichene Fristen klären (✓ erledigt / ✕ nicht erledigt) statt Abhaken-Kreis */
.f-act { display: flex; gap: 6px; flex: none; }
.f-act button { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid; background: var(--panel); font-size: 14px; font-weight: 700; line-height: 1; padding: 0; display: grid; place-items: center; }
.f-ok { border-color: var(--green); color: var(--green-dark); }
.f-ok:hover { background: var(--green); color: #fff; }
.f-no { border-color: var(--red); color: var(--red); }
.f-no:hover { background: var(--red); color: #fff; }
.row.line:not(.todo) { padding-left: 14px; }
.ptab-alert { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: var(--red); color: #fff; font-size: 10px; font-style: normal; font-weight: 800; margin-left: 5px; vertical-align: 1px; }
.detail-foot .btn.secondary { margin-left: auto; }

/* v12: gewählte Zeile deutlich markieren, solange rechts das Fenster offen ist */
.row.selected, .row.line.selected { background: light-dark(#e6eff0, var(--soft)); border-color: var(--blue); box-shadow: inset 4px 0 0 var(--blue); }
.row.selected .t-title { color: var(--blue-dark); }
.row.selected:hover { background: light-dark(#e6eff0, var(--soft)); }
.detail { box-shadow: -6px 0 18px rgba(0,0,0,.04); }
.detail-head strong::after { content: "  ↑ ↓ wechseln · Esc schließen"; font-weight: 400; font-size: 11px; color: var(--muted); }
@media (hover: none) { .detail-head strong::after { content: none; } }
/* Bei offenem Seitenfenster: Liste schlanker, damit der Name lesbar bleibt */
.layout:has(.detail) .row.line .t-tags, .layout:has(.detail) .row.line .t-desc { display: none; }
.layout:has(.detail) .row.line .due { min-width: 0; }
.layout:has(.detail) .row.line .due small { min-width: 0; }

/* v13: Breiten ziehbar */
:root { --side-w: 260px; --detail-w: 380px; }
.layout { grid-template-columns: var(--side-w) minmax(0, 1fr) auto; }
.sidebar, .detail { position: relative; }
.detail { width: var(--detail-w); }
.resizer { position: absolute; top: 0; bottom: 0; right: -4px; width: 8px; cursor: col-resize; z-index: 30; touch-action: none; }
.resizer.left { right: auto; left: -4px; }
.resizer::after { content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px; background: transparent; transition: background .15s; }
.resizer:hover::after, .resizing .resizer::after { background: var(--blue); }
body.resizing { cursor: col-resize; user-select: none; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .resizer { display: none; }
  .detail { width: auto; }
}

/* v14: Rückgängig und „Gelöscht“ */
.toast.has-undo { display: flex; align-items: center; gap: 14px; }
.toast-undo { border: 1px solid rgba(255,255,255,.5); background: none; color: #fff; border-radius: 6px; padding: 3px 10px; font-weight: 700; font-size: 12px; }
.toast-undo:hover { background: rgba(255,255,255,.15); }
.row.deleted, .row.deleted:hover { background: transparent; border-style: dashed; color: #a3aaae; cursor: default; }
.row.deleted .t-title { color: #a3aaae; font-weight: 500; text-decoration: none; }
.row.deleted .due, .row.deleted .due small { color: #b3b9bc; }
.row.deleted .btn.small { padding: 3px 9px; }

/* ---------- v15 ---------- */
/* Drei Flächen: links zart im Firmenblau, Mitte weiß, rechts leicht abgedunkelt */
:root { --bg: #ffffff; --side: #eef5f6; }
body, .main { background: var(--panel); }
.sidebar { background: var(--side); border-right: 1px solid #dde9eb; }
.side-search input { background: var(--panel); border-color: #d6e4e6; }
.nav-item { padding-top: 8px; padding-bottom: 8px; margin-bottom: 2px; font-size: 13px; }
.nav-item:hover { background: rgba(63,127,136,.08); }
.nav-item.active { background: var(--panel); border: 1px solid #d3e3e5; }
.nav-title { margin-top: 14px; padding-bottom: 6px; color: #6f8c90; }
.detail { background: light-dark(#f6f7f7, var(--soft)); border-left: 1px solid #e3e5e5; }
.detail .field input, .detail .field select, .detail .field textarea { background: var(--panel); }

/* Reiter: groß, Großbuchstaben, schwarz; aktiv unterstrichen; bleiben beim Scrollen oben */
.ptabs { position: sticky; top: 0; z-index: 20; background: var(--panel); margin: 0 -32px 16px; padding: 6px 32px 0; gap: 22px; border-bottom: 1px solid var(--line); }
.ptab, .ptab.act { color: var(--text); font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 12px 2px 10px; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.ptab:hover { border-bottom-color: #c9d3d5; }
.ptab.act { border-bottom-color: #1d2326; }
.ptab span, .ptab.act span { font-size: 11px; letter-spacing: 0; background: light-dark(#eef1f1, var(--soft)); color: #4b5458; }

/* Vertragsfristen aufgeräumter: nur Datum, Kurzname, Mieter, Stand der Aufgabe, Frist */
.row.line.frist { min-height: 46px; margin-bottom: 8px; gap: 12px; }
.cat-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: #b5bcc0; }
.cat-dot.bau { background: var(--green); } .cat-dot.vertrag { background: var(--blue); } .cat-dot.kfm { background: #7d878c; } .cat-dot.done { background: #d7dbdd; }
.row.line.frist .rt { gap: 10px; align-items: center; }
.row.line.frist .t-title { font-weight: 600; }
.f-todo { flex: none; font-size: 11px; border-radius: 12px; padding: 2px 10px; white-space: nowrap; }
.f-todo.add { border: 1px solid var(--blue); background: var(--panel); color: var(--blue-dark); font-weight: 600; opacity: .55; transition: opacity .1s; }
.row:hover .f-todo.add, .f-todo.add:focus { opacity: 1; }
.f-todo.add:hover { background: var(--blue); color: #fff; }
.f-todo.open { background: light-dark(#eef3f3, var(--soft)); color: var(--blue-dark); font-weight: 600; }
.f-todo.ok { background: light-dark(#eef3ea, var(--soft)); color: #5f7a48; font-weight: 600; }
.grp { margin: 26px 0 10px; }
.hero { margin-bottom: 18px; }
.tl { margin-bottom: 24px; }
.layout:has(.detail) .f-todo.add { display: none; }
@media (hover: none) { .f-todo.add { opacity: 1; } }
.main-body { padding-top: 0; }
@media (max-width: 900px) { .ptabs { margin: 0 -16px 12px; padding: 4px 16px 0; gap: 14px; } .ptab, .ptab.act { font-size: 12.5px; } }
.f-todo.add { opacity: 0; }
.row:hover .f-todo.add, .row.selected .f-todo.add, .f-todo.add:focus { opacity: 1; }
@media (hover: none) { .f-todo.add { opacity: 1; } }
