:root {
  --primary: #008afc;
  --primary-dark: #006fcc;
  --primary-light: #4cb5ff;
  --bg-soft: #f4f7fb;
  --bg-card: #ffffff;
  --text-color: #1d2939;
  --muted-color: #64748b;
  --border-color: rgba(0, 0, 0, 0.06);
  --shadow-soft: 0 18px 35px -25px rgba(0, 138, 252, 0.6);
}

body {
  font-family: "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: radial-gradient(circle at top left, rgba(0, 138, 252, 0.1), transparent 45%),
    radial-gradient(circle at bottom right, rgba(0, 138, 252, 0.12), transparent 50%),
    var(--bg-soft);
  color: var(--text-color);
  padding-bottom: 48px;
}

main.container {
  max-width: none;
  width: 100%;
  padding-left: clamp(1rem, 4vw, 3rem);
  padding-right: clamp(1rem, 4vw, 3rem);
}

.navbar {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 0 0 22px 22px;
  box-shadow: 0 20px 35px -30px rgba(0, 0, 0, 0.6);
}

.navbar .brand-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.navbar .brand-tagline {
  font-weight: 400;
  letter-spacing: 0.04em;
}

.navbar .navbar-brand {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.navbar .nav-link,
.navbar .navbar-brand {
  color: rgba(255, 255, 255, 0.95) !important;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.12);
  border-radius: 12px;
}

.navbar .navbar-collapse {
  gap: 1.5rem;
}

.navbar form {
  background-color: rgba(0, 0, 0, 0.15);
  padding: 0.5rem 0.75rem;
  border-radius: 14px;
}

.navbar form .form-control {
  min-width: 220px;
  border-radius: 12px;
}

.navbar form .btn {
  padding-inline: 1.25rem;
}

.navbar .btn-outline-light {
  border-color: rgba(255, 255, 255, 0.65);
  color: #ffffff;
  transition: all 0.2s ease-in-out;
}

.navbar .btn-outline-light:hover,
.navbar .btn-outline-light:focus {
  background-color: #ffffff;
  color: var(--primary);
}

.page-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(0, 138, 252, 0.2), rgba(76, 181, 255, 0.12));
  border: 1px solid rgba(0, 138, 252, 0.15);
  box-shadow: 0 30px 60px -45px rgba(0, 138, 252, 0.65);
}

.page-hero-icon {
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(70px, 8vw, 96px);
  height: clamp(70px, 8vw, 96px);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(0, 138, 252, 0.16);
  color: var(--primary-dark);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.hero-title {
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.hero-text {
  max-width: 620px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.5rem;
  font-size: 0.95rem;
  color: var(--muted-color);
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.65);
  padding: 0.35rem 0.75rem;
  border-radius: 12px;
}

.page-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: stretch;
  justify-content: space-between;
  padding: clamp(1rem, 3vw, 1.5rem);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 22px 44px -40px rgba(15, 23, 42, 0.55);
}

.toolbar-block {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.toolbar-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-color);
}

.status-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-chip {
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-color);
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.filter-chip:hover,
.filter-chip:focus {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -20px rgba(0, 0, 0, 0.25);
}

.filter-chip.active {
  background: linear-gradient(135deg, rgba(0, 138, 252, 0.2), rgba(76, 181, 255, 0.25));
  border-color: rgba(0, 138, 252, 0.35);
  color: var(--primary-dark);
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.toolbar-actions .btn {
  border-radius: 999px;
  font-weight: 600;
  padding-inline: 1.1rem;
}

.filter-empty {
  font-weight: 500;
  background: rgba(0, 138, 252, 0.1);
  border: 1px solid rgba(0, 138, 252, 0.25);
  color: var(--primary-dark);
}

.table-responsive {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-color);
}

.table tbody tr.is-hidden {
  display: none !important;
}

.dashboard-card {
  background: var(--bg-card);
  border-radius: 22px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-soft);
}

.status-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 0.5rem 0.75rem;
  border-radius: 16px;
  color: #fff;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.65rem;
}

.status-pill .pill-label {
  opacity: 0.9;
}

.status-pill .pill-value {
  font-size: 1.15rem;
}

.pill-crit {
  background: linear-gradient(135deg, #ff6b6b, #f94144);
}

.pill-warn {
  background: linear-gradient(135deg, #ffd166, #fca311);
  color: #2f2000;
}

.pill-ok {
  background: linear-gradient(135deg, #06c270, #27d17e);
}

.soft-note {
  font-size: 0.9rem;
  color: var(--muted-color);
}

.action-hint {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  background: rgba(0, 138, 252, 0.08);
  border: 1px solid rgba(0, 138, 252, 0.18);
}

.action-hint.relaxed {
  background: rgba(6, 194, 112, 0.08);
  border-color: rgba(6, 194, 112, 0.18);
}

.action-hint-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.audit-card {
  position: relative;
  overflow: hidden;
}

.audit-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(0, 138, 252, 0.08), transparent 60%);
  pointer-events: none;
}

.audit-card.audit-due {
  border-color: rgba(249, 65, 68, 0.35);
  box-shadow: 0 20px 40px -32px rgba(249, 65, 68, 0.8);
}

.audit-counter {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-weight: 700;
  font-size: 1.35rem;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.15);
}

.audit-progress {
  background-color: rgba(0, 0, 0, 0.08);
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
}

.audit-progress .progress-bar {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
}

.table {
  margin-bottom: 0;
}

.table thead {
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.table thead th {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-color);
  background: transparent;
  border-bottom: none;
}

.table tbody tr.table-warning {
  background-color: rgba(255, 209, 102, 0.12);
}

.table tbody tr.table-danger {
  background-color: rgba(255, 107, 107, 0.12);
}

.table tbody tr {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.table-hover > tbody > tr:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -22px rgba(0, 0, 0, 0.45);
  background-color: rgba(0, 138, 252, 0.05);
}

.table td,
.table th {
  vertical-align: middle;
  border-top: none;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.05);
}

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

.status-hint {
  margin-top: 0.35rem;
  font-size: 0.75rem;
}

.badge {
  font-size: 0.85rem;
  padding: 0.5em 0.75em;
  border-radius: 999px;
}

.badge.bg-success {
  background: linear-gradient(135deg, #06c270, #27d17e);
}

.badge.bg-warning {
  background: linear-gradient(135deg, #ffd166, #fca311);
}

.badge.bg-danger {
  background: linear-gradient(135deg, #ff6b6b, #f94144);
}

.alert {
  margin-top: 10px;
  border-radius: 16px;
  border: none;
  box-shadow: 0 14px 26px -24px rgba(0, 0, 0, 0.65);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  box-shadow: 0 12px 24px -20px rgba(0, 138, 252, 0.85);
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, var(--primary-dark), #005aa7);
}

.btn-outline-primary {
  border-color: rgba(0, 138, 252, 0.5);
  color: var(--primary);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background-color: rgba(0, 138, 252, 0.12);
  color: var(--primary-dark);
}

.btn-outline-secondary {
  border-color: rgba(100, 116, 139, 0.4);
  color: var(--muted-color);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
  background-color: rgba(100, 116, 139, 0.12);
  color: var(--text-color);
}

.btn-outline-danger {
  border-color: rgba(220, 38, 38, 0.5);
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
  background-color: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}

.form-control {
  border-radius: 14px;
  border-color: rgba(0, 0, 0, 0.08);
  padding: 0.55rem 1rem;
  box-shadow: none;
}

.form-control:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 0.2rem rgba(0, 138, 252, 0.12);
}

#note-field.form-control {
  min-height: 110px;
}

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

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

.storage-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.storage-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: rgba(0, 138, 252, 0.08);
  color: var(--primary-dark);
  border: 1px solid rgba(0, 138, 252, 0.18);
}

.inventory-due {
  position: relative;
}

.inventory-due::after {
  content: "Inventur fällig";
  position: absolute;
  top: 8px;
  right: 16px;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #b91c1c;
  font-weight: 700;
}

.inventory-info-card {
  background: var(--bg-card);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-soft);
  padding: 24px;
}

.inventory-info-card.due {
  border-left: 4px solid #f94144;
}

.actual-card,
.advanced-card {
  background: var(--bg-card);
  border-radius: 18px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-soft);
}

.advanced-card {
  background: rgba(0, 138, 252, 0.04);
}

#toggle-advanced {
  color: var(--primary);
  font-weight: 600;
}

#toggle-advanced:hover {
  text-decoration: none;
  color: var(--primary-dark);
}

.coverage-meter {
  --min-target: 40%;
  --max-target: 100%;
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.coverage-meter-optimal {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--min-target);
  right: calc(100% - var(--max-target));
  background: rgba(6, 194, 112, 0.18);
}

.coverage-meter-bar {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: inherit;
  transition: width 0.3s ease;
}

.coverage-meter-marker {
  position: absolute;
  top: -2px;
  width: 3px;
  height: 12px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.5);
}

.coverage-meter-marker.min {
  background: rgba(249, 65, 68, 0.55);
}

.coverage-meter-marker.max {
  background: rgba(0, 138, 252, 0.45);
}

@media (max-width: 991.98px) {
  .navbar form {
    width: 100%;
  }

  .navbar form .form-control {
    min-width: 100%;
  }

  .page-hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .page-hero-icon {
    margin: 0 auto;
  }

  .hero-text {
    margin: 0 auto;
  }

  .hero-meta {
    justify-content: center;
  }

  .hero-meta span {
    background: rgba(255, 255, 255, 0.85);
  }

  .page-toolbar {
    flex-direction: column;
  }

  .toolbar-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 767.98px) {
  .navbar {
    border-radius: 0 0 18px 18px;
  }

  .table-responsive {
    padding: 18px;
  }

  h2 {
    font-size: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .filter-chip,
  .table tbody tr {
    transition: none !important;
  }
}