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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
}

.screen {
  display: none;
}

.screen:not(.hidden) {
  display: block;
}

.hidden {
  display: none !important;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.container.small {
  max-width: 500px;
  margin-top: 5rem;
}

/* Login Screens */
h1 {
  text-align: center;
  color: white;
  margin-bottom: 2rem;
  font-size: 2.5rem;
}

.login-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.login-card {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  text-align: center;
}

.login-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.login-card h2 {
  color: #667eea;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.login-card p {
  color: #666;
  line-height: 1.6;
}

/* Forms */
.form-card, form {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #333;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #667eea;
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-block;
}

.btn-primary {
  background: #667eea;
  color: white;
  width: 100%;
}

.btn-primary:hover {
  background: #5568d3;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
  background: #e0e0e0;
  color: #333;
}

.btn-secondary:hover {
  background: #d0d0d0;
}

.btn-danger {
  background: #f44336;
  color: white;
  padding: 0.5rem 1rem;
}

.btn-danger:hover {
  background: #da190b;
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  margin-top: 1rem;
}

.back-btn {
  background: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 1rem;
  font-size: 1rem;
  font-weight: 600;
  transition: background 0.2s;
}

.back-btn:hover {
  background: #f0f0f0;
}

/* Error Messages */
.error {
  background: #ffebee;
  color: #c62828;
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  border-left: 4px solid #c62828;
}

.success {
  background: #e8f5e9;
  color: #2e7d32;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border-left: 4px solid #2e7d32;
}

/* Navbar */
.navbar {
  background: white;
  padding: 1rem 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.nav-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: #667eea;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  background: white;
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  flex-wrap: wrap;
}

.tab {
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  color: #666;
  transition: all 0.2s;
}

.tab:hover {
  background: #f5f5f5;
}

.tab.active {
  background: #667eea;
  color: white;
}

.tab-content {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

/* Cards */
.card {
  background: #f9f9f9;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: all 0.2s;
}

.card:hover {
  border-color: #667eea;
  box-shadow: 0 2px 10px rgba(102, 126, 234, 0.1);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #333;
}

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

.card-body {
  color: #666;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.form-actions .btn {
  flex: 1;
}

/* Bestellungen */
.bestellung-card {
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.bestellung-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e0e0e0;
  flex-wrap: wrap;
  gap: 1rem;
}

.bestellung-info {
  flex: 1;
}

.bestellung-id {
  font-size: 1.3rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 0.5rem;
}

.bestellung-meta {
  color: #666;
  font-size: 0.9rem;
}

.status-badge {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}

.status-eingegangen {
  background: #fff3e0;
  color: #f57c00;
}

.status-geprüft {
  background: #e3f2fd;
  color: #1976d2;
}

.status-weitergegeben {
  background: #e8f5e9;
  color: #388e3c;
}

.bestellung-positionen {
  margin-top: 1rem;
}

.bestellung-position {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem;
  background: #f9f9f9;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.position-produkt {
  font-weight: 600;
  color: #333;
}

.position-menge {
  color: #667eea;
  font-weight: 600;
}

/* Kompakte Bestellpositionen-Anzeige - 2-spaltig */
.bestellung-positionen-compact {
  margin-top: 1rem;
  padding: 0.75rem;
  background: #f9f9f9;
  border-radius: 8px;
  color: #555;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem 1rem;
}

.position-item {
  display: flex;
  align-items: baseline;
  padding: 0.25rem 0;
  line-height: 1.6;
}

.position-item strong {
  flex-shrink: 0;
  margin-right: 0.5rem;
}

.position-item strong {
  color: #333;
}

/* Toggle für Bestellpositionen */
.bestellung-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  margin-top: 0.5rem;
  background: #f0f0f0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #666;
  transition: background 0.2s;
}

.bestellung-toggle:hover {
  background: #e5e5e5;
}

.toggle-icon {
  font-size: 0.8rem;
  transition: transform 0.2s;
}

/* Collapsed State */
.bestellung-positionen-compact.collapsed {
  display: none;
}

/* Copy Button */
.btn-copy {
  padding: 0.5rem 1rem;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
  font-weight: 500;
}

.btn-copy:hover {
  background: #5568d3;
}

.status-select {
  padding: 0.5rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  background: white;
}

/* Produkt Input */
.produkt-input {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: #f9f9f9;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}

.produkt-input:hover {
  border-color: #667eea;
}

.produkt-input.has-quantity {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border-color: #667eea;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.produkt-info {
  flex: 1;
}

.produkt-name {
  font-weight: 600;
  color: #333;
  font-size: 1.1rem;
}

.produkt-einheit {
  color: #666;
  font-size: 0.9rem;
}

.produkt-einheit-inline {
  color: #666;
  font-size: 0.9rem;
  font-weight: 400;
  margin-left: 1rem;
}

.produkt-menge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.produkt-menge input {
  width: 80px;
  padding: 0.5rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  text-align: center;
}

.produkt-menge input:focus {
  outline: none;
  border-color: #667eea;
}

.btn-qty-plus, .btn-qty-minus {
  width: 35px;
  height: 35px;
  border: none;
  border-radius: 6px;
  font-size: 1.3rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-qty-plus {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-qty-plus:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-qty-minus {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

.btn-qty-minus:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(245, 87, 108, 0.3);
}

/* Zuweisung Drag & Drop */
.zuweisung-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.zuweisung-col h3 {
  margin-bottom: 1rem;
  color: #333;
}

.produkt-liste-drag {
  min-height: 300px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 1rem;
  background: #fafafa;
}

.produkt-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  margin-bottom: 0.35rem;
  transition: all 0.2s;
}

.produkt-item:hover {
  border-color: #667eea;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.produkt-item-name {
  flex: 1;
  font-weight: 500;
  color: #333;
  font-size: 0.95rem;
}

.btn-add, .btn-remove {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-add {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-add:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-remove {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

.btn-remove:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(245, 87, 108, 0.4);
}

.zuweisung-kategorie-gruppe {
  margin-bottom: 1.5rem;
}

.zuweisung-kategorie-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.empty-state {
  text-align: center;
  color: #999;
  padding: 2rem;
  font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  h1 {
    font-size: 1.8rem;
  }

  .login-cards {
    grid-template-columns: 1fr;
  }

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

  .tabs {
    flex-direction: column;
  }

  .tab {
    width: 100%;
  }

  .navbar {
    padding: 1rem;
  }

  .nav-brand {
    font-size: 1.2rem;
  }

  .bestellung-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .produkt-input {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .produkt-menge {
    width: 100%;
  }

  .produkt-menge input {
    flex: 1;
  }
}

/* Liste Items */
.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: #f9f9f9;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  transition: all 0.2s;
}

.list-item:hover {
  border-color: #667eea;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.list-item-info {
  flex: 1;
}

.list-item-title {
  font-weight: 600;
  color: #333;
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.list-item-subtitle {
  color: #666;
  font-size: 0.9rem;
}

.list-item-actions {
  display: flex;
  gap: 0.5rem;
}

/* Kategorien mit Dropdown */
.produkt-kategorie-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  transition: all 0.2s;
}

.produkt-kategorie-item:hover {
  border-color: #667eea;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.produkt-kategorie-info {
  flex: 1;
}

.produkt-kategorie-name {
  font-weight: 600;
  color: #333;
  font-size: 1rem;
}

.produkt-kategorie-details {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.25rem;
}

.produkt-kategorie-select {
  min-width: 200px;
}

.kategorie-dropdown {
  width: 100%;
  padding: 0.5rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
}

.kategorie-dropdown:hover {
  border-color: #667eea;
}

.kategorie-dropdown:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Kategorien-Gruppe im Bestellformular */
.produkt-kategorie-gruppe {
  margin-bottom: 2rem;
}

.kategorie-header-bestellen {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-weight: 600;
  font-size: 1.1rem;
}
