/* =========================================================
   Qeyafa Emergency Logo Fix
   Purpose: stop oversized Qeyafa logo/background from covering ERPNext pages.
   ========================================================= */

/* Kill old decorative pseudo backgrounds that may contain the logo */
body::before,
body::after,
.main-section::before,
.main-section::after,
.layout-main::before,
.layout-main::after,
.layout-main-section::before,
.layout-main-section::after,
.page-container::before,
.page-container::after,
.page-head::before,
.page-head::after,
.page-title::before,
.page-title::after,
.desk-page::before,
.desk-page::after,
.workspace::before,
.workspace::after,
.standard-page::before,
.standard-page::after,
[class*="qeyafa"]::before,
[class*="qeyafa"]::after {
  background-image: none !important;
  background: none !important;
  content: none !important;
}

/* Stop any Qeyafa image from acting like a page overlay */
body img[src*="qeyafa2c4ff7"],
body img[src*="qeyafa3e93d6"],
body img[src*="qeyafa"],
.navbar img[src*="qeyafa"],
.desk-sidebar img[src*="qeyafa"],
.layout-main img[src*="qeyafa"],
.layout-main-section img[src*="qeyafa"],
.page-container img[src*="qeyafa"],
.page-head img[src*="qeyafa"] {
  position: static !important;
  inset: auto !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;

  transform: none !important;
  translate: none !important;
  z-index: auto !important;

  max-width: 160px !important;
  max-height: 48px !important;
  width: auto !important;
  height: auto !important;

  object-fit: contain !important;
  object-position: center !important;
  display: inline-block !important;
  opacity: 1 !important;
}

/* Navbar logo must stay tiny */
.navbar-home img,
.navbar .app-logo img,
.app-logo img,
img.app-logo,
img.navbar-brand,
img[src*="qeyafa2c4ff7"],
img[src*="qeyafa3e93d6"] {
  max-width: 140px !important;
  max-height: 34px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
}

/* Print preview / invoice letterhead logo */
.print-format img[src*="qeyafa"],
.print-preview img[src*="qeyafa"],
.letter-head img[src*="qeyafa"],
.print-format .letter-head img,
.print-preview .letter-head img {
  position: static !important;
  transform: none !important;
  z-index: auto !important;

  max-width: 220px !important;
  max-height: 72px !important;
  width: auto !important;
  height: auto !important;

  object-fit: contain !important;
  display: inline-block !important;
}

/* Prevent any image from escaping containers */
.layout-main,
.layout-main-section,
.page-container,
.page-head,
.print-format,
.letter-head {
  overflow-x: hidden !important;
}

/* Last-resort: if an image was injected as a fixed/absolute overlay */
img[src*="qeyafa"][style*="position: fixed"],
img[src*="qeyafa"][style*="position:absolute"],
img[src*="qeyafa"][style*="position: absolute"] {
  position: static !important;
  max-width: 160px !important;
  max-height: 48px !important;
}
