:root {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-2: #1e222b;
  --border: #2a2f3a;
  --text: #e6e8ee;
  --muted: #9aa2b1;
  --accent: #6366f1;
  --accent-hover: #7c7ff3;
  --danger: #ef4444;
  --ok: #22c55e;
  --radius: 10px;
  --shadow: 0 8px 28px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; }
a { color: inherit; text-decoration: none; }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 18px 14px;
  display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.main { padding: 26px 32px 64px; min-width: 0; }

.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 1.05rem; padding: 4px 8px 12px; }
.brand-mark {
  display: grid; place-items: center; width: 26px; height: 26px;
  border-radius: 8px; background: var(--accent); color: #fff; font-size: .85rem;
}

.search input {
  width: 100%; padding: 8px 11px; margin-bottom: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: .9rem;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; border-radius: 8px; color: var(--muted); font-size: .92rem;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.is-active { background: var(--surface-2); color: var(--text); font-weight: 600; }
.nav-item .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item span:first-of-type { flex: 1; }
.nav-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 16px 0 4px; padding: 0 10px;
  font-size: .72rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted);
}
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.pill {
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--border);
  padding: 1px 7px; border-radius: 999px; font-size: .72rem; font-weight: 600;
}
.empty-hint { color: var(--muted); font-size: .85rem; padding: 4px 10px; margin: 0; }
.logout { margin-top: auto; padding-top: 12px; display: flex; align-items: center; justify-content: space-between; }
.whoami { color: var(--muted); font-size: .82rem; padding-left: 10px; }
.link-btn { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: .85rem; padding: 6px 10px; }
.link-btn:hover { color: var(--text); }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.subtitle { color: var(--muted); margin: 4px 0 0; font-size: .92rem; }
.head-actions { display: flex; gap: 8px; flex: none; }

/* ---------- Buttons ---------- */
.btn {
  padding: 8px 14px; border-radius: 8px; border: 1px solid transparent;
  font-size: .89rem; font-weight: 550; cursor: pointer; font-family: inherit;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: #fff; }
.btn.full { width: 100%; margin-top: 6px; }
.icon-btn {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  font-size: 1.1rem; line-height: 1; padding: 3px 7px; border-radius: 6px;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.danger:hover { background: var(--danger); color: #fff; }

/* ---------- Schnellerfassung ---------- */
.quick-add { display: flex; gap: 8px; margin-bottom: 18px; }
.quick-add input[type=text] { flex: 1; }
.quick-add input, .col-add input {
  padding: 9px 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: .92rem; font-family: inherit;
}
.quick-add input:focus, .col-add input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

/* ---------- Aufgabenliste ---------- */
.task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.task {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 11px 12px; border-radius: var(--radius);
  border: 1px solid transparent;
}
.task:hover { background: var(--surface); border-color: var(--border); }
.task-body { flex: 1; cursor: pointer; min-width: 0; }
.task-title { display: flex; align-items: center; gap: 7px; }
.task.is-done .task-title { color: var(--muted); text-decoration: line-through; }
.check {
  width: 19px; height: 19px; margin-top: 2px; flex: none;
  border: 1.5px solid var(--border); border-radius: 50%;
  background: transparent; color: #fff; cursor: pointer;
  font-size: .7rem; line-height: 1; display: grid; place-items: center;
}
.check:hover { border-color: var(--accent); }
.task.is-done .check { background: var(--ok); border-color: var(--ok); }
.check-form, .del-form { flex: none; }
.del-form { opacity: 0; transition: opacity .12s; }
.task:hover .del-form { opacity: 1; }

.task-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 1px 8px; border-radius: 999px; font-size: .74rem; color: var(--muted);
}
.chip-danger { border-color: var(--danger); color: #fca5a5; }
.chip.tag { color: #a5b4fc; }
.prio { width: 7px; height: 7px; border-radius: 2px; flex: none; }
.prio-1 { background: #64748b; } .prio-2 { background: #f59e0b; } .prio-3 { background: var(--danger); }

.empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.empty-title { color: var(--text); font-weight: 600; margin-bottom: 4px; }

/* ---------- Board ---------- */
.board { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 14px; align-items: start; }
.column { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.col-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.col-head h2 { font-size: .82rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.col-body { display: flex; flex-direction: column; gap: 8px; min-height: 24px; }
.card {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px; cursor: grab;
}
.card:hover { border-color: #3b4250; }
.card.is-overdue { border-left: 3px solid var(--danger); }
.card-title { margin: 0; font-size: .9rem; }
.sortable-ghost { opacity: .35; }
.sortable-drag { box-shadow: var(--shadow); }
.col-add { margin-top: 8px; }
.col-add input { width: 100%; background: transparent; border-color: transparent; font-size: .86rem; }
.col-add input:hover { border-color: var(--border); }

/* ---------- Dialoge ---------- */
.dialog {
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface);
  color: var(--text); padding: 0; width: min(540px, 92vw); box-shadow: var(--shadow);
}
.dialog::backdrop { background: rgba(0,0,0,.6); }
.dialog form { padding: 20px; display: flex; flex-direction: column; gap: 13px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.dialog-foot.spread { justify-content: space-between; }
.dialog-foot span { display: flex; gap: 8px; }
.dialog label { display: flex; flex-direction: column; gap: 5px; font-size: .82rem; color: var(--muted); }
.dialog label.row { flex-direction: row; align-items: center; gap: 8px; }
.dialog input, .dialog select, .dialog textarea {
  padding: 8px 11px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: .92rem; font-family: inherit;
}
.dialog input[type=color] { padding: 3px; height: 36px; }
.dialog textarea { resize: vertical; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.hint { color: #6b7280; font-weight: 400; }

/* ---------- Anmeldung ---------- */
.centered { display: grid; place-items: center; padding: 20px; }
.auth-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 28px; width: min(380px, 94vw); display: flex; flex-direction: column; gap: 13px;
  box-shadow: var(--shadow);
}
.auth-card label { display: flex; flex-direction: column; gap: 5px; font-size: .82rem; color: var(--muted); }
.auth-card input {
  padding: 9px 12px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: .95rem;
}
.alert { background: rgba(239,68,68,.12); border: 1px solid var(--danger); color: #fca5a5;
         padding: 9px 12px; border-radius: 8px; font-size: .86rem; margin: 0; }
.muted { color: var(--muted); font-size: .88rem; margin: 0; }

/* ---------- Mobil ---------- */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .main { padding: 20px 16px 48px; }
  .board { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; }
}

/* ---------- Kalender ---------- */
.cal-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.cal-nav { display: flex; gap: 6px; }
.cal-filter select {
  padding: 8px 11px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: .89rem; font-family: inherit;
}
.cal { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-dow {
  padding: 9px 10px; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.cal-day {
  min-height: 116px; padding: 7px 8px; border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.cal-day:nth-child(7n) { border-right: 0; }
.cal-grid > .cal-day:nth-last-child(-n+7) { border-bottom: 0; }
.cal-day.is-outside { background: var(--bg); }
.cal-day.is-outside .cal-num { color: #4b5261; }
.cal-num { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-day.is-today .cal-num {
  background: var(--accent); color: #fff; font-weight: 600;
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
}
.cal-items { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-task {
  display: flex; align-items: center; gap: 5px; width: 100%;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px;
  padding: 3px 6px; cursor: pointer; text-align: left; font: inherit; font-size: .76rem;
  color: var(--text); min-width: 0;
}
.cal-task:hover { border-color: var(--accent); }
.cal-task.is-done .cal-label { text-decoration: line-through; color: var(--muted); }
.cal-task.is-overdue { border-color: var(--danger); }
.cal-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.cal-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Terminplan / Zeitachse ---------- */
.scrollbox { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 16px; }
.gantt { --lbl: 200px; min-width: 700px; }

.gantt-head { display: grid; grid-template-columns: var(--lbl) 1fr; align-items: end;
              border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.gantt-corner { display: flex; gap: 12px; align-items: center; padding-bottom: 8px; }
.lg { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; color: var(--muted); }
.lg i { width: 15px; border-radius: 2px; flex: none; }
.lg-plan { height: 11px; background: transparent; border: 1.5px solid var(--muted); }
.lg-act  { height: 8px; background: var(--muted); }

.gantt-scale { position: relative; height: 38px; }
.gantt-week { position: absolute; top: 0; height: 38px; border-left: 1px solid var(--border);
              padding-left: 7px; display: flex; flex-direction: column; }
.gantt-kw { font-size: .7rem; font-weight: 600; color: var(--text); letter-spacing: .03em; }
.gantt-date { font-size: .68rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.gantt-today { position: absolute; bottom: 0; transform: translateX(-50%); }
.gantt-today b { font-size: .64rem; text-transform: uppercase; letter-spacing: .08em;
                 color: #fff; background: var(--danger); border-radius: 3px; padding: 1px 5px; }

.gantt-body { display: grid; grid-template-columns: var(--lbl) 1fr; row-gap: 5px; align-items: center; }
.gantt-label { display: flex; align-items: center; gap: 8px; padding-right: 14px; min-width: 0; }
.gl-title { font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.delay { font-size: .68rem; font-weight: 600; padding: 1px 6px; border-radius: 999px; flex: none;
         font-variant-numeric: tabular-nums; }
.delay.is-late    { color: #fca5a5; background: rgba(239,68,68,.16); }
.delay.is-early   { color: #86efac; background: rgba(34,197,94,.16); }
.delay.is-ontime  { color: var(--muted); background: var(--surface-2); }
.delay.is-running { color: #93c5fd; background: rgba(59,130,246,.16); }

.gantt-track { position: relative; height: 34px; border-radius: 6px; }
.gantt-track.is-clickable { cursor: pointer; }
.gantt-track.is-clickable:hover { background: var(--surface-2); }
.gantt-track.is-clickable:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.gantt-gridline { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border); opacity: .45; }
.gantt-todayline { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--danger); opacity: .55; }

/* Soll ist der Rahmen, Ist die Fuellung darunter. */
.bar { position: absolute; border-radius: 4px; min-width: 3px; }
.bar.plan { top: 5px; height: 12px; opacity: .30; }
.bar.act  { top: 20px; height: 9px; opacity: .95; }
.bar.act.is-running {
  border-top-right-radius: 0; border-bottom-right-radius: 0;
  -webkit-mask-image: linear-gradient(to right, #000 78%, transparent);
          mask-image: linear-gradient(to right, #000 78%, transparent);
}
.ms { position: absolute; width: 12px; height: 12px; transform: rotate(45deg) translate(-4.2px, 4.2px);
      border-radius: 2px; }
.ms.plan { top: 5px; opacity: .45; }
.ms.act  { top: 19px; opacity: .95; }

/* ---------- Freigabe-Liste ---------- */
.plan-bar { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.plan-hint { color: var(--muted); font-size: .9rem; }
.plan-hint strong { color: var(--text); }
.sec-head { font-size: 1rem; font-weight: 650; margin: 28px 0 10px; display: flex; align-items: center; gap: 9px; }
.soft-note { color: var(--muted); font-size: .86rem; margin: -4px 0 10px; }
.release-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.release {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px;
  border: 1px solid transparent; border-radius: 8px;
}
.release:hover { background: var(--surface); border-color: var(--border); }
.release-title { flex: 1; font-size: .92rem; color: var(--muted); min-width: 0;
                 overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.release.is-on .release-title { color: var(--text); }
.release-when { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.switch {
  width: 38px; height: 21px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-2); cursor: pointer; padding: 0; position: relative; flex: none;
  transition: background .14s, border-color .14s;
}
.switch-knob {
  position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%;
  background: var(--muted); transition: transform .14s, background .14s;
}
.release.is-on .switch { background: var(--ok); border-color: var(--ok); }
.release.is-on .switch-knob { transform: translateX(17px); background: #fff; }

/* ---------- Termin-Schnelleditor ---------- */
.dialog-sm { width: min(430px, 92vw); }
.dategroup { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px 14px; margin: 0;
             display: flex; flex-direction: column; gap: 9px; }
.dategroup legend { font-size: .78rem; font-weight: 600; color: var(--text); padding: 0 6px; }
.fieldnote { color: var(--muted); font-size: .76rem; margin: 0; }

.tally { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.tally .delay { font-size: .74rem; padding: 3px 9px; }

/* ---------- Benutzer, Konto, Meldungen ---------- */
.userbox { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); display: flex;
           flex-direction: column; gap: 6px; }
.whoami { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px;
          color: var(--text); font-size: .88rem; min-width: 0; }
.whoami:hover { background: var(--surface-2); }
.avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff;
          display: grid; place-items: center; font-size: .78rem; font-weight: 600; flex: none; }
.avatar.sm { width: 20px; height: 20px; font-size: .68rem; display: inline-grid; vertical-align: -4px;
             margin-right: 6px; }
.userlinks { display: flex; gap: 4px; align-items: center; padding-left: 4px; }
.chip.who { color: #c4b5fd; }

.flash { padding: 10px 14px; border-radius: 8px; font-size: .89rem; margin: 0 0 16px; }
.flash.ok { background: rgba(34,197,94,.12); border: 1px solid var(--ok); color: #86efac; }
.flash.err { background: rgba(239,68,68,.12); border: 1px solid var(--danger); color: #fca5a5; }

.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.panel-head { font-size: .95rem; font-weight: 650; margin: 0 0 14px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack label { display: flex; flex-direction: column; gap: 5px; font-size: .82rem; color: var(--muted); }
.stack input, .stack select {
  padding: 8px 11px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: .92rem; font-family: inherit;
}
.stack input:disabled { color: var(--muted); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: .88rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

table.grid { width: 100%; border-collapse: collapse; font-size: .89rem; }
table.grid th {
  text-align: left; font-size: .68rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--muted); font-weight: 600; padding: 0 12px 9px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.grid td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid tr.is-off { opacity: .5; }
.muted-inline { color: var(--muted); font-size: .84rem; }
.ok-chip { color: #86efac; border-color: var(--ok); }
.row-actions { text-align: right; white-space: nowrap; }
.btn.sm { padding: 5px 10px; font-size: .8rem; }

.subform { border-top: 1px solid var(--border); padding-top: 14px !important; }
.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1; padding: 8px 11px; background: var(--surface-2);
                     border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-family: inherit; }

/* ---------- Schnellerfassung ---------- */
.quick-add { display: flex; gap: 8px; margin-bottom: 18px; align-items: center; flex-wrap: wrap; }
.qa-title { flex: 1 1 320px; }
.qa-when { display: flex; align-items: center; gap: 6px; }
.qa-presets { display: flex; gap: 3px; }
.qa-presets button {
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  border-radius: 6px; padding: 5px 9px; font-size: .76rem; cursor: pointer; font-family: inherit;
}
.qa-presets button:hover { border-color: var(--accent); color: var(--text); }

/* ---------- Heute erledigt / Archiv ---------- */
.done-block { margin-top: 26px; border-top: 1px solid var(--border); padding-top: 14px; }
.done-block summary {
  cursor: pointer; font-size: .88rem; font-weight: 600; color: var(--muted);
  display: flex; align-items: center; gap: 9px; list-style: none; padding: 4px 0;
}
.done-block summary::-webkit-details-marker { display: none; }
.done-block summary::before { content: "▸"; transition: transform .12s; }
.done-block[open] summary::before { transform: rotate(90deg); }
.done-block summary:hover { color: var(--text); }

.arch-bar { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.arch-bar input[type=search] { flex: 1 1 240px; }
.arch-bar input, .arch-bar select {
  padding: 8px 11px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: .89rem; font-family: inherit;
}
.day-head { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
            margin: 24px 0 6px; }
.day-head:first-of-type { margin-top: 8px; }

/* ========== Startseite ========== */

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 2px;
}
.kpi:hover { border-color: #3b4250; }
.kpi-num { font-size: 1.7rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-lbl { font-size: .78rem; color: var(--muted); }
.kpi.is-alarm .kpi-num { color: var(--danger); }
.kpi.is-good .kpi-num { color: var(--ok); }

.dash { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; align-items: start; }
.span-2 { grid-column: span 1; }
.span-3 { grid-column: 1 / -1; }

.card-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; }
.cp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.cp-head h2 { font-size: 1rem; font-weight: 650; }
.link-more { font-size: .8rem; color: var(--muted); background: none; border: 0; cursor: pointer; font-family: inherit; }
.link-more:hover { color: var(--accent); }
.cp-empty { color: var(--muted); font-size: .88rem; margin: 6px 0; }

.quick-add.compact { margin-bottom: 14px; gap: 6px; flex-wrap: nowrap; }
.quick-add.compact .qa-title { flex: 1 1 auto; min-width: 0; }
.quick-add.compact select, .quick-add.compact input[type=date] {
  padding: 8px 9px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: .84rem; font-family: inherit; flex: none;
}
.quick-add.compact .btn { padding: 8px 14px; font-size: 1rem; line-height: 1; }

/* ---------- Aufgabenzeilen auf der Startseite ---------- */
.dash-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.dash-task {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 12px;
  border-radius: 8px; position: relative;
}
.dash-task::before {
  content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px; border-radius: 2px;
}
.prio-row-3::before { background: var(--danger); }
.prio-row-2::before { background: #f59e0b; }
.prio-row-1::before { background: #64748b; }
.dash-task:hover { background: var(--surface-2); }
.dt-body { flex: 1; cursor: pointer; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dt-title { font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt-meta { display: flex; flex-wrap: wrap; gap: 5px; }
.dt-meta:empty { display: none; }
.dt-time { font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.dash-task.is-done .dt-title { color: var(--muted); text-decoration: line-through; }
.dash-task.is-done .check { background: var(--ok); border-color: var(--ok); }

.prio-badge { font-size: .68rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; flex: none; }
.prio-badge.p0 { display: none; }
.prio-badge.p1 { color: #cbd5e1; background: rgba(100,116,139,.2); }
.prio-badge.p2 { color: #fcd34d; background: rgba(245,158,11,.16); }
.prio-badge.p3 { color: #fca5a5; background: rgba(239,68,68,.16); }

/* ---------- Notizzettel ---------- */
.note-add { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.note-add textarea {
  padding: 9px 11px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: .9rem; font-family: inherit; resize: vertical;
}
.notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px;
         max-height: 460px; overflow-y: auto; }
.note { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.note.is-pinned { border-color: var(--accent); }
.note-body { margin: 0; font-size: .88rem; white-space: pre-wrap; word-break: break-word; }
.note-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 7px; }
.note-when { font-size: .72rem; color: var(--muted); }
.note-acts { display: flex; gap: 1px; opacity: 0; transition: opacity .12s; }
.note:hover .note-acts, .note:focus-within .note-acts { opacity: 1; }
.note-acts form { display: inline; }
.note-acts .icon-btn { font-size: .9rem; padding: 2px 6px; }

/* ---------- Projektkacheln ---------- */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.proj {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px; display: flex; flex-direction: column; gap: 9px;
}
.proj:hover { border-color: #3b4250; }
.proj-top { display: flex; align-items: center; gap: 8px; }
.dot.lg { width: 10px; height: 10px; }
.proj-name { flex: 1; font-weight: 600; font-size: .94rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-pct { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.progress { height: 5px; background: var(--border); border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: 999px; transition: width .25s; }
.proj-facts { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; font-size: .78rem; color: var(--muted); }
.proj-next { font-size: .78rem; color: var(--muted); border-top: 1px solid var(--border); padding-top: 8px; }
.proj-next strong { color: var(--text); font-variant-numeric: tabular-nums; }

@media (max-width: 1000px) {
  .dash { grid-template-columns: 1fr; }
}

/* ---------- Laufende Uhr ---------- */
.timer-live { display: inline-flex; }
.btn.timer-stop {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(239,68,68,.14); border: 1px solid var(--danger); color: #fca5a5;
  font-variant-numeric: tabular-nums;
}
.btn.timer-stop:hover { background: var(--danger); color: #fff; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

/* ---------- Zeiterfassung ---------- */
.week-sum { display: flex; align-items: center; gap: 12px; font-size: .9rem; flex-wrap: wrap; }
.week-sum strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; }

.weekbars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-bottom: 18px;
            background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.wb { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.wb-col { width: 100%; height: 64px; background: var(--surface-2); border-radius: 5px;
          display: flex; align-items: flex-end; overflow: hidden; }
.wb-col span { width: 100%; background: var(--accent); border-radius: 5px; min-height: 2px; transition: height .25s; }
.wb-day { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.wb-min { font-size: .74rem; font-variant-numeric: tabular-nums; }

.time-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.time-form select { flex: 2 1 220px; min-width: 0; }
.time-form input[type=text] { flex: 1 1 130px; min-width: 0; }
.time-form select, .time-form input {
  padding: 8px 11px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: .89rem; font-family: inherit;
}
.inline-check { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); }

.entries { list-style: none; margin: 0 0 4px; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.entry { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; }
.entry:hover { background: var(--surface); }
.entry.is-running { background: rgba(239,68,68,.07); }
.e-time { font-variant-numeric: tabular-nums; font-weight: 600; font-size: .88rem; min-width: 72px; }
.e-what { flex: 1; font-size: .89rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry form { opacity: 0; transition: opacity .12s; }
.entry:hover form { opacity: 1; }

/* ---------- Projektreiter ---------- */
.ptabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px;
         overflow-x: auto; }
.ptab {
  padding: 8px 14px; font-size: .88rem; color: var(--muted); white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.ptab:hover { color: var(--text); }
.ptab.is-on { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }

/* ---------- Auswertung ---------- */
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.grid tr.grp td { border-top: 1px solid var(--border); border-bottom: 0; padding-top: 14px; }
table.grid tr.sub td { border-bottom: 0; padding-top: 3px; padding-bottom: 3px; font-size: .85rem; }
table.grid tr.sub td.indent { padding-left: 30px; }
table.grid tfoot tr.total td { border-top: 2px solid var(--border); padding-top: 12px; }
