body {
  background-color: #fffbf9;
}

td {
  /*display: table-cell;*/
  vertical-align: middle;
}

.container h1 {
  color: #730000;
  padding-top: 1.8em;
  font-size: 1.8em;
  text-align: right;
}

.container h2 {
  color: #730000;
  font-size: 1.5em;
}

.container h3 {
  color: #730000;
  font-size: 1.2em;
}

a {
  text-decoration: none;
}

th {
  border-right: solid 1px #c5c5c5;
}

.no-wrap {
  white-space: nowrap;
}

.txt_red {
  color: #ff5555;
}

.txt_bold {
  font-weight: bold;
}

.txt_info {
  color: #fff461;
  padding-top: 7px;
  font-size: 0.9em;
  text-align: center;
}

hr {
  border-top: -1px solid #000;
  margin-top: 2em;
  margin-bottom: 3em;
}

.icon {
  font-size: 1.7em;
  margin-left: 0.1em;
  cursor: pointer;
  box-shadow: #0000001a 1px 1px 2px 1px;
  padding: 0px 8px;
  border-radius: 10px;
  background-color: #f2f2f2;
}

.fixed-bottom {
  height: 60px;
  background-color: #6f1d27 !important;
  color: #f6be54 !important;
  text-align: center !important;
  bottom: 0px;
}

.fixed_buttons {
  position: fixed;
}

footer.footer-fixed {
  color: #f6be54 !important;
  z-index: 9;
}

.btn_red {
  background-color: #d42121;
  color: #fff;
  border: solid 1px #fff;
}

.btn_green {
  background-color: #378147;
  color: #fff;
  border: solid 1px #fff;
}

.btn_red:hover,
.btn_green:hover {
  background-color: #fff;
  color: #000;
}

.alert-info {
  color: #f4be54;
  background-color: #6f1d27;
  border-color: #000000;
}

.btn-outline-secondary {
  color: #efb54a;
  border-color: #efb54a;
}

.btn-outline-secondary:hover {
  color: #6f1d27;
  background-color: #f0b54b;
  border-color: #ffffff;
}

#current-time {
  font-size: 1.2em;
  color: #6f1d27;
}

.btn-primary {
  color: #f0b54b;
  background-color: #6f1d27;
  border-color: #f0b54b;
}

.btn-primary:hover {
  color: #6f1d27;
  background-color: #f0b54b;
  border-color: #6f1d27;
}

.breadcrumb {
  font-size: 0.8em;
  float: right;
  margin-right: 1em;
}

.breadcrumb a {
  color: #000;
  text-decoration: none;
}

.breadcrumb-item+.breadcrumb-item {
  padding-left: 0.1rem;
}

.breadcrumb-item+.breadcrumb-item::before {
  padding-right: 0.1rem;
}

.logotextklein {
  color: #fff;
  padding-right: 1em;
  font-size: 0.8em;
}

.abstand-1 {
  padding: 0px;
  margin: 0px;
  height: 1em;
}

.abstand-2 {
  padding: 0px;
  margin: 0px;
  height: 3em;
}

.abstand-3 {
  padding: 0px;
  margin: 0px;
  height: 2em;
}

.abstand-4 {
  padding: 0px;
  margin: 0px;
  height: 4em;
}

.modal-backdrop {
  z-index: 1;
}

.icon-badge {
  position: absolute;
  margin-top: -5px;
  margin-left: 3px;
  display: inline-block;
  width: 22px;
  height: 22px;
  background-color: red;
  border-radius: 50%;
  color: white;
  text-align: center;
  line-height: 22px;
  font-size: 14px;
}

.bg-primary {
  background-color: rgb(37 0 0) !important;
}

/* ---------------- Anpassungen -------------------------- */
.navbar-dark .navbar-nav .nav-link {
  color: rgb(255 255 255);
  font-size: 1.1em;
}

.navbar-text {
  padding-right: 2em;
  color: #f6be54 !important;
}

header.navbar-fixed {
  transition: box-shadow 200ms ease, background-color 200ms ease;
}

header.navbar-fixed .navbar {
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
  transition: padding 200ms ease;
}

header.navbar-fixed .navbar-brand img {
  height: 90px;
  transition: height 200ms ease;
}

header.navbar-fixed.is-scrolled {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

header.navbar-fixed.is-scrolled .navbar {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

header.navbar-fixed.is-scrolled .navbar-brand img {
  height: 70px;
}

section {
  background-color: #ededed;
  padding: 1em;
}

button {
  /*min-width: 150px;*/
}

.container_message {
  position: fixed;
  bottom: 60px;
  left: 0;
  width: 100%;
  z-index: 1000;
}

.alert {
  margin: 0em 1em 1em 1em;
}

.alert:not(:first-child) {
  margin-top: 5px;
}

.text-secondary {
  color: rgb(145 145 145 / 68%) !important;
}

.text-info {
  color: #e2e2e2 !important;
}

table.dataTable>thead .sorting:before,
table.dataTable>thead .sorting_asc:before,
table.dataTable>thead .sorting_desc:before,
table.dataTable>thead .sorting_asc_disabled:before,
table.dataTable>thead .sorting_desc_disabled:before {
  right: 1.5em;
}

table.dataTable>thead .sorting:after,
table.dataTable>thead .sorting_asc:after,
table.dataTable>thead .sorting_desc:after,
table.dataTable>thead .sorting_asc_disabled:after,
table.dataTable>thead .sorting_desc_disabled:after {
  right: 1em;
  content: "↓";
}

table.dataTable>thead>tr>th:not(.sorting_disabled),
table.dataTable>thead>tr>td:not(.sorting_disabled) {
  padding-right: 40px;
}

div.dataTables_wrapper div.dataTables_length select {
  width: 75px;
  display: inline-block;
}

/* ---------------- Anpassungen -------------------------- */

/* ---------------- Dark Theme Overrides ----------------- */
body.theme-dark {
  background-color: #0f1012 !important;
  color: #e8e8e8 !important;
}

body.theme-dark .card,
body.theme-dark .card .card-header,
body.theme-dark .modal-content,
body.theme-dark .dropdown-menu {
  background-color: #1a1b1f !important;
  color: #e8e8e8 !important;
  border-color: #2a2c32 !important;
}

body.theme-dark .table {
  color: #e0e0e0 !important;
}

body.theme-dark .table thead th {
  color: #e0e0e0 !important;
}

/* Tabellenzellen – global und Odd-Zeilen lesbar machen */
body.theme-dark .table tbody tr>td,
body.theme-dark .table tbody tr>th {
  color: #e6e6e6 !important;
}

body.theme-dark .table-striped>tbody>tr:nth-of-type(odd)>td,
body.theme-dark .table-striped>tbody>tr:nth-of-type(odd)>th {
  color: #f0f0f0 !important;
}

body.theme-dark .table-striped>tbody>tr:nth-of-type(odd) a {
  color: #f0b54b !important;
}

body.theme-dark .table-striped>tbody>tr:nth-of-type(odd) a:hover {
  color: #f6be54 !important;
  color: #ffffff !important;
}

body.theme-dark .table-hover tbody tr:hover {
  background-color: #23252b !important;
  color: #ffffff !important;
}

body.theme-dark .container h1,
body.theme-dark .container h2,
body.theme-dark .container h3 {
  color: #f0b54b;
}

body.theme-dark a {
  color: #f0b54b !important;
}

body.theme-dark a:hover {
  color: #f6be54 !important;
  color: #ffffff !important;
}

body.theme-dark .breadcrumb a {
  color: #f0b54b !important;
}

body.theme-dark .breadcrumb a:hover {
  color: #f6be54 !important;
}

body.theme-dark section {
  background-color: #141518 !important;
}

body.theme-dark .form-control,
body.theme-dark .form-select,
body.theme-dark .form-control:focus,
body.theme-dark .form-select:focus,
body.theme-dark .dataTables_wrapper .dataTables_filter input,
body.theme-dark .dataTables_wrapper .dataTables_length select {
  background-color: #141518 !important;
  color: #e8e8e8 !important;
  border-color: #2a2c32 !important;
}

body.theme-dark .form-control::placeholder {
  color: #9aa0a6 !important;
}

body.theme-dark .dropdown-item {
  color: #e8e8e8 !important;
}

body.theme-dark .dropdown-item:hover {
  background-color: #23252b !important;
}

body.theme-dark .modal-header,
body.theme-dark .modal-footer {
  background-color: #1a1b1f !important;
  border-color: #2a2c32 !important;
}

body.theme-dark .modal-backdrop.show {
  opacity: 0.75 !important;
}

body.theme-dark .table-striped>tbody>tr:nth-of-type(odd) {
  --bs-table-accent-bg: rgba(0, 0, 0, 0.5) !important;
  color: #e8e8e8 !important;
}

body.theme-dark .alert {
  border-color: #2a2c32 !important;
}

body.theme-dark .alert-light {
  color: #636464 !important;
  background-color: #1e1e1e !important;
  border-color: #fdfdfe !important;
}

body.theme-dark .alert-success {
  background-color: #306940 !important;
  color: #b7f3c5 !important;
  border-color: #245a36 !important;
}

body.theme-dark .alert-danger {
  background-color: #3a1719 !important;
  color: #ffb4b4 !important;
  border-color: #7a1f26 !important;
}

body.theme-dark .alert-warning {
  background-color: #3a2f17 !important;
  color: #f0b54b !important;
  border-color: #f0b54b !important;
}

body.theme-dark .alert-info {
  background-color: #1a2d3a !important;
  color: #f0b54b !important;
  border-color: #f0b54b !important;
}

/* Button Warning im Darkmode */
body.theme-dark .btn-warning {
  background-color: #ffc1071c !important;
  color: #f0b54b !important;
  /* Textfarbe anpassen falls nötig */
  border-color: #ffc1071c !important;
}

/* Expliziter Override für gestreifte Tabellen im Darkmode */
body.theme-dark .table-striped>tbody>tr:nth-of-type(odd)>* {
  --bs-table-accent-bg: rgba(0, 0, 0, 0.5) !important;
  box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.5) !important;
  color: #e8e8e8 !important;
}

body.theme-dark .btn-primary {
  background-color: #6f1d27 !important;
  border-color: #f0b54b !important;
  color: #f0b54b !important;
}

body.theme-dark .btn-primary:hover {
  background-color: #f0b54b !important;
  color: #1a1b1f !important;
  border-color: #6f1d27 !important;
}

/* Badges im Dark Mode harmonisieren */
body.theme-dark .badge {
  background-color: #2a2c32 !important;
  color: #e8e8e8 !important;
}

body.theme-dark .badge.bg-danger {
  background-color: #7a1f26 !important;
}

body.theme-dark .badge.bg-success {
  background-color: #245a36 !important;
}

body.theme-dark .badge.bg-secondary {
  background-color: #3a3d47 !important;
}

/* Input-Group Text */
body.theme-dark .input-group-text {
  background-color: #1a1b1f !important;
  color: #e8e8e8 !important;
  border-color: #2a2c32 !important;
}

/* Selectize Dark Anpassung */
body.theme-dark .selectize-control.single .selectize-input {
  background-color: #141518 !important;
  color: #e8e8e8 !important;
  border-color: #2a2c32 !important;
}

body.theme-dark .selectize-dropdown {
  background-color: #1a1b1f !important;
  color: #e8e8e8 !important;
  border-color: #2a2c32 !important;
}

body.theme-dark .btn-outline-secondary {
  color: #f0b54b;
  border-color: #f0b54b;
}

body.theme-dark .btn-outline-secondary:hover {
  background-color: #f0b54b;
  color: #1a1b1f;
}

/* Kopf- und Fußbereiche bleiben branding-konform (#6f1d27 / #f6be54) */
body.theme-dark header.navbar-fixed {
  background-color: #6f1d27 !important;
}

body.theme-dark footer.footer-fixed {
  background-color: #6f1d27 !important;
  color: #f6be54 !important;
}

body.theme-dark .navbar-dark .navbar-nav .nav-link {
  color: #f6be54 !important;
}

body.theme-dark .navbar-dark .navbar-nav .nav-link:hover {
  color: #f0b54b !important;
}

body.theme-dark .navbar-text {
  color: #f6be54 !important;
}

/* Komplementärfarben für bessere Harmonie im Darkmode */
body.theme-dark .text-primary {
  color: #f0b54b !important;
}

body.theme-dark .text-danger {
  color: #ff6b6b !important;
}

body.theme-dark .text-success {
  color: #51cf66 !important;
}

body.theme-dark .text-warning {
  color: #f0b54b !important;
}

body.theme-dark .text-info {
  color: #e2e2e2 !important;
}

/* Dropdown-Menüs im Darkmode */
body.theme-dark .dropdown-menu {
  background-color: #1a1b1f !important;
  border-color: #2a2c32 !important;
}

body.theme-dark .dropdown-item:focus,
body.theme-dark .dropdown-item:active {
  background-color: #23252b !important;
  color: #f0b54b !important;
}

/* Pagination im Dark Mode */
body.theme-dark .pagination .page-link {
  background-color: #1a1b1f !important;
  border-color: #2a2c32 !important;
  color: #e8e8e8 !important;
}

body.theme-dark .pagination .page-item.disabled .page-link {
  background-color: #141518 !important;
  border-color: #2a2c32 !important;
  color: #6c757d !important;
}

body.theme-dark .pagination .page-item.active .page-link {
  background-color: #6f1d27 !important;
  border-color: #6f1d27 !important;
  color: #f0b54b !important;
}

body.theme-dark .pagination .page-link:hover {
  background-color: #23252b !important;
  border-color: #2a2c32 !important;
  color: #f6be54 !important;
}

/* DataTables Processing Indicator im Dark Mode */
body.theme-dark .dataTables_processing {
  background-color: #1a1b1f !important;
  color: #e8e8e8 !important;
  box-shadow: 0 0 10px #000 !important;
}

/* Nav Tabs im Dark Mode */
body.theme-dark .nav-tabs .nav-link {
  color: #e8e8e8 !important;
  border-color: transparent !important;
}

body.theme-dark .nav-tabs .nav-link:hover {
  border-color: #2a2c32 #2a2c32 #1a1b1f !important;
  color: #f6be54 !important;
}

body.theme-dark .nav-tabs .nav-link.active {
  color: #f0b54b !important;
  background-color: #1a1b1f !important;
  border-color: #2a2c32 #2a2c32 #1a1b1f !important;
}

body.theme-dark .nav-tabs {
  border-bottom-color: #2a2c32 !important;
}

/* List Group im Dark Mode */
body.theme-dark .list-group-item {
  background-color: #1a1b1f !important;
  color: #e8e8e8 !important;
  border-color: #2a2c32 !important;
}

body.theme-dark .list-group-item-action:hover,
body.theme-dark .list-group-item-action:focus {
  background-color: #23252b !important;
  color: #f0b54b !important;
}

/* Utility Classes Overrides im Dark Mode */
body.theme-dark .bg-light {
  background-color: #23252b !important;
  color: #e8e8e8 !important;
}

body.theme-dark .bg-white {
  background-color: #1a1b1f !important;
  color: #e8e8e8 !important;
}

body.theme-dark .text-muted {
  color: #adb5bd !important;
}

body.theme-dark .form-text {
  color: #adb5bd !important;
}

/* Zusätzliche Tabellenrahmen im Dark Mode */
body.theme-dark .table> :not(:first-child) {
  border-top: 2px solid #2a2c32 !important;
  /* Eine dunklere Farbe für die Trennlinie */
}

/* ---------------- Kompakt-Modus ----------------- */
body.compact-mode {
  font-size: 0.875rem;
}

body.compact-mode .container h1 {
  font-size: 1.4rem;
  padding-top: 1.2em;
}

body.compact-mode .container h2 {
  font-size: 1.2rem;
}

body.compact-mode .container h3 {
  font-size: 1rem;
}

body.compact-mode .container h4 {
  font-size: 0.95rem;
}

body.compact-mode .container h5 {
  font-size: 0.9rem;
}

body.compact-mode .card {
  margin-bottom: 0.4rem;
}

body.compact-mode .card-header {
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
}

body.compact-mode .card-header i,
body.compact-mode .card-header .bi {
  font-size: 0.9em;
}

body.compact-mode .card-body {
  padding: 0.6rem;
}

body.compact-mode .card-footer {
  padding: 0.4rem 0.6rem;
  font-size: 0.75rem;
}

body.compact-mode .form-label {
  font-size: 0.75rem;
  margin-bottom: 0.15rem;
  font-weight: 500;
  line-height: 1.2;
  display: block;
}

/* Labels in einer Reihe auf gleicher Höhe */
body.compact-mode .row .form-label {
  min-height: 1.2rem;
  display: flex;
  align-items: flex-end;
  margin-bottom: 0.15rem;
}

body.compact-mode .row .form-label i,
body.compact-mode .row .form-label .bi {
  font-size: 0.85em;
  margin-right: 0.25rem;
  align-self: center;
}

body.compact-mode .form-control,
body.compact-mode .form-select {
  font-size: 0.85rem;
  padding: 0.3rem 0.45rem;
  height: calc(1.5em + 0.6rem + 2px);
  margin-bottom: 0.15rem;
}

body.compact-mode .form-control-sm,
body.compact-mode .form-select-sm {
  font-size: 0.8rem;
  padding: 0.25rem 0.4rem;
  height: calc(1.5em + 0.5rem + 2px);
}

body.compact-mode .btn {
  font-size: 0.85rem;
  padding: 0.35rem 0.65rem;
}

body.compact-mode .btn i,
body.compact-mode .btn .bi {
  font-size: 0.9em;
}

body.compact-mode .btn-sm {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
}

/* Kompaktere Buttons in Tabellen */
body.compact-mode .table .btn-sm {
  padding: 0.2rem 0.4rem;
  min-width: auto;
}

body.compact-mode .table .btn-group .btn-sm {
  padding: 0.2rem 0.35rem;
}

/* Icon-only Buttons in Tabellen noch kompakter */
body.compact-mode .table .btn-sm i,
body.compact-mode .table .btn-sm .bi {
  font-size: 0.85em;
  margin: 0;
}

body.compact-mode .table .btn-group .btn-sm {
  width: auto;
  padding-left: 0.3rem;
  padding-right: 0.3rem;
}

/* Header-Buttons kompakter (z.B. Kundensuche, Neuer Kunde) */
body.compact-mode .btn {
  padding: 0.3rem 0.6rem;
  white-space: nowrap;
}

body.compact-mode .btn i,
body.compact-mode .btn .bi {
  font-size: 0.9em;
}

/* Buttons mit Icons kompakter */
body.compact-mode .btn-primary,
body.compact-mode .btn-secondary {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

/* Noch kompaktere Buttons wenn nötig */
body.compact-mode .text-end .btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}

/* Einheitliche Footer-Button-Formatierung */
footer.footer-fixed .btn-success {
  background-color: #28a745 !important;
  border-color: #28a745 !important;
  color: #fff !important;
  font-weight: 600 !important;
}

footer.footer-fixed .btn-success:hover {
  background-color: #218838 !important;
  border-color: #1e7e34 !important;
}

/* Footer-Buttons auf dunklem Hintergrund */
footer.footer-fixed .btn-outline-light {
  color: #f6be54 !important;
  border-color: #f6be54 !important;
}

footer.footer-fixed .btn-outline-light:hover {
  background-color: #f6be54 !important;
  color: #6f1d27 !important;
  border-color: #f6be54 !important;
}

/* Kompaktere Footer-Buttons */
footer.footer-fixed .btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  white-space: nowrap;
}

footer.footer-fixed .btn-sm.fw-bold {
  padding-left: 0.6rem;
  padding-right: 0.6rem;
}

body.compact-mode .btn-sm i,
body.compact-mode .btn-sm .bi {
  font-size: 0.85em;
}

body.compact-mode .btn-xs {
  font-size: 0.7rem;
  padding: 0.2rem 0.4rem;
}

body.compact-mode .btn-xs i,
body.compact-mode .btn-xs .bi {
  font-size: 0.8em;
}

body.compact-mode .table {
  font-size: 0.85rem;
}

body.compact-mode .table th,
body.compact-mode .table td {
  padding: 0.4rem 0.5rem;
}

body.compact-mode .table-sm th,
body.compact-mode .table-sm td {
  padding: 0.25rem 0.35rem;
}

body.compact-mode .navbar {
  padding: 0.4rem 0;
}

body.compact-mode .navbar-brand img {
  height: 70px !important;
  position: absolute;
  top: 8px;
  left: 10px;
}

body.compact-mode .navbar-brand i,
body.compact-mode .navbar-brand .bi {
  font-size: 1.5rem !important;
}

body.compact-mode .navbar-nav .nav-link {
  font-size: 0.9rem;
  padding: 0.4rem 0.75rem;
}

body.compact-mode .navbar-nav .nav-link i,
body.compact-mode .navbar-nav .nav-link .bi {
  font-size: 0.9em;
}

body.compact-mode .navbar-text {
  font-size: 0.85rem;
  padding-right: 1.5em;
}

body.compact-mode .dropdown-menu {
  font-size: 0.85rem;
}

body.compact-mode .dropdown-item {
  padding: 0.35rem 0.75rem;
}

body.compact-mode .dropdown-item i,
body.compact-mode .dropdown-item .bi {
  font-size: 0.85em;
}

body.compact-mode .modal-header {
  padding: 0.75rem 1rem;
}

body.compact-mode .modal-body {
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
}

body.compact-mode .modal-footer {
  padding: 0.5rem 1rem;
}

body.compact-mode .modal-title {
  font-size: 1rem;
}

body.compact-mode .alert {
  font-size: 0.8rem;
  padding: 0.4rem 0.6rem;
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

body.compact-mode .alert .btn-close {
  padding: 0.25rem;
  font-size: 0.7rem;
  width: 1rem;
  height: 1rem;
  opacity: 0.7;
  flex-shrink: 0;
}

body.compact-mode .alert .btn-close:hover {
  opacity: 1;
}

body.compact-mode .input-group-sm .form-control,
body.compact-mode .input-group-sm .form-select,
body.compact-mode .input-group-sm .input-group-text {
  font-size: 0.75rem;
  padding: 0.2rem 0.35rem;
}

body.compact-mode .input-group-text {
  font-size: 0.8rem;
  padding: 0.35rem 0.5rem;
}

body.compact-mode .input-group-text i,
body.compact-mode .input-group-text .bi {
  font-size: 0.85em;
}

body.compact-mode .input-group-sm .input-group-text i,
body.compact-mode .input-group-sm .input-group-text .bi {
  font-size: 0.8em;
}

/* Input-Group Buttons - gleiche Höhe wie Input-Felder */
body.compact-mode .input-group .btn {
  padding: 0.3rem 0.4rem;
  font-size: 0.75rem;
  line-height: 1.5;
  height: calc(1.5em + 0.6rem + 2px);
  display: flex;
  align-items: center;
  justify-content: center;
}

body.compact-mode .input-group-sm .btn {
  padding: 0.25rem 0.35rem;
  font-size: 0.7rem;
  line-height: 1.5;
  height: calc(1.5em + 0.5rem + 2px);
  display: flex;
  align-items: center;
  justify-content: center;
}

body.compact-mode .input-group .btn i,
body.compact-mode .input-group .btn .bi {
  font-size: 0.9em;
  line-height: 1;
}

body.compact-mode .input-group-sm .btn i,
body.compact-mode .input-group-sm .btn .bi {
  font-size: 0.85em;
  line-height: 1;
}

/* Löschen-Kreuze - gleiche Höhe wie Input-Felder */
body.compact-mode .clear-total-btn {
  padding: 0.3rem 0.4rem !important;
  font-size: 0.75rem !important;
  min-width: auto;
  height: calc(1.5em + 0.5rem + 2px) !important;
  line-height: 1.5 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

body.compact-mode .input-group-sm .clear-total-btn {
  height: calc(1.5em + 0.5rem + 2px) !important;
  padding: 0.25rem 0.35rem !important;
}

body.compact-mode .clear-total-btn i,
body.compact-mode .clear-total-btn .bi {
  font-size: 0.9em !important;
  line-height: 1 !important;
}

.input-group> :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
  margin-top: 0px;
}

/* Input-Group Alignment - alle Elemente auf gleicher Höhe */
body.compact-mode .input-group {
  align-items: stretch;
}

body.compact-mode .input-group>.form-control,
body.compact-mode .input-group>.form-select,
body.compact-mode .input-group>.selectize-control,
body.compact-mode .input-group>.btn,
body.compact-mode .input-group>.input-group-text {
  display: flex;
  align-items: center;
}

/* Input-Group-Text gleiche Höhe */
body.compact-mode .input-group .input-group-text {
  height: calc(1.5em + 0.6rem + 2px);
  display: flex;
  align-items: center;
  padding: 0.3rem 0.5rem;
}

body.compact-mode .input-group-sm .input-group-text {
  height: calc(1.5em + 0.5rem + 2px);
  padding: 0.25rem 0.4rem;
}

body.compact-mode .row {
  --bs-gutter-x: 0.35rem;
  --bs-gutter-y: 0.2rem;
}

/* Noch kompaktere Abstände zwischen Formfeldern */
body.compact-mode .row.g-2 {
  --bs-gutter-x: 0.3rem;
  --bs-gutter-y: 0.15rem;
}

body.compact-mode .row.g-3 {
  --bs-gutter-x: 0.35rem;
  --bs-gutter-y: 0.2rem;
}

body.compact-mode .row.g-4 {
  --bs-gutter-x: 0.4rem;
  --bs-gutter-y: 0.25rem;
}

body.compact-mode .mb-1 {
  margin-bottom: 0.1rem !important;
}

body.compact-mode .mb-2 {
  margin-bottom: 0.15rem !important;
}

body.compact-mode .mb-3 {
  margin-bottom: 0.25rem !important;
}

body.compact-mode .mb-4 {
  margin-bottom: 0.35rem !important;
}

body.compact-mode .mb-5 {
  margin-bottom: 0.5rem !important;
}

body.compact-mode .mt-1 {
  margin-top: 0.2rem !important;
}

body.compact-mode .mt-2 {
  margin-top: 0.4rem !important;
}

body.compact-mode .mt-3 {
  margin-top: 0.6rem !important;
}

body.compact-mode .mt-4 {
  margin-top: 0.8rem !important;
}

body.compact-mode .mt-5 {
  margin-top: 1rem !important;
}

body.compact-mode .p-1 {
  padding: 0.2rem !important;
}

body.compact-mode .p-2 {
  padding: 0.4rem !important;
}

body.compact-mode .p-3 {
  padding: 0.6rem !important;
}

body.compact-mode .p-4 {
  padding: 0.8rem !important;
}

body.compact-mode .p-5 {
  padding: 1rem !important;
}

body.compact-mode .px-1 {
  padding-left: 0.2rem !important;
  padding-right: 0.2rem !important;
}

body.compact-mode .px-2 {
  padding-left: 0.4rem !important;
  padding-right: 0.4rem !important;
}

body.compact-mode .px-3 {
  padding-left: 0.6rem !important;
  padding-right: 0.6rem !important;
}

body.compact-mode .px-4 {
  padding-left: 0.8rem !important;
  padding-right: 0.8rem !important;
}

body.compact-mode .px-5 {
  padding-left: 1rem !important;
  padding-right: 1rem !important;
}

body.compact-mode .py-1 {
  padding-top: 0.2rem !important;
  padding-bottom: 0.2rem !important;
}

body.compact-mode .py-2 {
  padding-top: 0.4rem !important;
  padding-bottom: 0.4rem !important;
}

body.compact-mode .py-3 {
  padding-top: 0.6rem !important;
  padding-bottom: 0.6rem !important;
}

body.compact-mode .py-4 {
  padding-top: 0.8rem !important;
  padding-bottom: 0.8rem !important;
}

body.compact-mode .py-5 {
  padding-top: 1rem !important;
  padding-bottom: 1rem !important;
}

body.compact-mode .badge {
  font-size: 0.7rem;
  padding: 0.25rem 0.4rem;
}

body.compact-mode .badge i,
body.compact-mode .badge .bi {
  font-size: 0.85em;
}

body.compact-mode .selectize-control.single .selectize-input {
  font-size: 0.85rem;
  padding: 0.35rem 0.5rem;
  min-height: calc(1.5em + 0.7rem + 2px);
}

body.compact-mode .selectize-dropdown {
  font-size: 0.85rem;
}

body.compact-mode .selectize-dropdown .option {
  padding: 0.3rem 0.5rem;
}

body.compact-mode footer.footer-fixed {
  padding: 0.4rem 0;
  font-size: 0.8rem;
}

body.compact-mode main.container {
  margin-top: 0.75rem !important;
}

/* DataTables Kompakt */
body.compact-mode .dataTables_wrapper .dataTables_length,
body.compact-mode .dataTables_wrapper .dataTables_filter,
body.compact-mode .dataTables_wrapper .dataTables_info,
body.compact-mode .dataTables_wrapper .dataTables_paginate {
  font-size: 0.8rem;
}

body.compact-mode .dataTables_wrapper .dataTables_length select,
body.compact-mode .dataTables_wrapper .dataTables_filter input {
  font-size: 0.8rem;
  padding: 0.25rem 0.4rem;
  height: calc(1.5em + 0.5rem + 2px);
}

/* Zusätzliche Kompaktheit: Labels kompakter */
body.compact-mode .form-label.small {
  font-size: 0.7rem;
  margin-bottom: 0.1rem;
}

body.compact-mode .form-text {
  font-size: 0.7rem;
  margin-top: 0.1rem;
}

/* Kompaktere Input-Groups */
body.compact-mode .input-group {
  margin-bottom: 0.15rem;
}

body.compact-mode .input-group>.form-control,
body.compact-mode .input-group>.form-select {
  margin-bottom: 0;
}

/* Kompaktere Form-Rows */
body.compact-mode .form-row {
  margin-bottom: 0.15rem;
}

body.compact-mode .col-form-label {
  font-size: 0.75rem;
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
}

/* Kompaktere Buttons in Formularen */
body.compact-mode form .btn {
  margin-top: 0.15rem;
  margin-bottom: 0.15rem;
}

/* Kompaktere Abstände in Formularen allgemein */
body.compact-mode form .row {
  margin-bottom: 0.2rem;
}

body.compact-mode form .row:last-child {
  margin-bottom: 0;
}

/* Noch kompaktere Abstände zwischen Form-Gruppen */
body.compact-mode .form-group {
  margin-bottom: 0.2rem;
}

body.compact-mode .form-group:last-child {
  margin-bottom: 0;
}

/* Kompaktere Abstände in Cards */
body.compact-mode .card-body>.row {
  margin-bottom: 0.2rem;
}

body.compact-mode .card-body>.row:last-child {
  margin-bottom: 0;
}

/* Kompaktere Selectize-Dropdowns */
body.compact-mode .selectize-control.single .selectize-input {
  min-height: calc(1.5em + 0.6rem + 2px);
  padding: 0.3rem 0.45rem;
}

body.compact-mode .selectize-dropdown .option {
  padding: 0.25rem 0.4rem;
  font-size: 0.8rem;
}

/* Zusätzliche Kompaktheit: Noch weniger Abstände */
body.compact-mode .mb-0 {
  margin-bottom: 0 !important;
}

body.compact-mode .mt-0 {
  margin-top: 0 !important;
}

/* Kompaktere Abstände zwischen Elementen allgemein */
body.compact-mode *+* {
  margin-top: 0;
}

/* Felder in einer Reihe auf gleicher Höhe ausrichten - NUR in Formularen */
body.compact-mode form .row {
  align-items: flex-end;
}

body.compact-mode form .row>[class*="col-"] {
  display: flex;
  flex-direction: column;
}

body.compact-mode form .row>[class*="col-"]>.form-label {
  flex-shrink: 0;
}

body.compact-mode form .row>[class*="col-"]>.form-control,
body.compact-mode form .row>[class*="col-"]>.form-select,
body.compact-mode form .row>[class*="col-"]>.input-group,
body.compact-mode form .row>[class*="col-"]>.selectize-control {
  flex: 1 1 auto;
}

/* Kompaktere Tabellen-Abstände */
body.compact-mode .table {
  margin-bottom: 0.3rem;
}

/* Kompaktere Modals */
body.compact-mode .modal-body .row {
  margin-bottom: 0.2rem;
}

body.compact-mode .modal-body .form-group {
  margin-bottom: 0.2rem;
}

/* Kompaktere Listen */
body.compact-mode .list-group-item {
  padding: 0.4rem 0.6rem;
  margin-bottom: 0.1rem;
}

/* Kompaktere Badges */
body.compact-mode .badge {
  margin-left: 0.2rem;
  margin-right: 0.2rem;
}

/* Kompaktere Breadcrumbs */
body.compact-mode .breadcrumb {
  margin-bottom: 0.3rem;
  padding: 0.3rem 0.5rem;
}

/* Kompaktere Sections */
body.compact-mode section {
  padding: 0.6rem;
  margin-bottom: 0.4rem;
}

/* Darkmode-Definition für .table-secondary - NEU */
body.theme-dark .table-secondary {
  --bs-table-bg: #232323 !important;
  color: #e0e0d4 !important;
}

@media (min-width: 2500px) {
  .main-content {
    max-width: 2400px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (min-width: 992px) {
  .navbar-expand-lg .navbar-collapse {
    padding-left: 100px !important;
  }
}

/* Trennlinien zwischen Positions-Cards im An- und Verkauf */
.detail-row.card~.detail-row.card {
  margin-top: 1rem !important;
  position: relative;
}

.detail-row.card~.detail-row.card::before {
  content: "";
  position: absolute;
  top: -0.6rem;
  left: 0%;
  right: 0%;
  border-top: 1px solid #6f1d27;
}

.detail-row.card {
  margin-bottom: 0.5rem !important;
}

body.theme-dark .detail-row.card~.detail-row.card::before {
  border-top-color: #444;
}