/* ===============================================
   LAYOUT STYLES - Haupt-Container-Struktur
   =============================================== */

/* Benutzername-Anzeige inline in der Tab-Zeile */
.user-display-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  margin-left: auto; /* Schiebt das Element ganz nach rechts */
  transform: translateY(-50%); /* Zentriert das Feld genau zwischen Linie und oberem Rand */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  min-width: fit-content;
  max-width: 220px;
  box-sizing: border-box;
  flex-shrink: 0; /* Verhindert Schrumpfen */

  /* 🎬 ROLL-EFFEKT: Animation wird per JavaScript gestartet */
  transform-origin: top center;
  z-index: 1001; /* Höher als Toast-Container (10000) */
  position: relative; /* Für z-index */
  will-change: transform, opacity; /* Performance-Optimierung */

  /* Initial sichtbar - Animation kann später ausgelöst werden */
  opacity: 1;
  transform: translateY(-50%);

  /* Falls Animation später ausgelöst werden soll, kann das per JS gemacht werden */
  /* opacity: 0;
  transform: translateY(-50%) rotateX(-90deg) translateY(-30px); */
}

/* 🎬 ROLL-EFFEKT: CSS-Klasse für Animation */
.user-display-inline.animate-roll-in {
  animation: rollInFromTop 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* 🎬 ROLL-EFFEKT: Keyframes für das Herunterrollen - Optimiert für Flüssigkeit */
@keyframes rollInFromTop {
  0% {
    transform: translateY(-50%) rotateX(-90deg) translateY(-30px);
    opacity: 0;
    filter: blur(2px);
  }
  30% {
    transform: translateY(-50%) rotateX(-60deg) translateY(-15px);
    opacity: 0.3;
    filter: blur(1px);
  }
  60% {
    transform: translateY(-50%) rotateX(-20deg) translateY(-5px);
    opacity: 0.8;
    filter: blur(0px);
  }
  100% {
    transform: translateY(-50%) rotateX(0deg) translateY(0);
    opacity: 1;
    filter: blur(0px);
  }
}

/* 🎬 HOVER-EFFEKT: Sanfter Hover-Effekt ohne Bewegung */
.user-display-inline:hover {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transform: translateY(-50%) scale(1.02);
  transition: all 0.2s ease-in-out;
}

/* Hover-Effekt */
.user-display-inline:hover {
  background: rgba(45, 55, 72, 0.95);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.user-info-inline {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0; /* Erlaubt Schrumpfen für Text-Overflow */
  flex: 1;
  align-items: center;
}

.user-label-inline {
  font-size: 10px;
  color: var(--text-light);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1;
  white-space: nowrap;
}

.user-name-inline {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-color);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  flex: 1;
}

/* 🔒 INLINE-TIMER-ANZEIGE: Rechts neben dem Stift-Icon */
.own-timer-inline {
  display: flex;
  align-items: center;
  margin-left: 8px;
  margin-right: 8px;
  animation: slideInFromRight 0.3s ease-out forwards;
  transform-origin: right;
}

/* Animation für das Einblenden des Inline-Timers */
@keyframes slideInFromRight {
  0% {
    opacity: 0;
    transform: translateX(10px) scaleX(0.8);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scaleX(1);
  }
}

.own-timer-display {
  font-size: 10px;
  font-weight: 600;
  color: #27ae60;
  line-height: 1;
  font-family: 'Courier New', monospace;
  background: rgba(39, 174, 96, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(39, 174, 96, 0.2);
  text-align: center;
  min-width: 32px;
  transition: all 0.3s ease;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  pointer-events: auto;
}

/* 🔒 TIMER-CLICK-EFFEKT: Visueller Feedback beim Klicken */
.own-timer-display:active {
  transform: scale(0.95);
  background: rgba(39, 174, 96, 0.2);
}

.own-timer-display:hover {
  background: rgba(39, 174, 96, 0.15);
  border-color: rgba(39, 174, 96, 0.3);
}

/* 🔒 TIMER-ZUSTÄNDE: Verschiedene Farben für verschiedene Timer-Phasen */
.own-timer-display.timer-warning {
  color: #e67e22;
  background: rgba(230, 126, 34, 0.15);
  border-color: rgba(230, 126, 34, 0.3);
  font-weight: 700;
}

.own-timer-display.timer-warning:hover {
  background: rgba(230, 126, 34, 0.2);
  border-color: rgba(230, 126, 34, 0.4);
}

.own-timer-display.timer-warning:active {
  background: rgba(230, 126, 34, 0.25);
}

.own-timer-display.timer-critical {
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.2);
  border-color: rgba(231, 76, 60, 0.4);
  font-weight: 700;
  animation: pulse 1s infinite;
}

.own-timer-display.timer-critical:hover {
  background: rgba(231, 76, 60, 0.25);
  border-color: rgba(231, 76, 60, 0.5);
}

.own-timer-display.timer-critical:active {
  background: rgba(231, 76, 60, 0.3);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* für Inline-Timer */
.own-timer-display {
  color: #2ecc71;
  background: rgba(46, 204, 113, 0.15);
  border-color: rgba(46, 204, 113, 0.3);
}

/* für Timer-Warnung (Orange) */
.own-timer-display.timer-warning {
  color: #f39c12;
  background: rgba(243, 156, 18, 0.2);
  border-color: rgba(243, 156, 18, 0.4);
  font-weight: 700;
}

.own-timer-display.timer-warning:hover {
  background: rgba(243, 156, 18, 0.25);
  border-color: rgba(243, 156, 18, 0.5);
}

.own-timer-display.timer-warning:active {
  background: rgba(243, 156, 18, 0.3);
}

/* für Timer-Kritisch (Rot) */
.own-timer-display.timer-critical {
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.25);
  border-color: rgba(231, 76, 60, 0.5);
  font-weight: 700;
}

.own-timer-display.timer-critical:hover {
  background: rgba(231, 76, 60, 0.3);
  border-color: rgba(231, 76, 60, 0.6);
}

.own-timer-display.timer-critical:active {
  background: rgba(231, 76, 60, 0.35);
}

.user-change-btn-inline {
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  color: var(--text-light);
  border-radius: 3px;
  flex-shrink: 0;
}

.user-change-btn-inline:hover {
  background: var(--primary-color);
  color: white;
  transform: scale(1.1);
}

.user-change-btn-inline svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* Anpassungen für Inline-Benutzername */
.user-display-inline {
  background: rgba(45, 55, 72, 0.8);
  border-color: #4a5568;
}

.user-label-inline {
  color: #a0aec0;
}

.user-name-inline {
  color: #63b3ed;
}

.user-change-btn-inline {
  color: #a0aec0;
}

.user-change-btn-inline:hover {
  background: #3182ce;
  color: white;
}

/* Haupt-App-Container - 50/50 BASIS */
.app-container {
  display: flex !important;
  flex: 1;
  flex-direction: row !important;
  overflow: hidden;
  min-height: 100vh;
  height: 100vh;
  width: 100% !important;
}

/* Sidebar - Flexible Breite mit Minimum */
.sidebar {
  flex: 0 0 60%;
  width: 60%;
  min-width: 300px;
  max-width: 75%;
  padding: 0;
  border-right: none; /* Entfernt, da Resizer die Trennlinie übernimmt */
  box-sizing: border-box;
  height: 100vh;
  max-height: 100vh; /* 🔧 NEU: Verhindert Überlauf */
  position: sticky;
  top: 0;
  overflow: hidden; /* 🔧 GEÄNDERT: Keine Scrollbar in Sidebar selbst */
  background-color: #f9f9f9;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: width 0.1s ease;
  /* Wichtig: Flex-Eigenschaften für Resizing */
  flex-shrink: 0;
  flex-grow: 0;
}

/* Preview Area - Flexible Breite */
.preview-area {
  flex: 1;
  width: auto;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: #fafafa;
  min-height: 100vh;
  /* Padding/Margin entfernt für volle Breite */
  padding: 0 !important;
  margin: 0 !important;
  transition: width 0.1s ease;
  /* Wichtig: Flex-Eigenschaften für Resizing */
  flex-shrink: 1;
  flex-grow: 1;
}

/* Thumbnails-Container volle Breite im Preview-Bereich */
.preview-area > .thumbnails-container {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box;
}

/* ===============================================
   EINHEITLICHE TAB NAVIGATION STYLES
   =============================================== */

/* Input Tabs Container */
.input-tabs {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1px;
  padding-top: 14px; /* 🔧 ERHÖHT: Mehr Platz oben für User-Bereich (von 10px auf 14px - Kompromiss) */
  padding-right: var(--spacing-md);
  padding-bottom: 0;
  padding-left: var(--spacing-md);
  box-sizing: border-box;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0; /* 🔧 NEU: Verhindert Schrumpfen */
}

/* 🎯 KRITISCHE REGEL: Einheitliche Tab-Button-Styles für alle Tabs */
.input-tabs .tab-button {
  padding: 6px 12px 4px 12px !important; /* 🔧 REDUZIERT: Von 8px 15px auf 6px 12px, padding-bottom auf 4px für weniger Abstand zur Linie */
  background: none !important;
  border: none !important;
  cursor: pointer !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  color: var(--text-light) !important;
  transition: all var(--transition-normal) !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  position: relative !important;
  border-radius: 0 !important;
  margin: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
  background-color: transparent !important;
  background-image: none !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  border-bottom: 0 !important;
}

.input-tabs .tab-icon {
  width: 18px !important;
  height: 18px !important;
  fill: currentColor !important;
  transition: fill var(--transition-normal) !important;
}

/* 🎯 KRITISCHE REGEL: Einheitliche Hover-Styles für alle Tabs */
.input-tabs .tab-button:hover {
  color: #ff6b6b !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  background-color: transparent !important;
  background-image: none !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  border-bottom: 0 !important;
}

/* 🆕 Database Action Buttons: Wie Tabs aussehen, aber keine rote Unterlinie */
.input-tabs .tab-button.database-action-button {
  /* Erbt alle Tab-Styles, aber keine active-Markierung */
}

.input-tabs .tab-button.database-action-button:hover {
  color: #ff6b6b !important;
  /* Keine rote Unterlinie beim Hover */
  border-bottom: 0 !important;
}

.input-tabs .tab-button.database-action-button:active {
  color: #ff6b6b !important;
  /* Keine rote Unterlinie beim Klicken */
  border-bottom: 0 !important;
}

/* 🎯 KRITISCHE REGEL: Einheitliche Aktive-Styles für alle Tabs */
.input-tabs .tab-button.active {
  color: #ff6b6b !important;
  border-bottom: 3px solid #ff6b6b !important;
  background: none !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
  font-weight: 500 !important;
  background-color: transparent !important;
  background-image: none !important;
  border-bottom-color: #ff6b6b !important;
}

/* 🎯 KRITISCHE REGEL: Einheitliche Aktive-Styles mit Focus/Hover für alle Tabs */
.input-tabs .tab-button.active,
.input-tabs .tab-button.active:hover,
.input-tabs .tab-button.active:focus {
  background: none !important;
  background-color: transparent !important;
  background-image: none !important;
  border-bottom: 3px solid #ff6b6b !important;
  border-bottom-color: #ff6b6b !important;
  color: #ff6b6b !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

/* 🎯 KRITISCHE REGEL: Pseudo-Elemente entfernen */
.input-tabs .tab-button.active *,
.input-tabs .tab-button.active::before,
.input-tabs .tab-button.active::after {
  background: none !important;
  background-color: transparent !important;
  background-image: none !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* ===============================================
   VERSCHIEBBARE TRENNLINIE (RESIZER)
   =============================================== */

/* Verschiebbare Trennlinie zwischen Sidebar und Preview */
.resizer {
  position: relative;
  width: 8px;
  background: var(--border-color);
  cursor: col-resize;
  user-select: none;
  z-index: 1000;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 8px;
  max-width: 8px;
  flex-shrink: 0;
  /* Wichtig: Events nicht blockieren */
  pointer-events: auto;
  touch-action: none;
}

.resizer:hover {
  background: var(--primary-color);
}

.resizer:active {
  background: var(--primary-color);
}

/* Resizer-Handle mit Icon */
.resizer-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 60px;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.resizer:hover .resizer-handle {
  opacity: 1;
}

.resizer-handle svg {
  width: 16px;
  height: 16px;
  fill: var(--text-light);
  transition: fill 0.2s ease;
}

.resizer:hover .resizer-handle svg {
  fill: white;
}

/* Cursor-Änderung beim Verschieben */
.resizer.resizing {
  background: var(--primary-color);
  cursor: col-resize;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.resizer.resizing .resizer-handle {
  opacity: 1;
}

.resizer.resizing .resizer-handle svg {
  fill: white;
}

/* Zusätzliche visuelle Rückmeldung */
.resizer:active {
  background: var(--primary-color);
  transform: scale(1.1);
}

/* Styles für Resizer */
.resizer {
  background: var(--border-color-dark);
}

.resizer:hover {
  background: var(--primary-color);
}

.resizer-handle svg {
  fill: var(--text-light-dark);
}

.resizer:hover .resizer-handle svg {
  fill: white;
}

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

/* Sidebar */
.sidebar {
  background-color: #333;
  border-right-color: #444;
}

/* Preview Area */
.preview-area {
  background-color: #2a2a2a;
}

/* Tab Navigation */
.input-tabs {
  border-bottom-color: #444;
}

/* =============================================== TAB NAVIGATION STYLES
   =============================================== */

/* 🎯 KRITISCHE REGEL: Einheitliche Tab-Button-Styles für alle Tabs */
.input-tabs .tab-button {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 8px 15px !important;
  color: #aaa !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  transition: all var(--transition-normal) !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  position: relative !important;
  outline: none !important;
  background-color: transparent !important;
  background-image: none !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  border-bottom: none !important;
  text-shadow: none !important;
}

.input-tabs .tab-button:hover {
  color: #ff6b6b !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  background-color: transparent !important;
  background-image: none !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  border-bottom: 0 !important;
}

.input-tabs .tab-button.active {
  color: #ff6b6b !important;
  border-bottom: 3px solid #ff6b6b !important;
  background: none !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
  font-weight: 500 !important;
  background-color: transparent !important;
  background-image: none !important;
  border-bottom-color: #ff6b6b !important;
}

.input-tabs .tab-button.active,
.input-tabs .tab-button.active:hover,
.input-tabs .tab-button.active:focus {
  background: none !important;
  background-color: transparent !important;
  background-image: none !important;
  border-bottom: 3px solid #ff6b6b !important;
  border-bottom-color: #ff6b6b !important;
  color: #ff6b6b !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

/* 🚨 ULTIMATIVE REGEL: Überschreibe ALLE anderen CSS-Regeln für Datenbank-Tab */
.input-tabs .tab-button[data-tab='database'].active,
.input-tabs .tab-button[data-tab='database'].active:hover,
.input-tabs .tab-button[data-tab='database'].active:focus,
.input-tabs .tab-button[data-tab='database'].active *,
.input-tabs .tab-button[data-tab='database'].active::before,
.input-tabs .tab-button[data-tab='database'].active::after {
  color: #ff6b6b !important;
  border-bottom: 3px solid #ff6b6b !important;
  border-bottom-color: #ff6b6b !important;
  background: none !important;
  background-color: transparent !important;
  background-image: none !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
  font-weight: 500 !important;
  border: none !important;
}

/* 🚨 FINALE ULTIMATIVE REGEL: Höchste Spezifität für Datenbank-Tab */
html .input-tabs .tab-button[data-tab='database'].active,
html .input-tabs .tab-button[data-tab='database'].active:hover,
html .input-tabs .tab-button[data-tab='database'].active:focus,
html .input-tabs .tab-button[data-tab='database'].active *,
html .input-tabs .tab-button[data-tab='database'].active::before,
html .input-tabs .tab-button[data-tab='database'].active::after {
  color: #ff6b6b !important;
  border-bottom: 3px solid #ff6b6b !important;
  border-bottom-color: #ff6b6b !important;
  background: none !important;
  background-color: transparent !important;
  background-image: none !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
  font-weight: 500 !important;
  border: none !important;
}

/* Container für Tab-Buttons (links) */
.tab-buttons-container {
  display: flex;
  align-items: center;
  gap: 0;
}

/* Tab Content */
.tab-content {
  display: none;
  padding: var(--spacing-md); /* 🔧 REDUZIERT: Von lg (20px) auf md (15px) */
  width: 100%;
  box-sizing: border-box;
  flex: 1 1 auto; /* 🔧 NEU: Nimmt verfügbaren Platz ein */
  min-height: 0; /* 🔧 NEU: Ermöglicht Schrumpfen */
  overflow-y: auto; /* 🔧 NEU: Scrollbar nur im Content, nicht in Sidebar */
}

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

/* Spezielle Flexbox-Konfiguration für Database-Tab */
#database-tab.tab-content.active {
  display: flex;
  flex-direction: column;
  height: calc(
    100vh - 64px
  ); /* 🔧 ANGEPASST: Nutze volle Höhe minus Tab-Zeile (60px + 4px mehr Padding) */
  max-height: calc(100vh - 64px); /* 🔧 NEU: Verhindert Überlauf */
  min-height: 0; /* 🔧 NEU: Ermöglicht Schrumpfen */
  padding: 0; /* 🔧 REDUZIERT: Kein Padding, nutze volle Höhe */
  box-sizing: border-box;
  overflow: hidden; /* 🔧 NEU: Scrollbar nur in inneren Containern */
}

/* Split-Screen Modi - Flexible Breiten */
.split-screen .app-container {
  flex-direction: row;
}

.split-screen .sidebar {
  flex: 0 0 60%;
  width: 60%;
  min-width: 300px;
  max-width: 75%;
  /* Wichtig: Flex-Eigenschaften für Resizing */
  flex-shrink: 0;
  flex-grow: 0;
}

.split-screen .preview-area {
  flex: 1;
  width: auto;
  min-width: 200px;
  /* Wichtig: Flex-Eigenschaften für Resizing */
  flex-shrink: 1;
  flex-grow: 1;
}

.split-screen .mobile-tabs {
  display: none;
}

/* Always-Split - Flexible Breiten */
.always-split .app-container {
  flex-direction: row !important;
}

.always-split .sidebar {
  flex: 0 0 60%;
  width: 60%;
  min-width: 300px;
  max-width: 75%;
  /* Wichtig: Flex-Eigenschaften für Resizing */
  flex-shrink: 0;
  flex-grow: 0;
}

.always-split .preview-area {
  flex: 1;
  width: auto;
  min-width: 200px;
  /* Wichtig: Flex-Eigenschaften für Resizing */
  flex-shrink: 1;
  flex-grow: 1;
}

/* Split-View Toggle Button */
.split-view-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  background: var(--primary-color);
  border: none;
  border-radius: var(--border-radius-sm);
  padding: 8px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.split-view-toggle:hover {
  background: var(--primary-hover);
  transform: scale(1.05);
}

.split-view-toggle svg {
  width: 20px;
  height: 20px;
  fill: white;
}

/* Mobile Tabs */
.mobile-tabs {
  display: none;
  flex-direction: row;
  background: white;
  border-bottom: 1px solid var(--border-color);
  padding: 0;
}

.mobile-tab-button {
  flex: 1;
  padding: 12px 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all var(--transition-normal);
}

.mobile-tab-button.active {
  color: #ff6b6b !important;
  border-bottom: 2px solid #ff6b6b !important;
  background: none !important;
  border-bottom-color: #ff6b6b !important;
}

.mobile-tab-content {
  display: none;
}

.mobile-tab-content.active {
  display: block;
}

/* ===============================================
   RESPONSIVE LAYOUT-ANPASSUNGEN
   =============================================== */

/* ===============================================
   PREVIEW CONTROLS
   =============================================== */

.preview-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding: 10px;
  background-color: #f9f9f9;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
}

.view-controls,
.print-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.control-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-normal);
}

.control-button:hover {
  background-color: var(--secondary-color);
}

.control-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.control-button svg {
  width: 24px;
  height: 24px;
  fill: var(--text-light);
}

.control-button:hover svg {
  fill: var(--primary-color);
}

.control-button.primary {
  background-color: var(--primary-color);
  color: white;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-button.primary svg {
  fill: white;
}

.control-button.primary:hover {
  background-color: var(--primary-hover);
}

/* für Preview Controls */
.preview-controls {
  background-color: #333;
}

.control-button:hover {
  background-color: #444;
}

.control-button.primary {
  background-color: #ff6b6b;
}

.control-button.primary:hover {
  background-color: #ff5252;
}

/* ===============================================
   RESPONSIVE LAYOUT-ANPASSUNGEN
   =============================================== */

/* Mobile: Verstecke Resizer und nutze vertikalen Stack */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
    height: auto;
    min-height: 100dvh;
  }

  .resizer {
    display: none;
  }

  .sidebar {
    flex: 1 1 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
  }

  .preview-area {
    flex: 1 1 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    border-left: none;
    border-top: 1px solid var(--border-color);
  }
} /* ===============================================
   TAB FIXES - Höchste Priorität für Tab-Styles
   =============================================== */

/* 🚨 ULTIMATIVE REGEL: Rote Unterlinie für alle aktiven Tabs */
html .input-tabs .tab-button.active {
  color: #ff6b6b !important;
  border-bottom: 3px solid #ff6b6b !important;
  border-bottom-color: #ff6b6b !important;
  background: none !important;
  background-color: transparent !important;
  background-image: none !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
  font-weight: 500 !important;
}

/* 🚨 ULTIMATIVE REGEL: Rote Unterlinie für alle aktiven Tabs */
html .input-tabs .tab-button.active {
  color: #ff6b6b !important;
  border-bottom: 3px solid #ff6b6b !important;
  border-bottom-color: #ff6b6b !important;
  background: none !important;
  background-color: transparent !important;
  background-image: none !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
  font-weight: 500 !important;
}

/* 🚨 FINALE ULTIMATIVE REGEL: Rote Unterlinie für alle aktiven Tabs - Höchste Spezifität */
html body .input-tabs .tab-button.active,
html body .input-tabs .tab-button.active:hover,
html body .input-tabs .tab-button.active:focus {
  color: #ff6b6b !important;
  border-bottom: 3px solid #ff6b6b !important;
  border-bottom-color: #ff6b6b !important;
  background: none !important;
  background-color: transparent !important;
  background-image: none !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
  font-weight: 500 !important;
}

/* 🚨 FINALE ULTIMATIVE REGEL: Rote Unterlinie für alle aktiven Tabs im - Höchste Spezifität */
html .input-tabs .tab-button.active,
html .input-tabs .tab-button.active:hover,
html .input-tabs .tab-button.active:focus {
  color: #ff6b6b !important;
  border-bottom: 3px solid #ff6b6b !important;
  border-bottom-color: #ff6b6b !important;
  background: none !important;
  background-color: transparent !important;
  background-image: none !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
  font-weight: 500 !important;
}

/* 🚨 ULTIMATIVE REGEL: Speziell für Datenbank-Tab - Höchste Spezifität */
html body .input-tabs .tab-button[data-tab='database'].active,
html body .input-tabs .tab-button[data-tab='database'].active:hover,
html body .input-tabs .tab-button[data-tab='database'].active:focus {
  color: #ff6b6b !important;
  border-bottom: 3px solid #ff6b6b !important;
  border-bottom-color: #ff6b6b !important;
  background: none !important;
  background-color: transparent !important;
  background-image: none !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
  font-weight: 500 !important;
}

/* 🚨 ULTIMATIVE REGEL: Speziell für Datenbank-Tab im - Höchste Spezifität */
html .input-tabs .tab-button[data-tab='database'].active,
html .input-tabs .tab-button[data-tab='database'].active:hover,
html .input-tabs .tab-button[data-tab='database'].active:focus {
  color: #ff6b6b !important;
  border-bottom: 3px solid #ff6b6b !important;
  border-bottom-color: #ff6b6b !important;
  background: none !important;
  background-color: transparent !important;
  background-image: none !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
  font-weight: 500 !important;
}

/* 🆕 Database Action Buttons: Keine rote Unterlinie, auch nicht wenn active */
html body .input-tabs .tab-button.database-action-button,
html body .input-tabs .tab-button.database-action-button.active,
html body .input-tabs .tab-button.database-action-button:hover,
html body .input-tabs .tab-button.database-action-button:focus,
html .input-tabs .tab-button.database-action-button,
html .input-tabs .tab-button.database-action-button.active,
html .input-tabs .tab-button.database-action-button:hover,
html .input-tabs .tab-button.database-action-button:focus {
  border-bottom: 0 !important; /* Keine rote Unterlinie für Action-Buttons */
  border-bottom-color: transparent !important;
}

/* 🚨 ULTIMATIVE REGEL: Einheitliche Tab-Abstände für alle Tabs */
html #database-tab.tab-content.active {
  padding: 0 !important; /* Komplett eliminiert - kein Abstand mehr */
  margin: 0 !important;
  overflow: visible !important; /* Wichtig für Hover-Effekte der Abteilungsfilter */
}

html .database-controls {
  margin-top: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-top: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  width: 100% !important;
}

html .database-table-container {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* 🚨 ULTIMATIVE REGEL: Database-Tab volle Breite in ALLEN Bildschirmgrößen */
@media (max-width: 768px) {
  html #database-tab.tab-content.active {
    padding: 0 !important; /* Komplett eliminiert für alle Bildschirmgrößen */
  }
}

@media (max-width: 480px) {
  html #database-tab.tab-content.active {
    padding: 0 !important; /* Komplett eliminiert für alle Bildschirmgrößen */
  }
}

@media (min-width: 769px) {
  html #database-tab.tab-content.active {
    padding: 0 !important; /* Komplett eliminiert für alle Bildschirmgrößen */
  }
}

/* 🚨 ULTIMATIVE REGEL: Reduziertes Gap für zugeklappte Abteilungsfilter */
html #database-tab .database-controls.compact-gap {
  gap: 0px !important; /* Absolut minimal für zugeklappten Zustand */
}

/* Zusätzlich: Direktes Targeting mit höchster Spezifität */
html body #database-tab .database-controls.compact-gap {
  gap: 0px !important; /* Absolut minimal für zugeklappten Zustand */
}

/* 🚨 ULTIMATIVE REGEL: Abteilungsfilter-Content smooth ausblenden wenn collapsed */
html #departmentFiltersContent.collapsible-content.collapsed {
  height: 0 !important;
  max-height: 0 !important;
  opacity: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  overflow: hidden !important;
  min-height: 0 !important;
  transition:
    max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease,
    margin 0.3s ease,
    padding 0.3s ease !important;
}
