:root {
    --color-primary-magenta: #E20074;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

.navbar.bg-body {
  background-color: #E20074 !important;
}
.app-header .navbar-nav .nav-link {
  color: #ffffff !important;
  opacity: 1 !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Alle Icons in der Navbar vertikal zentrieren */
.app-header .navbar-nav .nav-link i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  vertical-align: middle;
}

.app-header .nav-link {
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Reflow (WCAG 1.4.10): Top bar must fit 320 CSS px (400 % zoom) without horizontal scrolling */
@media (max-width: 575.98px) {
  .app-header > .container-fluid { padding-inline: 0.25rem; }
  .app-header .navbar-nav .nav-link { padding-inline: 0.5rem; }
}

/* Reflow: toolbar and header rows may wrap on narrow viewports (.flex-nowrap still wins via !important) */
@media (max-width: 575.98px) {
  .d-flex.gap-1, .d-flex.gap-2, .d-flex.gap-3,
  .d-flex.justify-content-between, .card-header.d-flex { flex-wrap: wrap; }
  .d-flex.gap-1 > .form-control, .d-flex.gap-2 > .form-control, .d-flex.gap-3 > .form-control,
  .d-flex.gap-1 > .form-select, .d-flex.gap-2 > .form-select, .d-flex.gap-3 > .form-select { min-width: 0; max-width: 100%; }
}
.app-header .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff !important;
}

/* Hover-Effekt für Nav-Pills/Tabs im Content-Bereich */
.nav-pills .nav-link:not(.active) {
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.nav-pills .nav-link:not(.active):hover {
  background-color: rgba(0, 0, 0, 0.08) !important;
  color: #E20074 !important;
}
[data-bs-theme="dark"] .nav-pills .nav-link:not(.active):hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
}
.nav-tabs .nav-link:not(.active) {
  transition: background-color 0.2s ease, color 0.2s ease;
}
.nav-tabs .nav-link:not(.active):hover {
  background-color: rgba(0, 0, 0, 0.05) !important;
  color: #E20074 !important;
}
[data-bs-theme="dark"] .nav-tabs .nav-link:not(.active):hover {
  background-color: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}

/* Btn-group tabs (z.B. Filter-Buttons) */
.btn-group .btn-outline-secondary:not(.active):hover,
.btn-group .btn-outline-primary:not(.active):hover {
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Theme Toggle Icon Alignment */
#bd-theme {
  display: flex;
  align-items: center;
  justify-content: center;
}
.theme-icon-active {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.theme-icon-active i {
  font-size: 1rem;
  line-height: 1;
}

/* Badge Positionierung für Notifications */
.nav-item {
  position: relative;
}

.navbar-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  font-size: 0.6rem;
  padding: 2px 4px;
}

/* Customer Selection in Sidebar */
#customerSelect {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  transition: all 0.3s ease;
}

#customerSelect:focus {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
  box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.1);
}

#customerSelect option {
  background-color: #343a40;
  color: #ffffff;
}

#customerSelect:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

/* Accessibility: keyboard-only focus ring and skip link (invisible for mouse users) */
a:focus-visible,
summary:focus-visible,
[role="button"]:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible {
  outline: 2px solid #E20074;
  outline-offset: 2px;
}

main[tabindex="-1"]:focus {
  outline: none;
}

.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 100000;
  padding: 0.5rem 1rem;
  background: #E20074;
  color: #ffffff;
  border-radius: 0.25rem;
  transform: translateY(-300%);
}

.skip-link:focus {
  transform: none;
  color: #ffffff;
}

/* Accessibility: Bootstrap's default colours land just below 4.5:1 on the light grey page background (#f8f9fa).
   The dark-theme rules below are more specific and keep precedence inside dark areas (header, sidebar, dark mode). */
:root:not([data-bs-theme="dark"]) {
  --bs-link-color: #0a58ca;
  --bs-link-color-rgb: 10, 88, 202;
  --bs-link-hover-color: #084298;
  --bs-link-hover-color-rgb: 8, 66, 152;
  /* many page styles use these two variables as text colours */
  --bs-secondary: #5c636a;
  --bs-code-color: #b02a72;
}
.text-secondary { color: #5c636a !important; }
.text-primary { color: #0a58ca !important; }
.text-success { color: #146c43 !important; }
.text-danger { color: #b02a37 !important; }
.text-warning { color: #856404 !important; }
.text-info { color: #087990 !important; }
.btn-outline-secondary { --bs-btn-color: #5c636a; }
.btn-outline-primary { --bs-btn-color: #0a58ca; }
.btn-outline-success { --bs-btn-color: #146c43; }
.btn-outline-info { --bs-btn-color: #087990; }
.btn-outline-warning { --bs-btn-color: #856404; }
.btn-outline-danger { --bs-btn-color: #b02a37; }

/* Accessibility: Bootstrap's dark theme keeps the light-theme text colours, which fall below 4.5:1 on dark surfaces */
[data-bs-theme="dark"] { --bs-secondary: #adb5bd; }
[data-bs-theme="dark"] .text-secondary,
.table-dark .text-secondary, .bg-dark .text-secondary, .text-bg-dark .text-secondary { color: #adb5bd !important; }
[data-bs-theme="dark"] .text-primary,
.table-dark .text-primary, .bg-dark .text-primary, .text-bg-dark .text-primary { color: #6ea8fe !important; }
[data-bs-theme="dark"] .text-success,
.table-dark .text-success, .bg-dark .text-success, .text-bg-dark .text-success { color: #75b798 !important; }
[data-bs-theme="dark"] .text-danger,
.table-dark .text-danger, .bg-dark .text-danger, .text-bg-dark .text-danger { color: #ea868f !important; }
[data-bs-theme="dark"] .text-warning,
.table-dark .text-warning, .bg-dark .text-warning, .text-bg-dark .text-warning { color: #ffc107 !important; }
[data-bs-theme="dark"] .text-info,
.table-dark .text-info, .bg-dark .text-info, .text-bg-dark .text-info { color: #0dcaf0 !important; }
[data-bs-theme="dark"] .btn-outline-secondary { --bs-btn-color: #adb5bd; }
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: #6ea8fe; }
[data-bs-theme="dark"] .btn-outline-success { --bs-btn-color: #75b798; }
[data-bs-theme="dark"] .btn-outline-info { --bs-btn-color: #0dcaf0; }
[data-bs-theme="dark"] .btn-outline-warning { --bs-btn-color: #ffc107; }
[data-bs-theme="dark"] .btn-outline-danger { --bs-btn-color: #ea868f; }

/* Accessibility: white text on Bootstrap's light cyan/yellow badges is far below 4.5:1 */
.badge.bg-info, .badge.bg-warning, .bg-info.text-white, .bg-info .text-white { color: #000 !important; }

/* Accessibility: text colours for tinted badges (brand colour at ~10% as background) – >= 4.5:1 in both themes */
:root {
  --a11y-primary: #0a58ca;
  --a11y-success: #146c43;
  --a11y-danger: #b02a37;
  --a11y-warning: #856404;
  --a11y-info: #066a7e;
  --a11y-purple: #59359a;
  --a11y-magenta: #b0005a;
  --a11y-pink: #a62a6a;
  --a11y-orange: #a84b00;
}
[data-bs-theme="dark"] {
  --a11y-primary: #8bb9fe;
  --a11y-success: #75b798;
  --a11y-danger: #ea868f;
  --a11y-warning: #ffda6a;
  --a11y-info: #6edff6;
  --a11y-purple: #c3adf0;
  --a11y-magenta: #ff7ab8;
  --a11y-pink: #f08cc0;
  --a11y-orange: #ffb87a;
}
