/**
 * audatis MANAGER - Bootstrap2 CSS Framework
 * Allgemeine CSS-Komponenten basierend auf dem Design-System
 * Generiert aus: /var/www/manager/analyse_css
 */

/* ============================================
   BASE RESET & FOUNDATION
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ============================================
   CSS VARIABLES
   ============================================ */

:root {
  /* Primary Colors */
  --primary-color: #007abb;
  --primary-darken: #005a8c;
  --primary-light: #eff6ff;
  --primary-bg: #dbeafe;
  --primary-text: #1e40af;
  --secondary-color: #3e688e;

  /* Status Colors */
  --error-color: #c84646;
  --error-darken: #a63939;
  --error-light: #fef2f2;
  --error-bg: #fee2e2;
  --error-text: #991b1b;
  --success-color: #7ea820;
  --success-darken: #6d9419;
  --success-light: #f0fdf4;
  --success-bg: #dcfce7;
  --success-text: #166534;
  --warning-color: #cc7a00;
  --warning-darken: #b36b00;
  --warning-light: #fffbeb;
  --warning-bg: #fef3c7;
  --warning-text: #92400e;
  --info-color: #007abb;
  --info-light: #e0f2fe;
  --info-text: #075985;

  /* Grey Scale */
  --grey-color: #555555;
  --grey-light: #e0e0e0;
  --grey-darken: #333333;
  --grey-50: #f9fafb;
  --grey-100: #f3f4f6;
  --grey-200: #e5e7eb; /* divider */
  --grey-300: #d1d5db;
  --grey-400: #9ca3af;
  --grey-500: #6b7280;
  --grey-600: #4b5563;
  --grey-700: #374151;

  /* Surface & Background */
  --surface: #ffffff;
  --background: #f5f7fa;
  --border-color: #e5e7eb;

  /* Text Colors */
  --text-primary: #1e293b;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --text-disabled: #9ca3af;

  /* Chip/Tag Colors */
  --chip-purple-bg: #f3e8ff;
  --chip-purple-text: #7c3aed;
  --chip-cyan-bg: #e0f2fe;
  --chip-cyan-text: #0369a1;
  --chip-cyan-hover: #bae6fd;

  /* Alert Border Colors */
  --alert-success-border: #86efac;
  --alert-warning-border: #fde68a;
  --alert-error-border: #fca5a5;
  --alert-info-border: #bfdbfe;

  /* Sort Indicator */
  --sort-arrow-inactive: #c9c9c9;

  /* Help Sidebar v2 */
  --help-width: 340px;
  --help-width-wide: 480px;
  --help-neutral-bg: #f8fafc;
  --help-neutral-border: #e2e8f0;
  --help-neutral-text: #475569;
  --help-step-color: var(--primary-color);

  /* Border Radii */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

  /* Z-Index Layers */
  --z-header: 1010;
  --z-help-sidebar: 1011;
  --z-panel: 1009;
  --z-sidebar: 1008;
  --z-dropdown: 1000;
}

.primary {
  color: var(--primary-color)!important;
}

.success {
  color: var(--success-color)!important;
}

.warning {
  color: var(--warning-color)!important;
}

.error, .danger {
  color: var(--error-color)!important;
}

.text-center {
  text-align: center;
}

.same-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.scroll-y {
  overflow-y: auto !important;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

html {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--background);
  color: var(--text-primary);
  line-height: 1;
}

/* ============================================
   LAYOUT COMPONENTS
   ============================================ */

/* Spacing utilities */
.mt-16 {
  margin-top: 16px !important;
}

.pt-16 {
  padding-top: 16px !important;
}

.mb-16 {
  margin-bottom: 16px !important;
}

.mb-24 {
  margin-bottom: 24px !important;
}

.m-0 {
  margin: 0 !important;
}

.mt-8 {
  margin-top: 8px !important;
}

.mb-8 {
  margin-bottom: 8px !important;
}

.mt-24 {
  margin-top: 24px !important;
}

/* Flex Utilities */
.flex {
  display: flex;
}

.d-flex {
  display: flex !important;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-0 {
  gap: 0!important;
}

.gap-8 {
  gap: 8px!important;
}

.gap-12 {
  gap: 12px!important;
}

.gap-16 {
  gap: 16px!important;
}

.flex-1 {
  flex: 1 !important;
}

.center-div { 
  margin-left: auto; 
  margin-right: auto;
}

/* Visibility utilities */
.u-hidden, .display-none {
  display: none;
}

/* Header */
.header {
  background-color: var(--surface);
  border-bottom: 1px solid var(--border-color);
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Company Dropdown */
.company-dropdown {
  position: relative;
}

.company-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 200px;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: var(--surface);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.company-dropdown-trigger:hover {
  border-color: var(--primary-color);
}

.company-dropdown-trigger .dropdown-arrow {
  margin-left: auto;
  color: #6b7280;
  transition: transform 0.2s;
}

.company-dropdown.open .dropdown-arrow {
  transform: rotate(180deg);
}

.company-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  min-width: 280px;
  background-color: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1020;
  display: none;
}

.company-dropdown.open .company-dropdown-menu {
  display: block;
}

.company-search-wrapper {
  padding: 8px;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.company-search {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 4px;
  font-size: 14px;
  color: var(--text-primary, #1e293b);
  background-color: var(--surface, #ffffff);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.company-search:focus {
  border-color: var(--primary-color, #007abb);
  box-shadow: 0 0 0 3px rgba(0, 122, 187, 0.1);
}

.company-search::placeholder {
  color: var(--text-muted, #6b7280);
}

.company-list {
  max-height: 240px;
  overflow-y: auto;
}

.company-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-primary, #1e293b);
  cursor: pointer;
  transition: background-color 0.1s;
}

.company-option:hover,
.company-option.highlighted {
  background-color: var(--grey-100, #f3f4f6);
}

.company-option.selected {
  background-color: var(--primary-light, #e0f2fe);
  color: var(--primary-darken, #005f8a);
}

.company-option.selected:hover,
.company-option.selected.highlighted {
  background-color: var(--primary-lighter, #bae6fd);
}

.company-option .check-icon {
  flex-shrink: 0;
  margin-left: 8px;
  width: 16px;
  height: 16px;
  opacity: 0;
  color: var(--primary-color, #007abb);
  transition: opacity 0.1s;
}

.company-option.selected .check-icon {
  opacity: 1;
}

/* System Dropdown Separator */
.system-separator {
  display: flex;
  align-items: center;
  color: #9ca3af;
  margin: 0 8px;
}

/* System Dropdown inherits .company-dropdown styles, minor overrides */
.system-dropdown .company-dropdown-trigger {
  background: var(--primary-color-light, #eff6ff);
  border-color: var(--primary-color, #2563eb);
}

/* User Menu */
.user-menu {
  position: relative;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background-color: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1020;
  display: none;
}

.user-menu.open .user-dropdown {
  display: block;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  background-color: #e0f2fe;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}

.user-role {
  font-size: 12px;
  color: #6b7280;
}

.user-menu-divider {
  height: 1px;
  background-color: var(--border-color);
}

.divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 24px 0;
}

.divider-m-8 {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 8px 0;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 14px;
  color: #374151;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.user-menu-item:hover {
  background-color: #f3f4f6;
}

.user-menu-item svg {
  color: #6b7280;
}

.user-menu-item.logout {
  color: var(--error-color);
}

.user-menu-item.logout svg {
  color: var(--error-color);
}

/* Dev Tools Link in User Menu */
.dev-tools-link {
  color: #fff !important;
  font-weight: 600 !important;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 50%, #b91c1c 100%);
}

.dev-tools-link svg {
  color: #fff !important;
}

.dev-tools-link:hover {
  background: linear-gradient(135deg, #f87171 0%, #ef4444 50%, #dc2626 100%) !important;
  color: #fff !important;
}

/* Submenu in User Menu (e.g. Schnellerfassung) */
.user-menu-submenu-trigger {
  justify-content: flex-start;
}

.user-menu-submenu-trigger span {
  flex: 1;
}

.user-menu-submenu-arrow {
  margin-left: auto;
  transition: transform 0.2s ease;
  color: #9ca3af;
  width: 14px;
  height: 14px;
}

.user-menu-submenu.open .user-menu-submenu-arrow {
  transform: rotate(180deg);
}

.user-menu-submenu-items {
  display: none;
  background-color: var(--bg-secondary, #f9fafb);
}

.user-menu-submenu.open .user-menu-submenu-items {
  display: block !important;
}

.user-menu-subitem {
  padding-left: 28px !important;
  font-size: 13px;
}

/* Language Selector in User Menu */
.language-selector {
  justify-content: flex-start;
}

.language-selector span {
  flex: 1;
}

.language-buttons {
  display: flex;
  gap: 4px;
}

.lang-btn {
  padding: 4px 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: var(--surface);
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
}

.lang-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.lang-btn.active {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

/* Recent Pages Menu */
.recent-pages-menu {
  position: relative;
}

.recent-pages-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-height: 480px;
  background-color: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1020;
  display: none;
  overflow: hidden;
}

.recent-pages-menu.open .recent-pages-dropdown {
  display: block;
}

.recent-pages-dropdown-header {
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
}

.recent-pages-list {
  overflow-y: auto;
  max-height: 420px;
}

.recent-pages-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.recent-pages-item {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  padding: 8px;
  text-decoration: none;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.15s;
}

.recent-pages-item:hover {
  background-color: var(--background);
  color: var(--text-primary);
  text-decoration: none;
}

.recent-pages-item-icon {
  flex-shrink: 0;
  color: var(--text-muted);
  margin-top: 1px;
}

.recent-pages-item:hover .recent-pages-item-icon {
  color: var(--text-primary);
}

.recent-pages-item-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.recent-pages-item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.recent-pages-item-meta .status-badge {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-pages-item-time {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.recent-pages-item-type-icon {
  display: flex;
  align-items: center;
  color: var(--text-muted);
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  height: 55px;
  min-width: 200px;
  font-size: 18px;
  font-weight: 600;
  color: var(--primary-color);
  flex-shrink: 0;
  justify-content: center;
  gap: 12px;
}

.logo-icon {
  width: 48px;
  height: 48px;
  background: var(--primary-color);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header .logo .brand-logo {
  max-height: 50px;
  width: auto;
  object-fit: contain;
  margin-left: 18px;
  margin-right: 17px;
}

/* Company Select */
.company-select {
  min-width: 200px;
  padding: 8px 12px;
  padding-right: 32px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: var(--surface);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: calc(100% - 8px) center;
  color: var(--text-primary);
  box-sizing: border-box;
}

/* Company Select - Dropdown Options */
.company-select option {
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text-primary);
}

/* Layout Container */
.layout-container {
  display: flex;
  height: calc(100vh - 64px);
  margin-top: 64px;
}

/* Sidebar */
.sidebar {
  width: 256px;
  background-color: var(--surface);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  position: fixed;
  left: 0;
  top: 64px;
  height: calc(100vh - 64px);
  z-index: var(--z-sidebar);
  transition: width 0.3s ease, transform 0.3s ease;
}

/* Sidebar Toggle Button Container - Fixed at bottom of viewport */
.sidebar-toggle-container {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 256px;
  display: flex;
  justify-content: flex-end;
  padding: 10px;
  background-color: var(--surface);
  border-right: 1px solid var(--border-color);
  border-top: 1px solid var(--border-color);
  z-index: calc(var(--z-sidebar) + 1);
  box-sizing: border-box;
  transition: width 0.3s ease;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: var(--surface);
  cursor: pointer;
  transition: all 0.2s;
  color: #6b7280;
}

.sidebar-toggle:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

/* Sidebar Toggle Icon - Visibility based on collapsed state */
.sidebar-toggle .toggle-icon-collapsed {
  display: none;
}
.sidebar-toggle .toggle-icon-open {
  display: inline-flex;
}
.sidebar.collapsed .sidebar-toggle .toggle-icon-collapsed {
  display: inline-flex;
}
.sidebar.collapsed .sidebar-toggle .toggle-icon-open {
  display: none;
}

.sidebar.collapsed .sidebar-toggle-container,
.sidebar.collapsed ~ .sidebar-toggle-container {
  width: 70px;
  justify-content: center;
}

/* Sidebar Collapsed State */
.sidebar.collapsed {
  width: 70px;
}

/* Hide text and icons when collapsed */
.sidebar.collapsed .nav-parent-content span,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-child,
.sidebar.collapsed .nav-expand-icon {
  display: none;
}

/* Hide all children when collapsed */
.sidebar.collapsed .nav-children {
  display: none !important;
}

/* Center icons when collapsed */
.sidebar.collapsed .nav-parent,
.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 10px;
}

.sidebar.collapsed .nav-parent-content {
  justify-content: center;
}

/* Main Content */
.main-content {
  margin-left: 256px;
  margin-right: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  max-height: none;
  transition: margin-left 0.3s ease, margin-right 0.3s ease;
}

.main-content.sidebar-collapsed {
  margin-left: 70px;
}

.main-content.help-open {
  margin-right: var(--help-width);
}

.main-content.help-open.help-wide {
  margin-right: var(--help-width-wide);
}

.main-content.panel-open {
  margin-right: 400px;
}

/* Help Sidebar */
.help-sidebar {
  width: var(--help-width);
  background-color: var(--surface);
  border-left: 1px solid var(--border-color);
  position: fixed;
  right: calc(var(--help-width) * -1);
  top: 64px;
  height: calc(100vh - 64px);
  z-index: var(--z-help-sidebar);
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease, width 0.3s ease;
}

.help-sidebar.open {
  right: 0;
}

/* Help Sidebar Wide State */
.help-sidebar.wide {
  width: var(--help-width-wide);
}

.help-sidebar.wide:not(.open) {
  right: calc(var(--help-width-wide) * -1);
}


.help-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

.help-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.help-header-title svg {
  width: 18px;
  height: 18px;
  color: var(--primary-color);
  flex-shrink: 0;
}
.help-header-title .mdi {
  font-size: 18px;
  color: var(--primary-color);
  flex-shrink: 0;
  line-height: 1;
}

.help-header-title h3,
.help-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.help-header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.help-header-btn {
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.help-header-btn:hover {
  background: var(--grey-100);
  color: var(--text-primary);
}

.help-header-btn svg {
  width: 16px;
  height: 16px;
}
.help-header-btn .mdi {
  font-size: 16px;
  line-height: 1;
}

/* Legacy: help-content kept for backward compatibility, use help-body for v2 */
.help-content {
  flex: 1;
  overflow-y: auto;
}


/* ═══ Help Sidebar v2: Context Bar ═══ */
.help-context {
  padding: 10px 16px;
  background: var(--help-neutral-bg);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}
.help-context-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 2px;
}
.help-context-page {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 6px;
}
.help-context-page svg {
  width: 14px;
  height: 14px;
}
.help-context-page .mdi {
  font-size: 14px;
  line-height: 1;
}

/* ═══ Help Sidebar v2: Body ═══ */
.help-body {
  flex: 1;
  overflow-y: auto;
}
/* WebKit / Chromium */
::-webkit-scrollbar { width: 8px; height: 6px; }
::-webkit-scrollbar-track { background: var(--grey-200); }
::-webkit-scrollbar-thumb { background: var(--grey-400); border-radius: 2px; }
::-webkit-scrollbar-button { display: none; }
::-webkit-scrollbar-corner { background: transparent; }
/* Firefox-only fallback (browsers without ::-webkit-scrollbar support) */
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: var(--grey-400) var(--grey-200); }
}

/* ═══ Help Sidebar v2: Intro ═══ */
.help-intro {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}
.help-intro-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.4;
}
.help-intro-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0;
}

/* ═══ Help Sidebar v2: Accordion Level 1 (Sections) ═══ */
.help-section {
  /* No border between sections — compact layout */
}
.help-section:last-child {
  /* kept for compatibility */
}

.help-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  transition: background 0.2s;
}
.help-section-header:hover {
  background: var(--hover-bg-light, #f9fafb);
}

/* Section icon: SVG and MDI support */
.help-section-header svg.section-icon {
  width: 18px;
  height: 18px;
  color: var(--primary-color);
  flex-shrink: 0;
}
.help-section-header .section-icon.mdi {
  font-size: 18px;
  color: var(--primary-color);
  flex-shrink: 0;
  line-height: 1;
}
.help-section-header .help-section-title {
  flex: 1;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  margin: 0;
  padding: 0;
  border: none;
}
/* Chevron: SVG and MDI support */
.help-section-header svg.chevron {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.help-section-header .chevron.mdi {
  font-size: 16px;
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
  display: inline-block;
}
.help-section.open > .help-section-header svg.chevron,
.help-section.open > .help-section-header .chevron.mdi {
  transform: rotate(180deg);
}

.help-section-body {
  padding: 0 16px 14px;
  display: none;
}
.help-section.open > .help-section-body {
  display: block;
}

/* ═══ Help Sidebar v2: Accordion Level 2 (Sub-Sections) ═══ */
.help-sub-section {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  margin-bottom: 8px;
  overflow: hidden;
}
.help-sub-section:last-child {
  margin-bottom: 0;
}

.help-sub-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  background: var(--help-neutral-bg);
  border: none;
  width: 100%;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  transition: background 0.2s;
}
.help-sub-header:hover {
  background: #eef2f7;
}
.help-sub-header .sub-title {
  flex: 1;
}
.help-sub-header svg.chevron-sub {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.help-sub-header .chevron-sub.mdi {
  font-size: 14px;
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
  display: inline-block;
  line-height: 1;
}
.help-sub-section.open > .help-sub-header svg.chevron-sub,
.help-sub-section.open > .help-sub-header .chevron-sub.mdi {
  transform: rotate(180deg);
}

.help-sub-body {
  padding: 10px 12px;
  display: none;
}
.help-sub-section.open > .help-sub-body {
  display: block;
}

/* ═══ Help Sidebar v2: Text Elements ═══ */
.help-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 10px;
}
.help-text:last-child {
  margin-bottom: 0;
}
.help-text strong {
  color: var(--text-primary);
  font-weight: 600;
}
.help-text a {
  color: var(--primary-color);
  text-decoration: none;
}

.help-example {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* Numbered steps */
.help-steps {
  list-style: none;
  margin: 8px 0;
  padding: 0;
  counter-reset: help-step;
}
.help-steps li {
  counter-increment: help-step;
  position: relative;
  padding-left: 28px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 8px;
}
.help-steps li:last-child {
  margin-bottom: 0;
}
.help-steps li::before {
  content: counter(help-step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 20px;
  height: 20px;
  background: var(--help-step-color);
  color: white;
  font-size: 11px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Bullet list */
.help-list {
  list-style: none;
  margin: 8px 0;
  padding: 0;
}
.help-list li {
  position: relative;
  padding-left: 16px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 5px;
}
.help-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 5px;
  height: 5px;
  background: var(--primary-color);
  border-radius: 50%;
}

/* ═══ Help Sidebar v2: Tip Boxes – NEUTRAL, ICON-DIFFERENTIATED ═══ */
.help-tip {
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.55;
  margin: 10px 0;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: var(--help-neutral-bg);
  border: 1px solid var(--help-neutral-border);
  color: var(--help-neutral-text);
}
.help-tip:last-child {
  margin-bottom: 0;
}
.help-tip svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--grey-color);
}
.help-tip .mdi {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--grey-color);
  line-height: 1;
}
.help-tip-content {
  flex: 1;
}
.help-tip-content strong {
  color: var(--text-primary);
}

/* Tip icon differentiation – only icon color changes */
.help-tip .tip-icon-info { color: var(--primary-color); }
.help-tip .tip-icon-warning { color: var(--warning-color); }
.help-tip .tip-icon-best { color: var(--success-color); }
.help-tip .tip-icon-pro { color: #7c3aed; }

/* ═══ Help Sidebar v2: Field Table ═══ */
.help-field-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
}
.help-field-table td {
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
  vertical-align: top;
  border-bottom: 1px solid var(--border-color);
}
.help-field-table tr:last-child td {
  border-bottom: none;
}
.help-field-table td:first-child {
  font-weight: 600;
  color: var(--text-primary);
  width: 110px;
  padding-right: 10px;
}
.help-field-table .field-req {
  color: var(--error-color);
  font-weight: 700;
}

/* ═══ Help Sidebar v2: Related Links ═══ */
.help-links {
  margin: 8px 0;
}
.help-link-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--primary-color);
  text-decoration: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}
.help-link-item:hover {
  background: var(--hover-bg-light, #f9fafb);
}
.help-link-item svg {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.help-link-item .mdi {
  font-size: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
  line-height: 1;
}
.help-link-item span {
  flex: 1;
}
.help-link-item .help-link-arrow {
  color: var(--text-placeholder, #9ca3af);
}

/* Content card highlighting (for sub-accordion hover) */
.content-card.highlight {
  outline: 2px solid var(--primary-color);
  box-shadow: 0 0 0 4px rgba(0, 122, 187, 0.12), 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Section card / tab content highlighting (for help sidebar sub-accordion hover) */
.section-card.highlight,
.tab-content.highlight {
  outline: 2px solid var(--primary-color);
  box-shadow: 0 0 0 4px rgba(0, 122, 187, 0.12), 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: outline 0.2s, box-shadow 0.2s;
}

/* Dashboard widget highlighting (for help sidebar sub-accordion hover) */
.dashboard-widget.highlight {
  outline: 2px solid var(--primary-color);
  box-shadow: 0 0 0 4px rgba(0, 122, 187, 0.12), 0 1px 3px rgba(0, 0, 0, 0.06);
  border-radius: 8px;
  transition: outline 0.2s, box-shadow 0.2s;
}

.help-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.help-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--primary-color);
  text-decoration: none;
}

.help-link:hover {
  text-decoration: underline;
}

.version-info,
.mid-info {
  font-size: 12px;
  color: var(--text-disabled);
}

.help-footer-links {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  flex-wrap: wrap;
}

.help-footer-divider {
  color: var(--text-disabled);
}

.help-footer-link {
  color: var(--text-secondary);
  text-decoration: none;
}

.help-footer-link:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

/* ============================================
   BUTTONS
   ============================================ */

/* Primary Button */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  min-height: 36px;
  background-color: var(--primary-color);
  color: white;
  border: 1px solid var(--primary-color);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s;
  text-decoration: none;
}

.btn-primary:hover {
  background-color: var(--primary-darken);
  text-decoration: none;
  color: white;
}

/* Farben wenn button disbaled ist (bleibt z.B. rot aber so das er disbaled angezeigt wird) */
.btn-primary:disabled,
.btn-primary[disabled] {
  background-color: var(--primary-color);
  cursor: not-allowed;
  opacity: 0.7;
}

.btn-primary:disabled:hover,
.btn-primary[disabled]:hover {
  background-color: var(--primary-color);
}

/* Secondary Button */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  min-height: 36px;
  background-color: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-secondary:hover {
  text-decoration: none;
  background-color: var(--grey-50);
  border-color: var(--text-disabled);
}

.btn-secondary:disabled,
.btn-secondary[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Danger Button */

.btn-danger:disabled {
  opacity: 0.5;
  pointer-events: none;
}

.btn-danger.active {
  opacity: 1;
  pointer-events: all;
}

/* Success Button (Green) */
.btn-success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  background-color: var(--success-color);
  color: white;
  border: 1px solid var(--success-color);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none !important;
}

.btn-success:hover {
  background-color: var(--success-darken);
}

.btn-success:disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* Icon Button */
.icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background-color 0.2s;
  position: relative;
}

.icon-btn:hover {
  background-color: var(--grey-100);
}

.icon-btn.active {
  background-color: var(--primary-light);
  color: var(--primary-color);
}

/* Button Icon (smaller) */

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-secondary, #6b7280);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon:hover:not(:disabled) {
  background: var(--hover-bg-light, #f3f4f6);
  color: var(--text-primary, #111827);
  cursor: pointer;
}

.btn-icon:disabled {
  opacity: 0.7;
  cursor: default;
}

.btn-icon.active {
  background-color: var(--primary-light);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* ============================================
   BUTTON ICON DANGER (for delete actions)
   ============================================ */

   .btn-icon-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-secondary, #9ca3af);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .btn-icon-danger:hover {
    background: var(--error-light, #fef2f2);
    color: var(--error-color, #c84646);
  }

   .btn-icon-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-secondary, #9ca3af);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .btn-icon-primary:hover {
    background: var(--primary-light, #dbeafe);
    color: var(--primary-color, #007abb);
  }

/* Edit Button */
.btn-edit {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.2s;
}

.btn-edit:hover {
  background-color: var(--grey-100);
  color: var(--primary-color);
}

/* Text Button - subtle link-style button */
.btn-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: none;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary-color, #007abb);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn-text:hover {
  background-color: var(--hover-bg-light, #f3f4f6);
}

.btn-text:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Actions Cell in Tables - Feste Slots von rechts nach links */
td.actions-cell {
  height: 1px; /* Trick: TD nimmt TR-Höhe, Kind kann height:100% nutzen */
  white-space: nowrap;
  text-align: right;
}

td.actions-cell > .actions-cell {
  display: inline-flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  height: 100%;
  min-height: 32px;
}

.actions-cell .btn-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

/* More Button with Dropdown */
.btn-more {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background-color: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-more:hover {
  background-color: var(--grey-50);
}

/* New Button */
.btn-new {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background-color: var(--primary-color);
  color: white;
  border: 1px solid var(--primary-color);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-new:hover {
  background-color: var(--primary-darken);
  border-color: var(--primary-darken);
}

/* Delete Single Button */
.btn-delete-single {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background-color: var(--error-color);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-delete-single:hover:not(:disabled) {
  background-color: #c53030;
  transform: translateY(-1px);
}

.btn-delete-single:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Action Button */
.btn-action {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  background-color: var(--surface);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-action:hover:not(:disabled) {
  background-color: var(--grey-50);
  text-decoration: none;
}

.btn-action:disabled,
.btn-action[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

/* Input Fields - Underline Style per Mockup 06 */
.form-input {
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid var(--border-color);
  border-radius: 0;
  font-size: 14px;
  color: var(--text-primary);
  transition: all 0.2s;
  font-family: inherit;
  min-height: 42px; /* Einheitliche Hoehe mit Select-Komponenten */
  box-sizing: border-box;
  background-color: transparent;
}

.form-input-with-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-input:focus {
  outline: none;
  border-bottom: 2px solid var(--primary-color);
  margin-bottom: -0.75px;
  box-shadow: none;
  background-color: transparent;
}

.form-input:disabled,
.form-input[readonly] {
  background-color: transparent;
  border-bottom: 1px solid var(--grey-200);
  cursor: text;
}

/* HTML5 Validation Error States */
.form-input:invalid:not(:placeholder-shown):not(:focus),
.form-input:user-invalid:not(:focus) {
  border-bottom-color: var(--error-color);
}

.form-input:invalid:not(:placeholder-shown):focus,
.form-input:user-invalid:focus {
  border-bottom: 2px solid var(--error-color);
  margin-bottom: -0.75px;
}

/* Custom Validation Error Class (from JS) */
.form-input.has-validation-error,
.form-textarea.has-validation-error,
.form-select.has-validation-error {
  border-bottom-color: var(--error-color);
}

.form-input.has-validation-error:focus,
.form-textarea.has-validation-error:focus,
.form-select.has-validation-error:focus {
  border-bottom: 2px solid var(--error-color);
  margin-bottom: -0.75px;
}

/* Inline Validation Error Message */
.field-validation-error {
  color: var(--error-color);
  font-size: 12px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.field-validation-error::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23c84646'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  flex-shrink: 0;
}

/* Select Dropdown - Underline Style per Mockup 06 */
.form-select {
  width: 100%;
  padding: 10px 36px 10px 12px;
  border: none;
  border-bottom: 1px solid var(--border-color);
  border-radius: 0;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  min-height: 42px; /* Einheitliche Hoehe mit anderen Komponenten */
  box-sizing: border-box;
  appearance: none;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23007abb' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color 0.2s;
}

.form-select:focus {
  outline: none;
  border-bottom-color: var(--primary-color);
  box-shadow: none;
}

.form-select:disabled {
  pointer-events: none;
  background-color: transparent;
  border-bottom: 1px solid var(--grey-200);
  cursor: text;
}

/* Textarea - Underline Style per Mockup 06 */
.form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid var(--border-color);
  border-radius: 0;
  font-size: 14px;
  color: var(--text-primary);
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
  background-color: transparent;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.form-textarea:focus {
  outline: none;
  border-bottom: 2px solid var(--primary-color);
  margin-bottom: -0.75px;
  box-shadow: none;
}

.form-textarea:disabled,
.form-textarea[readonly] {
  background-color: transparent;
  border-bottom: 1px solid var(--grey-200);
  cursor: text;
  resize: none;
}

/* HTML5 Validation Error States for Textarea */
.form-textarea:invalid:not(:placeholder-shown):not(:focus),
.form-textarea:user-invalid:not(:focus) {
  border-bottom-color: var(--error-color);
}

.form-textarea:invalid:not(:placeholder-shown):focus,
.form-textarea:user-invalid:focus {
  border-bottom: 2px solid var(--error-color);
  margin-bottom: -0.75px;
}

/* Checkboxes */
.checkbox {
  width: 16px;
  height: 16px;
  min-width: 16px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--primary-color);
}

/* Search Input */
.search-input {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  width: 250px;
  transition: all 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 122, 187, 0.1);
}

/* ============================================
   NAVIGATION
   ============================================ */

.nav-section {
  padding: 6px;
  padding-bottom: 60px; /* Space for toggle button at bottom */
}

/* Nav Item */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 4px;
  text-decoration: none;
}

.nav-item:hover {
  background-color: var(--grey-100);
}

.nav-item.active {
  background-color: var(--primary-light);
  color: var(--primary-color);
  font-weight: 500;
}

/* Nav Parent */
.nav-parent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 4px;
  font-weight: 500;
}

.nav-parent:hover {
  background-color: var(--grey-100);
}

.nav-parent.active {
  background-color: var(--primary-light);
  color: var(--primary-color);
}

.nav-parent.expanded {
  color: var(--primary-color);
}

.nav-parent-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.nav-expand-icon {
  transition: transform 0.2s;
  flex-shrink: 0;
}

.nav-parent.expanded .nav-expand-icon {
  transform: rotate(90deg);
}

/* Nav Children */
.nav-children {
  display: none;
  padding-left: 32px;
  margin-bottom: 4px;
}

.nav-children.expanded {
  display: block;
}

.nav-child {
  display: flex;
  align-items: center;
  padding: 10px;
  border-radius: 6px;
  font-size: 13px;
  text-decoration: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 2px;
}

.nav-child:hover {
  background-color: var(--grey-100);
  color: var(--text-secondary);
  text-decoration: none;
}

.nav-child.active {
  background-color: var(--primary-light);
  color: var(--primary-color);
  font-weight: 500;
  text-decoration: none;
}

/* Nav Divider */
.nav-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 8px 0px ;
}

/* Flyout Menu - for collapsed sidebar */
.nav-flyout {
  position: fixed;
  left: 70px;
  top: 60px; /* Default: below header, will be adjusted by JS */
  background-color: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 220px;
  max-height: calc(100vh - 70px); /* Don't exceed viewport minus header */
  overflow-y: auto;
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-10px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  z-index: 2000;
  margin-left: 4px;
  display: none;
}

.sidebar.collapsed .nav-flyout {
  display: block;
}

.sidebar.collapsed .nav-parent:hover .nav-flyout,
.sidebar.collapsed .nav-item-wrapper:hover .nav-flyout {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* Nav Item Wrapper for flyout support */
.nav-item-wrapper {
  position: relative;
}

.nav-flyout-title {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 4px;
}

.nav-flyout-item {
  display: block;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.nav-flyout-item:hover {
  background-color: var(--grey-100);
  color: var(--primary-color);
  text-decoration: none;
}

.nav-flyout-item.active {
  background-color: var(--primary-light);
  color: var(--primary-color);
  font-weight: 500;
}

/* Single item flyout (like Dashboard) */
.nav-flyout-single {
  padding: 0;
}

.nav-flyout-single .nav-flyout-title {
  border-bottom: none;
  margin-bottom: 0;
  padding: 10px 16px;
}

/* ============================================
   TABS
   ============================================ */

/* Tab Navigation */
.tab-navigation {
  background-color: var(--surface);
  border-bottom: 2px solid var(--border-color);
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 0 12px;
  flex-shrink: 0; /* Nicht schrumpfen im Flex-Container */
 }

.tab-item {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: all 0.2s;
  flex-shrink: 0;
}

.tab-item:hover {
  color: var(--primary-color);
  background-color: var(--grey-50);
}

.tab-item.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  background-color: transparent;
}

.tab-navigation button.tab-item {
  background: transparent;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ============================================
   BREADCRUMB
   ============================================ */

.breadcrumb {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
  background-color: var(--surface);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0; /* Nicht schrumpfen im Flex-Container */
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: var(--primary-color);
}

.breadcrumb-current {
  color: var(--text-primary);
  font-weight: 500;
}

/* ============================================
   ACTION BAR
   ============================================ */

.sticky-action-bar {
  background-color: var(--surface);
  border-bottom: 1px solid var(--border-color);
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  flex-shrink: 0; /* Nicht schrumpfen im Flex-Container */
}

.action-bar-left {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.action-bar-right {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* ============================================
   CARDS & SECTIONS
   ============================================ */

/* Form Section */
.form-section {
  background-color: var(--surface);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--grey-100);
}


.subsection-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary, #111827);
  margin: 0 0 10px 0;
}

/* Form Content - einziger scrollbarer Bereich */
.form-content {
  flex: 1;
  min-height: 0; /* Wichtig für Flex-Scrolling */
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  scroll-behavior: smooth;
  padding-bottom: 50vh; /* Viel Platz unten, damit letzte Section nach oben gescrollt werden kann */
}

/* Form innerhalb form-content soll nicht scrollen */
.form-content > form {
  min-height: auto;
}

.form-content .toolbar {
  border-bottom: none !important;
  padding: 0px !important;
}

.table-container {
  flex: 1;
  overflow: auto;
  min-height: 0;
}

.table-container table {
  min-width: 800px; /* Mindestbreite für die Tabelle */
}

/* In Formularen (Edit-Seiten) ist der Platz begrenzt — keine Mindestbreite erzwingen,
   damit die Aktionen-Spalte nicht abgeschnitten wird */
.form-content .table-container table {
  min-width: 0;
}

/* ============================================
   STATUS CHIPS & BADGES
   ============================================ */

/* Chip Base */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  background-color: var(--grey-100);
  color: var(--text-secondary);
  margin: 1.5px;
}

/* Tags Cell - KEIN display:flex auf td, da es das Tabellen-Layout bricht */
.tags-cell {
  /* Chips werden inline-flex dargestellt, td bleibt table-cell */
  vertical-align: middle;
}

/* Tags Wrapper für bessere Kontrolle */
.tags-cell .chip {
  margin: 2px 4px 2px 0;
  vertical-align: middle;
}

/* Badge (Notification) */
.badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background-color: var(--error-color);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
}

.scope-badge {
  font-weight: 400;
  font-size: 0.85em;
  color: var(--text-secondary, #6c757d);
}

/* ============================================
   TABLES
   ============================================ */

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background-color: var(--grey-50);
  border-bottom: 1px solid var(--border-color);
}

th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  padding: 3px 16px;
  font-size: 14px;
  color: var(--grey-700);
  border-bottom: 1px solid var(--border-color);
  line-height: 1.4;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background-color: var(--grey-50);
}

tbody tr {
  height: 40px;
}

/* Sortable Headers - siehe SORT INDICATOR ENHANCEMENT Sektion weiter unten */

/* Table Footer - Fixiert am Ende der table-card */
.table-footer {
  padding: 8px 16px;
  border-top: 1px solid var(--border-color);
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background-color: var(--surface);
  flex-shrink: 0; /* Verhindert Schrumpfen */
}

span.am-badge.status-error {
  color: var(--error-color);
}

span.am-badge.status-warning {
  color: var(--warning-color);
}

span.am-badge.status-success {
  color: var(--success-color);
}

/* ============================================
   BULK ACTION BAR (DataTable)
   ============================================ */

.bulk-action-bar {
  display: none;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background-color: var(--primary-light, #e6f0ff);
  border: 1px solid var(--primary-color);
  border-radius: 8px;
  margin-bottom: 12px;
}

.bulk-action-bar.visible {
  display: flex;
}

.bulk-selection-info {
  font-size: 14px;
  color: var(--primary-color);
}

.bulk-selection-info strong {
  font-weight: 600;
}

.bulk-action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.btn-bulk-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background-color: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-bulk-action:hover {
  background-color: var(--grey-100);
  border-color: var(--grey-300);
  color: var(--text-primary);
}

.btn-bulk-action svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ============================================
   DROPDOWN
   ============================================ */

.dropdown {
  position: relative;
}

/* Dropdown Container */
.dropdown-container {
  position: relative;
  display: inline-block;
}

.dropdown-container.open .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-arrow {
  transition: transform 0.2s ease;
  margin-left: 2px;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 220px;
  background-color: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  display: none;
  z-index: var(--z-dropdown);
  padding: 4px;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.2s;
  background: none;
  border: none;
  text-align: left;
  text-decoration: none;
}

a.dropdown-item:hover {
  text-decoration: none;
}

.dropdown-item:hover {
  background-color: var(--grey-100);
  color: var(--text-primary);
}

.dropdown-item svg {
  flex-shrink: 0;
  fill: currentColor;
}

.dropdown-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 4px 0;
}

/* ============================================
   COMMENTS & TIMELINE
   ============================================ */


.comment-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.comment-meta {
  flex: 1;
}

.comment-author {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.comment-time {
  font-size: 12px;
  color: var(--text-disabled);
}

.comment-body {
  font-size: 14px;
  color: var(--text-secondary);
  margin-left: 42px;
}

.comment-actions {
  margin-left: 42px;
  margin-top: 8px;
  display: flex;
  gap: 12px;
}

.comment-action {
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.comment-action:hover {
  color: var(--primary-color);
}

/* Comment Input */
.comment-input-area {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  background-color: var(--grey-50);
}

.comment-input-wrapper {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.comment-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  resize: none;
  min-height: 60px;
  font-family: inherit;
}

.comment-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.comment-submit {
  padding: 10px 16px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination-btn {
  width: 24px;
  height: 24px;
  border: 1px solid var(--border-color);
  background-color: var(--surface);
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.2s;
  font-size: 12px;
}

.pagination-btn svg {
  width: 14px;
  height: 14px;
  pointer-events: none;
}

.pagination-btn:hover:not(:disabled) {
  background-color: var(--grey-100);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-btn.active {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.pagination-info {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 8px;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

/* Spacer */
.spacer {
  flex: 1;
}

/* Text Alignment */
.text-left {
  text-align: left;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

/* Text Color Utilities */
.text-danger {
  color: var(--error-color) !important;
}

.text-success {
  color: var(--success-color) !important;
}

.text-warning {
  color: var(--warning-color) !important;
}

.text-muted {
  color: var(--text-muted) !important;
}

/* ============================================
   CARD COMPONENTS (Dashboard & General Cards)
   ============================================ */

/* Card Base */
.card {
  background-color: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.sub-card {
  margin: 12px 0;
  padding: 12px;
  background: var(--color-bg-secondary, #f8f9fa);
  border-radius: 6px;
  border: 1px solid var(--border-color, #e5e7eb);
  min-height: 40px;
}

.sub-card .card-title {
  margin-bottom: 16px;
}

.sub-card ul,
.sub-card ol {
  padding-left: 24px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-title-icon {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title-icon i {
  color: var(--primary-color);
}

.card-link {
  font-size: 13px;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: text-decoration 0.2s;
}

.card-link:hover {
  text-decoration: underline;
}

.card-body {
  padding: 16px 20px;
}

/* ============================================
   BREADCRUMB (Navigation breadcrumb component)
   Mockup 06-kontakt-uebersicht.html konform
   ============================================ */

.main-content > .breadcrumb,
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--grey-600);
  padding: 12px 16px;
  margin: 0;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  flex-shrink: 0; /* Nicht komprimieren bei Flex-Layout */
}

.breadcrumb a {
  color: var(--grey-600);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: var(--primary-color);
}

.breadcrumb svg {
  color: var(--text-disabled);
  flex-shrink: 0;
}

.breadcrumb-current {
  color: var(--primary-color);
  font-weight: 700;
}

/* ============================================
   PAGE HEADER (General page header component)
   Mockup 06-kontakt-uebersicht.html konform
   ============================================ */

.main-content > .page-header,
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  margin: 0;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 16px;
  flex-shrink: 0; /* Nicht komprimieren bei Flex-Layout */
}

.page-header-left {
  flex: 1;
}

.page-header-left h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.page-header-left p {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
  margin-bottom: 0;
}

.page-header-right {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

/* ============================================
   CONTENT AREA
   ============================================ */

.content-area {
  display: flex;
  flex-direction: column;
  padding: 12px;
  flex: 1;
  gap: 12px;
  overflow: hidden; /* Kein Scroll auf content-area selbst */
  min-height: 0;
}

/* Tab Content - Füllt den verfügbaren Platz */
.tab-content {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 12px;
}

.tab-content.active {
  display: flex;
}

/* ============================================
   TABLE ENHANCEMENTS - Sticky Header & Footer
   ============================================ */

/* Sticky Header Table Layout - Overrides für scrollbare Tabellen */
.table-container {
  flex: 1;
  overflow: auto;
  min-height: 0;
}

.table-container table {
  width: 100%;
  border-collapse: collapse;
}

/* Sticky Header - Bleibt beim Scrollen oben */
.table-container thead {
  background-color: var(--grey-50);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 10;
}

.table-container thead th {
  background-color: var(--grey-50);
  /* Schatten beim Scrollen für visuellen Hinweis */
  box-shadow: inset 0 -1px 0 var(--border-color);
}

.table-container th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table-container th.sortable {
  cursor: pointer;
  user-select: none;
}

.table-container th.sortable:hover {
  background-color: var(--grey-100);
}

.table-container td {
  padding: 3px 16px;
  font-size: 14px;
  color: var(--grey-700);
  border-bottom: 1px solid var(--border-color);
  line-height: 1.4;
}

/* Zebra-Striping deaktiviert per Mockup
.table-container tbody tr:nth-child(even) {
    background-color: var(--grey-50);
}
*/

.table-container tbody tr:hover {
  background-color: var(--grey-100);
}

.table-container tbody tr:last-child td {
  border-bottom: none;
}

/* Text-Truncation mit Ellipsis */
.truncate-text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Page Size Select */
.page-size-select {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-size-select select {
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 13px;
  background-color: var(--surface);
  cursor: pointer;
}

.page-size-select select:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
  .filter-row {
    grid-template-columns: 1fr;
  }

  .action-bar {
    flex-direction: column;
    gap: 12px;
  }

  .action-bar-left,
  .action-bar-right {
    width: 100%;
    justify-content: space-between;
  }

  .table-footer {
    flex-direction: column;
    gap: 12px;
  }

  .table-footer-left,
  .table-footer-right {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================
   TOOLBAR
   ============================================ */

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background-color: var(--surface);
  flex-shrink: 0; /* Nicht komprimieren bei Flex-Layout */
}

.spacer {
  flex: 1;
}

/* ============================================
   SELECTION COUNTER
   ============================================ */

.selection-counter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background-color: rgba(0, 122, 187, 0.1);
  color: var(--primary-color);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
}

.selection-counter.hidden {
  display: none;
}

/* ============================================
   BTN-DELETE FIX
   ============================================ */

.btn-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  min-height: 36px;
  background-color: var(--error-color);
  color: white;
  border: 1px solid var(--error-color);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s;
  opacity: 0.5;
  pointer-events: none;
}

.btn-delete.active {
  opacity: 1;
  pointer-events: all;
}

.btn-delete.active:hover {
  background-color: var(--error-darken);
}

/* Button Review - Prüfmodus starten */
.btn-review {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  min-height: 36px;
  background-color: var(--success-color, #7ea820);
  color: white;
  border: 1px solid var(--success-color);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  line-height: 1;
  transition: background-color 0.2s, opacity 0.2s;
  text-decoration: none;
}

.btn-review:hover,
.btn-review:focus {
  background-color: var(--success-darken, #6a8c1a);
  color: white;
  text-decoration: none;
}

.btn-review:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================
   PAGINATION
   ============================================ */

/* Pagination styles are defined above - see line ~1925 */

/* ============================================
   FORM SECTIONS - FOR EDIT/NEW FORMS
   ============================================ */

/* .form-content ist oben definiert (Zeile ~1464) */

.form-section {
  background-color: var(--surface);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-label-required {
  color: var(--error-color);
}


.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
  min-width: 0;
}

.grid-2 > * {
  min-width: 0;
}

.grid-stretch {
  align-items: stretch !important;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.radio-label input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
}

.radio-label span {
  font-size: 14px;
  color: var(--grey-700);
  cursor: default;
}

.radio-label input[type="radio"],
input[type="radio"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

.radio-label input[type="radio"]:disabled,
input[type="radio"]:disabled {
  cursor: default;
}

.form-grid-full {
  grid-column: 1 / -1;
}

.schlagworte-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  cursor: auto;
}

.checkbox-label--plain {
  border: none;
  padding: 0;
}

.checkbox-label--plain:hover {
  background: none;
}

.checkbox-label .submit-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

/* Settings Group Styles */
.settings-group {
  background-color: var(--grey-50);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.settings-group:last-child {
  margin-bottom: 0;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.settings-group .form-group {
  margin-bottom: 12px;
}

.settings-group .form-group:last-child {
  margin-bottom: 0;
}

/* File Upload Styles */
.file-upload-area {
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  padding: 24px;
  transition: all 0.2s ease;
}

.file-upload-area.drag-over {
  border-color: var(--primary-color);
  background-color: rgba(0, 90, 170, 0.05);
}

.file-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  cursor: pointer;
  text-align: center;
}

.file-dropzone:hover {
  background-color: var(--grey-50);
  border-radius: 6px;
}

.file-dropzone-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  color: var(--grey-400);
}

.file-dropzone-text {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.file-dropzone-text a {
  color: var(--primary-color);
  cursor: pointer;
  font-weight: 500;
}

.file-dropzone-text a:hover {
  text-decoration: underline;
}

.file-dropzone-hint {
  font-size: 13px;
  color: var(--text-muted);
}

.file-list {
  margin-top: 20px;
}

.file-list:empty {
  display: none;
}

.file-list + .file-dropzone {
  margin-top: 0;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background-color: var(--grey-50);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.file-item:hover {
  background-color: white;
  border-color: var(--primary-color);
}

.file-item:last-child {
  margin-bottom: 0;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.file-icon {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.file-icon.pdf {
  background-color: #fef2f2;
  color: #dc2626;
}
.file-icon.doc {
  background-color: #eff6ff;
  color: #2563eb;
}
.file-icon.xls {
  background-color: #f0fdf4;
  color: #16a34a;
}
.file-icon.img {
  background-color: #fef3c7;
  color: #d97706;
}
.file-icon.ppt {
  background-color: #fff7ed;
  color: #ea580c;
}
.file-icon.default,
.file-icon.other {
  background-color: var(--grey-100);
  color: var(--grey-600);
}
.file-icon.folder {
  background-color: #fef3c7;
  color: var(--warning-color);
}
.file-icon.csv {
  background-color: #e0f2fe;
  color: #0284c7;
}
.file-icon.zip {
  background-color: #faf5ff;
  color: #9333ea;
}
.file-icon.mail {
  background-color: #ecfeff;
  color: #0891b2;
}
.file-icon.txt {
  background-color: #f5f5f5;
  color: #525252;
}

.file-details {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.file-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.file-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--grey-500);
  transition: all 0.2s ease;
}

.file-action-btn:hover {
  background-color: var(--grey-100);
  color: var(--text-primary);
}

.file-action-btn.download:hover {
  background-color: #eff6ff;
  color: var(--primary-color);
}

.file-action-btn.delete:hover {
  background-color: #fef2f2;
  color: #dc2626;
}

.file-upload-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background-color: var(--grey-50);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  margin-bottom: 8px;
}

.file-upload-progress .progress-bar {
  flex: 1;
  height: 6px;
  background-color: var(--grey-200);
  border-radius: 3px;
  overflow: hidden;
}

.file-upload-progress .progress-fill {
  height: 100%;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

.file-upload-progress .progress-text {
  font-size: 13px;
  color: var(--text-muted);
  min-width: 45px;
  text-align: right;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state svg {
  margin-bottom: 16px;
}

.empty-state-icon {
  font-size: 48px;
  opacity: 0.5;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 14px;
}

.form-actions {
  display: flex;
  gap: 16px;
  justify-content: flex-end;
  padding: 24px 0;
}

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

  .form-actions {
    flex-direction: column-reverse;
  }

  .form-actions .btn-primary,
  .form-actions .btn-secondary {
    width: 100%;
  }

  .schlagworte-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   CSV IMPORT COMPONENT
   ============================================ */

/* Import Section */
.import-section {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 24px;
}

.import-section-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
}

.import-section-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.import-section-body {
  padding: 20px;
}

/* Example File Download */
.example-file {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--grey-50);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  margin-bottom: 24px;
}

.example-file-icon {
  width: 40px;
  height: 40px;
  background: var(--success-bg);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--success-text);
  flex-shrink: 0;
}

.example-file-info {
  flex: 1;
}

.example-file-name {
  font-weight: 500;
  color: var(--primary-color);
  cursor: pointer;
  text-decoration: none;
}

.example-file-name:hover {
  text-decoration: underline;
}

/* Field Mapping */
.field-mapping-note {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding: 12px;
  background: var(--primary-light);
  border-radius: 6px;
  border-left: 3px solid var(--primary-color);
}

.field-mapping-header {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-bottom: 12px;
  padding-top: 12px;
  border-bottom: 1px solid var(--border-color);
}

.field-mapping-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 992px) {
  .field-mapping-grid {
    grid-template-columns: 1fr;
  }
}

.field-mapping-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--grey-50);
  border: 1px solid var(--border-color);
  border-radius: 6px;
}

.field-label {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
}

.field-label .field-type {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 2px;
}

.field-label .field-required {
  color: var(--error-color);
  margin-left: 2px;
}

.field-select {
  width: 160px;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 13px;
  background: var(--surface);
}

.field-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 122, 187, 0.1);
}

/* Import Checkbox */
.import-checkbox-row {
  margin-bottom: 8px;
}

.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
}

.checkbox-inline input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary-color);
}

/* Data Matching */
.data-matching {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.data-matching-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: block;
}

.data-matching-select {
  width: 300px;
  max-width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  background: var(--surface);
}

.data-matching-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 122, 187, 0.1);
}

.data-matching-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* File Upload Section */
.file-upload-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.file-upload-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: block;
}

.file-upload-requirements {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--warning-light);
  border: 1px solid var(--warning-bg);
  border-radius: 6px;
}

.file-upload-requirements strong {
  color: var(--text-primary);
}

.file-upload-requirements ul {
  margin: 8px 0 0 20px;
  padding: 0;
}

.file-upload-requirements li {
  margin-bottom: 4px;
}

/* Import File Upload Area */
.import-section .file-upload-area {
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--surface);
}

.import-section .file-upload-area:hover,
.import-section .file-upload-area.dragover {
  border-color: var(--primary-color);
  background: var(--primary-light);
}

.file-upload-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  color: var(--text-muted);
}

.file-upload-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.file-upload-text strong {
  color: var(--primary-color);
}

.file-upload-hint {
  font-size: 12px;
  color: var(--text-muted);
}

/* File Selected State */
.file-selected {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--success-light);
  border: 1px solid var(--success-color);
  border-radius: 8px;
}

.file-selected-icon {
  width: 40px;
  height: 40px;
  background: var(--success-bg);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--success-text);
  flex-shrink: 0;
}

.file-selected-info {
  flex: 1;
}

.file-selected-name {
  font-weight: 500;
  color: var(--text-primary);
}

.file-selected-size,
.example-file-desc,
.file-meta,
.meta-text  {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.file-selected-remove {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
}

.file-selected-remove:hover {
  background: var(--error-light);
  color: var(--error-color);
}

/* Import Actions */
.import-actions {
  padding-top: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-radius: 0 0 8px 8px;
}

.import-status {
  font-size: 14px;
  color: var(--text-muted);
}

.import-status.success {
  color: var(--success-color);
}

.import-status.error {
  color: var(--error-color);
}

/* Import Progress Overlay */
.import-progress-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.import-progress-content {
  background: var(--surface);
  padding: 40px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.import-progress-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--grey-200);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 1s linear infinite;
}

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

.import-progress-text {
  font-size: 16px;
  color: var(--text-primary);
}

/* Large Button */
.btn-large,
.btn-primary.btn-large {
  padding: 14px 28px;
  font-size: 15px;
}

/* Small Button */
.btn-sm {
  padding: 4px 10px;
  min-height: 28px;
  font-size: 12px;
  gap: 4px;
}

/* ============================================
   MODAL SYSTEM
   ============================================ */

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.modal-overlay.show {
  display: flex;
}

/* Modal Container */
.modal {
  background-color: var(--surface);
  border-radius: 8px;
  width: 100%;
  max-width: 750px;
  max-height: 90vh;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Modal Form (when form wraps body and footer) */
.modal > form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Modal Header */
.modal-header {
  background-color: var(--primary-color);
  color: white;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: white;
}

.modal-close {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.modal-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Modal Body */
.modal-body {
  padding: 24px 20px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.modal-description {
  margin-bottom: 24px;
  color: #4b5563;
  font-size: 14px;
  line-height: 1.5;
}

.modal-info {
  color: #6b7280;
  font-size: 13px;
  margin-top: 16px;
}

/* Modal Footer */
.modal-footer {
  padding: 16px 20px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

/* When modal-footer has left and right sections */
.modal-footer:has(.modal-footer-left) {
  justify-content: space-between;
  gap: 0;
}

.modal-footer-left {
  display: flex;
  align-items: center;
}

.modal-footer-right {
  display: flex;
  gap: 12px;
}

/* Modal Size Variants */
.modal.modal-sm {
  max-width: 400px;
}

.modal.modal-large {
  width: 700px;
  max-width: 90vw;
  max-height: 90vh;
}

/* Scrollable Modal Body */
.modal-body.modal-body-scroll {
  max-height: calc(90vh - 140px);
  overflow-y: auto;
  padding: 0;
}

/* Modal Sections */
.modal-section {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  overflow: hidden;
}

.modal-section:last-child {
  border-bottom: none;
}

.modal-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary, #1f2937);
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-section-desc {
  font-size: 13px;
  color: var(--text-secondary, #6b7280);
  margin: -8px 0 16px 0;
  line-height: 1.5;
}

.modal-info-text {
  color: #6b7280;
  font-size: 13px;
  margin-top: 16px;
}

/* Modal Section Form Layout */
.modal-section .form-row {
  margin-bottom: 16px;
}

.modal-section .form-row:last-child {
  margin-bottom: 0;
}

.modal-section .form-group {
  margin-bottom: 16px;
}

.modal-section .form-group:last-child {
  margin-bottom: 0;
}

.modal-section .form-row.three-cols {
  grid-template-columns: repeat(3, 1fr);
}

/* Modal Section Checkboxes */
.modal-section .checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.modal-section .checkbox-group + .checkbox-group {
  margin-top: 4px;
}

.modal-section .checkbox-group .checkbox {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--primary-color, #007abb);
}

.modal-section .checkbox-group .checkbox-label {
  font-size: 14px;
  color: var(--text-primary, #1f2937);
  cursor: pointer;
  margin: 0;
  user-select: none;
}

/* ============================================
   FORM COMPONENTS (MODAL-STYLE)
   ============================================ */

.form-group {
  margin-bottom: 20px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-field {
  margin-bottom: 24px;
}

.form-field:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 6px;
  font-weight: 600;
}

.form-text {
  display: block;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 6px;
  font-weight: 500;
  line-height: 1.2;
}

.form-label.required::after {
  content: " *";
  color: var(--error-color);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
  background-color: transparent;
  transition: border-color 0.2s;
  font-family: inherit;
  min-height: 42px;
  box-sizing: border-box;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-bottom: 2px solid var(--primary-color);
  margin-bottom: -0.75px;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-disabled);
}

.form-help, .form-hint  {
  display: block;
  font-size: 13px;
  color: var(--text-secondary, #6b7280);
  margin-bottom: 8px;
  margin-top: 8px;
    line-height: 1.4;
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23007abb' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 32px;
  cursor: pointer;
}

/* Checkbox Label in Modal Footer - ohne Border per Mockup 06 */
.modal-footer .checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  border: none;
  padding: 0;
  background: none;
}

.modal-footer .checkbox-label:hover {
  background: none;
  border: none;
}

.modal-footer .checkbox-label input[type="checkbox"] {
  display: block !important;
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

/* ============================================
   BUTTON STYLES (MODAL)
   ============================================ */

.btn-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  min-height: 36px;
  background-color: var(--primary-color);
  color: white;
  border: 1px solid var(--primary-color);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: opacity 0.2s, background-color 0.2s;
}

.btn-save:hover:not(:disabled) {
  background-color: var(--primary-darken);
}

.btn-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* Warning Button Variant */
.btn-warning,
.btn-save.btn-warning {
  background-color: var(--warning-color);
  border-color: var(--warning-color);
  color: white;
}

.btn-warning:hover:not(:disabled),
.btn-save.btn-warning:hover:not(:disabled) {
  background-color: var(--warning-darken);
  border-color: var(--warning-darken);
}

.btn-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  min-height: 36px;
  background-color: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-cancel:hover {
  background-color: var(--grey-50);
  border-color: var(--text-disabled);
}

/* ============================================
   RESPONSIVE MODAL
   ============================================ */

@media (max-width: 768px) {
  .modal {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .modal-overlay {
    padding: 0;
  }

  .modal-footer {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .modal-footer-left,
  .modal-footer-right {
    width: 100%;
  }

  .modal-footer-right {
    flex-direction: column-reverse;
  }

  .btn-save,
  .btn-cancel {
    width: 100%;
    justify-content: center;
  }

  .modal.modal-large {
    width: 100%;
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .modal-body.modal-body-scroll {
    max-height: calc(100vh - 140px);
  }

  .modal-section {
    padding: 16px;
  }

  .modal-section .form-row.three-cols {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   TOOLBAR ENHANCEMENTS (Mockup 06)
   ============================================ */

/* Icon-Only Button Variant */
.btn-icon-only {
  padding: 8px 12px;
}

.btn-icon-only i {
  margin: 0;
}

/* Selection Info in Table Footer */
.selection-info {
  font-size: 13px;
  color: var(--text-muted);
}

/* Table Footer Layout */
.table-footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.table-footer-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

/* Pagination Info Display */
.pagination-info {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ============================================
   DROPDOWN ENHANCEMENTS
   ============================================ */

/* Dropdown Button with Caret */
.btn-dropdown {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  min-height: 36px;
  border: 1px solid var(--border-color);
  background-color: var(--surface);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-dropdown:hover:not(:disabled) {
  background-color: var(--grey-50);
  text-decoration: none;
  border-color: var(--text-disabled);
}

.btn-dropdown:disabled,
.btn-dropdown[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Dropdown Positioning */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown .dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 200px;
  background-color: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: var(--z-dropdown);
  display: none;
  padding: 4px 0;
}

.dropdown .dropdown-menu.show {
  display: block;
}

.dropdown .dropdown-item {
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color 0.15s;
  display: block;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.dropdown .dropdown-item:hover {
  background-color: var(--grey-100);
  color: var(--text-primary);
}

/* ============================================
   RESPONSIVE TABLE FOOTER
   ============================================ */

@media (max-width: 768px) {
  .table-footer {
    flex-direction: column;
    gap: 16px;
    padding: 16px;
  }

  .table-footer-left,
  .table-footer-right {
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
  }

  .page-size-select {
    order: 1;
  }

  .pagination-info {
    order: 2;
  }

  .pagination {
    order: 3;
    width: 100%;
    justify-content: center;
  }
}

/* ============================================
   ALERT COMPONENTS
   ============================================ */

.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-success {
  background-color: var(--success-bg);
  color: var(--success-text);
  border: 1px solid var(--success-bg);
}

.alert-error {
  background-color: var(--error-light);
  color: var(--error-text);
  border: 1px solid var(--error-bg);
}

.alert-warning {
  background-color: var(--warning-light);
  color: var(--warning-text);
  border: 1px solid var(--warning-bg);
}

.alert-info {
  background-color: var(--primary-light);
  color: var(--primary-text);
  border: 1px solid var(--primary-bg);
}

/* ============================================
   NOTIFICATION BADGE (Header Icons)
   ============================================ */

.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background-color: var(--error-color);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
}

/* ============================================
   BREADCRUMB IMPROVEMENTS (Mockup 06)
   ============================================ */

.breadcrumb {
  padding: 0;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
  background-color: transparent;
  border-bottom: none;
}

/* ============================================
   USER AVATAR (Header)
   ============================================ */

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--secondary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.user-avatar:hover {
  opacity: 0.9;
}

/* ============================================
   FORM ROW GRID (2-Columns)
   ============================================ */

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.form-row:last-child {
  margin-bottom: 0;
}

.form-row.single {
  grid-template-columns: 1fr;
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   ENHANCED CHIP STYLES (Mockup 06)
   ============================================ */

.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

/* ============================================
   TABLE ENHANCEMENTS (Mockup 06)
   ============================================ */

/* Strong text in table cells */
td strong {
  font-weight: 600;
  color: var(--text-primary);
}

/* Table Row Hover Enhancement */
tbody tr {
  transition: background-color 0.15s ease;
}

/* Selected Row */
tbody tr.selected {
  background-color: var(--primary-light);
}

/* ============================================
   SORT INDICATOR ENHANCEMENT (Mockup 06)
   ============================================ */

th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 28px;
  transition: background-color 0.15s;
}

th.sortable:hover {
  background-color: var(--grey-100);
}

/* Double arrow indicator (unsorted state) */
th.sortable::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%) translateY(3px); /* 3px nach unten für Zentrierung als Einheit */
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--sort-arrow-inactive);
}

th.sortable::before {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%) translateY(-3px); /* 3px nach oben für Zentrierung als Einheit */
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 5px solid var(--sort-arrow-inactive);
}

/* Ascending - up arrow active */
th.sortable.sort-asc::before,
th.sortable.asc::before {
  border-bottom-color: var(--primary-color);
}

th.sortable.sort-asc::after,
th.sortable.asc::after {
  border-top-color: var(--sort-arrow-inactive);
}

/* Descending - down arrow active */
th.sortable.sort-desc::after,
th.sortable.desc::after {
  border-top-color: var(--primary-color);
}

th.sortable.sort-desc::before,
th.sortable.desc::before {
  border-bottom-color: var(--sort-arrow-inactive);
}

/* Help Header Actions (Mockup 06) */
.help-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.help-header-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.2s;
}

.help-header-btn:hover {
  background-color: var(--grey-100);
  color: var(--text-primary);
}

/* ============================================
   CONFIRMATION MODAL (Delete Actions)
   ============================================ */

.modal-confirm {
  max-width: 400px;
}

.modal-confirm .modal-header {
  background-color: var(--error-color);
}

.modal-confirm .modal-body {
  text-align: center;
  padding: 32px 24px;
}

.modal-confirm-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: var(--error-light);
  color: var(--error-color);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.modal-confirm-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.modal-confirm-text {
  font-size: 14px;
  color: var(--text-secondary);
}

.modal-confirm .modal-footer {
  justify-content: center;
  gap: 12px;
}

/* ============================================
   LOADING STATES
   ============================================ */

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--grey-100);
  border-top: 2px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.btn-loading {
  position: relative;
  pointer-events: none;
}

.btn-loading::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ============================================
   EMPTY STATE (Tables)
   ============================================ */

td.empty-state {
  height: 150px;
  padding: 0;
}

.empty-state-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 150px;
  color: var(--text-muted);
}

.empty-state-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state-text {
  font-size: 14px;
  color: var(--text-muted);
}

/* ============================================
   RESPONSIVE TABLE FOOTER
   ============================================ */

@media (max-width: 640px) {
  .table-footer {
    padding: 16px 12px;
  }

  .table-footer-left,
  .table-footer-right {
    width: 100%;
    flex-direction: column;
    gap: 12px;
  }

  .page-size-select {
    width: 100%;
    justify-content: space-between;
  }

  .pagination {
    width: 100%;
    justify-content: center;
  }

  .pagination-info {
    text-align: center;
  }
}

/* ============================================
   TOOLBAR RESPONSIVE (Mockup 06)
   ============================================ */

@media (max-width: 768px) {
  .toolbar {
    flex-wrap: wrap;
    gap: 8px;
  }

  .toolbar .btn-new,
  .toolbar .btn-delete,
  .toolbar .btn-action,
  .toolbar .btn-dropdown {
    flex: 1;
    min-width: calc(50% - 4px);
    justify-content: center;
  }

  .toolbar .spacer {
    display: none;
  }

  .toolbar .search-input {
    width: 100%;
    order: -1;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  .header,
  .sidebar,
  .help-sidebar,
  .toolbar,
  .table-footer,
  .btn-edit,
  .checkbox,
  .modal-overlay {
    display: none !important;
  }

  .main-content {
    margin: 0 !important;
    padding: 0 !important;
  }

  .table-card {
    box-shadow: none;
    border: 1px solid var(--grey-light);
  }

  tbody tr:nth-child(even) {
    background-color: var(--grey-50) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ============================================
   TAG POPOVER COMPONENT (Mockup 06)
   Wiederverwendbar für Tag/Schlagwort-Bearbeitung
   ============================================ */

/* Popover Container */
.tag-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 350px;
  background-color: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  z-index: calc(var(--z-dropdown) + 1);
  display: none;
}

.tag-popover.show {
  display: block;
}

/* Popover Header */
.tag-popover-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Popover Body */
.tag-popover-body {
  padding: 16px;
  max-height: 280px;
  overflow-y: auto;
}

/* Tag Current Label */
.tag-current-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

/* Tag Search Input */
.tag-search-wrapper {
  position: relative;
}

.tag-search-input {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  margin-bottom: 8px;
}

/* Tag Suggestions List */
.tag-suggestions {
  display: flex;
  flex-wrap: wrap;
  padding-bottom: 12px;
}

.tag-suggestion-item {
  cursor: pointer;
  transition: background-color 0.15s;
}

/* Popover Footer */
.tag-popover-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-top: 1px solid var(--border-color);
  background-color: var(--grey-50);
}

.tag-selection-info {
  font-size: 13px;
  color: var(--text-muted);
}

.tag-selection-info strong {
  color: var(--primary-color);
}

.tag-popover-actions {
  display: flex;
  gap: 8px;
}

/* Dropdown Button Active State (when selection exists) */
.btn-dropdown.has-selection {
  background-color: var(--grey-50);
  text-decoration: none;
  border-color: var(--text-disabled);
}

/* ============================================
   TAGS CELL ENHANCEMENTS (Mockup 06)
   Klickbare Tags-Zelle mit Edit-Hint
   ============================================ */

/* Tags Cell Editable */
.tags-cell-editable {
  cursor: pointer;
  position: relative;
  padding-right: 28px !important;
}

.tags-cell-editable:hover {
  background-color: var(--grey-100);
}

/* Edit Hint Icon */
.edit-hint {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  color: var(--text-muted);
  transition: opacity 0.15s;
}

.tags-cell-editable:hover .edit-hint {
  opacity: 1;
}

/* ============================================
   TAG POPOVER RESPONSIVE
   ============================================ */

@media (max-width: 480px) {
  .tag-popover {
    width: calc(100vw - 32px);
    left: 50%;
    transform: translateX(-50%);
  }
}

/* ============================================
   MULTISELECT COMPONENT
   Reusable multiselect dropdown with search
   ============================================ */

.multiselect {
  position: relative;
  width: 100%;
}

/* Display (Underline Style) - wie Searchable Select */
.multiselect-display {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 0;
  border: none;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  border-radius: 0;
  background-color: transparent;
  cursor: pointer;
  transition: border-color 0.2s;
}

.multiselect-display:hover {
  border-bottom-color: var(--grey-400, #9ca3af);
}

.multiselect-display:focus {
  outline: none;
  border-bottom-color: var(--primary-color, #007abb);
}

.multiselect.open .multiselect-display {
  border-bottom-color: var(--primary-color, #007abb);
}

/* Tags Container */
.multiselect-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
  min-width: 0;
  align-items: center;
}

/* Individual Tag */
.multiselect-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px 2px 8px;
  background-color: var(--primary-light);
  color: var(--text-primary);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  max-width: 200px;
}

.multiselect-tag .tag-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}

.multiselect-tag .tag-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  background-color: var(--primary-bg);
  border-radius: 2px;
  cursor: pointer;
  color: var(--text-primary);
  transition: all 0.15s;
  flex-shrink: 0;
}

.multiselect-tag .tag-remove:hover {
  background-color: var(--primary-color, #007abb);
  color: white;
}

/* Placeholder */
.multiselect-placeholder {
  color: var(--text-muted, #6b7280);
  font-size: 14px;
}

/* Arrow Icon */
.multiselect-arrow {
  flex-shrink: 0;
  margin-left: 8px;
  color: var(--text-muted, #6b7280);
  transition: transform 0.2s;
}

.multiselect.open .multiselect-arrow {
  transform: rotate(180deg);
}

/* Dropdown */
.multiselect-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background-color: var(--surface, #ffffff);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  overflow: hidden;
}

.multiselect.open .multiselect-dropdown {
  display: block;
}

/* Search Input */
.multiselect-search {
  padding: 8px;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.multiselect-search-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 4px;
  font-size: 14px;
  color: var(--text-primary, #1e293b);
  background-color: var(--surface, #ffffff);
}

.multiselect-search-input:focus {
  outline: none;
  border-color: var(--primary-color, #007abb);
  box-shadow: 0 0 0 3px rgba(0, 122, 187, 0.1);
}

/* Options Container */
.multiselect-options {
  max-height: 240px;
  overflow-y: auto;
}

/* Option Items */
.multiselect-option,
.multiselect-select-all {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-primary, #1e293b);
  transition: background-color 0.1s;
}

.multiselect-option:hover,
.multiselect-select-all:hover {
  background-color: var(--grey-100, #f3f4f6);
}

.multiselect-option.selected,
.multiselect-select-all.selected {
  background-color: var(--primary-light);
  color: var(--text-primary);
}

/* Check Icon */
.multiselect-option .check-icon,
.multiselect-select-all .check-icon {
  flex-shrink: 0;
  margin-left: 8px;
  opacity: 0;
  color: var(--primary-color, #007abb);
  transition: opacity 0.1s;
}

.multiselect-option.selected .check-icon,
.multiselect-select-all.selected .check-icon {
  opacity: 1;
}

/* Select All - Separator */
.multiselect-select-all {
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  font-weight: 500;
}

/* No results message */
.multiselect-no-results {
  padding: 12px;
  text-align: center;
  color: var(--text-muted, #6b7280);
  font-size: 14px;
  font-style: italic;
}

/* ============================================
   SEARCHABLE SELECT (Single Select Dropdown)
   ============================================ */

.searchable-select {
  position: relative;
  width: 100%;
}

.searchable-select-input-wrapper {
  display: flex;
  align-items: center;
  height: auto;
  padding: 0;
  border: none;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  border-radius: 0;
  background-color: transparent;
  cursor: pointer;
  transition: border-color 0.15s;
}

.searchable-select-input-wrapper:hover {
  border-bottom-color: var(--grey-400, #9ca3af);
}

.searchable-select.open .searchable-select-input-wrapper,
.searchable-select-input-wrapper:focus-within {
  border-bottom-color: var(--primary-color, #007abb);
}

.searchable-select.validation-error .searchable-select-input-wrapper {
  border-color: var(--error-color, #c84646);
  box-shadow: 0 0 0 3px rgba(200, 70, 70, 0.15);
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(-5px);
  }
  40%,
  80% {
    transform: translateX(5px);
  }
}

.searchable-select-input {
  flex: 1;
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: #2c3e50;
  padding: 10px 0 !important;
  padding-left: 0 !important;
  font-family: inherit;
  text-align: left !important;
}

.searchable-select-input::placeholder {
  color: var(--text-muted, #9ca3af);
}

.searchable-select-arrow,
.searchable-select-input-wrapper i {
  flex-shrink: 0;
  color: var(--text-muted, #9ca3af);
  transition: transform 0.2s;
  margin-right: 4px;
}

.searchable-select.open .searchable-select-arrow,
.searchable-select.open .searchable-select-input-wrapper i {
  transform: rotate(180deg);
}

.searchable-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  background-color: white;
  border: 1px solid var(--border-color, #d1d5db);
  border-radius: 6px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  margin-top: 4px;
  display: none;
}

.searchable-select.open .searchable-select-dropdown {
  display: block;
}

.searchable-select-option {
  padding: 10px 12px;
  cursor: pointer;
  transition: background-color 0.15s;
  font-size: 14px;
  color: var(--text-color, #374151);
}

.searchable-select-option:hover {
  background-color: var(--grey-100, #f3f4f6);
}

.searchable-select-option.selected {
  background-color: #eff6ff;
  color: var(--primary-color, #2563eb);
  font-weight: 500;
}

.searchable-select-option.focused {
  background-color: var(--grey-200);
}

.searchable-select-no-results {
  padding: 12px;
  text-align: center;
  color: var(--text-muted, #9ca3af);
  font-size: 14px;
}

/* SearchableSelect Display (new component structure) - Underline Style */
.searchable-select-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 8px 0;
  border: none;
  border-bottom: 1px solid var(--border-color, #d1d5db);
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.15s;
}

.searchable-select-display:hover {
  border-bottom-color: var(--grey-400, #9ca3af);
}

.searchable-select.open .searchable-select-display,
.searchable-select-display:focus {
  border-bottom: 2px solid var(--primary-color, #007abb);
  margin-bottom: -0.75px;
}

.searchable-select.disabled .searchable-select-display {
  cursor: not-allowed;
  opacity: 0.7;
}

.searchable-select-text {
  flex: 1;
  font-size: 14px;
  color: var(--text-color, #374151);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}

.searchable-select-text.placeholder {
  color: var(--text-muted, #9ca3af);
}

.searchable-select-icons {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.searchable-select-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: var(--text-muted, #9ca3af);
  transition: background-color 0.15s, color 0.15s;
  cursor: pointer;
}

.searchable-select-clear:hover {
  background-color: #fee2e2;
  color: #dc2626;
}

.searchable-select-arrow,
.searchable-select-input-wrapper i {
  display: flex;
  align-items: center;
  color: var(--text-muted, #9ca3af);
  transition: transform 0.2s;
}

.searchable-select.open .searchable-select-arrow,
.searchable-select.open .searchable-select-input-wrapper i {
  transform: rotate(180deg);
}

/* SearchableSelect Dropdown with Search */
.searchable-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: white;
  border: 1px solid var(--border-color, #d1d5db);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  margin-top: 4px;
  display: none;
  overflow: hidden;
}

.searchable-select-dropdown.show,
.searchable-select.open .searchable-select-dropdown {
  display: block;
}

.searchable-select-search {
  padding: 8px;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.searchable-select-search input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-color, #d1d5db);
  border-radius: 4px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

.searchable-select-search input:focus {
  border-color: var(--primary-color, #007abb);
}

.searchable-select-search input::placeholder {
  color: var(--text-muted, #9ca3af);
}

.searchable-select-options {
  max-height: 200px;
  overflow-y: auto;
}

.searchable-select-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background-color 0.15s;
  font-size: 14px;
  color: var(--text-color, #374151);
}

.searchable-select-option:hover,
.searchable-select-option.focused {
  background-color: var(--grey-100, #f3f4f6);
}

.searchable-select-option.selected {
  background-color: var(--primary-light, #eff6ff);
  color: var(--primary-color, #2563eb);
}

.searchable-select-option .check-icon {
  opacity: 0;
  flex-shrink: 0;
  color: var(--primary-color, #2563eb);
  transition: opacity 0.15s;
}

.searchable-select-option.selected .check-icon {
  opacity: 1;
}

.searchable-select-option .option-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4; /* Ensures descenders (g, p, q, etc.) are visible */
  padding-bottom: 2px; /* Extra space below text to prevent clipping */
}

.searchable-select-empty-option, .no-data {
  color: var(--text-muted, #9ca3af);
  font-style: italic;
}

/* Searchable Select inside Modal - dropdown flows in document */
.modal .searchable-select-dropdown,
.modal-overlay .searchable-select-dropdown {
  z-index: 99999;
}

.modal .searchable-select.open .searchable-select-display,
.modal-overlay .searchable-select.open .searchable-select-display {
  border-bottom-color: var(--primary-color, #007abb);
}

/* ============================================
   CONFIRMATION MODAL COMPONENT
   ============================================ */

.confirmation-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
}

.confirmation-modal.show {
  display: flex;
}

.confirmation-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.confirmation-modal-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  margin: 20px;
  animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.confirmation-modal-content {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.confirmation-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-muted, #9ca3af);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.confirmation-modal-close:hover {
  background-color: #f3f4f6;
  color: var(--text-color, #374151);
}

.confirmation-modal-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 24px 16px;
  text-align: center;
}

.confirmation-modal-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin-bottom: 16px;
}

.confirmation-modal-icon--danger {
  background-color: #fef2f2;
  color: #dc2626;
}

.confirmation-modal-icon--warning {
  background-color: #fffbeb;
  color: #d97706;
}

.confirmation-modal-icon--info {
  background-color: #eff6ff;
  color: #2563eb;
}

.confirmation-modal-icon--success {
  background-color: #f0fdf4;
  color: #16a34a;
}

.confirmation-modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary, #111827);
}

.confirmation-modal-body {
  padding: 0 24px 24px;
  text-align: center;
}

.confirmation-modal-message {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted, #6b7280);
  line-height: 1.5;
}

.confirmation-modal-footer {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  background-color: var(--grey-50);
  border-top: 1px solid var(--grey-200);
}

.confirmation-modal-form {
  display: flex;
  gap: 12px;
  width: 100%;
}

.confirmation-modal-footer .btn {
  flex: 1;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
}

/* ============================================
   STATUS BADGE COMPONENT
   ============================================ */


/* Icon */
.status-badge-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.status-badge-icon i {
  width: 12px;
  height: 12px;
}

/* Dot only variant */
.status-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
}

.status-badge .status-badge-dot {
  width: 6px;
  height: 6px;
}

.status-badge .status-badge-dot {
  width: 10px;
  height: 10px;
}

/* Pulse animation */
.status-badge--pulse .status-badge-dot,
.status-badge--pulse.status-badge--danger {
  animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Outline variants (optional, add outline- prefix to variant) */
.status-badge--outline-success {
  background-color: transparent;
  border: 1px solid #16a34a;
  color: #16a34a;
}

.status-badge--outline-warning {
  background-color: transparent;
  border: 1px solid #d97706;
  color: #d97706;
}

.status-badge--outline-danger {
  background-color: transparent;
  border: 1px solid #dc2626;
  color: #dc2626;
}

.status-badge--outline-info {
  background-color: transparent;
  border: 1px solid #2563eb;
  color: #2563eb;
}

.status-badge--outline-primary {
  background-color: transparent;
  border: 1px solid #4f46e5;
  color: #4f46e5;
}

.status-badge--outline-neutral, .status-badge--resolved {
  background-color: transparent;
  border: 1px solid #6b7280;
  color: #6b7280;
}

/* Page Title with Icon (Mockup 06) */
.page-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-title svg,
.page-title .mdi {
  color: var(--primary-color, #007abb);
}

/* Config Link (Mockup 06) */
.config-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--primary-color, #007abb);
  text-decoration: none;
  transition: color 0.15s;
}

.config-link:hover {
  color: var(--primary-darken, #005a8c);
}

.config-link svg {
  flex-shrink: 0;
}

/* Multiselect Responsive */
@media (max-width: 768px) {
  .multiselect-dropdown {
    max-height: 200px;
  }

  .multiselect-chip {
    font-size: 11px;
    padding: 2px 4px 2px 6px;
  }
}

/* ============================================
   KONTAKT EDIT PAGE STYLES (Mockup 07)
   ============================================ */

/* Grid 3 Columns */
.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
}

.grid-4 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 24px;
}

@media (max-width: 999px) {
  .grid-3 {
    grid-template-columns: 1fr 1fr;
  }

  .grid-4 {
    grid-template-columns: 1fr 1fr;
  }
}

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

  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* Section Title with Icon */
.section-title i {
  color: var(--primary-color);
  flex-shrink: 0;
}

.tag-suggestions-label {
  font-size: 12px;
  color: var(--text-muted, #6b7280);
  width: 100%;
  margin-bottom: 4px;
}

.tag-suggestion:hover {
  cursor: pointer;
}

/* Chip with Remove Button */
.chip-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
  background-color: transparent;
}

/* Status Badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  margin: 1px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;

  /* Default: neutral */
  background: #f3f4f6;
  color: #4b5563;
}

/* Interactive status badges (for filters) */
.status-badge--interactive {
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.status-badge--interactive:hover {
  filter: brightness(0.95);
}

.status-badge--interactive.active {
  box-shadow: 0 0 0 2px currentColor;
}

/* Count badge inside status-badge */
.status-badge-count {
  background-color: rgba(0, 0, 0, 0.1);
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 4px;
}

.status-badge--interactive.active .status-badge-count {
  background-color: rgba(255, 255, 255, 0.3);
}

/* Btn Danger Style */
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  min-height: 36px;
  background-color: var(--error-color);
  color: white;
  border: 1px solid var(--error-color);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-danger:hover {
  background-color: var(--error-darken);
}

/* Modal Warning Header */
.modal-header.warning {
  background-color: var(--warning-color);
}

/* for commonModal cancel edit!!! */
.modal-header.warning h2,
.modal-header.warning i {
  color: white;
}

/* Modal Danger Header */
.modal-header.danger,
.modal-danger .modal-header {
  background-color: var(--error-color);
  border-bottom-color: var(--error-darken);
}

.modal-header.danger h2,
.modal-header.danger i,
.modal-danger .modal-header h2,
.modal-danger .modal-header i {
  color: white;
}

.modal-danger .modal-close {
  color: white;
}

.modal-danger .modal-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}

/* Modal Buttons */
.btn-modal-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  min-height: 36px;
  background-color: var(--surface);
  color: var(--text-secondary, #4b5563);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-modal-cancel:hover {
  background-color: var(--grey-100, #f3f4f6);
}

.btn-modal-save {
  padding: 10px 20px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-modal-save:hover {
  background-color: var(--primary-darken);
}

.btn-modal-save:disabled {
  background-color: var(--primary-color);
  color: white;
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-modal-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  min-height: 36px;
  background-color: var(--error-color);
  color: white;
  border: 1px solid var(--error-color);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-modal-delete:hover {
  background-color: var(--error-darken, #a63939);
}

.btn-modal-warning {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  min-height: 36px;
  background-color: var(--warning-color);
  color: white;
  border: 1px solid var(--warning-color);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-modal-warning:hover {
  background-color: var(--warning-darken, #b36b00);
}

.btn-modal-warning:disabled {
  background-color: var(--warning-color);
  color: white;
  opacity: 0.6;
  cursor: not-allowed;
}

/* Contact Name Display in Modal */
.contact-name-display {
  font-weight: 600;
  color: #1e293b;
  background-color: #f3f4f6;
  padding: 12px 16px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Contact List Display in Delete Modal (List View) */
.contact-list-display {
  margin-top: 12px;
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-list-display:empty {
  display: none;
}

.contact-list-item {
  font-weight: 500;
  color: #1e293b;
  background-color: #f3f4f6;
  padding: 10px 14px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.contact-list-item svg {
  flex-shrink: 0;
  color: #6b7280;
}

/* Page Subtitle */
.page-subtitle {
  font-size: 14px;
  color: var(--text-muted, #6b7280);
  padding-left: 16px;
  border-left: 1px solid var(--border-color);
}

/* Disabled Input Style */
.form-input:disabled,
.form-input[disabled] {
  background-color: transparent;
  border-bottom: 1px solid var(--grey-200);
  cursor: text;
}

/* ============================================
   AUFTRAGSVERARBEITUNG (ADV) STYLES - Mockup 16
   ============================================ */

/* Sub-Navigation (Tab Bar) */
.sub-navigation {
  background: var(--surface, #ffffff);
  border-bottom: 2px solid var(--border-color, #e5e7eb);
  display: flex;
  gap: 4px;
  padding: 0 24px;
}

.sub-nav-item {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted, #6b7280);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

a.sub-nav-item {
  text-decoration: none;
}

a.sub-nav-item:hover {
  text-decoration: none;
}

.sub-nav-item:hover {
  color: var(--primary-color, #007abb);
  background: var(--grey-50, #f9fafb);
  border-bottom: 2px solid var(--border-color, #e5e7eb);
}

.sub-nav-item.active:hover {
  color: var(--primary-color, #007abb);
  background: var(--grey-50, #f9fafb);
  border-bottom-color: var(--primary-color, #007abb);
}

.sub-nav-item.disabled {
  color: var(--grey-400, #9ca3af);
  cursor: not-allowed;
  opacity: 0.5;
  pointer-events: none;
}

.sub-nav-item.active {
  color: var(--primary-color, #007abb);
  border-bottom-color: var(--primary-color, #007abb);
  background: transparent;
}

.sub-nav-badge {
  background: var(--primary-color, #007abb);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* Benutzerdefinierte Status */
.status-badge.custom-positiv,
.status-badge--success,
.status-badge.vertrag-abgeschlossen,
.status-badge.geprueft-ok,
.status-badge.erledigt,
.status-badge.scope-read,
.status-badge.status-erledigt,
.status-badge.status-aktiv,
.searchable-select-display.status-success,
.risk-badge.low,
.status-badge.aktiv,
.status-active,
.risk-badge.gering,
.status-complete,
.status-success,
.status-badge.on {
  background: var(--success-bg, #dcfce7);
  color: var(--success-text, #166534);
}

.status-badge.custom-negativ,
.status-badge--danger,
.status-badge.vertrag-fehlt,
.status-badge.geprueft-maengel,
.status-badge.frist-abgelaufen,
.status-badge.inaktiv,
.status-badge.important,
.status-danger,
.status-error,
.status-badge--invalid,
.searchable-select-display.status-error,
.risk-badge.high,
.risk-badge.hoch{
  background: var(--error-bg, #fee2e2);
  color: var(--error-text, #991b1b);
}

.status-badge--very-high{
  background: var(--error-darken, #991b1b);
  color: var(--surface, #fff);
}

.status-badge.custom-neutral,
.status-badge--neutral,
.status-badge.beendet,
.status-badge.neutral,
.status-badge.status-abgeschlossen,
.status-inactive,
.status-neutral,
.searchable-select-display.status-neutral,
.risk-badge.unbekannt {
  background: var(--grey-100, #f3f4f6);
  color: var(--text-muted, #6b7280);
}

.status-badge.offen,
.status-badge--open,
.status-offen,
.status-badge.status-entwurf,
.searchable-select-display.status-offen,
.status-new {
  background: var(--primary-light, #dbeafe);
  color: var(--text-primary, #1e293b);
}

.status-badge.vertrag-bearbeitung,
.status-badge--warning,
.status-badge.zur-pruefung,
.status-badge.in-bearbeitung,
.status-badge.status-in-bearbeitung,
.status-badge.status-pruefung,
.status-badge.entwurf,
.status-badge.scope-write,
.status-warning,
.searchable-select-display.status-warning,
.risk-badge.medium,
.risk-badge.mittel,
.status-inprogress,
.status-invited,
.wartet,
.status-deactivated {
  background: var(--warning-bg, #fef3c7);
  color: var(--warning-text, #92400e);
}

/* Personen-Status: Archiviert */
.status-archived,
.status-badge.status-archiviert,
.status-badge.off,
.nicht_relevant,
.status-badge.inactive {
  background: var(--grey-200, #e5e7eb);
  color: var(--text-secondary, #4b5563);
}

.status-badge--info,
.status-badge.info,
.status-badge.in-pruefung,
.status-badge.pruefung {
  background-color: var(--info-bg, #dbeafe);
  color: var(--info-text, #1e40af);
}

.status-badge--primary,
.status-badge.online-vertrag {
  background-color: var(--primary-bg, #e0e7ff);
  color: var(--primary-text, #3730a3);
}

.risk-badge.low::before,
.risk-badge.gering::before {
  background: var(--success-text, #166534);
}

.risk-badge.medium::before,
.risk-badge.mittel::before {
  background: var(--warning-text, #92400e);
}

.risk-badge.high::before,
.risk-badge.hoch::before {
  background: var(--error-text, #991b1b);
}

.risk-badge.unbekannt::before {
  background: var(--text-muted, #6b7280);
}

/* Contract Status */
.contract-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.contract-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted, #94a3b8);
}

.contract-status.valid .dot {
  background: var(--success-color, #7ea820);
}

.contract-status.pending .dot {
  background: var(--warning-color, #cc7a00);
}

.contract-status.missing .dot {
  background: var(--error-color, #c84646);
}

/* Schutzbedarf Badges (shared: Asset + Informationswerte) */
.schutzbedarf-cell {
  display: flex;
  gap: 4px;
}

.sb-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.sb-badge--normal {
  background: #ecfdf5;
  color: #059669;
}

.sb-badge--hoch {
  background: #fef3c7;
  color: #d97706;
}

.sb-badge--sehr-hoch {
  background: #fef2f2;
  color: #dc2626;
}

.sb-badge--none {
  background: var(--grey-200, #f3f4f6);
  color: var(--text-muted, #9ca3af);
}

/* Count Badge */
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--grey-200, #f0f0f0);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary, #666);
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  margin: 1px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 12px;
  background: var(--primary-bg);
  color: var(--text-primary);
  vertical-align: middle;
  max-width: 150px;
  cursor: default;
  box-sizing: border-box;
  overflow: hidden;
}
.tag-chip .chip-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.4;
}
.tag-chip .chip-remove:hover {
  opacity: 1;
  background-color: var(--primary-color);
  color: var(--surface);
}

.tag-chip:hover {
  background-color: color-mix(in srgb, var(--primary-bg), #000 5%);
}

/* Tags Wrapper für Tabellenzelle - dynamische Anzeige */
.tags-wrapper {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
}

.tags-wrapper .tag-chip {
  display: inline-block;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}

.tags-wrapper .tag-chip.tag-more {
  background: var(--grey-200);
  color: #4b5563;
  cursor: default;
  max-width: none;
  overflow: visible;
  flex-shrink: 0;
}

/* Versteckte Tags für Overflow-Berechnung */
.tags-wrapper .tag-chip.tag-hidden {
  display: none !important;
}

/* Link Cell for Table (clickable) */
.link-cell {
  color: var(--primary-color, #007abb);
  cursor: pointer;
}

.link-cell:hover {
  text-decoration: underline;
}

/* Checkbox Cell */
.checkbox-cell {
  width: 48px;
}

.checkbox-cell input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Import Button */
.btn-import {
  padding: 8px 16px;
  background: var(--surface, #ffffff);
  color: var(--text-secondary, #374151);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-import:hover {
  background: var(--hover-bg, #f3f4f6);
  border-color: var(--primary-color, #007abb);
  color: var(--primary-color, #007abb);
}

/* Filter Checkbox (for "hide ended" option) */
.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 24px;
}

.filter-checkbox input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.filter-checkbox label {
  font-size: 14px;
  color: var(--text-secondary, #374151);
  cursor: pointer;
}

/* ============================================
   ADV EDIT FORM - Additional Styles
   ============================================ */

/* Section Anchor for smooth scroll */
.section-anchor {
  scroll-margin-top: 180px;
}

/* Submit Section (Zur Prüfung einreichen) */
.submit-section {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  margin-top: 16px; /* Wie zwischen den Cards */
}

.submit-section.highlight {
  border: 2px solid var(--primary-color);
  background: var(--primary-light);
}

.submit-checkbox-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.submit-checkbox {
  width: 20px;
  height: 20px;
  min-width: 20px;
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

.submit-label {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
  cursor: pointer;
}

.submit-description {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.5;
}

/* VVT Table */
.vvt-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.vvt-table th,
.vvt-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
}

.vvt-table th {
  background: var(--grey-50);
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.vvt-table tr:hover {
  background: var(--grey-50);
}

.vvt-table tr:last-child td {
  border-bottom: none;
}

.vvt-link {
  color: var(--primary-color);
  text-decoration: none;
}

.vvt-link:hover {
  text-decoration: underline;
}

/* Add Button*/
.btn-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--surface);
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  margin-top: 12px;
  transition: all 0.2s;
}

.btn-add:hover {
  background: var(--primary-light);
}

/* Icon Toolbar Button */
.btn-icon-toolbar {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-color);
  background: transparent;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  position: relative;
  transition: all 0.2s;
}

.btn-icon-toolbar:hover {
  background: var(--hover-bg);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.btn-icon-toolbar .badge {
  position: absolute;
  top: -6px;
  right: -6px;
}

/* Risk Badge */
.risk-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  width: fit-content;
}

.risk-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Inline Input Group */
.inline-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-input-group .form-input {
  width: 100px;
}

.inline-input-group span {
  color: var(--text-secondary);
  font-size: 14px;
}

/* Section Card (alternative to form-section) */
.section-card {
  background: var(--surface, #ffffff);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: var(--radius-lg, 8px);
  padding: 24px;
  margin-bottom: 12px;
}

.section-card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary, #111827);
  margin: 0 0 20px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
}

/* QR Code Section */
.qr-code-section {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  padding: 20px;
  background-color: var(--bg-secondary, #f8fafc);
  border-radius: 8px;
  margin-top: 24px;
}

.qr-code-container {
  width: 150px;
  height: 150px;
  background-color: #fff;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.qr-code-container img {
  max-width: 100%;
  max-height: 100%;
}

.qr-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted, #9ca3af);
  font-size: 12px;
  text-align: center;
  padding: 10px;
}

.qr-code-info {
  flex: 1;
}

.qr-code-info h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #1e293b);
  margin: 0 0 8px 0;
}

.qr-code-info p {
  font-size: 13px;
  color: var(--text-secondary, #6b7280);
  margin: 0 0 16px 0;
  line-height: 1.5;
}

@media (max-width: 576px) {
  #tab-weitere .qr-code-section {
      flex-direction: column;
      align-items: center;
      text-align: center;
  }

  #tab-weitere .qr-code-info {
      width: 100%;
  }
}

/* Tab Navigation as Anchor Links */
.tab-navigation a.tab-item {
  text-decoration: none;
}

.tab-navigation a.tab-item:hover {
  text-decoration: none;
}

/* ============================================
   LIST PAGE LAYOUT - Table & Filter Scrolling
   ============================================ */
/* Seite scrollt NICHT - nur Tabelle und ggf. Filter scrollen intern */

/* Filter-Panel kann scrollen wenn sehr viele Filter */
.filter-content {
  max-height: 300px;
  overflow-y: auto;
}

/* Tabellen-Container - füllt den Platz bis zum Footer */
.table-card > .table-container {
  flex: 1 1 100%;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;
}

/* Sticky Header für scrollbare Tabelle */
.table-container thead {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface, #ffffff);
}

.table-container thead th {
  background: var(--grey-50, #f9fafb);
}

/* DataTable Wrapper - füllt verfügbaren Platz */
.datatable-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* Table Card - füllt den Wrapper */

.table-card {
  background-color: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0; /* Erlaubt Schrumpfen auf Content-Höhe */
  overflow: hidden; /* Verhindert Überlauf */
}

/* Table Card - füllt den Wrapper komplett aus */
.datatable-wrapper > .table-card {
  flex: 1 1 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background-color: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  position: relative;
  z-index: 1;
}

/* ============================================
   DATATABLE LINK STYLING
   ============================================ */

.data-link {
  color: inherit;
  text-decoration: none;
  font-weight: normal;
  transition: color 0.2s ease;
  padding: 8px 2px;
}

.data-link:hover {
  color: var(--primary-color);
  text-decoration: none;
}

.data-link i {
  margin-left: 4px;
}

/* ============================================
   SHARED COMPONENTS
   Reusable components across all pages
   ============================================ */

/* Language Switcher Component */
.language-switcher {
  position: fixed;
  top: 16px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 4px;
  background-color: var(--surface);
  border: 1px solid var(--grey-200);
  border-radius: 6px;
  padding: 6px 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 100;
}

.language-switcher--inline {
  position: static;
  box-shadow: none;
  border: none;
  background: transparent;
  padding: 0;
}

.language-switcher svg,
.language-switcher .mdi {
  width: 16px;
  height: 16px;
  color: var(--primary-color);
  flex-shrink: 0;
}

.language-switcher .mdi {
  font-size: 18px;
  width: auto;
  height: auto;
}

.language-btn {
  padding: 4px 8px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.2s;
}

.language-btn:hover {
  color: var(--primary-color);
  background: var(--grey-100);
  text-decoration: none;
}

.language-btn.active {
  color: var(--primary-color);
  font-weight: 600;
  background: var(--primary-bg);
}

.language-divider {
  width: 1px;
  height: 16px;
  background-color: var(--grey-200);
}

/* Language Switcher Form-Button Styling (für POST-basierte Sprachwechsel) */
.language-switcher form {
  display: inline;
  margin: 0;
  padding: 0;
}

.language-switcher form button.language-btn {
  font-family: inherit;
}

/* Help Sidebar Responsive */
@media (max-width: 1200px) {
  :root {
    --help-width: 300px;
    --help-width-wide: 420px;
  }

  /* Overlay statt Push */
  .main-content.help-open {
    margin-right: 0;
  }

  .main-content.help-open.help-wide {
    margin-right: 0;
  }

  .help-sidebar.open {
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.15);
  }
}

/* Help Sidebar Mobile Fullscreen */
@media (max-width: 768px) {
  .help-sidebar {
    width: 100vw;
    top: 0;
    height: 100vh;
    border-left: none;
  }

  .help-sidebar:not(.open) {
    right: -100vw;
  }

  .help-sidebar.wide {
    width: 100vw;
  }

  .help-sidebar.wide:not(.open) {
    right: -100vw;
  }

  /* Breiten-Toggle auf Mobile ausblenden */
  .help-sidebar #helpWidthToggle {
    display: none;
  }
}
