/* === teamgeist Design-System: Component Classes ===
   Reusable component styles built on Design Tokens
*/

/* === Wave 0.46/46.11: Global Focus-Visible Style ===
   Globaler Focus-Visible-Style mit Brand-Farbe.
   Nur fuer Tastatur-Navigation (nicht Maus-Klicks). */
*:focus-visible {
  outline: 2px solid var(--color-accent, #ce2128);
  outline-offset: 2px;
  border-radius: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline-offset: 1px;
}

/* Mausklicks sollen keinen Outline-Ring zeigen */
*:focus:not(:focus-visible) {
  outline: none;
}

/* === Button Component === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: all var(--transition-base);
  min-height: 44px;
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Button Variants */
.btn-primary {
  background: var(--color-accent);
  color: #ffffff;
  border-color: var(--color-accent);
  border-radius: var(--radius-md);
}
.btn-primary:hover:not(:disabled) {
  background: #b91b22;
  border-color: #b91b22;
  box-shadow: var(--shadow-md);
}
.btn-primary:active:not(:disabled) {
  background: #a01720;
  transform: scale(0.98);
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text-strong);
  border-color: var(--color-border);
  border-radius: var(--radius-md);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--color-surface-hover);
  border-color: var(--color-border-dark);
  box-shadow: var(--shadow-sm);
}

.btn-danger {
  background: var(--color-danger);
  color: #ffffff;
  border-color: var(--color-danger);
  border-radius: var(--radius-md);
}
.btn-danger:hover:not(:disabled) {
  background: #b91b22;
}

.btn-success {
  background: var(--color-success);
  color: #ffffff;
  border-color: var(--color-success);
  border-radius: var(--radius-md);
}
.btn-success:hover:not(:disabled) {
  background: #247a43;
}

.btn-ghost {
  background: transparent;
  color: var(--color-accent);
  border-color: var(--color-accent);
  border-radius: var(--radius-md);
}
.btn-ghost:hover:not(:disabled) {
  background: rgba(206, 33, 40, 0.08);
  border-color: var(--color-accent);
}

/* Button Sizes */
.btn-sm {
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--font-size-sm);
  min-height: 36px;
}

.btn-lg {
  padding: var(--space-md) var(--space-lg);
  font-size: var(--font-size-lg);
  min-height: 52px;
}

.btn-block {
  width: 100%;
}

/* === Input Component === */
.input,
.select,
textarea {
  display: block;
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  color: var(--color-text-strong);
  background: var(--color-bg);
  transition: all var(--transition-base);
  min-height: 44px;
}
.input::placeholder,
textarea::placeholder {
  color: var(--color-text-light);
}
.input:focus,
.select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(206, 33, 40, 0.1);
}
.input:disabled,
.select:disabled,
textarea:disabled {
  background: var(--color-surface);
  color: var(--color-text-disabled);
  cursor: not-allowed;
}

/* Input Error State */
.input-error,
.select-error,
textarea.error {
  border-color: var(--color-danger);
}

/* === Filter Card Component === */
/* Welle 0.45/45.4: Standard-Filter-Card fuer Listings */
.filter-card {
  background: var(--color-surface, #ffffff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.filter-card label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--color-text-muted, #94a3b8);
}

.filter-card select,
.filter-card input {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 4px;
  font-size: 0.9rem;
}

.filter-card .filter-actions {
  margin-left: auto;
  display: flex;
  gap: 0.5rem;
}

@media (max-width: 640px) {
  .filter-card {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-card .filter-actions {
    margin-left: 0;
  }
}
.input-error:focus,
.select-error:focus,
textarea.error:focus {
  box-shadow: 0 0 0 3px rgba(206, 33, 40, 0.1);
}

/* Input Wrapper with Label */
.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}
.input-group label {
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-strong);
  font-size: var(--font-size-sm);
}
.input-group .input-helper {
  font-size: var(--font-size-xs);
  color: var(--color-text-light);
}
.input-group .input-error-msg {
  font-size: var(--font-size-xs);
  color: var(--color-danger);
  font-weight: var(--font-weight-semibold);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

/* === Card Component === */
.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}
.card-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-strong);
  margin: 0;
}
.card-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
}
.card-content {
  flex: 1;
}
.card-footer {
  display: flex;
  gap: var(--space-md);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-border);
  margin-top: auto;
}

/* === Card dl (Definition-List-Grid) === */
.card dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.4rem 1rem;
  margin: 0;
}
.card dt {
  font-size: 0.85rem;
  color: var(--color-text-muted, #94a3b8);
  font-weight: 500;
  white-space: nowrap;
}
.card dd {
  margin: 0;
  color: var(--color-text, #575756);
}

/* === Modal Component === */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: var(--z-modal-overlay);
  animation: fadeIn var(--transition-base);
}
.modal-overlay.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  z-index: var(--z-modal);
  animation: slideUp var(--transition-base);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
}
.modal-title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-strong);
  margin: 0;
}
.modal-close {
  background: transparent;
  border: none;
  font-size: var(--font-size-xl);
  cursor: pointer;
  color: var(--color-text-light);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}
.modal-close:hover {
  background: var(--color-surface);
  color: var(--color-text-strong);
}

.modal-body {
  padding: var(--space-lg);
}

.modal-footer {
  display: flex;
  gap: var(--space-md);
  justify-content: flex-end;
  padding: var(--space-lg);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

/* === Toast/Notification Component === */
.toast-container {
  position: fixed;
  top: calc(var(--topbar-height) + var(--space-lg));
  right: var(--space-lg);
  z-index: var(--z-notification);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  max-width: 400px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  animation: slideInRight var(--transition-base);
}

.toast-success {
  border-left: 4px solid var(--color-success);
  background: var(--color-success-light);
}
.toast-success .toast-icon {
  color: var(--color-success);
}

.toast-error {
  border-left: 4px solid var(--color-danger);
  background: var(--color-error-light);
}
.toast-error .toast-icon {
  color: var(--color-danger);
}

.toast-warning {
  border-left: 4px solid var(--color-warning);
  background: var(--color-warning-light);
}
.toast-warning .toast-icon {
  color: var(--color-warning);
}

.toast-info {
  border-left: 4px solid var(--color-info);
  background: var(--color-info-light);
}
.toast-info .toast-icon {
  color: var(--color-info);
}

.toast-icon {
  flex-shrink: 0;
  font-size: var(--font-size-lg);
}

.toast-message {
  flex: 1;
  font-size: var(--font-size-base);
  color: var(--color-text-strong);
}

.toast-close {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: var(--color-text-light);
  cursor: pointer;
  padding: 0;
  font-size: var(--font-size-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.toast-close:hover {
  color: var(--color-text-strong);
}

/* === Badge Component === */
.badge {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--color-surface);
  color: var(--color-text-strong);
}

.badge-success {
  background: var(--color-success);
  color: #ffffff;
}

.badge-warning {
  background: var(--color-warning);
  color: #ffffff;
}

.badge-danger {
  background: var(--color-danger);
  color: #ffffff;
}

.badge-info {
  background: var(--color-info);
  color: #ffffff;
}

.badge-neutral {
  background: var(--color-surface);
  color: var(--color-text-strong);
}

/* === Backward-Compat Aliase (Welle 0.43/43.4) ===
   Mapping von alten Non-Semantischen Klassen zu neuen Semantischen Klassen.
   Wird spaeter durch Codemod (Welle 0.53) in Views geloescht. */
.badge-yellow {
  background: var(--color-warning);
  color: #ffffff;
}

.badge-green {
  background: var(--color-success);
  color: #ffffff;
}

.badge-gray,
.badge-light {
  background: var(--color-surface);
  color: var(--color-text-strong);
}

.badge-red {
  background: var(--color-danger);
  color: #ffffff;
}

.badge-orange {
  background: var(--color-warning);
  color: #ffffff;
}

/* === Loading Spinner === */
.loading-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-spinner-sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

.loading-spinner-lg {
  width: 40px;
  height: 40px;
  border-width: 4px;
}

/* === Empty State === */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: 32px 24px;
  text-align: center;
  min-height: 300px;
  border: 1px dashed var(--color-border);
  background: var(--color-bg-soft, var(--color-surface));
  border-radius: var(--radius-md);
}

.empty-state-icon {
  font-size: 48px;
  color: var(--color-text-light);
}

.empty-state-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-strong);
}

.empty-state-text {
  font-size: var(--font-size-base);
  color: var(--color-text-light);
  max-width: 400px;
}

.empty-state-action {
  margin-top: var(--space-md);
}

/* === Error State === */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-2xl) var(--space-lg);
  text-align: center;
  background: var(--color-error-light);
  border: 1px solid var(--color-danger);
  border-radius: var(--radius-lg);
  min-height: 200px;
}

.error-state-icon {
  font-size: 48px;
  color: var(--color-danger);
}

.error-state-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-danger);
}

.error-state-text {
  font-size: var(--font-size-base);
  color: var(--color-text-strong);
  max-width: 400px;
}

.error-state-details {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  color: var(--color-text);
  background: var(--color-bg);
  padding: var(--space-md);
  border-radius: var(--radius-sm);
  max-width: 500px;
  word-break: break-all;
  margin-top: var(--space-md);
}

/* === Animations === */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === Utilities === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Responsive Grid */
.grid {
  display: grid;
  gap: var(--space-md);
}
.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
  .grid-cols-2, .grid-cols-3, .grid-cols-4 {
    grid-template-columns: 1fr;
  }
}

/* === Sub-Sidebar (used by _layout/with-subnav.ejs and views/layout.js) === */
.sub-sidebar {
  width: 200px;
  flex-shrink: 0;
  background: var(--color-surface-2, #f8fafc);
  border-right: 1px solid var(--color-border, #e2e8f0);
  padding: 1rem 0;
}
.sb-group {
  margin-bottom: 1.5rem;
}
.sb-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted, #94a3b8);
  padding: 0 1rem 0.5rem;
  font-weight: 600;
}
.sb-link {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--color-text, #575756);
  text-decoration: none;
  font-size: 0.9rem;
  border-left: 3px solid transparent;
  transition: background var(--transition-base, 0.15s), color var(--transition-base, 0.15s);
}
.sb-link:hover {
  background: var(--color-surface-hover, #f1f5f9);
}
.sb-active {
  color: var(--color-accent, #ce2128);
  border-left-color: var(--color-accent, #ce2128);
  font-weight: 600;
}
@media (max-width: 900px) {
  .sub-sidebar {
    display: none;
  }
}

/* === Welle 0.44/44.9: Skip-Link fuer Tastatur-Navigation (WCAG 2.4.1) === */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-accent, #ce2128);
  color: white;
  padding: 0.5rem 1rem;
  text-decoration: none;
  z-index: 10000;
  border-radius: 0 0 4px 0;
  font-weight: 500;
  font-size: 0.9rem;
}
.skip-link:focus {
  top: 0;
  outline: 2px solid white;
  outline-offset: -2px;
}

/* === Welle 0.44/44.4: Page-Header-Komponente === */
.page-header {
  margin-bottom: 1.5rem;
}
.page-header-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}
.page-header-title h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
  color: var(--color-text, #575756);
}
.page-header-subtitle {
  font-size: 0.95rem;
  color: var(--color-text-muted, #94a3b8);
  margin: 0.25rem 0 0 0;
}
.page-header-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* === Breadcrumb-Komponente === */
.breadcrumb {
  margin-bottom: 0.5rem;
}
.breadcrumb ol {
  list-style: none;
  display: flex;
  gap: 0.5rem;
  padding: 0;
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-text-muted, #94a3b8);
}
.breadcrumb li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.breadcrumb a {
  color: inherit;
  text-decoration: none;
}
.breadcrumb a:hover {
  color: var(--color-text, #575756);
  text-decoration: underline;
}
.breadcrumb span[aria-current="page"] {
  color: var(--color-text, #575756);
  font-weight: 500;
}
.breadcrumb-separator {
  opacity: 0.6;
}

/* === Welle 0.44/44.11: Loading-State fuer Submit-Buttons === */
.btn-loading {
  opacity: 0.7;
  cursor: wait !important;
  pointer-events: none;
}

.btn-spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: btn-spinner-spin 0.6s linear infinite;
  vertical-align: -2px;
  margin-right: 0.4em;
}

@keyframes btn-spinner-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* === Text Color Utilities (Welle 0.44) === */
.text-danger {
  color: var(--color-danger, #dc2626);
}

/* === Welle 0.44/44.15: JSON-Field Komponente === */
.json-field-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.json-field-wrapper label {
  font-weight: var(--font-weight-semibold, 600);
  font-size: var(--font-size-sm, 0.875rem);
  color: var(--color-text-strong, #1f2937);
}

.json-field-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.json-field-status {
  color: var(--color-text-muted, #94a3b8);
  font-size: 0.78rem;
  transition: color 0.2s;
}

.json-field {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  padding: 0.5rem;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius-sm, 4px);
  background: var(--color-surface, #ffffff);
  color: var(--color-text, #374151);
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
  line-height: 1.5;
}

.json-field:focus {
  outline: none;
  border-color: var(--color-accent, #ce2128);
  box-shadow: 0 0 0 2px rgba(206, 33, 40, 0.15);
}

.json-field::placeholder {
  color: var(--color-text-muted, #94a3b8);
  font-style: italic;
}

/* === Welle 0.45/45.3: Responsive Table Wrapper ===
   Ermöglicht horizontales Scrollen bei großen Tabellen auf mobilen Geräten.
   Views sollten Tabellen mit dieser Klasse wrappen oder direkt apply:
   <div class="table-responsive"><table>...</table></div>
   OR
   <table class="table-responsive">...</table>
*/
.table-responsive {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  /* Touch-freundliches Scrolling auf iOS */
}

/* Nur bei Bedarf display:block überschreiben (mobile-first) */
@media (min-width: 1024px) {
  .table-responsive {
    display: auto;
    overflow-x: auto;
  }
}

/* === Welle 0.45/45.10: Folien Drag&Drop === */
.folie-draggable {
  cursor: grab;
  transition: opacity 0.15s, transform 0.15s;
}
.folie-draggable:active {
  cursor: grabbing;
}
.folie-dragging {
  opacity: 0.5;
}
.folie-drop-before {
  border-top: 3px solid var(--color-accent, #ce2128);
}
.folie-drop-after {
  border-bottom: 3px solid var(--color-accent, #ce2128);
}

/* === Welle 0.45/45.9: WYSIWYG-Editor === */
.wysiwyg-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  padding: 0.4rem 0.5rem;
  background: var(--color-surface-2, #f9fafb);
  border: 1px solid var(--color-border, #e5e7eb);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
}

.wysiwyg-toolbar-sep {
  display: inline-block;
  width: 1px;
  background: var(--color-border, #e5e7eb);
  margin: 0.2rem 0.2rem;
  align-self: stretch;
}

.wysiwyg-toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 0.35rem;
  background: var(--color-bg, #ffffff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.82rem;
  font-family: var(--font-body, sans-serif);
  color: var(--color-text-strong, #1f2937);
  transition: background 0.1s, border-color 0.1s, color 0.1s;
  line-height: 1;
}

.wysiwyg-toolbar-btn:hover {
  background: var(--color-surface-hover, #f1f5f9);
  border-color: var(--color-accent, #ce2128);
  color: var(--color-accent, #ce2128);
}

.wysiwyg-toolbar-btn-active {
  background: var(--color-accent, #ce2128);
  border-color: var(--color-accent, #ce2128);
  color: #ffffff;
}

.wysiwyg-toolbar-btn-active:hover {
  background: #b91b22;
  border-color: #b91b22;
  color: #ffffff;
}

.wysiwyg-content {
  min-height: 200px;
  padding: 0.75rem;
  border: 1px solid var(--color-border, #e5e7eb);
  border-top: none;
  border-radius: 0 0 4px 4px;
  background: var(--color-bg, #ffffff);
  font-family: var(--font-body, sans-serif);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--color-text, #374151);
  outline: none;
  overflow-y: auto;
}

.wysiwyg-content:focus {
  border-color: var(--color-accent, #ce2128);
  box-shadow: 0 0 0 3px rgba(206, 33, 40, 0.1);
}

.wysiwyg-content h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0.75rem 0 0.5rem;
}

.wysiwyg-content h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0.5rem 0 0.35rem;
}

.wysiwyg-content ul,
.wysiwyg-content ol {
  padding-left: 1.5rem;
  margin: 0.5rem 0;
}

.wysiwyg-content li {
  margin: 0.2rem 0;
}

.wysiwyg-content a {
  color: var(--color-accent, #ce2128);
  text-decoration: underline;
}

.wysiwyg-content p {
  margin: 0.5rem 0;
}

/* Wrapper-Element (Parent von Toolbar + Content) */
.wysiwyg-wrap {
  border-radius: 4px;
  overflow: visible;
}

/* Dark-Mode-Anpassungen */
[data-theme="dark"] .wysiwyg-toolbar {
  background: var(--color-surface-2, #1e293b);
}
[data-theme="dark"] .wysiwyg-toolbar-btn {
  background: var(--color-surface, #0f172a);
  color: var(--color-text-strong, #f1f5f9);
}
[data-theme="dark"] .wysiwyg-content {
  background: var(--color-bg, #0f172a);
  color: var(--color-text, #e2e8f0);
}

/* === Welle 0.46/46.14: Touch-Feedback via :active === */
/* Visible tap feedback for topbar buttons, buttons, and interactive controls */
.btn:active:not(:disabled),
button:active:not(:disabled) {
  transform: scale(0.98);
  opacity: 0.9;
}

/* Theme toggle button — already has :active, ensure consistency */
.theme-toggle-btn:active {
  transform: scale(0.95);
  opacity: 0.85;
}

/* Notification bell button */
.notification-bell:active {
  transform: scale(0.95);
  opacity: 0.85;
  background-color: var(--color-bg-hover, #e8e8e8);
}

/* Feedback trigger button */
#tg-feedback-trigger-btn:active {
  transform: scale(0.95);
  opacity: 0.85;
}

/* Generic topbar buttons */
.topbar button:active:not(:disabled),
.topbar a:active:not(:disabled) {
  transform: scale(0.95);
  opacity: 0.85;
}

/* Touch-device optimization: disable hover effects on touch devices */
@media (hover: none) {
  .topbar button:hover,
  .topbar a:hover,
  button:hover,
  a:hover {
    background: transparent;
  }
}

/* Hover-only devices: keep hover effects */
@media (hover: hover) {
  .topbar button:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.05);
  }

  button:not(.btn):hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.02);
  }
}

/* === Welle 0.46/46.16: Touch-Target-Garantie ===
   WCAG 2.5.5: alle interaktiven Elemente min. 44×44px
   (oder min. 24×24px mit ausreichendem Abstand).
   Diese Regel greift für Buttons/Links die die Component-Klassen NICHT nutzen.
   Mit Touch-Devices (hover:none) verstärkt. */
@media (hover: none) {
  button:not(.btn-sm):not(.btn-xs):not([data-no-touch-target]),
  input[type="submit"],
  input[type="button"],
  a.btn:not(.btn-sm):not(.btn-xs) {
    min-height: 44px;
    min-width: 44px;
  }
}

/* Garantie für .btn-xs-Klasse (kleinere Touch-Targets) */
.btn-xs {
  min-height: 24px;
  min-width: 24px;
  padding: 0.15rem 0.4rem;
}

/* === Welle 0.50/50.10: Sidebar-Sektionen-Styling ===
   Visuelle Gruppierung der Sidebar-Items in 4 logische Sektionen:
   1. Persönlich (oben)
   2. Bereiche (Hauptbereiche)
   3. Tools (Querschnitt mit Trennlinie)
   4. System/Admin (unten) */
.sidebar-section {
  margin: 0.5rem 0;
}

.sidebar-section:not(:first-child) {
  padding-top: 0.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.sidebar-section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted, #94a3b8);
  padding: 0.5rem 1rem 0.25rem;
  font-weight: 600;
}
