

/* Dialog insgesamt mittig im Browser */
.modal-dialog {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 100vh !important;
  margin: 0 auto !important;
  padding: 16px;
}

/* eigentlicher Dialog */
.mymodaldialog {
  border: none !important;
  border-radius: 10px !important;
  overflow: hidden !important;
  box-shadow: var(--dialog-shadow) !important;
  transform: translateY(-2px);
}

/* Header */
.mymodaldialog .modal-header {
  padding: 16px 20px 14px 20px !important;
  border-bottom: 1px solid #e5e5e5 !important;
  background: #ffffff;
}

.mymodaldialog .modal-title {
  margin: 0 !important;
  font-size: 18px !important;
  font-weight: 600 !important;
  color: #2b2b2b !important;
}

/* Body: Icon links, Text rechts */
.mymodaldialog .modal-body {
  display: flex !important;
  align-items: flex-start !important;
  gap: 14px !important;
  padding: 18px 20px 20px 20px !important;
  background: #ffffff;
}

/* TMS erzeugt das Icon im span mit float:left -> das überschreiben wir */
.mymodaldialog .modal-body > span {
  float: none !important;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: center !important;
  flex: 0 0 48px !important;
  width: 48px !important;
  min-width: 48px !important;
  padding-right: 0 !important;
}

/* Material Icon */
.mymodaldialog .modal-body > span i.material-icons {
  font-size: 38px !important;
  line-height: 1 !important;
  margin-top: 2px !important;
}

/* Meldungstext */
.mymodaldialog .modal-body > h6 {
  margin: 0 !important;
  flex: 1 1 auto !important;
  font-size: 15px !important;
  font-weight: 400 !important;
  line-height: 1.45 !important;
  color: #2b2b2b !important;
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
}

/* Footer */
.mymodaldialog .modal-footer {
  padding: 14px 20px 16px 20px !important;
  border-top: 1px solid #e5e5e5 !important;
  background: #ffffff;
}

/* Button */
.mymodaldialog .modal-footer .btn {
  background-color: var(--color-primary) !important;
  color: white !important;
  border: none !important;
  border-radius: 6px !important;
  min-width: 74px !important;
  height: 34px !important;
  padding: 0 18px !important;
  font-size: 15px !important;
  font-weight: 500 !important;
}

/* Hover */
.mymodaldialog .modal-footer .btn:hover {
  filter: brightness(1.08);
}

/* Fokus / Active / Bootstrap Shadow entfernen */
.mymodaldialog .modal-footer .btn,
.mymodaldialog .modal-footer .btn:focus,
.mymodaldialog .modal-footer .btn:active,
.mymodaldialog .modal-footer .btn.focus,
.mymodaldialog .modal-footer .btn:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

/* Support muss auch aus normalen XCraft-Overlays erreichbar bleiben.
   Das Supportfenster selbst liegt in support.css bei 120000. */
html body .menu#menu-support,
html body #xcraftSupportRestore {
  z-index: 119000 !important;
  pointer-events: auto !important;
}

/* Der zusätzliche Minimierer gehört nur zur internen Ticketbearbeitung.
   Im Endkunden-Support existiert bereits ein eigener Minimieren-Button. */
html body .xcraft-support-overlay:not(:has(.xcraft-support-role))
.xcraft-support-window-actions
.xcraft-support-minimize[title="Ticketbearbeitung minimieren"] {
  display: none !important;
}

/* optional: auf kleineren Screens etwas kompakter */
@media (max-width: 576px) {
  .modal-dialog {
    padding: 10px !important;
  }

  .mymodaldialog .modal-header,
  .mymodaldialog .modal-body,
  .mymodaldialog .modal-footer {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .mymodaldialog .modal-body {
    gap: 10px !important;
  }

  .mymodaldialog .modal-body > span {
    flex: 0 0 40px !important;
    width: 40px !important;
    min-width: 40px !important;
  }

  .mymodaldialog .modal-body > span i.material-icons {
    font-size: 32px !important;
  }

  .mymodaldialog .modal-body > h6 {
    font-size: 14px !important;
  }
}

/* Belegbearbeitung: schwebende Einfügequellen bleiben an ihrer Position.
   Die Seitenleiste öffnet unterhalb der Buttonleiste, ohne die Buttons zu verschieben. */
html body #beleg-single-root .xcraft-floating-source-bar,
html body #beleg-single-root.xcraft-source-open .xcraft-floating-source-bar,
html body #beleg-single-root.xcraft-source-open.xcraft-other-belege-mode .xcraft-floating-source-bar {
  right: 18px !important;
  background: #ffffff !important;
  border-color: #cfd9e1 !important;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transition: none !important;
}

html body #beleg-single-root .xcraft-floating-source-button {
  color: #24465c !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  text-shadow: none !important;
}

html body #beleg-single-root .xcraft-floating-source-button .material-icons {
  color: #365e77 !important;
  font-size: 19px !important;
  line-height: 1 !important;
  text-shadow: none !important;
}

html body #beleg-single-root .xcraft-floating-source-button:hover {
  background: #f1f5f8 !important;
  color: #063f6c !important;
}

html body #beleg-single-root .xcraft-floating-source-button.is-active {
  background: #e7f0f6 !important;
  border-color: #83a9c1 !important;
  color: #063f6c !important;
}

html body #beleg-single-root .xcraft-floating-source-button.is-active .material-icons {
  color: #063f6c !important;
}

html body #beleg-single-root .beleg-insert-sidebar.xcraft-insert-sources,
html body #beleg-single-root.xcraft-source-open .beleg-insert-sidebar.xcraft-insert-sources,
html body #beleg-single-root.xcraft-source-open.xcraft-other-belege-mode .beleg-insert-sidebar.xcraft-insert-sources {
  top: 61px !important;
}

/* Die Seitenleiste wird nur explizit geschlossen: über denselben Quellen-Button
   oder über das X. Der bisherige Backdrop bleibt rein visuell und fängt keine
   Klicks auf der Belegvorschau mehr ab. */
html body #beleg-single-root .xcraft-source-backdrop {
  pointer-events: none !important;
}

/* Titel und Unterzeile stehen bereits im Kopf der Seitenleiste. Die zusätzliche
   Wiederholung innerhalb des jeweiligen Inhaltsbereichs entfällt. */
html body #beleg-single-root .xcraft-source-panel-title {
  display: none !important;
}

@media (max-width: 980px) {
  html body #beleg-single-root .xcraft-floating-source-bar,
  html body #beleg-single-root.xcraft-source-open .xcraft-floating-source-bar,
  html body #beleg-single-root.xcraft-source-open.xcraft-other-belege-mode .xcraft-floating-source-bar {
    right: 12px !important;
  }

  html body #beleg-single-root .beleg-insert-sidebar.xcraft-insert-sources,
  html body #beleg-single-root.xcraft-source-open .beleg-insert-sidebar.xcraft-insert-sources,
  html body #beleg-single-root.xcraft-source-open.xcraft-other-belege-mode .beleg-insert-sidebar.xcraft-insert-sources {
    top: 58px !important;
    padding-top: 0 !important;
  }
}