/**
 * BB_DESIGN_2026 | Sneat V2 — global modal stack (load last)
 * Fixes: backdrop above modal, legacy overlay blocking clicks, stacked modals.
 */

body.bb-theme-v2 .modal.in,
body.bb-theme-v2 .modal.fade.in {
  z-index: 10550 !important;
  pointer-events: auto;
}

body.bb-theme-v2 .modal.in ~ .modal.in {
  z-index: 10560 !important;
}

body.bb-theme-v2 .modal.in ~ .modal.in ~ .modal.in {
  z-index: 10570 !important;
}

body.bb-theme-v2 .modal-backdrop.in,
body.bb-theme-v2 .modal-backdrop.fade.in {
  z-index: 10540 !important;
}

body.bb-theme-v2 .modal-backdrop.in ~ .modal-backdrop.in {
  z-index: 10545 !important;
}

body.bb-theme-v2.modal-open .bb-v2-overlay,
body.bb-theme-v2.modal-open .overlay:not(.modal-backdrop) {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body.bb-theme-v2.modal-open.bb-v2-nav-open .bb-v2-overlay {
  display: none !important;
}

body.bb-theme-v2 .modal.in .select2-container--open {
  z-index: 10600 !important;
}

body.bb-theme-v2 .modal.in .daterangepicker,
body.bb-theme-v2 .modal.in .bootstrap-datetimepicker-widget {
  z-index: 10600 !important;
}

body.bb-theme-v2 .modal.in .dropdown-menu {
  z-index: 10600 !important;
}

body.bb-theme-v2 #bb-build-update-overlay {
  z-index: 999999 !important;
  pointer-events: auto !important;
}

body.bb-theme-v2 #bb-build-update-overlay > * {
  pointer-events: auto !important;
}

body.bb-theme-v2.modal-open #bb-build-update-overlay {
  display: none !important;
}

/* BB_DESIGN_2026 | Sneat V2 — build update popup */
#bb-build-update-overlay.bb-sn-build-update-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.75rem, 2vw, 1.25rem);
  pointer-events: auto;
  font-family: inherit;
}

#bb-build-update-overlay .bb-sn-build-update-backdrop {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.62) 0%, rgba(67, 56, 202, 0.38) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: bbSnBuildUpdateFadeIn 0.35s ease;
}

#bb-build-update-overlay .bb-sn-build-update-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: min(540px, 96vw);
  animation: bbSnBuildUpdateSlideUp 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

#bb-build-update-overlay .bb-sn-build-update-card {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: #fff;
  box-shadow:
    0 24px 60px rgba(15, 23, 42, 0.28),
    0 0 0 1px rgba(105, 108, 255, 0.08);
}

#bb-build-update-overlay .bb-sn-build-update-card__glow {
  position: absolute;
  inset: -40% auto auto -15%;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(105, 108, 255, 0.28) 0%, transparent 68%);
  pointer-events: none;
}

#bb-build-update-overlay .bb-sn-build-update-card__header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.35rem 1.35rem 1.15rem;
  background: linear-gradient(135deg, #696cff 0%, #5a5de8 52%, #7b83ff 100%);
  color: #fff;
}

#bb-build-update-overlay .bb-sn-build-update-card__header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 1.65rem;
  flex-shrink: 0;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.18);
}

#bb-build-update-overlay .bb-sn-build-update-card__eyebrow {
  display: inline-block;
  margin-bottom: 0.35rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

#bb-build-update-overlay .bb-sn-build-update-card__title {
  margin: 0;
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  font-weight: 800;
  line-height: 1.25;
}

#bb-build-update-overlay .bb-sn-build-update-card__subtitle {
  margin: 0.4rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.88);
  max-width: 36ch;
}

#bb-build-update-overlay .bb-sn-build-update-card__body {
  position: relative;
  z-index: 1;
  padding: 1.15rem 1.35rem 0.5rem;
}

#bb-build-update-overlay .bb-sn-build-update-kpi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

#bb-build-update-overlay .bb-sn-build-update-kpi__item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0.65rem;
  border: 1px solid #e7e9ed;
  background: linear-gradient(180deg, #fafbff 0%, #f5f6fa 100%);
}

#bb-build-update-overlay .bb-sn-build-update-kpi__icon {
  font-size: 1.15rem;
  color: #696cff;
  line-height: 1;
}

#bb-build-update-overlay .bb-sn-build-update-kpi__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8592a3;
}

#bb-build-update-overlay .bb-sn-build-update-kpi__value {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #384551;
  word-break: break-word;
}

#bb-build-update-overlay .bb-sn-build-update-card__lead {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  line-height: 1.75;
  color: #566a7f;
}

#bb-build-update-overlay .bb-sn-build-update-callout {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0.65rem;
  font-size: 0.8125rem;
  line-height: 1.65;
}

#bb-build-update-overlay .bb-sn-build-update-callout--warn {
  background: linear-gradient(135deg, #fff8e6 0%, #fff3cd 100%);
  border: 1px solid rgba(255, 171, 0, 0.35);
  color: #7a5d00;
}

#bb-build-update-overlay .bb-sn-build-update-callout__icon {
  font-size: 1.25rem;
  color: #ffab00;
  flex-shrink: 0;
  margin-top: 0.05rem;
}

#bb-build-update-overlay .bb-sn-build-update-callout kbd {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 0.35rem;
  border: 1px solid rgba(122, 93, 0, 0.35);
  background: #fff;
  color: #5c4600 !important;
  font-size: 0.8125rem;
  font-weight: 800;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  box-shadow: 0 1px 0 rgba(122, 93, 0, 0.12), inset 0 -1px 0 rgba(122, 93, 0, 0.06);
  -webkit-text-fill-color: #5c4600;
}

#bb-build-update-overlay .bb-sn-build-update-card__footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  padding: 1rem 1.35rem 1.25rem;
  border-top: 1px solid #eef0f4;
  background: linear-gradient(180deg, #fff 0%, #f8f9fb 100%);
}

#bb-build-update-overlay .bb-sn-build-update-card__action {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 9.5rem;
  justify-content: center;
  border: 0;
  border-radius: 0.55rem;
  padding: 0.7rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #696cff 0%, #5a5de8 100%);
  box-shadow: 0 6px 18px rgba(105, 108, 255, 0.42);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#bb-build-update-overlay .bb-sn-build-update-card__action:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(105, 108, 255, 0.48);
}

#bb-build-update-overlay .bb-sn-build-update-card__action:active {
  transform: translateY(0);
}

@keyframes bbSnBuildUpdateFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes bbSnBuildUpdateSlideUp {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 575.98px) {
  #bb-build-update-overlay .bb-sn-build-update-card__header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  #bb-build-update-overlay .bb-sn-build-update-card__subtitle {
    max-width: none;
  }

  #bb-build-update-overlay .bb-sn-build-update-card__footer {
    justify-content: stretch;
  }

  #bb-build-update-overlay .bb-sn-build-update-card__action {
    width: 100%;
  }
}
