/* frontend/src/index.css
 * Zentrale Gestaltung der React-Oberfläche, Formulare, Tabellen und Modals.
 */

:root {
  --primary: #074437;
  --primary-soft: #EFF7F4;
}

body {
  margin: 0;
  padding: 0;
  position: relative;
  background-color: #f9fafb !important;
}

/* >>> NEU: Der Betriebsumschalter bleibt kompakt und wächst nur bis zu einer gut lesbaren Breite. */
.company-switcher {
  width: auto;
  min-width: 9rem;
  max-width: 16rem;
}

/* Sidebar */
.sidebar {
  width: 280px;
  min-width: 280px;
  /* >>> NEU: Sidebar bleibt beim Scrollen fix, nur der Inhalt rechts scrollt */
  position: sticky;
  top: 0;
  height: 100vh;
  align-self: flex-start;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.85rem 1rem;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  color: #374151;
  border-radius: 0.57rem;
}

.sidebar-link:hover {
  background-color: var(--primary-soft);
  color:var(--primary);
}

.sidebar-link-disabled {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  color: #c1c8d4;
  border-radius: 0.57rem;
  cursor: not-allowed;
  user-select: none;
}

.sidebar-link.active {
  background-color: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

/* Primärfarbe — zentral hier ändern, gilt für alle btn-primary im Projekt */
.btn-primary {
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff;
}

.btn-primary:hover,
.btn-primary:active,
.btn-primary:focus-visible {
  background-color: var(--primary)!important;
  border-color: var(--primary) !important;
  color: #fff;
}

/* Avatar-Kreise mit Initialen */
.avatar-circle {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.avatar-primary { background-color: var(--primary); }
.avatar-0 { background-color: #4f46e5; }
.avatar-1 { background-color: #0891b2; }
.avatar-2 { background-color: #059669; }
.avatar-3 { background-color: #d97706; }
.avatar-4 { background-color: #dc2626; }
.avatar-5 { background-color: #7c3aed; }
.avatar-6 { background-color: #0d9488; }

/* Rollen-Badges */
.role-badge {
  padding: 0.1875rem 0.625rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
}
.role-badge-manager    { background: #d1fae5; color: #065f46; }
.role-badge-employee   { background: #dbeafe; color: #1e40af; }
.role-badge-accountant { background: #ede9fe; color: #5b21b6; }

/* Status-Punkt */
.status-dot {
  width: 0.4375rem;
  height: 0.4375rem;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.375rem;
}
.status-dot-active   { background-color: #10b981; }
.status-dot-inactive { background-color: #9ca3af; }
.status-dot-pending  { background-color: #f59e0b; }

/* Aktionsmenü */
.actions-btn {
  background: none;
  border: none;
  color: #6b7280;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 1rem;
  letter-spacing: 0.1em;
}

.actions-btn:hover {
  background-color: #f3f4f6;
  color: #111827;
}

.actions-menu-dropdown {
  min-width: 10rem;
  top: 100%;
  z-index: 200;
}

.actions-menu-dropdown .dropdown-item {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: #374151;
}

.actions-menu-dropdown .dropdown-item:hover {
  background-color: #f9fafb;
  color: #111827;
}

/* Tabelle: Zellen-Klassen */
.member-name   { font-size: 0.875rem; font-weight: 500; }
.member-sub    { font-size: 0.75rem;  color: #6b7280; }
.member-email  { font-size: 0.875rem; }
.member-status { font-size: 0.875rem; }
.member-login  { font-size: 0.875rem; color: #6b7280; }

/* Tabelle: Filter-Dropdown */
.table-filter-wrapper {
  min-width: 10rem;
}

.table-filter-wrapper .react-select__control {
  min-height: 2rem;
  font-size: 0.875rem;
}

.table-filter-wrapper .react-select__dropdown-indicator {
  padding: 0 0.375rem;
}

.table-filter-wrapper .react-select__value-container {
  padding: 0 0.5rem;
}

/* React Select — Projektfarben statt Blau */
.react-select__control--is-focused {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 1px var(--primary) !important;
}

.react-select__option--is-focused {
  background-color: var(--primary-soft) !important;
  color: var(--primary) !important;
}

.react-select__option--is-selected {
  background-color: var(--primary) !important;
  color: #fff !important;
}

/* Tabelle: Suchfeld */
.table-search-wrapper {
  position: relative;
  width: 220px;
}

.table-search-icon {
  position: absolute;
  left: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.9375rem;
  height: 0.9375rem;
  color: #9ca3af;
  pointer-events: none;
}

.table-search-input {
  padding-left: 2rem !important;
}

/* X-Button zum Zurücksetzen der Suche */
.table-search-clear {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;   
  padding: 0;
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  line-height: 1;
}

.table-search-clear:hover {
  color: #6b7280;
}

.table-filter-wrapper .react-select__control {
  min-height: 2rem;
  font-size: 0.875rem; 
}

/* >>> NEU: Wert/Platzhalter gleiche Schriftgröße wie das Suchfeld (0.875rem) */
.table-filter-wrapper .react-select__single-value,
.table-filter-wrapper .react-select__placeholder {
  font-size: 0.875rem; 
}

/* >>> NEU: Lösch-X in derselben grauen Farbe wie in der Freitextsuche */
.table-filter-wrapper .react-select__clear-indicator {
  color: #9ca3af;
}

.table-filter-wrapper .react-select__clear-indicator:hover {
  color: #6b7280;
}

/* Tabelle: Spaltenköpfe */
.table-header-cell {
  font-weight: 400;
  font-size: 0.8125rem;
  color: #6b7280;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  border-top: none !important;
  border-bottom: 1px solid #e5e7eb !important;
}

/* >>> NEU: Sortierbarer Spaltenkopf bleibt optisch wie die übrigen Tabellenüberschriften. */
.table-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

/* >>> NEU: Kleiner Richtungspfeil direkt neben der sortierbaren Überschrift. */
.table-sort-icon {
  width: 0.875rem;
  height: 0.875rem;
}

.member-status,
.belegliste-kompakt .table td {
  font-size: 0.8125rem;
}
.belegliste-kompakt .table-header-cell {
  font-size: 0.75rem;
}

/* Beleg-Upload: Dropzone im Hochladen-Modal */
.dropzone {
  border: 2px dashed #d1d5db;
  border-radius: 0.75rem;
  padding: 2.5rem 1rem;
  text-align: center;
  cursor: pointer;
  background-color: #fff;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--primary);
  background-color: var(--primary-soft);
}

.dropzone-icon {
  color: var(--primary);
}

/* Beleg-Upload: eine Zeile in der Liste der gewählten Dateien */
.upload-file-row {
  font-size: 0.875rem;
  padding: 0.375rem 0.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  margin-bottom: 0.375rem;
}

/* Klickbare Tabellenzeile (z. B. Beleg-Detail öffnen) */
.table-row-clickable {
  cursor: pointer;
}

/* Beleg-Detail: Vorschau der Original-Datei rechts im Modal */
.receipt-preview {
  width: 100%;
  height: 70vh;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
}

.receipt-preview-img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
}

/* >>> GEÄNDERT: Prüfmodal als Arbeitsfläche mit Dokument links und festem Formular rechts. */
.receipt-review-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0 !important;
  overflow: hidden !important;
  background-color: var(--bs-tertiary-bg);
}

.receipt-review-body > .alert {
  flex: 0 0 auto;
  margin: 1rem 1rem 0;
}

.receipt-review-workspace {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  background-color: var(--bs-tertiary-bg);
}

.receipt-review-workspace > .receipt-document-column {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  height: 100%;
  width: auto;
  max-width: none;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 1rem;
  overflow: hidden;
}

.receipt-review-workspace > .receipt-form-pane {
  flex: 0 0 clamp(24rem, 29vw, 32rem);
  width: clamp(24rem, 29vw, 32rem);
  max-width: none;
  max-height: 100%;
  min-height: 0;
  padding: 1rem;
  overflow: hidden;
  background-color: var(--bs-tertiary-bg);
  border-left: var(--bs-border-width) solid var(--bs-border-color);
}

/* >>> GEÄNDERT: Eingerückte weiße Formularkarte wie in der Referenz. */
.receipt-form-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  background-color: var(--bs-body-bg);
  border: var(--bs-border-width) solid var(--bs-border-color);
  border-radius: 0.75rem;
}

/* >>> GEÄNDERT: Nur die Formulardaten scrollen; die Aktionen bleiben unten sichtbar. */
.receipt-form-scroll {
  flex: 1 1 auto;
  min-height: 0;
  padding: 1rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.receipt-form-actions {
  flex: 0 0 auto;
  padding: 1rem;
  border-top: var(--bs-border-width) solid var(--bs-border-color);
}

.receipt-form-primary-action {
  width: 100%;
  margin-bottom: 0.75rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  font-weight: 600;
}

.receipt-form-secondary-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) auto;
  gap: 0.5rem;
}

.receipt-form-secondary-actions .btn {
  white-space: nowrap;
}

.receipt-document-tabs {
  flex: 0 0 auto;
  margin-bottom: 0.75rem;
}

.receipt-document-tabs .nav-link {
  color: var(--bs-secondary-color);
}

/* >>> GEÄNDERT: Hover und Tastaturfokus der Dokument-Tabs verwenden die Betriebsfarbe statt Blau. */
.receipt-document-tabs .nav-link:hover,
.receipt-document-tabs .nav-link:focus,
.receipt-document-tabs .nav-link:focus-visible {
  color: var(--primary);
  background-color: var(--primary-soft);
  border-color: var(--primary);
  outline: 0;
  box-shadow: 0 0 0 0.15rem var(--primary-soft);
}

.receipt-document-tabs .nav-link.active {
  color: var(--primary);
  font-weight: 600;
  border-color: var(--primary);
}

.receipt-document-stage {
  display: flex;
  flex: 1 1 0;
  align-items: stretch;
  justify-content: center;
  height: 0;
  min-height: 0;
  padding: 1.5rem;
  overflow: hidden;
  background-color: var(--bs-secondary-color);
  border-radius: 0.5rem;
}

.receipt-document-stage-pdf .receipt-preview {
  width: min(100%, 60rem);
  height: 100%;
  max-height: none;
  border: 0;
  border-radius: 0;
  background-color: var(--bs-body-bg);
}

/* >>> GEÄNDERT: Lange Bildbelege behalten ihre Höhe und scrollen innerhalb der Dokumentfläche. */
.receipt-document-stage-image {
  align-items: flex-start;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.receipt-document-stage-image .receipt-preview-img {
  width: min(100%, 60rem);
  height: auto;
  max-height: none;
  object-fit: contain;
  object-position: top center;
  border: 0;
  border-radius: 0;
  background-color: var(--bs-body-bg);
}

/* >>> GEÄNDERT: Auf schmalen Ansichten stehen Dokument und Formular wieder untereinander. */
@media (max-width: 991.98px) {
  .receipt-review-body {
    overflow-y: auto !important;
  }

  .receipt-review-workspace {
    display: block;
    height: auto;
    overflow: visible;
  }

  .receipt-review-workspace > .receipt-document-column,
  .receipt-review-workspace > .receipt-form-pane {
    height: auto;
    width: 100%;
    max-width: 100%;
    max-height: none;
  }

  .receipt-review-workspace > .receipt-document-column {
    overflow: visible;
  }

  .receipt-review-workspace > .receipt-form-pane {
    max-height: none;
    overflow-y: visible;
    border-left: 0;
    border-top: var(--bs-border-width) solid var(--bs-border-color);
  }

  .receipt-form-card {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .receipt-form-scroll {
    overflow-y: visible;
  }

  .receipt-document-stage {
    flex: 0 0 auto;
    height: 60vh;
  }
}

/* >>> GEÄNDERT: Kompakte und klar gegliederte Belegdaten mit dauerhaft sichtbarem Gesamtstatus im Prüfmodal. */
.receipt-form-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.receipt-form-heading {
  margin-bottom: 0;
  font-size: 1rem;
  font-weight: 600;
}

.receipt-status-badge {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 0.25rem 0.625rem;
  border: var(--bs-border-width) solid;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25;
}

.receipt-status-badge-confirmed {
  color: var(--primary);
  background-color: var(--primary-soft);
  border-color: var(--primary);
}

.receipt-status-badge-pending {
  color: var(--bs-warning-text-emphasis);
  background-color: var(--bs-warning-bg-subtle);
  border-color: var(--bs-warning-border-subtle);
}

.receipt-edit-form .row {
  --bs-gutter-x: 0.75rem;
}

.receipt-edit-form .mb-3 {
  margin-bottom: 0.75rem !important;
}

.receipt-edit-form .form-label {
  margin-bottom: 0.3rem;
  font-size: 0.8125rem;
  font-weight: 600;
}

/* >>> NEU: Prüfstatus steht ruhig über Farbe und ein kleines Info-Symbol direkt am Label. */
.receipt-field-label-row,
.receipt-tax-overview-title {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* >>> GEÄNDERT: Label und Info-Symbol stehen auf derselben Höhe; der bisherige Feldabstand bleibt erhalten. */
.receipt-field-label-row {
  margin-bottom: 0.3rem;
}

.receipt-field-label-row .form-label {
  margin-bottom: 0;
}

.receipt-field-info-button {
  display: inline-flex;
  flex: 0 0 0.25rem;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0 !important;
  line-height: 1 !important;
  vertical-align: middle;
  color: inherit !important;
  background-color: transparent !important;
  border: 0 !important;
  border-radius: 50%;
}

/* >>> GEÄNDERT: Das SVG selbst sitzt optisch mittig zur Schrift und übernimmt keine Bootstrap-Grundlinie. */
.receipt-field-info-button svg {
  display: block;
  transform: translateY(-0.0325rem);
}

.receipt-field-info-button:hover,
.receipt-field-info-button:focus-visible {
  background-color: var(--bs-tertiary-bg) !important;
}

/* >>> NEU: Der Unternehmensname erhält rechts einen klar erkennbaren, quadratischen Bearbeiten-Button. */
.receipt-field-edit-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

.receipt-field-edit-row .form-control,
.receipt-company-select {
  flex: 1 1 auto;
  min-width: 0;
}

.receipt-field-edit-button {
  position: relative;
  display: inline-flex;
  flex: 0 0 2.5rem;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  padding: 0;
  line-height: 1;
}

/* >>> NEU: Das Stift-Symbol sitzt fest und optisch mittig im danebenstehenden Bearbeiten-Button. */
.receipt-field-edit-button svg {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  margin: 0;
  transform: translate(-50%, -50%);
}

/* >>> NEU: Ähnliche Unternehmensnamen als vollständig anklickbare Zeilen ohne Checkboxen. */
.supplier-suggestion-list {
  display: grid;
  gap: 0.5rem;
}

.supplier-suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 0.625rem 0.75rem;
  color: var(--bs-body-color);
  text-align: left;
  background-color: var(--bs-body-bg);
  border-color: var(--bs-border-color);
}

/* >>> GEÄNDERT: Die bewusste Auswahl bleibt auch gegenüber Bootstrap-Zuständen klar grün sichtbar. */
.supplier-suggestion.supplier-suggestion-selected,
.supplier-suggestion.supplier-suggestion-selected:hover,
.supplier-suggestion.supplier-suggestion-selected:focus-visible {
  color: var(--primary) !important;
  background-color: var(--primary-soft) !important;
  border-color: var(--primary) !important;
}

.supplier-suggestion-count {
  flex: 0 0 auto;
  color: var(--bs-secondary-color);
  font-size: 0.8125rem;
}

/* >>> NEU: Das Info-Symbol übernimmt dieselbe grüne oder gelbe Bedeutung wie das Feld. */
.receipt-field-success .receipt-field-info-button,
.receipt-check-success .receipt-field-info-button {
  color: var(--primary) !important;
}

.receipt-field-warning .receipt-field-info-button,
.receipt-check-warning .receipt-field-info-button {
  color: var(--bs-warning-text-emphasis) !important;
}

.receipt-field-check-message {
  margin-top: 0.35rem;
  color: var(--bs-secondary-color);
  font-size: 0.75rem;
  line-height: 1.35;
}

/* >>> NEU: Grün bedeutet ohne Prüfhinweis, Gelb bedeutet manuell ansehen. */
.receipt-field-success .form-control,
.receipt-field-success .react-select__control {
  background-color: var(--primary-soft);
  border-color: var(--primary);
}

.receipt-field-warning .form-control,
.receipt-field-warning .react-select__control {
  background-color: var(--bs-warning-bg-subtle);
  border-color: var(--bs-warning-border-subtle);
}

.receipt-edit-form .form-control,
.receipt-edit-form .react-select__control {
  min-height: 2.5rem;
  font-size: 0.9375rem;
}

.receipt-edit-form input[type="number"],
.receipt-tax-section input[type="number"] {
  text-align: right;
}

/* >>> GEÄNDERT: Bruttobetrag steht kompakt unter den einzelnen Steuersatzzeilen. */
.receipt-edit-form .form-field-total {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(8rem, 1fr);
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem !important;
  padding: 0.75rem;
  background-color: var(--primary-soft);
  border: var(--bs-border-width) solid var(--primary);
  border-top: 0;
  border-radius: 0 0 0.5rem 0.5rem;
}

.receipt-edit-form .form-field-total .form-label {
  margin: 0;
}

.receipt-edit-form .form-field-total .form-control {
  font-size: 0.9375rem;
  font-weight: 600;
}

/* >>> NEU: Aufgeklappter Brutto-Hinweis nutzt unter Label und Eingabe die ganze Breite. */
.receipt-edit-form .form-field-total .receipt-field-check-message {
  grid-column: 1 / -1;
}

/* >>> NEU: Ein problematischer Bruttobetrag schließt den gelben Betragsbereich bündig ab. */
.receipt-edit-form .form-field-total.receipt-field-warning {
  background-color: var(--bs-warning-bg-subtle);
  border-color: var(--bs-warning-border-subtle);
}

/* >>> GEÄNDERT: Mehrere Steuersätze als eigener, übersichtlicher Formularabschnitt. */
.receipt-tax-section {
  margin-bottom: 0;
  padding: 0.75rem;
  background-color: var(--primary-soft);
  border: var(--bs-border-width) solid var(--primary);
  border-bottom: 0;
  border-radius: 0.5rem 0.5rem 0 0;
}

.receipt-tax-overview-title {
  justify-content: flex-start;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
}

/* >>> NEU: Derselbe Prüfstatus gilt sichtbar für alle Steuersatzzeilen des Bereichs. */
.receipt-tax-section.receipt-check-warning {
  background-color: var(--bs-warning-bg-subtle);
  border-color: var(--bs-warning-border-subtle);
}

.receipt-tax-check-message {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.receipt-tax-title {
  font-size: 0.875rem;
  font-weight: 600;
}

.receipt-tax-header {
  color: var(--bs-secondary-color);
  font-size: 0.75rem;
  font-weight: 600;
}

.receipt-tax-action {
  width: 2rem;
}

/* >>> GEÄNDERT: Zusätzlicher fester Bereich unter der Modal-Aktionszeile. */
.modal-footer-below {
  padding: 0.625rem 1rem;
  border-top: var(--bs-modal-footer-border-width) solid var(--bs-modal-footer-border-color);
}

/* >>> GEÄNDERT: Offene Belege als horizontal scrollbare Warteschlange. */
.receipt-queue {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.receipt-queue-label {
  flex: 0 0 auto;
  color: var(--bs-secondary-color);
  font-size: 0.8125rem;
  font-weight: 600;
}

.receipt-queue-scroll {
  display: flex;
  flex: 1 1 auto;
  gap: 0.375rem;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 0.125rem;
}

.receipt-queue-button {
  flex: 0 0 auto;
  min-width: 2.25rem;
}

/* >>> GEÄNDERT: Fortschritt der laufenden Belegprüfung im Kopf des Vollbildmodals. */
.receipt-review-header {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.receipt-review-title {
  font-weight: 600;
}

.receipt-review-position {
  color: var(--bs-secondary-color);
  font-size: 0.875rem;
  font-weight: 400;
}

.receipt-review-progress {
  width: min(24vw, 25rem);
  height: 0.5rem;
  accent-color: var(--primary);
}

.receipt-review-completed {
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 600;
}


.form-control:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 1px  var(--primary) !important;
}

/* Breiteres Modal für die Paar-Ansicht (Rechnung + Lieferschein nebeneinander) */
.modal-xxl {
  max-width: 95vw !important;
}

.modal-xxl .modal-content {
  max-height: 90vh !important;
}
.modal-xxl .modal-body {
  overflow-y: auto !important;
}


/* >>> NEU: Export-Modal — Excel-artige Liste, kompakt und scrollbar (bis ~400 Belege) */
.export-table-wrap {
  max-height: 65vh;
  overflow: auto;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
}

.export-table {
  font-size: 0.8125rem;
}

.export-table thead th {
  position: sticky;
  top: 0;
  background-color: #f3f4f6;
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
  border-bottom: 1px solid #e5e7eb;
  z-index: 1;
}

.export-table th,
.export-table td {
  padding: 0.4rem 0.6rem;
  vertical-align: middle;
}

/* Zahlenspalten rechtsbündig, gleiche Ziffernbreite */
.export-num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}


/* >>> NEU: Export-Modal — Werkzeugleiste (Spalten ein-/ausblenden) */
.export-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.export-col-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: #374151;
  cursor: pointer;
  margin: 0;
  user-select: none;
}

/* >>> NEU: Export-Modal — Spalte mit der Zeilen-Auswahl (Häkchen) */
.export-check-col {
  width: 2.25rem;
  text-align: center;
}

/* >>> NEU: Export-Modal — Eingabefeld in der Zelle (randlos, füllt die Zelle) */
.export-cell-input {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  font-size: 0.8125rem;
  padding: 0.15rem 0.3rem;
  border-radius: 0.25rem;
}

.export-cell-input:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}

.export-cell-input:disabled {
  color: #9ca3af;
}

/* >>> NEU: Export-Modal — abgewählte Zeile (kommt nicht in den Export) */
.export-row-excluded {
  opacity: 0.5;
}

/* >>> NEU: Export-Modal — Suchfeld in der Liste */
.export-search {
  width: 220px;
}

/* >>> NEU: Export-Modal — Download-Dropdown (Excel / CSV) */
.export-download {
  position: relative;
}

.export-download-menu {
  display: block;
  right: 0;
  left: auto;
}

/* Abschluss-Liste unter der Belegtabelle — Status-Badge + Lade-Datum */
.period-badge {
  padding: 0.1875rem 0.625rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
}
.period-badge-done {
  background: #d1fae5;
  color: #065f46;
}
.period-badge-progress {
  background: #f3f4f6;
  color: #6b7280;
}
.belegtabelle h5 {
  font-size: 1.2rem;
}

/* >>> NEU: Glocke in der Kopfzeile mit Anzahl der offenen Hinweise (Header.js) */
.notification-bell {
  position: relative;
  background: none;
  border: none;
  padding: 0.25rem;
  line-height: 0;
}
.notification-badge {
  position: absolute;
  top: -0.125rem;
  right: -0.25rem;
  min-width: 1.125rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.125rem;
  text-align: center;
}

/* >>> NEU: Eine Zeile in der Benachrichtigungs-Liste (abgewiesener Upload) */
.notification-row {
  padding: 0.625rem 0;
  border-bottom: 1px solid #e5e7eb;
}
.notification-row:last-child {
  border-bottom: none;
}
/* >>> NEU: Kennzeichen fuer wiederkehrende Rechnungen (Abo) hinter der Belegart. */
.recurring-badge {
  display: inline-block;
  margin-left: 0.375rem;
  padding: 0 0.35rem;
  border: 1px solid var(--primary);
  border-radius: 0.25rem;
  color: var(--primary);
  background-color: var(--primary-soft);
  font-weight: 600;
  line-height: 1.25;
}

/* >>> NEU: Lange Dateinamen werden abgeschnitten statt aus der Liste herauszuragen.
   min-width: 0 ist noetig, weil ein Flex-Element sonst nie schmaler wird als sein Text. */
.notification-text {
  flex: 1 1 auto;
  min-width: 0;
}

/* >>> GEÄNDERT: Höhere Spezifität und feste Ebene verhindern ein Überschreiben durch Bootstrap. */
.modal-backdrop.modal-backdrop-stacked {
  z-index: 1990 !important;
  opacity: 0.65 !important;
}

.modal.modal-stacked {
  z-index: 2000 !important;
}

