/* Deal status dialog.  The popover is mounted under <body>, so these rules
   intentionally live outside Angular component encapsulation. */
.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, .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: 570px !important;
  max-width: calc(100vw - 32px) !important;
  max-height: calc(100vh - 32px) !important;
  overflow: hidden !important;
  color: #162238 !important;
  background: #fff !important;
  border: 1px solid #dfe5ed !important;
  border-radius: 14px !important;
  box-shadow: 0 18px 55px rgba(25, 42, 70, .22) !important;
  font-family: Arial, sans-serif !important;
}

.popover.nw-status-popover .nw-status-dialog__head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  height: 58px !important;
  padding: 0 24px !important;
  border-bottom: 1px solid #e2e7ee !important;
}

.popover.nw-status-popover .nw-status-dialog__head h3 {
  margin: 0 !important;
  color: #101b30 !important;
  font-size: 26px !important;
  line-height: 1.15 !important;
  font-weight: 700 !important;
}

.popover.nw-status-popover .nw-status-close {
  border: 0 !important;
  padding: 0 !important;
  color: #697589 !important;
  background: transparent !important;
  font-size: 32px !important;
  line-height: 1 !important;
}

.popover.nw-status-popover .nw-status-dialog__body {
  max-height: calc(100vh - 142px) !important;
  overflow-y: auto !important;
  padding: 0 24px 10px !important;
}

.popover.nw-status-popover .nw-status-actuality-bar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 18px !important;
  min-height: 50px !important;
  margin: 0 0 10px !important;
  border-bottom: 1px solid #e2e7ee !important;
}

.popover.nw-status-popover .nw-status-actuality-bar__text {
  display: flex !important;
  align-items: center !important;
  min-width: 0 !important;
  gap: 10px !important;
  color: #657186 !important;
  font-size: 16px !important;
  line-height: 1.25 !important;
}

.popover.nw-status-popover .nw-status-actuality-bar__text i {
  flex: 0 0 auto !important;
  color: #718098 !important;
  font-size: 23px !important;
}

.popover.nw-status-popover .nw-status-actuality-bar__text u {
  color: #4f5d72 !important;
  text-decoration-color: #9ba6b6 !important;
  text-underline-offset: 3px !important;
}

.popover.nw-status-popover .nw-status-actuality-confirm {
  flex: 0 0 auto !important;
  height: 34px !important;
  padding: 0 16px !important;
  border: 1px solid #27ae60 !important;
  border-radius: 6px !important;
  color: #249c57 !important;
  background: #fff !important;
  font-size: 14px !important;
  line-height: 32px !important;
  font-weight: 600 !important;
}

.popover.nw-status-popover .nw-status-actuality-confirm:disabled {
  opacity: .5 !important;
  cursor: not-allowed !important;
}

.popover.nw-status-popover .nw-status-actuality-bar--confirmed .nw-status-actuality-bar__text,
.popover.nw-status-popover .nw-status-actuality-bar--confirmed .nw-status-actuality-bar__text i,
.popover.nw-status-popover .nw-status-actuality-bar--confirmed .nw-status-actuality-bar__text u {
  color: #209653 !important;
}

.popover.nw-status-popover .nw-status-actuality-bar--confirmed .nw-status-actuality-confirm:disabled {
  opacity: 1 !important;
  color: #209653 !important;
  border-color: #72c995 !important;
  background: #f2fbf6 !important;
}

.popover.nw-status-popover .nw-status-top-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 150px) !important;
  justify-content: space-between !important;
  gap: 12px !important;
}

.popover.nw-status-popover .nw-status-bottom-grid {
  display: grid !important;
  grid-template-columns: 150px minmax(0, 1fr) !important;
  align-items: start !important;
  gap: 12px !important;
  margin-top: 8px !important;
  padding-top: 8px !important;
  border-top: 1px solid #dfe4eb !important;
}

.popover.nw-status-popover .nw-status-section {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  padding: 0 10px !important;
  border-right: 1px solid #e1e6ed !important;
}

.popover.nw-status-popover .nw-status-section:first-child { padding-left: 0 !important; }
.popover.nw-status-popover .nw-status-section:last-child { padding-right: 0 !important; border-right: 0 !important; }
.popover.nw-status-popover .nw-status-bottom-grid .nw-status-section {
  align-self: start !important;
  padding: 0 10px 0 0 !important;
}

.popover.nw-status-popover .nw-status-section h4,
.popover.nw-status-popover .nw-status-comment h4 {
  margin: 0 0 6px !important;
  border: 0 !important;
  color: #172238 !important;
  font-size: 16px !important;
  line-height: 1.2 !important;
  font-weight: 700 !important;
}

.popover.nw-status-popover .nw-status-comment { min-width: 0 !important; padding: 0 !important; }
.popover.nw-status-popover .nw-status-comment h4 small { color: #7c8799 !important; font-size: 14px !important; font-weight: 400 !important; }

/* Status choices deliberately match the legacy “Предложено / Не предложено”
   buttons from the selection table. */
.popover.nw-status-popover .nw-status-dialog button.nw-status-choice {
  position: relative !important;
  display: inline-flex !important;
  flex: 0 0 32px !important;
  align-self: flex-start !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  width: 116px !important;
  min-width: 116px !important;
  max-width: 116px !important;
  height: 32px !important;
  min-height: 32px !important;
  margin: 0 0 6px !important;
  padding: 0 5px !important;
  border-width: 1px !important;
  border-style: solid !important;
  border-radius: 4px !important;
  color: #fff !important;
  background-image: none !important;
  font-family: Arial, sans-serif !important;
  font-size: 13px !important;
  line-height: 30px !important;
  font-weight: 400 !important;
  text-align: center !important;
  white-space: nowrap !important;
  filter: none !important;
}

.popover.nw-status-popover .nw-status-dialog button.nw-status-choice:last-of-type { margin-bottom: 0 !important; }
.popover.nw-status-popover .nw-status-dialog button.nw-status-choice span,
.popover.nw-status-popover .nw-status-dialog button.nw-status-choice > i { display: none !important; }

/* The production Angular bundle still contains the old long label inside <b>.
   Keep the visible control identical to the compact selection-table status. */
.popover.nw-status-popover .nw-status-dialog button.nw-status-choice.failed > b { display: none !important; }
.popover.nw-status-popover .nw-status-dialog button.nw-status-choice.failed::after { content: "Сорвалось" !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;
  background-color: #efbd4a !important;
}

.popover.nw-status-popover .nw-status-dialog button.nw-status-choice.actuality {
  border-color: #d78918 !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;
  background-color: #be5450 !important;
}

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

.popover.nw-status-popover .nw-status-dialog .nw-status-section--deal button.nw-status-choice.deal-stage:nth-of-type(3) {
  border-color: #6aa050 !important;
  background-color: #7eb762 !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.selected {
  font-weight: 400 !important;
  filter: brightness(.9) !important;
  box-shadow: 0 0 0 2px rgba(22, 34, 56, .13) !important;
}

.popover.nw-status-popover .nw-status-dialog button.nw-status-choice:disabled { opacity: .62 !important; cursor: not-allowed !important; }
.popover.nw-status-popover .nw-status-dialog button.nw-status-choice.incoming:disabled { opacity: 1 !important; }

.popover.nw-status-popover .nw-status-failed-note,
.popover.nw-status-popover .nw-status-section--second::after {
  display: block !important;
  max-width: 220px !important;
  margin-top: 3px !important;
  color: #8792a3 !important;
  font-size: 11px !important;
  line-height: 1.35 !important;
}

.popover.nw-status-popover .nw-status-section--second::after {
  content: "Если клиент хотел взять, но не получилось, как станет актуальным опять предложим" !important;
}

.popover.nw-status-popover .nw-status-section--deal { position: relative !important; }
.popover.nw-status-popover .nw-status-section--deal::before {
  display: none !important;
  content: none !important;
}
.popover.nw-status-popover .nw-status-section--deal h4,
.popover.nw-status-popover .nw-status-section--deal button { position: relative !important; z-index: 1 !important; }

.popover.nw-status-popover .nw-status-comment__field { position: relative !important; }
.popover.nw-status-popover .nw-status-comment textarea {
  box-sizing: border-box !important;
  width: 100% !important;
  height: 100px !important;
  min-height: 100px !important;
  max-height: 150px !important;
  resize: vertical !important;
  padding: 12px 14px 30px !important;
  border: 1px solid #cfd6e2 !important;
  border-radius: 8px !important;
  outline: none !important;
  font-family: Arial, sans-serif !important;
  font-size: 14px !important;
}
.popover.nw-status-popover .nw-status-comment textarea:focus { border-color: #74a7f7 !important; box-shadow: 0 0 0 2px rgba(38, 112, 255, .1) !important; }
.popover.nw-status-popover .nw-status-comment__counter { position: absolute !important; right: 14px !important; bottom: 10px !important; color: #7a8597 !important; font-size: 12px !important; }

.popover.nw-status-popover .nw-status-comment__actions {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  min-height: 25px !important;
  margin-top: 3px !important;
}
.popover.nw-status-popover .nw-status-mention,
.popover.nw-status-popover .nw-status-deal-link {
  display: inline-flex !important;
  align-items: center !important;
  min-width: 0 !important;
  padding: 3px 5px !important;
  border: 0 !important;
  color: #1766c8 !important;
  background: transparent !important;
  font-size: 12px !important;
  line-height: 1.25 !important;
  text-decoration: none !important;
  cursor: pointer !important;
}
.popover.nw-status-popover .nw-status-mention { max-width: 58% !important; overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; }
.popover.nw-status-popover .nw-status-deal-link { margin-left: auto !important; font-weight: 600 !important; }

.popover.nw-status-popover .nw-status-dialog__footer {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  height: 60px !important;
  padding: 10px 24px !important;
  border-top: 1px solid #e3e7ed !important;
}
.popover.nw-status-popover .nw-status-cancel,
.popover.nw-status-popover .nw-status-submit {
  height: 36px !important;
  min-height: 36px !important;
  border-radius: 7px !important;
  font-family: Arial, sans-serif !important;
  font-size: 14px !important;
  font-weight: 600 !important;
}
.popover.nw-status-popover .nw-status-cancel { width: 86px !important; border: 0 !important; color: #536174 !important; background: transparent !important; }
.popover.nw-status-popover .nw-status-submit { width: 134px !important; border: 1px solid #1266ed !important; color: #fff !important; background: #1266ed !important; }
.popover.nw-status-popover .nw-status-submit:disabled { opacity: .45 !important; cursor: not-allowed !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-dialog__head { height: 54px !important; padding: 0 16px !important; }
  .popover.nw-status-popover .nw-status-dialog__head h3 { font-size: 20px !important; }
  .popover.nw-status-popover .nw-status-dialog__body { padding: 0 16px 12px !important; }
  .popover.nw-status-popover .nw-status-actuality-bar { align-items: flex-start !important; flex-direction: column !important; gap: 8px !important; padding: 12px 0 !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-bottom-grid .nw-status-section,
  .popover.nw-status-popover .nw-status-comment { padding: 0 !important; border-right: 0 !important; }
  .popover.nw-status-popover .nw-status-section { margin-bottom: 16px !important; }
  .popover.nw-status-popover .nw-status-section--deal::before { display: none !important; }
  .popover.nw-status-popover .nw-status-comment textarea { height: 110px !important; min-height: 110px !important; }
  .popover.nw-status-popover .nw-status-dialog__footer { position: sticky !important; bottom: 0 !important; padding: 10px 16px !important; background: #fff !important; }
}


/* NW 2026-07-31: убрать соединительные чёрточки между этапами сделки */
.popover.nw-status-popover .nw-status-section--deal button.nw-status-choice.deal-stage::before,
.popover.nw-status-popover .nw-status-section--deal button.nw-status-choice.deal-stage::after,
.popover.nw-status-popover .nw-status-section--deal h4::before,
.popover.nw-status-popover .nw-status-section--deal h4::after {
  display: none !important;
  content: none !important;
}


/* NW 2026-07-31: тумблер «Не покупает бизнес» в фильтрах выборки */
.nw-biz-toggle{display:flex;align-items:center;gap:8px;cursor:pointer;font-size:12px;color:#5c6674;font-weight:400;margin:6px 0 0;user-select:none}
.nw-biz-toggle__switch{position:relative;display:inline-block;width:34px;height:20px;flex:0 0 34px;border-radius:10px;background:#c9d2de;transition:background .15s ease}
.nw-biz-toggle__switch input{position:absolute;opacity:0;width:100%;height:100%;margin:0;cursor:pointer}
.nw-biz-toggle__switch::after{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.25);transition:left .15s ease;pointer-events:none}
.nw-biz-toggle__switch--on{background:#5cb85c}
.nw-biz-toggle__switch--on::after{left:16px}
.nw-biz-toggle__text{line-height:1.2;white-space:normal}


/* NW 2026-07-31: зелёная плашка свежей актуализации (<14 дней) */
.object-life__overdue--fresh{background:#e8f7ee !important;border-color:#bfe5c8 !important;color:#1f7a3d !important}
.object-life__overdue--fresh i{color:#2e9e54 !important}
.object-life__overdue--fresh strong{color:#1f7a3d !important}


/* NW 2026-07-31: изменения события в одну строку, без раскрывашки */
.life-event__changes{display:flex !important;flex-wrap:wrap;align-items:center;gap:4px 10px;margin:2px 0 0 !important;padding:0 !important;border:none !important;background:transparent !important}
.life-event__changes > *{display:inline-flex !important;align-items:center;gap:4px;margin:0 !important;padding:0 !important;border:none !important}
.life-event__changes strong,.life-event__changes b{font-size:12px !important}
