/* =============================================================
   style.css – das Aussehen des Dashboards
   -------------------------------------------------------------
   Ganz oben stehen die Farben als "Variablen". Wer das Design
   anpassen will, muss meist nur dort etwas ändern.
   ============================================================= */

:root {
  /* Hauptfarben */
  --primary: #6366f1;          /* Indigo */
  --primary-2: #8b5cf6;        /* Violett (für Farbverläufe) */
  --primary-soft: #eef2ff;

  /* Seitenleiste */
  --side-bg: #151632;
  --side-bg-2: #1e1b4b;
  --side-text: #a5a8d4;

  /* Flächen & Text */
  --bg: #f4f5fb;
  --card: #ffffff;
  --text: #1e1f3b;
  --muted: #7a7d9c;
  --border: #e7e8f3;

  /* Status-Farben */
  --todo: #94a3b8;
  --doing: #3b82f6;
  --review: #f59e0b;
  --done: #10b981;
  --danger: #ef4444;

  --radius: 16px;
  --shadow: 0 1px 2px rgba(30, 31, 59, .04), 0 8px 24px rgba(30, 31, 59, .06);
  --shadow-lg: 0 20px 50px rgba(30, 31, 59, .18);
}

* { box-sizing: border-box; }
/* Elemente mit dem Attribut "hidden" immer ausblenden – auch wenn sie sonst display:flex/grid haben */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
}

/* Farbige "Lichtflecken" im Hintergrund, damit es nicht steril wirkt */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(600px 400px at 85% -5%, rgba(139, 92, 246, .14), transparent 70%),
    radial-gradient(500px 400px at 30% 105%, rgba(20, 184, 166, .10), transparent 70%),
    var(--bg);
}

button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); }

/* ================= Layout ================= */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 250px; flex-shrink: 0;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 24px 16px;
  background: linear-gradient(180deg, var(--side-bg) 0%, var(--side-bg-2) 100%);
  color: var(--side-text);
}

.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; }
.brand-logo {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 20px; color: #fff;
  background: linear-gradient(135deg, var(--primary), #ec4899);
  box-shadow: 0 8px 20px rgba(236, 72, 153, .35);
}
.brand-name { color: #fff; font-weight: 700; font-size: 16px; }
.brand-sub { font-size: 12px; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 12px;
  color: var(--side-text); text-decoration: none; font-weight: 500;
  transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(99, 102, 241, .9), rgba(139, 92, 246, .9));
  box-shadow: 0 8px 20px rgba(99, 102, 241, .35);
}
.nav svg { width: 19px; height: 19px; }

.me {
  margin-top: auto; padding: 14px;
  border-radius: 14px; background: rgba(255, 255, 255, .06);
}
.me-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.me-row { display: flex; align-items: center; gap: 10px; }
.me-name { flex: 1; min-width: 0; color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-btn {
  width: 30px; height: 30px; flex-shrink: 0; display: grid; place-items: center;
  border: none; border-radius: 8px; background: transparent; color: var(--side-text); cursor: pointer;
}
.me-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.me-btn svg { width: 16px; height: 16px; }

/* Team-Karte: Einladen-Button */
.invite-btn { margin-top: 14px; width: 100%; justify-content: center; padding: 8px 12px; font-size: 13px; }
.btn.full-width { width: 100%; justify-content: center; }

.main { flex: 1; min-width: 0; padding: 28px 40px; }

/* ================= Seitenkopf ================= */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 28px;
}
.page-head h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.page-head p { margin: 6px 0 0; color: var(--muted); }

/* ================= Bausteine ================= */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px;
  border: 1px solid rgba(231, 232, 243, .7);
}
.card h2 {
  margin: 0 0 16px; font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.card h2 a { font-size: 13px; font-weight: 600; text-decoration: none; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 12px; border: none; cursor: pointer;
  font-weight: 600; color: #fff; text-decoration: none; white-space: nowrap;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 6px 16px rgba(99, 102, 241, .3);
  transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(99, 102, 241, .38); }
.btn svg { width: 17px; height: 17px; }
.btn.ghost { background: var(--card); color: var(--text); box-shadow: none; border: 1px solid var(--border); }
.btn.ghost:hover { background: var(--primary-soft); }
.btn.danger { background: #fee2e2; color: #b91c1c; box-shadow: none; }
.btn.teams { background: linear-gradient(135deg, #5b5fc7, #4f52b2); }

.icon-btn {
  width: 34px; height: 34px; display: inline-grid; place-items: center;
  border: none; border-radius: 10px; background: transparent; cursor: pointer; color: var(--muted);
}
.icon-btn:hover { background: var(--primary-soft); color: var(--primary); }
.icon-btn svg { width: 17px; height: 17px; }

.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: #fff;
  border: 2px solid #fff;
}
.avatar.lg { width: 64px; height: 64px; font-size: 22px; border-width: 3px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { width: 28px; height: 28px; font-size: 11px; margin-left: -5px; }
.avatar-stack .avatar:first-child { margin-left: 0; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge svg { width: 13px; height: 13px; }
.badge.gray { background: #f1f2f8; color: var(--muted); }
.badge.red { background: #fee2e2; color: #b91c1c; }
.badge.amber { background: #fef3c7; color: #92400e; }
.badge.green { background: #d1fae5; color: #047857; }
.badge.indigo { background: var(--primary-soft); color: var(--primary); }

.empty { text-align: center; color: var(--muted); padding: 28px 8px; }
.muted { color: var(--muted); }

/* ================= Übersicht ================= */
.stats { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 18px; margin-bottom: 22px; }
.stat {
  position: relative; overflow: hidden;
  padding: 20px; border-radius: var(--radius); color: #fff;
  box-shadow: var(--shadow);
}
.stat::after {               /* dekorativer Kreis */
  content: ''; position: absolute; right: -30px; top: -30px;
  width: 120px; height: 120px; border-radius: 50%; background: rgba(255, 255, 255, .12);
}
.stat .stat-icon {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .2); margin-bottom: 14px;
}
.stat .stat-icon svg { width: 20px; height: 20px; }
.stat .stat-value { font-size: 28px; font-weight: 800; line-height: 1.1; }
.stat .stat-label { opacity: .85; font-size: 13px; margin-top: 2px; }
.stat.c1 { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.stat.c2 { background: linear-gradient(135deg, #ec4899, #f472b6); }
.stat.c3 { background: linear-gradient(135deg, #14b8a6, #06b6d4); }
.stat.c4 { background: linear-gradient(135deg, #f59e0b, #f97316); }
.stat.c4 .stat-value { font-size: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-kicker { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; opacity: .9; margin-bottom: 4px; }
.stat.clickable { cursor: pointer; transition: transform .12s; }
.stat.clickable:hover { transform: translateY(-2px); }

.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; }
.grid-2 > div { display: flex; flex-direction: column; gap: 22px; min-width: 0; }

/* Übersicht = genau eine Bildschirmhöhe (100vh minus Innenabstand von .main).
   Die Karten teilen sich den Platz, lange Listen scrollen innerhalb der Karte. */
.overview { height: calc(100vh - 56px); min-height: 620px; display: flex; flex-direction: column; }
.overview .page-head { margin-bottom: 18px; }
.overview .stats { margin-bottom: 18px; }
.overview .stat { padding: 16px 20px; }
.overview .stat .stat-icon { margin-bottom: 10px; }
.overview .grid-2 { flex: 1; min-height: 0; gap: 18px; }
.overview .grid-2 > div { min-height: 0; gap: 18px; }
.card.fill { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.card.fill h2 { flex-shrink: 0; margin-bottom: 8px; }
.card-scroll { flex: 1; min-height: 0; overflow-y: auto; margin-right: -10px; padding-right: 10px; }
.card-scroll::-webkit-scrollbar { width: 6px; }
.card-scroll::-webkit-scrollbar-thumb { background: #dcdef0; border-radius: 3px; }

.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* Datum-Kachel bei Meetings */
.date-tile {
  width: 48px; flex-shrink: 0; text-align: center; border-radius: 12px; overflow: hidden;
  background: var(--primary-soft); color: var(--primary);
}
.date-tile .m { font-size: 10px; font-weight: 700; text-transform: uppercase; background: var(--primary); color: #fff; padding: 2px 0; }
.date-tile .d { font-size: 18px; font-weight: 800; padding: 3px 0 4px; }

/* Team-Tempo: Balkendiagramm "neu vs. erledigt" pro Woche */
.tempo { --c-new: #ec4899; --c-done: #6366f1; }
.tempo { flex-shrink: 0; }
.tempo-heads { display: flex; gap: 28px; margin-bottom: 14px; }
.tempo-num { font-size: 28px; font-weight: 800; line-height: 1.1; }
.tempo-heads .muted { font-size: 13px; display: flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.tempo-chart {
  position: relative; display: flex; align-items: stretch; gap: 6px;
  height: 110px; border-bottom: 1px solid var(--border);
}
.tempo-week { position: relative; flex: 1; display: flex; flex-direction: column; border-radius: 8px 8px 0 0; }
.tempo-week:hover { background: #f4f5fb; }
.tempo-bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; padding-top: 6px; }
.tempo-bars .bar { width: 12px; border-radius: 4px 4px 0 0; transition: height .4s ease; }
.tempo-label { position: absolute; left: 0; right: 0; bottom: -22px; text-align: center; font-size: 11px; color: var(--muted); }
.tempo-tip {
  position: absolute; top: -8px; transform: translate(-50%, -100%);
  background: var(--side-bg); color: #fff; font-size: 12px; line-height: 1.4;
  padding: 6px 10px; border-radius: 8px; white-space: nowrap; pointer-events: none; z-index: 2;
}
.tempo-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 34px; }

/* Aktivitäten */
.activity-icon {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center;
}
.activity-icon svg { width: 16px; height: 16px; }
.ai-task { background: #dbeafe; color: #2563eb; }
.ai-file { background: #fce7f3; color: #db2777; }
.ai-meeting { background: #ede9fe; color: #7c3aed; }
.ai-user { background: #d1fae5; color: #059669; }

/* ================= Aufgaben (Kanban) ================= */
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  background: var(--card); border: 1px solid var(--border); font-weight: 600; color: var(--muted);
}
.chip.active { background: var(--text); color: #fff; border-color: var(--text); }

.board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 18px; overflow-x: auto; padding-bottom: 8px; }
.column {
  background: rgba(255, 255, 255, .55); backdrop-filter: blur(6px);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; min-height: 420px;
  transition: background .15s, border-color .15s;
}
.column.drag-over { background: var(--primary-soft); border-color: var(--primary); border-style: dashed; }
.column-head { display: flex; align-items: center; gap: 8px; font-weight: 700; padding: 4px 4px 14px; }
.column-head .count { margin-left: auto; background: #fff; color: var(--muted); border-radius: 999px; padding: 1px 9px; font-size: 12px; }
.column-head .icon-btn { width: 26px; height: 26px; }

.task-card {
  position: relative; background: var(--card); border-radius: 14px;
  padding: 14px 14px 12px 18px; margin-bottom: 10px;
  box-shadow: var(--shadow); cursor: grab; overflow: hidden;
  transition: transform .12s, box-shadow .12s;
}
.task-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(30, 31, 59, .1); }
.task-card.dragging { opacity: .5; }
.task-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--prio); }
.task-card .t-title { font-weight: 700; margin-bottom: 4px; }
.task-card .t-desc { color: var(--muted); font-size: 13px; margin-bottom: 10px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.task-card .t-foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.task-card.done .t-title { text-decoration: line-through; color: var(--muted); }
/* Eigene Aufgaben (ich bin zugewiesen): dezenter farbiger Rahmen */
.task-card.mine { box-shadow: 0 0 0 1.5px rgba(99, 102, 241, .35), var(--shadow); }
/* Verknüpftes Meeting auf der Karte */
.t-meeting {
  display: flex; align-items: center; gap: 6px; margin: 2px 0 6px; padding: 4px 8px;
  border-radius: 8px; background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 600;
}
.t-meeting svg { width: 13px; height: 13px; flex-shrink: 0; }
.t-meeting span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* "+ 3 ältere anzeigen" unter der Erledigt-Spalte */
.show-more {
  width: 100%; padding: 10px; border-radius: 12px; cursor: pointer;
  border: 1px dashed #c7c9e6; background: transparent; color: var(--muted); font-weight: 600;
}
.show-more:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* Auswahl im Export-Dialog */
.export-option {
  display: flex; align-items: center; gap: 14px; padding: 14px; margin-top: 10px;
  border: 1px solid var(--border); border-radius: 14px; color: var(--text); text-decoration: none;
  transition: border-color .15s, background .15s;
}
.export-option:hover { border-color: var(--primary); background: var(--primary-soft); }
.export-option .muted { font-size: 13px; }

/* ================= Dateien ================= */
.files-layout { display: grid; grid-template-columns: 260px 1fr; gap: 22px; }

.dropzone {
  border: 2px dashed #c7c9e6; border-radius: var(--radius);
  padding: 26px; text-align: center; color: var(--muted); margin-bottom: 18px;
  background: linear-gradient(135deg, rgba(99, 102, 241, .04), rgba(236, 72, 153, .04));
  transition: border-color .15s, background .15s; cursor: pointer;
}
.dropzone.drag-over { border-color: var(--primary); background: var(--primary-soft); }
.dropzone svg { width: 34px; height: 34px; color: var(--primary); margin-bottom: 6px; }
.dropzone b { color: var(--text); }

.file-row {
  display: grid; grid-template-columns: 44px 1fr 90px 150px auto; align-items: center; gap: 14px;
  padding: 12px 8px; border-bottom: 1px solid var(--border); border-radius: 10px;
}
.file-row:hover { background: #fafbff; }
.file-row:last-child { border-bottom: none; }
.file-icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  font-size: 11px; font-weight: 800; color: #fff;
}
.file-row .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .actions { display: flex; gap: 2px; }

/* ----- Explorer: Ordnerbaum links ----- */
.tree { padding: 10px 8px; align-self: start; position: sticky; top: 28px; max-height: calc(100vh - 56px); overflow-y: auto; }
.tree-row {
  display: flex; align-items: center; gap: 6px; padding: 6px 8px 6px calc(4px + var(--depth) * 16px);
  border-radius: 8px; cursor: pointer; font-weight: 500; user-select: none;
}
.tree-row:hover { background: #f4f5fb; }
.tree-row.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.tree-row > svg { width: 18px; height: 18px; color: #f59e0b; flex-shrink: 0; }
.tree-row:first-child > svg { color: var(--primary); }
.tree-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-row .n { color: var(--muted); font-size: 12px; font-weight: 500; }
.tree-toggle {
  width: 20px; height: 20px; flex-shrink: 0; display: grid; place-items: center;
  border: none; background: none; border-radius: 5px; cursor: pointer; color: var(--muted); padding: 0;
}
.tree-toggle:hover { background: #e7e8f3; color: var(--text); }
.tree-toggle svg { width: 14px; height: 14px; transition: transform .15s; }
.tree-toggle.open svg { transform: rotate(90deg); }
.tree-toggle.empty { visibility: hidden; }
/* Ziel beim Drag & Drop hervorheben */
.drop-target { background: var(--primary-soft) !important; outline: 2px dashed var(--primary); outline-offset: -2px; }

/* ----- Explorer: Brotkrumen-Leiste rechts ----- */
.crumbbar { display: flex; align-items: center; gap: 8px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.crumbbar .icon-btn:disabled { opacity: .35; cursor: default; background: none; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; min-width: 0; }
.crumb {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 8px;
  border: none; background: none; cursor: pointer; font-weight: 600; color: var(--muted);
}
.crumb svg { width: 15px; height: 15px; }
button.crumb:hover { background: #f4f5fb; color: var(--text); }
.crumb.current { color: var(--text); cursor: default; }
.crumbs .sep { display: inline-flex; color: #c7c9e6; }
.crumbs .sep svg { width: 14px; height: 14px; }

.dropzone.compact { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px; }
.dropzone.compact svg { width: 22px; height: 22px; margin: 0; }
.folder-row { cursor: pointer; }
.folder-icon { background: #fef3c7; color: #f59e0b; }
.folder-icon svg { width: 22px; height: 22px; }
.file-row.dragging { opacity: .45; }
.file-row[draggable="true"] { cursor: grab; }

/* Versions-Zeitleiste */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding: 0 0 18px; }
.tl-item::before {
  content: ''; position: absolute; left: -23px; top: 4px;
  width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--primary);
}
.tl-item:first-child::before { background: var(--primary); }
.tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ================= Kalender ================= */
.calendar-layout { display: grid; grid-template-columns: 1fr 300px; gap: 22px; }
.fc { --fc-border-color: var(--border); --fc-today-bg-color: rgba(99, 102, 241, .07); }
.fc .fc-scroller { overflow: hidden !important; }  /* keine leere Scrollbalken-Spalte */
.fc .fc-toolbar-title { font-size: 20px; font-weight: 800; }
.fc .fc-button-primary {
  background: var(--card); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px !important; font-weight: 600; text-transform: capitalize; box-shadow: none !important;
}
.fc .fc-button-primary:hover { background: var(--primary-soft); color: var(--primary); border-color: var(--border); }
.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active { background: var(--primary); border-color: var(--primary); color: #fff; }
.fc .fc-button-primary:disabled { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-soft); opacity: 1; }
.fc .fc-button-group { gap: 4px; }
.fc .fc-col-header-cell-cushion { color: var(--muted); font-weight: 600; text-decoration: none; padding: 8px; }
.fc .fc-daygrid-day-number { color: var(--text); text-decoration: none; font-weight: 600; }
.fc-event { border-radius: 6px !important; padding: 1px 4px; border: none !important; cursor: pointer; font-weight: 600; }
/* Symbol "✓ 2" = eigene fällige Aufgaben an diesem Tag */
.day-badge {
  display: inline-flex; align-items: center; gap: 3px; margin: 4px auto 0 4px;
  padding: 1px 7px 1px 5px; border-radius: 999px; border: none; cursor: pointer;
  background: #fef3c7; color: #92400e; font-size: 11px; font-weight: 700; line-height: 18px;
}
.day-badge svg { width: 12px; height: 12px; }
.day-badge:hover { background: #fde68a; }
.day-badge.demo { margin: 0 2px; cursor: default; vertical-align: middle; }
.fc-daygrid-day-top { align-items: flex-start; }
.fc-col-header-cell .day-badge { margin: 0 0 6px; }
.fc-col-header-cell .fc-scrollgrid-sync-inner { display: flex; flex-direction: column; align-items: center; }

/* Aufgaben-Bereich in der Tagesansicht */
.day-tasks { border-top: 4px solid #f59e0b; }
.day-tasks h2 { justify-content: flex-start; }
.day-tasks h2 svg { width: 18px; height: 18px; color: #f59e0b; }
.list-item.is-done .title { text-decoration: line-through; color: var(--muted); }
.fc .fc-timegrid-slot { height: 2.2em; }

.ics-box input {
  width: 100%; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--border);
  background: #f8f9fd; font-size: 12px; margin: 10px 0;
}

/* ================= Statistik ================= */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); }
.kpi-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.kpi-value { font-size: 26px; font-weight: 800; margin-top: 4px; }
.kpi-value small { font-size: 15px; color: var(--muted); font-weight: 600; }
.kpi-sub { font-size: 12px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 22px; }
.hint { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: #fef3c7; color: #92400e; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.hint svg { width: 16px; height: 16px; flex-shrink: 0; }
.hint > span { flex: 1; min-width: 0; }
.btn svg { flex-shrink: 0; }
.member .muted { overflow-wrap: anywhere; padding: 0 6px; }

/* Waagerechte Balken pro Person */
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar-row { display: grid; grid-template-columns: 130px 1fr 80px; align-items: center; gap: 10px; }
.hbar-label { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; font-size: 13px; }
.hbar-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-label .avatar { width: 26px; height: 26px; font-size: 10px; border: none; }
.hbar-track { height: 12px; background: #f1f2f8; border-radius: 6px; overflow: hidden; }
.hbar { height: 100%; background: #6366f1; border-radius: 0 4px 4px 0; transition: width .4s ease; }
.hbar-val { font-size: 13px; font-weight: 600; text-align: right; }

/* Vergleichstabelle */
.table-wrap { overflow-x: auto; }
.stats-table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.stats-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--border); }
.stats-table td { padding: 10px; border-bottom: 1px solid var(--border); }
.stats-table tbody tr:hover { background: #fafbff; }
.stats-table .person { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.stats-table .person .avatar { width: 28px; height: 28px; font-size: 11px; border: none; }

.check-row { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; padding: 10px 12px; border-radius: 10px; background: #fafbff; border: 1px solid var(--border); }

/* ================= Team ================= */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.member { text-align: center; position: relative; overflow: hidden; padding-top: 0; }
.member .banner { height: 64px; margin: 0 -22px 0; }
.member .avatar.lg { margin: -32px auto 10px; }
.member h3 { margin: 0; font-size: 16px; }
.member .mstats { display: flex; justify-content: center; gap: 20px; margin-top: 14px; }
.member .mstats b { display: block; font-size: 18px; }
.member .mstats span { font-size: 12px; color: var(--muted); }
.member .edit { position: absolute; right: 8px; top: 8px; color: #fff; }
.member .edit:hover { background: rgba(255, 255, 255, .25); color: #fff; }

/* ================= Dialog / Formulare ================= */
dialog {
  border: none; border-radius: 20px; padding: 0;
  width: min(560px, 92vw); box-shadow: var(--shadow-lg);
}
dialog::backdrop { background: rgba(21, 22, 50, .45); backdrop-filter: blur(3px); }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-body { padding: 20px 24px; max-height: 65vh; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 24px; border-top: 1px solid var(--border); background: #fafbff; }
.modal-foot .left { margin-right: auto; }
.modal-foot .btn { padding: 10px 14px; }
.avatar-stack .more { background: #e7e8f3; color: var(--muted); }

.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: #fff; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(99, 102, 241, .12); }
.field textarea { min-height: 80px; resize: vertical; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Personen-Auswahl im Aufgaben-Dialog */
.people-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.people-pick label {
  display: flex; align-items: center; gap: 8px; margin: 0;
  padding: 5px 12px 5px 5px; border-radius: 999px; border: 1px solid var(--border);
  cursor: pointer; font-weight: 600; transition: all .12s;
}
.people-pick input { display: none; }
.people-pick .avatar { width: 26px; height: 26px; font-size: 10px; border: none; }
/* Verknüpfte Aufgaben im Meeting-Dialog */
.linked-tasks { display: flex; flex-direction: column; gap: 6px; }
.linked-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px;
  border: 1px solid var(--border); border-radius: 12px; background: #fafbff;
}
.linked-row .grow { flex: 1; min-width: 0; }
.linked-row .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linked-row .title.strike { text-decoration: line-through; color: var(--muted); }
.linked-row .sub { font-size: 12px; color: var(--muted); }
.linked-row .icon-btn { width: 28px; height: 28px; }
.add-select {
  padding: 9px 12px; border-radius: 12px; border: 1px dashed #c7c9e6; background: #fff;
  color: var(--primary); font-weight: 600; cursor: pointer;
}

/* Variante ohne Avatar (Meetings / Aufgaben auswählen) */
.people-pick.plain label { padding: 6px 12px; font-weight: 500; font-size: 13px; }
.people-pick.plain svg { width: 14px; height: 14px; }
.pick-scroll { max-height: 150px; overflow-y: auto; padding: 2px; }
.people-pick label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }

.color-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.color-pick label { margin: 0; cursor: pointer; }
.color-pick input { display: none; }
.color-pick span { display: block; width: 30px; height: 30px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--border); }
.color-pick input:checked + span { box-shadow: 0 0 0 2px var(--text); }

/* ================= Glocke (Benachrichtigungen) ================= */
.main { position: relative; }
.page-head { padding-right: 60px; }            /* Platz für die Glocke rechts oben */
.bell-wrap { position: absolute; top: 28px; right: 40px; z-index: 20; }
.bell {
  position: relative; width: 44px; height: 44px; border-radius: 14px; cursor: pointer;
  display: grid; place-items: center; color: var(--text);
  background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.bell:hover { color: var(--primary); }
.bell svg { width: 20px; height: 20px; }
.bell.ring svg { animation: ring 1.2s ease 1; transform-origin: 50% 0; }
@keyframes ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(8deg); } 60% { transform: rotate(-4deg); } }
.bell-count {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: var(--danger); color: #fff; border: 2px solid #fff;
  font-size: 11px; font-weight: 700; display: grid; place-items: center;
}
.bell-panel {
  position: absolute; right: 0; top: 54px; width: min(380px, 90vw);
  background: var(--card); border-radius: 16px; box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  overflow: hidden; animation: fadeUp .15s ease;
}
.bell-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.link-btn { border: none; background: none; color: var(--primary); font-weight: 600; cursor: pointer; font-size: 13px; }
.bell-list { max-height: 420px; overflow-y: auto; }
.bell-item {
  display: flex; gap: 10px; width: 100%; text-align: left; padding: 12px 16px;
  border: none; border-bottom: 1px solid var(--border); background: transparent; cursor: pointer; font-size: 13px;
}
.bell-item:hover { background: #fafbff; }
.bell-item.unread { background: var(--primary-soft); }
.bell-item.unread:hover { background: #e4e8ff; }

/* ================= Kommentare ================= */
/* Sprechblase auf den Aufgaben-Karten */
.comment-chip {
  display: inline-flex; align-items: center; gap: 4px; margin-left: auto;
  padding: 3px 7px; border: none; border-radius: 8px; background: transparent;
  color: #b4b7d0; font-size: 12px; font-weight: 700; cursor: pointer;
}
.comment-chip svg { width: 15px; height: 15px; }
.comment-chip:hover { background: var(--primary-soft); color: var(--primary); }
.comment-chip.has { color: var(--primary); }

/* Zähler am Kommentar-Symbol bei Dateien */
.comment-btn { position: relative; }
.count-dot {
  position: absolute; top: 1px; right: 1px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 999px;
  background: var(--primary); color: #fff; font-size: 9px; font-weight: 700; display: grid; place-items: center;
}

/* Kommentar-Popup */
.modal-head h3 { display: flex; align-items: center; gap: 8px; }
.modal-head h3 svg { width: 20px; height: 20px; color: var(--primary); }
.comment-target { color: var(--muted); margin-bottom: 14px; font-size: 13px; }
.comments { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.comment { display: flex; gap: 10px; }
.comment-body { flex: 1; min-width: 0; background: #f6f7fc; border-radius: 4px 14px 14px 14px; padding: 10px 14px; }
.comment.mine .comment-body { background: var(--primary-soft); }
.comment-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.comment-head .muted { font-size: 12px; }
.comment-actions { margin-left: auto; display: flex; gap: 2px; }
.comment-actions .icon-btn { width: 26px; height: 26px; }
.comment-actions svg { width: 15px; height: 15px; }
.comment-text { margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment.flash .comment-body { animation: flash 1.6s ease; }

/* Zitat des Kommentars, auf den geantwortet wird */
.comment-quote {
  display: block; width: 100%; text-align: left; margin-top: 6px; padding: 6px 10px;
  border: none; border-left: 3px solid var(--primary); border-radius: 4px 8px 8px 4px;
  background: rgba(99, 102, 241, .08); color: var(--muted); font-size: 12px; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.comment-quote:hover { background: rgba(99, 102, 241, .15); }

.comment-form { position: sticky; bottom: -20px; background: #fff; padding: 10px 0; }
.comment-input { display: flex; gap: 10px; align-items: flex-end; }
.reply-bar {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding: 6px 6px 6px 12px;
  border-radius: 10px; background: var(--primary-soft); color: var(--text); font-size: 13px;
}
.reply-bar > svg { width: 15px; height: 15px; color: var(--primary); flex-shrink: 0; }
.reply-bar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-bar .icon-btn { width: 26px; height: 26px; }
.comment-form textarea {
  flex: 1; min-height: 64px; resize: vertical; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--border); outline: none;
}
.comment-form textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(99, 102, 241, .12); }

/* Neu gespeicherte Aufgabe kurz aufleuchten lassen */
.task-card.flash { animation: flash 1.6s ease; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px var(--primary), 0 12px 28px rgba(99, 102, 241, .35); } 100% { box-shadow: var(--shadow); } }

/* ================= Hinweis-Meldungen ================= */
#toasts { position: fixed; right: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 100; }
.toast {
  background: var(--side-bg); color: #fff; padding: 12px 18px; border-radius: 12px;
  box-shadow: var(--shadow-lg); font-weight: 600; animation: slideIn .25s ease;
}
@keyframes slideIn { from { transform: translateY(12px); opacity: 0; } }

/* Seiten sanft einblenden */
#page > * { animation: fadeUp .3s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }

/* ================= Kleine Bildschirme ================= */
@media (max-width: 1100px) {
  .grid-2, .calendar-layout, .stats-grid { grid-template-columns: 1fr; }
  .tree { position: static; max-height: none; }
  /* einspaltig passt nicht auf einen Bildschirm → normal scrollen */
  .overview { height: auto; }
  .card.fill { flex: none; }
  .card-scroll { max-height: 360px; }
}
/* Niedrige Bildschirme (z. B. Laptop): Übersicht etwas kompakter */
@media (max-height: 780px) {
  .overview .stat .stat-icon { display: none; }
  .overview .page-head h1 { font-size: 24px; }
  .tempo-chart { height: 70px; }
  .tempo-heads { margin-bottom: 8px; }
  .tempo-num { font-size: 22px; }
}
@media (max-width: 700px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat.c4 { grid-column: 1 / -1; }
}
@media (max-width: 800px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; padding: 16px; }
  .brand { padding-bottom: 12px; }
  .nav { flex-direction: row; overflow-x: auto; }
  .nav a { white-space: nowrap; }
  .me { margin-top: 12px; }
  .main { padding: 20px 16px 40px; }
  .bell-wrap { top: 20px; right: 16px; }
  .files-layout { grid-template-columns: 1fr; }
  .file-row { grid-template-columns: 44px 1fr auto; }
  .file-row .hide-sm { display: none; }
  .row-2 { grid-template-columns: 1fr; }
}

/* ================= Papierkorb, Suche, Rückgängig ================= */
[hidden] { display: none !important; }
.toast { display: flex; align-items: center; gap: 14px; }
.toast-undo {
  border: none; background: rgba(255, 255, 255, .18); color: #fff; font: inherit; font-weight: 700;
  padding: 5px 12px; border-radius: 8px; cursor: pointer;
}
.toast-undo:hover { background: rgba(255, 255, 255, .3); }
.search-input {
  margin-left: auto; width: 220px; max-width: 45%; padding: 8px 12px; border: 1px solid var(--border);
  border-radius: 10px; font: inherit; background: #fff;
}
.search-input:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.folder-link { cursor: pointer; }
.folder-link:hover { color: var(--primary); text-decoration: underline; }
.trash-row {
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 14px;
  padding: 12px 8px; border-bottom: 1px solid var(--border);
}
.trash-row:last-child { border-bottom: none; }
.trash-row .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trash-row .btn:disabled { opacity: .45; cursor: not-allowed; }
