/* Global geometry for the body-mounted ngx-bootstrap status popover.
   Kept outside Angular component encapsulation so the legacy Bootstrap
   max-width can never clip the new deal-status dialog. */
.popover.nw-status-popover {
  position: fixed !important;
  inset: 50% auto auto 50% !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: translate(-50%, -50%) !important;
  border: 0 !important;
  border-radius: 14px !important;
  background: transparent !important;
  box-shadow: 0 0 0 100vmax rgba(20, 30, 45, 0.38) !important;
  z-index: 20000 !important;
}

.popover.nw-status-popover > .arrow,
.popover.nw-status-popover > .popover-arrow {
  display: none !important;
}

.popover.nw-status-popover > .popover-content,
.popover.nw-status-popover > .popover-body {
  width: auto !important;
  max-width: none !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.popover.nw-status-popover .nw-status-dialog {
  width: 680px !important;
  max-width: calc(100vw - 32px) !important;
  max-height: calc(100vh - 32px) !important;
}

/* Compact deal-status controls. This lives outside Angular encapsulation so
   cached component styles and legacy Bootstrap button rules cannot stretch
   the choices back to full-column cards. */
.popover.nw-status-popover .nw-status-dialog__head {
  height: 52px !important;
  padding: 0 18px !important;
}

.popover.nw-status-popover .nw-status-dialog__head h3 {
  margin: 0 !important;
  font-size: 20px !important;
}

.popover.nw-status-popover .nw-status-dialog__body {
  padding: 8px 12px !important;
}

.popover.nw-status-popover .nw-status-top-grid {
  display: grid !important;
  grid-template-columns: max-content max-content max-content !important;
  gap: 4px !important;
  justify-content: start !important;
}

.popover.nw-status-popover .nw-status-bottom-grid {
  display: grid !important;
  grid-template-columns: 220px minmax(300px, 1fr) !important;
  gap: 4px !important;
  margin-top: 8px !important;
  padding-top: 8px !important;
}

.popover.nw-status-popover .nw-status-section {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  padding: 0 4px !important;
}

.popover.nw-status-popover .nw-status-section:first-child {
  padding-left: 0 !important;
}

.popover.nw-status-popover .nw-status-section h4,
.popover.nw-status-popover .nw-status-comment h4 {
  margin: 0 0 4px !important;
  font-size: 15px !important;
}

.popover.nw-status-popover .nw-status-comment {
  padding-left: 0 !important;
}

.popover.nw-status-popover .nw-status-choice {
  display: inline-flex !important;
  flex: 0 0 36px !important;
  align-self: flex-start !important;
  align-items: center !important;
  gap: 6px !important;
  box-sizing: border-box !important;
  width: 180px !important;
  min-width: 0 !important;
  max-width: 180px !important;
  height: 36px !important;
  min-height: 36px !important;
  margin: 0 0 2px !important;
  padding: 0 11px !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  line-height: 1 !important;
}

.popover.nw-status-popover .nw-status-choice:last-child {
  margin-bottom: 0 !important;
}

/* Compatibility for the currently deployed template: keep the status button
   short and move its explanation below it. */
.popover.nw-status-popover .nw-status-choice--long b {
  display: none !important;
}

.popover.nw-status-popover .nw-status-choice--long::after {
  content: "Сорвалось";
}

.popover.nw-status-popover .nw-status-section--second::after {
  content: "Если клиент хотел взять, но не получилось, как станет актуальным опять предложим";
  display: block !important;
  max-width: 210px !important;
  margin-top: 3px !important;
  color: #8792a3 !important;
  font-size: 11px !important;
  line-height: 1.25 !important;
}

.popover.nw-status-popover .nw-status-choice span {
  flex: 0 0 24px !important;
  min-width: 24px !important;
  width: 24px !important;
  height: 24px !important;
  font-size: 16px !important;
}

.popover.nw-status-popover .nw-status-dialog button.nw-status-choice.deal-stage {
  color: #1766c8 !important;
  border-color: #8ab6f8 !important;
  background-color: #f4f8ff !important;
  background-image: none !important;
}

.popover.nw-status-popover .nw-status-dialog button.nw-status-choice.deal-stage.selected {
  color: #fff !important;
  border-color: #2275dd !important;
  background-color: #2f80ed !important;
  background-image: none !important;
  box-shadow: 0 2px 5px rgba(34, 117, 221, .2) !important;
}

.popover.nw-status-popover .nw-status-dialog button.nw-status-choice.deal-stage.selected b {
  color: #fff !important;
}

.popover.nw-status-popover .nw-status-dialog button.nw-status-choice.deal-stage.selected span {
  color: #1766c8 !important;
  background: #fff !important;
}

.popover.nw-status-popover .nw-status-comment textarea {
  box-sizing: border-box !important;
  height: 90px !important;
  min-height: 90px !important;
  font-size: 14px !important;
}

.popover.nw-status-popover .nw-status-dialog__footer {
  height: 56px !important;
  padding: 10px 18px !important;
}

.popover.nw-status-popover .nw-status-cancel,
.popover.nw-status-popover .nw-status-submit {
  height: 36px !important;
  min-height: 36px !important;
  font-size: 14px !important;
}

.popover.nw-status-popover .nw-status-cancel { width: 86px !important; }
.popover.nw-status-popover .nw-status-submit { width: 134px !important; }

@media (max-width: 760px) {
  .popover.nw-status-popover {
    width: calc(100vw - 20px) !important;
  }

  .popover.nw-status-popover .nw-status-dialog {
    width: 100% !important;
    max-width: none !important;
    max-height: calc(100vh - 20px) !important;
    overflow: auto !important;
  }

  .popover.nw-status-popover .nw-status-top-grid,
  .popover.nw-status-popover .nw-status-bottom-grid {
    display: block !important;
  }

  .popover.nw-status-popover .nw-status-section,
  .popover.nw-status-popover .nw-status-section:first-child,
  .popover.nw-status-popover .nw-status-comment {
    padding: 0 !important;
    border-right: 0 !important;
  }
}

/* Restored solid legacy status colours (2026-07-29).
   Keep every label visually centred, including the locked incoming-call item. */
.popover.nw-status-popover .nw-status-dialog button.nw-status-choice {
  position: relative !important;
  justify-content: center !important;
  text-align: center !important;
  font-family: SegoeUIBold, "Segoe UI", Arial, sans-serif !important;
  font-weight: 700 !important;
  color: #fff !important;
  background-image: none !important;
  filter: none !important;
}

.popover.nw-status-popover .nw-status-dialog button.nw-status-choice > i {
  position: absolute !important;
  right: 9px !important;
  margin: 0 !important;
  color: rgba(255, 255, 255, .9) !important;
  filter: none !important;
}

.popover.nw-status-popover .nw-status-dialog button.nw-status-choice span {
  color: #fff !important;
  background: rgba(255, 255, 255, .2) !important;
}

/* Status icons used to pull the label away from the real centre.  Only the
   numbered deal steps keep their marker. */
.popover.nw-status-popover .nw-status-dialog button.nw-status-choice:not(.deal-stage) span,
.popover.nw-status-popover .nw-status-dialog button.nw-status-choice:not(.deal-stage) > i {
  display: none !important;
}

.popover.nw-status-popover .nw-status-dialog button.nw-status-choice.interest,
.popover.nw-status-popover .nw-status-dialog button.nw-status-choice.proposed,
.popover.nw-status-popover .nw-status-dialog button.nw-status-choice.incoming {
  border-color: #d6a734 !important;
  color: #fff !important;
  background-color: #efbd4a !important;
}

.popover.nw-status-popover .nw-status-dialog button.nw-status-choice.actuality {
  border-color: #d78918 !important;
  color: #fff !important;
  background-color: #e99c2e !important;
}

.popover.nw-status-popover .nw-status-dialog button.nw-status-choice.failed,
.popover.nw-status-popover .nw-status-dialog button.nw-status-choice.refusal,
.popover.nw-status-popover .nw-status-dialog button.nw-status-choice.manager-refusal,
.popover.nw-status-popover .nw-status-dialog button.nw-status-choice.nw-status-choice--long {
  border-color: #a84743 !important;
  color: #fff !important;
  background-color: #be5450 !important;
}

.popover.nw-status-popover .nw-status-dialog button.nw-status-choice.deal-stage {
  border-color: #2586bd !important;
  color: #fff !important;
  background-color: #2d9ad9 !important;
  padding-right: 34px !important;
  padding-left: 34px !important;
}

.popover.nw-status-popover .nw-status-dialog button.nw-status-choice.deal-stage span {
  position: absolute !important;
  left: 8px !important;
  color: #267fae !important;
  background: #fff !important;
}

.popover.nw-status-popover .nw-status-dialog button.nw-status-choice.deal-stage.selected {
  border-color: #2076a7 !important;
  color: #fff !important;
  background-color: #2486bf !important;
  box-shadow: 0 2px 5px rgba(34, 117, 221, .24) !important;
}

.popover.nw-status-popover .nw-status-dialog .nw-status-section--deal button.nw-status-choice.deal-stage:nth-of-type(3),
.popover.nw-status-popover .nw-status-dialog .nw-status-section--stages button.nw-status-choice.deal-stage:nth-of-type(3) {
  border-color: #6aa050 !important;
  color: #fff !important;
  background-color: #7eb762 !important;
}

.popover.nw-status-popover .nw-status-dialog .nw-status-section--deal button.nw-status-choice.deal-stage:nth-of-type(3).selected,
.popover.nw-status-popover .nw-status-dialog .nw-status-section--stages button.nw-status-choice.deal-stage:nth-of-type(3).selected {
  border-color: #588e40 !important;
  background-color: #6aa050 !important;
}

.popover.nw-status-popover .nw-status-dialog button.nw-status-choice.actuality--requested {
  border-color: #c87a08 !important;
  background-color: #e89212 !important;
}

.popover.nw-status-popover .nw-status-dialog button.nw-status-choice.actuality--actual {
  border-color: #20934f !important;
  background-color: #27ae60 !important;
}

.popover.nw-status-popover .nw-status-dialog button.nw-status-choice.actuality--not-actual {
  border-color: #dc4f4a !important;
  background-color: #ec5f5a !important;
}

.popover.nw-status-popover .nw-status-dialog button.nw-status-choice:disabled {
  opacity: .62 !important;
  filter: none !important;
}

.popover.nw-status-popover .nw-status-dialog button.nw-status-choice.incoming:disabled {
  opacity: 1 !important;
  color: #fff !important;
  background-color: #efbd4a !important;
}

.popover.nw-status-popover .nw-status-dialog button.nw-status-choice.selected {
  font-weight: 700 !important;
  filter: brightness(.92) !important;
}
