html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

:root {
  --app-header-bg: #0f3a4b;
  --app-header-text: #ffffff;
  --app-header-height: 56px;
  --app-sidebar-width: 230px;
  --app-sidebar-bg: #ffffff;
  --app-sidebar-border: #dee2e6;
  --app-sidebar-hover-bg: #f1f3f5;
  --app-sidebar-active-bg: #e9ecef;
  --app-sidebar-text: #212529;
  --sort-arrow-inactive: #adb5bd;
  --sort-arrow-active: #495057;
}

body {
  margin-bottom: 0;
}

.app-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 1rem;
  height: var(--app-header-height);
  padding: 0 1rem;
  background: var(--app-header-bg);
  color: var(--app-header-text);
}

.app-header-start {
  grid-column: 1;
  display: flex;
  align-items: center;
}

.app-sidebar-toggle {
  border: 0;
  background: transparent;
  margin-right: 0.75rem;
}

.app-brand {
  color: var(--app-header-text);
  font-size: 1.25rem;
  font-weight: 600;
  text-decoration: none;
}

.app-header-search {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
}

.app-header-search input {
  width: 100%;
  max-width: 440px;
  min-width: 0;
}

.app-header-account {
  grid-column: 3;
}

.app-body {
  position: relative;
  display: flex;
  align-items: stretch;
  min-height: calc(100vh - var(--app-header-height) - 60px);
}

.app-sidebar {
  flex: 0 0 var(--app-sidebar-width);
  width: var(--app-sidebar-width);
  background: var(--app-sidebar-bg);
  border-right: 1px solid var(--app-sidebar-border);
  padding: 0.75rem 0;
  overflow: hidden;
  transition: width 0.2s ease, flex-basis 0.2s ease, padding 0.2s ease, border-color 0.2s ease;
}

.app-body.sidebar-collapsed .app-sidebar {
  width: 0;
  flex-basis: 0;
  padding: 0;
  border-right-color: transparent;
}

.app-sidebar-collapse-toggle {
  position: absolute;
  top: 0.25rem;
  left: calc(var(--app-sidebar-width) - 12px);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  height: 24px;
  padding: 0 0.6rem;
  border: 1px solid var(--app-sidebar-border);
  border-radius: 999px;
  background: var(--app-sidebar-bg);
  color: var(--app-sidebar-text);
  font-size: 0.8rem;
  white-space: nowrap;
  cursor: pointer;
  transition: left 0.2s ease;
}

.app-sidebar-collapse-label-collapsed {
  display: none;
}

.app-sidebar-collapse-toggle[aria-expanded="false"] .app-sidebar-collapse-label-expanded {
  display: none;
}

.app-sidebar-collapse-toggle[aria-expanded="false"] .app-sidebar-collapse-label-collapsed {
  display: inline;
}

/* Im eingeklappten Zustand faellt die Sidebar-Breite (und damit der linke Anker) auf 0 —
   der Button muss daher fest sichtbar links positioniert werden, statt wie zuvor bei
   left:-12px fast vollstaendig ausserhalb des sichtbaren Bereichs zu haengen. */
.app-body.sidebar-collapsed .app-sidebar-collapse-toggle {
  left: 0.5rem;
}

.app-sidebar-link {
  display: block;
  padding: 0.5rem 1.25rem;
  color: var(--app-sidebar-text);
  text-decoration: none;
}

.app-sidebar-link:hover {
  background: var(--app-sidebar-hover-bg);
}

.app-sidebar-link.active {
  background: var(--app-sidebar-active-bg);
  font-weight: 600;
}

.app-content {
  flex: 1 1 auto;
  min-width: 0;
  padding: 1.5rem;
}

@media (max-width: 767.98px) {
  .app-body {
    flex-direction: column;
  }

  .app-sidebar {
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--app-sidebar-border);
  }

  .app-sidebar-collapse-toggle {
    display: none !important;
  }
}

.kanban-grid {
  display: grid;
  gap: 0.5rem;
  overflow-x: auto;
  border: 1px solid var(--app-sidebar-border);
  border-radius: 0.375rem;
  padding: 0.75rem;
}

/* Kopfzeile und jede Swimlane-Zeile sind eigene Grid-Items des äusseren .kanban-grid
   (grid-column:1/-1 = über alle Spalten), übernehmen dessen Spaltenbreiten aber 1:1
   per CSS Subgrid (grid-template-columns:subgrid) statt eigene Spaltenbreiten zu
   berechnen. Dadurch bleiben Kopfzeile und Datenzeilen immer exakt gleich breit,
   auch bei unterschiedlichem Zeileninhalt (z.B. leere vs. befüllte Wochenspalten) —
   und jede Swimlane bleibt trotzdem ein echtes, eigenständiges DOM-Element mit
   eigener Geometrie (Voraussetzung fürs Drag & Drop der Swimlane-Reihenfolge per
   SortableJS; ein einziges durchgehendes Grid mit display:contents-Wrappern pro
   Lane funktioniert dafür nicht, da display:contents-Elemente kein eigenes
   Layout-Rechteck haben).
*/
.kanban-grid-row,
.kanban-lane-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
}

.kanban-grid-header {
  font-weight: 600;
  padding: 0.25rem 0.5rem;
}

.kanban-lane-label-cell {
  display: flex;
  align-items: flex-start;
  padding: 0.25rem 0.5rem;
  font-weight: 600;
  grid-column: 1;
}

.kanban-lane-drag-handle {
  cursor: grab;
  color: var(--bs-secondary-color, #6c757d);
  margin-right: 0.4rem;
}

.kanban-lane-toggle {
  border: 0;
  background: transparent;
  padding: 0;
  margin-right: 0.4rem;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  color: inherit;
}

.kanban-lane-chevron {
  display: inline-block;
  transition: transform 0.15s ease-in-out;
}

.kanban-lane-toggle[aria-expanded="true"] .kanban-lane-chevron {
  transform: rotate(90deg);
}

.kanban-collapsible.kanban-lane-collapsed {
  display: none;
}

.kanban-column-body {
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: 0.375rem;
  background-color: var(--bs-light, #f8f9fa);
  padding: 1.75rem 0.5rem 0.5rem;
  min-height: 120px;
  position: relative;
}

.kanban-add-task-btn {
  position: absolute;
  top: 0.25rem;
  right: 0.5rem;
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--bs-secondary-color, #6c757d);
  text-decoration: none;
  z-index: 2;
}

.kanban-add-task-btn:hover {
  color: var(--bs-body-color, #212529);
}

.min-w-0 {
  min-width: 0;
}

.kanban-notplanned-sidebar {
  flex: 0 0 auto;
  width: 300px;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  background: var(--app-sidebar-bg);
  border: 1px solid var(--app-sidebar-border);
  border-radius: 0.375rem;
  padding: 0.75rem;
  transition: width 0.2s ease;
}

.kanban-notplanned-sidebar.collapsed {
  width: 2.5rem;
  padding: 0.75rem 0.25rem;
}

.kanban-notplanned-sidebar.collapsed .kanban-notplanned-content {
  display: none;
}

.kanban-notplanned-toggle {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  padding: 0.25rem;
  cursor: pointer;
  color: var(--app-sidebar-text);
}

.kanban-notplanned-chevron {
  display: inline-block;
  transition: transform 0.15s ease-in-out;
}

.kanban-notplanned-sidebar.collapsed .kanban-notplanned-chevron {
  transform: rotate(180deg);
}

.kanban-notplanned-content {
  min-width: 0;
  flex: 1 1 auto;
}

.kanban-month-header {
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  background-color: var(--app-sidebar-hover-bg);
  border-radius: 0.375rem;
}

.kanban-month-header-current {
  background-color: #dcedd9;
}

.kanban-lane-header-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
}

/* Aufgabenkaertchen: Hierarchie durch Kontrast statt Groesse (Titel 14-15px/Medium,
   alles andere 11-13px gedaempftes Grau), Farbe als knappes Gut (Tag-Pillen als blasse
   Tints statt Vollton, gesaettigtes Rot nur fuer "ueberfaellig"), Weissraum statt
   Trennlinien (kein Rahmen, ein dezentes Schattenniveau, staerkerer Schatten nur im
   Drag-Zustand), Hoehenkonsistenz (Titel auf 2 Zeilen geclampt, Metazeile mit fixer
   Mindesthoehe auch bei leeren Feldern). */
.kanban-card {
  background-color: var(--app-sidebar-bg, #fff);
  border-radius: 0.375rem;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  box-shadow: 0 0.15rem 0.4rem rgba(0, 0, 0, .08);
  transition: box-shadow 0.15s ease-in-out;
}

.kanban-card.sortable-drag {
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, .15);
}

.kanban-card-context-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--bs-secondary-color, #6c757d);
}

.kanban-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  min-width: 0;
}

.kanban-card-id-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
  white-space: nowrap;
}

.kanban-card-id-actions a {
  color: var(--bs-secondary-color, #6c757d);
  text-decoration: none;
}

/* Tag-Farbe kommt per Inline-Style als CSS-Custom-Property (--tag-color); color-mix()
   berechnet daraus einen blassen Hintergrund-Tint und einen abgedunkelten Textfarbton,
   ohne dass dafuer serverseitige Farbberechnung noetig ist. */
.kanban-tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.4;
  background-color: color-mix(in srgb, var(--tag-color) 15%, white);
  color: color-mix(in srgb, var(--tag-color) 65%, black);
}

.kanban-card-title {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.3;
  margin: 0.3rem 0 0.4rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kanban-card-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 1.4rem;
  font-size: 0.75rem;
  color: var(--bs-secondary-color, #6c757d);
}

.kanban-card-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background-color: var(--bs-secondary-bg, #e9ecef);
  color: var(--bs-secondary-color, #6c757d);
  font-size: 0.6rem;
  font-weight: 600;
  flex: 0 0 auto;
}

.kanban-card-overdue {
  color: var(--bs-danger, #dc3545);
  font-weight: 500;
}

/* Iconoir-SVGs (siehe Data/Icons.cs, wwwroot/js/icons.js): stroke="currentColor" + fill="none"
   im Quellmarkup geben Farbvererbung kostenlos, .icon steuert nur die Groesse passend zur
   umgebenden Schriftgroesse. */
.icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  flex: 0 0 auto;
}

/* Icon+Zahl/Text-Paare (z.B. Kanban-Kaertchen-Metazeile) brauchten frueher keinen Abstand, da
   Emoji von Haus aus etwas Leerraum mitbringen - ein <svg> hat das nicht, daher dieser Wrapper. */
.kanban-card-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

/* Feste Höhe für beide Dashboard-Widgets (Home-Seite), damit z.B. das Kreis- und das
   Säulendiagramm trotz unterschiedlicher Chart.js-Standard-Seitenverhältnisse gleich
   hoch sind (Chart.js füllt bei maintainAspectRatio:false die Höhe des Eltern-Elements). */
.dashboard-chart-container {
  position: relative;
  height: 320px;
}

.tag-picker {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: 0.375rem;
  padding: 0.375rem 0.5rem;
  background: #fff;
}

.tag-picker-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.tag-picker-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.tag-picker-chip-remove {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  line-height: 1;
  cursor: pointer;
  font-size: 1.1em;
}

.tag-picker-search {
  border: 0;
  outline: none;
  flex: 1 1 120px;
  min-width: 120px;
  padding: 0.15rem 0;
}

.tag-picker-dropdown {
  position: absolute;
  z-index: 20;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.25rem;
  max-height: 260px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--app-sidebar-border);
  border-radius: 0.375rem;
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, .15);
  display: none;
}

.tag-picker-dropdown.show {
  display: block;
}

.tag-picker-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.375rem 0.5rem;
  cursor: pointer;
}

.tag-picker-dropdown-item:hover {
  background: var(--app-sidebar-hover-bg);
}

.tag-picker-dropdown-item-edit {
  border: 0;
  background: transparent;
  color: var(--bs-secondary-color, #6c757d);
  padding: 0 0.25rem;
  cursor: pointer;
}

.tag-picker-dropdown-create {
  font-style: italic;
  color: var(--bs-primary, #0d6efd);
}

.tag-picker-dropdown-empty {
  padding: 0.5rem;
  font-size: 0.9em;
}

.attachment-dropzone {
  border: 2px dashed var(--bs-border-color, #dee2e6);
  border-radius: 0.375rem;
  padding: 0.75rem;
  text-align: center;
  color: var(--bs-secondary-color, #6c757d);
}

.attachment-dropzone.dragover {
  border-color: var(--bs-primary, #0d6efd);
  background-color: var(--bs-tertiary-bg, #f8f9fa);
}

.attachment-delete-btn {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.checklist-item {
  padding: 0.25rem 0;
}

.kanban-card-checklist {
  font-size: 0.75rem;
  margin: 0 0 0.3rem;
}

.kanban-card-checklist .checklist-item {
  padding: 0.15rem 0;
}

.checklist-check-btn {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  border: 2px solid var(--bs-border-color, #dee2e6);
  background-color: transparent;
  padding: 0;
  cursor: pointer;
  flex: 0 0 auto;
}

/* Gruenton identisch zur "Erledigt"-TaskStatusOption (siehe ApplicationDbContext-Seed-Daten),
   damit "erledigt" app-weit dieselbe Farbe hat. */
.checklist-check-btn.checked {
  border-color: #22c55e;
  background-color: #22c55e;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='white'%3E%3Cpath d='M13.485 1.929a1 1 0 0 1 0 1.414l-7.07 7.071a1 1 0 0 1-1.415 0L2.515 7.929a1 1 0 1 1 1.414-1.415L6 8.586l6.07-6.07a1 1 0 0 1 1.415 0z'/%3E%3C/svg%3E");
  background-size: 0.7rem;
  background-repeat: no-repeat;
  background-position: center;
}

.checklist-item-done .checklist-item-text {
  text-decoration: line-through;
  color: var(--bs-secondary-color, #6c757d);
}

.checklist-move-btn {
  border: 0;
  background: transparent;
  padding: 0 0.15rem;
  cursor: pointer;
  color: var(--bs-secondary-color, #6c757d);
  font-size: 0.7rem;
}

.checklist-move-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.entity-comment-delete-btn {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.entity-comment {
  border-bottom: 1px solid var(--bs-border-color, #dee2e6);
  padding-bottom: 0.5rem;
}

.entity-comment-text {
  white-space: pre-wrap;
}

.gantt-legend-btn {
  border: 0;
  color: #fff;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.875rem;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.15s ease-in-out;
}

.gantt-legend-btn[aria-pressed="false"] {
  opacity: 0.35;
}

.gantt-lane-hidden {
  display: none;
}

.app-sidebar-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.5rem 1.25rem;
  border: 0;
  background: transparent;
  color: var(--app-sidebar-text);
  text-align: left;
}

.app-sidebar-group-toggle:hover {
  background: var(--app-sidebar-hover-bg);
}

.app-sidebar-group-chevron {
  transition: transform 0.15s ease-in-out;
}

.app-sidebar-group-toggle[aria-expanded="true"] .app-sidebar-group-chevron {
  transform: rotate(90deg);
}

.app-sidebar-link-nested {
  padding-left: 2.25rem;
  font-size: 0.9em;
}

.sortable-th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.sortable-th .sort-indicator {
  display: inline-flex;
  flex-direction: column;
  vertical-align: middle;
  margin-left: 0.35rem;
  line-height: 0.6;
}

.sort-arrow {
  font-size: 0.55rem;
  color: var(--sort-arrow-inactive);
}

.sort-arrow.active {
  color: var(--sort-arrow-active);
}

.column-filter-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  padding: 0 0.25rem;
  cursor: pointer;
  color: var(--sort-arrow-inactive);
}

.column-filter-toggle:hover,
.column-filter-toggle.active {
  color: var(--sort-arrow-active);
}

.funnel-icon {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: currentColor;
  clip-path: polygon(0% 0%, 100% 0%, 60% 55%, 60% 100%, 40% 100%, 40% 55%);
}

.week-filter-badge {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: normal;
  color: #212529;
  background-color: #ced4da;
  text-decoration: none;
}

.week-filter-badge.active {
  color: #fff;
  background-color: var(--sort-arrow-active);
}

.col-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 6px;
  cursor: col-resize;
  user-select: none;
  z-index: 3;
}

.col-resize-handle:hover {
  background: var(--sort-arrow-inactive);
}

body.col-resizing {
  cursor: col-resize;
  user-select: none;
}

.column-filter-popover {
  position: fixed;
  z-index: 20;
  background: #fff;
  border: 1px solid var(--app-sidebar-border);
  border-radius: 0.375rem;
  padding: 0.5rem;
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, .15);
  display: none;
  min-width: 180px;
  font-weight: normal;
  white-space: normal;
}

.column-filter-popover.show {
  display: block;
}

.table-group-header td {
  background: var(--app-sidebar-hover-bg);
  font-weight: 600;
}

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--app-sidebar-bg);
  border: 1px solid var(--app-sidebar-border);
  border-radius: 0.5rem;
  padding: 2rem;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, .08);
}

/* Whiteboard — optisch an SMDC angelehnt: Punktraster-Hintergrund, abgerundete
   Formen, halbtransparente Fuellung + kraeftiger Rahmen, graue Verbindungslinien. */
.whiteboard-toolbox {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--app-sidebar-border);
  border-radius: 0.375rem;
  background: var(--app-sidebar-bg);
}

.whiteboard-toolbox-label {
  font-weight: 600;
  margin-right: 0.25rem;
}

.whiteboard-toolbox-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--app-sidebar-border);
  border-radius: 999px;
  background: var(--app-sidebar-hover-bg);
  cursor: grab;
  font-size: 0.875rem;
  user-select: none;
}

.whiteboard-toolbox-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  background: #3b82f6;
  border: 1px solid rgba(0, 0, 0, .25);
}

.whiteboard-toolbox-swatch-rectangle { border-radius: 3px; }
.whiteboard-toolbox-swatch-circle,
.whiteboard-toolbox-swatch-oval { border-radius: 50%; }
.whiteboard-toolbox-swatch-diamond { transform: rotate(45deg); }
.whiteboard-toolbox-swatch-process { border-radius: 3px 8px 8px 3px; }
.whiteboard-toolbox-swatch-textbox { background: #ffffff; }
.whiteboard-toolbox-swatch-postit { background: #fde68a; border-radius: 2px; }
.whiteboard-toolbox-swatch-line { height: 2px; border: none; border-radius: 0; transform: rotate(-30deg); }

.whiteboard-toolbox-hint {
  font-size: 0.8rem;
  color: var(--bs-secondary-color, #6c757d);
  flex-basis: 100%;
}

.whiteboard-toolbox-hint a {
  color: inherit;
}

/* Emoji-Picker-Popover: folgt dem .whiteboard-submenu-Grundmuster (position:fixed,
   .show-Klasse, siehe initSubmenu in whiteboard.js), mit eigener Breite/Scroll-Hoehe fuer
   das Suchfeld + die nach Gruppe gegliederten Kacheln. */
.whiteboard-emoji-picker {
  flex-direction: column;
  align-items: stretch;
  width: 320px;
  max-height: 380px;
}

.whiteboard-emoji-search {
  width: 100%;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--app-sidebar-border);
  border-radius: 0.25rem;
  margin-bottom: 0.5rem;
}

.whiteboard-emoji-picker-body {
  overflow-y: auto;
}

.whiteboard-emoji-picker-loading {
  color: var(--bs-secondary-color, #6c757d);
  font-size: 0.85rem;
  margin: 0.5rem 0;
}

.whiteboard-emoji-group-heading {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--bs-secondary-color, #6c757d);
  margin: 0.5rem 0 0.25rem;
}

.whiteboard-emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
  gap: 0.25rem;
}

.whiteboard-emoji-tile {
  width: 32px;
  height: 32px;
  padding: 2px;
  border-radius: 0.25rem;
  cursor: grab;
}

.whiteboard-emoji-tile:hover {
  background: var(--app-sidebar-hover-bg);
}

.whiteboard-canvas-wrapper {
  position: relative;
  width: 100%;
  height: 70vh;
  overflow: auto;
  border: 1px solid var(--app-sidebar-border);
  border-radius: 0.375rem;
}

.whiteboard-zoom-control {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--app-sidebar-bg);
  border: 1px solid var(--app-sidebar-border);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  box-shadow: 0 0.15rem 0.4rem rgba(0, 0, 0, .1);
  z-index: 20;
}

.whiteboard-zoom-control button {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0 0.1rem;
  line-height: 1;
}

.whiteboard-zoom-control input[type="range"] {
  width: 120px;
}

.whiteboard-canvas {
  display: block;
  width: 2400px;
  height: 1600px;
  background: #ffffff;
  background-image: radial-gradient(circle at 1px 1px, #d0d5db 1px, transparent 0);
  background-size: 20px 20px;
}

.whiteboard-shape {
  cursor: grab;
}

.whiteboard-shape-body {
  stroke-width: 2;
}

.whiteboard-shape.selected .whiteboard-shape-body {
  stroke: #0d6efd;
  stroke-width: 3;
}

/* pointer-events:none muss hier auf dem <foreignObject> SELBST gesetzt werden, nicht nur
   auf dem inneren Div: SVG behandelt pointer-events als eigene Praesentationseigenschaft
   des <foreignObject>-Elements, unabhaengig vom CSS-pointer-events des eingebetteten
   HTML-Inhalts — ohne diese Zeile "verschluckt" das foreignObject Klicks/Doppelklicks
   auf der ganzen Formflaeche, statt sie zum darunterliegenden mainEl durchzureichen
   (aeussert sich als: Formen lassen sich nicht mehr verschieben/per Doppelklick
   editieren). Waehrend der Textbearbeitung (.editing) wieder aktiviert, siehe unten. */
.whiteboard-shape-foreignobject {
  overflow: visible;
  pointer-events: none;
}

.whiteboard-shape.editing .whiteboard-shape-foreignobject {
  pointer-events: auto;
}

/* Formen-Beschriftung als echtes HTML statt SVG-<text> (siehe renderShapeContent() in
   whiteboard.js) — dadurch bekommen wir Wortumbruch, mehrzeiliges Abschneiden mit "..."
   (-webkit-line-clamp) und klickbare Links "gratis" vom Browser statt sie selbst
   nachzubauen. Ausserhalb des Bearbeitungsmodus pointer-events:none, damit Klicks auf den
   Formkoerper (mainEl) weiterhin fuer Drag/Auswahl durchschlagen; Links sind trotzdem
   klickbar (eigene Ausnahme unten), waehrend der Textbearbeitung (.editing) faengt der
   Container Klicks fuer die native Textauswahl ab.

   Zweistufiger Aufbau (aeusserer Flex-Wrapper + innerer Textblock) noetig, damit
   vertikale Ausrichtung UND mehrzeiliges Abschneiden gleichzeitig funktionieren:
   -webkit-line-clamp gibt dem inneren Block eine intrinsische Hoehe passend zur
   tatsaechlich sichtbaren (ggf. abgeschnittenen) Zeilenzahl — der aeussere Flex-Container
   kann diesen dadurch korrekt nach oben/mittig/unten ausrichten (justify-content). Ohne
   diesen Wrapper wuerde -webkit-box (das line-clamp fuer sich selbst braucht) die eigene
   vertikale Ausrichtung ueberschreiben und Text immer oben anzeigen. `display`/
   `-webkit-line-clamp`/Ausrichtung werden inline per JS gesetzt (siehe
   renderShapeContent()/enterTextEditMode() in whiteboard.js), da sie von
   shape.height/fontSize/textAlign und vom Modus abhaengen — hier nur die
   modusunabhaengige Grundausstattung. */
.whiteboard-shape-content {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: default;
  pointer-events: none;
}

.whiteboard-shape-content-inner {
  width: 100%;
  overflow-wrap: break-word;
  white-space: normal;
  font-family: inherit;
  outline: none;
}

.whiteboard-shape-content a {
  pointer-events: auto;
  color: inherit;
  text-decoration: underline;
}

.whiteboard-shape.editing .whiteboard-shape-content {
  pointer-events: auto;
  cursor: text;
  overflow-y: auto;
}

.whiteboard-connect-handle {
  fill: #ffffff;
  stroke: #0d6efd;
  stroke-width: 1.5;
  opacity: 0;
  cursor: crosshair;
  transition: opacity 0.1s ease-in-out;
}

.whiteboard-shape:hover .whiteboard-connect-handle,
.whiteboard-shape.selected .whiteboard-connect-handle {
  opacity: 1;
}

.whiteboard-resize-handle {
  fill: #0d6efd;
  opacity: 0;
  cursor: nwse-resize;
  transition: opacity 0.1s ease-in-out;
}

.whiteboard-shape:hover .whiteboard-resize-handle,
.whiteboard-shape.selected .whiteboard-resize-handle {
  opacity: 1;
}

.whiteboard-line-endpoint-handle {
  fill: #ffffff;
  stroke: #0d6efd;
  stroke-width: 1.5;
  opacity: 0;
  cursor: move;
  transition: opacity 0.1s ease-in-out;
}

.whiteboard-shape:hover .whiteboard-line-endpoint-handle,
.whiteboard-shape.selected .whiteboard-line-endpoint-handle {
  opacity: 1;
}

.whiteboard-connection-line {
  fill: none;
  stroke: #616161;
  stroke-width: 2;
  pointer-events: none;
}

.whiteboard-connection.selected .whiteboard-connection-line {
  stroke: #0d6efd;
  stroke-width: 3;
}

.whiteboard-connection-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 14;
  cursor: pointer;
  pointer-events: stroke;
}

.whiteboard-arrowhead {
  fill: #616161;
}

.whiteboard-connection.selected .whiteboard-arrowhead {
  fill: #0d6efd;
}

.whiteboard-temp-connection {
  stroke: #0d6efd;
  stroke-width: 2;
  stroke-dasharray: 6 4;
}

.whiteboard-marquee {
  fill: rgba(13, 110, 253, .1);
  stroke: #0d6efd;
  stroke-width: 1;
  stroke-dasharray: 4 2;
  pointer-events: none;
}

.whiteboard-shape-toolbar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.5rem;
  background: var(--app-sidebar-bg);
  border: 1px solid var(--app-sidebar-border);
  border-radius: 0.375rem;
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, .15);
  z-index: 30;
}

.whiteboard-shape-toolbar input[type="color"] {
  width: 32px;
  height: 32px;
  padding: 2px;
  border: 1px solid var(--app-sidebar-border);
  border-radius: 0.25rem;
}

.whiteboard-toolbar-group {
  position: relative;
  display: inline-flex;
}

.whiteboard-toolbar-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--app-sidebar-border);
  border-radius: 0.25rem;
  background: var(--app-sidebar-bg);
  color: var(--app-sidebar-text);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
}

.whiteboard-toolbar-btn:hover {
  background: var(--app-sidebar-hover-bg);
}

.whiteboard-toolbar-btn-danger {
  color: #dc3545;
}

.whiteboard-fontcolor-btn {
  border-bottom: 3px solid var(--wb-fontcolor, #212529);
}

/* Untermenues (Schriftgroesse/Stil/Ausrichtung/Schriftfarbe/Anordnung): analog zum
   Filter-Popover der sortierbaren Tabellen (position:fixed, beim Oeffnen ueber
   getBoundingClientRect positioniert, schliesst bei Klick ausserhalb). */
.whiteboard-submenu {
  display: none;
  position: fixed;
  align-items: center;
  gap: 0.3rem;
  background: var(--app-sidebar-bg);
  border: 1px solid var(--app-sidebar-border);
  border-radius: 0.375rem;
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, .15);
  padding: 0.4rem;
  z-index: 40;
}

.whiteboard-submenu.show {
  display: flex;
}

.whiteboard-fontsize-menu button {
  width: 24px;
  height: 24px;
  border: 1px solid var(--app-sidebar-border);
  border-radius: 0.25rem;
  background: var(--app-sidebar-bg);
  cursor: pointer;
}

.whiteboard-fontsize-menu span {
  min-width: 24px;
  text-align: center;
  font-size: 0.85rem;
}

.whiteboard-toggle-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--app-sidebar-border);
  border-radius: 0.25rem;
  background: var(--app-sidebar-bg);
  cursor: pointer;
}

.whiteboard-toggle-btn.active {
  background: #0d6efd;
  color: #ffffff;
  border-color: #0d6efd;
}

.whiteboard-toggle-btn-wide {
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.35rem 0.5rem;
  border-radius: 0.25rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--app-sidebar-text);
}

.whiteboard-toggle-btn-wide:hover {
  background: var(--app-sidebar-hover-bg);
}

.whiteboard-toggle-btn-wide.active {
  background: #0d6efd;
  color: #ffffff;
}

.whiteboard-align-menu.show {
  display: grid;
  grid-template-columns: repeat(3, 26px);
  grid-template-rows: repeat(3, 26px);
  gap: 2px;
  padding: 4px;
}

.whiteboard-align-cell {
  display: flex;
  border: 1px solid var(--app-sidebar-border);
  border-radius: 3px;
  background: var(--app-sidebar-bg);
  cursor: pointer;
  padding: 0;
}

.whiteboard-align-cell::after {
  content: '';
  width: 6px;
  height: 6px;
  margin: auto;
  background: #6c757d;
  border-radius: 1px;
}

.whiteboard-align-cell[data-align^="top"] { align-items: flex-start; }
.whiteboard-align-cell[data-align*="middle"] { align-items: center; }
.whiteboard-align-cell[data-align^="bottom"] { align-items: flex-end; }
.whiteboard-align-cell[data-align$="left"] { justify-content: flex-start; }
.whiteboard-align-cell[data-align$="center"] { justify-content: center; }
.whiteboard-align-cell[data-align$="right"] { justify-content: flex-end; }

.whiteboard-align-cell.active {
  background: #0d6efd;
  border-color: #0d6efd;
}

.whiteboard-align-cell.active::after {
  background: #ffffff;
}

.whiteboard-layer-menu {
  flex-direction: column;
  align-items: stretch;
  min-width: 190px;
}

.whiteboard-layer-menu button {
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.35rem 0.5rem;
  border-radius: 0.25rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--app-sidebar-text);
}

.whiteboard-layer-menu button:hover {
  background: var(--app-sidebar-hover-bg);
}

.whiteboard-layer-menu button.active {
  background: #0d6efd;
  color: #ffffff;
}

/* Schluesselergebnis-Karte: Name/Status/Fortschritt statt freiem Text (siehe
   renderKeyResultCard() in whiteboard.js). */
.whiteboard-keyresult-name {
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  fill: #212529;
  pointer-events: none;
}

.whiteboard-keyresult-status-text {
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  fill: #ffffff;
  pointer-events: none;
}

.whiteboard-keyresult-progress-track {
  fill: #e5e7eb;
}

.whiteboard-keyresult-progress-text {
  font-family: inherit;
  font-size: 11px;
  fill: #495057;
  pointer-events: none;
}

.whiteboard-keyresult-missing {
  font-family: inherit;
  font-size: 12px;
  font-style: italic;
  fill: #6c757d;
  pointer-events: none;
}

.whiteboard-keyresult-open-btn {
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.1s ease-in-out;
}

.whiteboard-shape:hover .whiteboard-keyresult-open-btn,
.whiteboard-shape.selected .whiteboard-keyresult-open-btn {
  opacity: 1;
}

.whiteboard-keyresult-open-btn-bg {
  fill: #ffffff;
  stroke: #0d6efd;
  stroke-width: 1.5;
}

.whiteboard-keyresult-open-btn-icon {
  pointer-events: none;
}

/* Risiko-Karte: Name/Status statt freiem Text (siehe renderRiskCard() in whiteboard.js). */
.whiteboard-risk-name {
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  fill: #212529;
  pointer-events: none;
}

.whiteboard-risk-status-text {
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  fill: #ffffff;
  pointer-events: none;
}

.whiteboard-risk-missing {
  font-family: inherit;
  font-size: 12px;
  font-style: italic;
  fill: #6c757d;
  pointer-events: none;
}

.whiteboard-risk-open-btn {
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.1s ease-in-out;
}

.whiteboard-shape:hover .whiteboard-risk-open-btn,
.whiteboard-shape.selected .whiteboard-risk-open-btn {
  opacity: 1;
}

.whiteboard-risk-open-btn-bg {
  fill: #ffffff;
  stroke: #0d6efd;
  stroke-width: 1.5;
}

.whiteboard-risk-open-btn-icon {
  pointer-events: none;
}

/* Formular-Drawer: #formModal (einziges Modal der App) öffnet als rechtsseitiges
   Slide-in-Panel statt zentriert. Nur CSS — Markup/JS (form-modal.js,
   data-bs-backdrop="static") bleiben unverändert. */
#formModal .modal-dialog {
  position: fixed;
  top: 0;
  right: 0;
  margin: 0;
  width: 100%;
  max-width: 480px;
  height: 100%;
}

#formModal .modal-dialog.modal-lg {
  max-width: 720px;
}

#formModal.fade .modal-dialog {
  transform: translateX(100%);
}

#formModal.show .modal-dialog {
  transform: translateX(0);
}

#formModal .modal-content {
  height: 100%;
  overflow: hidden;
  border: 0;
  border-radius: 0;
}

/* In allen 12 Formularen liegt ein <form> zwischen .modal-content und .modal-body/
   .modal-footer (siehe z.B. Pages/Tasks/Edit.cshtml) — dadurch ist .modal-body KEIN
   direktes Flex-Kind von .modal-content mehr, Bootstraps "flex:1 1 auto" auf .modal-body
   greift also nicht mehr, das <form> waechst stattdessen unkontrolliert mit seinem
   gesamten Inhalt und wird von .modal-content { overflow:hidden } hart abgeschnitten
   (kein Scrollbalken, Footer-Buttons verschwinden). Das <form> muss daher selbst als
   Flex-Spalte auftreten, damit .modal-body/.modal-footer wieder korrekt einer diesem
   uebergeordneten Flex-Layout folgen. */
#formModal .modal-content > form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

#formModal .modal-body {
  overflow-y: auto;
  /* Ohne min-height:0 verweigert der Flex-Item-Standardwert min-height:auto das
     Schrumpfen unter die eigene Inhaltshoehe — bei langen Formularen wuerde dadurch nie
     ein interner Scrollbalken entstehen, stattdessen wird der Inhalt vom
     .modal-content-overflow:hidden einfach hart abgeschnitten (inkl. Footer-Buttons). */
  min-height: 0;
}

/* Risikomap (Pages/Risks/Index.cshtml): 6x6-Matrix als HTML-Tabelle mit gedrehtem
   Y-Achsentitel links und X-Achsentitel unten, siehe Screenshot-Vorlage. */
.risk-map-scroll {
  overflow-x: auto;
}

.risk-map-axis-y {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-align: center;
  font-weight: 600;
  color: var(--bs-secondary-color, #6c757d);
  padding: 0.5rem 0.25rem;
  flex: 0 0 auto;
  white-space: nowrap;
}

.risk-map-table {
  border-collapse: collapse;
  table-layout: fixed;
}

.risk-map-table th,
.risk-map-table td {
  border: 1px solid #adb5bd;
  padding: 0.4rem;
}

.risk-map-table tfoot th {
  background-color: transparent;
  border: none;
  text-align: center;
  vertical-align: top;
  font-weight: 600;
  font-size: 0.85rem;
  min-width: 90px;
}

/* X-Achsentitel als eigene Fusszeile derselben Tabelle statt eines separaten Elements
   darunter: dadurch beginnt "Eintretenswahrscheinlichkeit" exakt am linken Rand der ersten
   Datenspalte (dem dunkelgruenen Feld) — die leere erste Zelle ueberspringt die
   Zeilenbeschriftungs-Spalte, das colspan="6" umfasst die sechs Datenspalten. */
.risk-map-axis-x-row td {
  border: none;
  padding-top: 0.5rem;
}

.risk-map-axis-x-cell {
  text-align: left;
  font-weight: 600;
  color: var(--bs-secondary-color, #6c757d);
}

.risk-map-table tbody th {
  background-color: transparent;
  border: none;
  text-align: right;
  vertical-align: middle;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  padding-right: 0.75rem;
}

.risk-map-table tbody td {
  width: 90px;
  height: 70px;
  vertical-align: middle;
  text-align: center;
}

.risk-map-badge {
  display: inline-block;
  margin: 2px;
  background-color: rgba(255, 255, 255, 0.85);
  color: #212529;
  font-weight: 600;
  cursor: pointer;
}

/* !important noetig: sowohl .risk-map-badge als auch .risk-map-measure-badge setzen
   selbst display:inline-block mit derselben Spezifitaet — ohne !important wuerde je nach
   Deklarationsreihenfolge im Stylesheet eine dieser Regeln die Ausblendung wieder
   aufheben. */
.risk-map-badge-hidden {
  display: none !important;
}

.risk-map-measure-badge {
  display: inline-block;
  margin: 2px;
  background-color: rgba(255, 255, 255, 0.85);
  color: #0f3a4b;
  font-weight: 600;
  border: 1px solid #0f3a4b;
}

.risk-map-measure-hidden {
  display: none !important;
}

.risk-map-measures-toggle-btn {
  border: 1px solid #0f3a4b;
  background-color: #fff;
  color: #0f3a4b;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
}

.risk-map-measures-toggle-btn[aria-pressed="true"] {
  background-color: #0f3a4b;
  color: #fff;
}

/* Positionierungsrahmen fuer das SVG-Pfeil-Overlay (siehe risk-map.js), damit dessen
   position:absolute sich auf die Matrix bezieht statt auf ein weiter aussen liegendes
   positioniertes Element. */
.risk-map-canvas {
  position: relative;
}

/* pointer-events:none noetig, damit Klicks auf Risiko-/Massnahmen-Badges und Zellen unter
   dem Overlay weiterhin ankommen (siehe Klick-Highlighting in risk-map.js). */
.risk-map-arrows {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Hervorhebung der Risikozeile in der Liste nach Klick auf ein Risiko in der Risikomap
   (siehe risk-map.js) — !important noetig, um .table-striped-Zebrastreifen zu ueberstimmen. */
.risk-list-row-highlight > td {
  background-color: #fff3cd !important;
  box-shadow: inset 3px 0 0 0 #0f3a4b;
}

/* Ausblendung von Risikozeilen ueber den Projekt-Filter oberhalb der Risikomap (siehe
   risk-map.js) — !important noetig, damit sortable-table.js's eigenes render() (Sortieren/
   Suchen/Spalten-Filter) diese Ausblendung nicht ueberschreibt, siehe Kommentar in risk-map.js. */
.risk-list-row-project-hidden {
  display: none !important;
}

/* Nur-Lese-Anzeige einer sanitisierten Beschreibung (siehe Data/DescriptionHtml.cs),
   z.B. Pages/Risks/Delete.cshtml. Listen kommen als echtes <ol>/<ul>/<li> (Quills
   getSemanticHTML(), siehe description-editor.js) und brauchen daher keine eigene
   Aufzaehlungs-CSS — nur die Einzugsstufen (ql-indent-1..8) als Fallback fuer eingerueckte
   Nicht-Listen-Absaetze, Werte 1:1 aus quill.snow.css uebernommen (3em je Stufe). */
.description-html p {
  margin: 0 0 0.5em;
}
.description-html ol,
.description-html ul {
  margin: 0 0 0.5em;
  padding-left: 1.5em;
}
.description-html .ql-indent-1 { padding-left: 3em; }
.description-html .ql-indent-2 { padding-left: 6em; }
.description-html .ql-indent-3 { padding-left: 9em; }
.description-html .ql-indent-4 { padding-left: 12em; }
.description-html .ql-indent-5 { padding-left: 15em; }
.description-html .ql-indent-6 { padding-left: 18em; }
.description-html .ql-indent-7 { padding-left: 21em; }
.description-html .ql-indent-8 { padding-left: 24em; }

/* Quill (siehe description-editor.js) fuegt seine eigenen Klassen (ql-container ql-snow)
   direkt dem von uns erzeugten <div class="description-editor"> hinzu, statt es zu
   umschliessen — .description-editor UND .ql-container sind also dasselbe Element, kein
   Nachfahre. Der zusammengesetzte Selektor (zwei Klassen) ist bewusst statt !important
   gewaehlt: er ist spezifischer als Quills eigenes einfaches ".ql-container{height:100%}"
   bzw. "font-family:Helvetica,Arial,sans-serif;font-size:13px" aus quill.snow.css (das trotz
   spaeterer Ladereihenfolge ueber den Scripts-Abschnitt so verlaesslich verliert) — waehrend
   eine per Maus gezogene Groesse weiterhin greift, da der Browser dafuer eine Inline-Angabe
   setzt, die JEDE externe Regel ohne !important schlaegt. font-family/font-size gleichen die
   Basisschrift des Editors an Bootstraps .form-control an (z.B. Feld "Titel"), damit
   unformatierter Text nicht kleiner/anders wirkt als in einzeiligen Textfeldern; explizite
   Groessen-Formatierungen (siehe Toolbar) ueberschreiben das weiterhin per Inline-Style pro
   Textstelle. Starthoehe entspricht mind. 8 Textzeilen (16px Schrift * 1.42 Zeilenhoehe * 8 +
   Editor-Padding, siehe quill.snow.css), per Maus (resize:vertical) vergroesser-/
   verkleinerbar. .ql-editor erhaelt bereits von Quill selbst overflow-y:auto, wodurch bei
   Bedarf ein vertikaler Scrollbalken erscheint, sobald der Inhalt die aktuelle
   Container-Hoehe uebersteigt. overflow:hidden hier verhindert einen zweiten, aeusseren
   Scrollbalken. */
.description-editor.ql-container {
  height: 220px;
  resize: vertical;
  overflow: hidden;
  font-family: var(--bs-body-font-family);
  font-size: 1rem;
}

/* Die Groessen-Whitelist in description-editor.js verwendet eigene Pixelwerte statt Quills
   Standardwerte small/large/huge, fuer die quill.snow.css eigene [data-value]::before-Regeln
   mitbringt — ohne diese Ergaenzung wuerden alle sechs Dropdown-Eintraege auf Quills generische,
   wertunabhaengige Fallback-Regel content:'Normal' zurueckfallen. Der Eintrag fuer "kein Format"
   (false in der Toolbar) hat bewusst keine eigene Regel: Quill setzt dafuer kein data-value-
   Attribut, er faellt korrekt weiterhin auf 'Normal' zurueck. */
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="10px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="10px"]::before {
  content: 'Klein';
}
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="14px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="14px"]::before {
  content: 'Standard';
}
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="18px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="18px"]::before {
  content: 'Überschrift 3';
}
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="24px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="24px"]::before {
  content: 'Überschrift 2';
}
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="32px"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="32px"]::before {
  content: 'Überschrift 1';
}

/* ===================== Leistungserfassung (wwwroot/js/timetracking.js) ===================== */
.tt-root {
  --tt-ink: #151A21;
  --tt-ink2: #39424F;
  --tt-muted: #7C8794;
  --tt-faint: #A9B2BD;
  --tt-panel: #FFFFFF;
  --tt-line: #E4E8ED;
  --tt-line-strong: #CBD3DC;
  --tt-accent: #0B6E6E;
  --tt-internal: #8A93A0;
}

.tt-mono { font-variant-numeric: tabular-nums; }
.tt-eyebrow { letter-spacing: .08em; text-transform: uppercase; font-size: .75rem; color: var(--tt-muted); }

.tt-header {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 1rem; padding: .5rem 0 1rem;
}
.tt-week-range { display: block; margin-top: .25rem; color: var(--tt-muted); font-size: .875rem; }
.tt-header-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.tt-header-divider { width: 1px; height: 24px; background: var(--tt-line); margin: 0 .25rem; }

.tt-body { display: flex; flex-direction: column; gap: 1rem; }
@media (min-width: 992px) { .tt-body { flex-direction: row; align-items: flex-start; } }

.tt-calendar {
  flex: 1; min-width: 0; background: var(--tt-panel); border: 1px solid var(--tt-line);
  border-radius: 8px; overflow: hidden;
}

.tt-day-headers { display: flex; background: var(--tt-panel); border-bottom: 1px solid var(--tt-line-strong); }
.tt-hour-gutter-spacer { width: 56px; flex: none; }
.tt-day-header-row { display: flex; flex: 1; }
.tt-day-header-col { flex: 1; min-width: 0; padding: .4rem .5rem; border-left: 1px solid var(--tt-line); }
.tt-day-header-top { display: flex; align-items: baseline; justify-content: space-between; gap: .25rem; }
.tt-day-header-label { font-size: .8rem; font-weight: 600; color: var(--tt-ink2); }
.tt-day-header-label.tt-today { color: var(--tt-accent); }
.tt-day-header-date { font-size: .75rem; color: var(--tt-faint); padding: 0 .2rem; border-radius: 4px; }
.tt-day-header-date.tt-today-badge { color: #fff; background: var(--tt-accent); }
.tt-day-header-bar-wrap { margin-top: .35rem; display: flex; align-items: center; gap: .35rem; }
.tt-day-header-bar-track { height: 4px; flex: 1; background: var(--tt-line); border-radius: 2px; overflow: hidden; }
.tt-day-header-bar-fill { display: flex; height: 100%; }
.tt-day-header-bar-billable { background: var(--tt-accent); }
.tt-day-header-bar-internal { background: var(--tt-internal); }
.tt-day-header-total { font-size: .75rem; color: var(--tt-ink2); white-space: nowrap; }

.tt-scroll { max-height: 62vh; overflow: auto; background: var(--tt-panel); }
.tt-grid-wrapper { display: flex; }
.tt-hour-gutter { width: 56px; flex: none; position: relative; }
.tt-hour-label { position: absolute; right: .5rem; font-size: .75rem; color: var(--tt-faint); }
.tt-lanes { position: relative; display: flex; flex: 1; min-width: 0; }
.tt-hour-line { position: absolute; left: 0; right: 0; border-top: 1px solid #EFF2F5; pointer-events: none; }
.tt-hour-line.tt-hour-line-strong { border-top-color: var(--tt-line); }
.tt-day-col { position: relative; flex: 1; min-width: 0; border-left: 1px solid var(--tt-line); cursor: crosshair; }
.tt-day-col.tt-day-col-weekend { background: #FAFBFC; }

.tt-entry {
  position: absolute; overflow: hidden; border-radius: 5px; background: #fff;
  border: 1px solid var(--tt-line-strong); border-left: 3px solid var(--tt-internal);
  box-shadow: 0 1px 2px rgba(21,26,33,.06); cursor: grab; transition: box-shadow .12s ease;
}
.tt-entry:hover { box-shadow: 0 2px 10px rgba(21,26,33,.14); }
.tt-entry:focus-visible { outline: 2px solid var(--tt-accent); outline-offset: 2px; }
.tt-entry.tt-entry-internal { background: #F4F5F7; }
.tt-entry.tt-entry-readonly { cursor: pointer; opacity: .88; }
.tt-resize-handle { position: absolute; left: 0; right: 0; height: 6px; cursor: ns-resize; }
.tt-resize-handle-top { top: 0; }
.tt-resize-handle-bottom { bottom: 0; }
.tt-entry-meta { display: flex; align-items: center; justify-content: space-between; gap: .25rem; font-size: .65625rem; color: var(--tt-muted); }
.tt-entry-meta-right { display: flex; align-items: center; gap: .25rem; }
.tt-entry-edit-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 16px; height: 16px; padding: 0; border: none; background: transparent;
  color: var(--tt-muted); cursor: pointer; border-radius: 3px;
}
.tt-entry-edit-btn:hover { color: var(--tt-ink2); background: rgba(21,26,33,.08); }
.tt-entry-edit-btn .icon { width: 11px; height: 11px; }
.tt-entry-title { font-weight: 600; font-size: .84375rem; color: var(--tt-ink); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-entry-sub { font-size: .71875rem; color: var(--tt-ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-entry-notes { margin-top: .1rem; font-size: .6875rem; color: var(--tt-muted); line-height: 1.35; }

.tt-ghost {
  pointer-events: none; position: absolute; left: 3px; right: 3px; border-radius: 5px;
  border: 1px dashed var(--tt-accent); z-index: 20;
}
.tt-ghost-label {
  position: absolute; top: -.15rem; left: .25rem; padding: 0 .25rem; font-size: .65625rem;
  color: #fff; border-radius: 3px; white-space: nowrap;
}

.tt-now-line { pointer-events: none; position: absolute; z-index: 25; }
.tt-now-line::before { content: ''; display: block; height: 1px; background: #D0342C; }
.tt-now-dot { position: absolute; top: -3px; left: -1px; width: 7px; height: 7px; border-radius: 99px; background: #D0342C; }

.tt-hint { padding: .5rem 1rem; margin: 0; font-size: .75rem; color: var(--tt-muted); border-top: 1px solid var(--tt-line); }

.tt-summary-col { display: flex; flex-direction: column; gap: 1rem; width: 100%; flex-shrink: 0; }
@media (min-width: 992px) { .tt-summary-col { width: 320px; } }

.tt-summary {
  width: 100%; flex-shrink: 0; padding: 1rem; background: var(--tt-panel);
  border: 1px solid var(--tt-line); border-radius: 8px;
}
@media (min-width: 992px) { .tt-summary { width: 320px; } }
.tt-summary-month-label { margin-top: .15rem; font-size: .8125rem; color: var(--tt-muted); }
.tt-summary-total { margin-top: .5rem; display: flex; align-items: baseline; gap: .5rem; }
.tt-summary-total > span:first-child { font-size: 2rem; font-weight: 600; color: var(--tt-ink); }
.tt-summary-total-label { font-size: .875rem; color: var(--tt-muted); }
.tt-summary-rows { margin-top: 1rem; display: flex; flex-direction: column; gap: .5rem; font-size: .875rem; }
.tt-summary-row { display: flex; align-items: center; justify-content: space-between; color: var(--tt-ink2); }
.tt-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: .4rem; }
.tt-summary-subhead { margin-top: 1.5rem; }
.tt-project-summary { margin-top: .5rem; display: flex; flex-direction: column; gap: .75rem; }
.tt-project-summary-row { font-size: .875rem; }
.tt-project-summary-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.tt-project-summary-name { display: flex; min-width: 0; align-items: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-project-summary-bar-wrap { margin-top: .25rem; display: flex; align-items: center; gap: .5rem; padding-left: 1rem; }
.tt-project-summary-bar-track { height: 4px; flex: 1; background: var(--tt-line); border-radius: 2px; }
.tt-project-summary-bar-fill { height: 100%; border-radius: 2px; }
.tt-project-summary-amount { font-size: .75rem; color: var(--tt-muted); white-space: nowrap; }
.tt-project-summary-spacer { width: 1px; }
.tt-project-summary-users { margin-top: .35rem; padding-left: 1rem; display: flex; flex-direction: column; gap: .2rem; }
.tt-project-summary-user-row { display: flex; align-items: baseline; justify-content: space-between; font-size: .75rem; color: var(--tt-muted); }
.tt-summary-empty { font-size: .875rem; color: var(--tt-muted); }

.tt-readonly-field { background: var(--tt-line, #f3f4f6); color: var(--tt-ink2); }

/* ===================== Leistungsberichte (Pages/Reports/View.cshtml) ===================== */
.report-toolbar { display: flex; gap: .5rem; justify-content: center; margin-bottom: 1rem; }

.report-sheet {
  width: 21cm; min-height: 29.7cm; margin: 0 auto; padding: 1.5cm;
  background: #fff; border: 1px solid #E4E8ED; box-shadow: 0 4px 18px rgba(21,26,33,.08);
  color: #151A21;
}

.report-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.report-title { margin: 0; font-size: 1.6rem; font-weight: 700; }
.report-meta { margin-top: .25rem; font-size: .875rem; color: #39424F; display: flex; align-items: center; gap: .4rem; }
.report-meta .icon { width: 14px; height: 14px; flex: 0 0 auto; color: #7C8794; }
.report-logo { max-width: 160px; max-height: 70px; object-fit: contain; flex: 0 0 auto; }

.report-table { width: 100%; border-collapse: collapse; margin-top: 1.5rem; }
.report-table thead th {
  text-align: left; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase;
  color: #7C8794; background: #F6F7F9; padding: .6rem .5rem; border-bottom: 1px solid #E4E8ED;
}
.report-col-hours { text-align: right; width: 140px; }
.report-table td { padding: .4rem .5rem; border-bottom: 1px solid #F0F2F4; vertical-align: top; }
.report-row-user td { padding-top: 1rem; border-bottom: none; font-size: .95rem; }
.report-row-keyresult td { padding-left: 1.5rem; font-weight: 600; font-size: .85rem; border-bottom: none; }
.report-row-entry td { padding-left: 2.5rem; font-size: .82rem; }
.report-row-entry .report-col-hours { white-space: nowrap; }
.report-entry-time { color: #151A21; }
.report-entry-notes { margin-top: .1rem; color: #39424F; }
.report-mono { font-variant-numeric: tabular-nums; }

.report-row-total td {
  border-bottom: none; border-top: 2px solid #151A21; padding-top: .6rem;
  font-weight: 700; font-size: .95rem;
}

.report-avatar {
  display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
  border-radius: 50%; background: #0B6E6E; color: #fff; font-size: .65rem; font-weight: 700;
  margin-right: .4rem; vertical-align: middle;
}

@media print {
  .app-header, .app-sidebar, .app-sidebar-collapse-toggle, .report-toolbar, footer.footer,
  .rechnung-status-controls, .rechnung-position-actions, .rechnung-add-position { display: none !important; }
  .app-body { display: block !important; }
  body { background: #fff !important; }
  .report-sheet { width: auto; min-height: 0; margin: 0; padding: 0; border: none; box-shadow: none; }
  .report-row-user, .report-row-keyresult { break-inside: avoid; }
  .rechnung-inline-input { border-color: transparent !important; background: transparent !important; }
  @page { size: A4 portrait; margin: 1.5cm; }
}

/* ===================== Rechnungen (Pages/Rechnungen/View.cshtml) ===================== */
.rechnung-toolbar { align-items: center; }

.rechnung-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; }
.rechnung-recipient { flex: 1 1 auto; min-width: 0; }
.rechnung-recipient-address { margin-top: .5rem; line-height: 1.5; }
.rechnung-city-date { margin-top: 1.25rem; font-size: .85rem; color: #7C8794; }

.rechnung-meta { flex: 0 0 auto; width: 270px; }
.rechnung-meta-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .15rem 0; font-size: .85rem; }
.rechnung-meta-label { color: #7C8794; white-space: nowrap; }
.rechnung-meta-value { text-align: right; }
.rechnung-meta-suffix { font-size: .8rem; color: #7C8794; }
.rechnung-meta-readonly { color: #151A21; }

.rechnung-logo { margin-left: 1rem; }

.rechnung-title { margin: 1.5rem 0 1rem; font-size: 1.6rem; font-weight: 700; }

/* Inline-editierbare Felder sollen wie Dokumenttext wirken, nicht wie ein Formular - Rahmen
   erst bei Hover/Fokus sichtbar, damit die Ansicht wie eine echte Rechnung statt wie ein
   Eingabeformular aussieht. */
.rechnung-inline-input {
  border: 1px solid transparent; background: transparent; border-radius: 4px;
  padding: .15rem .35rem; margin: -.15rem -.35rem; color: #151A21; width: 100%; font: inherit;
}
.rechnung-inline-input:hover { border-color: #E4E8ED; }
.rechnung-inline-input:focus { border-color: #7C8794; outline: none; background: #fff; }
.rechnung-inline-input[readonly], .rechnung-inline-input:disabled { color: #39424F; }
.rechnung-meta .rechnung-inline-input { text-align: right; width: auto; min-width: 110px; }

.rechnung-anrede, .rechnung-grussformel { display: block; margin: 1rem 0; }
.rechnung-anrede { resize: vertical; }

.rechnung-positions-table { width: 100%; border-collapse: collapse; margin-top: 1.5rem; }
.rechnung-positions-table thead th {
  text-align: left; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase;
  color: #7C8794; background: #F6F7F9; padding: .6rem .5rem; border-bottom: 1px solid #E4E8ED;
}
.rechnung-positions-table td { padding: .35rem .5rem; border-bottom: 1px solid #F0F2F4; vertical-align: middle; }
.rechnung-position-actions { white-space: nowrap; }
.rechnung-position-actions a, .rechnung-position-actions button { color: #7C8794; margin-left: .4rem; background: none; border: none; }
.rechnung-position-actions .icon { width: 15px; height: 15px; }
.rechnung-position-actions a:hover, .rechnung-position-actions button:hover { color: #151A21; }

.rechnung-add-position { margin-top: .75rem; }
.rechnung-add-position .icon { width: 14px; height: 14px; margin-right: .25rem; vertical-align: -2px; }

.rechnung-totals { margin-top: 1.5rem; margin-left: auto; width: 260px; }
.rechnung-totals-row { display: flex; justify-content: space-between; padding: .25rem 0; font-size: .9rem; }
.rechnung-totals-final { border-top: 2px solid #151A21; margin-top: .25rem; padding-top: .5rem; font-weight: 700; font-size: .95rem; }

.rechnung-footer {
  margin-top: 2.5rem; padding-top: .75rem; border-top: 1px solid #E4E8ED;
  display: flex; gap: 3rem; font-size: .75rem; color: #7C8794;
}
.rechnung-footer-title { font-weight: 700; color: #7C8794; margin-bottom: .2rem; }

/* Wizard (Pages/Rechnungen/PositionWizard.cshtml) */
.rp-step-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.25rem; }
.rp-type-cards { display: flex; gap: .75rem; margin-top: .5rem; }
.rp-type-card {
  flex: 1; padding: 1rem; border: 1px solid #E4E8ED; border-radius: 8px; background: #fff;
  font-weight: 600; cursor: pointer;
}
.rp-type-card.active { border-color: #0B6E6E; box-shadow: 0 0 0 1px #0B6E6E inset; }
.rp-type-card:disabled { color: #B7BEC6; cursor: not-allowed; background: #F6F7F9; }