:root {
  --white: #ffffff;
  --green-light: #a0c860;
  --green-dark: #526e26;
  --gold: #d2b464;
  --gray: #646363;
  --gray-light: #938a8d;
  --bg: #f4f6f0;
  --surface: #ffffff;
  --border: #dde3d4;
  --text: #212121;
  --text-muted: #757575;
  --success: #388e3c;
  --warning: #f57c00;
  --danger: #d32f2f;
  --info: #1976d2;
  --radius: 10px;
  --shadow: 0 2px 8px rgba(82, 110, 38, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 400;
}

a { color: var(--green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  background: linear-gradient(135deg, var(--green-dark), #6b8f32);
  color: var(--white);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
}

.topbar-brand {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.topbar-brand small {
  display: block;
  font-size: 0.72rem;
  opacity: 0.85;
  font-weight: 400;
}

.topbar-user {
  font-size: 0.85rem;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.topbar-user a { color: var(--white); opacity: 0.9; }

.topbar-menu {
  position: relative;
}

.topbar-menu-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: var(--white);
  border-radius: 6px;
  padding: 0.25rem 0.55rem;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
}

.topbar-menu:hover .topbar-menu-panel,
.topbar-menu:focus-within .topbar-menu-panel {
  display: block;
}

.topbar-menu-panel {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 100;
  overflow: hidden;
}

.topbar-menu-panel a {
  display: block;
  padding: 0.55rem 0.85rem;
  color: var(--green-dark) !important;
  opacity: 1 !important;
  font-size: 0.8125rem;
  text-decoration: none;
}

.topbar-menu-panel a:hover {
  background: #eef3e6;
  text-decoration: none;
}

.topbar-menu-panel a.active {
  background: #eef3e6;
  font-weight: 500;
}

.badge.role-user { background: #eef3e6; color: var(--green-dark); }
.badge.role-admin { background: #e3f2fd; color: var(--info); }
.badge.role-vorg { background: #fff8e1; color: #8a6d00; }

.badge.approval-offen { background: #f5f5f5; color: var(--gray); }
.badge.approval-angefragt { background: #e3f2fd; color: var(--info); }
.badge.approval-besprochen_antwort_ausstehend { background: #fff8e1; color: #8a6d00; }
.badge.approval-email_gesendet_antwort_ausstehend { background: #fff3e0; color: var(--warning); }
.badge.approval-genehmigt { background: #e8f5e9; color: var(--success); }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem;
}

.container:has(.termine-edit-page) {
  max-width: 1320px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.filters a {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.8125rem;
  text-decoration: none;
}

.filters a.active,
.filters a:hover {
  background: var(--green-light);
  border-color: var(--green-light);
  color: var(--green-dark);
}

.view-toggle a {
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.8125rem;
  text-decoration: none;
  color: var(--text-muted);
}

.view-toggle a.active {
  background: var(--green-dark);
  color: var(--white);
  border-color: var(--green-dark);
}

.btn {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  border: none;
  font-size: 0.8125rem;
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
  background: var(--green-dark);
  color: var(--white);
}

.btn:hover { background: #3d521c; text-decoration: none; color: var(--white); }
.btn-secondary { background: var(--surface); color: var(--green-dark); border: 1px solid var(--border); }
.btn-secondary:hover { background: #eef2e8; color: var(--green-dark); }
.btn-sm { padding: 0.25rem 0.55rem; font-size: 0.75rem; }
.btn-warning { background: var(--warning); }
.btn-danger { background: var(--danger); }

.btn-save-action {
  background: var(--green-dark);
  color: var(--white);
  border: 1px solid #3d521c;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(61, 82, 28, 0.25);
}

.btn-save-action:hover {
  background: #3d521c;
  color: var(--white);
}

.tasks-closed-details {
  margin-top: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8f9f6;
  overflow: hidden;
}

.tasks-closed-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--green-dark);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.tasks-closed-summary::-webkit-details-marker { display: none; }

.tasks-closed-summary::before {
  content: '▸';
  font-size: 0.75rem;
  transition: transform 0.15s ease;
}

.tasks-closed-details[open] > .tasks-closed-summary::before {
  transform: rotate(90deg);
}

.tasks-closed-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #e8ede0;
  color: var(--green-dark);
  font-size: 0.7rem;
  font-weight: 700;
}

.tasks-closed-wrap {
  margin: 0;
  padding: 0 0.5rem 0.65rem;
  border-top: 1px solid var(--border);
  background: var(--white);
}

.tasks-closed-wrap .list {
  margin-top: 0.35rem;
}

/* —— Knowledge Base —— */
.kb-page-title {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--green-dark);
  margin-bottom: 0.35rem;
}

.kb-page-lead {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.55;
}

.kb-article-meta {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
}

.kb-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.kb-card {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.kb-card:hover {
  text-decoration: none;
  border-color: var(--green-light);
  box-shadow: 0 4px 14px rgba(82, 110, 38, 0.12);
}

.kb-card-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--green-dark);
  margin: 0 0 0.4rem;
}

.kb-card-summary {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0 0 0.65rem;
  line-height: 1.45;
}

.kb-card-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin: 0;
}

.kb-topbar {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.8125rem;
}

.kb-topbar-back { font-weight: 500; }
.kb-topbar-muted { color: var(--text-muted); }

.kb-article-header { margin-bottom: 1rem; }

.kb-article {
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.25rem;
}

.kb-toc {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 0.9rem;
  margin-bottom: 1.25rem;
  background: #f8faf5;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.8125rem;
}

.kb-toc a {
  color: var(--green-dark);
  text-decoration: none;
}

.kb-toc a:hover { text-decoration: underline; }

.kb-section {
  margin-bottom: 1.35rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eef2e8;
}

.kb-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.kb-section h2 {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--green-dark);
  margin: 0 0 0.6rem;
}

.kb-section h3 {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  margin: 0.75rem 0 0.4rem;
}

.kb-section p,
.kb-section li {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.kb-section ul,
.kb-section ol {
  margin: 0.4rem 0 0.65rem 1.2rem;
}

.kb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  margin: 0.5rem 0 0.75rem;
}

.kb-table th,
.kb-table td {
  border: 1px solid var(--border);
  padding: 0.45rem 0.6rem;
  text-align: left;
}

.kb-table th {
  background: #eef3e6;
  color: var(--green-dark);
  font-weight: 500;
}

.kb-article pre {
  background: #1e2a1e;
  color: #e8f0e3;
  padding: 0.75rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.78rem;
  line-height: 1.45;
  margin: 0.5rem 0 0.75rem;
}

.kb-box {
  background: #f0f5ea;
  border-left: 3px solid var(--green-dark);
  padding: 0.65rem 0.85rem;
  margin: 0.65rem 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  border-radius: 0 6px 6px 0;
}

.kb-box-warn {
  background: #fff8e6;
  border-left-color: #c9a227;
}

.kb-checklist {
  list-style: none;
  padding-left: 0;
  margin: 0.5rem 0;
}

.kb-checklist li {
  padding: 0.2rem 0 0.2rem 1.35rem;
  position: relative;
}

.kb-checklist li::before {
  content: '☐';
  position: absolute;
  left: 0;
  color: var(--green-dark);
}

.kb-muted {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.kb-footer-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

.kb-related {
  margin-top: 1rem;
}

.kb-related-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--green-dark);
  margin-bottom: 0.5rem;
}

.kb-related-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.8125rem;
}

.kb-related-list li { margin-bottom: 0.3rem; }

.kb-index-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.kb-index-back {
  margin: 0;
  font-size: 0.8125rem;
}

.kb-index-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.kb-list-table .kb-list-summary {
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

.kb-list-edit {
  white-space: nowrap;
  width: 1%;
}

.kb-topbar-edit {
  margin-left: auto;
}

.kb-edit-form {
  padding: 1.15rem 1.25rem;
  margin-bottom: 1rem;
}

.kb-edit-textarea {
  width: 100%;
  font-family: Consolas, "Cascadia Code", monospace;
  font-size: 0.78rem;
  line-height: 1.45;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  resize: vertical;
  min-height: 320px;
}

.kb-delete-form {
  margin-top: 0.5rem;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  line-height: 1.4;
}

.flash {
  padding: 0.65rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.flash-ok { background: #e8f5e9; color: var(--success); border: 1px solid #c8e6c9; }
.flash-err { background: #ffebee; color: var(--danger); border: 1px solid #ffcdd2; }
.flash-warn { background: #fff8e1; color: #8a6d00; border: 1px solid #ffe082; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  margin-bottom: 1rem;
}

table.list {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  font-size: 0.8125rem;
}

table.list th,
table.list td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

table.list th {
  background: #eef3e6;
  color: var(--green-dark);
  font-weight: 500;
  font-size: 0.75rem;
}

table.list tr:hover td { background: #fafcf7; }

#tasksList,
#tasksClosedList {
  table-layout: fixed;
  width: 100%;
}

#tasksList .th-ticket-search,
#tasksClosedList th:first-child {
  width: 52%;
}

#tasksList .list-status-cell,
#tasksClosedList .list-status-cell {
  width: 4.75rem;
}

#tasksList .list-priority-cell,
#tasksClosedList .list-priority-cell {
  width: 4.25rem;
  white-space: nowrap;
}

#tasksList .list-assignee-cell,
#tasksClosedList .list-assignee-cell {
  width: 4.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#tasksList .freigabe-col,
#tasksClosedList .freigabe-col {
  width: 2.5rem;
}

#tasksList .list-actions-cell,
#tasksClosedList .list-actions-cell {
  width: 8.25rem;
  white-space: nowrap;
}

#tasksList thead th:nth-child(2) { width: 4.75rem; }
#tasksList thead th:nth-child(3) { width: 4.25rem; }
#tasksList thead th:nth-child(4) { width: 4.75rem; }
#tasksClosedList thead th:nth-child(2) { width: 4.75rem; }
#tasksClosedList thead th:nth-child(3) { width: 4.25rem; }
#tasksClosedList thead th:nth-child(4) { width: 4.75rem; }
#tasksList thead th:nth-child(5),
#tasksClosedList thead th:nth-child(5) {
  width: 2.75rem;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
  text-align: center;
}

#tasksList thead th:nth-child(6),
#tasksClosedList thead th:nth-child(6) {
  width: 8.25rem;
}

#tasksList .task-row td:first-child,
#tasksClosedList .task-row td:first-child {
  word-break: break-word;
  overflow-wrap: break-word;
}

#tasksList .task-row td,
#tasksClosedList .task-row td {
  vertical-align: middle;
}

.list-status-cell {
  white-space: nowrap;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.list-status-form {
  margin: 0;
}

.list-status-select {
  width: 100%;
  max-width: 4.5rem;
  font-size: 0.65rem;
  line-height: 1.2;
  padding: 0.16rem 0.25rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--green-dark);
  cursor: pointer;
}

.list-status-select:hover,
.list-status-select:focus {
  border-color: var(--green-dark);
  outline: none;
  box-shadow: 0 0 0 2px rgba(82, 110, 38, 0.12);
}

#tasksList .list-row-actions,
#tasksClosedList .list-row-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.2rem;
}

#tasksList .list-assign-form,
#tasksClosedList .list-assign-form {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.2rem;
  margin: 0;
  min-width: 0;
}

#tasksList .list-assign-select,
#tasksClosedList .list-assign-select {
  width: 4.5rem;
  max-width: 4.5rem;
  font-size: 0.65rem;
  padding: 0.14rem 0.2rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
}

#tasksList .list-details-btn,
#tasksClosedList .list-details-btn {
  flex-shrink: 0;
  padding: 0.18rem 0.35rem;
  font-size: 0.68rem;
  white-space: nowrap;
}

.notes-filter-row th {
  background: #fafcf7;
  padding-top: 0.35rem;
  padding-bottom: 0.5rem;
  vertical-align: top;
}

.notes-search-empty {
  margin-top: 0.75rem;
}

.th-ticket-search {
  white-space: nowrap;
}

.th-ticket-search-inner {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  min-width: 0;
}

.list-th-label {
  flex-shrink: 0;
}

.list-inline-search,
.notes-search-input {
  min-width: 0;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text, inherit);
  background: var(--white, #fff);
}

.list-inline-search {
  flex: 1;
  min-width: 4.5rem;
  max-width: 12rem;
}

.notes-search-input {
  width: 100%;
  max-width: 280px;
}

.list-inline-search:focus,
.notes-search-input:focus {
  outline: none;
  border-color: var(--green-dark);
  box-shadow: 0 0 0 2px rgba(82, 110, 38, 0.15);
}

.tasks-search-empty {
  margin-top: 0.75rem;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
}

.status-offen { background: #e3f2fd; color: var(--info); }
.status-in_bearbeitung { background: #fff3e0; color: var(--warning); }
.status-warten { background: #ffe0b2; color: #e65100; }
.status-geschlossen { background: #e8f5e9; color: var(--success); }

.priority-niedrig { background: #f5f5f5; color: var(--gray); }
.priority-normal { background: #eef3e6; color: var(--green-dark); }
.priority-hoch { background: #fff8e1; color: #f9a825; }
.priority-kritisch { background: #ffebee; color: var(--danger); }

.approval.ok {
  color: var(--success);
  font-size: 1.1rem;
  font-weight: 700;
}

.approval.pending {
  color: var(--gray-light);
  font-size: 1rem;
}

.approval.na {
  color: #ccc;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  align-items: start;
}

@media (max-width: 960px) {
  .kanban { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .kanban { grid-template-columns: 1fr; }
}

.kanban-col {
  background: #eef3e6;
  border-radius: var(--radius);
  padding: 0.65rem;
  min-height: 120px;
}

.kanban-col h3 {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--green-dark);
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
}

.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem;
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
}

.kanban-card .title { font-weight: 500; margin-bottom: 0.35rem; }
.kanban-card .meta { color: var(--text-muted); font-size: 0.72rem; }

.form-group { margin-bottom: 0.85rem; }
.form-group label {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.875rem;
  font-family: inherit;
}

.form-group-check label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: auto;
  margin-bottom: 0;
  cursor: pointer;
  color: var(--text);
}

.form-group-check input[type="checkbox"] {
  width: auto;
  margin: 0;
  flex-shrink: 0;
}

.form-group textarea { min-height: 100px; resize: vertical; }

.label-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
}

.label-row label {
  margin-bottom: 0;
  flex: 1;
}

.desc-image-hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px dashed var(--border);
  background: #fafcf7;
}

.desc-image-hint.is-ready {
  border-color: #a5d6a7;
  background: #f1f8e9;
  color: #2e7d32;
}

.desc-image-hint img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.desc-image-hint kbd {
  font-size: 0.7rem;
  padding: 0.05rem 0.25rem;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: #fff;
}

.image-paste-help {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin: 0 0 0.35rem;
}

.comment-body .desc-img {
  margin: 0.5rem 0 0;
}

.comment-body .desc-img img {
  max-width: 100%;
  max-height: 280px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.description-body {
  white-space: normal;
  line-height: 1.5;
}

.description-body b,
.comment-body b {
  font-weight: 700;
}

.desc-format-toolbar {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.35rem;
}

.desc-format-btn {
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface, #fff);
  color: var(--text, inherit);
  font-size: 0.9375rem;
  line-height: 1;
  cursor: pointer;
}

.desc-format-btn:hover {
  border-color: var(--green-dark);
  background: #fafcf7;
}

.desc-format-btn:active {
  transform: translateY(1px);
}

.image-paste-textarea {
  margin-top: 0;
}

.desc-img {
  margin: 0.65rem 0;
}

.desc-img img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.text-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.8125rem;
  color: var(--green-dark);
  text-decoration: underline;
  cursor: pointer;
}

.text-link:hover {
  color: var(--green);
}

.task-note-copy-block {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.task-note-copy-block form {
  margin: 0;
}

.note-ticket-create {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #eef3e6, #f4f6f0);
}

.login-box {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.login-box h1 {
  font-size: 1.1rem;
  color: var(--green-dark);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.login-box p.sub {
  color: var(--text-muted);
  font-size: 0.8125rem;
  margin-bottom: 1rem;
}

.comments { margin-top: 0; }

.task-title {
  font-size: 1rem;
  color: var(--green-dark);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.task-description-block {
  margin-bottom: 0;
}

.task-description-block .description-body {
  margin: 0;
}

.task-link-line {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
}

.task-section-divider {
  margin: 1.75rem 0 1.35rem;
  height: 1px;
  border: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--border) 12%,
    var(--green-light) 50%,
    var(--border) 88%,
    transparent 100%
  );
}

.comments-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.comments-heading {
  font-size: 0.9rem;
  color: var(--green-dark);
  font-weight: 500;
  letter-spacing: 0.08em;
  margin: 0;
  padding-bottom: 0.15rem;
}

.comment-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.comment-meta {
  min-width: 0;
}

.comment-delete-form {
  margin: 0;
  flex-shrink: 0;
}

.comment-delete-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.15rem;
  border-radius: 4px;
}

.comment-delete-btn:hover {
  color: var(--danger);
  background: #ffebee;
}

.comment-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.comment {
  border-left: 3px solid var(--green-light);
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.75rem;
  background: #fafcf7;
  font-size: 0.8125rem;
}

.comment .who { font-weight: 500; color: var(--green-dark); }
.comment .when { color: var(--text-muted); font-size: 0.72rem; }

.task-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.task-topbar-back {
  color: var(--green-dark);
  text-decoration: none;
  white-space: nowrap;
}

.task-topbar-back:hover {
  text-decoration: underline;
}

.task-pager {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
}

.task-pager a {
  color: var(--green-dark);
  text-decoration: none;
}

.task-pager a:hover {
  text-decoration: underline;
}

.task-pager-count {
  color: var(--text-muted);
  min-width: 3.5rem;
  text-align: center;
}

.task-pager-disabled {
  color: #ccc;
  user-select: none;
}

.note-pager a {
  color: #888;
}

.note-pager a:hover {
  color: #555;
  text-decoration: underline;
}

.detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
}

.detail-sidebar .sidebar-edit-top {
  margin-bottom: 0.85rem;
}

.detail-sidebar .sidebar-edit-top .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-align: center;
}

.detail-sidebar .sidebar-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.detail-sidebar .sidebar-quick {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.detail-sidebar .sidebar-heading {
  font-size: 0.85rem;
  color: var(--green-dark);
  font-weight: 500;
  margin-bottom: 0.15rem;
}

.detail-sidebar .sidebar-row {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
}

.detail-sidebar .sidebar-row select,
.detail-sidebar .sidebar-wait-input {
  flex: 1;
  min-width: 0;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.8125rem;
}

.detail-sidebar .sidebar-row .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.detail-sidebar .sidebar-bottom-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.detail-sidebar .sidebar-delete-form {
  margin: 0;
}

.detail-sidebar .sidebar-row-btns {
  gap: 0.35rem;
}

.detail-sidebar .sidebar-row-btns form {
  flex: 1;
  margin: 0;
}

.detail-sidebar .sidebar-row-btns .btn {
  flex: 1;
  width: 100%;
  text-align: center;
}

.detail-sidebar .sidebar-row-btns > a.btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-sidebar .sidebar-status-form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
}

.detail-sidebar .sidebar-actions {
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
}

.detail-sidebar .sidebar-actions form,
.detail-sidebar .sidebar-actions .btn-block {
  width: 100%;
}

.detail-sidebar .sidebar-form select {
  width: 100%;
  margin-bottom: 0;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.8125rem;
}

.btn-block {
  display: block;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}

.detail-sidebar .freigabe-box {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  background: #fafcf7;
}

.freigabe-report {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  font-size: 0.8125rem;
}

.freigabe-received-bar {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.45rem 0.75rem;
  margin: 0 0 0.65rem;
  border-radius: 6px;
  background: var(--green-dark);
  color: var(--white);
  font-weight: 500;
  font-size: 0.8125rem;
  text-align: center;
}

.freigabe-report-title {
  font-weight: 500;
  color: var(--success);
  margin-bottom: 0.5rem;
}

.freigabe-report-list {
  margin: 0;
  font-size: 0.8125rem;
}

.freigabe-report-list dt {
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 0.35rem;
  font-size: 0.72rem;
}

.freigabe-report-list dd {
  margin: 0;
  color: var(--text);
}

.sidebar-freigabe-off {
  padding-top: 0.5rem;
  border-top: none;
}

.btn-link-style {
  background: transparent !important;
  color: var(--text-muted) !important;
  border: none !important;
  font-size: 0.75rem !important;
  font-weight: 400 !important;
  padding: 0.25rem !important;
}

.btn-link-style:hover {
  color: var(--green-dark) !important;
  background: transparent !important;
  text-decoration: underline;
}

@media (max-width: 768px) {
  .detail-grid { grid-template-columns: 1fr; }
}

.meta-list { font-size: 0.8125rem; color: var(--text-muted); }
.meta-list dt { font-weight: 500; color: var(--green-dark); margin-top: 0.5rem; }
.meta-list dd { margin-left: 0; }

.assignee-list {
  margin: 0;
  padding-left: 1.1rem;
}

.assignee-item-haupt {
  list-style: disc;
}

.assignee-haupt-details {
  display: block;
  width: 100%;
  margin-left: -1.1rem;
  padding-left: 1.1rem;
  box-sizing: border-box;
}

.assignee-haupt-details > summary.assignee-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  list-style: none;
}

.assignee-haupt-details > summary::-webkit-details-marker {
  display: none;
}

.assignee-haupt-details > summary::marker {
  content: '';
}

.assignee-label {
  flex: 1;
  min-width: 0;
}

.assignee-change-btn {
  flex-shrink: 0;
  cursor: pointer;
  line-height: 1.2;
}

.assignee-haupt-details > summary:hover .assignee-change-btn {
  background: #3d521c;
  color: var(--white);
}

.assignee-haupt-details[open] .assignee-change-btn {
  background: #3d521c;
  color: var(--white);
}

.haupt-change-form {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.haupt-change-form select {
  flex: 1;
  min-width: 0;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.8125rem;
}

.meta-list dd.review-due {
  display: inline-block;
  margin-top: 0.15rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: #b45309;
  font-weight: 500;
  animation: review-blink 1.2s ease-in-out infinite;
}

@keyframes review-blink {
  0%, 100% { background-color: #fff8e1; }
  50% { background-color: #ffecb3; }
}

.empty { color: var(--text-muted); font-size: 0.875rem; padding: 1rem; text-align: center; }

.filters a.filter-freigabe { border-color: #ffcdd2; }
.filters a.filter-freigabe.active,
.filters a.filter-freigabe:hover { background: #ffebee; border-color: #ef5350; color: #c62828; }

.filters a.filter-mine { border-color: #bbdefb; }
.filters a.filter-mine.active,
.filters a.filter-mine:hover { background: #e3f2fd; border-color: #42a5f5; color: #1565c0; }

.freigabe-col { text-align: center; width: 2.5rem; }

button.freigabe-cell {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  font-family: inherit;
}

button.freigabe-cell:hover { background: #eef3e6; }
button.freigabe-cell.na { color: #ccc; font-size: 0.95rem; }
button.freigabe-cell.pending { color: var(--danger); font-weight: 700; }
button.freigabe-cell.ok { color: var(--success); font-weight: 700; }

.approval.pending { color: var(--danger); }

.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal[hidden] { display: none !important; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.35); }
.modal-panel { position: relative; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; margin: 0; z-index: 1; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.25rem; }
.modal-close { border: none; background: transparent; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--text-muted); padding: 0 0.25rem; }
body.modal-open { overflow: hidden; }

/* —— Termine / Meeting Tracking —— */
.topbar-user a.active {
  opacity: 1;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.termine-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem 1.15rem;
  background: linear-gradient(135deg, #eef3e6 0%, #f8faf5 55%, #fff 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-left: 4px solid var(--green-dark);
}

.termine-title {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--green-dark);
  margin-bottom: 0.25rem;
}

.termine-subtitle {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.termine-filters { margin-bottom: 1rem; }

.termine-section-head {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--green-dark);
  margin-bottom: 0.75rem;
}

.termine-followups-card { margin-bottom: 1rem; }

.termine-followup-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.termine-followup-item {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fafcf7;
  text-decoration: none;
  color: inherit;
}

.termine-followup-item:hover {
  background: #eef3e6;
  border-color: var(--green-light);
  text-decoration: none;
}

.termine-followup-theme {
  display: block;
  font-weight: 500;
  color: var(--green-dark);
  font-size: 0.875rem;
}

.termine-followup-meta {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.termine-status-geplant { background: #e3f2fd; color: var(--info); }
.termine-status-laufend { background: #fff3e0; color: var(--warning); }
.termine-status-abgeschlossen { background: #e8f5e9; color: var(--success); }

.termine-topic-badge-offen { background: #f5f5f5; color: var(--gray); }
.termine-topic-badge-besprochen { background: #e8f5e9; color: var(--success); }
.termine-topic-badge-verschoben { background: #fff8e1; color: #8a6d00; }

.termine-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.form-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.termine-form-card { max-width: 720px; }

.termine-topbar-actions { margin-left: auto; }

.termine-edit-header { margin-bottom: 0.75rem; }

.termine-edit-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.termine-compact-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
}

.termine-compact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  flex: 1;
  min-width: 0;
}

.termine-compact-list li {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.8125rem;
  min-width: 0;
  max-width: 220px;
}

.termine-compact-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.termine-compact-muted {
  font-weight: 500;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

.termine-compact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex-shrink: 0;
}

.modal-panel-wide { max-width: 560px; }

@media (max-width: 640px) {
  .termine-compact-list li { max-width: 100%; }
  .termine-compact-muted { max-width: 100%; white-space: normal; }
  .termine-compact-actions { width: 100%; }
  .termine-compact-actions .btn { flex: 1; }
}

/* Edit page: Agenda volle Breite */
.termine-edit-page {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.termine-top-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

@media (max-width: 900px) {
  .termine-top-grid { grid-template-columns: 1fr; }
}

.termine-main-full {
  width: 100%;
  min-width: 0;
}

.termine-layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 960px) {
  .termine-layout { grid-template-columns: 1fr; }
}

.termine-main { min-width: 0; }

.termine-agenda-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 1.15rem 1.25rem 1.25rem;
}

.termine-agenda-panel-head {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.termine-agenda-panel-head .termine-section-head {
  margin-bottom: 0.2rem;
}

.termine-agenda-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}

.termine-add-bar {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1rem 1.1rem;
  margin-bottom: 0;
  background: linear-gradient(135deg, #eef3e6 0%, #f8faf5 100%);
  border: 2px dashed var(--green-light);
  border-radius: 12px;
}

.termine-add-bar-bottom {
  margin-top: 1.25rem;
}

.termine-add-bar-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--green-dark);
}

.termine-add-bar-row {
  display: flex;
  align-items: stretch;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.termine-add-bar-icon {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--green-dark);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.termine-add-bar .termine-add-topic-input {
  flex: 1;
  min-width: min(100%, 280px);
  padding: 0.7rem 0.9rem;
  border: 1px solid #c5d4b0;
  border-radius: 10px;
  font-size: 0.95rem;
  background: var(--white);
  box-shadow: inset 0 1px 2px rgba(82, 110, 38, 0.06);
}

.termine-add-bar .termine-add-topic-input:focus {
  outline: none;
  border-color: var(--green-dark);
  box-shadow: 0 0 0 3px rgba(82, 110, 38, 0.14);
}

.termine-add-bar-row .btn {
  padding: 0.65rem 1.15rem;
  font-size: 0.875rem;
  align-self: stretch;
  white-space: nowrap;
}

.termine-agenda-empty {
  padding: 2rem 1rem;
  text-align: center;
  background: #fafcf7;
  border-radius: 8px;
}

.termine-topic-list {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.termine-topic-card {
  background: #fafcf7;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  scroll-margin-top: 5rem;
  transition: box-shadow 0.2s;
}

.termine-topic-card:hover {
  box-shadow: 0 4px 14px rgba(82, 110, 38, 0.1);
}

.termine-topic-card.termine-topic-status-besprochen {
  border-color: #c5e1a5;
}

.termine-topic-card.termine-topic-status-verschoben {
  border-color: #ffe082;
}

.termine-topic-card.termine-topic-highlight {
  box-shadow: 0 0 0 3px rgba(160, 200, 96, 0.45);
}

.termine-topic-view {
  padding: 0.85rem 1rem 1rem;
}

.termine-topic-view-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.termine-topic-view-head .termine-topic-num {
  background: var(--green-dark);
  border-color: var(--green-dark);
  color: var(--white);
  width: 1.75rem;
  height: 1.75rem;
  font-size: 0.8rem;
}

.termine-topic-view-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--green-dark);
}

.termine-topic-read-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

@media (max-width: 900px) {
  .termine-topic-read-grid { grid-template-columns: 1fr; }
}

.termine-read-cell {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  min-height: 4rem;
}

.termine-read-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.termine-read-body {
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.termine-empty-field {
  color: var(--text-muted);
}

.termine-topic-read-meta {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.termine-topic-read-meta li span {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-right: 0.35rem;
}

.termine-topic-empty-hint {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-style: italic;
}

.termine-topic-view-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.modal-panel-topic {
  max-width: 920px;
  max-height: 92vh;
}

.termine-modal-subtitle {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0 0 0.85rem;
}

.termine-topic-meta-modal {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.termine-modal-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.termine-topic-form { margin: 0; }

.termine-topic-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, var(--green-dark), #6b8f32);
  color: var(--white);
}

.termine-topic-num {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.45);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.termine-topic-title-wrap {
  flex: 1;
  min-width: 0;
}

.termine-topic-title-input {
  width: 100%;
  padding: 0.45rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--green-dark);
  font-weight: 600;
  font-size: 0.95rem;
  font-family: inherit;
}

.termine-topic-title-input:focus {
  outline: none;
  border-color: var(--white);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.termine-topic-header .badge {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.92) !important;
  color: var(--green-dark) !important;
  font-size: 0.68rem;
  padding: 0.2rem 0.55rem;
}

.termine-protocol-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-bottom: 1px solid var(--border);
}

.termine-protocol-cell {
  padding: 1rem 1.15rem;
  border-right: none;
  border-bottom: 1px solid var(--border);
  min-height: auto;
}

.termine-protocol-cell:last-child {
  border-bottom: none;
}

.termine-protocol-discussed { background: #f8faf5; }
.termine-protocol-decision { background: #f1f8e9; }
.termine-protocol-followup { background: #fffef5; }

.termine-protocol-cell-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--green-dark);
}

.termine-protocol-icon {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.termine-protocol-discussed .termine-protocol-icon { background: #e3f2fd; }
.termine-protocol-decision .termine-protocol-icon { background: #e8f5e9; }
.termine-protocol-followup .termine-protocol-icon { background: #fff8e1; }

.termine-protocol-cell textarea,
.termine-field {
  display: block;
  width: 100%;
  min-height: 7.5rem;
  border: 1px solid #c5d4b0;
  background: var(--white);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  font-size: 0.9rem;
  line-height: 1.55;
  resize: vertical;
  font-family: inherit;
  color: var(--text);
  box-shadow: inset 0 1px 2px rgba(82, 110, 38, 0.05);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.termine-protocol-cell textarea:hover,
.termine-field:hover {
  border-color: #a8bf8a;
}

.termine-protocol-cell textarea:focus,
.termine-field:focus {
  outline: none;
  border-color: var(--green-dark);
  box-shadow: 0 0 0 3px rgba(82, 110, 38, 0.12);
}

.termine-topic-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--white);
}

.termine-topic-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  flex: 1;
  min-width: 200px;
}

.termine-meta-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 130px;
}

.termine-meta-field label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.termine-meta-field input,
.termine-meta-field select {
  padding: 0.45rem 0.6rem;
  border: 1px solid #c5d4b0;
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: inherit;
  background: var(--white);
  width: 100%;
  min-width: 140px;
}

.termine-meta-field input:focus,
.termine-meta-field select:focus {
  outline: none;
  border-color: var(--green-dark);
  background: var(--white);
}

.termine-topic-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.termine-topic-actions .termine-delete-btn {
  background: transparent;
  color: var(--danger);
  border: 1px solid #ffcdd2;
}

.termine-topic-actions .termine-delete-btn:hover {
  background: #ffebee;
  color: var(--danger);
}

.termine-topic-delete-form {
  display: none;
}

.termine-danger-zone {
  margin-top: 0.5rem;
  padding: 1.15rem 1.25rem;
  border: 1px solid #ffcdd2;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff8f8, #fff);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.termine-danger-hint {
  margin: 0;
  font-size: 0.8125rem;
  color: #8d4a4a;
  max-width: 42rem;
  line-height: 1.45;
}

.termine-delete-meeting-form {
  margin: 0;
  flex-shrink: 0;
}

.termine-delete-meeting-form .btn-danger {
  padding: 0.55rem 1.1rem;
  font-size: 0.875rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.termine-meta-card .form-group { margin-bottom: 0.65rem; }

.termine-prep-others-head {
  font-size: 0.8rem;
  color: var(--green-dark);
  margin: 1rem 0 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.termine-prep-other {
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.8125rem;
}

.termine-prep-other:last-child { border-bottom: none; }

.termine-prep-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-left: 0.35rem;
}

.termine-prep-body {
  margin-top: 0.35rem;
  color: var(--text);
  line-height: 1.45;
}

/* Presentation mode */
.termine-present-body {
  background: var(--bg);
  min-height: 100vh;
}

.termine-present-top {
  background: linear-gradient(135deg, var(--green-dark), #6b8f32);
  color: var(--white);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.termine-present-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.85;
}

.termine-present-top h1 {
  font-size: 1.5rem;
  font-weight: 500;
  margin: 0.25rem 0;
}

.termine-present-top p {
  font-size: 0.9rem;
  opacity: 0.9;
}

.termine-present-nav {
  display: flex;
  gap: 0.5rem;
}

.termine-present-summary {
  max-width: 1100px;
  margin: 1rem auto;
  padding: 0 1.25rem;
}

.termine-present-summary h2 {
  font-size: 0.85rem;
  color: var(--green-dark);
  margin-bottom: 0.35rem;
}

.termine-present-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.termine-present-topic {
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.termine-present-topic.is-done {
  border-left: 5px solid var(--success);
}

.termine-present-topic-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  background: #eef3e6;
  border-bottom: 1px solid var(--border);
}

.termine-present-num {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--green-dark);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
}

.termine-present-topic-head h2 {
  flex: 1;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--green-dark);
  margin: 0;
}

.termine-present-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}

@media (max-width: 900px) {
  .termine-present-grid { grid-template-columns: 1fr; }
}

.termine-present-cell {
  padding: 1rem 1.15rem;
  border-right: 1px solid var(--border);
}

.termine-present-cell:last-child { border-right: none; }

.termine-present-cell h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--green-dark);
  margin-bottom: 0.5rem;
}

.termine-present-content {
  font-size: 0.95rem;
  line-height: 1.55;
  min-height: 3rem;
}

.termine-present-cell.discussed { background: #fafcf7; }
.termine-present-cell.decision { background: #f1f8e9; }
.termine-present-cell.followup { background: #fffef5; }

.termine-present-dates {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.termine-present-content .muted {
  color: var(--text-muted);
  font-style: italic;
}

/* App footer */
.app-footer {
  text-align: center;
  padding: 1.25rem 1rem 1.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  background: #fafcf7;
}

.app-footer-link {
  color: var(--green-dark);
  font-weight: 500;
  text-decoration: none;
}

.app-footer-link:hover {
  text-decoration: underline;
}

.app-footer-muted {
  color: var(--text-muted);
}

.app-footer-badge {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #fff3e0;
  color: var(--warning);
  font-size: 0.7rem;
  font-weight: 600;
}

/* Feedback admin */
.feedback-admin-card { margin-top: 1.25rem; max-width: 900px; }

.feedback-admin-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.feedback-filters { margin: 0; }

.feedback-admin-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.feedback-admin-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem;
  background: #fafcf7;
  scroll-margin-top: 5rem;
}

.feedback-admin-item-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.feedback-admin-meta {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 0.2rem;
}

.feedback-admin-body {
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 0.65rem;
  white-space: pre-wrap;
}

.feedback-admin-note {
  font-size: 0.8125rem;
  padding: 0.55rem 0.65rem;
  background: #eef3e6;
  border-radius: 6px;
  margin-bottom: 0.65rem;
  color: var(--green-dark);
}

.feedback-admin-form-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 0.75rem;
  align-items: end;
}

@media (max-width: 700px) {
  .feedback-admin-form-row { grid-template-columns: 1fr; }
}

.feedback-status-offen { background: #ffebee; color: var(--danger); }
.feedback-status-in_bearbeitung { background: #fff8e1; color: #8a6d00; }
.feedback-status-geschlossen { background: #e8f5e9; color: var(--success); }

.feedback-compact-wrap {
  overflow-x: auto;
  margin-top: 0.5rem;
}

.feedback-compact-table {
  width: 100%;
  font-size: 0.8125rem;
}

.feedback-compact-table th {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  white-space: nowrap;
}

.feedback-compact-row {
  scroll-margin-top: 5rem;
}

.feedback-compact-row.feedback-row-highlight {
  background: #eef3e6;
}

.feedback-compact-id {
  color: var(--text-muted);
  white-space: nowrap;
  width: 2.5rem;
}

.feedback-compact-subject {
  min-width: 12rem;
  max-width: 22rem;
}

.feedback-compact-subject strong {
  display: block;
  color: var(--green-dark);
}

.feedback-compact-preview {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.15rem;
}

.feedback-compact-date {
  white-space: nowrap;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.feedback-compact-page {
  max-width: 10rem;
}

.feedback-page-link {
  color: var(--green-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  max-width: 10rem;
}

.feedback-page-link:hover {
  color: #3d5218;
}

.feedback-compact-actions {
  white-space: nowrap;
  text-align: right;
}

.feedback-modal-subject {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  color: var(--green-dark);
}

.feedback-modal-meta {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.feedback-modal-meta a {
  color: var(--green-dark);
  font-weight: 600;
}

.feedback-modal-body {
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 1rem;
  padding: 0.65rem 0.75rem;
  background: #fafcf7;
  border: 1px solid var(--border);
  border-radius: 8px;
  white-space: pre-wrap;
}

@media (max-width: 900px) {
  .feedback-compact-table thead { display: none; }
  .feedback-compact-row {
    display: block;
    border-bottom: 1px solid var(--border);
    padding: 0.65rem 0;
  }
  .feedback-compact-row td {
    display: block;
    border: none;
    padding: 0.15rem 0;
  }
  .feedback-compact-actions { text-align: left; margin-top: 0.35rem; }
}

.feedback-closed-details {
  margin-top: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8f9f6;
  overflow: hidden;
}

.feedback-closed-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--green-dark);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.feedback-closed-summary::-webkit-details-marker { display: none; }

.feedback-closed-summary::before {
  content: '▸';
  font-size: 0.75rem;
  transition: transform 0.15s ease;
}

.feedback-closed-details[open] > .feedback-closed-summary::before {
  transform: rotate(90deg);
}

.feedback-closed-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #e8ede0;
  color: var(--green-dark);
  font-size: 0.7rem;
  font-weight: 700;
}

.feedback-closed-wrap {
  margin: 0;
  padding: 0 0.5rem 0.65rem;
  border-top: 1px solid var(--border);
  background: var(--white);
}

.feedback-closed-wrap .feedback-compact-table {
  margin-top: 0.35rem;
}

.protocol-table .protocol-date,
.protocol-table .protocol-ip {
  white-space: nowrap;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.protocol-table .protocol-details {
  max-width: 28rem;
  word-break: break-word;
}

.badge.protocol-action-login,
.badge.protocol-action-logout { background: #e3f2fd; color: #1565c0; }
.badge.protocol-action-login_failed { background: #ffebee; color: #c62828; }
.badge.protocol-action-password_change { background: #fff3e0; color: #e65100; }
.badge.protocol-action-user_create,
.badge.protocol-action-user_update,
.badge.protocol-action-user_delete { background: #f3e5f5; color: #6a1b9a; }
.badge.protocol-action-ticket_create,
.badge.protocol-action-ticket_update,
.badge.protocol-action-ticket_delete { background: #e8f5e9; color: #2e7d32; }
.badge.protocol-action-backup_cron,
.badge.protocol-action-backup_auto { background: #eceff1; color: #455a64; }
