/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
  /* New FLB Brand Colors */
  --flb-cyan: #0086cb;
  /* RGB 0, 134, 203 */
  --flb-blue: #00255e;
  /* RGB 0, 40, 94 */

  /* Semantic Variables - Default (Dark Mode) */
  --bg-color: var(--flb-blue);
  --text-main: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.7);
  --primary: var(--flb-cyan);
  --secondary: #10b981;
  /* Keeping green for success/correct/secondary actions */
  --quiz-accent: #f59e0b;
  --card-bg: rgba(255, 255, 255, 0.1);
  --card-border: rgba(255, 255, 255, 0.2);
  --glass-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
}

/* Light Mode Overrides */
body.light-mode {
  --bg-color: #ffffff;
  --text-main: var(--flb-blue);
  --text-muted: rgba(0, 37, 94, 0.75);
  --card-bg: rgba(0, 134, 203, 0.05);
  /* Very light cyan tint */
  --card-border: rgba(0, 40, 94, 0.15);
  --glass-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.05);
}

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

body {
  font-family: 'Calibri', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto; /* Vertikales Scrollen auf kleinen Screens erlauben */
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* App Header */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  z-index: 1001;
  /* Above sidebar */
  backdrop-filter: blur(10px);
}

.header-toggle-btn {
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
  margin-right: 1rem;
  padding: 0.5rem;
  border-radius: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.header-title {
  font-size: 1.25rem;
  margin: 0;
  font-weight: 700;
}

/* Sidebar (Mobile Header) */
.sidebar {
  width: 280px;
  background: var(--card-bg);
  border-right: 1px solid var(--card-border);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  flex-shrink: 0;
  height: calc(100vh - 60px);
  /* Full height minus header */
  position: fixed;
  top: 60px;
  /* Starts below header */
  left: -280px;
  /* Hidden by default on mobile */
  z-index: 1000;
  transition: transform 0.3s ease-in-out, left 0.3s ease-in-out;
  backdrop-filter: blur(10px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sidebar.open {
  left: 0;
}

/* Desktop Sidebar Behavior (Collapsible) */
@media (min-width: 768px) {
  .sidebar {
    left: 0;
    /* Always visible by default on desktop */
    padding-top: 50px;
    transform: translateX(0);
    gap: 1rem;
  }

  body.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
  }

  .main-content {
    margin-left: 280px; /* Precise sidebar width */
    width: calc(100% - 280px); /* Fill remaining space */
    transition: margin-left 0.3s ease-in-out, width 0.3s ease-in-out;
  }

  body.sidebar-collapsed .main-content {
    margin-left: 0;
    width: 100%;
  }

  /* Hide specific Mobile-Only header elements in sidebar if any */
  .sidebar-header-mobile {
    display: none;
  }
}

.sidebar-header-mobile {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.close-sidebar-btn {
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 2rem;
  cursor: pointer;
}



.logo-area h1 {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 0.2rem;
}

.section h2 {
  margin-top: 0.5rem; /* Ensure some space below the fixed header */
}

.inv-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.inventory-view td:first-child {
  text-align: left !important;
}

.control-group label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

/* Slider Customization */
input[type=range] {
  width: 100%;
  accent-color: var(--primary);
  margin-bottom: 0.5rem;
  height: 24px;
  /* Touchable height */
}

.level-indicator {
  font-size: 0.9rem;
  color: var(--primary);
  font-weight: bold;
  text-align: center;
}

/* Unified Menu Buttons */
.nav-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-btn {
  width: 100%;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  padding: 0.8rem;
  cursor: pointer;
  border-radius: 0.25rem;
  transition: all 0.2s ease;
  font-weight: 600;
  font-size: 1rem;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.nav-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

/* Light Mode for Nav Buttons */
body.light-mode .nav-btn {
  background: #f1f5f9;
  color: var(--flb-blue);
  border: 1px solid #e2e8f0;
}

body.light-mode .nav-btn.active {
  background: var(--flb-cyan);
  color: white;
  border-color: var(--flb-cyan);
}

body.light-mode .nav-btn:hover:not(.active) {
  background: #e2e8f0;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: clamp(0.5rem, 2vmin, 1.5rem);
  padding-top: 90px; /* Refined for better aesthetics on iPad */
  padding-bottom: 2rem; /* Reduced to provide more space for simulation containers */
  font-size: 0.95rem; /* Minimal smaller content globally on mobile */
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto; /* Vertikales Scrollen erlauben */
}

.main-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.15) 0%, transparent 20%),
    radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.15) 0%, transparent 20%);
  pointer-events: none;
  z-index: -1;
}

.section {
  display: none;
  max-width: 100%;
  width: 100%;
  min-height: 0; /* Natürliche Höhe, kein Abschneiden */
  margin: 0 auto;
  animation: fadeIn 0.5s ease-out;
  flex-direction: column;
}

.section.active {
  display: flex;
  flex: 1;
  min-height: 0;
  margin-top: 0.5rem; /* Minimal space below header */
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Learning Cards */
.scenario-box {
  background: linear-gradient(135deg, rgba(0, 134, 203, 0.1), rgba(0, 134, 203, 0.05));
  /* FLB-Cyan */
  border: 1px solid rgba(0, 134, 203, 0.2);
  padding: 1.25rem;
  border-radius: 1rem;
  margin-bottom: 2rem;
  border-left: 4px solid var(--primary);
}

.layer-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: 1rem;
  margin-bottom: 1.5rem;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--glass-shadow);
}

/* Disabled hover on touch devices usually, keeping for consistency */
.layer-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.layer-header {
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--card-border);
  flex-wrap: wrap;
  /* Allow wrapping on very small screens */
  gap: 0.5rem;
  cursor: pointer;
  /* Clickable */
  user-select: none;
}

.layer-header::after {
  content: '▼';
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: transform 0.3s ease;
  margin-left: auto;
}

.layer-card.collapsed .layer-header::after {
  transform: rotate(-90deg);
}

.layer-card.collapsed .layer-header {
  border-bottom: none;
  /* Remove border when collapsed */
}

.layer-num {
  font-weight: 700;
  color: var(--primary);
  font-size: 1.1rem;
  margin-right: 0.5rem;
}

.layer-content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  /* Stacked content on mobile */
  gap: 1.5rem;
  transition: all 0.3s ease-in-out;
  max-height: 2000px;
  /* Limit for animation */
  overflow: hidden;
  opacity: 1;
}

.layer-card.collapsed .layer-content {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  pointer-events: none;
}

.layer-info h3 {
  font-size: 0.9rem;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  margin-top: 1rem;
}

.layer-info h3:first-child {
  margin-top: 0;
}

.example-box {
  background: rgba(16, 185, 129, 0.1);
  padding: 1rem;
  border-radius: 0.5rem;
  border-left: 3px solid var(--secondary);
  font-size: 0.95rem;
}

code {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.2rem 0.4rem;
  border-radius: 0.3rem;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  color: #fbbf24;
  word-break: break-word;
  /* Handle long codes on mobile */
}

body.light-mode code {
  background: rgba(0, 134, 203, 0.1);
  color: #b45309;
}

/* Quiz Styles */
.quiz-header {
  display: flex;
  flex-direction: column;
  /* Stacked header on mobile */
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.score-badge {
  background: var(--quiz-accent);
  color: black;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-weight: bold;
  align-self: flex-start;
}

.question-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 1.5rem;
  border-radius: 1rem;
}

.question-text {
  font-size: 1.15rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.option-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.option-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  padding: 1rem;
  /* Good touch target */
  border-radius: 0.5rem;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}

.option-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
}

.option-btn.selected {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.2);
}

.option-btn.correct {
  border-color: var(--secondary);
  background: rgba(16, 185, 129, 0.2);
}

.option-btn.wrong {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.2);
}

.feedback-area {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: 0.5rem;
  animation: fadeIn 0.3s;
}

.feedback-correct {
  background: rgba(16, 185, 129, 0.1);
  color: var(--secondary);
  border: 1px solid var(--secondary);
}

.feedback-wrong {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid #ef4444;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 1rem 1.5rem;
  /* Larger touch area */
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 600;
  margin-top: 1.5rem;
  width: 100%;
}

.btn-primary:active {
  transform: scale(0.98);
}

/* Utils */
.hidden {
  display: none !important;
}

/* Interactive Elements */
.interactive-item {
  cursor: pointer;
  border-bottom: 1px dashed var(--text-muted);
  transition: all 0.2s;
  margin-right: 0.5rem;
  display: inline-block;
  padding: 2px 0;
  /* Slight padding for touch */
}

.interactive-item:hover {
  color: var(--primary);
  border-bottom: 1px solid var(--primary);
}

.match-item.status-correct {
  border: 2px solid var(--secondary) !important;
  background: rgba(16, 185, 129, 0.2) !important;
}

.match-item.status-wrong {
  border: 2px solid #ef4444 !important;
  background: rgba(239, 68, 68, 0.2) !important;
}

/* Detail Views */
.detail-container {
  padding: 0 1.25rem 1.25rem 1.25rem;
  animation: slideDown 0.3s ease-out;
}

.detail-box {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--card-border);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-top: 0.5rem;
  position: relative;
  box-shadow: var(--glass-shadow);
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 2rem;
  /* Easy to tap */
  cursor: pointer;
  line-height: 1;
  padding: 0 0.5rem;
}

.close-btn:hover {
  color: white;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Glossary & Tooltips */
.glossary-term {
  border-bottom: 1px dotted var(--text-muted);
  cursor: help;
  position: relative;
  color: #a5f3fc;
  font-weight: 500;
}

body.light-mode .glossary-term {
  color: var(--flb-blue);
  border-bottom-color: var(--flb-blue);
}

.glossary-term::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #e2e8f0;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
  white-space: normal;
  width: max-content;
  max-width: 200px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--card-border);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 100;
  margin-bottom: 5px;
  font-weight: normal;
  text-align: center;
}

.glossary-term:hover::after {
  opacity: 1;
}

/* Quiz Badges & Progress */
.quiz-progress {
  display: flex;
  flex-wrap: wrap;
  /* Wrap on mobile */
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  gap: 0.5rem;
}

.badge {
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: bold;
  color: #1e293b;
}

.badge-easy {
  background-color: #86efac;
}

.badge-medium {
  background-color: #fca5a5;
}

.badge-hard {
  background-color: #f87171;
  color: white;
  border: 1px solid #ef4444;
}

/* End Screen Summary */
.summary-list {
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.summary-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  padding: 1rem;
  border-radius: 0.5rem;
  font-size: 0.95rem;
}

.summary-item.summary-correct {
  border-left: 3px solid var(--secondary);
}

.summary-item.summary-wrong {
  border-left: 3px solid #ef4444;
}

.text-green {
  color: var(--secondary);
  font-weight: bold;
}

.text-red {
  color: #ef4444;
  font-weight: bold;
}

/* ------------------------------------------------------------------ */
/* DESKTOP OVERRIDES                                                  */
/* ------------------------------------------------------------------ */

@media (min-width: 768px) {
  body {
    flex-direction: row;
    /* Side-by-side */
    height: 100vh;
    overflow: hidden;
    /* Scroll in containers */
  }

  /* Sidebar Fixed Width */
  .sidebar {
    width: 300px;
    height: calc(100% - 60px);
    /* Full height minus header */
    position: fixed;
    /* Fixed on desktop too to stay under header */
    top: 60px;
    left: 0;
    border-right: 1px solid var(--card-border);
    border-bottom: none;
    padding: 2rem;
    gap: 2rem;
    overflow-y: auto;
  }

  /* Hide specific Mobile-Only header elements in sidebar if any */
  .sidebar-header-mobile {
    display: none;
  }

  /* Main Content Area */
  .main-content {
    overflow-y: auto;
    padding: 2rem;
    padding-top: 90px; /* Must match base value to clear the fixed header */
    padding-bottom: 3rem;
    margin-left: 300px;
    /* Ensure content starts after fixed sidebar */
  }

  .section {
    max-width: 1000px;
    /* Limit width for reading comfort */
  }
  
  #inventur-section {
    max-width: 1500px; /* Wider on large monitors */
  }

  .layer-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  }

  .layer-header {
    padding: 1rem 1.5rem;
  }

  .layer-content {
    display: flex;
    flex-direction: column;
    /* Use full width for cards */
    gap: 2rem;
    padding: 1.5rem;
  }

  .quiz-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .score-badge {
    align-self: center;
  }

  .question-card {
    padding: 2rem;
  }

  .question-text {
    font-size: 1.25rem;
  }

  .detail-container {
    padding: 0 1.5rem 1.5rem 1.5rem;
  }

  .close-btn {
    font-size: 1.5rem;
  }

  .glossary-term::after {
    max-width: 250px;
  }
}

/* Impressum Link */
.footer-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.8rem;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  height: 1.2rem;
  line-height: 1;
}

.footer-link:hover {
  text-decoration: underline;
  opacity: 0.8;
}

.footer-dot {
  opacity: 0.3;
  display: inline-flex;
  align-items: center;
  height: 1.2rem;
  line-height: 1;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: clamp(1rem, 3vmin, 1.5rem);
  border-radius: 1rem;
  box-shadow: var(--glass-shadow);
  position: relative;
  overflow: visible; /* Critical for long content and selects */
}

/* Fix for Buchführung Box on Mobile */
@media (max-width: 768px) {
  .buchung-form {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .buchung-form .btn-primary {
    width: 100% !important;
  }
}


/* --- Stationen-Lernen Styles --- */

#stations-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.station-overview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.station-score-display {
  background: var(--card-bg);
  border: 1px solid var(--primary);
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-weight: bold;
  font-size: 1.1rem;
}

.score-highlight {
  color: var(--secondary);
  font-size: 1.2rem;
}

.station-intro {
  margin-bottom: 2rem;
  color: var(--text-muted);
}

.station-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.station-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 1.2rem;
  border-radius: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 170px;
}

.station-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--glass-shadow);
}

.station-card.completed {
  border-color: var(--secondary);
  background: rgba(16, 185, 129, 0.05);
}

.station-card-header h3 {
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.status-icon {
  display: inline-block;
  background: var(--secondary);
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.station-progress {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: bold;
}

/* Station Detail View */
.station-detail-view {
  animation: fadeIn 0.3s ease-out;
}

.btn-back {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  margin-bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

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

.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 2rem;
}

.task-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 1rem;
  padding: 1.5rem;
  position: relative;
}

.task-card.mandatory {
  border-left: 4px solid var(--primary);
}

.task-card.bonus {
  border-left: 4px solid var(--quiz-accent);
}

.task-card.correct {
  border-color: var(--secondary);
  background: rgba(16, 185, 129, 0.05);
}

/* Red border for wrong answer card */
.task-card.wrong {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
}


.task-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.task-badge {
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: bold;
}

.task-badge.mandatory {
  background: rgba(0, 134, 203, 0.2);
  color: #a5f3fc;
}

.task-badge.bonus {
  background: rgba(245, 158, 11, 0.2);
  color: #fde68a;
}

body.light-mode .task-badge.bonus {
  background: rgba(245, 158, 11, 0.3);
  color: #92400e;
  /* Darker amber for readability */
  border: 1px solid rgba(245, 158, 11, 0.4);
}

body.light-mode .task-badge.mandatory {
  background: rgba(0, 134, 203, 0.15);
  color: #0369a1;
  border: 1px solid rgba(0, 134, 203, 0.3);
}

body.light-mode .task-badge.interactive {
  background: rgba(16, 185, 129, 0.15);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.task-badge.interactive {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

.task-question {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.task-options {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.task-feedback {
  margin-top: 1.5rem;
  animation: slideDown 0.3s ease-out;
}

.feedback-box {
  padding: 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
}

.feedback-box.success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

/* Light mode override for success text */
body.light-mode .feedback-box.success {
  color: #047857;
}

.feedback-box.error {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

body.light-mode .feedback-box.error {
  color: #b91c1c;
}

/* --- Matching Task Styles --- */
.matching-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.matching-pool-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.matching-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 50px;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  border: 1px dashed var(--card-border);
}

.match-item {
  background: var(--card-bg);
  border: 1px solid var(--primary);
  padding: 0.5rem 0.8rem;
  border-radius: 0.4rem;
  font-size: 0.9rem;
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition: transform 0.1s;
  background: rgba(0, 134, 203, 0.2);
}

.match-item.interactive:hover {
  background: var(--primary);
  color: white;
}

/* Reset Button Styles */
.btn-reset {
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--card-border);
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  width: 100%;
  transition: all 0.2s;
}


.btn-reset:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-color: #ef4444;
}

/* Attempts & Hints */
.attempts-badge {
  font-size: 0.8rem;
  color: #ef4444;
  font-weight: bold;
  margin-left: 0.5rem;
  background: rgba(239, 68, 68, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.hint-star {
  cursor: pointer;
  font-size: 1.2rem;
  margin-right: 0.5rem;
  color: #fbbf24;
  transition: transform 0.2s;
  user-select: none;
}

.hint-star:hover {
  transform: scale(1.2) rotate(15deg);
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
}

/* Overview Stats */
.station-stats {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  font-weight: bold;
}

.stat-correct {
  color: #34d399;
}

.stat-wrong {
  color: #f87171;
}

/* OSI Table Styles */
.osi-table-container {
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.osi-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 400px;
}

.osi-table th,
.osi-table td {
  border: 1px solid var(--card-border);
  padding: 0.5rem;
  text-align: center;
}

.osi-table th {
  background: rgba(255, 255, 255, 0.05);
  color: var(--primary);
}

/* ===================== */
/* SQL Sandbox Styles    */
/* ===================== */

#sql-input {
  tab-size: 4;
}

#sql-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 134, 203, 0.3);
}

.example-query-btn {
  background: rgba(0, 134, 203, 0.15);
  border: 1px solid rgba(0, 134, 203, 0.3);
  color: var(--primary);
  padding: 0.4rem 0.8rem;
  border-radius: 2rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
}

.example-query-btn:hover {
  background: var(--primary);
  color: white;
}

body.light-mode .example-query-btn {
  background: rgba(0, 134, 203, 0.1);
  border-color: rgba(0, 134, 203, 0.3);
}

.result-table-container {
  overflow-x: auto;
  margin-top: 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--card-border);
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  min-width: 400px;
}

.result-table th {
  background: rgba(0, 134, 203, 0.2);
  color: var(--primary);
  padding: 0.7rem 1rem;
  text-align: left;
  font-weight: 700;
  border-bottom: 2px solid var(--primary);
  white-space: nowrap;
}

.result-table td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--card-border);
  white-space: nowrap;
}

.result-table tr:hover td {
  background: rgba(255, 255, 255, 0.05);
}

body.light-mode .result-table tr:hover td {
  background: rgba(0, 134, 203, 0.05);
}

.result-count {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-style: italic;
}

.result-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid #ef4444;
  border-radius: 0.5rem;
  padding: 1rem;
  color: #f87171;
  font-family: 'Courier New', monospace;
  margin-top: 1rem;
}

body.light-mode .result-error {
  color: #b91c1c;
}

.result-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--secondary);
  border-radius: 0.5rem;
  padding: 1rem;
  color: var(--secondary);
  margin-top: 1rem;
}

/* Schema display */
.schema-table-card {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--card-border);
  border-radius: 0.5rem;
  overflow: hidden;
}

.schema-table-name {
  background: rgba(0, 134, 203, 0.2);
  padding: 0.6rem 1rem;
  font-weight: bold;
  color: var(--primary);
  font-family: 'Courier New', monospace;
  border-bottom: 1px solid var(--card-border);
}

.schema-columns {
  padding: 0.5rem;
}

.schema-col {
  padding: 0.3rem 0.5rem;
  font-size: 0.85rem;
  font-family: 'Courier New', monospace;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.schema-col:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.schema-col-name {
  color: var(--text-main);
}

.schema-col-type {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.schema-col-pk {
  color: var(--quiz-accent);
  font-weight: bold;
}

/* SQL Code Block in Theory */
.sql-code-block {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--card-border);
  border-radius: 0.5rem;
  padding: 1rem;
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  line-height: 1.6;
  overflow-x: auto;
  color: #e2e8f0;
  margin: 1rem 0;
}

body.light-mode .sql-code-block {
  background: rgba(0, 37, 94, 0.05);
  border-color: rgba(0, 37, 94, 0.15);
  color: var(--flb-blue);
}

.sql-keyword {
  color: #60a5fa;
  font-weight: bold;
}

body.light-mode .sql-keyword {
  color: #0086cb;
}

.sql-string {
  color: #34d399;
}

body.light-mode .sql-string {
  color: #047857;
}

.sql-comment {
  color: #6b7280;
  font-style: italic;
}

.sql-operator {
  color: #f59e0b;
}

body.light-mode .sql-operator {
  color: #b45309;
}

/* Station SQL Input */
.station-sql-input {
  width: 100%;
  padding: 0.8rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--card-border);
  border-radius: 0.5rem;
  color: #fbbf24;
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  outline: none;
  resize: vertical;
  min-height: 60px;
  transition: border-color 0.2s;
  line-height: 1.5;
}

.station-sql-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 134, 203, 0.3);
}

body.light-mode .station-sql-input {
  background: rgba(0, 37, 94, 0.05);
  color: #b45309;
}

body.light-mode #sql-input {
  background: rgba(0, 37, 94, 0.05);
  color: #b45309;
}

/* ===================== */
/* Schema FK & ER Styles */
/* ===================== */

/* FK column styling */
.schema-col-fk {
  color: #a78bfa;
}

body.light-mode .schema-col-fk {
  color: #7c3aed;
}

/* Schema Info Button (ℹ️ in stations) */
.schema-info-btn {
  background: rgba(0, 134, 203, 0.15);
  border: 1px solid rgba(0, 134, 203, 0.3);
  color: var(--primary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
}

.schema-info-btn:hover {
  background: var(--primary);
  color: white;
  transform: scale(1.1);
}

/* ---- Schema Popup Overlay ---- */
.schema-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.15s ease-out;
}

.schema-info-popup {
  background: var(--bg-color);
  border: 1px solid var(--primary);
  border-radius: 1rem;
  padding: 1.25rem;
  width: 100%;
  max-width: 700px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.2s ease-out;
}

body.light-mode .schema-info-popup {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.schema-info-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--card-border);
  font-size: 1.1rem;
}

.schema-info-popup-body {
  font-size: 0.9rem;
}

.schema-popup-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

/* ---- ER Diagram ---- */
.er-diagram {
  margin-top: 1.25rem;
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid var(--card-border);
  border-radius: 0.75rem;
  padding: 1rem;
}

body.light-mode .er-diagram {
  background: rgba(0, 134, 203, 0.04);
}

.er-diagram-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: bold;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  color: var(--primary);
}

.er-relation {
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.er-relation:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

body.light-mode .er-relation {
  border-bottom-color: rgba(0, 37, 94, 0.08);
}

.er-relation-row {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: nowrap;
  overflow: hidden;
}

.er-table-badge {
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  font-weight: bold;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 35%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.er-badge-pk {
  background: rgba(0, 134, 203, 0.2);
  color: var(--primary);
  border: 1px solid rgba(0, 134, 203, 0.35);
}

.er-badge-fk {
  background: rgba(167, 139, 250, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(167, 139, 250, 0.3);
}

body.light-mode .er-badge-fk {
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.1);
  border-color: rgba(124, 58, 237, 0.25);
}

/* Cardinality badges */
.er-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: bold;
  flex-shrink: 0;
}

.er-card-one {
  background: rgba(0, 134, 203, 0.25);
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.er-card-many {
  background: rgba(245, 158, 11, 0.2);
  color: var(--quiz-accent);
  border: 1.5px solid var(--quiz-accent);
}

/* Connection line */
.er-line {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
}

.er-line-bar {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), #a78bfa);
  min-width: 8px;
}

.er-line-label {
  font-family: 'Courier New', monospace;
  font-size: 0.6rem;
  color: var(--text-muted);
  white-space: nowrap;
  padding: 0 0.2rem;
  flex-shrink: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.er-relation-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  padding-left: 0.25rem;
  font-style: italic;
}

/* ER Legend */
.er-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.2rem;
  font-size: 0.8rem;
  padding: 0.75rem;
  background: rgba(16, 185, 129, 0.08);
  border-left: 3px solid var(--secondary);
  border-radius: 4px;
  margin-top: 1rem;
  color: var(--text-muted);
}

/* Theory Schema Section */
.theory-schema-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

/* ---- Desktop ER Diagram ---- */
@media (min-width: 768px) {
  .schema-popup-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .er-table-badge {
    max-width: none;
    font-size: 0.8rem;
  }

  .er-line-label {
    font-size: 0.7rem;
    padding: 0 0.5rem;
    flex-shrink: 0;
  }
}

/* ================================================================ */
/* MOBILE RESPONSIVE FIXES (≤ 430px — iPhone 13 Mini = 375px)      */
/* ================================================================ */

@media (max-width: 430px) {

  /* General mobile spacing */
  .main-content {
    padding: 0.75rem;
    padding-top: 70px;
  }

  .section {
    padding: 0;
  }

  h2 {
    font-size: 1.2rem;
    line-height: 1.3;
  }

  /* Theory cards */
  .layer-header {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
  }

  .layer-content {
    padding: 0.75rem !important;
    font-size: 0.95rem !important;
  }

  /* Schema cards in theory / sandbox / popup */
  .theory-schema-grid,
  .schema-popup-grid,
  #schema-display {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .schema-table-card {
    font-size: 0.75rem;
  }

  .schema-table-name {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
  }

  .schema-col {
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
    gap: 0.2rem;
  }

  .schema-col-type {
    font-size: 0.65rem;
  }

  /* ER diagram mobile – compact vertical layout */
  .er-diagram {
    padding: 0.6rem;
  }

  .er-diagram-title {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
  }

  .er-relation {
    padding: 0.4rem 0;
  }

  .er-relation-row {
    /* Stack: PK-badge (1) ——line—— (n) FK-badge */
    display: grid;
    grid-template-columns: auto auto 1fr auto auto;
    align-items: center;
    gap: 0.2rem;
  }

  .er-table-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.3rem;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .er-card {
    width: 16px;
    height: 16px;
    font-size: 0.55rem;
  }

  .er-line {
    min-width: 0;
  }

  .er-line-label {
    display: none;
  }

  .er-line-bar {
    min-width: 4px;
  }

  .er-relation-desc {
    font-size: 0.7rem;
  }

  .er-legend {
    font-size: 0.7rem;
    gap: 0.4rem 0.8rem;
    padding: 0.5rem;
  }


  /* Popup mobile */
  .schema-popup-overlay {
    padding: 0.5rem;
  }

  .schema-info-popup {
    padding: 1rem;
    border-radius: 0.75rem;
    max-height: 90vh;
  }

  .schema-info-popup-header {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
  }

  /* Station cards */
  .station-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .station-card {
    min-height: 160px;
    padding: 1rem;
  }

  .task-card {
    padding: 1rem;
  }

  .task-question {
    font-size: 0.95rem;
    margin-bottom: 1rem;
  }

  .option-btn {
    padding: 0.75rem;
    font-size: 0.9rem;
  }

  .task-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
  }

  /* SQL input */
  .station-sql-input,
  #sql-input {
    font-size: 0.85rem;
    padding: 0.6rem;
    min-height: 50px;
  }

  /* Buttons */
  .btn-primary {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }

  /* Quiz */
  .quiz-header {
    gap: 0.5rem;
  }

  .score-badge {
    font-size: 0.85rem;
    padding: 0.3rem 0.7rem;
  }

  .question-text {
    font-size: 1rem;
    margin-bottom: 1rem;
  }

  /* Result tables */
  .result-table {
    font-size: 0.8rem;
    min-width: 300px;
  }

  .result-table th,
  .result-table td {
    padding: 0.4rem 0.6rem;
  }

  /* Sandbox buttons */
  .sandbox-btn-row {
    flex-direction: column;
  }

  /* Example query buttons */
  .example-query-btn {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
  }

  /* Scenario box */
  .scenario-box {
    padding: 1rem;
  }

  /* SQL code blocks */
  .sql-code-block {
    font-size: 0.8rem;
    padding: 0.75rem;
    line-height: 1.5;
  }

  /* Info button alignment */
  .schema-info-btn {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
  }
}

/* Extra-small screens (iPhone SE, very compact) */
@media (max-width: 350px) {
  .theory-schema-grid,
  .schema-popup-grid,
  #schema-display {
    grid-template-columns: 1fr;
  }

  .er-relation-row {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem;
  }

  .er-line {
    order: 3;
    width: 100%;
    margin-top: 0.2rem;
  }

  .er-table-badge {
    max-width: none;
  }
}

/* ------------------------------------------------------------------ */
/* INVENTUR SPLIT-SCREEN & WAREHOUSE CSS                              */
/* ------------------------------------------------------------------ */

.split-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  flex: 1;
  min-height: 0;
}

/* Erst ab 1200px nebeneinander – so bleibt alles sichtbar */
@media (min-width: 1200px) {
  .split-layout {
    flex-direction: row;
    align-items: stretch;
    gap: 1.5rem;
  }
}

/* Left Area: Warehouse */
.warehouse-view {
  flex: 1;
  background: linear-gradient(180deg, #2C3E50 0%, #1a252f 100%);
  border: 1.5px solid var(--fly-blue, #4682B4);
  border-radius: 8px;
  padding: 0.5rem;
  overflow: visible; /* Niemals abschneiden */
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-height: 0;
}

@media (min-width: 1200px) {
  .warehouse-view {
    flex: 5.5;
  }
}

/* Right Area: Inventory Table */
.inventory-view {
  flex: 1;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 8px;
  padding: 0.75rem;
  padding-top: 0.5rem;
  overflow-y: auto;
  overflow-x: auto; /* Tabelle darf horizontal gescrollt werden */
  display: flex;
  flex-direction: column;
  min-height: 150px;
}

@media (min-width: 1200px) {
  .inventory-view {
    flex: 4.5;
  }
}

/* Racks & Shelves */
.rack-container {
  display: grid;
  /* Immer genau 2 Spalten in der Lagerhalle */
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
  flex: 1;
  align-content: start;
  align-items: start;
}

.rack {
  background: #34495e;
  border-left: 3px solid var(--fly-orange, #F39C12);
  border-right: 3px solid var(--fly-orange, #F39C12);
  border-top: 3px solid var(--fly-orange, #F39C12);
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  border-radius: 4px 4px 0 0;
  position: relative;
  min-height: 0;
}

.rack-title {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--fly-orange, #F39C12);
  color: #1a252f;
  padding: 0 4px;
  font-size: clamp(0.5rem, 1.4vmin, 0.75rem);
  font-weight: bold;
  border-radius: 2px;
  white-space: nowrap;
  z-index: 5;
}

.shelf-row {
  display: flex;
  border-bottom: 3px solid var(--fly-orange, #F39C12);
  padding: 0.2rem;
  gap: 0.2rem;
  justify-content: space-evenly;
  flex: 1;
  min-height: 0;
}

.shelf-bin {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  text-align: center;
  padding: 0.3rem 0.15rem;
  min-width: 0;
  overflow: visible; /* Nie abschneiden */
}

.shelf-bin:hover {
  background: rgba(70, 130, 180, 0.4);
  border-color: var(--fly-blue, #4682B4);
  transform: scale(1.02);
}

.shelf-bin.completed {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
}

.shelf-bin.completed::after {
  content: '✓';
  position: absolute;
  top: 2px;
  right: 2px;
  background: #10b981;
  color: white;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bin-icon {
  font-size: clamp(0.9rem, 3vmin, 2rem);
  margin-bottom: 1px;
  line-height: 1;
}

.bin-label {
  font-size: clamp(0.5rem, 1.6vmin, 0.8rem);
  color: #bdc3c7;
  line-height: 1.1;
  /* Zeilenumbruch erlauben, damit nie abgeschnitten wird */
  white-space: normal;
  word-break: break-word;
  hyphens: auto;
  overflow: visible;
  width: 100%;
}

/* Office Area */
.office-desk {
  background: rgba(255,255,255,0.05);
  border-top: 2px solid #95a5a6;
  padding: 0.4rem;
  display: flex;
  justify-content: center;
  gap: 0.3rem;
  flex-wrap: wrap; /* Umbruch auf schmalen Screens */
  margin-top: auto;
  min-height: 0;
}

.desk-item {
  background: #2c3e50;
  border: 1px solid #7f8c8d;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.2s;
  min-width: 0;
  flex-shrink: 1;
}

.desk-item .bin-label {
  font-size: clamp(0.45rem, 1.4vmin, 0.7rem);
}

.desk-item:hover {
  background: #34495e;
  border-color: var(--fly-blue, #4682B4);
  transform: translateY(-2px);
}

.desk-item.completed {
  border-color: #10b981;
}

/* Modals */
.inventur-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.8);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.inventur-modal {
  background: var(--bg-color);
  border: 2px solid var(--fly-orange, #F39C12);
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.5);
  overflow: hidden;
  animation: slideDown 0.3s ease-out;
}

.inventur-modal-header {
  background: var(--fly-blue, #4682B4);
  color: white;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
}

.inventur-modal-body {
  padding: 1.5rem;
  color: var(--text-main);
  text-align: center;
  font-size: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

/* Inventory List Inputs */
.osi-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  font-size: clamp(0.65rem, 1.5vw, 0.85rem);
}

.osi-table thead th {
  position: sticky;
  top: -0.5rem;
  background: var(--card-bg);
  z-index: 50;
  padding: 0.3rem 0.1rem;
  font-weight: bold;
  border-bottom: 2px solid var(--primary);
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  white-space: nowrap;
  font-size: clamp(0.6rem, 1.3vw, 0.8rem);
}

body.light-mode .osi-table thead th {
  background: #f8fafc;
}

.osi-table td {
  padding: 0.15rem 0.1rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.inv-input {
  width: 100%;
  min-width: 0;
  padding: 0.15rem 0.1rem;
  border: 1px solid var(--card-border);
  border-radius: 3px;
  background: rgba(0,0,0,0.2);
  color: var(--text-main);
  font-family: monospace;
  text-align: right;
  font-size: clamp(0.6rem, 1.3vw, 0.8rem);
}

body.light-mode .inv-input {
  background: rgba(255,255,255,0.8);
  color: #000;
  border-color: #ccc;
}

.inv-input.valid,
.inventar-select.valid {
  border-color: #10b981 !important;
  background: rgba(16, 185, 129, 0.1) !important;
}

.inv-input.invalid,
.inventar-select.invalid {
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.1) !important;
}

/* Scrollbars for warehouse & list */
.warehouse-view::-webkit-scrollbar,
.inventory-view::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.warehouse-view::-webkit-scrollbar-thumb,
.inventory-view::-webkit-scrollbar-thumb {
  background-color: var(--fly-blue, #4682B4);
  border-radius: 4px;
}

/* ------------------------------------------------------------------ */
/* INVENTUR RESPONSIVE: Kompakte Anpassungen für schmale Screens      */
/* ------------------------------------------------------------------ */

/* Mittlere Screens (Tablets) */
@media (max-width: 768px) {
  .warehouse-view {
    padding: 0.35rem;
  }

  .rack-container {
    gap: 0.3rem;
  }

  .shelf-row {
    padding: 0.15rem;
    gap: 0.15rem;
  }

  .bin-icon {
    font-size: clamp(0.8rem, 5vw, 1.5rem);
  }

  .bin-label {
    font-size: clamp(0.5rem, 2vw, 0.7rem);
  }

  .office-desk {
    gap: 0.2rem;
    padding: 0.3rem;
  }

  .desk-item {
    padding: 0.2rem 0.3rem;
  }

  .desk-item .bin-icon {
    font-size: clamp(0.7rem, 4vw, 1.2rem);
  }

  .desk-item .bin-label {
    font-size: clamp(0.4rem, 1.8vw, 0.6rem);
  }

  .inventory-view {
    padding: 0.5rem;
    padding-top: 0.3rem;
  }

  .osi-table {
    font-size: clamp(0.6rem, 2vw, 0.75rem);
  }

  .osi-table thead th {
    padding: 0.2rem 0.05rem;
    font-size: clamp(0.55rem, 1.8vw, 0.7rem);
  }

  .inv-input {
    font-size: clamp(0.55rem, 1.8vw, 0.7rem);
    padding: 0.1rem;
  }
}

/* Kleine Screens (Smartphones) */
@media (max-width: 480px) {
  .rack-container {
    gap: 0.2rem;
  }

  .rack {
    border-width: 2px;
  }

  .rack-title {
    font-size: 0.55rem;
    padding: 0 3px;
    top: -5px;
  }

  .shelf-row {
    border-bottom-width: 2px;
    padding: 0.1rem;
    gap: 0.1rem;
  }

  .shelf-bin {
    padding: 0.2rem 0.1rem;
  }

  .bin-icon {
    font-size: clamp(0.7rem, 6vw, 1.3rem);
  }

  .bin-label {
    font-size: clamp(0.45rem, 2.5vw, 0.6rem);
  }

  .office-desk {
    flex-wrap: wrap;
    gap: 0.15rem;
  }

  .desk-item {
    padding: 0.15rem 0.2rem;
  }
}

/* ------------------------------------------------------------------ */
/* INVENTAR MODUL – Responsive Summen-Zeilen                          */
/* ------------------------------------------------------------------ */

.inventar-sum-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: clamp(0.75rem, 2.2vw, 1rem);
}

.inventar-sum-highlight {
  font-weight: bold;
}

.inventar-ek-row {
  padding: 0.75rem;
  background: rgba(59, 130, 246, 0.2);
  border-radius: 4px;
  font-weight: bold;
  font-size: clamp(0.85rem, 2.5vw, 1.1rem);
  color: var(--primary);
  border-bottom: none;
}

.inventar-sum-input {
  width: clamp(80px, 30%, 140px);
  flex-shrink: 0;
}

/* Inventar Card responsive */
@media (max-width: 480px) {
  .inventar-sum-row {
    font-size: clamp(0.7rem, 3.5vw, 0.85rem);
    padding: 0.3rem 0;
  }

  .inventar-ek-row {
    padding: 0.5rem;
    font-size: clamp(0.75rem, 3.5vw, 0.95rem);
  }

  .inventar-sum-input {
    width: clamp(70px, 35%, 120px);
  }

  .card {
    padding: 0.75rem;
  }
}

/* ------------------------------------------------------------------ */
/* THEORIE MODUL CSS                                                  */
/* ------------------------------------------------------------------ */

.theory-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap; /* responsive */
}

.theory-tab-btn {
  background: var(--card-bg);
  color: var(--text-muted);
  border: 1px solid var(--card-border);
  padding: 0.75rem 1.25rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s;
}

.theory-tab-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

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

body.light-mode .theory-tab-btn {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

body.light-mode .theory-tab-btn.active {
  background: var(--flb-cyan);
  color: white;
}

.theory-box {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: var(--glass-shadow);
  line-height: 1.6;
}

.theory-box h3 {
  color: var(--primary);
  margin-bottom: 0.5rem;
}

/* Timeline Interactive */
.timeline-interactive {
  margin-top: 1.5rem;
  background: rgba(0,0,0,0.1);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  overflow: hidden;
}

body.light-mode .timeline-interactive {
  background: rgba(0,0,0,0.03);
}

.timeline-controls {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  flex-wrap: wrap;
}

body.light-mode .timeline-controls {
  background: rgba(0, 134, 203, 0.1);
}

.timeline-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 0.75rem;
  color: var(--text-main);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  min-width: 120px;
}

.timeline-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.timeline-btn.active {
  border-bottom: 2px solid var(--fly-orange, #F39C12);
  color: var(--fly-orange, #F39C12);
  font-weight: bold;
}

.timeline-display {
  padding: 2rem 1.5rem;
  min-height: 250px;
}

/* Vis Timeline */
.vis-timeline {
  position: relative;
  height: 60px;
  margin: 3rem 0;
}

.vis-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 4px;
  background: #34495e;
  transform: translateY(-50%);
}

.vis-node {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #bdc3c7;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.vis-node.node-major {
  width: 20px;
  height: 20px;
  background: var(--fly-orange, #F39C12);
}

.vis-node.node-danger {
  background: #e74c3c;
}

.vis-label {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 8px;
  font-size: 0.85rem;
  white-space: nowrap;
  color: var(--text-muted);
}

.vis-node.node-major .vis-label {
  color: var(--text-main);
}

.vis-highlight {
  position: absolute;
  top: 50%;
  height: 20px;
  transform: translateY(-50%);
  z-index: 1;
  border-radius: 10px;
}

.vis-mark {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 20px;
  background: var(--fly-orange, #F39C12);
  transform: translate(-50%, -50%);
  z-index: 2;
  border-radius: 2px;
  animation: dropIn 0.5s ease backwards;
}

@keyframes dropIn {
  0% { transform: translate(-50%, -20px); opacity: 0; }
  100% { transform: translate(-50%, -50%); opacity: 1; }
}

.vis-caption {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 1rem;
}

.color-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 4px;
}

.vis-boxes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  margin: 2rem 0;
}

.vis-box {
  width: 24px;
  height: 24px;
  background: rgba(255,255,255,0.1);
  border: 1px solid var(--card-border);
  border-radius: 2px;
}

.vis-box.boxed-sample {
  background: var(--fly-blue, #4682B4);
  border-color: #5dade2;
  animation: popIn 0.3s ease backwards;
}

@keyframes popIn {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

/* Bilanz t-konto */
.bilanz-t-konto {
  display: flex;
  flex-direction: column;
  border: 2px solid var(--text-muted);
  margin-top: 1rem;
}

.t-konto-header {
  border-bottom: 2px solid var(--text-muted);
  text-align: center;
  font-weight: bold;
  padding: 0.5rem;
  letter-spacing: 2px;
}

.t-konto-sides {
  display: flex;
}

.t-konto-side {
  flex: 1;
  padding: 1rem;
}

.left-side {
  border-right: 2px solid var(--text-muted);
}

.side-title {
  text-align: center;
  font-weight: bold;
  margin-bottom: 1rem;
  color: var(--fly-orange, #F39C12);
}

.ledger-list {
  list-style: none;
  padding: 0;
}

.ledger-list li {
  margin-bottom: 0.2rem;
}

.ledger-list .sub-item {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-left: 1rem;
  margin-bottom: 0.8rem;
}

.t-konto-footer {
  display: flex;
  border-top: 2px double var(--text-muted);
}

.footer-sum {
  flex: 1;
  text-align: right;
  padding: 0.5rem 1rem;
}

.left-side .footer-sum {
  border-right: 2px solid var(--text-muted);
}

/* Inventar Schema */
.inventar-schema {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 768px) {
  .inventar-schema {
    flex-direction: row;
  }
  .schema-part {
    flex: 1;
  }
}

.schema-part {
  background: rgba(0,0,0,0.15);
  border: 1px solid var(--card-border);
  padding: 1rem;
  border-radius: 6px;
}

body.light-mode .schema-part {
  background: rgba(0,0,0,0.03);
}

.schema-part h4 {
  margin-bottom: 0.5rem;
  color: var(--fly-orange, #F39C12);
}

.schema-part ul {
  margin-left: 1.5rem;
  margin-top: 0.5rem;
}

.formula-box {
  background: var(--bg-color);
  padding: 1rem;
  margin-top: 1rem;
  border-radius: 4px;
  text-align: right;
  font-family: monospace;
  font-size: 1.1rem;
}

/* Bilanz Drag & Drop */
.bilanz-chip {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  color: #fff;
  font-weight: bold;
  font-size: 0.85rem;
  cursor: grab;
  user-select: none;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.bilanz-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.bilanz-chip.dragging {
  opacity: 0.5;
  transform: scale(0.95);
}
.bilanz-chip-placed {
  display: inline-block;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  color: #fff;
  font-weight: bold;
  font-size: 0.8rem;
  white-space: nowrap;
}

.bilanz-slot {
  min-height: 48px;
  border: 2px dashed rgba(255,255,255,0.2);
  border-radius: 6px;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s;
}
.bilanz-slot.empty {
  background: rgba(255,255,255,0.03);
}
.bilanz-slot.empty.drag-over {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.15);
  box-shadow: inset 0 0 10px rgba(59,130,246,0.2);
}
.bilanz-slot.filled {
  border-style: solid;
  background: rgba(255,255,255,0.05);
}

/* ------------------------------------------------------------------ */
/* WERKSTOFFE THEORIE CSS                                             */
/* ------------------------------------------------------------------ */

.werkstoff-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

@media (min-width: 768px) {
  .werkstoff-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.two-column-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

@media (min-width: 768px) {
  .two-column-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.werkstoff-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1.25rem;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.werkstoff-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.werkstoff-card.rohstoff::before {
  background: linear-gradient(90deg, #0086cb, #38bdf8);
}

.werkstoff-card.hilfsstoff::before {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.werkstoff-card.betriebsstoff::before {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.werkstoff-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.werkstoff-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.werkstoff-card h4 {
  margin-bottom: 0.5rem;
  font-size: 1.15rem;
}

.werkstoff-card.rohstoff h4 {
  color: #0086cb;
}

.werkstoff-card.hilfsstoff h4 {
  color: #f59e0b;
}

.werkstoff-card.betriebsstoff h4 {
  color: #10b981;
}

.werkstoff-def {
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.werkstoff-merkmal {
  background: rgba(0, 0, 0, 0.15);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

body.light-mode .werkstoff-merkmal {
  background: rgba(0, 0, 0, 0.04);
}

.werkstoff-table-wrap {
  overflow-x: auto;
  margin-top: 1rem;
}

.werkstoff-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 400px;
}

.werkstoff-table th,
.werkstoff-table td {
  border: 1px solid var(--card-border);
  padding: 0.6rem 1rem;
  text-align: left;
}

.werkstoff-table th {
  background: rgba(0, 134, 203, 0.15);
  color: var(--primary);
  font-weight: bold;
}

.werkstoff-table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

body.light-mode .werkstoff-table tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.02);
}

/* SVG icon for Stationenlernen button - using a more fitting "route" icon  */
.nav-btn svg {
  flex-shrink: 0;
}


/* =============================================================================
   WARENWIRTSCHAFTSSIMULATION (ERP-SIMULATOR) STYLES
   Mobile First Design
   ============================================================================= */

/* --- Main Container --- */
.wawi-container {
  display: flex;
  flex-direction: column;
  height: calc(100svh - 150px); /* Adjusted for perfect fit on laptops/desktops */
  min-height: 450px;
  position: relative;
  background: var(--bg-color);
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid var(--card-border);
}

@media (min-width: 1024px) {
  .wawi-container {
    height: calc(100svh - 150px); /* Laptop/Desktop optimization */
  }
}

@media (max-width: 1023px) {
  .wawi-container {
    height: calc(100svh - 130px); /* Taller on tablets (iPad 8th Gen optimization) */
  }
}

/* --- App Header (Internal) --- */
.wawi-app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--card-bg);
  border-bottom: 1px solid var(--card-border);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.wawi-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.wawi-company-icon {
  font-size: 1.5rem;
}

.wawi-company-name {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
}

.wawi-module-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.wawi-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.wawi-scenario-select {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 0.5rem;
  color: var(--text-main);
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  max-width: 160px;
}

.wawi-reset-btn {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 0.5rem;
  color: #ef4444;
  padding: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.wawi-reset-btn:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* --- Content Area --- */
.wawi-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem;
  -webkit-overflow-scrolling: touch;
}

/* --- Bottom Navigation --- */
.wawi-bottom-nav {
  display: flex;
  align-items: stretch;
  background: var(--card-bg);
  border-top: 1px solid var(--card-border);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
  padding: 0;
  padding-bottom: clamp(1rem, env(safe-area-inset-bottom), 2.5rem);
}

.wawi-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.6rem 0.25rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  min-height: 56px;
  font-family: inherit;
}

.wawi-nav-item:active {
  transform: scale(0.95);
}

.wawi-nav-item.active {
  color: var(--primary);
}

.wawi-nav-item.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 25%;
  right: 25%;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 3px 3px;
}

.wawi-nav-item svg {
  flex-shrink: 0;
}

/* Alert Badge on Nav */
.wawi-badge-alert {
  position: absolute;
  top: 4px;
  right: calc(50% - 20px);
  background: #ef4444;
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  animation: wawiPulse 2s ease-in-out infinite;
}

@keyframes wawiPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* --- Toast Notification --- */
.wawi-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  max-width: calc(100vw - 2rem);
  text-align: center;
  font-family: 'Outfit', sans-serif;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.wawi-toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.wawi-toast-success {
  background: linear-gradient(135deg, #059669, #10b981);
  color: white;
}

.wawi-toast-error {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: white;
}

.wawi-toast-info {
  background: linear-gradient(135deg, #0077b6, #0096c7);
  color: white;
}

/* --- Welcome Banner --- */
.wawi-welcome-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: linear-gradient(135deg, rgba(0, 134, 203, 0.15), rgba(0, 134, 203, 0.05));
  border: 1px solid rgba(0, 134, 203, 0.2);
  border-left: 4px solid var(--primary);
  border-radius: 1rem;
  margin-bottom: 1.25rem;
}

.wawi-welcome-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
}

.wawi-welcome-text h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1.1rem;
  color: var(--primary);
}

.wawi-welcome-text p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --- KPI Grid --- */
.wawi-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.wawi-kpi-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 1rem;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.wawi-kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  opacity: 0.7;
}

.wawi-kpi-bank::before { background: linear-gradient(90deg, #0086cb, #00b4d8); }
.wawi-kpi-stock::before { background: linear-gradient(90deg, #10b981, #34d399); }
.wawi-kpi-products::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.wawi-kpi-journal::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }

.wawi-kpi-card:active {
  transform: scale(0.97);
}

.wawi-kpi-alert {
  border-color: rgba(239, 68, 68, 0.4);
}

.wawi-kpi-alert::before {
  background: linear-gradient(90deg, #ef4444, #f87171) !important;
}

.wawi-kpi-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.wawi-kpi-value {
  font-size: clamp(0.85rem, 3vw, 1rem);
  font-weight: 700;
  margin-bottom: 0.25rem;
  line-height: 1.3;
  white-space: nowrap;
  letter-spacing: -0.5px;
}

.wawi-kpi-label {
  font-size: clamp(0.65rem, 2vw, 0.75rem);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.wawi-kpi-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  line-height: 1.4;
}

/* --- Alert Card --- */
.wawi-alert-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.wawi-alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.wawi-alert-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

/* --- Dashboard Sections --- */
.wawi-dashboard-section {
  margin-bottom: 1.5rem;
}

.wawi-dashboard-section h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-weight: 700;
}

/* --- Progress Card --- */
.wawi-progress-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 0.75rem;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.wawi-progress-card:active {
  transform: scale(0.98);
}

.wawi-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.wawi-progress-pct {
  color: var(--primary);
  font-weight: 700;
}

.wawi-progress-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.wawi-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #00b4d8);
  border-radius: 4px;
  transition: width 0.5s ease;
}

body.light-mode .wawi-progress-bar-track {
  background: rgba(0, 0, 0, 0.08);
}

/* --- Quick Actions --- */
.wawi-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.wawi-quick-btn {
  flex: 1;
  min-width: 140px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 0.75rem;
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.wawi-quick-btn:active {
  transform: scale(0.97);
}

.wawi-quick-btn:hover {
  border-color: var(--primary);
  background: rgba(0, 134, 203, 0.1);
}

.wawi-quick-sell {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.05);
}

.wawi-quick-icon {
  font-size: 1.3rem;
}

.wawi-link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.5rem 0;
  font-family: inherit;
}

/* --- Buttons --- */
.wawi-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
}

.wawi-btn:active {
  transform: scale(0.97);
}

.wawi-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.wawi-btn-primary {
  background: linear-gradient(135deg, #0077b6, #0096c7);
  color: white;
}

.wawi-btn-success {
  background: linear-gradient(135deg, #059669, #10b981);
  color: white;
}

.wawi-btn-danger {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: white;
}

.wawi-btn-outline {
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text-main);
}

.wawi-btn-outline:hover {
  border-color: var(--primary);
  background: rgba(0, 134, 203, 0.1);
}

.wawi-btn-sm {
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
}

.wawi-btn-lg {
  padding: 1rem 1.5rem;
  font-size: 1rem;
  width: 100%;
  border-radius: 0.75rem;
}

/* --- Section Headers --- */
.wawi-section-header {
  margin-bottom: 1.25rem;
}

.wawi-section-header h3 {
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}

.wawi-section-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --- Production: Progress Ring --- */
.wawi-production-progress {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.wawi-ring-container {
  position: relative;
  width: 130px;
  height: 130px;
}

.wawi-progress-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.wawi-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 8;
}

body.light-mode .wawi-ring-bg {
  stroke: rgba(0, 0, 0, 0.06);
}

.wawi-ring-fill {
  fill: none;
  stroke: var(--primary);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease;
}

.wawi-ring-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.wawi-ring-pct {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
}

.wawi-ring-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --- BOM List --- */
.wawi-bom-list {
  margin-bottom: 1.5rem;
}

.wawi-bom-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.wawi-bom-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 0.75rem;
  margin-bottom: 0.5rem;
  transition: all 0.2s;
}

.wawi-bom-done {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.05);
}

.wawi-bom-blocked {
  border-color: rgba(239, 68, 68, 0.2);
  opacity: 0.7;
}

.wawi-bom-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}

.wawi-bom-info {
  flex: 1;
  min-width: 0;
}

.wawi-bom-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

.wawi-bom-detail {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.wawi-bom-bar-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

body.light-mode .wawi-bom-bar-track {
  background: rgba(0, 0, 0, 0.08);
}

.wawi-bom-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.wawi-bom-bar-fill.done {
  background: var(--secondary);
}

.wawi-assemble-btn {
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: inherit;
  background: linear-gradient(135deg, #0077b6, #0096c7);
  color: white;
  min-height: 36px;
}

.wawi-assemble-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.wawi-assemble-btn.done {
  background: var(--secondary);
  color: white;
  cursor: default;
}

.wawi-assemble-btn.blocked {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  cursor: not-allowed;
}

.wawi-assemble-btn:disabled {
  opacity: 0.6;
}

/* --- Production Actions --- */
.wawi-production-actions {
  margin-top: 1rem;
}

.wawi-info-note {
  text-align: center;
  padding: 1rem;
  background: var(--card-bg);
  border: 1px dashed var(--card-border);
  border-radius: 0.75rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.wawi-sell-section {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: var(--card-bg);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 1rem;
}

.wawi-sell-section h4 {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.wawi-sell-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.wawi-sell-actions .wawi-btn {
  flex: 1;
  min-width: 140px;
}

.wawi-sell-price {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

/* --- Stock Grid --- */
.wawi-stock-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.wawi-stock-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 1rem;
  padding: 1rem;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.wawi-stock-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.wawi-stock-ok::before { background: #10b981; }
.wawi-stock-warning::before { background: #f59e0b; }
.wawi-stock-danger::before { background: #ef4444; }

.wawi-stock-danger {
  border-color: rgba(239, 68, 68, 0.3);
}

.wawi-stock-warning {
  border-color: rgba(245, 158, 11, 0.3);
}

.wawi-stock-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.wawi-stock-icon {
  font-size: 1.5rem;
}

.wawi-stock-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.wawi-dot-ok { background: #10b981; }
.wawi-dot-warning { background: #f59e0b; }
.wawi-dot-danger { background: #ef4444; }

.wawi-stock-name {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.wawi-stock-amount {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.wawi-stock-amount-lg {
  font-size: 1.8rem;
  color: var(--primary);
}

.wawi-stock-bar-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

body.light-mode .wawi-stock-bar-track {
  background: rgba(0, 0, 0, 0.08);
}

.wawi-stock-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}

.wawi-bar-ok { background: #10b981; }
.wawi-bar-warning { background: #f59e0b; }
.wawi-bar-danger { background: #ef4444; }

.wawi-stock-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
  gap: 0.25rem;
  flex-wrap: wrap;
}

.wawi-stock-value {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  font-weight: 600;
}

.wawi-stock-label-fe {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
  font-weight: 600;
}

/* --- Finished Stock --- */
.wawi-finished-stock {
  margin-bottom: 1.25rem;
}

.wawi-stock-finished {
  border-color: rgba(0, 134, 203, 0.3);
  background: linear-gradient(135deg, rgba(0, 134, 203, 0.1), rgba(0, 134, 203, 0.03));
}

.wawi-stock-finished::before {
  background: linear-gradient(90deg, var(--primary), #00b4d8);
}

/* --- Inventory Summary --- */
.wawi-inventory-summary {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 0.75rem;
  padding: 1rem;
}

.wawi-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  font-size: 0.85rem;
}

.wawi-summary-value {
  font-weight: 700;
}

.wawi-summary-total {
  border-top: 2px solid var(--card-border);
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  font-weight: 700;
  font-size: 0.95rem;
}

/* --- Accounting --- */
.wawi-accounts-section {
  margin-bottom: 1.5rem;
}

.wawi-account-group {
  margin-bottom: 1rem;
}

.wawi-group-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
  font-weight: 700;
  padding: 0.4rem 0.75rem;
  border-radius: 0.4rem;
}

.wawi-group-aktiv {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
}

.wawi-group-passiv {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
}

.wawi-group-ertrag {
  color: #34d399;
  background: rgba(52, 211, 153, 0.1);
}

.wawi-group-aufwand {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
}

body.light-mode .wawi-group-aktiv {
  color: #0369a1;
  background: rgba(3, 105, 161, 0.08);
}

body.light-mode .wawi-group-passiv {
  color: #b91c1c;
  background: rgba(185, 28, 28, 0.08);
}

body.light-mode .wawi-group-ertrag {
  color: #047857;
  background: rgba(4, 120, 87, 0.08);
}

body.light-mode .wawi-group-aufwand {
  color: #92400e;
  background: rgba(146, 64, 14, 0.08);
}

.wawi-account-list {
  border: 1px solid var(--card-border);
  border-radius: 0.5rem;
  overflow: hidden;
}

.wawi-account-row {
  display: flex;
  align-items: center;
  padding: 0.65rem 0.75rem;
  gap: 0.75rem;
  border-bottom: 1px solid var(--card-border);
  font-size: 0.85rem;
}

.wawi-account-row:last-child {
  border-bottom: none;
}

.wawi-acc-id {
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  min-width: 36px;
}

.wawi-acc-name {
  flex: 1;
  font-weight: 500;
}

.wawi-acc-balance {
  font-weight: 700;
  white-space: nowrap;
}

.wawi-acc-positive {
  color: #34d399;
}

.wawi-acc-negative {
  color: #fbbf24;
}

body.light-mode .wawi-acc-positive {
  color: #047857;
}

body.light-mode .wawi-acc-negative {
  color: #92400e;
}

/* --- View Toggle --- */
.wawi-view-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 1.25rem;
  border: 1px solid var(--card-border);
  border-radius: 0.5rem;
  overflow: hidden;
}

.wawi-toggle-btn {
  flex: 1;
  padding: 0.6rem 0.5rem;
  background: var(--card-bg);
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
}

.wawi-toggle-btn:not(:last-child) {
  border-right: 1px solid var(--card-border);
}

.wawi-toggle-btn.active {
  background: var(--primary);
  color: white;
}

.wawi-toggle-btn:hover:not(.active) {
  background: rgba(0, 134, 203, 0.1);
}

/* --- T-Konten --- */
.wawi-tkonten-section {
  animation: fadeIn 0.3s ease-out;
}

.wawi-tkonten-group {
  margin-bottom: 1.5rem;
}

.wawi-tkonten-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.wawi-tkonto {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 0.75rem;
  overflow: hidden;
  transition: all 0.2s;
}

/* T-Konto Header */
.wawi-tkonto-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 2px solid var(--text-main);
  flex-wrap: wrap;
}

body.light-mode .wawi-tkonto-header {
  background: rgba(0, 0, 0, 0.02);
}

.wawi-tkonto-id {
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 700;
}

.wawi-tkonto-name {
  font-weight: 700;
  font-size: 0.9rem;
  flex: 1;
}

.wawi-tkonto-cat {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
}

.wawi-tk-cat-aktiv {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

.wawi-tk-cat-passiv {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}

.wawi-tk-cat-ertrag {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
}

.wawi-tk-cat-aufwand {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

body.light-mode .wawi-tk-cat-aktiv { color: #0369a1; background: rgba(3, 105, 161, 0.1); }
body.light-mode .wawi-tk-cat-passiv { color: #b91c1c; background: rgba(185, 28, 28, 0.1); }
body.light-mode .wawi-tk-cat-ertrag { color: #047857; background: rgba(4, 120, 87, 0.1); }
body.light-mode .wawi-tk-cat-aufwand { color: #92400e; background: rgba(146, 64, 14, 0.1); }

/* T-Konto Body (Soll | Haben) */
.wawi-tkonto-body {
  display: flex;
  min-height: 80px; /* Slightly taller */
}

.wawi-tkonto-col {
  flex: 1;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.wawi-tkonto-col-header {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 0.2rem 0.35rem;
  margin-bottom: 0.3rem;
  text-align: center;
}

.wawi-tkonto-soll .wawi-tkonto-col-header {
  color: #38bdf8;
}

.wawi-tkonto-haben .wawi-tkonto-col-header {
  color: #f87171;
}

body.light-mode .wawi-tkonto-soll .wawi-tkonto-col-header {
  color: #0369a1;
}

body.light-mode .wawi-tkonto-haben .wawi-tkonto-col-header {
  color: #b91c1c;
}

/* Vertical Divider */
.wawi-tkonto-divider {
  width: 2px;
  background: var(--text-main);
  flex-shrink: 0;
  opacity: 0.5;
}

/* Entry Row */
.wawi-tkonto-entry {
  display: flex;
  justify-content: space-between;
  align-items: flex-start; /* Better for wrapped text */
  padding: 0.5rem 0.75rem; /* Increased horizontal padding */
  font-size: 0.8rem;
  gap: 0.75rem; /* More gap between name and value */
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body.light-mode .wawi-tkonto-entry {
  border-bottom-color: rgba(0, 0, 0, 0.04);
}

.wawi-tkonto-ab {
  font-weight: 600;
  background: rgba(0, 134, 203, 0.08);
  border-radius: 0.25rem;
}

.wawi-tkonto-entry-label {
  flex: 1;
  min-width: 0;
  /* Removed ellipsis to ensure everything is readable */
  word-wrap: break-word;
  font-size: 0.78rem;
  line-height: 1.2;
}

.wawi-tkonto-entry-amount {
  font-weight: 700;
  white-space: nowrap;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.wawi-tkonto-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 0.5rem;
  font-size: 0.8rem;
}

/* Saldo Row */
.wawi-tkonto-saldo-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem; /* More space to prevent cutting off */
  font-size: 0.78rem;
  margin-top: auto;
  border-top: 1px dashed var(--card-border);
  color: var(--primary);
  font-weight: 700;
  font-style: italic;
}

/* Footer (Totals) */
.wawi-tkonto-footer {
  display: flex;
  border-top: 3px double var(--text-main);
  font-weight: 700;
  font-size: 0.85rem;
}

.wawi-tkonto-footer span {
  flex: 1;
  text-align: center;
  padding: 0.5rem;
  font-variant-numeric: tabular-nums;
}

.wawi-tkonto-footer span:first-child {
  border-right: 2px solid var(--text-main);
  opacity: 0.5;
}

/* --- Special Actions --- */
.wawi-closing-actions {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
}

.wawi-btn-closing {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: white;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.wawi-btn-closing:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4);
}

/* --- GuV Card --- */
.wawi-guv-card {
  padding: 1.25rem;
  border-radius: 1rem;
  text-align: center;
  margin-top: 1rem;
}

.wawi-guv-positive {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.wawi-guv-negative {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05));
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.wawi-guv-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.wawi-guv-value {
  font-size: 1.6rem;
  font-weight: 700;
}

.wawi-guv-positive .wawi-guv-value {
  color: #34d399;
}

.wawi-guv-negative .wawi-guv-value {
  color: #f87171;
}

body.light-mode .wawi-guv-positive .wawi-guv-value {
  color: #047857;
}

body.light-mode .wawi-guv-negative .wawi-guv-value {
  color: #b91c1c;
}

.wawi-guv-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* --- Journal Feed --- */
.wawi-journal-section {
  margin-top: 0.5rem;
}

.wawi-journal-section h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.wawi-journal-feed {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.wawi-journal-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 0.75rem;
  padding: 0.85rem;
  transition: all 0.2s;
}

.wawi-journal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.wawi-journal-id {
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 700;
}

.wawi-journal-time {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.wawi-journal-desc {
  font-size: 0.85rem;
  margin-bottom: 0.6rem;
  font-weight: 500;
  line-height: 1.4;
}

.wawi-journal-booking {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.wawi-journal-side {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-radius: 0.4rem;
  font-size: 0.8rem;
  flex-wrap: wrap;
}

.wawi-journal-soll {
  background: rgba(56, 189, 248, 0.1);
}

.wawi-journal-haben {
  background: rgba(248, 113, 113, 0.1);
}

body.light-mode .wawi-journal-soll {
  background: rgba(3, 105, 161, 0.08);
}

body.light-mode .wawi-journal-haben {
  background: rgba(185, 28, 28, 0.08);
}

.wawi-journal-label {
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 36px;
}

.wawi-journal-soll .wawi-journal-label {
  color: #38bdf8;
}

.wawi-journal-haben .wawi-journal-label {
  color: #f87171;
}

body.light-mode .wawi-journal-soll .wawi-journal-label {
  color: #0369a1;
}

body.light-mode .wawi-journal-haben .wawi-journal-label {
  color: #b91c1c;
}

.wawi-journal-acc {
  flex: 1;
  font-weight: 500;
}

.wawi-journal-amount {
  font-weight: 700;
  white-space: nowrap;
}

.wawi-journal-divider {
  text-align: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.1rem 0;
}

/* --- Empty State --- */
.wawi-empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
}

.wawi-empty-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  display: block;
}

.wawi-empty-state p {
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

/* --- Procurement --- */
.wawi-liquidity-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.wawi-liquidity-row {
  display: flex;
  justify-content: space-between;
  padding: 0.3rem 0;
  font-size: 0.9rem;
}

.wawi-liquidity-val {
  font-weight: 700;
}

.wawi-debt {
  color: #f87171;
}

body.light-mode .wawi-debt {
  color: #b91c1c;
}

.wawi-order-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.wawi-order-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 1rem;
  padding: 1rem;
  position: relative;
  overflow: hidden;
}

.wawi-order-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.wawi-order-card.wawi-stock-ok::before { background: #10b981; }
.wawi-order-card.wawi-stock-warning::before { background: #f59e0b; }
.wawi-order-card.wawi-stock-danger::before { background: #ef4444; }

.wawi-order-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.wawi-order-icon {
  font-size: 1.3rem;
}

.wawi-order-name {
  font-weight: 600;
  flex: 1;
}

.wawi-order-stock {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.wawi-order-form-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.wawi-order-label {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.wawi-qty-control {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--card-border);
  border-radius: 0.5rem;
  overflow: hidden;
  flex: 1;
  max-width: 150px;
}

.wawi-qty-btn {
  background: var(--card-bg);
  border: none;
  color: var(--text-main);
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 700;
  transition: background 0.2s;
  font-family: inherit;
  min-height: 38px;
}

.wawi-qty-btn:hover {
  background: rgba(0, 134, 203, 0.15);
}

.wawi-qty-btn:active {
  transform: scale(0.95);
}

.wawi-qty-input {
  width: 50px;
  text-align: center;
  border: none;
  border-left: 1px solid var(--card-border);
  border-right: 1px solid var(--card-border);
  background: transparent;
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  padding: 0.5rem 0.25rem;
  -moz-appearance: textfield;
}

.wawi-qty-input::-webkit-inner-spin-button,
.wawi-qty-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.wawi-order-preview {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.wawi-order-actions {
  display: flex;
  gap: 0.5rem;
}

.wawi-order-actions .wawi-btn {
  flex: 1;
}

.wawi-order-warning {
  font-size: 0.75rem;
  color: #f59e0b;
  margin-top: 0.5rem;
  font-weight: 500;
}

/* --- Sales --- */
.wawi-sales-inventory-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 1rem;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, rgba(0, 134, 203, 0.05), transparent);
}

.wawi-sales-inv-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.wawi-sales-inv-icon {
  font-size: 2rem;
}

.wawi-sales-inv-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.wawi-sales-inv-val {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
}

.wawi-sales-inv-alert {
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 0.5rem;
  font-size: 0.85rem;
  color: #f59e0b;
}

.wawi-sales-title {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-weight: 700;
}

.wawi-sales-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.wawi-sales-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 1rem;
  padding: 1rem;
  position: relative;
  overflow: hidden;
  border-left: 4px solid var(--primary);
}

.wawi-sales-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.wawi-sales-id {
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
}

.wawi-sales-status-badge {
  font-size: 0.65rem;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  padding: 0.2rem 0.5rem;
  border-radius: 1rem;
  font-weight: 700;
}

.wawi-sales-customer {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.wawi-sales-details {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.4;
}

.wawi-sales-actions {
  display: flex;
  gap: 0.5rem;
}

.wawi-sales-warning {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: #ef4444;
  font-weight: 600;
}

.wawi-sales-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.wawi-sales-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 0.5rem;
  font-size: 0.85rem;
}

.wawi-sales-history-meta {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-left: 0.5rem;
}

.wawi-sales-history-total {
  font-weight: 700;
  color: #10b981;
}

/* --- Sales Creator --- */
.wawi-sales-creator {
  margin-bottom: 2rem;
}

.wawi-creator-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 1rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: linear-gradient(to bottom right, rgba(0, 134, 203, 0.05), transparent);
}

.wawi-creator-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.wawi-creator-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.wawi-creator-field label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.wawi-input {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 0.75rem;
  color: var(--text-main);
  padding: 0.85rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  font-family: inherit;
  transition: all 0.2s ease;
  min-height: 48px; /* Higher inputs as requested */
  width: 100%;
}

.wawi-input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(0, 134, 203, 0.1);
  box-shadow: 0 0 0 3px rgba(0, 134, 203, 0.2);
}

body.light-mode .wawi-input {
  background: #ffffff;
  border-color: #cbd5e1;
}

.wawi-creator-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

/* --- Tooltips & Info --- */
.wawi-sales-orders-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.wawi-discount-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.wawi-tooltip-container {
  position: relative;
  display: inline-block;
}

.wawi-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 800;
  font-family: 'Georgia', serif;
  cursor: help;
}

.wawi-tooltip {
  visibility: hidden;
  width: 220px;
  background-color: #ffffff; /* Solid White */
  color: #1e293b; /* Solid Dark Text */
  text-align: left;
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  padding: 1rem;
  position: absolute;
  z-index: 100;
  bottom: 125%;
  left: 50%;
  margin-left: -110px;
  font-size: 0.85rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  opacity: 0;
  transition: opacity 0.3s, visibility 0.3s;
  line-height: 1.5;
}

body.dark-mode .wawi-tooltip {
  background-color: #1e293b;
  color: #f8fafc;
  border-color: #334155;
}

.wawi-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--card-border) transparent transparent transparent;
}

.wawi-tooltip-container:hover .wawi-tooltip {
  visibility: visible;
  opacity: 1;
}

.wawi-discount-tag {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  padding: 0.1rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  margin-left: 0.25rem;
}

@media (min-width: 1024px) {
  .wawi-creator-card {
    flex-direction: row;
    align-items: flex-end;
  }
  .wawi-creator-form {
    flex: 1;
  }
}

/* =============================================================================
   DESKTOP OVERRIDES (ERP Module)
   ============================================================================= */

@media (min-width: 768px) {
  .wawi-kpi-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .wawi-kpi-value {
    font-size: 1.1rem;
  }

  .wawi-stock-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .wawi-order-grid {
    grid-template-columns: 1fr 1fr;
  }

  .wawi-sales-grid {
    grid-template-columns: 1fr 1fr;
  }

  .wawi-nav-item {
    font-size: 0.75rem;
    min-height: 52px;
  }

  .wawi-journal-booking {
    flex-direction: row;
    align-items: center;
  }

  .wawi-journal-side {
    flex: 1;
  }

  .wawi-journal-divider {
    padding: 0 0.5rem;
  }

  .wawi-bom-item {
    padding: 1rem;
  }

  .wawi-content {
    padding: 1.5rem;
  }

  .wawi-tkonten-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .wawi-stock-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .wawi-order-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .wawi-sales-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .wawi-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  }

  .wawi-bom-item:hover {
    border-color: var(--primary);
  }

  .wawi-tkonto:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  }
}

/* --- Changelog --- */
.changelog-container {
  max-width: 800px;
  margin: 0 auto;
  animation: fadeIn 0.4s ease-out;
}

.changelog-version {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.changelog-version.legacy {
  opacity: 0.8;
}

.changelog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.version-tag {
  background: var(--primary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 2rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.version-date {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.changelog-body h3 {
  font-size: 1.1rem;
  margin: 1.25rem 0 0.75rem 0;
  color: var(--primary);
}

.changelog-body ul {
  list-style: none;
  padding: 0;
}

.changelog-body li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.changelog-body li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
}

/* --- Data Management --- */
.wawi-data-mgmt-section {
  background: rgba(0, 134, 203, 0.05);
  border: 1px dashed var(--card-border);
  border-radius: 1rem;
  padding: 1.25rem;
  margin-top: 2rem;
  transition: all 0.3s ease;
}

.wawi-data-mgmt-section.drag-over {
  background: rgba(0, 134, 203, 0.15);
  border: 2px dashed var(--primary);
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 134, 203, 0.1);
}


.wawi-data-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

@media (max-width: 480px) {
  .wawi-data-grid {
    grid-template-columns: 1fr;
  }
}

.wawi-btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  transition: all 0.2s ease;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
}

.wawi-btn-outline:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 134, 203, 0.2);
}

/* Difficulty Selector */
.wawi-diff-btn {
  padding: 0.6rem 0.5rem;
  border-radius: 0.8rem;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: clamp(0.7rem, 2.8vw, 0.85rem);
  font-weight: 600;
  flex: 1;
  min-width: 80px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wawi-diff-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.wawi-diff-btn.active {
  border: 2px solid var(--primary);
  background: rgba(0, 134, 203, 0.1);
  color: var(--primary);
  font-weight: 700;
  box-shadow: 0 0 15px rgba(0, 134, 203, 0.2);
}


/* Journal GoB Extensions */
.wawi-journal-card-storniert {
  opacity: 0.6;
  text-decoration: line-through;
  filter: grayscale(0.5);
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.05) !important;
}

.wawi-journal-card-storniert .wawi-journal-booking,
.wawi-journal-card-storniert .wawi-journal-desc {
  text-decoration: line-through;
}

.wawi-storno-label {
  text-decoration: none !important;
  display: inline-block;
  color: #ef4444;
  font-weight: 700;
  font-size: 0.75rem;
  margin-left: 0.5rem;
  text-transform: uppercase;
}

.wawi-audit-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: #f59e0b;
  color: white;
  border-radius: 50%;
  font-size: 0.7rem;
  cursor: help;
  margin-left: 0.5rem;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
  transition: transform 0.2s;
}

.wawi-audit-icon:hover {
  transform: scale(1.2);
}

.wawi-journal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--card-border);
}

.wawi-journal-action-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.wawi-edit-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.wawi-storno-btn:hover {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
}

@media print {
  .wawi-journal-actions {
    display: none !important;
  }
}

/* --- Mobile Fixes for iPhone Mini & small screens --- */
@media (max-width: 400px) {
  .wawi-welcome-banner {
    padding: 1rem;
    gap: 0.75rem;
  }
  .wawi-welcome-icon {
    font-size: 2rem;
  }
  .wawi-kpi-grid, .wawi-stock-grid {
    gap: 0.5rem;
  }
  .wawi-kpi-card, .wawi-stock-card {
    padding: 0.75rem;
  }
  .wawi-section-header h3 {
    font-size: 1rem;
  }
  .wawi-diff-btn {
    padding: 0.5rem 0.3rem;
    min-width: 75px;
  }
  .wawi-quick-btn {
    padding: 0.75rem 0.5rem;
    font-size: 0.8rem;
    min-width: 120px;
  }
}



/* Hardware Trainer Specific Styles */
.drop-zone {
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.drag-item {
    box-shadow: var(--glass-shadow);
    transition: transform 0.2s;
}

.drag-item:active {
    cursor: grabbing;
    transform: scale(0.95);
}

.option-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    border: 1px solid var(--card-border);
    background: rgba(255,255,255,0.03);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.option-btn:hover {
    background: rgba(255,255,255,0.08);
    border-color: var(--primary);
}

.option-btn small {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 2px;
}

.status-area .layer-card {
    border-left: 4px solid var(--primary);
}

#validation-feedback div {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Theory Expansion & Content Styles */
.layer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.expand-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    opacity: 0.5;
}

.collapsed .expand-icon {
    transform: rotate(-90deg);
}

.layer-content h3 {
    color: var(--primary);
    font-size: 1.1rem;
    margin: 1.2rem 0 0.5rem 0;
}

.layer-content h3:first-child {
    margin-top: 0;
}

.layer-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.layer-content ul {
    margin-bottom: 1rem;
    padding-left: 1.2rem;
}

.layer-content li {
    margin-bottom: 0.5rem;
}

/* Stationenlernen Styles */
.station-grid {
    margin-top: 1rem;
}

.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255,255,255,0.1);
    color: var(--text-muted);
}

.badge-easy { background: rgba(40, 167, 69, 0.15); color: #28a745; }
.badge-medium { background: rgba(255, 193, 7, 0.15); color: #ffc107; }
.badge-hard { background: rgba(220, 53, 69, 0.15); color: #dc3545; }

.nav-btn {
    background: none;
    border: 1px solid var(--card-border);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.05);
    border-color: var(--primary);
}

.option-grid .option-btn {
    text-align: left;
    font-size: 1rem;
    padding: 1rem 1.5rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-grid .option-btn:hover {
    background: rgba(0, 134, 203, 0.1);
    border-color: var(--primary);
    transform: translateX(5px);
}

/* Station Tile Refinement */
.station-tile {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, border-color 0.3s ease !important;
}

.station-tile:hover {
    transform: translateY(-5px);
    border-color: var(--primary) !important;
}

.station-tile-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.2rem !important;
}

.station-desc {
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-muted);
    margin-bottom: 1.2rem;
    min-height: 2.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.station-footer {
    display: none; /* Footers are now handled by full-width buttons in JS */
}

.compact-tile {
    min-height: auto;
}




