/* ============================================================
   SOC Tasks – Stylesheet
   Dunkles Arbeits-UI, Bernstein-Akzent (Bühnenlicht), systemeigene Schriften
   ============================================================ */
:root {
  --bg: #12151a;
  --panel: #1b2029;
  --panel-2: #232a36;
  --line: #2e3644;
  --ink: #e8eaf0;
  --muted: #8b93a3;
  --accent: #ffb224;
  --danger: #ff5c5c;
  --ok: #3dd68c;
  --radius: 10px;
  --shadow: 0 6px 18px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--ink); text-decoration: none; }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  width: 100%;
}
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 0 0 10px; }
h3 { font-size: 14px; margin: 18px 0 8px; }
.muted { color: var(--muted); font-size: 13px; }

/* ---------- Buttons ---------- */
.btn {
  background: var(--accent);
  color: #1a1200;
  border: 0;
  border-radius: 8px;
  padding: 9px 16px;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--muted); }
.btn-danger {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
}
.btn-icon {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}
.btn-icon:hover { color: var(--ink); background: var(--panel-2); }

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 18px;
  height: 54px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { font-weight: 800; font-size: 17px; letter-spacing: .02em; }
.brand span { color: var(--accent); }
.brand-big { font-size: 26px; margin-bottom: 4px; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 500;
}
.topbar nav a:hover { color: var(--ink); }
.topbar nav a.active { color: var(--ink); background: var(--panel-2); }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  flex: none;
}
.avatar-sm { width: 24px; height: 24px; font-size: 10px; }

/* ---------- Seitenlayout ---------- */
#main { min-height: calc(100vh - 54px); }
.page { max-width: 1100px; margin: 0 auto; padding: 26px 18px 60px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.center-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.app-loading { color: #8b93a3; padding: 40px; text-align: center; }

/* ---------- Login ---------- */
.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 30px;
  width: 100%;
  max-width: 360px;
  box-shadow: var(--shadow);
}
.login-sub { color: var(--muted); margin: 2px 0 18px; font-size: 13px; }
.login-card label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.login-card input { margin-top: 4px; }
.login-card .btn { width: 100%; margin-top: 6px; }
.login-card a { display: block; text-align: center; margin-top: 14px; color: var(--muted); font-size: 13px; }
.login-card a:hover { color: var(--accent); }

/* ---------- Dashboard ---------- */
.dash-head { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.dash-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 16px;
  min-width: 92px;
  text-align: center;
}
.stat b { display: block; font-size: 22px; }
.stat span { color: var(--muted); font-size: 12px; }
.stat-warn { border-color: var(--danger); }
.stat-warn b { color: var(--danger); }

.dash-sec { margin-bottom: 24px; }
.dash-sec h2 { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--muted); }
.dash-sec h2.h-over { color: var(--danger); }
.dash-sec h2.h-today { color: var(--accent); }
.count {
  background: var(--panel-2);
  border-radius: 20px;
  padding: 1px 8px;
  font-size: 11px;
  color: var(--muted);
  margin-left: 4px;
}
.dash-list { display: flex; flex-direction: column; gap: 6px; }
.dash-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px;
}
.dash-card:hover { border-color: var(--muted); }
.dash-title { font-weight: 600; }
.dash-meta { color: var(--muted); font-size: 12px; flex: 1; }
.board-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.board-dot.big { width: 14px; height: 14px; border-radius: 4px; }
.prio-high { color: var(--danger); font-weight: 800; }

.due {
  font-size: 12px;
  color: var(--muted);
  background: var(--panel-2);
  border-radius: 6px;
  padding: 2px 7px;
  white-space: nowrap;
}
.due-today { color: #1a1200; background: var(--accent); font-weight: 700; }
.due-over { color: #fff; background: var(--danger); font-weight: 700; }

/* ---------- Boards-Übersicht ---------- */
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.board-tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .12s;
}
.board-tile:hover { transform: translateY(-2px); border-color: var(--muted); }
.board-tile-top { height: 6px; background: var(--bc); }
.board-tile-body { padding: 14px; }
.board-tile-title { font-weight: 700; margin-bottom: 4px; }
.board-tile-meta { color: var(--muted); font-size: 12px; }

/* ---------- Kanban ---------- */
.board-page { display: flex; flex-direction: column; height: calc(100vh - 54px); }
.board-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.chip {
  background: var(--panel-2);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 12px;
  color: var(--muted);
}
.chip-team { color: var(--accent); border: 1px solid var(--accent); background: none; }

.board-scroll {
  flex: 1;
  display: flex;
  gap: 14px;
  padding: 18px;
  overflow-x: auto;
  align-items: flex-start;
}
.list {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  width: 280px;
  flex: none;
  display: flex;
  flex-direction: column;
  max-height: 100%;
}
.list-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
}
.list-title { font-weight: 700; font-size: 14px; flex: 1; cursor: default; }
.list-del { opacity: 0; }
.list:hover .list-del { opacity: 1; }
.cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 10px 10px;
  overflow-y: auto;
  min-height: 30px;
}
.card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-left: 3px solid transparent;
  border-radius: 8px;
  padding: 9px 11px;
  cursor: pointer;
}
.card:hover { border-color: var(--muted); }
.card.dragging { opacity: .45; }
.card.prio-high { border-left-color: var(--danger); }
.card.prio-low { border-left-color: #5a8dee; }
.card-done { opacity: .55; }
.card-done .card-title { text-decoration: line-through; }
.card-title { font-weight: 600; font-size: 14px; }
.card-meta { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.card-meta .avatar-sm { margin-left: auto; }
.add-card input, .add-list input {
  background: none;
  border: 1px dashed var(--line);
}
.add-card { padding: 0 10px 10px; }
.add-list { padding: 10px; background: none; border-style: dashed; }

/* ---------- Modals ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 16px;
  z-index: 50;
  overflow-y: auto;
}
.modal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  width: 100%;
  max-width: 720px;
  box-shadow: var(--shadow);
  padding: 18px 20px 22px;
}
.modal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.modal-head h2 { flex: 1; font-size: 17px; margin: 0; }
.modal-title {
  flex: 1;
  font-size: 17px;
  font-weight: 700;
  background: none;
  border: 1px solid transparent;
}
.modal-title:hover, .modal-title:focus { border-color: var(--line); background: var(--panel-2); }
.modal-grid { display: grid; grid-template-columns: 1fr 220px; gap: 22px; }
.modal-side { display: flex; flex-direction: column; gap: 10px; }
.modal-body { display: flex; flex-direction: column; gap: 12px; }
.lbl { font-size: 12px; color: var(--muted); display: block; }
.lbl input, .lbl select, .lbl textarea { margin-top: 4px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); cursor: pointer; }
.check input { width: auto; }
.member-list { display: flex; flex-direction: column; gap: 6px; max-height: 180px; overflow-y: auto; }

.comments { display: flex; flex-direction: column; gap: 10px; margin: 8px 0; }
.comment { display: flex; gap: 10px; font-size: 14px; }
.comment-form { display: flex; gap: 8px; }
.user-list { display: flex; flex-direction: column; gap: 8px; }
.user-row { display: flex; align-items: center; gap: 8px; }

/* ---------- Ansicht-Umschalter ---------- */
.view-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.view-toggle a { padding: 6px 12px; font-size: 13px; color: var(--muted); }
.view-toggle a.active { background: var(--panel-2); color: var(--ink); font-weight: 600; }

/* ---------- Gantt ---------- */
.gantt-scroll { flex: 1; overflow: auto; padding: 14px 18px; }
.gantt { display: inline-block; min-width: 100%; position: relative; }
.g-row { display: flex; align-items: center; }
.g-label {
  width: 220px;
  flex: none;
  padding: 5px 12px 5px 0;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: sticky;
  left: 0;
  background: var(--bg);
  z-index: 3;
}
.g-list-title {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  font-size: 11px;
  color: var(--muted);
  padding-top: 14px;
}
.g-track {
  position: relative;
  height: 30px;
  display: flex;
  flex: none;
  border-bottom: 1px solid rgba(46,54,68,.4);
}
.g-list .g-track { border-bottom: 0; }
.g-col { width: 30px; flex: none; border-left: 1px solid rgba(46,54,68,.4); }
.g-col.g-we { background: rgba(255,255,255,.025); }
.g-day {
  width: 30px;
  flex: none;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  line-height: 30px;
  border-left: 1px solid rgba(46,54,68,.4);
}
.g-day.g-we { background: rgba(255,255,255,.025); }
.g-day.g-today { color: #1a1200; background: var(--accent); font-weight: 800; border-radius: 4px; }
.g-months { border-bottom: 0; }
.g-month {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  line-height: 30px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
  white-space: nowrap;
  overflow: hidden;
}
.g-bar {
  position: absolute;
  top: 5px;
  height: 20px;
  border-radius: 5px;
  cursor: pointer;
  z-index: 2;
  opacity: .92;
  min-width: 10px;
}
.g-bar:hover { opacity: 1; box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
.g-bar.prio-high { box-shadow: 0 0 0 2px var(--danger); }
.g-bar.g-done { opacity: .35; }
.board-page[style*="--today-x"] .g-row:not(.g-head) .g-track::after {
  content: "";
  position: absolute;
  left: var(--today-x);
  top: 0; bottom: -1px;
  width: 2px;
  background: var(--accent);
  opacity: .55;
  z-index: 1;
  pointer-events: none;
}

/* ---------- Kalender ---------- */
.page-wide { max-width: 1400px; }
.cal-nav { display: flex; align-items: center; gap: 10px; }
.cal-nav h1 { min-width: 200px; text-align: center; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-head { margin-bottom: 6px; }
.cal-head div {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .07em;
}
.cal-cell {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 108px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}
.cal-empty { background: none; border-color: transparent; }
.cal-today { border-color: var(--accent); }
.cal-today .cal-daynum { color: var(--accent); font-weight: 800; }
.cal-daynum { font-size: 12px; color: var(--muted); }
.cal-ev {
  font-size: 12px;
  line-height: 1.3;
  padding: 2px 6px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--ec) 26%, var(--panel-2));
  border-left: 3px solid var(--ec);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
a.cal-ev:hover { background: color-mix(in srgb, var(--ec) 45%, var(--panel-2)); }
.cal-ev-feed { opacity: .65; border-left-style: dashed; }
.cal-done { opacity: .4; text-decoration: line-through; }
.cal-more { font-size: 11px; padding-left: 4px; }
.feed-url { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.feed-list { display: flex; flex-direction: column; gap: 8px; }

@media (max-width: 760px) {
  .cal-cell { min-height: 64px; }
  .cal-ev { font-size: 10px; padding: 1px 4px; }
  .g-label { width: 120px; }
}

/* ---------- Suche & Profil ---------- */
#topbar-search { margin-left: auto; }
#topbar-search input {
  width: 200px;
  background: var(--panel-2);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
}
.avatar-btn { cursor: pointer; }
.avatar-btn:hover { border-color: var(--accent); }
.user-inactive { opacity: .5; }
.user-row .um-toggle { margin-left: auto; padding: 4px 10px; font-size: 12px; }

/* ---------- Mail ---------- */
.mail-page { display: flex; height: calc(100vh - 54px); }
.mail-side {
  width: 220px;
  flex: none;
  border-right: 1px solid var(--line);
  padding: 14px 10px;
  overflow-y: auto;
  background: var(--panel);
}
.mail-side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 8px; }
.mail-folder {
  display: block;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mail-folder:hover { color: var(--ink); }
.mail-folder.active { background: var(--panel-2); color: var(--ink); font-weight: 600; }
.mail-main { flex: 1; overflow-y: auto; }
.mail-list-head { padding: 14px 18px 8px; border-bottom: 1px solid var(--line); }
.mail-row {
  display: grid;
  grid-template-columns: 200px 1fr auto;
  gap: 14px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(46,54,68,.5);
  cursor: pointer;
  align-items: center;
}
.mail-row:hover { background: var(--panel); }
.mail-unseen .mail-row-from, .mail-unseen .mail-row-subject { font-weight: 700; }
.mail-unseen { border-left: 3px solid var(--accent); }
.mail-row-from, .mail-row-subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-row-date { font-size: 12px; white-space: nowrap; }
.chip-linked { color: var(--accent); border: 1px solid var(--accent); background: none; }
.mail-msg { padding: 18px; max-width: 900px; }
.mail-actions { display: flex; gap: 10px; margin: 12px 0; }
.mail-body {
  white-space: pre-wrap;
  word-wrap: break-word;
  font: 14px/1.5 inherit;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin-top: 6px;
}
.card-mailbox {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}
.card-mailbox .mail-actions { margin: 4px 0 0; }
.form-grid { display: grid; grid-template-columns: 1fr 110px 170px; gap: 10px 12px; align-items: start; }

@media (max-width: 760px) {
  #topbar-search input { width: 110px; }
  .mail-side { width: 140px; }
  .mail-row { grid-template-columns: 1fr auto; }
  .mail-row-from { display: none; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translate(-50%, 12px);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 18px;
  opacity: 0;
  transition: .25s;
  z-index: 100;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-error { border-color: var(--danger); color: var(--danger); }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .modal-grid { grid-template-columns: 1fr; }
  .topbar { gap: 10px; }
  .list { width: 82vw; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Checkliste & Aktivität (Phase 3) ---------- */
.cl-bar { height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; margin: 2px 0 8px; }
.cl-bar-fill { height: 100%; background: var(--ok, #4caf7d); width: 0; transition: width .25s; }
.checklist { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.cl-item { display: flex; align-items: center; justify-content: space-between; padding: 3px 6px; border-radius: 6px; }
.cl-item:hover { background: var(--panel-2); }
.cl-item .cl-del { opacity: 0; }
.cl-item:hover .cl-del { opacity: 1; }
.cl-done label { text-decoration: line-through; color: var(--muted); }
.chip-ok { color: #4caf7d; border-color: #4caf7d; }
.cm-activity { margin-top: 14px; }
.cm-activity summary { cursor: pointer; font-size: 13px; }
.act-row { padding: 7px 4px; border-bottom: 1px solid rgba(46,54,68,.5); font-size: 14px; }
.act-row .muted { font-size: 12px; margin-left: 6px; }
.act-link { color: inherit; }
.act-link:hover b { color: var(--accent); }

/* ---------- Phase 5: Labels, Filter, Hinweise ---------- */
.lbl-chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  padding: 0 7px;
  border-radius: 10px;
  color: #10141a;
  border: 0;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 5px; }
.lbl-pick { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.lbl-pick .lbl-chip { background: var(--lc); cursor: pointer; opacity: .35; padding: 2px 10px; font-size: 12px; }
.lbl-pick .lbl-chip.on { opacity: 1; box-shadow: 0 0 0 2px var(--panel), 0 0 0 3px var(--lc); }
.lbl a { color: var(--accent); margin-left: 6px; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 18px; border-bottom: 1px solid var(--line); }
.filter-bar input[type=search] { width: 200px; }
.filter-bar select { width: auto; }
.card[hidden] { display: none; }
.notice {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 12px 18px;
}
.page .notice { margin: 0 0 18px; }
.notice-actions { display: flex; gap: 8px; }
.board-archived { opacity: .6; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ig-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ig-form input, .ig-form select { width: auto; flex: 1 1 140px; }
.secret-box { border: 1px solid var(--ok); border-radius: 8px; padding: 10px 12px; background: color-mix(in srgb, var(--ok) 10%, var(--panel)); }
.secret-box input { margin-top: 6px; font-family: ui-monospace, Consolas, monospace; }
code { background: var(--panel-2); border-radius: 4px; padding: 1px 5px; font-size: 12px; }

/* ---------- Phase 5: Kalender (Termine, Woche) ---------- */
.cal-daynum { display: flex; justify-content: space-between; align-items: center; }
.cal-add { opacity: 0; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 4px; border-radius: 4px; }
.cal-cell:hover .cal-add, .cal-add:focus-visible { opacity: 1; }
.cal-add:hover { color: var(--accent); background: var(--panel-2); }
.cal-ev.dragging, .wk-ev.dragging { opacity: .4; }
.cal-ev-own { display: block; cursor: pointer; }
.cal-ev-own:hover { background: color-mix(in srgb, var(--ec) 45%, var(--panel-2)); }
a.cal-more { color: var(--muted); }

.wk { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
.wk-row { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); }
.wk-gutter { font-size: 11px; padding: 4px 6px; align-self: center; text-align: right; }
.wk-dayhead { text-align: center; padding: 8px 4px; font-size: 13px; font-weight: 600; border-left: 1px solid var(--line); }
.wk-dayhead a { color: var(--ink); }
.wk-dayhead.wk-today { color: var(--accent); }
.wk-heads { border-bottom: 1px solid var(--line); }
.wk-alldays { border-bottom: 1px solid var(--line); }
.wk-adcol { border-left: 1px solid var(--line); padding: 3px; display: flex; flex-direction: column; gap: 2px; min-height: 30px; }
.wk-adcol.wk-today, .wk-col.wk-today { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.wk-scroll { max-height: calc(100vh - 290px); min-height: 320px; overflow-y: auto; }
.wk-times { position: relative; }
.wk-hour { position: relative; border-top: 1px solid rgba(46,54,68,.5); }
.wk-hour:first-child { border-top: 0; }
.wk-hour span { position: absolute; top: -8px; right: 6px; font-size: 11px; color: var(--muted); background: var(--panel); padding: 0 2px; }
.wk-hour:first-child span { top: 2px; }
.wk-col {
  position: relative;
  border-left: 1px solid var(--line);
  cursor: cell;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 47px, rgba(46,54,68,.5) 47px, rgba(46,54,68,.5) 48px);
}
.wk-ev {
  position: absolute;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.3;
  padding: 2px 5px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--ec) 35%, var(--panel-2));
  border-left: 3px solid var(--ec);
  cursor: pointer;
  z-index: 2;
}
.wk-ev:hover { background: color-mix(in srgb, var(--ec) 55%, var(--panel-2)); z-index: 3; }
.wk-ev b { font-weight: 700; }
.wk-loc { color: var(--muted); }
.wk-feed { opacity: .65; border-left-style: dashed; cursor: default; }
.wk-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 4; pointer-events: none; }
.wk-now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
@media (max-width: 760px) {
  .wk-row { grid-template-columns: 34px repeat(7, minmax(0, 1fr)); }
  .wk-ev { font-size: 10px; padding: 1px 3px; }
  .wk-hour span { font-size: 9px; right: 2px; }
  .two-col { grid-template-columns: 1fr; }
  .filter-bar input[type=search] { width: 100%; }
}
/* hidden-Attribut muss immer gewinnen (auch bei display:grid/flex) */
[hidden] { display: none !important; }
@media (max-width: 1100px) {
  .topbar { gap: 8px; padding: 0 10px; }
  .topbar nav a { padding: 6px 8px; font-size: 14px; }
  #topbar-search input { width: 110px; }
}
/* ---------- Phase 6: Verantwortliche, Unterkarten, Erwähnungen, Glocke ---------- */
.avatars { display: inline-flex; margin-left: auto; }
.avatars .avatar-sm { margin-left: -6px; border: 2px solid var(--panel-2); }
.avatars .avatar-sm:first-child { margin-left: 0; }
.card-meta .avatars .avatar-sm { margin-left: -6px; }
.card-meta .avatars .avatar-sm:first-child { margin-left: 0; }
.card-parent { font-size: 11px; color: var(--muted); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-item .cl-actions { display: inline-flex; opacity: 0; }
.cl-item:hover .cl-actions { opacity: 1; }
.cl-item .cl-actions .cl-del { opacity: 1; }
.cl-item .cl-tocard { font-size: 16px; }
/* Notiz / Bezugsquelle am Checklistenpunkt (Phase 8) */
.cl-item .cl-main { flex: 1; min-width: 0; }
.cl-item .cl-note { margin: 0 0 3px 26px; font-size: 12px; color: var(--muted); word-break: break-word; }
.cl-item .cl-note a, .card-info a { color: var(--accent); }
#cl-all-tocards { display: inline-block; margin: 2px 6px 8px; }
.ch-open { color: inherit; }
.ch-open:hover { color: var(--accent); }
.mention { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.mention-host { position: relative; }
.mention-pop {
  position: absolute; left: 0; bottom: calc(100% + 4px); min-width: 240px; z-index: 60;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden;
}
.mention-item { padding: 7px 12px; cursor: pointer; font-size: 14px; }
.mention-item.sel, .mention-item:hover { background: color-mix(in srgb, var(--accent) 18%, var(--panel-2)); }
.comment-body { white-space: pre-wrap; word-wrap: break-word; }
.bell { position: relative; font-size: 17px; }
.bell-count {
  position: absolute; top: -3px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}
.notif-list { display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow-y: auto; }
.notif { display: flex; gap: 10px; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line); font-size: 14px; }
.notif:hover { border-color: var(--muted); }
.notif-unread { background: color-mix(in srgb, var(--accent) 10%, var(--panel)); border-color: var(--accent); }
.notif-type { width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--panel-2); text-align: center; line-height: 22px; font-weight: 700; color: var(--accent); }
/* Automatische Infos (getrennt von den eigenen Notizen) */
.card-info {
  white-space: pre-wrap; word-wrap: break-word; margin: 4px 0 10px; padding: 10px 12px; font: 13px/1.5 inherit; color: var(--muted);
  background: var(--panel-2); border: 1px dashed var(--line); border-left: 3px solid var(--accent); border-radius: 8px;
}

/* ============================================================
   Phase 7 – Theme, Anhänge, Zeiterfassung, Gantt 2.0, Bericht, Auslastung, Automationen
   ============================================================ */
:root[data-theme="light"] {
  --bg: #f3f4f7; --panel: #ffffff; --panel-2: #eef0f5; --line: #d5d9e2; --ink: #1d2230; --muted: #667085;
  --accent: #d98a00; --danger: #d92d2d; --ok: #1f9d64; --shadow: 0 6px 18px rgba(20,30,50,.15);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] {
    --bg: #f3f4f7; --panel: #ffffff; --panel-2: #eef0f5; --line: #d5d9e2; --ink: #1d2230; --muted: #667085;
    --accent: #d98a00; --danger: #d92d2d; --ok: #1f9d64; --shadow: 0 6px 18px rgba(20,30,50,.15);
    color-scheme: light;
  }
}
:root[data-theme="light"] .g-col.g-we, :root[data-theme="light"] .g-day.g-we { background: rgba(0,0,0,.04); }
:root[data-theme="light"] .g-col, :root[data-theme="light"] .g-day, :root[data-theme="light"] .g-track { border-color: rgba(0,0,0,.08); }
[hidden] { display: none !important; }

/* Chips */
.chip-over, .chip-warn { color: var(--danger); border: 1px solid var(--danger); background: none; }
.chip-ms { color: var(--accent); border: 1px solid var(--accent); background: none; }
.count-over { color: var(--danger) !important; font-weight: 700; }
.list-wip { font-size: 12px; }
.dragging-list { opacity: .5; outline: 2px dashed var(--accent); }
.btn-sm { padding: 3px 9px; font-size: 12px; }

/* Anhänge */
.att-list { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 10px; }
.att-item { display: flex; align-items: center; gap: 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.att-item a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--accent); }
.att-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; flex: none; }
.att-ico { width: 40px; height: 40px; flex: none; display: grid; place-items: center; font-size: 20px; }
.att-del { flex: none; }
.file-btn { display: inline-block; cursor: pointer; }
.file-btn input { display: none; }

/* Aufwand / Zeiterfassung */
.effort { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0; font-size: 13px; }
.effort input { width: 90px; }
.cm-side-extra { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.cm-dep { display: flex; gap: 8px; align-items: center; font-size: 13px; padding: 2px 0; }
.cm-dep input { width: auto; }
.timer-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  background: var(--accent); color: #1a1200; font-weight: 700; font-size: 12px; cursor: pointer; border: 0;
}

/* Markdown */
.md-preview { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-top: 6px; }
.md-code { background: var(--panel-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; font-family: ui-monospace, Consolas, monospace; font-size: .92em; }
pre.md-code { display: block; padding: 8px 10px; overflow: auto; white-space: pre-wrap; }
.md-h { font-weight: 700; margin: 6px 0 2px; }
.md-quote { border-left: 3px solid var(--accent); margin: 4px 0; padding: 2px 10px; color: var(--muted); }
.md-hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; }

/* Tastenkürzel-Hilfe */
.sc-table { width: 100%; border-collapse: collapse; }
.sc-table td { padding: 5px 8px; border-bottom: 1px solid var(--line); }
kbd { background: var(--panel-2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; font: 12px ui-monospace, Consolas, monospace; }

/* Gantt 2.0 */
.gantt { user-select: none; }
.g-bar { touch-action: none; }
.g-bar.g-dragging { opacity: 1; box-shadow: 0 0 0 2px var(--accent); cursor: grabbing; z-index: 5; }
.g-bar.g-crit { box-shadow: 0 0 0 2px #ff8a1f; }
.g-bar.g-late { box-shadow: 0 0 0 2px var(--danger); }
.g-bar.g-ms { transform: rotate(45deg) scale(.72); border-radius: 3px; min-width: 20px; }
.g-h { position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; }
.g-h-l { left: 0; } .g-h-r { right: 0; }
.g-h:hover { background: rgba(255,255,255,.35); }
.g-basebar { position: absolute; top: 22px; height: 5px; border-radius: 3px; background: var(--muted); opacity: .7; z-index: 1; }
.g-deps { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 4; overflow: visible; }
.g-dep { fill: none; stroke: var(--muted); stroke-width: 1.4; }
.g-dep-bad { stroke: var(--danger); stroke-width: 2; }
.g-dep-crit { stroke: #ff8a1f; stroke-width: 2; }
.g-deps marker path { fill: context-stroke; }
.board-head .check { font-size: 13px; }

/* Bericht */
.report { padding: 14px 18px 40px; display: flex; flex-direction: column; gap: 16px; overflow: auto; }
.report-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.report section { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; min-width: 0; }
.report h3 { margin: 0 0 8px; font-size: 14px; }
.chart { width: 100%; height: auto; }
.chart .ax { stroke: var(--line); stroke-width: 1; }
.chart .tx { fill: var(--muted); font-size: 10px; }
.chart .ln { fill: none; stroke: var(--accent); stroke-width: 2; }
.chart .area { fill: var(--accent); opacity: .15; }
.chart .bar { fill: var(--ok); }
.rtable { width: 100%; border-collapse: collapse; font-size: 13px; }
.rtable td { padding: 4px 6px; border-bottom: 1px solid var(--line); }
.r-over { color: var(--danger); font-weight: 700; text-align: right; white-space: nowrap; }
.bar-row { display: flex; align-items: center; gap: 10px; margin: 4px 0; font-size: 13px; }
.bar-name { width: 160px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; height: 8px; background: var(--panel-2); border-radius: 4px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--accent); }
@media print { .app-nav, nav, .board-head .btn-ghost, .toast { display: none !important; } body { background: #fff; color: #000; } }

/* Auslastung */
.page-wide { max-width: 1200px; }
.wl-scroll { overflow: auto; margin-top: 14px; }
.wl { border-collapse: separate; border-spacing: 3px; width: 100%; }
.wl th { font-size: 12px; color: var(--muted); font-weight: 600; text-align: center; padding: 4px 8px; }
.wl th small { display: block; font-weight: 400; }
.wl tbody th { text-align: left; color: var(--ink); white-space: nowrap; }
.wl td { text-align: center; border-radius: 6px; padding: 8px 6px; min-width: 76px; font-size: 13px; }
.wl td small { display: block; color: var(--muted); font-size: 10px; }
.wl-empty { color: var(--muted); background: var(--panel); }
.wl-ok { background: rgba(61,214,140,.16); }
.wl-high { background: rgba(255,178,36,.28); }
.wl-over { background: rgba(255,92,92,.30); }
span.wl-key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; margin: 0 4px 0 10px; }

/* Automationen */
.au-item { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.au-btns { display: flex; gap: 6px; flex: none; align-items: center; }
.ae-action { display: grid; grid-template-columns: 200px 1fr auto; gap: 8px; align-items: start; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.ae-a-params { display: flex; gap: 8px; flex-wrap: wrap; }
.ae-a-params > * { flex: 1 1 140px; min-width: 0; }
.modal code { background: var(--panel-2); padding: 0 5px; border-radius: 4px; }
@media (max-width: 720px) {
  .report-grid { grid-template-columns: 1fr; }
  .ae-action { grid-template-columns: 1fr auto; }
  .ae-action .ae-a-params { grid-column: 1 / -1; }
}

/* ============================================================
   Phase 7b – Handy-Ansicht, Aufklapp-Menüs, einklappbare Kartenbereiche
   ============================================================ */
.only-mobile, .tabbar { display: none; }
.filter-more { display: contents; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Aufklapp-Menüs (Board „⋯ Mehr", Karte „⋯", Gantt „Ansicht") */
details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; user-select: none; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 210px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow);
  padding: 6px; display: flex; flex-direction: column; gap: 2px;
}
.board-menu .menu-pop { left: 0; right: auto; }
.menu-item { background: none; border: 0; text-align: left; padding: 10px 12px; border-radius: 7px; cursor: pointer; color: var(--ink); width: 100%; }
.menu-item:hover { background: var(--panel-2); }
.menu-danger { color: var(--danger); }
.menu-pop-form { padding: 12px; gap: 10px; min-width: 240px; }

/* Karte: einklappbare Bereiche – Kopfzeile zeigt den Stand, ohne aufzuklappen */
.cm-sections { display: flex; flex-direction: column; margin-top: 6px; border-top: 1px solid var(--line); }
.cm-box { display: contents; }
.cm-sec { border-bottom: 1px solid var(--line); margin: 0; }
.cm-sec > summary { list-style: none; cursor: pointer; user-select: none; padding: 11px 2px; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.cm-sec > summary::-webkit-details-marker { display: none; }
.cm-sec > summary::before { content: "▸"; color: var(--muted); width: 10px; transition: transform .15s; }
.cm-sec[open] > summary::before { transform: rotate(90deg); }
.cm-sec[open] { padding-bottom: 12px; }
.cm-sec[open] > :not(summary) + :not(summary) { margin-top: 8px; }
.cm-badge { margin-left: auto; font-weight: 400; font-size: 12px; text-align: right; }
.cm-badge:empty { display: none; }
.cm-activity.cm-sec { margin-top: 0; }
.cm-plan-extra { display: flex; flex-direction: column; gap: 10px; }
.cm-assign > summary { list-style: none; cursor: pointer; display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; padding: 2px 0; }
.cm-assign > summary::-webkit-details-marker { display: none; }
.cm-assign > summary::before { content: "▸"; color: var(--muted); }
.cm-assign[open] > summary::before { content: "▾"; }
.cm-assign .member-list { margin-top: 6px; }
.modal-foot {
  position: sticky; bottom: 0; z-index: 3; background: var(--panel); border-top: 1px solid var(--line);
  margin: 16px -20px -22px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  display: flex; justify-content: flex-end; border-radius: 0 0 14px 14px;
}
.modal-foot:empty { display: none; }
.modal-foot .btn { min-width: 150px; }
.sheet-list a { display: block; padding: 14px 6px; border-bottom: 1px solid var(--line); font-size: 16px; }

@media (hover: none) {
  .list-del, .cl-item .cl-del, .cl-item .cl-actions, .ac-del { opacity: 1; }
}
@media (pointer: coarse) {
  .g-h { width: 16px; }
  .btn-icon { min-width: 38px; min-height: 38px; }
}

/* ---------- Handy (bis 720 px Breite) ---------- */
@media (max-width: 720px) {
  html { -webkit-text-size-adjust: 100%; }
  body { overflow-x: hidden; }
  input, select, textarea { font-size: 16px; }             /* iOS zoomt sonst beim Antippen in das Feld */
  .btn, .btn-ghost, .btn-danger { min-height: 40px; }
  .only-mobile { display: inline-flex; }
  .not-mobile { display: none !important; }

  /* Kopfzeile schlank, Hauptmenü unten */
  .topbar { height: calc(50px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 12px 0; gap: 8px; }
  .topbar nav { display: none; }
  .brand { flex: 1; }
  .topbar-right { gap: 6px; }
  #topbar-search { display: none; position: absolute; left: 0; right: 0; top: 100%; margin: 0; padding: 8px 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
  #topbar-search.open { display: block; }
  #topbar-search input { width: 100%; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
    height: calc(56px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--panel); border-top: 1px solid var(--line);
  }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; }
  .tabbar span { font-size: 19px; line-height: 1; }
  .tabbar a.active { color: var(--accent); font-weight: 700; }
  #main { min-height: 0; padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(72px + env(safe-area-inset-bottom)); max-width: 92vw; }

  /* Seiten */
  .page { padding: 14px 12px 24px; }
  .page-head { flex-wrap: wrap; gap: 10px; }
  h1 { font-size: 21px; }
  .cal-nav h1 { min-width: 0; font-size: 17px; }
  .dash-head { gap: 12px; }
  .dash-card { flex-wrap: wrap; }

  /* Board */
  .board-page { height: calc(100vh - 106px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); height: calc(100dvh - 106px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .board-head { flex-wrap: wrap; padding: 10px 12px; gap: 8px; }
  .board-head h1 { font-size: 18px; flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .board-head .board-menu { order: 3; }
  .board-head .view-toggle { order: 5; flex: 1 1 100%; display: flex; }
  .board-head .view-toggle a { flex: 1; text-align: center; padding: 8px 4px; }
  .board-head .chip, .board-head .chip-linked { order: 6; }
  .notice { padding: 10px 12px; font-size: 14px; }
  .filter-bar { padding: 8px 12px; gap: 8px; }
  .filter-bar input[type=search] { flex: 1; width: auto; min-width: 0; }
  .filter-more { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: 8px; }
  .filter-more.open { display: flex; }
  .filter-more select { width: 100%; }
  .board-scroll { scroll-snap-type: x mandatory; scroll-padding-left: 12px; padding: 12px; gap: 10px; -webkit-overflow-scrolling: touch; }
  .list { width: 84vw; max-width: 340px; scroll-snap-align: start; }
  .card { padding: 11px 12px; }
  .card-title { font-size: 15px; }

  /* Menüs als Blatt am unteren Rand */
  .menu-pop { position: fixed; left: 12px; right: 12px; top: auto; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 60; }
  .board-menu .menu-pop { left: 12px; right: 12px; }
  .menu-item { padding: 14px 12px; font-size: 16px; }

  /* Dialoge: Vollbild, Blatt für „Mehr" */
  .modal-backdrop { padding: 0; align-items: flex-start; }
  .modal { max-width: none; min-height: 100vh; min-height: 100dvh; border: 0; border-radius: 0; padding: 0 14px 16px; box-shadow: none; }
  .modal-head { position: sticky; top: 0; z-index: 4; background: var(--panel); margin: 0 -14px 12px; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; border-bottom: 1px solid var(--line); }
  .modal-grid { grid-template-columns: 1fr; gap: 14px; }
  .modal-side { order: -1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .modal-side > label:first-child, .modal-side .cm-assign, .modal-side .cm-done-row { grid-column: 1 / -1; }
  .modal-foot { margin: 14px -14px -16px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); border-radius: 0; }
  .modal-foot .btn { width: 100%; }
  .modal-backdrop.sheet { align-items: flex-end; }
  .sheet .modal { min-height: 0; border-radius: 16px 16px 0 0; padding: 0 14px calc(14px + env(safe-area-inset-bottom)); }
  .sheet .modal-head { position: static; padding-top: 14px; }
  .modal table { display: block; overflow-x: auto; max-width: 100%; }
  .two-col { grid-template-columns: 1fr; }

  /* Gantt, Bericht, Auslastung */
  .gantt-scroll { padding: 8px; }
  .g-label { width: 104px; font-size: 12px; }
  .report { padding: 10px 12px 24px; }
  .report-tiles { grid-template-columns: 1fr 1fr; }
  .bar-name { width: 100px; }
  .wl td { min-width: 64px; }
}

/* Kalender: Aktionsmenü, Handy-Monatsansicht (Punkte + Tagesliste), Wochenansicht seitlich scrollbar */
.cal-actions { display: flex; gap: 8px; align-items: center; }
.cal-nav { flex-wrap: wrap; }
.cal-dots, .cal-agenda { display: none; }
@media (max-width: 720px) {
  .cal-actions { width: 100%; }
  .page-head .cal-nav { width: 100%; }
  .cal-grid { gap: 3px; }
  .cal-cell { min-height: 46px; padding: 3px; cursor: pointer; }
  .cal-cell .cal-ev, .cal-cell .cal-more, .cal-cell .cal-add { display: none; }
  .cal-dots { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
  .cal-dots i { width: 7px; height: 7px; border-radius: 50%; display: block; }
  .cal-sel { background: var(--panel-2); border-color: var(--muted); }
  .cal-agenda { display: block; margin-top: 12px; }
  .cal-agenda-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
  .cal-agenda-day { display: flex; flex-direction: column; gap: 6px; }
  .cal-agenda-day[hidden] { display: none; }
  .cal-agenda .cal-ev { font-size: 14px; padding: 9px 10px; white-space: normal; }
  .wk { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .wk > * { min-width: 720px; }
  .wk-scroll { max-height: calc(100dvh - 330px); }
}
@media (max-width: 720px) {
  .dash-stats { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .dash-card .dash-meta { flex: 1 1 100%; order: 5; }
}
.user-row { flex-wrap: wrap; }
.feed-url { overflow-wrap: anywhere; min-width: 0; }
@media (max-width: 720px) { .board-head > button.btn-ghost { order: 7; } }

/* Karten-Fuß bleibt am unteren Bildschirmrand kleben: Abstand unten über den Dialog statt über das Polster des Hintergrunds */
.modal-backdrop { padding-bottom: 0; }
.modal-backdrop .modal { margin-bottom: 6vh; }
@media (max-width: 720px) { .modal-backdrop .modal { margin-bottom: 0; } }