/* Локальный рабочий слой раздела «Сметы».
 * Подключается root из app-api.html; общие стили приложения здесь не переопределяем. */

.estimate-registry-workspace {
  display: grid;
  gap: 12px;
}

.estimate-registry-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.estimate-registry-toolbar .est-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
}

.estimate-registry-search {
  display: grid;
  grid-template-columns: max-content minmax(230px, 360px) max-content max-content;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.estimate-registry-search label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.estimate-registry-search input {
  min-width: 0;
  height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
}

.estimate-registry-search input:focus {
  border-color: var(--green);
  outline: 2px solid rgba(33, 115, 70, .13);
  outline-offset: 0;
}

#estimate-registry-reset:not(.is-visible) {
  visibility: hidden;
  pointer-events: none;
}

#estimate-registry-count {
  min-width: 112px;
  text-align: right;
  white-space: nowrap;
}

.estimate-registry-table {
  width: 100%;
  table-layout: fixed;
}

.estimate-registry-table th:nth-child(1) { width: 31%; }
.estimate-registry-table th:nth-child(2) { width: 29%; }
.estimate-registry-table th:nth-child(3) { width: 15%; }
.estimate-registry-table th:nth-child(4),
.estimate-registry-table th:nth-child(5) { width: 12.5%; }

.estimate-registry-row[hidden],
#estimate-registry-empty[hidden] {
  display: none;
}

.estimate-registry-row:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: -2px;
  background: var(--selected-bg);
}

.estimate-registry-title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.estimate-registry-title > b,
.estimate-registry-context > div {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.estimate-registry-title > b {
  min-width: 0;
  font-weight: 650;
}

.estimate-registry-title .est-kind {
  flex: 0 0 auto;
}

.estimate-registry-context {
  min-width: 0;
}

.estimate-registry-table td.num {
  white-space: nowrap;
}

.estimate-modal-advanced {
  margin-top: 12px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.estimate-modal-advanced summary {
  cursor: pointer;
  color: var(--green-d);
  font-size: 13px;
  font-weight: 650;
}

.estimate-modal-advanced[open] summary {
  margin-bottom: 8px;
}

.construction-act-preview-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 8px;
}

.construction-act-preview-head span {
  color: var(--green-d);
  font-weight: 700;
  white-space: nowrap;
}

.construction-act-preview-table {
  max-height: 300px;
  margin-bottom: 8px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.construction-act-preview-table table {
  table-layout: fixed;
}

.construction-act-preview-table th:first-child { width: auto; }
.construction-act-preview-table th:not(:first-child) { width: 120px; }
.construction-act-preview-table td:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1120px) {
  .estimate-registry-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .estimate-registry-search {
    grid-template-columns: max-content minmax(220px, 1fr) max-content max-content;
  }
}

@media (max-width: 760px) {
  .estimate-registry-search {
    grid-template-columns: 1fr max-content;
  }

  .estimate-registry-search label,
  #estimate-registry-count {
    grid-column: 1 / -1;
    min-width: 0;
    text-align: left;
  }

  .estimate-registry-table th:nth-child(2),
  .estimate-registry-table td:nth-child(2) {
    display: none;
  }

  .estimate-registry-table th:nth-child(1) { width: 40%; }
  .estimate-registry-table th:nth-child(3) { width: 20%; }
  .estimate-registry-table th:nth-child(4),
  .estimate-registry-table th:nth-child(5) { width: 20%; }
}

.estimate-workflow {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid #cfd9e5;
  border-radius: 10px;
  background: #fff;
}

.estimate-workflow-top,
.estimate-workflow-actions,
.estimate-dependencies-head,
.estimate-execution-head,
.estimate-execution-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.estimate-workflow-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(92px, 1fr));
  flex: 1 1 auto;
  min-width: 0;
}

.estimate-workflow-steps > span {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding-right: 10px;
  color: #778394;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.estimate-workflow-steps > span:not(:last-child)::after {
  width: 100%;
  height: 1px;
  margin-left: 2px;
  background: #dce3eb;
  content: '';
}

.estimate-workflow-steps i {
  display: inline-grid;
  place-items: center;
  flex: 0 0 24px;
  height: 24px;
  border: 1px solid #ccd6e1;
  border-radius: 50%;
  background: #f7f9fb;
  color: #607083;
  font-style: normal;
  font-size: 11px;
}

.estimate-workflow-steps .is-done,
.estimate-workflow-steps .is-current {
  color: var(--green-d);
}

.estimate-workflow-steps .is-done i {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.estimate-workflow-steps .is-current i {
  border: 2px solid var(--green);
  background: #fff;
  color: var(--green-d);
}

.estimate-launch-mode {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f5f7fa;
}

.estimate-launch-mode button {
  min-height: 30px;
  padding: 5px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.estimate-launch-mode button.active {
  background: #fff;
  box-shadow: 0 1px 3px rgba(31, 48, 68, .12);
  color: var(--green-d);
}

.estimate-workflow-state {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 9px;
  border: 1px solid #a9cfb9;
  border-radius: 999px;
  background: #edf8f1;
  color: var(--green-d);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.estimate-readiness-body {
  display: grid;
  grid-template-columns: minmax(210px, .45fr) minmax(340px, 1fr);
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid #edf0f4;
}

.estimate-readiness-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(90px, 1fr));
  gap: 6px;
  align-content: start;
}

.estimate-readiness-stats span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid #e2e7ed;
  border-radius: 7px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
}

.estimate-readiness-stats b { color: var(--text); }

.estimate-readiness-group {
  display: grid;
  gap: 5px;
}

.estimate-readiness-group > b {
  font-size: 12px;
}

.estimate-readiness-group ul,
.estimate-attention-list {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.estimate-readiness-issue {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  padding: 7px 8px;
  border-radius: 7px;
  font-size: 12px;
}

.estimate-readiness-issue > span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-weight: 800;
}

.estimate-readiness-issue--blocker { background: #fff1f0; }
.estimate-readiness-issue--blocker > span { background: #d94747; color: #fff; }
.estimate-readiness-issue--warning { background: #fff8e6; }
.estimate-readiness-issue--warning > span { background: #d99518; color: #fff; }

.estimate-readiness-detail {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.estimate-readiness-loading,
.estimate-readiness-error,
.estimate-readiness-ok {
  min-height: 38px;
  padding: 9px 11px;
  border-radius: 7px;
  font-size: 12px;
}

.estimate-readiness-loading { background: #f5f7fa; color: var(--muted); }
.estimate-readiness-error { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fff1f0; color: #9c2727; }
.estimate-readiness-ok { background: #edf8f1; color: var(--green-d); }

.estimate-workflow-actions {
  min-height: 34px;
  padding-top: 9px;
  border-top: 1px solid #edf0f4;
}

.estimate-workflow-actions > span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.estimate-launch-warning {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 11px;
  border: 1px solid #ead8a9;
  border-radius: 8px;
  background: #fffaf0;
}

.estimate-launch-warning-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

.estimate-launch-warning-title span { color: var(--muted); white-space: nowrap; }

.estimate-dependencies {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.estimate-dependencies h3,
.estimate-execution h3 {
  margin: 0;
  font-size: 14px;
}

.estimate-dependencies-head p,
.estimate-execution-head p,
.estimate-execution-panel p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.estimate-dependencies-head > span,
.estimate-execution-panel-head > span {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border-radius: 999px;
  background: #eef2f6;
  color: #526172;
  font-size: 11px;
  font-weight: 700;
}

.estimate-dependency-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(115px, max-content) minmax(180px, 1fr) 28px;
  gap: 9px;
  align-items: center;
  min-height: 40px;
  padding: 6px 8px;
  border: 1px solid #e4e9ef;
  border-radius: 7px;
}

.estimate-dependency-work {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.estimate-dependency-kind {
  display: grid;
  justify-items: center;
  color: var(--green-d);
  font-size: 11px;
  white-space: nowrap;
}

.estimate-dependency-kind small { color: var(--muted); font-size: 10px; }
.estimate-dependency-empty { padding: 9px 10px; border-radius: 7px; background: #f7f9fb; color: var(--muted); font-size: 12px; }

.estimate-dependency-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.25fr) minmax(135px, .7fr) 85px 120px minmax(180px, 1.25fr) max-content;
  gap: 8px;
  align-items: end;
  padding-top: 9px;
  border-top: 1px solid #edf0f4;
}

.estimate-dependency-form .field { min-width: 0; }
.estimate-dependency-form select,
.estimate-dependency-form input { width: 100%; min-width: 0; }

.estimate-execution {
  display: grid;
  gap: 12px;
}

.estimate-execution-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.estimate-execution-flow {
  display: grid;
  grid-template-columns: repeat(6, minmax(125px, 1fr));
  gap: 7px;
}

.estimate-execution-step {
  position: relative;
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid #dbe2e9;
  border-radius: 8px;
  background: #fff;
}

.estimate-execution-step:not(:last-child)::after {
  position: absolute;
  z-index: 1;
  top: 50%;
  right: -8px;
  width: 8px;
  height: 1px;
  background: #aeb9c5;
  content: '';
}

.estimate-execution-step > span { color: var(--muted); font-size: 11px; font-weight: 650; }
.estimate-execution-step > b { overflow: hidden; color: var(--text); font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.estimate-execution-step > small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.estimate-execution-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.estimate-execution-panel {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.estimate-attention-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 7px 8px;
  border-radius: 6px;
  background: #fff5e8;
  color: #86520c;
  font-size: 12px;
}

.estimate-execution-stages,
.estimate-execution-procurement { table-layout: fixed; }
.estimate-execution-stages th:first-child { width: 24%; }
.estimate-execution-stages th:nth-child(2) { width: 13%; }
.estimate-execution-stages th:nth-child(3) { width: 17%; }
.estimate-execution-stages th:nth-child(4) { width: 18%; }
.estimate-execution-stages th:nth-child(5),
.estimate-execution-stages th:nth-child(6) { width: 14%; }
.estimate-execution-procurement th:first-child { width: 36%; }
.estimate-execution-procurement th:nth-child(2) { width: 16%; }
.estimate-execution-procurement th:nth-child(3) { width: 29%; }
.estimate-execution-procurement th:nth-child(4) { width: 19%; }

.constr-act-stage-label,
.estimate-execution .cat-op-name small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.estimate-close-confirm {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 12px;
  padding: 10px 11px;
  border: 1px solid #d8e0e8;
  border-radius: 8px;
  background: #f7f9fb;
  cursor: pointer;
  font-size: 12px;
}

.estimate-close-confirm input { margin-top: 2px; }

.estimate-close-readiness {
  display: grid;
  gap: 5px;
  margin-top: 9px;
  padding: 9px 10px;
  border: 1px solid #d8e0e8;
  border-radius: 7px;
  font-size: 11px;
}

.estimate-close-readiness.is-ready {
  border-color: #b9ddc6;
  background: #f1faf4;
  color: #1f6b3a;
}

.estimate-close-readiness.is-blocked {
  border-color: #efd29e;
  background: #fff9ed;
  color: #7c4b08;
}

.estimate-close-readiness.is-waivable {
  border-color: #c9b8eb;
  background: #f7f3ff;
  color: #5d3c91;
}

.estimate-close-readiness ul {
  display: grid;
  gap: 3px;
  margin: 0;
  padding-left: 17px;
}

.constr-entry--reversal {
  border-color: #efd0a0;
  background: #fff8ec;
}

.constr-entries {
  max-height: 360px;
  overflow: auto;
  padding-right: 3px;
}

.constr-entry--reversed {
  opacity: .68;
  background: #f7f8fa;
}

.constr-entry-kind { flex: 0 0 auto; }

.constr-act-row--reversal > td { background: #fff8ec; }
.constr-act-row--reversed > td { background: #f7f8fa; }

.constr-act-state {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.constr-act-event--reversal {
  border-color: #e9c989;
  background: #fff2d8;
  color: #7a4b08;
}

.constr-act-event--reversed {
  border-color: #cfd6de;
  background: #eef1f4;
  color: #5a6572;
}

.constr-act-reversal-note {
  display: block;
  max-width: 100%;
  margin-top: 3px;
  overflow: hidden;
  color: #7a4b08;
  font-size: 10px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.constr-act-reverse-btn {
  border-color: #d9b875;
  color: #7a4b08;
}

.constr-act-reverse-summary {
  margin-bottom: 10px;
  padding: 9px 10px;
  border: 1px solid #d8e0e8;
  border-radius: 7px;
  background: #f7f9fb;
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
}

.constr-progress-overrun {
  padding: 9px 10px;
  border: 1px solid #efd29e;
  border-radius: 7px;
  background: #fff9ed;
}

.constr-progress-overrun small {
  display: block;
  margin-top: 4px;
  color: #7c4b08;
  line-height: 1.35;
}

@media (max-width: 1180px) {
  .estimate-workflow-top { align-items: stretch; flex-direction: column; }
  .estimate-launch-mode { align-self: flex-start; }
  .estimate-dependency-form { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
  .estimate-dependency-form .btn { align-self: end; }
  .estimate-execution-flow { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
}

@media (max-width: 760px) {
  .estimate-workflow-steps { grid-template-columns: 1fr; gap: 5px; }
  .estimate-workflow-steps > span:not(:last-child)::after { display: none; }
  .estimate-readiness-body,
  .estimate-execution-grid { grid-template-columns: 1fr; }
  .estimate-workflow-actions,
  .estimate-execution-head { align-items: stretch; flex-direction: column; }
  .estimate-dependency-row { grid-template-columns: 1fr max-content; }
  .estimate-dependency-kind { grid-column: 1; justify-items: start; }
  .estimate-dependency-row .cat-mini-btn { grid-column: 2; grid-row: 1 / span 2; }
  .estimate-dependency-form { grid-template-columns: 1fr; }
  .estimate-execution-flow { grid-template-columns: 1fr 1fr; }
}

/* Группа однотипных блокеров готовности: заголовок со счётчиком и одно действие на всю группу. */
.estimate-readiness-grouped { display: grid; gap: 3px; min-width: 0; }
.estimate-readiness-grouped-head {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}
.estimate-readiness-grouped-head .btn { flex: none; white-space: nowrap; }

/* Название сущности в блокере — переход к её строке в «Составе». */
.estimate-readiness-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--green-d);
  font: inherit;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
  cursor: pointer;
}
.estimate-readiness-link:hover { text-decoration-style: solid; }

/* Куда именно привёл переход: подсветка гаснет сама. */
.est-row-focused > td {
  background: #FEF3C7 !important;
  transition: background .5s ease;
}

/* Раскладка себестоимости по категориям ресурсов (маршруты затрат). */
.est-mix {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
.est-mix-cell {
  display: grid;
  gap: 1px;
  flex: 1 1 150px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.est-mix-cell > span { font-size: 11px; color: var(--muted); }
.est-mix-cell > span i { font-style: normal; opacity: .75; }
.est-mix-cell > b { font-size: 14px; }
.est-mix-cell > small { font-size: 11px; color: var(--muted); }

/* Просроченная работа на графике: срок прошёл, а работа не закрыта. */
.gantt-bar--overdue { background: #DC2626; box-shadow: 0 1px 3px rgba(220, 38, 38, .3); }
.gantt-bar--overdue .gantt-done { background: rgba(0, 0, 0, .3); }

/* Просрочка в таблице работ «Стройки». */
.est-work-overdue { color: #B91C1C; font-weight: 700; }

/* Поиск и сворачивание внутри дерева сметы. */
.est-tree-toolbar { flex-wrap: wrap; gap: 8px; }
.est-tree-toolbar input[type="search"] { flex: 1 1 220px; min-width: 160px; }
/* слот кнопки сброса зарезервирован — панель не «дёргается» при вводе */
#est-tree-reset { visibility: hidden; pointer-events: none; }
#est-tree-reset.is-visible { visibility: visible; pointer-events: auto; }
#est-tree-count { margin-left: auto; white-space: nowrap; }

/* Правка значения прямо в строке дерева. */
.est-inline { cursor: text; }
.est-inline:hover { background: var(--selected-bg); }
.est-inline-input {
  width: 100%;
  min-width: 60px;
  padding: 1px 4px;
  border: 1px solid var(--green);
  border-radius: 4px;
  font: inherit;
  text-align: right;
}
.est-inline-saving { opacity: .55; }
.est-inline-saved { animation: est-inline-flash 1.6s ease-out; }
@keyframes est-inline-flash {
  from { background: #DCFCE7; }
  to { background: transparent; }
}

/* Пикер расценок: список с чекбоксами и количеством, добавление пачкой. */
.est-res-pick-body { max-height: 46vh; overflow: auto; margin-top: 8px; }
.est-res-pick-table { width: 100%; }
.est-res-pick-table td { vertical-align: middle; }
.est-res-pick-table tr[hidden] { display: none; }
.est-res-pick-qty { width: 92px; }
.est-res-pick-qty:disabled { background: var(--selected-bg); }
.est-res-pick-link { margin-top: 6px; }

/* Предпросмотр разбора xlsx-сметы до записи. */
.est-import-stats { margin-bottom: 8px; }
.est-import-warnings { margin: 0 0 8px; padding: 0; list-style: none; display: grid; gap: 5px; }
.est-import-table { width: 100%; }
.est-import-table td, .est-import-table th { vertical-align: top; }

/* Таблица «раздел сметы → этап договора» в модалке назначения. */
.est-stage-plan-table { width: 100%; margin-top: 8px; }
.est-stage-plan-table td { vertical-align: top; }
.est-stage-plan-table select { width: 100%; }

/* Ручная цена работы, не раскрытая ресурсами. Тихая пометка: суммы сметы не меняются,
   она лишь показывает, что часть введённой вручную цены в итог не попала. */
.est-unallocated { background: #FEF3C7; color: #92400E; white-space: nowrap; }

/* Предупреждение о пересчёте состава при смене количества работы. */
.est-scale-notice { margin-top: 10px; padding: 9px 11px; border: 1px solid #FDE68A; border-radius: 8px; background: #FFFBEB; }
.est-scale-notice label { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; font-weight: 600; color: #92400E; }
.est-scale-notice input { margin-top: 2px; }
.est-scale-preview { margin-top: 6px; font-size: 12px; color: #6B7280; line-height: 1.45; }

/* Путь «раздел · работа» в таблице снабжения вкладки «Исполнение» — как в реестре Снабжение. */
.estimate-execution-path { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Тихое объяснение, почему на «Составе» нет кнопок редактирования. */
.est-locked-note { margin: 0 0 10px; padding: 8px 12px; border: 1px solid #e2e8f0; border-left: 3px solid #94a3b8; border-radius: 8px; background: #f8fafc; color: #475569; font-size: 12px; }

/* Разрезы раскладки по категориям: ячейка кликабельна, выбранная подсвечена,
   ниже — таблица строк категории или маршрута («Снабжение/Стройка. Детализация»). */
.est-mix-cell { cursor: pointer; }
.est-mix-cell:hover { border-color: #86efac; }
.est-mix-cell.is-active { border-color: var(--green); background: #f0fdf4; }
.est-mix-cell--route > span { color: var(--green-d); font-weight: 600; }
.est-mix-detail { margin: 8px 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); }
.est-mix-detail-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.est-mix-detail-head span { font-size: 12px; color: var(--muted); flex: 1; }
.est-mix-detail .table-wrap { max-height: 320px; overflow-y: auto; }

/* Ответственная бригада работы: бейдж в дереве, клик открывает назначение. */
.est-brigade { background: #eef2ff; color: #4338ca; border-color: #c7d2fe; cursor: pointer; }
.est-brigade:hover { border-color: #818cf8; }

/* Анализ цен: панель сводки и бейджи расхождений (смета ↔ справочник «Расценки» ↔ закупки). */
.est-price-panel { margin: 0 0 12px; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; }
.est-price-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.est-price-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.est-price-tiles { margin: 10px 0 0; }
.est-price-oddments { margin-top: 6px; }
/* Плитка-фильтр: клик показывает в дереве только строки её статуса. */
.est-price-tiles .est-econ-cell.est-price-cell--click { cursor: pointer; }
.est-price-tiles .est-econ-cell.est-price-cell--click:hover { box-shadow: inset 0 0 0 1px #cbd5e1; border-radius: 8px; }
.est-price-tiles .est-econ-cell.is-active { box-shadow: inset 0 0 0 2px #16A34A; border-radius: 8px; }
.est-econ-cell.est-price-cell--risk b { color: #B91C1C; }
.est-econ-cell.est-price-cell--warn b { color: #92400E; }
.est-econ-cell.est-price-cell--muted b { color: #64748B; }
.est-econ-cell.est-price-cell--unapproved b { color: #6D28D9; }
.cat-tag.est-price-diff { background: #FEF3C7; color: #92400E; cursor: pointer; white-space: nowrap; }
.cat-tag.est-price-diff--risk { background: #FEE2E2; color: #B91C1C; }
.cat-tag.est-price-norate { background: #F1F5F9; color: #64748B; border: 1px dashed #CBD5E1; cursor: pointer; white-space: nowrap; }
.cat-tag.est-price-unapproved { background: #EDE9FE; color: #6D28D9; cursor: pointer; white-space: nowrap; }
.est-price-res { margin-bottom: 10px; }
.est-price-block { margin: 0 0 10px; padding: 9px 11px; border: 1px solid #e2e8f0; border-radius: 8px; background: #f8fafc; }
.est-price-block--warn { border-color: #FDE68A; background: #FFFBEB; }
.est-price-block-head { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: #64748B; margin-bottom: 4px; }
.est-price-block-act { margin-top: 8px; }
.est-price-neg { color: #B91C1C; font-weight: 600; }
.est-price-pos { color: #15803D; font-weight: 600; }
.est-price-cands th, .est-price-cands td { font-size: 12px; }

/* Критический путь на графике: янтарная обводка бара и оранжевая стрелка связи без запаса. */
.gantt-bar--critical { box-shadow: 0 0 0 2px #f59e0b; }
.gantt-link--critical { stroke: #d97706; stroke-width: 2; opacity: .9; }

/* Веха: ромб на финише этапа. */
.gantt-bar--stage::after { content: ''; position: absolute; right: -4px; top: 50%; width: 8px; height: 8px; background: #0f766e; transform: translateY(-50%) rotate(45deg); border-radius: 1px; }

/* Выбор варианта оформления при экспорте КП: карточки-радио, активная подсвечена. */
.est-export-opts { display: grid; gap: 8px; margin-bottom: 10px; }
.est-export-opt { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.est-export-opt:hover { border-color: #86efac; }
.est-export-opt.is-active { border-color: var(--green); background: #f0fdf4; }
.est-export-opt input { margin-top: 3px; }
.est-export-opt b { display: block; font-size: 13px; }
.est-export-opt small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); line-height: 1.4; }

/* Реквизиты КП: тихая подпись под списком объектов — сколько объектов у заказчика. */
.est-parties-scope { margin: 6px 0 10px; font-size: 12px; color: var(--muted); }

/* Заголовок карточки сметы и строка «Объект · Заказчик» — рабочие элементы:
   клик по названию правит название, клик по строке открывает реквизиты.
   Пунктир снизу — единственная подсказка, что текст кликабелен. */
.est-title-edit, .est-parties-edit { cursor: pointer; border-bottom: 1px dashed transparent; }
.est-title-edit:hover, .est-parties-edit:hover { border-bottom-color: var(--green); }
.est-title-input { font: inherit; color: inherit; width: 100%; max-width: 720px; padding: 2px 6px; border: 1px solid var(--green); border-radius: 6px; }
