/* ==========================================================
   Projektmanager - Ergaenzungen zu Bootstrap 5.3
   ========================================================== */
:root {
    --pm-sidebar-w: 260px;
    --pm-sidebar-bg: #f8f9fb;
    --pm-board-bg: #f3f4f7;
    --pm-column-bg: #eceef2;
    --pm-card-bg: #ffffff;
    --pm-border: rgba(0, 0, 0, .08);
    --pm-hover: rgba(0, 0, 0, .04);
    --pm-prio-high: #dc2626;
    --pm-prio-mid: #d97706;
    --pm-prio-low: #64748b;
    --bs-primary: #4f46e5;
    --bs-primary-rgb: 79, 70, 229;
    --bs-link-color: #4f46e5;
    --bs-link-color-rgb: 79, 70, 229;
    --bs-link-hover-color: #4338ca;
    --bs-body-font-size: .9375rem;
}

[data-bs-theme="dark"] {
    --pm-sidebar-bg: #16181d;
    --pm-board-bg: #1a1d23;
    --pm-column-bg: #22262e;
    --pm-card-bg: #2b3039;
    --pm-border: rgba(255, 255, 255, .08);
    --pm-hover: rgba(255, 255, 255, .05);
    --bs-body-bg: #1a1d23;
    --bs-link-color: #a5b4fc;
    --bs-link-color-rgb: 165, 180, 252;
    --bs-link-hover-color: #c7d2fe;
}

.btn-primary {
    --bs-btn-bg: #4f46e5;
    --bs-btn-border-color: #4f46e5;
    --bs-btn-hover-bg: #4338ca;
    --bs-btn-hover-border-color: #4338ca;
    --bs-btn-active-bg: #3730a3;
    --bs-btn-active-border-color: #3730a3;
    --bs-btn-disabled-bg: #4f46e5;
    --bs-btn-disabled-border-color: #4f46e5;
}
.text-bg-primary { background-color: #4f46e5 !important; }
.form-control:focus, .form-select:focus { border-color: #a5b4fc; box-shadow: 0 0 0 .2rem rgba(79, 70, 229, .2); }
.form-check-input:checked { background-color: #4f46e5; border-color: #4f46e5; }
.nav-underline .nav-link.active { color: var(--bs-emphasis-color); border-bottom-color: #4f46e5; }
.btn-light { --bs-btn-bg: var(--bs-tertiary-bg); --bs-btn-border-color: var(--pm-border); }
[data-bs-theme="dark"] .btn-light { --bs-btn-color: var(--bs-body-color); --bs-btn-hover-bg: #343a46; --bs-btn-hover-color: #fff; --bs-btn-active-bg: #3b4250; }

body { min-height: 100vh; }
body.bare { background: var(--pm-board-bg); }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
kbd { font-size: .75em; }

/* ==========================================================
   App-Shell: Sidebar + Inhalt
   ========================================================== */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--pm-sidebar-w);
    background: var(--pm-sidebar-bg);
    border-right: 1px solid var(--pm-border);
    display: flex;
    flex-direction: column;
}
@media (min-width: 992px) {
    .sidebar { position: sticky; top: 0; height: 100vh; flex-shrink: 0; }
}
@media (max-width: 991.98px) {
    .sidebar.offcanvas-lg { --bs-offcanvas-width: 280px; }
}

.sidebar-brand { display: flex; align-items: center; padding: 1rem 1.1rem; }
.sidebar-brand a { color: var(--bs-emphasis-color); }
.brand-logo { display: inline-block; width: 30px; height: 30px; }
.brand-logo-lg { width: 52px; height: 52px; }

.sidebar-nav { padding: .25rem .6rem; }
.sidebar-link {
    display: flex; align-items: center; gap: .6rem;
    padding: .42rem .6rem; border-radius: 7px;
    color: var(--bs-body-color); text-decoration: none; font-size: .9rem;
}
.sidebar-link:hover { background: var(--pm-hover); color: var(--bs-emphasis-color); }
.sidebar-link.active { background: rgba(79, 70, 229, .1); color: #4f46e5; font-weight: 500; }
[data-bs-theme="dark"] .sidebar-link.active { color: #a5b4fc; background: rgba(129, 140, 248, .14); }
.sidebar-link .bi { font-size: 1rem; opacity: .8; }

.sidebar-section { padding: .75rem .6rem; flex: 1; overflow-y: auto; }
.sidebar-section-title {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 .6rem .35rem; font-size: .72rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .05em; color: var(--bs-secondary-color);
}
.sidebar-add { color: var(--bs-secondary-color); }
.sidebar-count { margin-left: auto; font-size: .75rem; color: var(--bs-secondary-color); }

.sidebar-footer { border-top: 1px solid var(--pm-border); padding: .6rem; }
.sidebar-user {
    display: flex; align-items: center; gap: .6rem; width: 100%;
    border: 0; background: none; padding: .45rem .5rem; border-radius: 8px; color: var(--bs-body-color);
}
.sidebar-user:hover { background: var(--pm-hover); }

.app-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-topbar {
    position: sticky; top: 0; z-index: 1020;
    display: flex; align-items: center; gap: .75rem;
    height: 56px; padding: 0 1.5rem;
    background: color-mix(in srgb, var(--bs-body-bg) 88%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--pm-border);
}
.topbar-title { font-weight: 600; }
.app-main { padding: 1.5rem; flex: 1; min-width: 0; }
@media (max-width: 575.98px) {
    .app-main { padding: 1rem; }
    .app-topbar { padding: 0 1rem; }
}

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }

/* ==========================================================
   Avatare, Badges, Projekt-Icons
   ========================================================== */
.avatar {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 32px; height: 32px; border-radius: 50%;
    color: #fff; font-size: .75rem; font-weight: 600; letter-spacing: .02em;
    user-select: none;
}
.avatar-sm { width: 24px; height: 24px; font-size: .62rem; }
.avatar-xs { width: 20px; height: 20px; font-size: .55rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.2rem; }
.avatar-more { background: var(--bs-secondary-bg); color: var(--bs-body-color); }
.avatar-add { background: transparent; border: 1px dashed var(--bs-secondary-color); color: var(--bs-secondary-color); }
.avatar-stack { display: inline-flex; align-items: center; }
.avatar-stack .avatar { box-shadow: 0 0 0 2px var(--bs-body-bg); }
.avatar-stack .avatar + .avatar { margin-left: -6px; }

.project-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.project-icon {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: 34px; height: 34px; border-radius: 9px; color: #fff; font-weight: 700;
}
.project-icon-lg { width: 44px; height: 44px; border-radius: 11px; font-size: 1.2rem; }

.prio-badge {
    display: inline-flex; align-items: center; gap: .25rem;
    font-size: .7rem; font-weight: 600; padding: .1rem .45rem; border-radius: 4px;
    text-transform: uppercase; letter-spacing: .03em; white-space: nowrap;
}
.prio-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.prio-high { color: var(--pm-prio-high); background: rgba(220, 38, 38, .1); }
.prio-mid { color: var(--pm-prio-mid); background: rgba(217, 119, 6, .1); }
.prio-low { color: var(--pm-prio-low); background: rgba(100, 116, 139, .12); }

.due-chip { display: inline-flex; align-items: center; gap: .25rem; font-size: .75rem; color: var(--bs-secondary-color); white-space: nowrap; }
.due-overdue { color: var(--pm-prio-high); font-weight: 600; }
.due-today { color: #4f46e5; font-weight: 600; }
[data-bs-theme="dark"] .due-today { color: #a5b4fc; }

.color-picker { display: flex; gap: .5rem; flex-wrap: wrap; }
.color-swatch { width: 28px; height: 28px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: transform .1s; }
.btn-check:checked + .color-swatch { box-shadow: 0 0 0 2px var(--bs-body-bg), 0 0 0 4px currentColor; transform: scale(1.05); color: var(--bs-emphasis-color); }

.empty-state { text-align: center; }
.empty-state > .bi { font-size: 2.2rem; color: var(--bs-tertiary-color); display: block; margin-bottom: .5rem; }

/* ==========================================================
   Login / Setup
   ========================================================== */
.bare-main { min-height: 100vh; }
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.auth-card { width: 100%; max-width: 420px; border: 0; border-radius: 16px; }

/* ==========================================================
   Benachrichtigungen
   ========================================================== */
.notif-menu { width: 360px; max-width: calc(100vw - 2rem); }
.notif-list { max-height: 420px; overflow-y: auto; }
.notif-item {
    display: flex; gap: .65rem; padding: .7rem 1rem; text-decoration: none; color: var(--bs-body-color);
    border-bottom: 1px solid var(--pm-border); font-size: .85rem;
}
.notif-item:hover { background: var(--pm-hover); color: var(--bs-emphasis-color); }
.notif-item.unread { background: rgba(79, 70, 229, .06); }
.notif-item.unread .notif-dot { visibility: visible; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: #4f46e5; margin-top: .4rem; flex-shrink: 0; visibility: hidden; }
.notif-icon { font-size: 1rem; color: var(--bs-secondary-color); }

/* ==========================================================
   Dashboard
   ========================================================== */
.task-group-head { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; background: var(--bs-tertiary-bg); padding-top: .4rem; padding-bottom: .4rem; }
.my-task-row { display: flex; align-items: center; gap: .75rem; padding: .6rem 1rem; }
.my-task-row.done { opacity: .45; }
.my-task-row.done .my-task-title { text-decoration: line-through; }
.my-task-main { flex: 1; min-width: 0; text-decoration: none; color: var(--bs-body-color); }
.my-task-main:hover .my-task-title { color: #4f46e5; }
.my-task-title { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.my-task-meta { display: flex; align-items: center; gap: .35rem; font-size: .78rem; color: var(--bs-secondary-color); }

.task-check {
    border: 0; background: none; padding: 0; line-height: 1; font-size: 1.15rem;
    color: var(--bs-tertiary-color); cursor: pointer; flex-shrink: 0;
}
.task-check:hover { color: #16a34a; }
.task-check:hover .bi-circle::before { content: "\f26b"; }
.task-check.is-done { color: #16a34a; }
.task-check:disabled { cursor: default; opacity: .5; }

/* ==========================================================
   Projektliste
   ========================================================== */
.project-card { border: 1px solid var(--pm-border); overflow: hidden; transition: transform .12s, box-shadow .12s; }
.project-card:hover { transform: translateY(-2px); box-shadow: 0 .5rem 1.2rem rgba(0, 0, 0, .08) !important; }
.project-card-stripe { height: 4px; }

/* ==========================================================
   Projektseite: Toolbar, Tabs, Filter
   ========================================================== */
.project-toolbar {
    display: flex; align-items: flex-end; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
    border-bottom: 1px solid var(--pm-border); margin-bottom: 1rem;
}
.project-tabs { margin-bottom: -1px; }
.project-tabs .nav-link { color: var(--bs-secondary-color); padding: .5rem .25rem; margin-right: .75rem; }
.task-filters { display: flex; align-items: center; gap: .5rem; padding-bottom: .5rem; }
.filter-search { width: 220px; }
@media (max-width: 575.98px) { .filter-search { width: 150px; } }

/* ==========================================================
   Kanban-Board
   ========================================================== */
.board {
    display: flex; gap: .9rem; align-items: flex-start;
    overflow-x: auto; padding-bottom: 1rem;
    min-height: calc(100vh - 260px);
}
.board-column {
    flex: 0 0 290px; max-width: 290px;
    background: var(--pm-column-bg); border-radius: 12px;
    display: flex; flex-direction: column;
    max-height: calc(100vh - 230px);
}
.board-column-head {
    display: flex; align-items: center; gap: .4rem;
    padding: .7rem .8rem .5rem; font-weight: 600; font-size: .88rem;
}
.board-column-head .col-handle { cursor: grab; color: var(--bs-tertiary-color); }
.board-column-head .col-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-column-head .col-name-input { flex: 1; font-weight: 600; padding: .1rem .35rem; height: auto; }
.board-column-head .col-count { font-weight: 500; font-size: .78rem; color: var(--bs-secondary-color); background: var(--pm-hover); padding: 0 .45rem; border-radius: 10px; }
.board-cards { flex: 1; overflow-y: auto; padding: .15rem .55rem .3rem; min-height: 40px; display: flex; flex-direction: column; gap: .5rem; }
.board-column-foot { padding: .25rem .55rem .6rem; }
.btn-add-card {
    width: 100%; text-align: left; border: 0; background: none; border-radius: 8px;
    padding: .4rem .5rem; font-size: .85rem; color: var(--bs-secondary-color);
}
.btn-add-card:hover { background: var(--pm-hover); color: var(--bs-emphasis-color); }
.quick-add textarea { resize: none; font-size: .88rem; }
.board-column-new { flex: 0 0 260px; background: transparent; border: 2px dashed var(--pm-border); }

.task-card {
    background: var(--pm-card-bg); border-radius: 9px; padding: .6rem .7rem;
    border: 1px solid var(--pm-border); box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
    cursor: pointer; transition: box-shadow .12s, border-color .12s;
    position: relative;
}
.task-card:hover { border-color: rgba(79, 70, 229, .45); box-shadow: 0 3px 8px rgba(0, 0, 0, .07); }
.task-card:focus-visible { outline: 2px solid #4f46e5; outline-offset: 1px; }
.task-card.prio-border-high { border-left: 3px solid var(--pm-prio-high); }
.task-card.prio-border-mid { border-left: 3px solid var(--pm-prio-mid); }
.task-card.prio-border-low { border-left: 3px solid var(--pm-prio-low); }
.task-card.is-done { opacity: .6; }
.task-card.is-done .card-title { text-decoration: line-through; color: var(--bs-secondary-color); }
.task-card .card-top { display: flex; gap: .45rem; align-items: flex-start; }
.task-card .task-check { font-size: 1rem; margin-top: .05rem; }
.task-card .card-title { font-size: .88rem; font-weight: 500; line-height: 1.35; word-break: break-word; flex: 1; }
.task-card .card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem .6rem; margin-top: .45rem; font-size: .75rem; color: var(--bs-secondary-color); }
.task-card .card-meta .bi { margin-right: .1rem; }
.task-card .card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: .45rem; }
.task-card .card-foot:empty { display: none; }
.subtask-pill.complete { color: #16a34a; }

.sortable-ghost { opacity: .35; }
.sortable-chosen { box-shadow: 0 8px 20px rgba(0, 0, 0, .15) !important; }
.sortable-drag { transform: rotate(2deg); }
.board-column.sortable-ghost { opacity: .4; }

/* ==========================================================
   Listenansicht
   ========================================================== */
.list-group-section { margin-bottom: 1.25rem; }
.list-section-head { display: flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .9rem; padding: .3rem 0; cursor: pointer; user-select: none; }
.list-section-head .bi-chevron-down { transition: transform .15s; }
.list-section-head.collapsed .bi-chevron-down { transform: rotate(-90deg); }
.task-table { font-size: .875rem; table-layout: fixed; }
.task-table .tt-title { overflow-wrap: anywhere; }
.task-table td, .task-table th { vertical-align: middle; }
.task-table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--bs-secondary-color); font-weight: 600; }
.task-table tbody tr { cursor: pointer; }
.task-table tr.is-done .tt-title { text-decoration: line-through; color: var(--bs-secondary-color); }
.tt-title { font-weight: 500; }

/* ==========================================================
   Aufgaben-Detail-Dialog
   ========================================================== */
#taskModal .modal-content { min-height: 70vh; }
.task-head { display: flex; align-items: center; gap: .5rem; padding: .7rem 1rem; border-bottom: 1px solid var(--pm-border); font-size: .82rem; }
.task-head .breadcrumb { margin: 0; font-size: .82rem; }
.task-main { padding: 1.25rem 1.5rem 2rem; }
.task-side { padding: 1.25rem 1.25rem 2rem; background: var(--bs-tertiary-bg); border-left: 1px solid var(--pm-border); }
@media (max-width: 991.98px) { .task-side { border-left: 0; border-top: 1px solid var(--pm-border); } }

.task-title-row { display: flex; gap: .6rem; align-items: flex-start; }
.task-title-row .task-check { font-size: 1.5rem; margin-top: .25rem; }
.task-title-input {
    font-size: 1.4rem; font-weight: 600; border: 1px solid transparent; padding: .2rem .45rem;
    background: transparent; resize: none; overflow: hidden; line-height: 1.3;
}
.task-title-input:hover { border-color: var(--pm-border); }
.task-title-input:focus { background: var(--bs-body-bg); }

.desc-input { border: 1px solid transparent; background: transparent; resize: none; min-height: 80px; }
.desc-input:hover { border-color: var(--pm-border); }
.desc-input:focus { background: var(--bs-body-bg); }

.section-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; color: var(--bs-secondary-color); margin: 1.6rem 0 .6rem; display: flex; align-items: center; gap: .4rem; }

.prop-row { margin-bottom: 1rem; }
.prop-label { display: block; font-size: .75rem; font-weight: 600; color: var(--bs-secondary-color); margin-bottom: .3rem; text-transform: uppercase; letter-spacing: .04em; }
.prio-toggle .btn { font-size: .8rem; font-weight: 600; }
.prio-toggle .btn-check:checked + .btn-prio-high { background: var(--pm-prio-high); border-color: var(--pm-prio-high); color: #fff; }
.prio-toggle .btn-check:checked + .btn-prio-mid { background: var(--pm-prio-mid); border-color: var(--pm-prio-mid); color: #fff; }
.prio-toggle .btn-check:checked + .btn-prio-low { background: var(--pm-prio-low); border-color: var(--pm-prio-low); color: #fff; }

.save-indicator { font-size: .78rem; color: var(--bs-secondary-color); transition: opacity .3s; }

.subtask-list { border: 1px solid var(--pm-border); border-radius: 9px; overflow: hidden; }
.subtask-item { display: flex; align-items: center; gap: .55rem; padding: .45rem .7rem; border-bottom: 1px solid var(--pm-border); background: var(--bs-body-bg); }
.subtask-item:last-child { border-bottom: 0; }
.subtask-item:hover { background: var(--pm-hover); }
.subtask-item .st-title { flex: 1; min-width: 0; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.subtask-item.is-done .st-title { text-decoration: line-through; color: var(--bs-secondary-color); }
.subtask-item .st-handle { cursor: grab; color: var(--bs-tertiary-color); }
.subtask-add { border: 0; border-radius: 0; background: var(--bs-body-bg); font-size: .9rem; }

.dropzone {
    border: 2px dashed var(--pm-border); border-radius: 10px; padding: 1rem; text-align: center;
    color: var(--bs-secondary-color); font-size: .85rem; cursor: pointer; transition: all .15s;
}
.dropzone:hover, .dropzone.dragover { border-color: #4f46e5; background: rgba(79, 70, 229, .05); color: #4f46e5; }
.attachment-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; margin-bottom: .75rem; }
.attachment-tile {
    position: relative; border: 1px solid var(--pm-border); border-radius: 9px; overflow: hidden;
    background: var(--bs-body-bg); display: flex; flex-direction: column;
}
.attachment-thumb {
    height: 90px; display: flex; align-items: center; justify-content: center;
    background: var(--bs-tertiary-bg); font-size: 2rem; color: var(--bs-secondary-color); overflow: hidden;
}
.attachment-thumb img { width: 100%; height: 100%; object-fit: cover; }
.attachment-info { padding: .4rem .55rem; font-size: .75rem; min-width: 0; }
.attachment-info a { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-tile .att-delete { position: absolute; top: .3rem; right: .3rem; opacity: 0; transition: opacity .15s; }
.attachment-tile:hover .att-delete { opacity: 1; }

.comment { display: flex; gap: .7rem; margin-bottom: 1rem; }
.comment-bubble { flex: 1; min-width: 0; }
.comment-head { font-size: .82rem; margin-bottom: .15rem; display: flex; gap: .5rem; align-items: baseline; }
.comment-body { font-size: .9rem; word-wrap: break-word; }
.comment-body p:last-child { margin-bottom: 0; }
.comment-actions { opacity: 0; transition: opacity .15s; }
.comment:hover .comment-actions { opacity: 1; }
.comment-composer { display: flex; gap: .7rem; }
.comment-composer textarea { resize: vertical; min-height: 70px; }

.mention { color: #4f46e5; background: rgba(79, 70, 229, .1); padding: 0 .2rem; border-radius: 4px; font-weight: 500; }
.mention-me { background: rgba(217, 119, 6, .18); color: #b45309; }
[data-bs-theme="dark"] .mention { color: #a5b4fc; }

.mention-menu {
    position: fixed; z-index: 2000; min-width: 220px; max-width: 320px;
    background: var(--bs-body-bg); border: 1px solid var(--pm-border); border-radius: 9px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .15); padding: .3rem; font-size: .88rem;
}
.mention-item { display: flex; align-items: center; gap: .5rem; padding: .35rem .5rem; border-radius: 6px; cursor: pointer; }
.mention-item.active, .mention-item:hover { background: rgba(79, 70, 229, .1); }

.rich-text p { margin-bottom: .6rem; }
.rich-text h1, .rich-text h2, .rich-text h3 { font-size: 1.1rem; font-weight: 600; margin: 1rem 0 .5rem; }
.rich-text h1 { font-size: 1.3rem; }
.rich-text ul, .rich-text ol { padding-left: 1.3rem; margin-bottom: .6rem; }
.rich-text code { background: var(--bs-tertiary-bg); padding: .1rem .3rem; border-radius: 4px; }
.rich-text .md-check { list-style: none; margin-left: -1.3rem; }
.rich-text .md-check .bi { margin-right: .3rem; }
.rich-text a { word-break: break-all; }

.activity-item { display: flex; gap: .65rem; padding: .6rem 0; border-bottom: 1px solid var(--pm-border); font-size: .85rem; }

/* ==========================================================
   Notizen
   ========================================================== */
.notes-layout { display: grid; grid-template-columns: 300px 1fr; gap: 1rem; min-height: calc(100vh - 260px); }
@media (max-width: 767.98px) { .notes-layout { grid-template-columns: 1fr; } }
.notes-list { border: 1px solid var(--pm-border); border-radius: 12px; overflow: hidden; background: var(--bs-body-bg); align-self: start; }
.note-item { display: block; width: 100%; text-align: left; border: 0; background: none; padding: .75rem 1rem; border-bottom: 1px solid var(--pm-border); color: var(--bs-body-color); }
.note-item:last-child { border-bottom: 0; }
.note-item:hover { background: var(--pm-hover); }
.note-item.active { background: rgba(79, 70, 229, .08); box-shadow: inset 3px 0 0 #4f46e5; }
.note-item .note-title { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-item .note-excerpt { font-size: .78rem; color: var(--bs-secondary-color); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-pane { border: 1px solid var(--pm-border); border-radius: 12px; background: var(--bs-body-bg); padding: 1.5rem 2rem; min-width: 0; }
@media (max-width: 575.98px) { .note-pane { padding: 1rem; } }
.note-editor-title { font-size: 1.4rem; font-weight: 600; border: 0; padding: 0; box-shadow: none !important; background: transparent; }
.note-editor-body { min-height: 380px; font-family: var(--bs-font-monospace); font-size: .88rem; }

/* Tom Select an Theme anpassen */
.ts-wrapper.multi .ts-control > div { border-radius: 5px; }
[data-bs-theme="dark"] .ts-control, [data-bs-theme="dark"] .ts-dropdown, [data-bs-theme="dark"] .ts-control input { background: var(--bs-body-bg); color: var(--bs-body-color); border-color: var(--bs-border-color); }
[data-bs-theme="dark"] .ts-dropdown .active { background: #343a46; color: #fff; }
[data-bs-theme="dark"] .ts-wrapper.multi .ts-control > div { background: #343a46; color: #e5e7eb; }

.import-log { max-height: 320px; overflow-y: auto; background: var(--bs-tertiary-bg); border-radius: 8px; padding: .6rem .8rem; }
.import-log:empty { display: none; }

/* Anhaenge in Kommentaren */
.comment-files { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.comment-file { position: relative; }
.comment-file-image a { display: block; width: 140px; height: 100px; border-radius: 8px; overflow: hidden; border: 1px solid var(--pm-border); background: var(--bs-tertiary-bg); }
.comment-file-image img { width: 100%; height: 100%; object-fit: cover; }
.comment-file-doc a { display: flex; align-items: center; gap: .4rem; max-width: 260px; padding: .35rem .6rem; border: 1px solid var(--pm-border); border-radius: 8px; font-size: .82rem; text-decoration: none; background: var(--bs-body-bg); }
.comment-file-del { position: absolute; top: -6px; right: -6px; padding: 0 .3rem; font-size: .65rem; border-radius: 50%; opacity: 0; transition: opacity .15s; }
.comment-file:hover .comment-file-del { opacity: 1; }
.comment-composer.dragover textarea { border-color: #4f46e5; background: rgba(79, 70, 229, .05); }
.pending-files { display: flex; flex-wrap: wrap; gap: .4rem; }
.pending-files:not(:empty) { margin-top: .5rem; }
.pending-file { display: inline-flex; align-items: center; gap: .35rem; max-width: 220px; padding: .2rem .35rem .2rem .25rem; border: 1px solid var(--pm-border); border-radius: 7px; font-size: .78rem; background: var(--bs-tertiary-bg); }
.pending-file img { width: 28px; height: 28px; object-fit: cover; border-radius: 4px; }
.pending-file .bi { font-size: 1rem; padding: 0 .2rem; }
.btn-close-sm { width: .5em; height: .5em; padding: .2em; }

/* Einklappbare Seitenleiste (Desktop) - z.B. fuer Bildschirmfreigaben */
.sidebar-show-btn { display: none; }
@media (min-width: 992px) {
    .sidebar { transition: margin-left .2s ease; }
    .sidebar-collapsed .sidebar { margin-left: calc(-1 * var(--pm-sidebar-w)); visibility: hidden; }
    .sidebar-collapsed .sidebar-show-btn { display: inline-flex; }
}
