body {
  background-color: #f8f9fa;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
}

.container-lg {
  max-width: 1400px;
  margin: 0 auto;
  padding: 30px 10px;
}

.card {
  border-radius: 14px;
  border: none;
  box-shadow: 0 0.5rem 1.5rem rgba(0,0,0,0.08);
  margin-bottom: 24px;
  overflow: hidden;
}

.card-header {
  border-radius: 14px 14px 0 0 !important;
  font-weight: 600;
  font-size: 1.2rem;
  padding: 1.2rem 1.5rem;
}

.bg-primary, .btn-primary, .card-header.bg-primary {
  background-color: #252D50 !important;
  color: #fff !important;
}

.bg-info, .badge.bg-info {
  background-color: #0dcaf0 !important;
  color: #fff !important;
}

.bg-success, .badge.bg-success {
  background-color: #198754 !important;
  color: #fff !important;
}

.bg-warning, .badge.bg-warning {
  background-color: #ffc107 !important;
  color: #212529 !important;
}

.bg-danger, .badge.bg-danger {
  background-color: #dc3545 !important;
  color: #fff !important;
}

.bg-secondary, .badge.bg-secondary {
  background-color: #6c757d !important;
  color: #fff !important;
}

.bg-light, .badge.bg-light {
  background-color: #f8f9fa !important;
  color: #212529 !important;
  border: 1px solid #dee2e6;
}

.btn, .btn-lg, .btn-outline-primary, .btn-outline-light {
  border-radius: 50rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.875rem;
}

.btn-light {
  background-color: #fff !important;
  color: #252D50 !important;
  border: 1px solid #dee2e6;
}

.btn-light:hover {
  background-color: #e9f7ff !important;
  color: #252D50 !important;
}

.btn-outline-light {
  border-color: #fff;
  color: #fff;
}

.btn-outline-light:hover {
  background-color: #fff;
  color: #252D50;
}

.btn-outline-primary {
  color: #252D50;
  border-color: #252D50;
}

.btn-outline-primary:hover, .btn-outline-primary:focus {
  background-color: #252D50;
  color: #fff;
}

.dropdown-menu {
  position: absolute !important;
  z-index: 2000 !important;
  min-width: 220px;
  border-radius: 10px;
  box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15);
  border: none;
  left: auto;
  right: 0;
}

.dropdown-item {
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
}

.dropdown-item:active, .dropdown-item:focus {
  background-color: #252D50 !important;
  color: #fff !important;
}

.dropdown-item:hover {
  background-color: #e9f7ff;
  color: #252D50;
}

.table th, .table td {
  vertical-align: middle !important;
}

.table-hover tbody tr {
  transition: background-color 0.2s;
}
.table-hover tbody tr:hover {
  background-color: #e9f7ff;
}

.table .badge {
  display: block;
  text-align: center;
  padding: 0.5rem;
  border-radius: 5px;
  font-size: 0.9rem;
  font-weight: 500;
}

/* Dropdown in Tabellen sichtbar halten */
.table-responsive {
  overflow: visible !important;
}
.card-body {
  overflow: visible !important;
}
@media (min-width: 768px) {
  .table-responsive {
    overflow: visible !important;
  }
}

/* Hover für Kategorie-Zeilen */
.kategorie-auswahl,
.d-flex.justify-content-between.align-items-center.p-3.rounded.shadow-sm.bg-white.mb-2 {
  transition: background 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.kategorie-auswahl:hover,
.d-flex.justify-content-between.align-items-center.p-3.rounded.shadow-sm.bg-white.mb-2:hover {
  background: #e9f7ff !important;
  box-shadow: 0 4px 16px rgba(13,110,253,0.10);
}

/* Toggle-Buttons (Prüfkriterien) */
.btn-check:checked + .btn-outline-success { background: #198754; color: #fff; }
.btn-check:checked + .btn-outline-warning { background: #ffc107; color: #000; }
.btn-check:checked + .btn-outline-danger  { background: #dc3545; color: #fff; }

/* Kategorie-Edit Kriterien */
.kriterium-block { background: #f8fafd; transition: box-shadow .15s; }
.kriterium-block:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08) !important; }

/* Anhang-Vorschau */
.anhang-item img { transition: transform .15s; }
.anhang-item img:hover { transform: scale(1.04); }

/* Drag & Drop Upload Zone */
#drop-zone:hover { background: #f0f7ff; }

/* Prüflingsprotokoll Druck */
@media print {
  .no-print { display: none !important; }
  .d-print-block { display: block !important; }
  body { background: #fff; }
  .card, .card-body {
    border: none !important;
    box-shadow: none !important;
    background: #fff !important;
  }
  .card-header { display: none !important; }
}
.d-print-block { display: none; }

/* Etikett für QR-Code-Druck */
.etikett {
  width: 398px;
  height: 160px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 0.2rem 0.5rem rgba(0,0,0,0.07);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.etikett h2 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
  color: #252D50;
}
.etikett img {
  max-width: 80px;
  max-height: 80px;
  margin: 0.5rem 0;
}
.etikett .nummer {
  font-size: 1.2rem;
  font-weight: bold;
  color: #252D50;
  margin-top: 0.5rem;
  letter-spacing: 2px;
}
.etikett-ueberschrift {
  font-size: 1.1em;
  font-weight: bold;
  text-align: center;
  margin-bottom: 8px;
}
.nummer {
  font-size: 1.2em;
  text-align: center;
  margin-top: 8px;
  font-weight: bold;
}
@media print {
  body { margin: 0; }
  .etikett {
    width: 398px;
    height: 160px;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
}

/* ═══════════════════════════════════════
   RESPONSIVE – nur Handy (< 768px)
   Desktop bleibt vollständig unverändert
═══════════════════════════════════════ */
@media (max-width: 767px) {

  /* Container weniger Padding */
  .container-lg {
    padding: 12px 8px;
  }
  .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  /* Navbar: Buttons untereinander wenn aufgeklappt */
  .navbar .d-flex {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }

  /* Karten kompakter */
  .card-header {
    font-size: 1rem;
    padding: 0.85rem 1rem;
  }
  .card-body {
    padding: 12px;
  }

  /* Tabellen auf Handy: scrollbar statt abgeschnitten */
  .table-responsive {
    overflow-x: auto !important;
  }

  /* Prüflinge-Tabelle auf Handy ausblenden → Cards zeigen */
  .pruefling-table-desktop { display: none !important; }
  .pruefling-cards-mobile  { display: block !important; }

  /* iOS: verhindert Auto-Zoom bei Formularfeldern */
  .form-control, .form-select, .input-group-text {
    font-size: 16px;
  }

  /* Buttons in Formularen volle Breite */
  .btn-mobile-full { width: 100%; }

  /* Dropdown auf Handy: kein overflow-Problem */
  .table-responsive .dropdown-menu {
    position: static !important;
  }
}

/* Prüflinge Card-Ansicht: standardmäßig versteckt, nur Handy sichtbar */
.pruefling-cards-mobile { display: none; }