/* Кабинет офиса «Объектив» — Sprint 94: точная реализация дизайн-handoff.
   Один связный слой на токенах /shared/base.css (источник: docs/design/design-tokens.css).
   Эталоны: docs/design/reference/{object-prototype,object-flow,checklists-1c}.dc.html. */

* { box-sizing: border-box; }

/* Атрибут hidden обязан скрывать элемент, даже когда класс задаёт display
   (.workspace/.wizard/.topsearch и др. — flex). Без этого «экраны»-секции
   (мастер создания объекта, ручная форма) не прячут список и открываются
   ниже него, за пределами экрана. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink);
  background: var(--bg-canvas);
}

/* ===== Топбар ===== */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand svg { flex: none; }
.brand span { font-size: 14px; font-weight: 600; }
.brand small { font-size: 12px; font-weight: 400; color: var(--text-muted); white-space: nowrap; }
.topsearch {
  display: flex; align-items: center; gap: 8px;
  width: 280px; height: 32px; padding: 0 10px;
  border: 1px solid var(--border); background: var(--surface-sunken); border-radius: 6px;
  transition: border-color .12s, box-shadow .12s;
}
.topsearch:focus-within { border-color: #7D9FBE; box-shadow: 0 0 0 2px #DCE8F2; }
.topsearch input {
  flex: 1; min-width: 0; border: 0; background: none; padding: 0;
  font: inherit; font-size: 13px; color: var(--ink);
}
.topsearch input::placeholder { color: var(--text-muted); }
.topsearch svg { flex: none; color: var(--text-muted); }
.topuser { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 0; }
.topuser .who { font-size: 12.5px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: #D9DCE0; color: #5A616A;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
}
.topbar button.link { color: var(--text-secondary); }

.devnote {
  background: var(--status-warn-tint);
  color: var(--status-warn);
  font-size: var(--text-sm);
  padding: 5px 20px;
  border-bottom: 1px solid var(--status-warn-border);
}

/* ===== Каркас: сайдбар + рабочая область ===== */
main { min-height: calc(100vh - 51px); }
.workspace { display: flex; align-items: stretch; min-height: calc(100vh - 51px); }
.shell-sidebar {
  flex: none; width: 184px;
  background: var(--surface-sunken);
  border-right: 1px solid #E3E5E8;
  padding: 12px 8px;
  display: flex; flex-direction: column; gap: 2px;
}
.shell-nav { display: flex; flex-direction: column; gap: 2px; }
.shell-nav-item {
  text-align: left; font: inherit; font-size: 13px; color: var(--text-secondary);
  background: none; border: 1px solid transparent; border-left: 3px solid transparent;
  border-radius: 6px; padding: 7px 10px; cursor: pointer;
}
.shell-nav-item:hover { background: none; color: var(--ink); }
.shell-nav-item.active {
  font-weight: 600; color: var(--ink);
  background: var(--surface);
  border: 1px solid #E0E2E5; border-left: 3px solid var(--accent);
}
.shell-nav-item:disabled { color: var(--text-disabled); cursor: default; }
.shell-nav-item:disabled:hover { color: var(--text-disabled); background: none; }
.shell-sidebar-note { margin-top: auto; padding: 5px 13px; font-size: 11px; color: var(--text-muted); line-height: 1.45; }
.workarea { flex: 1; min-width: 0; padding: 16px 24px; }

/* ===== Вход ===== */
.login {
  max-width: 460px; margin: 40px auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 20px 22px;
}
.login h2 { margin: 0 0 6px; font-size: 18px; }
.login p { color: var(--text-secondary); margin: 0 0 14px; }
.loginrow { display: flex; gap: 8px; }
.loginrow input { flex: 1; }

input[type="text"], input[type="date"], input[type="datetime-local"], select, textarea {
  font: inherit; font-size: 12.5px; color: var(--ink);
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface);
}

button {
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  height: 34px; padding: 0 15px;
  border: none; background: var(--accent); color: var(--on-accent); border-radius: 6px;
}
button:hover { background: var(--accent-hover); }
button:disabled { opacity: .55; cursor: default; }
button.secondary, .secondary-button {
  height: 32px; padding: 0 13px;
  font-size: 12.5px; font-weight: 500;
  background: var(--surface); color: var(--ink); border: 1px solid var(--border);
}
button.secondary:hover, .secondary-button:hover, button.secondary.active { background: var(--surface-sunken); }
button.link {
  height: auto; padding: 0; font-size: 12.5px; font-weight: 400;
  background: none; border: none; color: var(--text-secondary); text-decoration: none;
}
button.link:hover { background: none; color: var(--ink); }
button.link.primary { color: var(--accent); font-weight: 500; }
button.link.primary:hover { color: var(--accent-hover); }
button.danger { background: var(--status-danger); }
button.danger:hover { background: var(--status-danger); opacity: .9; }
.danger-link { color: var(--status-danger) !important; }
.icon-button, .iconbtn {
  width: 32px; height: 32px; flex: none; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); color: var(--text-secondary);
  border: 1px solid var(--border); border-radius: 6px; font-size: 16px; font-weight: 400; line-height: 1;
}
.icon-button:hover, .iconbtn:hover { background: var(--surface-sunken); color: var(--ink); }

/* ===== Чипы статусов (outline) и мягкие pill ===== */
.chip-status {
  display: inline-flex; align-items: center; padding: 3px 8px;
  border: 1px solid var(--status-neutral-border); color: var(--status-neutral);
  background: var(--surface); border-radius: 4px; font-size: 12px; font-weight: 500; white-space: nowrap;
}
.chip-status.ok { border-color: var(--status-ok-border); color: #2E6B4C; }
.chip-status.warn { border-color: var(--status-warn-border); color: var(--status-warn); }
.chip-status.danger { border-color: var(--status-danger-border); color: var(--status-danger); }
.chip-status.info { border-color: var(--status-info-border); color: var(--status-info); }
.pill { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 999px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.pill.ok { background: var(--status-ok-tint); color: #2E6B4C; }
.pill.warn { background: var(--status-warn-tint); color: #8F6209; }
.pill.neutral { background: var(--surface-sunken); color: var(--status-neutral); }
.pill.accent { background: var(--accent-tint); color: var(--accent-hover); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { background: var(--surface-sunken); color: var(--text-secondary); border-radius: 999px; padding: 2px 9px; font-size: 12px; white-space: nowrap; }

/* ===== Список объектов ===== */
.listhead { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.listhead h1 { margin: 0; font-size: 18px; font-weight: 700; }
.listhead h1 span { color: var(--text-muted); font-weight: 400; font-size: 15px; }
.list-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-chip {
  height: 32px; padding: 0 11px; font-size: 12.5px; color: var(--text-secondary);
  border: 1px solid var(--border); background: var(--surface); border-radius: 6px;
}
.projects-table { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.pt-head, .pt-row {
  display: grid;
  grid-template-columns: 2.1fr 1.1fr 1fr 1.5fr 0.8fr 0.3fr;
  gap: 12px; align-items: center; padding: 9px 16px;
}
.pt-head { border-bottom: 1px solid var(--border-soft); }
.pt-head span { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.pt-row { padding: 11px 16px; border-bottom: 1px solid var(--divider); cursor: pointer; }
.pt-row:last-child { border-bottom: none; }
.pt-row:hover { background: #FBFAF9; }
.pt-name { font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.pt-addr { font-size: 12.5px; color: var(--text-muted); margin-top: 1px; overflow-wrap: anywhere; }
.pt-cell { font-size: 13px; min-width: 0; overflow-wrap: anywhere; }
.pt-cell small { display: block; font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.pt-cell.muted { color: var(--text-muted); }
.pt-menu { justify-self: end; color: var(--text-muted); background: none; border: none; height: auto; padding: 4px 6px; font-weight: 400; font-size: 14px; }
.pt-menu:hover { background: var(--surface-sunken); color: var(--ink); border-radius: 6px; }
.list-footnote { margin-top: 8px; font-size: 12px; color: var(--text-muted); }

/* ===== Пустые/ошибочные/загрузочные состояния ===== */
.empty-state {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 26px 20px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.empty-state .tile {
  width: 38px; height: 38px; border: 1.5px dashed var(--text-disabled); border-radius: 8px;
  display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 18px;
}
.empty-state.error .tile { border: 1.5px solid var(--status-danger-border); color: var(--status-danger); }
.empty-state b { font-size: 13.5px; font-weight: 600; }
.empty-state p { margin: 0; font-size: 12px; color: var(--text-muted); line-height: 1.45; }
.empty-state button { margin-top: 8px; height: 32px; font-size: 12.5px; }
.empty-inline { padding: 10px 0; font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
/* Эмпти-стейт списка объектов (дизайн «настройки-компании», экран 04) */
.empty-objects {
  background: none; border: none; border-radius: 0;
  max-width: 560px; margin: 48px auto 0; padding: 0 0 32px; gap: 0;
}
.empty-objects > svg { opacity: .9; }
.empty-objects > b { font-size: 18px; font-weight: 700; margin-top: 16px; }
.empty-objects .empty-lead {
  font-size: 14px; color: var(--text-secondary); line-height: 1.55;
  margin-top: 6px; max-width: 420px; text-wrap: pretty;
}
.empty-objects .empty-create {
  height: 44px; padding: 0 22px; font-size: 14.5px; font-weight: 600;
  border-radius: 6px; margin-top: 20px;
}
.empty-objects .empty-minute { font-size: 12.5px; color: var(--text-muted); margin-top: 10px; }
.empty-objects .empty-steps { display: flex; align-items: stretch; margin-top: 36px; width: 100%; }
.empty-objects .empty-step { flex: 1; padding: 0 14px; }
.empty-objects .empty-step-head { display: flex; align-items: center; gap: 8px; justify-content: center; }
.empty-objects .empty-step-head i {
  font-family: ui-monospace, Menlo, monospace; font-style: normal;
  font-size: 13px; font-weight: 700; color: var(--accent);
}
.empty-objects .empty-step-head b { font-size: 13px; font-weight: 600; }
.empty-objects .empty-step p { margin: 4px 0 0; font-size: 12px; color: var(--text-muted); line-height: 1.45; }
.empty-objects .empty-sep { width: 1px; background: #E3E5E8; flex: none; }
.skeleton { height: 8px; border-radius: 4px; background: var(--divider); margin: 8px 0; }
.skeleton.w2 { width: 64%; background: #F4F5F6; }
.spinner {
  display: inline-block; width: 14px; height: 14px; border-radius: 50%;
  border: 2.5px solid var(--accent-tint); border-top-color: var(--accent);
  animation: spin .8s linear infinite; vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.error { color: var(--status-danger); font-size: 12.5px; min-height: 1em; margin: 4px 0; }

/* ===== Карточка объекта — отдельная страница ===== */
.workspace.object-open .list { display: none; }
.card { flex: 1; min-width: 0; }
.crumb { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.crumb button { height: auto; padding: 0; font: inherit; font-size: 12px; color: var(--text-muted); background: none; border: none; font-weight: 400; }
.crumb button:hover { color: var(--accent); background: none; }
.object-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.object-title-row { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.object-title-row h1 { margin: 0; font-size: 20px; font-weight: 700; overflow-wrap: anywhere; }
.object-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; overflow-wrap: anywhere; }
.object-head-actions { position: relative; margin-left: auto; display: flex; align-items: center; gap: 8px; }
.avatar-stack { display: flex; align-items: center; }
.avatar-stack .avatar { border: 2px solid var(--bg-canvas); margin-left: -8px; }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-stack .avatar:nth-child(2n) { background: #CBD4DC; }
.avatar-stack .avatar:nth-child(3n) { background: #D9D3CB; }
.object-tabs { display: flex; gap: 2px; border-bottom: 1px solid #E3E5E8; margin-top: 12px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.object-tabs::-webkit-scrollbar { display: none; }
.object-tabs button {
  flex: none; height: auto; font-size: 13px; font-weight: 400; color: var(--text-secondary);
  padding: 8px 12px; border: none; background: none; border-radius: 0;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.object-tabs button:hover { background: none; color: var(--ink); }
.object-tabs button.active { font-weight: 600; color: var(--ink); border-bottom-color: var(--accent); }
.object-tabs button span { color: var(--text-muted); font-weight: 400; margin-left: 4px; }
.object-tabs button .tabbadge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 4px; margin-left: 5px;
  background: var(--status-warn-tint); color: #8F6209; border-radius: 999px; font-size: 10.5px; font-weight: 700;
}
.cardbody { padding: 14px 0 28px; }
.object-tab-panel[hidden] { display: none; }
.cardsection { min-width: 0; }
.cardsectionbody { min-width: 0; }

/* Карточки-панели */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.panel + .panel { margin-top: 16px; }
.panel-title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.panel-title .alllink { margin-left: auto; font-size: 12.5px; font-weight: 500; color: var(--accent); background: none; border: none; height: auto; padding: 0; }
.panel-title .alllink:hover { color: var(--accent-hover); background: none; }
.section-label { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); margin: 16px 0 8px; }

/* Обзор */
.overview-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 16px; align-items: flex-start; }
.overview-main, .overview-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.timeline-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; position: relative; }
.timeline-node { flex: none; width: 12px; height: 12px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--surface); }
.timeline-row.done .timeline-node { background: var(--status-ok); border-color: var(--status-ok); }
.timeline-row.current .timeline-node { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.timeline-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.timeline-row.future .timeline-title { font-weight: 400; color: var(--text-secondary); }
.timeline-meta { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.reportline { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--divider); cursor: pointer; }
.reportline:last-child { border-bottom: none; }
.reportline:hover { background: #FBFAF9; }
.report-thumb { flex: none; width: 44px; height: 33px; border-radius: 5px; background: repeating-linear-gradient(45deg, var(--divider), var(--divider) 4px, var(--surface-sunken) 4px, var(--surface-sunken) 8px); }
.reportline b { display: block; font-size: 13px; font-weight: 600; }
.reportline .rmeta { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.reportline > div { flex: 1; min-width: 0; }
.summary-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--divider); }
.summary-row:last-child { border-bottom: none; }
.summary-row span { font-size: 12.5px; color: var(--text-muted); }
.summary-row b { font-size: 13px; font-weight: 500; text-align: right; overflow-wrap: anywhere; min-width: 0; }
.photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.photo-grid img, .photo-grid .more {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; display: block;
}
.photo-grid .more { background: var(--surface-sunken); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: var(--text-secondary); }

/* Готовность объекта (новый объект) */
.object-success {
  display: flex; align-items: center; gap: 10px;
  background: #EFF5F1; border: 1px solid #CDE2D5; border-radius: 8px; padding: 11px 14px;
  font-size: 13px; color: #2E5A42;
}
.object-success .okmark { flex: none; width: 22px; height: 22px; border-radius: 999px; background: var(--status-ok); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.object-success button { margin-left: auto; }
.object-readiness .readiness-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; flex-wrap: wrap; }
.readiness-head b { font-size: 14px; font-weight: 700; }
.readiness-progress { flex: 1; max-width: 180px; height: 6px; border-radius: 3px; background: var(--divider); overflow: hidden; }
.readiness-progress i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.readiness-count { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-muted); }
.readiness-note { margin-left: auto; font-size: 12px; color: var(--text-muted); }
.readiness-item { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid #F3F4F6; }
.readiness-item:last-child { border-bottom: none; }
.readiness-item.attention { background: #FDFBF6; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.readiness-mark { flex: none; width: 22px; height: 22px; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700; border: 1.5px solid #C9CDD2; color: var(--text-muted); }
.readiness-item.done .readiness-mark { background: var(--status-ok); border-color: var(--status-ok); color: #fff; }
.readiness-item.attention .readiness-mark { background: var(--status-warn); border-color: var(--status-warn); color: #fff; }
.readiness-item > div { flex: 1; min-width: 0; }
.readiness-item b { font-size: 13.5px; font-weight: 600; }
.readiness-item.done b { text-decoration: line-through; color: var(--text-secondary); font-weight: 500; }
.readiness-item small { display: block; font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.readiness-item button { flex: none; height: 30px; font-size: 12.5px; }

/* Сводка/строки карточки */
.project-summary { display: grid; gap: 0; }
.project-summary .row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--divider); }
.project-summary .row:last-child { border-bottom: none; }
.project-summary .row span:first-child { font-size: 12.5px; color: var(--text-muted); }
.project-summary .row span:last-child { font-size: 13px; font-weight: 500; text-align: right; min-width: 0; overflow-wrap: anywhere; }

/* Предложенные шаги */
.suggested { margin-top: 0; }
.suggestedrow { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--divider); }
.suggestedrow:last-child { border-bottom: none; }
.suggestedrow span:first-child { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.suggeststatus { color: var(--text-muted); font-size: 12px; white-space: nowrap; }

/* ===== Параметры ===== */
.params { min-width: 0; }
.paramnote { background: var(--status-warn-tint); color: var(--status-warn); border-radius: 6px; padding: 6px 10px; font-size: 12.5px; margin-bottom: 8px; }
.param-field { display: grid; grid-template-columns: minmax(150px, 200px) minmax(210px, 460px) minmax(90px, 1fr); align-items: center; gap: 8px 14px; padding: 10px 0; border-bottom: 1px solid #F3F4F6; }
.param-field > label { font-size: 13px; font-weight: 600; color: var(--ink); }
.param-field select, .param-multi > summary { width: 100%; min-height: 34px; font: inherit; font-size: 12.5px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.param-multi { min-width: 0; }
.param-multi > summary { cursor: pointer; list-style-position: inside; overflow-wrap: anywhere; }
.param-multi-choices { display: grid; gap: 7px; padding: 10px; border: 1px solid var(--border); border-top: 0; }
.param-multi-choices label { display: flex; align-items: center; gap: 7px; }
.param-custom { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 8px; }
.param-custom[hidden] { display: none; }
.param-custom input { min-width: 0; width: 100%; }
.param-save-state { color: #2E6B4C; font-size: 12px; min-height: 1em; }
.params .field { margin: 8px 0; display: flex; flex-direction: column; gap: 4px; }
.params label { font-size: 12.5px; color: var(--text-secondary); }
.params .checks { display: flex; flex-wrap: wrap; gap: 10px; }
.params .checks label { color: var(--ink); display: flex; align-items: center; gap: 5px; }
.params .formbtns { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.tzupload { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); }
.tzstatus { color: var(--text-muted); font-size: 12px; margin-top: 6px; min-height: 1em; }
.tzpreview { margin-top: 8px; }
.tzpreview button { margin-top: 8px; }

/* ===== Ручная форма (в мастере) ===== */
.newform .field { margin-bottom: 11px; display: flex; flex-direction: column; gap: 4px; }
.newform label { font-size: 12.5px; color: var(--text-secondary); }
.newform .checks { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 11px; }
.newform .checks label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.newform .formbtns { display: flex; align-items: center; gap: 12px; margin-top: 4px; }

/* ===== История/журнал ===== */
.activity { min-width: 0; }
.event { padding: 8px 6px; border-bottom: 1px solid var(--divider); cursor: pointer; border-radius: 6px; }
.event:last-child { border-bottom: none; }
.event:hover { background: #FBFAF9; }
.eventhead { font-size: 13px; font-weight: 600; }
.eventsummary { font-size: 12.5px; color: var(--text-muted); margin: 3px 0; }
.event .chips { margin-top: 4px; }
.audit { margin-top: 14px; border-top: 1px solid var(--divider); padding-top: 8px; }
.auditrow { display: flex; gap: 9px; align-items: baseline; font-size: 12.5px; color: var(--text-secondary); padding: 6px 0; border-bottom: 1px solid #F3F4F6; line-height: 1.45; }
.auditrow:last-child { border-bottom: none; }
.checkrow { font-size: 13px; padding: 4px 0; border-bottom: 1px dashed var(--divider); line-height: 1.4; }

/* ===== Документы ===== */
.documents { min-width: 0; }
.doc-drop {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border: 1.5px dashed #C9CDD2; border-radius: 8px; padding: 12px 14px; margin-bottom: 14px;
  font-size: 12.5px; color: var(--text-secondary); cursor: pointer;
}
.doc-drop:hover, .doc-drop.dragover { border-color: var(--accent); }
.doc-drop b { color: var(--accent); font-weight: 500; }
.doc-group { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 12px; }
.doc-row { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid #F3F4F6; }
.doc-row:last-child { border-bottom: none; }
.doc-type {
  flex: none; width: 30px; height: 30px; border: 1px solid #E0E2E5; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 9px; font-weight: 700; color: var(--status-info);
}
.doc-type.pdf { color: var(--status-danger); }
.document-info { flex: 1; min-width: 0; }
.document-info h4 { margin: 0; font-size: 12.5px; font-weight: 600; overflow-wrap: anywhere; }
.document-meta { font-size: 11px; color: var(--text-muted); margin-top: 1px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.doc-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.doc-actions .link { font-size: 12px; }
.doc-menu { position: relative; }
.doc-menu-list {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: var(--z-dropdown, 1000);
  min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: var(--shadow-md); padding: 6px; display: flex; flex-direction: column; gap: 2px;
}
.doc-menu-list button { height: auto; text-align: left; font-size: 12.5px; font-weight: 400; color: var(--ink); background: none; border: none; padding: 7px 9px; border-radius: 6px; }
.doc-menu-list button:hover { background: var(--surface-sunken); }
.docfilters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }
.docfilters input[type="text"] { flex: 1; min-width: 130px; }
.docmatch { font-size: 12px; color: var(--text-muted); padding: 2px 0 6px 4px; word-break: break-word; }
.docform { display: grid; grid-template-columns: minmax(150px, 220px) minmax(180px, 1fr) auto; align-items: center; gap: 8px; padding: 10px 0; }
.mediarow { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 18px; font-size: 13px; padding: 10px 0; border-bottom: 1px solid var(--divider); }
.mediaactions { display: flex; flex-wrap: wrap; gap: 8px 12px; min-width: 0; }
.visbadge { display: inline-block; margin: 8px 0; padding: 3px 10px; border-radius: 999px; font-size: 12px; background: var(--status-ok-tint); color: #2E6B4C; }
.visbadge.hidden { background: var(--status-warn-tint); color: var(--status-warn); }

.lightbox { position: fixed; inset: 0; background: rgba(28, 30, 34, .62); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: var(--z-overlay, 1200); }
.lightbox-box { background: var(--surface); border-radius: 10px; max-width: 92vw; max-height: 92vh; display: flex; flex-direction: column; overflow: hidden; }
.lightbox-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 14px; border-bottom: 1px solid var(--divider); font-size: 13px; }
.lightbox-box img { max-width: 92vw; max-height: 82vh; object-fit: contain; display: block; background: var(--surface-sunken); }

/* ===== Участники ===== */
.members { min-width: 0; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #F3F4F6; }
.member-row:last-child { border-bottom: none; }
.inviterow { display: flex; justify-content: space-between; align-items: center; gap: 16px; font-size: 13px; padding: 9px 0; border-bottom: 1px dashed var(--divider); }
.inviteinfo { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.inviteinfo span { color: var(--text-muted); font-size: 12px; overflow-wrap: anywhere; }
.inviteactions, .invitesendactions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.inviteform { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: end; gap: 10px; margin-top: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-sunken); }
.invitefield { min-width: 0; display: flex; flex-direction: column; gap: 4px; color: var(--text-secondary); font-size: 12px; }
.invitefield input, .invitefield select { width: 100%; min-width: 0; }
.inviteform > button { grid-column: 1 / -1; justify-self: start; min-height: 34px; white-space: nowrap; }
.invitesend { margin-top: 10px; padding: 12px; border: 1px solid var(--status-ok-border); border-radius: 8px; background: var(--status-ok-tint); }
.invitesendsummary { margin: 3px 0 9px; color: var(--text-secondary); font-size: 13px; }
.invitehint { margin-top: 8px; color: var(--text-muted); font-size: 12px; }

/* ===== Контроль и выезды ===== */
.controlplan { margin: 4px 0 12px; background: var(--surface); }
.plantitle { font-weight: 600; word-break: break-word; font-size: 13.5px; }
.planmeta { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.planstages { margin: 8px 0 0; padding: 0; list-style: none; font-size: 13px; }
.planstages li { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid #F3F4F6; word-break: break-word; }
.planstages li:last-child { border-bottom: none; }
.planstages .plannum { font-family: var(--font-mono); font-size: 11px; color: var(--text-disabled); flex: none; width: 18px; }
.planstages .plancount { margin-left: auto; font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.plannote { font-size: 13px; color: var(--text-muted); margin: 4px 0 12px; }
.srcbadge { font-size: 11px; color: var(--status-warn); background: var(--status-warn-tint); border-radius: 4px; padding: 1px 5px; }
.checklist-recommendation { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0; padding: 11px 14px; border: 1px solid #CDE2D5; border-radius: 8px; background: #EFF5F1; font-size: 13px; line-height: 1.45; }
.checklist-recommendation span { color: #2E5A42; }
.checklist-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.checklist-saved { margin-top: 9px; font-size: 13px; }
.checklist-saved > summary { color: var(--text-secondary); cursor: pointer; }
.checklist-saved-row, .checklist-saved > div { display: flex; gap: 8px; margin-top: 8px; }
.checklist-saved select { min-width: 0; flex: 1; }
.tmpl-mgmt { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--divider); }
.tmpl-mgmt h4 { margin: 0 0 6px; font-size: 13px; }
.tmplrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 5px 0; }
.tmpllabel { flex: 1 1 100%; font-size: 12px; color: var(--text-muted); }
.tmplrow select, .tmplrow input { max-width: 100%; }
.draftedit { margin-top: 8px; padding: 8px; border: 1px dashed var(--border); border-radius: 8px; }
.drafthead { font-size: 12px; font-weight: 600; margin-bottom: 4px; word-break: break-word; }

.visits { margin-top: 14px; border-top: 1px solid var(--divider); padding-top: 10px; }
.visitnewform { background: var(--surface-sunken); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin: 8px 0; }
.visitfield { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--text-secondary); margin-bottom: 8px; }
.visitformbtns { display: flex; align-items: center; gap: 12px; }
.visitlist { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.visititem { display: block; width: 100%; height: auto; text-align: left; background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-weight: 400; }
.visititem:hover { background: #FBFAF9; }
.visititem.active { background: var(--accent-tint); border-color: var(--accent); }
.visititem-main { font-size: 13px; font-weight: 600; }
.visititem-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.visitdetail { margin-top: 10px; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: var(--surface-sunken); }
.visitdetail-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.visitsubhead { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin: 12px 0 4px; font-weight: 600; }
.visitbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.visitnote { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.visittitle { font-weight: 600; margin: 10px 0 6px; }
.assignrow { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; padding: 4px 0; border-bottom: 1px dashed var(--divider); }
.assignform { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.assignform select { flex: 1; min-width: 150px; }
.visitstatusbar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.visitbar select, .visitfield select, .assignform select { max-width: 100%; }

/* Sprint 111 (волна C): «Пакет выезда» + инлайн-планировщик выездов. */
.visit-package {
  margin-top: 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); padding: 10px 12px;
}
.vp-title { font-size: 12.5px; font-weight: 700; }
.vp-note { margin: 2px 0 8px; font-size: 11px; color: var(--text-muted); }
.vp-row { display: flex; gap: 10px; padding: 4px 0; border-top: 1px solid #F5F6F7; font-size: 12px; }
.vp-row.warn .vp-value { color: #A8730A; font-weight: 600; }
.vp-label { width: 110px; flex: none; color: var(--text-muted); }
.vp-value { flex: 1; min-width: 0; }
.vp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.vp-inline { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.visit-scheduler {
  margin: 10px 0; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-sunken); padding: 12px 14px;
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px;
}
.vsch-title { width: 100%; font-size: 13px; font-weight: 700; }
.vsch-field { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--text-muted); }
.vsch-field select, .vsch-field input { min-width: 170px; }
.visitresults { margin-top: 10px; }
.resultrow { border-left: 3px solid var(--border); padding: 4px 0 4px 8px; margin: 6px 0; }
.resultrow.s-pass { border-left-color: var(--status-ok); }
.resultrow.s-fail { border-left-color: var(--status-danger); }
.resultrow.s-not_applicable { border-left-color: var(--text-muted); }
.resulttitle { font-size: 13px; font-weight: 600; }
.resultcomment { font-size: 13px; color: var(--text-muted); margin-top: 2px; word-break: break-word; }
.resultphotos { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.visitreport { margin-top: 12px; border-top: 1px solid var(--divider); padding-top: 8px; }
.reportstatus { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 999px; margin: 4px 0; }
.reportstatus.pub { background: var(--status-ok-tint); color: #2E6B4C; }
.reportstatus.unpub { background: var(--surface-sunken); color: var(--text-muted); }
.reportdefect { font-size: 13px; color: var(--status-danger); padding: 2px 0 2px 8px; word-break: break-word; }
.clientvis-item { border: 1px solid var(--border-soft); border-radius: 6px; padding: 8px 10px; margin: 6px 0; }
.clientvis-cp { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.clientvis-cp input, .clientvis-media input { margin-top: 2px; flex: none; }
.clientvis-media { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); margin: 4px 0 0 22px; cursor: pointer; }
.clientvis-media input:disabled { cursor: not-allowed; }
.clientvis-hint { font-size: 12px; color: var(--text-muted); margin: 4px 0 0 22px; }

/* ===== Задачи и замечания ===== */
.defects { min-width: 0; }
.defectrow { display: flex; gap: 9px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid #F3F4F6; }
.defectrow:last-child { border-bottom: none; }
.defect-mark { flex: none; width: 20px; height: 20px; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; margin-top: 1px; }
.defectrow.s-open .defect-mark { background: var(--status-danger-tint); color: var(--status-danger); }
.defectrow.s-fixed .defect-mark { background: var(--status-warn-tint); color: var(--status-warn); }
.defectrow.s-verified .defect-mark { background: var(--status-ok-tint); color: #2E6B4C; }
.defectrow > div { flex: 1; min-width: 0; }
.defecttitle { font-size: 13px; font-weight: 600; word-break: break-word; }
.defectrow.s-verified .defecttitle { text-decoration: line-through; color: var(--text-secondary); font-weight: 500; }
.defectmeta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.defectactions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }

/* ===== Мастер создания объекта ===== */
.create-choice { width: min(640px, calc(100vw - 32px)); border: none; border-radius: 10px; padding: 26px 28px; box-shadow: var(--shadow-lg); }
.create-choice::backdrop { background: rgba(28, 30, 34, 0.42); }
.create-choice h2 { margin: 0 0 4px; font-size: 19px; font-weight: 700; }
.create-choice-lead { margin: 0 0 16px; font-size: 13px; color: var(--text-secondary); }
.create-choice-close { position: absolute; top: 14px; right: 14px; border: none; background: none; }
.create-choice-inner { position: relative; }
.create-paths { display: flex; gap: 14px; align-items: stretch; }
.create-path { flex: 1; border: 1px solid var(--border); border-radius: 8px; padding: 18px; display: flex; flex-direction: column; gap: 8px; position: relative; }
.create-path:hover { border-color: var(--text-disabled); }
.create-path.recommended { flex: 1.15; border: 2px solid var(--accent); background: #FDFBFA; }
.create-path .ribbon { position: absolute; top: -9px; left: 14px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.create-path .pathicon { width: 32px; height: 32px; border: 1px solid #E2CBB8; background: var(--accent-tint); border-radius: 6px; color: var(--accent-hover); display: flex; align-items: center; justify-content: center; font-size: 15px; }
.create-path:not(.recommended) .pathicon { background: var(--bg-canvas); border-color: #E0E2E5; color: var(--text-secondary); }
.create-path h3 { margin: 0; font-size: 15px; font-weight: 700; }
.create-path p { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--text-secondary); flex: 1; }
.create-path .pathmeta { font-size: 11.5px; color: var(--text-muted); }
.create-path button { height: 36px; }

.wizard { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg-canvas); }
.wizard-top { display: flex; align-items: center; gap: 18px; padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--border-soft); position: sticky; top: 0; z-index: var(--z-sticky); }
.wizard-top .wtitle { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; min-width: 0; }
.wizard-top .wtitle small { font-weight: 400; font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.wizard-steps { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.wstep { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.wstep i { font-style: normal; width: 22px; height: 22px; border-radius: 999px; display: flex; align-items: center; justify-content: center; background: var(--surface); border: 1.5px solid var(--border); color: var(--text-muted); font-size: 11.5px; }
.wstep.current { color: var(--ink); }
.wstep.current i { background: var(--accent); border-color: var(--accent); color: #fff; }
.wstep.done { color: var(--ink); }
.wstep.done i { background: var(--status-ok); border-color: var(--status-ok); color: #fff; }
.wconnector { width: 26px; height: 1.5px; background: var(--border); }
.wconnector.done { background: var(--status-ok); }
.wizard-exit { font-size: 12.5px; color: var(--text-secondary); background: none; border: none; height: auto; padding: 0; font-weight: 400; }
.wizard-exit:hover { background: none; color: var(--ink); }
.wizard-body { flex: 1; width: 100%; }
.wizard-body.narrow { max-width: 720px; margin: 0 auto; padding: 34px 24px 30px; }
.wizard-body.wide { max-width: 1120px; margin: 0 auto; padding: 26px 24px 24px; display: flex; gap: 20px; align-items: flex-start; }
.wizard-main { flex: 1.7; min-width: 0; }
.wizard-aside { width: 300px; flex: none; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 76px; }
.wizard-foot { display: flex; align-items: center; gap: 14px; padding: 12px 20px; background: var(--surface); border-top: 1px solid var(--border-soft); position: sticky; bottom: 0; }
.wizard-foot .whint { margin-left: auto; font-size: 12px; color: var(--text-muted); }
.wizard-foot .primary-next { height: 38px; }
.wizard-h1 { margin: 0 0 6px; font-size: 20px; font-weight: 700; }
.wizard-sub { margin: 0 0 18px; font-size: 13.5px; line-height: 1.5; color: var(--text-secondary); }

.dropzone {
  border: 1.5px dashed #C9CDD2; border-radius: 8px; background: var(--surface); padding: 30px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; cursor: pointer;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); }
.dropzone .dropicon { width: 44px; height: 44px; border: 1px solid #E2CBB8; background: var(--accent-tint); border-radius: 8px; color: var(--accent-hover); display: flex; align-items: center; justify-content: center; font-size: 19px; }
.dropzone b { font-size: 14.5px; font-weight: 600; }
.dropzone b span { color: var(--accent); }
.dropzone small { font-size: 12px; color: var(--text-muted); }
.filecard { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-top: 14px; }
.filerow { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--divider); }
.filerow:last-child { border-bottom: none; }
.filerow .doc-type { width: 32px; height: 32px; }
.filerow > div { flex: 1; min-width: 0; }
.filerow b { display: block; font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.filerow small { font-size: 12px; color: var(--text-muted); }
.callout { display: flex; gap: 9px; align-items: flex-start; background: var(--status-info-tint); border: 1px solid var(--status-info-border); border-radius: 8px; padding: 10px 13px; margin-top: 14px; font-size: 12.5px; line-height: 1.5; color: #33546F; }
.callout i { font-style: normal; font-weight: 700; color: var(--status-info); }

.fieldcard { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-bottom: 14px; }
.fieldcard-label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; margin-bottom: 8px; }
.fieldcard input[type="text"] { width: 100%; height: 38px; font-size: 13.5px; font-weight: 500; }
.fieldcard input.needs-confirm { border: 1.5px solid #E2CBA0; background: #FDFBF6; }
.provenance { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); margin-top: 6px; overflow-wrap: anywhere; }
.candidates { border: 1px solid var(--border-soft); border-radius: 6px; margin-top: 8px; overflow: hidden; }
.candidate { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--divider); cursor: pointer; }
.candidate:last-child { border-bottom: none; }
.candidate.selected { background: var(--bg-canvas); }
.candidate > div { flex: 1; min-width: 0; font-size: 12.5px; }
.candidate .provenance { margin-top: 2px; }
.candidate .pickbtn { flex: none; font-size: 12.5px; font-weight: 500; color: var(--accent); background: none; border: none; height: auto; padding: 0; }
.paramcard-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.paramcard-head b { font-size: 13.5px; font-weight: 700; }
.found-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.found-row { display: flex; align-items: center; gap: 9px; padding: 8px 0; border-bottom: 1px solid #F3F4F6; min-width: 0; }
.found-row .okdot { flex: none; width: 18px; height: 18px; border-radius: 999px; background: var(--status-ok); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; }
.found-row span { font-size: 13px; color: var(--text-secondary); }
.found-row b { font-size: 13px; font-weight: 600; margin-left: auto; text-align: right; overflow-wrap: anywhere; }
.review-row { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #FDFBF6; border: 1px solid #E2CBA0; border-radius: 6px; padding: 9px 10px; margin: 6px 0; }
.review-row .warndot { flex: none; width: 18px; height: 18px; border-radius: 999px; background: var(--status-warn); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.review-row > div { flex: 1; min-width: 160px; }
.review-row b { display: block; font-size: 13px; font-weight: 600; }
.review-row select { height: 32px; min-width: 150px; }
.review-row .confirmbtn { height: 30px; font-size: 12.5px; font-weight: 500; background: var(--surface); color: #2E6B4C; border: 1px solid var(--status-ok-border); }
.review-row .confirmbtn:hover { background: var(--status-ok-tint); }
.unknown-row { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid #F3F4F6; }
.unknown-row .nonedot { flex: none; width: 18px; height: 18px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--surface); }
.progresscard .bar { height: 6px; border-radius: 3px; background: var(--divider); overflow: hidden; margin: 8px 0; }
.progresscard .bar i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.progresscard .mono { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-muted); }
.todoline { font-size: 12.5px; padding: 3px 0; color: var(--text-muted); }
.todoline.done { color: #2E6B4C; text-decoration: line-through; }
.todoline.warn { color: #8F6209; }
.sourcerow { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 12px; }
.sourcerow .doc-type { width: 26px; height: 26px; font-size: 8px; }
.autosave-note { background: var(--surface-sunken); border-radius: 8px; padding: 12px 14px; font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.autosave-note b { color: #2E6B4C; font-weight: 600; }

.radiocard { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; padding: 13px 14px; cursor: pointer; margin-bottom: 10px; }
.radiocard.selected { border: 2px solid var(--accent); background: #FDFBFA; padding: 12px 13px; }
.radiocard .radio { flex: none; width: 18px; height: 18px; border-radius: 999px; border: 1.5px solid #C9CDD2; background: var(--surface); margin-top: 1px; }
.radiocard.selected .radio { border: 5.5px solid var(--accent); }
.radiocard > div { flex: 1; min-width: 0; }
.radiocard b { font-size: 13.5px; font-weight: 600; }
.radiocard small { display: block; font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.togglerow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #F3F4F6; cursor: pointer; }
.togglerow:last-child { border-bottom: none; }
.togglerow > div { flex: 1; min-width: 0; }
.togglerow b { font-size: 13px; font-weight: 600; }
.togglerow small { display: block; font-size: 12px; color: var(--text-muted); }
.switch { flex: none; width: 34px; height: 20px; border-radius: 999px; background: var(--border); position: relative; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 999px; background: #fff; transition: left .15s; }
.switch.on { background: var(--status-ok); }
.switch.on::after { left: 16px; }
.summarycard .summary-row b { font-weight: 600; }

.intake-steps { display: none; }
.intakedoc { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--divider); font-size: 13px; }
.intakebucket { margin: 10px 0; }
.intakebucket h5 { margin: 6px 0; font-size: 13px; color: var(--text-muted); }
.intakebucket ul { margin: 4px 0 0 18px; font-size: 13px; color: var(--text-muted); }
.intakerow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 0; }
.intakerow span { font-size: 13px; }
.intakerow select { min-width: 180px; }
.intakeidentitymeta { margin-top: 5px; color: var(--text-muted); font-size: 12px; }
.intakeidentitymeta.found { color: #2E6B4C; }
.intakeidentitymeta.needs_review { color: var(--status-warn); }

/* ===== Бейджи (общие, поверх base.css) ===== */
.badge { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 999px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.badge.ok { background: var(--status-ok-tint); color: #2E6B4C; }
.badge.warn { background: var(--status-warn-tint); color: #8F6209; }
.badge.info { background: var(--status-info-tint); color: var(--status-info); }
.badge.danger { background: var(--status-danger-tint); color: var(--status-danger); }

/* ===== Редактор чек-листов (форма 1c) ===== */
.cl-screen { min-width: 0; }
.cl-crumb { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; font-size: 13px; color: var(--text-muted); }
.cl-crumb button { height: auto; padding: 0; font-size: 13px; font-weight: 400; color: var(--text-muted); background: none; border: none; }
.cl-crumb button:hover { color: var(--accent); background: none; }
.cl-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.cl-head h1 { margin: 0; font-size: 19px; font-weight: 700; }
.cl-meta { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-muted); }
.cl-savestate { font-size: 12px; color: #2E6B4C; font-weight: 500; min-width: 90px; }
.cl-head-actions { margin-left: auto; display: flex; gap: 8px; }
.cl-import { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 14px; margin-bottom: 14px; }
.cl-import .dropzone { padding: 20px; }
.cl-filerow { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.cl-filecard { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 260px; border: 1px solid #E0E2E5; border-radius: 6px; padding: 7px 10px; }
.cl-filecard .doc-type { width: 28px; height: 28px; font-size: 8.5px; }
.cl-filecard > div { flex: 1; min-width: 0; }
.cl-filecard b { display: block; font-size: 12.5px; font-weight: 600; overflow-wrap: anywhere; }
.cl-filecard small { font-size: 11px; color: var(--text-muted); }
.cl-import-mode { height: 32px; font-size: 12.5px; }
.cl-import-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cl-import-foot .note { font-size: 11.5px; color: var(--text-muted); }
.cl-import-foot .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.cl-grid { display: flex; gap: 14px; align-items: flex-start; }
.cl-stages { flex: 1.35; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.cl-dropbar { height: 2px; background: transparent; transition: background 0.12s; }
.cl-dropbar.on { background: var(--accent); }
.cl-dropbar.inner { margin: 0 14px 0 24px; border-radius: 1px; }
.cl-stage-row { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--divider); cursor: pointer; background: var(--surface); transition: background 0.15s, opacity 0.15s; }
.cl-stage-row:hover { background: #FBFAF9; }
.cl-stage-row.open { background: #FDFCFB; }
.cl-stage-row.dragging, .cl-point.dragging { opacity: .35; }
.cl-drag { flex: none; color: #C9CDD2; font-size: 13px; cursor: grab; background: none; border: none; height: auto; padding: 0; font-weight: 400; }
.cl-drag:active { cursor: grabbing; }
.cl-drag:hover { background: none; color: var(--text-muted); }
.cl-check { flex: none; width: 15px; height: 15px; border-radius: 4px; background: var(--surface); border: 1.5px solid #C9CDD2; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; font-weight: 700; box-sizing: border-box; cursor: pointer; }
.cl-check.on { background: var(--accent); border-color: var(--accent); }
.cl-stage-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-stage-row.off .cl-stage-title { color: var(--text-muted); }
.cl-rename { flex: 1; height: 28px; border: 1.5px solid var(--accent); border-radius: 6px; padding: 0 9px; font-size: 13px; font-weight: 600; min-width: 0; }
.cl-rename-done { font-size: 12px; color: #2E6B4C; font-weight: 600; background: none; border: none; height: auto; padding: 0; }
.cl-pencil { font-size: 12px; color: #B3B8BE; background: none; border: none; height: auto; padding: 0; font-weight: 400; }
.cl-pencil:hover { color: var(--accent); background: none; }
.cl-count { flex: none; font-size: 11.5px; color: var(--text-muted); }
.cl-chev { flex: none; color: var(--text-muted); font-size: 11px; }
.cl-mergesel { flex: none; width: 16px; height: 16px; border-radius: 999px; border: 1.5px solid #C9CDD2; background: var(--surface); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 9px; font-weight: 700; box-sizing: border-box; cursor: pointer; }
.cl-mergesel.on { background: var(--ink); border-color: var(--ink); }
.cl-points { background: #FDFCFB; border-bottom: 1px solid var(--divider); padding: 4px 0 8px; }
.cl-point { display: flex; align-items: flex-start; gap: 9px; padding: 8px 14px 8px 24px; cursor: pointer; border-left: 3px solid transparent; transition: background 0.15s, opacity 0.15s; }
.cl-point:hover { background: #F2F3F5; }
.cl-point.selected { background: var(--accent-tint); border-left-color: var(--accent); }
.cl-point .cl-drag { font-size: 12px; margin-top: 1px; }
.cl-point .cl-check { margin-top: 1px; }
.cl-point-text { flex: 1; min-width: 0; font-size: 12.5px; line-height: 1.45; overflow-wrap: anywhere; }
.cl-point.off .cl-point-text { color: #B3B8BE; text-decoration: line-through; }
.cl-tol { display: inline-flex; padding: 1px 6px; border: 1px solid #D5D8DC; color: var(--status-neutral); border-radius: 4px; font-size: 10.5px; margin-left: 5px; white-space: nowrap; }
.cl-strict { display: inline-flex; padding: 1px 6px; background: #FBEFE8; color: var(--accent-hover); border-radius: 4px; font-size: 10.5px; margin-left: 5px; white-space: nowrap; }
.cl-stage-foot { display: flex; gap: 16px; padding: 7px 14px 2px 24px; }
.cl-stage-foot button, .cl-list-foot button { height: auto; padding: 0; font-size: 12px; font-weight: 500; background: none; border: none; }
.cl-stage-foot .addpoint, .cl-list-foot .addstage { color: var(--accent); }
.cl-stage-foot .delstage { color: var(--text-muted); }
.cl-stage-foot .delstage:hover { color: var(--status-danger); background: none; }
.cl-list-foot { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.cl-list-foot .mergetoggle { color: var(--text-secondary); font-size: 12.5px; }
.cl-list-foot .hint { margin-left: auto; font-size: 11.5px; color: var(--text-muted); }
.cl-panel-wrap { width: 340px; flex: none; position: sticky; top: 76px; }
.cl-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 14px; }
.cl-panel-label { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cl-panel-label span { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-panel-label .cl-savestate { margin-left: auto; font-size: 11px; min-width: 0; }
.cl-panel textarea { width: 100%; border-radius: 6px; font-size: 12.5px; line-height: 1.5; resize: vertical; }
.cl-panel textarea:focus { border-color: var(--accent); outline: none; }
.cl-field-label { font-size: 11.5px; color: var(--text-secondary); margin: 10px 0 4px; }
.cl-panel input[type="text"] { width: 100%; height: 30px; }
.cl-panel input[type="text"]:disabled { background: var(--surface-sunken); }
.cl-checkline { display: flex; align-items: center; gap: 7px; font-size: 12.5px; margin-top: 9px; cursor: pointer; }
.cl-panel-foot { display: flex; gap: 12px; border-top: 1px solid var(--divider); margin-top: 12px; padding-top: 10px; }
.cl-panel-foot button { height: auto; padding: 0; font-size: 12px; font-weight: 400; background: none; border: none; color: var(--text-secondary); }
.cl-panel-foot button:hover { color: var(--ink); background: none; }
.cl-panel-foot .delpoint { color: var(--status-danger); }
.cl-placeholder { background: var(--surface); border: 1px dashed #C9CDD2; border-radius: 8px; padding: 22px; text-align: center; }
.cl-placeholder b { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.cl-placeholder p { margin: 0; font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.cl-note { background: var(--surface-sunken); border-radius: 8px; padding: 10px 12px; font-size: 11.5px; color: var(--text-secondary); line-height: 1.55; margin-top: 12px; }
.cl-merge-bar {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--ink); color: #fff; border-radius: 10px; padding: 11px 18px; font-size: 13px;
  box-shadow: 0 12px 32px rgba(32, 34, 38, 0.3); z-index: var(--z-toast, 1400);
  display: flex; align-items: center; gap: 16px;
}
.cl-merge-bar b { font-weight: 600; }
.cl-merge-bar .mergego { height: 32px; padding: 0 14px; font-size: 12.5px; }
.cl-merge-bar .mergego:disabled { background: #5A5E66; opacity: 1; }
.cl-merge-bar .link { color: #AEB4BB; font-size: 12.5px; }
.cl-merge-bar .link:hover { color: #fff; }

/* ===== Тосты ===== */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--ink); color: #fff; border-radius: 8px; padding: 10px 18px;
  font-size: 13px; font-weight: 500; box-shadow: 0 12px 32px rgba(32, 34, 38, 0.3);
  z-index: var(--z-toast, 1400);
}

/* ===== Адаптив ===== */
@media (max-width: 1100px) {
  .overview-grid { grid-template-columns: 1fr; }
  .wizard-body.wide { flex-direction: column; }
  .wizard-aside { width: 100%; position: static; }
  .cl-grid { flex-direction: column; align-items: stretch; }
  .cl-stages { width: 100%; }
  .cl-panel-wrap { width: 100%; position: static; }
  .found-grid { grid-template-columns: 1fr; }
  .docform { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: 8px 12px; padding: 10px 12px; }
  .topsearch { order: 3; width: 100%; }
  .workspace { display: block; }
  .shell-sidebar { width: 100%; flex-direction: row; align-items: center; overflow-x: auto; border-right: none; border-bottom: 1px solid #E3E5E8; padding: 8px; }
  .shell-nav { flex-direction: row; gap: 4px; }
  .shell-nav-item { white-space: nowrap; border-left-width: 1px; }
  .shell-nav-item.active { border-left: 1px solid #E0E2E5; border-bottom: 2px solid var(--accent); border-radius: 6px 6px 0 0; }
  .shell-sidebar-note { display: none; }
  .workarea { padding: 12px; }
  .pt-head { display: none; }
  .pt-row { grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 12px; }
  .pt-row > .pt-cell { grid-column: 1 / -1; }
  .pt-row > .pt-cell:first-child { grid-column: 1; }
  .pt-row > .pt-cell:nth-child(5) { grid-column: 2; grid-row: 1; justify-self: end; }
  .pt-menu { display: none; }
  .object-head { flex-direction: column; align-items: stretch; }
  .object-head-actions { margin-left: 0; align-self: flex-start; }
  .create-paths { flex-direction: column; }
  .wizard-steps { display: none; }
  .wizard-body.narrow, .wizard-body.wide { padding: 16px 12px; }
  .wizard-foot { flex-wrap: wrap; }
  .param-field { grid-template-columns: 1fr; gap: 5px; }
  .param-save-state { min-height: 0; }
  .docform, .mediarow { grid-template-columns: 1fr; }
  .mediaactions { justify-content: flex-start; }
  .listhead { align-items: center; }
  .doc-row { flex-wrap: wrap; }
  .doc-actions { margin-left: 40px; }
  .visitbar, .visitfield, .assignform { min-width: 0; }
  .visitbar select, .visitfield select, .assignform select { width: 100%; }
  button.link { padding: 6px 4px; }
  .loginrow { flex-direction: column; }
  .intakerow { flex-wrap: wrap; align-items: stretch; }
  .intakerow select { width: 100%; min-width: 0; }
  .inviteform { grid-template-columns: 1fr; align-items: stretch; }
  .inviteform > button { grid-column: auto; justify-self: stretch; width: 100%; }
  .inviterow { align-items: flex-start; flex-direction: column; }
  .checklist-actions { flex-direction: column; align-items: stretch; }
  .cl-head-actions { margin-left: 0; width: 100%; }
  .cl-head-actions button { flex: 1; }
  .cl-merge-bar { width: calc(100vw - 24px); flex-wrap: wrap; gap: 10px; bottom: 12px; }
  .photo-grid { grid-template-columns: 1fr 1fr; }
  .summary-row b { text-align: left; }
  .object-tabs { margin-left: -12px; margin-right: -12px; padding: 0 12px; }
}

/* ===== Sprint 95: разделы кабинета (форма «кабинет-разделы») ===== */

/* Убираем нативные стрелочки спиннера date/time/number */
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator { opacity: .5; }
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button { display: none; -webkit-appearance: none; appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

/* Общие для разделов: заголовок блока, счётчик, аватар-размеры, role-badge, ⋯, фильтр-чипы */
.block-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.block-head b { font-size: 15px; font-weight: 700; }
.block-head .count { font-size: 14px; font-weight: 400; color: var(--text-muted); }
.avatar.sm { width: 22px; height: 22px; font-size: 9.5px; }
.avatar.pending { background: var(--surface-sunken); color: var(--text-muted); border: 1px dashed #C9CDD2; }
.role-badge { flex: none; display: inline-flex; align-items: center; padding: 3px 9px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; color: var(--text-secondary); background: var(--surface); white-space: nowrap; }
.row-menu { flex: none; width: 30px; height: 28px; padding: 0; color: var(--text-muted); background: none; border: none; font-size: 15px; border-radius: 6px; }
.row-menu:hover { background: var(--surface-sunken); color: var(--ink); }
.filter-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-pill { height: auto; padding: 4px 11px; font-size: 12.5px; font-weight: 500; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); }
.filter-pill:hover { background: var(--surface-sunken); }
.filter-pill.active { background: var(--accent-tint); border-color: var(--accent-tint); color: var(--accent-hover); font-weight: 600; }
.filter-pill.muted { color: var(--text-disabled); cursor: default; }
.filter-pill.muted:hover { background: var(--surface); }
.block-note { margin: 14px 0 0; font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.pill.danger { background: var(--status-danger-tint); color: var(--status-danger); }

/* Участники */
.members-grid, .tasks-grid, .params-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) 320px; gap: 20px; align-items: flex-start; }
.members-main, .tasks-main, .params-main { min-width: 0; }
.members-side, .tasks-side, .params-side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.people-list { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.people-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid #F3F4F6; }
.people-row:last-child { border-bottom: none; }
.people-row.pending { background: var(--surface); }
.people-info { flex: 1; min-width: 0; }
.people-info b { display: block; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.people-info small { display: block; font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); margin-top: 1px; }
.invites-block { margin-top: 18px; }
.invite-panel .invitefield { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; color: var(--text-secondary); font-size: 12.5px; }
.invite-panel .invitefield input, .invite-panel .invitefield select { width: 100%; }
.invite-submit { width: 100%; }
.invite-hint { margin: 10px 0 0; font-size: 11.5px; color: var(--text-muted); line-height: 1.5; }

/* Задачи */
.task-card { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--border); border-radius: 8px; padding: 13px 14px; margin-bottom: 12px; }
.task-card.s-open { border-left-color: var(--status-danger); }
.task-card.s-fixed { border-left-color: var(--status-warn); }
.task-card.s-verified { border-left-color: var(--status-ok); }
.task-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task-who { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-secondary); }
.task-head .row-menu { margin-left: auto; }
.task-desc { font-size: 13px; line-height: 1.5; color: var(--ink); margin: 9px 0; overflow-wrap: anywhere; }
.task-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.task-meta { font-size: 12px; color: var(--text-muted); }
.task-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.task-actions .secondary { height: 30px; }
.task-composer .composer-sub { margin: 0 0 12px; font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.task-composer textarea { width: 100%; border-radius: 6px; font-size: 12.5px; line-height: 1.5; resize: vertical; }
.task-composer select { width: 100%; }
.composer-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.composer-submit { width: 100%; margin-top: 14px; }
.composer-note { margin: 10px 0 0; font-size: 11.5px; color: var(--text-muted); line-height: 1.5; }

/* Параметры */
.params-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.params-hint { margin-left: auto; font-size: 12px; color: var(--text-muted); }
.param-readrow { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #F3F4F6; }
.param-readrow span { font-size: 13px; color: var(--text-secondary); }
.param-readrow b { font-size: 13px; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.param-readrow b.muted { color: var(--text-muted); font-weight: 400; }
.param-field.needs-fill { background: #FDFBF6; border-radius: 6px; margin: 0 -8px; padding-left: 8px; padding-right: 8px; }
.param-field.needs-fill select, .param-field.needs-fill .param-multi > summary { border: 1.5px solid #E2CBA0; }
.fill-badge { margin-left: 8px; padding: 1px 7px; background: var(--status-warn-tint); color: #8F6209; border-radius: 999px; font-size: 10.5px; font-weight: 600; vertical-align: middle; }
.param-save-state.saving { color: var(--text-muted); }
.rules-list { margin: 4px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--text-secondary); line-height: 1.6; }
.rules-list li { margin: 3px 0; }
.mini-history { display: flex; flex-direction: column; gap: 2px; }
.mini-history-row { display: flex; gap: 9px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid #F3F4F6; font-size: 12.5px; color: var(--text-secondary); line-height: 1.45; }
.mini-history-row:last-child { border-bottom: none; }
.mh-time { flex: none; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }

@media (max-width: 1100px) {
  .members-grid, .tasks-grid, .params-grid { grid-template-columns: 1fr; }
  .members-side, .tasks-side, .params-side { position: static; width: 100%; }
  .params-hint { margin-left: 0; }
}

/* Контроль и выезды — 2 колонки (план+выезды слева, деталь выезда справа) */
.control-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) 340px; gap: 20px; align-items: flex-start; }
.control-main { min-width: 0; }
.control-side { position: sticky; top: 16px; min-width: 0; }
.visits-head { margin-top: 16px; }
.visits-head > button { margin-left: auto; }
.visitdetail { background: var(--surface); border: 1px solid var(--border); }
.visit-placeholder { text-align: left; align-items: stretch; }
@media (max-width: 1100px) {
  .control-grid { grid-template-columns: 1fr; }
  .control-side { position: static; width: 100%; }
}

/* ===== Sprint 96: Контроль и выезды по форме «кабинет-разделы» ===== */

/* План контроля: баннер над карточкой, карточка с кнопками и этапами */
.controlplan { background: none; }
.plan-card { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); padding: 14px 16px; }
.plan-card .plantitle { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.checklist-actions .secondary.active {
  background: var(--accent-tint); border-color: var(--accent-tint); color: var(--accent-hover); font-weight: 600;
}
.plan-card .planstages { margin-top: 14px; border-top: 1px solid var(--divider); padding-top: 2px; }
.planstages .stagename { min-width: 0; overflow-wrap: anywhere; }
.planstages .srcbadge {
  margin-left: auto; background: var(--surface-sunken); color: var(--text-secondary);
  border: 1px solid var(--border-soft); font-weight: 500;
}
/* mgmt-блок (сохранённые/расширенные) уходит под карточку — без разделителя сверху */
.tmpl-mgmt { margin-top: 8px; padding-top: 0; border-top: none; }

/* Карточки выездов: цветная полоса статуса слева + статус справа */
.visititem { border-left-width: 3px; }
.visititem.s-assigned, .visititem.s-in_progress, .visititem.s-submitted { border-left-color: var(--accent); }
.visititem.s-reviewed { border-left-color: var(--status-ok); }
.visititem.s-cancelled { border-left-color: var(--text-disabled); }
.visititem-top { display: flex; align-items: center; gap: 8px; }
.visititem-top .visititem-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.visititem-status { flex: none; font-size: 12px; font-weight: 500; white-space: nowrap; }
.visititem-status.tone-warn { color: var(--accent-hover); }
.visititem-status.tone-neutral { color: var(--text-muted); }
.visititem-status.tone-muted { color: var(--text-disabled); }
.visititem-status.tone-ok { color: #2E6B4C; background: #E3EFE7; padding: 2px 9px; border-radius: 999px; }

/* Деталь выезда: предупреждение о недостающих обязательных документах */
.visit-doc-warn {
  margin: 8px 0; padding: 9px 12px; border: 1px solid #E2CBA0; background: #FDFBF6;
  border-radius: 8px; font-size: 12.5px; color: #8F6209; line-height: 1.45;
}
.visit-doc-warn::before { content: "! "; font-weight: 700; }

/* ===== Sprint 99: участники — статус, действия, отправка приглашения ===== */

/* Статус-чип участника/приглашения (принял / ещё не принял) */
.member-status {
  flex: none; padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
}
.member-status.ok { background: var(--status-ok-tint); color: #2E6B4C; }
.member-status.pending { background: var(--surface-sunken); color: var(--text-muted); }

/* Инлайн-действия над участником (раскрываются по «⋯») */
.member-actions {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px; margin: 0; background: var(--surface-sunken);
  border-bottom: 1px solid #F3F4F6;
}
.member-actions-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.member-actions-row select { flex: 1; min-width: 150px; }
.member-actions-row .secondary { height: 32px; }
.link.danger { color: var(--status-danger); }
button.link.danger { background: none; }
button.link.danger:hover { background: none; opacity: .85; }

/* Кнопка «Готово» в блоке доставки приглашения */
.invite-done { width: 100%; margin-top: 10px; }

/* ===== Sprint 103: настройки компании (дизайн «настройки-компании») ===== */

/* Чип компании в топбаре: аватар-инициалы + название + ▾ */
.cmp-chip { display: inline-flex; align-items: center; gap: 8px; margin-right: 4px; }
.cmp-chip-avatar {
  width: 26px; height: 26px; border-radius: 6px; background: #24262A; color: #fff;
  font-size: 10.5px; font-weight: 600; display: inline-flex; align-items: center;
  justify-content: center; letter-spacing: 0.02em;
}
.cmp-chip-name { font-size: 13px; font-weight: 500; }
.cmp-chip-caret { font-size: 10px; color: var(--text-muted); }

/* Экран настроек */
.cmp-screen { padding: 2px 0; }
.cmp-h1 { font-size: 18px; font-weight: 700; margin: 0 0 14px; }
.cmp-count { color: var(--text-muted); font-weight: 400; font-size: 15px; margin-left: 4px; }
.cmp-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 16px; align-items: start; }
.cmp-col { display: flex; flex-direction: column; gap: 16px; }
.cmp-card { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.cmp-card-flush { padding: 0; overflow: hidden; }
.cmp-card-head { display: flex; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--border-divider); }
.cmp-card-head .cmp-btn-sm { margin-left: auto; }
.cmp-card-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.cmp-card-head .cmp-card-title { margin-bottom: 0; }
.cmp-msg { font-size: 12.5px; color: #A8730A; background: #F4EAD2; border-radius: 6px; padding: 8px 12px; margin-bottom: 12px; }
.cmp-hint { font-size: 11.5px; color: var(--text-muted); line-height: 1.5; }
.cmp-opt { color: var(--text-muted); font-weight: 400; }
.cmp-empty { padding: 14px 16px; font-size: 12.5px; color: var(--text-muted); }
.cmp-warn-text { color: #A8730A; }

.cmp-logo-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.cmp-logo {
  width: 56px; height: 56px; border-radius: 8px; background: #24262A; color: #fff;
  font-size: 20px; font-weight: 600; display: inline-flex; align-items: center;
  justify-content: center; flex: none; letter-spacing: 0.02em; overflow: hidden;
}
.cmp-logo img { width: 100%; height: 100%; object-fit: cover; }
.cmp-logo-ctl { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }

.cmp-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.cmp-label { font-size: 12px; font-weight: 500; }
.cmp-field input {
  height: 38px; border: 1px solid var(--border); border-radius: 6px; padding: 0 12px;
  font-family: inherit; font-size: 13.5px;
}
.cmp-site { color: #3B6EA5; }
.cmp-save-row { display: flex; align-items: center; gap: 10px; }

.cmp-btn-primary {
  height: 36px; padding: 0 15px; background: var(--accent); color: #fff; border: none;
  border-radius: 6px; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.cmp-btn-primary:hover { background: var(--accent-hover); }
.cmp-btn-sm { height: 32px; padding: 0 13px; font-size: 12.5px; }
.cmp-btn-outline {
  height: 36px; padding: 0 13px; background: #fff; border: 1px solid var(--border); color: var(--ink);
  border-radius: 6px; font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
}
.cmp-btn-outline:hover { background: var(--surface-sunken); }
.cmp-btn-danger {
  height: 34px; padding: 0 13px; background: #fff; border: 1px solid #E5BAB4; color: #B3403A;
  border-radius: 6px; font-family: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer;
}
.cmp-btn-danger:hover { background: #FDF6F5; }
.cmp-btn-danger:disabled { opacity: 0.5; cursor: default; }
.cmp-danger { border-color: #E5BAB4; }
.cmp-danger-title { color: #B3403A; margin-bottom: 6px; }

.cmp-row-wrap { border-bottom: 1px solid var(--border-divider); }
.cmp-row-wrap:last-child { border-bottom: none; }
.cmp-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.cmp-row-main { flex: 1; min-width: 0; }
.cmp-row-title { font-size: 13.5px; font-weight: 600; }
.cmp-row-meta { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; color: var(--text-muted); }
.cmp-pill-ok {
  display: inline-flex; padding: 3px 9px; background: #E3EFE7; color: #2E6B4C;
  border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap;
}
.cmp-dots {
  width: 28px; height: 28px; padding: 0; border: 1px solid var(--border-soft); border-radius: 6px;
  background: #fff; color: var(--text-muted); cursor: pointer; font-family: inherit;
}
.cmp-dots:hover { background: var(--surface-sunken); color: var(--ink); }
.cmp-actions { display: flex; align-items: center; gap: 14px; padding: 8px 16px 12px; flex-wrap: wrap; }
.cmp-actions select { height: 30px; border: 1px solid var(--border); border-radius: 6px; font-family: inherit; font-size: 12.5px; }

.cmp-dropzone {
  width: 100%; height: auto; border: 1.5px dashed #C9CDD2; border-radius: 8px; padding: 14px;
  background: #fff; text-align: center; font-size: 12.5px; color: var(--text-muted); font-weight: 400;
  font-family: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 3px; align-items: center;
}
.cmp-dropzone:hover { border-color: var(--accent); background: #fff; }
.cmp-dz-sub { font-size: 12.5px; }
.cmp-dz-link { color: var(--accent); font-weight: 500; }
.cmp-or { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.cmp-or span { flex: 1; height: 1px; background: var(--border-soft); display: block; }
.cmp-or b { font-size: 12px; color: var(--text-muted); font-weight: 400; }
.cmp-entity-form { border-top: 1px solid var(--border-divider); margin-top: 12px; padding-top: 12px; }

/* Сотрудники */
.emp-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.emp-head .cmp-btn-primary { margin-left: auto; }
.emp-head .cmp-h1 { margin: 0; }
.emp-invite-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.emp-invite-form .cmp-field { margin-bottom: 0; }
.emp-contact-field { flex: 1; min-width: 220px; }
.emp-invite-form select { height: 36px; min-width: 190px; border: 1px solid var(--border); border-radius: 6px; font-family: inherit; font-size: 13px; padding: 0 8px; }
.emp-invite-form input { height: 36px; }
.emp-invite-result { margin-top: 10px; }
.emp-invite-link { display: flex; align-items: center; gap: 10px; font-size: 12.5px; flex-wrap: wrap; }
.emp-invite-link a { word-break: break-all; }
#employeesScreen .cmp-card-flush { margin-top: 14px; }

.emp-row {
  /* Задача 10.6: сотрудник · должность · доступ · контакт · статус · меню. */
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.1fr 1fr 0.3fr; gap: 12px;
  padding: 11px 16px; align-items: center;
}
.emp-row-head {
  padding: 9px 16px; border-bottom: 1px solid var(--border-soft);
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-muted);
}
.emp-who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.emp-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: #D9DCE0; color: #5A616A;
  font-size: 10px; font-weight: 600; display: inline-flex; align-items: center;
  justify-content: center; flex: none;
}
.emp-avatar-invited { background: transparent; border: 1.5px dashed #C9CDD2; color: var(--text-muted); font-size: 12px; }
.emp-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emp-you { color: var(--text-muted); font-weight: 400; }
.emp-dept {
  display: inline-flex; padding: 3px 8px; border: 1px solid var(--border); color: var(--text-secondary);
  border-radius: 4px; font-size: 12px; font-weight: 500; white-space: nowrap;
}
.emp-contact { font-size: 12.5px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; }
.emp-status { display: inline-flex; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.emp-status.ok { background: #E3EFE7; color: #2E6B4C; }
.emp-status.warn { background: #F4EAD2; color: #8F6209; }
/* Вторая строка под чипом (пользовательская роль) — переносится, не обрезается. */
.emp-delivery { margin-top: 4px; font-size: 11.5px; color: var(--text-secondary); }

/* ===== Задача 10.8: окно передачи приглашения ===== */
.invmodal-backdrop {
  position: fixed; inset: 0; background: rgba(28, 30, 34, .62);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  z-index: var(--z-overlay, 1200);
}
.invmodal {
  background: var(--surface); border-radius: 12px; padding: 18px 20px 20px;
  width: 420px; max-width: min(92vw, 420px); max-height: 90vh; overflow: auto;
  display: flex; flex-direction: column; gap: 12px;
}
.invmodal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.invmodal-title { font-size: 17px; font-weight: 600; margin: 0; }
.invmodal-close {
  border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer;
  color: var(--text-muted); padding: 0 2px;
}
.invmodal-summary { display: flex; flex-direction: column; gap: 6px; }
.invmodal-row { display: flex; gap: 10px; font-size: 13px; }
.invmodal-label { color: var(--text-muted); min-width: 132px; flex: none; }
.invmodal-value { color: var(--ink); word-break: break-word; }
/* Кнопки в колонку: на телефоне это единственная читаемая раскладка, а на
   десктопе окно узкое и три кнопки в строку всё равно не помещаются. */
.invmodal-actions { display: flex; flex-direction: column; gap: 8px; }
/* Цвет текста задаём явно: глобальное правило для button красит подпись в белый
   под акцентную заливку, а здесь фон светлый — иначе кнопка выглядит пустой. */
.invmodal-btn {
  height: 38px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--ink);
  font-family: inherit; font-size: 13.5px; cursor: pointer;
}
.invmodal-btn:hover { background: var(--surface-sunken, #F2F3F5); color: var(--ink); }
.invmodal-note { font-size: 12.5px; color: var(--text-secondary); min-height: 16px; }
.invmodal-qr { display: flex; flex-direction: column; gap: 8px; align-items: center; }
/* QR не должен вылезать за окно ни на десктопе, ни на узком экране. */
.invmodal-qr img { width: 100%; max-width: 240px; height: auto; display: block; }
.invmodal-qr .cmp-hint, .invmodal-qr .cmp-warn-text { text-align: center; }

@media (max-width: 480px) {
  .invmodal { width: 100%; max-width: 100%; padding: 16px; }
  .invmodal-row { flex-direction: column; gap: 2px; }
  .invmodal-label { min-width: 0; }
  .invmodal-qr img { max-width: 200px; }
}

@media (max-width: 900px) {
  .cmp-grid { grid-template-columns: 1fr; }
  /* На узком экране остаются сотрудник, должность и контакт — как и раньше
     скрываем хвост строки, добавив к нему новую колонку доступа. */
  .emp-row { grid-template-columns: 1.4fr 1fr 1fr; }
  .emp-row > div:nth-child(3), .emp-row > div:nth-child(5),
  .emp-row > div:nth-child(6) { display: none; }
}

/* ===== Sprint 106.1: инвайт сбоку от сотрудников; Компания — политика/брендинг/шаблоны ===== */

.emp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
#employeesScreen .emp-layout .cmp-card-flush { margin: 0; }
.emp-invite-side .emp-invite-form { flex-direction: column; align-items: stretch; }
.emp-invite-side .emp-contact-field { min-width: 0; }
.emp-invite-side .emp-invite-form select { min-width: 0; width: 100%; }

.cmp-policy-row {
  display: flex; align-items: center; gap: 9px; padding: 6px 8px; margin: 0 -8px;
  width: calc(100% + 16px);
  border: 0; background: none; font-family: inherit; font-size: 13px;
  color: var(--text-secondary); cursor: pointer; text-align: left;
}
.cmp-policy-row.active { color: var(--ink); cursor: default; }
/* Отменяем глобальный button:hover (акцентная заливка): пункт — не кнопка-CTA. */
.cmp-policy-row:hover { background: var(--surface-sunken); border-radius: 6px; }
.cmp-policy-row.active:hover { background: none; }
.cmp-radio { width: 16px; height: 16px; border-radius: 999px; border: 1.5px solid #C9CDD2; flex: none; box-sizing: border-box; }
.cmp-radio.on { border: 5px solid var(--accent); }
.cmp-brand-text { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }
.cmp-link-btn { border: 0; background: none; padding: 0; font-family: inherit; font-size: 12.5px; color: var(--accent); font-weight: 500; cursor: pointer; }
.cmp-link-btn:hover { background: none; color: var(--accent-hover); }
/* Sprint 111 (волна I): выбор фирменного цвета. */
.cmp-brand-row { display: flex; align-items: center; gap: 12px; margin: 12px 0 4px; }
.cmp-color { width: 44px; height: 32px; padding: 0; border: 1px solid #D7DBDF; border-radius: 6px; background: none; cursor: pointer; }
.cmp-brand-swatch { width: 26px; height: 26px; border-radius: 6px; border: 1px solid rgba(0,0,0,.12); display: inline-flex; align-items: center; justify-content: center; font-size: 9px; color: #fff; text-align: center; line-height: 1.1; }
.cmp-brand-hex { font-size: 12.5px; font-weight: 600; letter-spacing: .3px; color: var(--ink); }
.cmp-tpl-head { padding: 11px 14px; border-bottom: 1px solid #EEF0F2; font-size: 14px; font-weight: 600; }
.cmp-tpl-row { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid #EEF0F2; }
.cmp-tpl-row:last-child { border-bottom: 0; }
.cmp-tpl-name { flex: 1; font-size: 13px; }
.cmp-tpl-row .cmp-link-btn { font-size: 11.5px; }
.cmp-tpl-soon { font-size: 11.5px; color: #8A9096; }

@media (max-width: 900px) {
  .emp-layout { grid-template-columns: 1fr; }
}

/* ===== Sprint 108 (Стадия 2, волна A): ревью отчётов во вкладке «Отчёты и замечания» ===== */

.vr-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.vr-row { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.vr-head {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 14px; border: 0; background: none; font-family: inherit;
  font-size: 13px; color: var(--ink); cursor: pointer; text-align: left;
}
.vr-head:hover { background: #FBFAF9; }
.vr-head b { font-weight: 600; }
.vr-date { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; color: var(--text-muted); }
.vr-defects { font-size: 11.5px; color: #B3403A; }
.vr-pill {
  margin-left: auto; display: inline-flex; padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
}
.vr-pill.ok { background: #E3EFE7; color: #2E6B4C; }
.vr-pill.ok-outline { background: none; border: 1px solid #BFD9CA; color: #2E6B4C; }
.vr-pill.warn { background: #F4EAD2; color: #8F6209; }
.vr-pill.danger { background: #F9E7E5; color: #B3403A; }
.vr-pill.muted { background: #EEF0F2; color: #5C636B; }
.vr-returned {
  margin: 0 14px 10px; padding: 8px 10px; background: #F9E7E5;
  border: 1px solid #E5BAB4; border-radius: 6px; font-size: 12.5px; color: #B3403A;
}
.vr-detail { padding: 0 14px 12px; border-top: 1px solid var(--border-soft); }
.vr-review-row { display: flex; gap: 8px; margin: 10px 0 0; }
.vr-return-box { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.vr-return-box textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 6px;
  font-family: inherit; font-size: 13px; padding: 8px 10px; resize: vertical;
}
.card-more-menu { right: 0; }

/* ===== Sprint 110: параметры v3 (дизайн «параметры-редактор») ===== */

.pv3-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.pv3-head b { font-size: 14px; }
.pv3-fillpill {
  display: inline-flex; padding: 3px 9px; background: #F4EAD2; color: #8F6209;
  border-radius: 999px; font-size: 11.5px; font-weight: 600;
}
.pv3-fillpill.full { background: #E3EFE7; color: #2E6B4C; }
.pv3-set { font-size: 12px; color: var(--text-muted); }
.pv3-editbtn { margin-left: auto; }
.pv3-progress { height: 5px; border-radius: 3px; background: #EEF0F2; overflow: hidden; margin-bottom: 14px; }
.pv3-progress div { height: 100%; background: #2E7D52; }
.pv3-primary-intro {
  margin: 0 0 10px; padding: 9px 12px; border: 1px solid #E3E7EA; border-radius: 8px;
  color: var(--text-secondary); font-size: 12px; line-height: 1.45; background: #FAFBFB;
}
.pv3-primary-intro b { color: var(--ink); }
.pv3-primary-grid { margin-bottom: 14px; }
.pv3-primary-row { align-items: flex-start; }
.pv3-primary-value { flex-wrap: wrap; }
.pv3-select { width: 100%; box-shadow: none; background: #fff; }
.pv3-evidence { flex-basis: 100%; font-size: 11px; color: var(--text-muted); }
.pv3-evidence summary { cursor: pointer; user-select: none; width: max-content; }
.pv3-evidence div { margin-top: 4px; line-height: 1.45; }
.pv3-legacy-source { margin-top: 2px; }
.pv3-level { margin-top: 4px; }
.pv3-level > summary {
  cursor: pointer; list-style-position: inside; padding: 10px 2px; font-size: 13px;
  font-weight: 700; color: var(--text-secondary);
}
.pv3-level-body { padding-top: 2px; }
.pv3-toolbar {
  background: #F6E9E1; border: 1px solid #E7CDBC; border-radius: 8px;
  padding: 8px 8px 8px 14px; display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.pv3-toolbar-note { flex: 1; min-width: 220px; font-size: 12.5px; color: #8A4B29; line-height: 1.35; }
.pv3-reason {
  height: 34px; min-width: 250px; background: #fff; border: 1px solid #E7CDBC;
  border-radius: 6px; padding: 0 11px; font-family: inherit; font-size: 12.5px;
}
.pv3-save { white-space: nowrap; }
.pv3-cancel { color: #8A4B29; }
.pv3-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.pv3-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.pv3-card-head {
  padding: 8px 14px; background: #F6F7F8; border-bottom: 1px solid #EEF0F2;
  display: flex; align-items: center; gap: 8px;
}
.pv3-card-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text-secondary);
}
.pv3-card-count { margin-left: auto; font-size: 11px; color: var(--text-muted); }
.pv3-delsection { font-size: 11px; color: #B3403A; }
.pv3-delsection:hover { color: #8f2f2b; }
.pv3-row {
  display: flex; align-items: center; gap: 10px; padding: 7px 14px;
  border-bottom: 1px solid #F5F6F7;
}
.pv3-row.hidden .pv3-label, .pv3-row.hidden .pv3-value-text { text-decoration: line-through; color: var(--text-muted); }
.pv3-label { width: 40%; flex: none; font-size: 12.5px; color: var(--text-muted); }
.pv3-value { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.pv3-value-text { font-size: 12.5px; font-weight: 500; cursor: default; }
.pv3-value-text.empty { color: var(--text-muted); font-weight: 400; }
.pv3-row .pv3-value-text[tabindex] { cursor: pointer; }
.pv3-input {
  flex: 1; border: 1.5px solid var(--accent); border-radius: 6px; padding: 6px 10px;
  font-family: inherit; font-size: 12.5px; box-shadow: 0 0 0 3px rgba(192, 91, 46, 0.10);
  min-width: 0;
}
.pv3-was {
  display: inline-flex; padding: 2px 7px; background: #E6EDF5; color: #3B6EA5;
  border-radius: 999px; font-size: 10.5px; font-weight: 600; white-space: nowrap;
}
.pv3-clarify {
  display: inline-flex; align-items: center; width: auto; height: auto; min-height: 0;
  padding: 3px 8px; background: #F4EAD2; color: #8F6209;
  border: 0; border-radius: 9px; font: inherit; font-size: 10.5px; font-weight: 600;
  line-height: 1.15; white-space: nowrap; cursor: pointer;
}
.pv3-clarify:hover { background: #ECDDCA; }
.pv3-hide { font-size: 11.5px; }
.pv3-addrow { display: flex; gap: 8px; padding: 9px 14px; }
.pv3-addrow .pv3-input { border-color: var(--border); box-shadow: none; }
.pv3-addname { width: 40%; flex: none; }
.pv3-addsection { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.pv3-addsection .pv3-input {
  border: 1.5px dashed #C9CDD2; box-shadow: none; background: var(--surface);
  font-weight: 600; color: var(--accent); max-width: 280px;
}
.pv3-addhint { font-size: 11.5px; }
.pv3-rules {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 14px; margin-top: 12px;
}
.pv3-rules b { font-size: 12px; }
.pv3-rules p { margin: 6px 0 0; font-size: 11.5px; color: var(--text-secondary); line-height: 1.65; }

/* Наборы параметров компании (экран 02) */
.pset-layout { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.pset-row {
  display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 10px 14px;
  border: 0; border-bottom: 1px solid #EEF0F2; background: none; font-family: inherit;
  text-align: left; cursor: pointer;
}
.pset-row.active { background: #FBF8F6; }
.pset-row b { font-size: 12.5px; font-weight: 600; }
.pset-row small { font-size: 11px; color: var(--text-muted); }
.pset-create { padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }
.pset-create input[type="text"], .pset-create input:not([type]) {
  height: 34px; border: 1px solid var(--border); border-radius: 6px; padding: 0 10px;
  font-family: inherit; font-size: 12.5px;
}
.pset-ways { display: flex; gap: 6px; flex-wrap: wrap; }
.pset-editor-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.pset-name {
  flex: 1; font-size: 14px; font-weight: 700; border: 1px solid transparent;
  border-radius: 6px; padding: 4px 8px; font-family: inherit;
}
.pset-name:focus { border-color: var(--border); outline: none; }
.pset-version {
  display: inline-flex; padding: 3px 9px; border: 1px solid var(--border);
  color: var(--text-secondary); border-radius: 4px; font-size: 11.5px; font-weight: 500;
}
.pset-sections { display: flex; flex-direction: column; gap: 10px; }
.pset-section { border: 1px solid #E8EAED; border-radius: 8px; overflow: hidden; }
.pset-section-head {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px;
  background: #F6F7F8; border-bottom: 1px solid #EEF0F2;
}
.pset-section-head input {
  flex: 1; border: 1px solid transparent; background: none; font-family: inherit;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-secondary); border-radius: 4px; padding: 3px 6px;
}
.pset-section-head input:focus { border-color: var(--border); background: #fff; outline: none; }
.pset-param { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-bottom: 1px solid #F5F6F7; }
.pset-param input[type="text"], .pset-param input:not([type]):not([type="checkbox"]) {
  flex: 1; border: 1px solid transparent; font-family: inherit; font-size: 12.5px;
  border-radius: 4px; padding: 4px 6px;
}
.pset-param input:focus { border-color: var(--border); outline: none; }
.pset-req { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.pset-addparam, .pset-addsection {
  border: 1px dashed #C9CDD2; border-radius: 6px; padding: 6px 10px; margin: 8px 12px;
  font-family: inherit; font-size: 12.5px; color: var(--accent); width: calc(100% - 24px);
}
.pset-addsection { margin: 12px 0 0; width: 280px; }
.pset-archive { margin-top: 12px; color: #B3403A; }

@media (max-width: 900px) {
  .pv3-grid { grid-template-columns: 1fr; }
  .pset-layout { grid-template-columns: 1fr; }
}

/* ===== Sprint 111: задачи-поручения ===== */

.task-form { margin-bottom: 12px; padding: 12px 14px; }
.task-form-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.task-form-title {
  flex: 1 1 260px; height: 34px; border: 1px solid var(--border); border-radius: 6px;
  padding: 0 11px; font-family: inherit; font-size: 13px;
}
.task-form-due {
  height: 34px; border: 1px solid var(--border); border-radius: 6px;
  padding: 0 8px; font-family: inherit; font-size: 12.5px;
}
.vtask-prio { color: #B3403A; font-size: 11px; font-weight: 700; text-transform: uppercase; }

/* ===== Sprint 104: «Контрольные точки» + библиотека шаблонов (дизайн «контрольные-точки») ===== */

/* Рабочий режим: шапка плана (одна строка; длинное имя — «…», клик раскрывает) */
.ctb-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ctb-title-box { flex: 1; min-width: 0; }
.ctb-title {
  font-size: 15px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.ctb-title.full { white-space: normal; overflow: visible; }
.ctb-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
/* Компактная сводка под заголовком: этапы, точки, проверено, замечания. */
.ctb-summary { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctb-summary-issues.has-issues { color: #B3403A; font-weight: 600; }
.ctb-hint { font-size: 12.5px; color: var(--text-muted); }
.ctb-approved {
  display: inline-flex; padding: 3px 9px; background: #E3EFE7; color: #2E6B4C;
  border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; flex: none;
}
.ctb-actions { margin-left: auto; display: flex; gap: 8px; flex: none; }
.ctb-assign-btn { height: 34px; padding: 0 14px; font-size: 13px; font-weight: 600; }
.ctb-edit-btn { height: 34px; padding: 0 14px; font-size: 13px; font-weight: 600; gap: 7px; border-color: #C9CDD2; }
.ctb-cancel { margin-left: auto; height: 32px; padding: 0 13px; color: var(--text-secondary); font-size: 12.5px; font-weight: 500; }

/* Карточка этапов */
.ctb-card { background: #fff; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.ctb-stage-wrap { border-bottom: 1px solid var(--border-divider); }
.ctb-stage-wrap:last-child { border-bottom: none; }
.ctb-stage { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.ctb-stage.selectable { cursor: pointer; }
.ctb-stage.locked { opacity: 0.55; }
.ctb-num { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--text-muted); width: 20px; flex: none; }
.ctb-stage-title { flex: 1; font-size: 13.5px; font-weight: 600; min-width: 0; }
.ctb-whole { color: var(--accent-hover); font-weight: 500; }
.ctb-progress {
  width: 120px; height: 4px; border-radius: 2px; background: var(--border-divider);
  overflow: hidden; flex: none; display: inline-block;
}
.ctb-progress i { display: block; height: 100%; background: var(--accent); }
.ctb-progress i.done { background: #2E7D52; }
.ctb-count { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--text-muted); width: 46px; text-align: right; flex: none; }
.ctb-count.ok { color: #2E6B4C; }
.ctb-chip { display: inline-flex; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; flex: none; }
.ctb-chip.accepted { background: #E3EFE7; color: #2E6B4C; }
.ctb-chip.in_progress { background: var(--accent-tint); color: var(--accent-hover); }
.ctb-chip.pending { background: var(--border-divider); color: #6B7178; }
.ctb-chev { font-size: 11px; color: var(--text-muted); background: none; border: none; height: auto; padding: 0 2px; flex: none; }
.ctb-chev:hover { background: none; color: var(--ink); }

/* Раскрытые точки этапа */
.ctb-points { padding: 0 16px 12px 48px; display: flex; flex-direction: column; background: #FBFBFC; }
.ctb-point { display: flex; align-items: center; gap: 10px; min-height: 40px; border-bottom: 1px solid #F0F2F4; padding: 4px 0; }
.ctb-point:last-child { border-bottom: none; }
.ctb-point.selectable { cursor: pointer; }
.ctb-mark {
  width: 22px; height: 22px; border-radius: 999px; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; flex: none; color: #fff;
}
.ctb-mark.accepted { background: #2E7D52; }
.ctb-mark.issue { background: #A8730A; }
.ctb-mark.pending { background: none; border: 1.5px solid var(--border); }
.ctb-point-main { flex: 1; min-width: 0; }
.ctb-point-title { font-size: 13px; }
.ctb-point-title.issue { font-weight: 500; }
.ctb-point-title.pending { color: var(--text-secondary); }
.ctb-req { font-family: ui-monospace, Menlo, monospace; font-size: 10.5px; color: var(--text-muted); margin-top: 1px; }
.ctb-req.strict { color: #A8730A; }
.ctb-when { font-size: 11.5px; color: var(--text-muted); flex: none; }
.ctb-when.muted { color: var(--text-disabled); }
.ctb-task-link { font-size: 11.5px; font-weight: 500; flex: none; }
.ctb-more { background: none; border: none; height: auto; color: var(--text-muted); font-size: 11.5px; padding: 8px 0 2px 32px; text-align: left; font-weight: 400; }
.ctb-more:hover { background: none; color: var(--ink); }

/* Режим «Поручить контроль»: чекбоксы и sticky-бар */
.ctb-check {
  width: 18px; height: 18px; border-radius: 4px; border: 1.5px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  font-size: 11px; font-weight: 700; color: #fff; position: relative; background: #fff;
}
.ctb-check.on { background: var(--accent); border-color: var(--accent); }
.ctb-check.disabled { background: var(--bg); border-color: var(--border-soft); }
.ctb-check-part { position: absolute; inset: 3px; background: var(--accent); border-radius: 2px; opacity: 0.45; }
.ctb-stage.picked { background: #FBF8F6; }
.ctb-assignbar {
  position: sticky; top: 8px; margin: 0 0 14px; background: var(--ink); border-radius: 8px;
  padding: 12px 16px; display: flex; align-items: center; gap: 14px;
  box-shadow: 0 12px 32px rgba(32, 34, 38, 0.25); flex-wrap: wrap; z-index: 4;
}
.ctb-assignbar-text { font-size: 13px; color: #fff; font-weight: 500; }
.ctb-assignbar-total { color: #9BA1A8; }
.ctb-assignbar-controls { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ctb-assignbar-select {
  height: 34px; min-width: 200px; background: #2E3237; border: 1px solid #3A3E44; border-radius: 6px;
  color: #fff; font-family: inherit; font-size: 12.5px; padding: 0 11px;
}
.ctb-assignbar-select.due { min-width: 110px; }
.ctb-assignbar-select.duedate { min-width: 140px; color-scheme: dark; }

/* Редактор: баннер режима правки утверждённого плана */
.cl-editbanner {
  background: var(--accent-tint); border: 1px solid #E7CDBC; border-radius: 8px;
  padding: 8px 8px 8px 14px; display: flex; align-items: center; gap: 12px; margin: 0 0 14px;
  min-width: 0;
}
.cl-editbanner-text { flex: 1; min-width: 0; font-size: 12.5px; color: #8A4B29; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-editbanner-save {
  height: 34px; padding: 0 13px; border: 1px solid #E7CDBC; background: #fff; color: #8A4B29;
  border-radius: 6px; font-size: 13px; font-weight: 500; flex: none; white-space: nowrap;
}
.cl-editbanner-save:hover { background: #FDFBFA; }
.cl-editbanner-finish { height: 34px; padding: 0 15px; font-size: 13px; font-weight: 600; flex: none; white-space: nowrap; }
.cl-lock { flex: none; font-size: 12px; }
.cl-point.locked { opacity: 0.75; }
.cl-point.locked .cl-point-text { color: var(--text-secondary); }
.cl-drag.disabled { color: var(--border-soft); cursor: default; }
.cl-lock-note { font-size: 12px; color: var(--text-muted); background: var(--surface-sunken); border-radius: 6px; padding: 7px 10px; margin-bottom: 10px; }

/* Диалог «Куда применить изменения?» */
.apply-overlay {
  position: fixed; inset: 0; background: rgba(32, 34, 38, 0.45);
  display: flex; align-items: center; justify-content: center; z-index: 60; padding: 16px;
}
.apply-dialog {
  background: #fff; border-radius: 10px; padding: 24px; width: 464px; max-width: 100%;
  box-shadow: 0 12px 32px rgba(32, 34, 38, 0.30); max-height: 90vh; overflow: auto;
}
.apply-title { font-size: 17px; font-weight: 700; }
.apply-sub { font-size: 12.5px; color: var(--text-muted); margin: 3px 0 16px; }
.apply-options { display: flex; flex-direction: column; gap: 8px; }
.apply-option {
  border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px;
  display: flex; gap: 11px; cursor: pointer;
}
.apply-option.selected { border: 1.5px solid var(--accent); background: #FBF6F2; }
.apply-radio {
  width: 18px; height: 18px; border-radius: 999px; border: 1.5px solid #C9CDD2; flex: none;
  margin-top: 1px; box-sizing: border-box; background: #fff;
}
.apply-radio.on { border: 5px solid var(--accent); }
.apply-option-title { font-size: 13.5px; font-weight: 600; }
.apply-option-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.45; margin-top: 2px; }
.apply-name { height: 36px; border: 1px solid var(--border); border-radius: 6px; padding: 0 11px; font-family: inherit; font-size: 13px; margin-top: 8px; width: 100%; }
.apply-buttons { display: flex; gap: 10px; margin-top: 16px; align-items: center; }
.apply-save { height: 40px; padding: 0 18px; font-size: 13.5px; font-weight: 600; }
.apply-cancel { color: var(--text-secondary); font-size: 13.5px; font-weight: 500; }

/* «Компания»: вкладки раздела */
.cmp-tabs { display: flex; gap: 2px; border-bottom: 1px solid #E3E5E8; margin-bottom: 14px; font-size: 13px; }
.cmp-tabs button {
  background: none; border: none; height: auto; padding: 8px 12px; color: var(--text-secondary);
  font-size: 13px; font-weight: 400; border-radius: 0;
}
.cmp-tabs button:hover { background: none; color: var(--ink); }
.cmp-tabs button.active { color: var(--ink); font-weight: 600; border-bottom: 2px solid var(--accent); margin-bottom: -1px; }

/* Библиотека шаблонов */
.lib-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.lib-h1 { font-size: 16px; font-weight: 700; }
.lib-head .cmp-btn-primary { margin-left: auto; }
.lib-paths { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.lib-path {
  background: #fff; border: 1.5px dashed #C9CDD2; border-radius: 8px; padding: 14px;
  text-align: center; height: auto; font-family: inherit; display: flex; flex-direction: column;
  gap: 3px; align-items: center; color: var(--ink); font-weight: 400;
}
.lib-path:hover { background: #fff; border-color: var(--accent); }
.lib-path b { font-size: 13px; font-weight: 600; }
.lib-path span { font-size: 11.5px; color: var(--text-muted); line-height: 1.45; }
.lib-path-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.lib-path-form select, .lib-path-form input {
  height: 36px; border: 1px solid var(--border); border-radius: 6px; font-family: inherit;
  font-size: 13px; padding: 0 10px; min-width: 200px;
}
.lib-row {
  display: grid; grid-template-columns: 2.1fr 1fr 1.1fr 0.9fr 0.9fr 0.3fr; gap: 12px;
  padding: 11px 16px; align-items: center;
}
.lib-row-head {
  padding: 9px 16px; border-bottom: 1px solid var(--border-soft);
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-muted);
}
.lib-name { font-size: 13.5px; font-weight: 600; }
.lib-version { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--text-muted); font-weight: 400; }
.lib-cell { font-size: 12.5px; color: var(--text-secondary); }
.lib-cell.muted { color: var(--text-muted); }
.lib-hint { margin-top: 10px; }

@media (max-width: 900px) {
  .lib-paths { grid-template-columns: 1fr; }
  .lib-row { grid-template-columns: 1.6fr 1fr 0.4fr; }
  .lib-row > div:nth-child(3), .lib-row > div:nth-child(4), .lib-row > div:nth-child(5) { display: none; }
  .ctb-assignbar-select { min-width: 150px; }
}

/* --- Sprint 105: жизненный цикл объекта (стадии, воронка, карточка до стройки) --- */

/* Пилюли-фильтры стадий */
.stage-pills { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.stage-pill {
  height: auto; padding: 5px 11px; border-radius: 999px; font-size: 12.5px;
  background: var(--surface); border: 1px solid var(--border); color: #5C636B; font-weight: 400;
}
.stage-pill:hover { border-color: #C05B2E; color: #A64E27; }
.stage-pill.active { background: #F6E9E1; border-color: #F6E9E1; color: #A64E27; font-weight: 600; }

/* Чипы стадий */
.lc-chip {
  display: inline-block; padding: 3px 8px; border-radius: 4px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.lc-chip.lc-design { background: #E6EDF5; color: #3B6EA5; }
.lc-chip.lc-contract_not_concluded { background: #ECEDEF; color: #5C636B; }
.lc-chip.lc-contract { background: #F4EAD2; color: #8F6209; }
.lc-chip.lc-construction { background: #F6E9E1; color: #A64E27; }
.lc-chip.lc-construction_in_progress { background: #F6E9E1; color: #A64E27; }
.pt-row.lc-build { background: #FBF8F6; }
.pt-row.lc-build:hover { background: #F7F2EE; }
.pt-step { font-size: 12.5px; color: #5C636B; }
.pt-updated { font-size: 12px; }

/* Степпер стадий в карточке */

/* Заблокированная вкладка «Контрольные точки» до стройки */
.object-tabs button.locked { color: #B3B8BE; cursor: default; }
.object-tabs button.locked:hover { color: #B3B8BE; border-color: transparent; }
.lc-locked-note { font-size: 13px; color: var(--text-muted); margin: 8px 0; }

/* Обзор стадии: чек-лист «Что нужно на этой стадии» */
.lc-checklist { display: flex; flex-direction: column; }
.lc-checkrow {
  display: flex; align-items: center; gap: 10px; min-height: 38px;
  border-bottom: 1px solid #F0F2F4; padding: 4px 0;
}
.lc-checkrow:last-child { border-bottom: none; }
.lc-checkmark {
  width: 20px; height: 20px; min-width: 20px; border-radius: 50%; padding: 0;
  background: var(--surface); border: 1.5px solid #D8DBDF; color: #fff; font-size: 11px;
  display: inline-flex; align-items: center; justify-content: center; height: 20px;
}
.lc-checkrow.done .lc-checkmark { background: #2E7D52; border-color: #2E7D52; }
.lc-checktext { flex: 1; font-size: 13px; min-width: 0; overflow-wrap: anywhere; }
.lc-checkrow.done .lc-checktext { color: #5C636B; }
.lc-checkstate { font-size: 11.5px; color: #B3B8BE; white-space: nowrap; }
.lc-state-build[hidden] { display: none; }
.lc-stagehint { font-size: 11.5px; color: var(--text-muted); margin: 10px 0 0; }

/* Документы стадии */
.lc-stagedocs .panel-title { display: flex; align-items: center; justify-content: space-between; }
button.lc-alldocs { background: none; border: none; height: auto; padding: 0; color: #C05B2E; font-size: 12px; font-weight: 500; }
button.lc-alldocs:hover { color: #A64E27; background: none; }
.lc-docrow { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid #F0F2F4; }
.lc-docrow:last-child { border-bottom: none; }
.lc-docrow b { display: block; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.lc-docrow small { font-size: 11.5px; color: var(--text-muted); }
.lc-docsempty { font-size: 12.5px; color: var(--text-muted); margin: 6px 0 0; }
.doc-tile {
  width: 30px; height: 30px; min-width: 30px; border-radius: 6px; background: var(--surface-sunken);
  color: #5C636B; font-size: 9px; font-weight: 700; font-family: ui-monospace, monospace;
  display: inline-flex; align-items: center; justify-content: center;
}

/* Сводка и «Заказчик ещё не приглашён» */
.lc-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.lc-note { font-size: 12.5px; color: var(--text-secondary, #5C636B); margin: 8px 0 0; }
.lc-invitecard {
  background: #F2F3F5; border: 1.5px dashed #C9CDD2; border-radius: 8px;
  padding: 12px 14px; margin-top: 14px;
}
.lc-invitecard b { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.lc-invitecard p { font-size: 12px; color: var(--text-muted); margin: 0 0 8px; }
.lc-advwarn { font-size: 12.5px; color: #8F6209; background: #F4EAD2; border-radius: 6px; padding: 8px 10px; margin: 8px 0; }

/* Модал «Новый объект»: плитки стадий и форма */
.lc-modal { max-width: 560px; }
.lc-tiles { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin: 10px 0 14px; }
.lc-tile {
  height: auto; padding: 9px 6px; border-radius: 8px; font-size: 12.5px; font-weight: 400;
  background: var(--surface); border: 1.5px solid #D8DBDF; color: #5C636B;
}
.lc-tile:hover { border-color: #C05B2E; color: #A64E27; }
.lc-tile.active { border-color: #C05B2E; background: #F6E9E1; color: #A64E27; font-weight: 700; }
.lc-drop {
  border: 1.5px dashed #C9CDD2; border-radius: 8px; padding: 14px; text-align: center;
  cursor: pointer; margin-bottom: 10px;
}
.lc-drop:hover, .lc-drop.dragover { border-color: #C05B2E; }
.lc-drop b { display: block; font-size: 13px; font-weight: 600; }
.lc-drop small { font-size: 11.5px; color: #8A9096; }
.lc-files { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.lc-filerow { display: flex; align-items: center; gap: 8px; }
.lc-filerow b { font-size: 12px; font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.lc-filerow .doc-tile { width: 28px; height: 28px; min-width: 28px; }
.lc-filestatus { font-size: 10.5px; color: var(--text-muted); white-space: nowrap; margin-left: auto; }
.lc-filestatus.ok { color: #2E7D52; }
.lc-or { display: flex; align-items: center; gap: 10px; margin: 10px 0; color: #8A9096; font-size: 11.5px; }
.lc-or::before, .lc-or::after { content: ""; flex: 1; height: 1px; background: var(--divider); }
/* Единая раскладка полей модала: метка над полем, поле на всю ширину колонки.
   Без этого базовый input (без width:100%) и inline-label «разъезжаются». */
.lc-form { display: flex; flex-direction: column; gap: 10px; }
.lc-modal .field { display: flex; flex-direction: column; gap: 4px; margin: 0; min-width: 0; }
.lc-modal .field label {
  font-size: 12px; font-weight: 500; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lc-modal .field input, .lc-modal .field select, .lc-modal .field textarea {
  width: 100%; box-sizing: border-box;
}
.lc-fieldrow { display: flex; gap: 10px; align-items: flex-start; }
.lc-fieldrow .field { flex: 1; min-width: 0; }
.lc-fieldrow .lc-grow { flex: 1.4; }
.lc-tag { color: #2E7D52; font-size: 10.5px; margin-left: 6px; text-transform: none; letter-spacing: 0; }
input.lc-recognized, textarea.lc-recognized { border-color: #BFD9CA; background: #FBFDFB; }
.lc-create-actions { display: flex; gap: 8px; margin-top: 14px; }
.lc-create-actions button { height: 40px; }
.lc-create { flex: 1; }
.lc-cancel { flex: 0 0 auto; }
.lc-hint { font-size: 11.5px; color: var(--text-muted); text-align: center; margin: 8px 0 0; }
.lc-altpath { text-align: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--divider); }
.lc-altpath .link { font-size: 12.5px; }

@media (max-width: 720px) {
  /* Мобильная строка воронки: чип стадии — в правый верхний угол */
  .pt-row > .pt-cell:nth-child(5) { grid-column: 1 / -1; grid-row: auto; justify-self: start; }
  .pt-row > .pt-cell:nth-child(2) { grid-column: 2; grid-row: 1; justify-self: end; }
  .lc-fieldrow { flex-direction: column; gap: 10px; }
}

/* --- Sprint 106: кабинет v2 (дизайн «кабинет-прототип-v2») --- */

/* Каркас разделов */
.v2-screen { min-width: 0; }
.screen-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.screen-head h1 { margin: 0; font-size: 19px; font-weight: 700; }
.v2-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
button.v2-secondary {
  height: 34px; padding: 0 13px; border: 1px solid #D8DBDF; background: var(--surface);
  color: var(--ink); border-radius: 6px; font-size: 13px; font-weight: 500; white-space: nowrap;
}
button.v2-secondary:hover { background: var(--surface-sunken); }
.v2-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.v2-panel-title { padding: 11px 14px; border-bottom: 1px solid var(--divider); font-size: 14px; font-weight: 600; }
.v2-empty-row { padding: 12px 14px; font-size: 12.5px; color: var(--text-muted); }
.v2-hidden-card {
  background: var(--surface-sunken); border: 1px dashed #C9CDD2; border-radius: 8px; padding: 14px;
}
.v2-hidden-card b { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.v2-hidden-card p { margin: 0; font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

/* Топбар: колокольчик уведомлений */
button.bell {
  position: relative; width: 30px; height: 30px; min-width: 30px; padding: 0;
  border: 1px solid #E0E2E5; border-radius: 6px; background: var(--surface);
  font-size: 13px; color: #5C636B; display: inline-flex; align-items: center; justify-content: center;
}
button.bell:hover { background: var(--surface-sunken); }
.bell-badge {
  position: absolute; top: -4px; right: -4px; min-width: 15px; height: 15px;
  background: #C05B2E; color: #fff; border-radius: 999px; font-size: 9.5px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
}

/* Главная: KPI и панели */
.dash-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 16px; }
.kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
.kpi-card b { display: block; font-size: 22px; font-weight: 700; }
.kpi-card span { font-size: 12px; color: #5C636B; }
.kpi-card.danger { border-color: #E5BAB4; }
.kpi-card.danger b { color: #B3403A; }
.kpi-card.warn { border-color: #E2CBA0; }
.kpi-card.warn b { color: #A8730A; }
.dash-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 16px; align-items: start; }
.attn-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-bottom: 1px solid var(--divider); cursor: pointer; font-size: 13px;
}
.attn-row:last-child { border-bottom: none; }
.attn-row:hover { background: #FBF8F6; }
.attn-dot { width: 8px; height: 8px; border-radius: 999px; flex: none; background: #A8730A; }
.attn-dot.danger { background: #B3403A; }
.attn-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.attn-cta { font-size: 12px; color: #C05B2E; font-weight: 500; white-space: nowrap; }
.upc-row {
  display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--divider);
  font-size: 13px; cursor: pointer;
}
.upc-row:last-child { border-bottom: none; }
.upc-row:hover { background: #FBF8F6; }
.upc-when {
  font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; color: #8A9096;
  width: 74px; flex: none;
}

@media (max-width: 1100px) {
  .dash-kpis { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
}

/* --- Sprint 106 W2: раздел «Объекты» — 4 вида --- */

.obj-views {
  display: flex; border: 1px solid #D8DBDF; border-radius: 6px; overflow: hidden;
  background: var(--surface);
}
.obj-view {
  height: auto; padding: 6px 13px; font-size: 12.5px; color: #5C636B; font-weight: 400;
  background: var(--surface); border: none; border-radius: 0;
}
.obj-view + .obj-view { border-left: 1px solid var(--border-soft); }
.obj-view:hover { background: var(--surface-sunken); }
.obj-view.active { background: #F6E9E1; color: #A64E27; font-weight: 600; }
.obj-filters { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }

/* Таблица v2: 10 колонок по дизайну */
.pt-head, .pt-row {
  grid-template-columns: 1.9fr 0.9fr 0.9fr 0.8fr 0.8fr 0.7fr 0.9fr 0.5fr 0.6fr 1fr;
}
.pt-progress { display: flex; align-items: center; gap: 6px; }
.pt-bar { flex: 1; height: 4px; border-radius: 2px; background: var(--divider); overflow: hidden; }
.pt-bar i { display: block; height: 100%; background: #C05B2E; }
.pt-progress span {
  font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: #8A9096;
}
.pt-defects { color: #B3403A; font-weight: 600; }
.chip-status.critical { background: #B3403A; color: #fff; border-color: #B3403A; }
.chip-status.danger { border-color: #E5BAB4; color: #B3403A; }

/* Канбан */
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; align-items: start; }
.kanban-col { background: var(--surface-sunken); border: 1px solid #E3E5E8; border-radius: 8px; padding: 10px; }
.kanban-title { font-size: 12px; font-weight: 600; margin-bottom: 8px; }
.kanban-card {
  background: var(--surface); border: 1px solid #E0E2E5; border-radius: 6px;
  padding: 10px 12px; margin-bottom: 8px; cursor: pointer;
}
.kanban-card:last-child { margin-bottom: 0; }
.kanban-card:hover { background: #FBF8F6; }
.kanban-card.trouble { border-color: #E5BAB4; }
.kanban-name { font-size: 12.5px; font-weight: 600; }
.kanban-sub { font-size: 11px; color: #8A9096; }
.kanban-sub.danger { color: #B3403A; }

/* Трасса */
.trassa-legend {
  display: flex; align-items: center; gap: 6px; margin-bottom: 10px;
  font-size: 11.5px; color: #5C636B; flex-wrap: wrap;
}
.trassa-swatch { width: 10px; height: 10px; border-radius: 3px; margin-left: 6px; }
.trassa-swatch:first-child { margin-left: 0; }
.trassa-note { margin-left: auto; color: #8A9096; }
.trassa {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 16px 16px 12px; position: relative;
}
.trassa-zone {
  position: absolute; right: 18px; font-family: ui-monospace, Menlo, monospace;
  font-size: 9px; letter-spacing: 0.06em;
}
.trassa-zone.top { top: 20px; color: #B98A6E; }
.trassa-zone.bottom { bottom: 18px; color: #9BB3A4; }
.trassa-lane { display: grid; grid-template-columns: repeat(var(--trassa-cols, 8), 1fr); gap: 4px; }
.trassa-lane.top .trassa-cell { height: 64px; }
.trassa-lane.bottom .trassa-cell { height: 56px; }
.trassa-cell { border-left: 2px solid #E3E5E8; position: relative; }
.trassa-chip {
  position: absolute; left: -14px; width: 32px; height: 32px; min-width: 32px;
  border-radius: 8px; background: var(--surface); border: 2px solid #D8DBDF;
  color: var(--ink); font-size: 11px; font-weight: 700; padding: 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(32, 34, 38, 0.12); cursor: pointer;
  transition: transform 0.18s ease, top 0.18s ease;
}
/* Sprint 108: стек-веер — при hover фишки раскрываются в ряд (дизайн v2). */
.trassa-stack:hover { z-index: 6; }
.trassa-stack:hover .trassa-chip {
  top: 4px !important;
  transform: translateX(var(--fan-x, 0px));
  z-index: 6;
}
.trassa-stack:hover .trassa-chip:hover {
  border-color: var(--ink);
  z-index: 7;
}
.trassa-chip:hover { background: #FBF8F6; }
.trassa-chip.tone-ok { border-color: #2E7D52; }
.trassa-chip.tone-warn { border-color: #A8730A; }
.trassa-chip.tone-danger, .trassa-chip.tone-critical { border-color: #B3403A; }
.trassa-dot {
  position: absolute; top: -5px; right: -5px; width: 11px; height: 11px;
  border-radius: 999px; background: #B3403A; border: 2px solid #fff;
}
.trassa-dot.warn { background: #A8730A; }
.trassa-scale {
  display: grid; grid-template-columns: repeat(var(--trassa-cols, 8), 1fr); gap: 4px;
  border-top: 2px solid #24262A; padding: 8px 0;
}
.trassa-stage { font-size: 10px; color: #5C636B; line-height: 1.3; }
.trassa-stage span { font-family: ui-monospace, Menlo, monospace; color: #8A9096; }
.trassa-caption { font-size: 11px; color: #8A9096; margin-top: 8px; line-height: 1.5; }

/* Карта */
.objmap {
  position: relative; height: 440px; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--border);
  background: repeating-linear-gradient(45deg, #EDEFF1 0, #EDEFF1 14px, #E8EAED 14px, #E8EAED 28px);
}
.objmap-center {
  position: absolute; left: 50%; top: 14%; transform: translateX(-50%);
  font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: #9AA0A6;
  text-align: center; line-height: 1.6;
}
.objmap-zoom { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 6px; }
.objmap-zoom button {
  width: 30px; height: 30px; min-width: 30px; padding: 0; border-radius: 6px;
  background: var(--surface); border: 1px solid #D8DBDF; font-size: 15px; color: #5C636B;
  display: flex; align-items: center; justify-content: center;
}
.objmap-route {
  position: absolute; left: 14px; bottom: 14px; height: 34px; padding: 0 15px;
  box-shadow: 0 3px 10px rgba(32, 34, 38, 0.2);
}
.objmap-overlay {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: var(--surface); border: 1px dashed #C9CDD2; border-radius: 8px;
  padding: 14px 18px; max-width: 340px; text-align: center;
}
.objmap-overlay b { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.objmap-overlay p { margin: 0; font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

@media (max-width: 1100px) {
  .kanban { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .kanban { grid-template-columns: 1fr; }
  .obj-views { flex-wrap: wrap; }
}

/* Мобильная строка таблицы v2: имя + статус, прочие колонки — стеком */
@media (max-width: 720px) {
  .pt-row { grid-template-columns: 1fr auto; }
  .pt-row > .pt-cell { grid-column: 1 / -1; grid-row: auto; justify-self: start; }
  .pt-row > .pt-cell:first-child { grid-column: 1; }
  .pt-row > .pt-cell:nth-child(10) { grid-column: 2; grid-row: 1; justify-self: end; }
}

/* --- Sprint 106 W3: карточка объекта v2 --- */
.object-title-box { min-width: 0; }
.object-meta { font-size: 12px; color: #8A9096; margin-top: 3px; overflow-wrap: anywhere; }
.tab-badge { color: #B3403A; font-weight: 600; }

/* Обзор v2: стоп-точка */
.stop-panel { border-color: #E5BAB4; }
.stop-title { color: #B3403A; }
.stop-text { font-size: 13px; line-height: 1.5; margin: 0 0 8px; }
button.stop-link { background: none; border: none; height: auto; padding: 0; color: #C05B2E; font-size: 12.5px; font-weight: 500; }
button.stop-link:hover { color: #A64E27; background: none; }

/* Вкладка ГПР: список этапов */
.gpr-stage-row {
  display: flex; align-items: center; gap: 8px; padding: 5px 14px;
  border-bottom: 1px solid #F5F6F7; font-size: 11.5px; color: #3F444B;
}
.gpr-stage-row:last-child { border-bottom: none; }
.gpr-stage-row.current { font-weight: 600; color: var(--ink); }
.gpr-num { font-family: ui-monospace, Menlo, monospace; font-size: 10px; color: #8A9096; }
.gpr-stage-row.current .gpr-num { color: #C05B2E; }

/* Sprint 111 (волна D): ГПР — Гант + прогноз + режим корректировки. */
.gpr-forecast-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  background: #F9E7E5; border: 1px solid #E5BAB4; border-radius: 8px;
  padding: 10px 12px; font-size: 12.5px; margin-bottom: 12px;
}
.gpr-forecast-banner button { margin-left: auto; }
.gpr-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.gpr-toolbar button { margin-left: auto; }
.gpr-correct-banner {
  background: #F6E9E1; border: 1px solid #E4C7B4; border-radius: 8px;
  padding: 8px 12px; font-size: 12px; color: #8f5a34; margin-bottom: 10px;
}
.gpr-gantt {
  position: relative; border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; background: var(--surface);
}
.gpr-months {
  font-family: ui-monospace, Menlo, monospace; font-size: 10.5px; color: var(--text-muted);
  padding: 6px 14px 6px 224px; background: #F6F7F8; border-bottom: 1px solid #EEF0F2;
}
.gpr-row {
  position: relative; display: flex; flex-wrap: wrap; align-items: center;
  border-bottom: 1px solid #F5F6F7; min-height: 30px;
}
.gpr-row:last-child { border-bottom: none; }
.gpr-row.done { background: #FBFDFB; }
.gpr-row-label {
  width: 210px; flex: none; display: flex; align-items: center; gap: 8px;
  padding: 4px 8px 4px 14px; min-width: 0;
}
.gpr-row-name { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gpr-track { position: relative; flex: 1; height: 20px; min-width: 0; }
.gpr-bar {
  position: absolute; top: 5px; height: 10px; border-radius: 3px; min-width: 3px;
}
.gpr-bar-plan { background: #EEF0F2; border: 1px solid #D8DBDF; }
.gpr-bar-fact { background: #2E7D52; }
.gpr-bar-forecast { background: #FBF6F2; border: 1px dashed #C9A08A; }
.gpr-bar-overrun { background: #B3403A; }
.gpr-bar-milestone { border-radius: 2px; transform: rotate(0deg); box-shadow: 0 0 0 1.5px #A8730A inset; }
.gpr-row-dates {
  width: 190px; flex: none; text-align: right; padding: 0 14px;
  font-family: ui-monospace, Menlo, monospace; font-size: 10.5px; color: var(--text-muted);
}
.gpr-nodate { font-size: 11px; color: var(--text-muted); padding-left: 4px; }
.gpr-today {
  position: absolute; top: 26px; bottom: 0; width: 0;
  border-left: 1.5px dashed #B3403A; pointer-events: none;
}
.gpr-legend {
  display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px;
  font-size: 11px; color: var(--text-muted);
}
.gpr-swatch { display: inline-block; width: 14px; height: 8px; border-radius: 2px; vertical-align: middle; }
.gpr-correct-form {
  width: 100%; flex-basis: 100%; order: 3; padding: 8px 14px 10px;
  background: #FBF8F6; border-top: 1px dashed #E4C7B4;
}
.gpr-cf-line { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin-bottom: 6px; }
.gpr-cf-field { display: flex; flex-direction: column; gap: 2px; font-size: 10.5px; color: var(--text-muted); }
.gpr-cf-line input[type="text"] { flex: 1; min-width: 140px; }

/* Отчёты и замечания: цепочка статусов */
.report-flow {
  display: flex; align-items: center; gap: 6px; margin-bottom: 12px;
  font-size: 11.5px; color: #8A9096; flex-wrap: wrap;
}
.report-flow-note { margin-left: 12px; }

/* Параметры v2: карточки-группы */
.param-group {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; margin-bottom: 12px;
}
.param-group-title {
  padding: 8px 14px; background: var(--bg-canvas); border-bottom: 1px solid var(--divider);
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: #5C636B;
}
.param-group .param-readrow { padding: 8px 14px; border-bottom: 1px solid #F5F6F7; }
.param-group .param-readrow:last-child { border-bottom: none; }

/* --- Sprint 106 W5: разделы Задачи / Выезды / Субподрядчики / Аналитика / Журнал --- */

/* Задачи компании */
.vtask-head, .vtask-row {
  display: grid; grid-template-columns: 2.2fr 1.2fr 1fr 0.8fr 1fr 0.3fr;
  gap: 10px; padding: 10px 14px; align-items: center;
}
.vtask-head {
  border-bottom: 1px solid var(--border-soft); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase; color: #8A9096; padding: 9px 14px;
}
.vtask-row { border-bottom: 1px solid var(--divider); font-size: 12.5px; cursor: pointer; }
.vtask-row:last-child { border-bottom: none; }
.vtask-row:hover { background: #FBF8F6; }
.vtask-row.overdue { background: #FDF7F6; }
.vtask-title { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.vtask-project { color: #C05B2E; }
.vtask-due-overdue { color: #B3403A; font-weight: 600; }
.pill.info { background: #E6EDF5; color: #3B6EA5; }

/* Календарь выездов */
.vweek { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 12px; }
.vday {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px; min-height: 120px;
}
.vday.today { background: #FBF8F6; border: 1.5px solid #C05B2E; }
.vday.problem { border-color: #E5BAB4; }
.vday-title { font-size: 11px; font-weight: 600; color: #8A9096; margin-bottom: 8px; }
.vday.today .vday-title { color: #A64E27; }
.vday-item {
  border-radius: 6px; padding: 8px; font-size: 11.5px; line-height: 1.4;
  margin-bottom: 6px; cursor: pointer;
}
.vday-item:last-child { margin-bottom: 0; }
.vday-item.done { background: #E3EFE7; }
.vday-item.planned { background: #E6EDF5; }
.vday-item.unassigned { background: #F9E7E5; border: 1px dashed #E5BAB4; }
.vday-item.unassigned b { color: #B3403A; }
.vday-assign { color: #C05B2E; font-weight: 600; }

/* Субподрядчики: пилюли-специализации */
.subs-pills { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.subs-pill {
  display: inline-flex; padding: 4px 10px; border: 1px solid #D8DBDF; color: #5C636B;
  border-radius: 999px; font-size: 12px; background: var(--surface);
}
.subs-pill.active { background: #F6E9E1; border-color: #F6E9E1; color: #A64E27; font-weight: 600; }
.subs-pill { cursor: pointer; }

/* Sprint 111 (волна E): таблица + форма субподрядчиков. */
.subs-head, .subs-row {
  display: grid; grid-template-columns: 1.7fr 1.1fr 1.4fr 0.9fr 0.9fr 0.4fr;
  gap: 10px; align-items: center; padding: 8px 12px;
}
.subs-head {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
}
.subs-row { border-bottom: 1px solid #F5F6F7; font-size: 12.5px; }
.subs-row:hover { background: #FBF8F6; }
.subs-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.subs-contact { font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; }
.sub-form {
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface-sunken);
  padding: 12px 14px; margin-bottom: 14px; display: flex; flex-wrap: wrap;
  align-items: flex-end; gap: 10px;
}
.sub-form-title { width: 100%; font-size: 13px; font-weight: 700; }
.sub-field { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--text-muted); }
.sub-field input[type="text"], .sub-field select { min-width: 150px; }
.sub-form-checks { display: flex; flex-wrap: wrap; gap: 4px 12px; max-width: 420px; }
.sub-form-checks label { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--ink); }

/* Sprint 111 (волна F): план-факт аналитики + панель шаблонов задач. */
.pf-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 12px; }
.pf-name { width: 150px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-track { flex: 1; height: 12px; background: #EEF0F2; border-radius: 3px; min-width: 0; }
.pf-bar { height: 12px; border-radius: 3px; min-width: 2px; }
.pf-ok { background: #2E7D52; }
.pf-warn { background: #E2CBA0; }
.pf-danger { background: #B3403A; }
.pf-val { width: 44px; flex: none; text-align: right; font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; }
.task-templates { border: 1px solid var(--border); border-radius: 8px; background: var(--surface-sunken); padding: 12px 14px; margin-bottom: 14px; }
.tpl-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.tpl-form input[type="text"] { flex: 1; min-width: 160px; }
.tpl-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid #F5F6F7; font-size: 12.5px; }
.tpl-row > div:first-child { flex: 1; min-width: 0; }
.tpl-meta { color: var(--text-muted); font-size: 11.5px; }

/* Аналитика */
.analytics-kpis { grid-template-columns: repeat(4, 1fr); }

/* Журнал компании */
.log-note { font-size: 11.5px; color: #8A9096; margin: -8px 0 10px; }
.log-day {
  padding: 7px 14px; background: var(--bg-canvas); border-bottom: 1px solid var(--divider);
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: #8A9096;
}
.log-row {
  display: flex; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--divider);
  align-items: baseline; font-size: 13px; cursor: pointer;
}
.log-row:last-child { border-bottom: none; }
.log-row:hover { background: #FBF8F6; }
.log-time {
  font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: #8A9096;
  width: 38px; flex: none;
}
.log-text { overflow-wrap: anywhere; }
.log-project { color: #C05B2E; }
/* Событие уровня компании (роли): объекта у него нет и открывать нечего —
   курсор не должен обещать переход в карточку. */
.log-row-flat { cursor: default; }

/* Задача 8: реестр изменений и согласований объекта. */
.changes-pending {
  margin: 6px 0 12px; font-size: 13px; font-weight: 600; color: #B3403A;
}
.changes-pending.muted { color: #8A9096; font-weight: 400; }
.change-row {
  border: 1px solid var(--divider); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 10px; background: #fff;
}
.change-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.change-title { font-size: 14px; }
.change-cat { font-size: 11.5px; color: #8A9096; }
.change-values {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 8px 0; font-size: 13px;
}
.change-was { color: #8A9096; text-decoration: line-through; }
.change-arrow { color: #C05B2E; }
.change-new { font-weight: 600; }
.change-reason, .change-meta { font-size: 12px; color: #8A9096; margin-top: 4px; }
.change-actions { display: flex; gap: 10px; margin-top: 10px; }
.change-roles { display: flex; flex-direction: column; gap: 4px; }
.change-role { display: flex; align-items: center; gap: 6px; font-size: 13px; }

@media (max-width: 1100px) {
  .vweek { grid-template-columns: repeat(2, 1fr); }
  .vtask-head { display: none; }
  .vtask-row { grid-template-columns: 1fr auto; }
  .vtask-row > div { grid-column: 1 / -1; }
  .analytics-kpis { grid-template-columns: repeat(2, 1fr); }
}

/* Задача 22: задачи офиса по объекту — в карточке рядом с композером. */
.ptasks { margin-top: 14px; }
.ptask-row {
  display: grid;
  grid-template-columns: 1fr 140px 96px 104px;
  gap: 8px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--divider);
  font-size: 12.5px;
}
.ptask-row:last-child { border-bottom: none; }
.ptask-title { font-weight: 500; }
.ptask-who, .ptask-due { color: var(--text-secondary); }
@media (max-width: 720px) {
  .ptask-row { grid-template-columns: 1fr auto; }
}

/* Этап 6: «Компания → Роли и права» — список ролей слева, форма роли справа. */
.roles-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.role-row { display: flex; align-items: flex-start; gap: 16px; padding: 12px 16px; }
.role-main { flex: 1; min-width: 0; }
.role-name { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.role-desc { margin-top: 3px; font-size: 12.5px; color: var(--text-secondary); }
.role-perms { margin-top: 4px; font-size: 11.5px; color: var(--text-muted); line-height: 1.5; }
.role-side { flex: none; font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.role-members { padding: 0 16px 12px; }
.role-member { font-size: 12.5px; padding: 2px 0; }
.roles-empty { padding: 18px 16px; }
.roles-empty b { font-size: 13px; }
.roles-empty p { margin: 6px 0 0; max-width: 460px; font-size: 12.5px; color: var(--text-muted); line-height: 1.6; }
.role-form textarea {
  border: 1px solid var(--border); border-radius: 6px; padding: 7px 10px;
  font-family: inherit; font-size: 12.5px; resize: vertical;
}
.role-perm-grid { display: flex; flex-direction: column; gap: 7px; margin: 8px 0 12px; }
.role-perm { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.role-form-buttons { display: flex; align-items: center; gap: 8px; }

/* Роль сотрудника — отдельной строкой внутри ⋯-меню на экране «Сотрудники». */
.emp-role-box { display: flex; align-items: center; gap: 10px; width: 100%; flex-wrap: wrap; }
.emp-role-box .cmp-label { flex: none; }

@media (max-width: 1180px) {
  .roles-layout { grid-template-columns: 1fr; }
}

/* Задача 11: конфигурируемый ГПР — график объекта и редактор шаблона. */
.sched-start { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sched-label { color: var(--muted); font-size: 12px; }
.sched-date, .sched-select, .sched-input { border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 8px; font: inherit; background: var(--card);
  color: var(--ink); }
.sched-duration { width: 64px; border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 8px; font: inherit; background: var(--card); color: var(--ink); }
.sched-chip { border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px;
  font-size: 12px; color: var(--muted); }
.sched-chip.overdue { border-color: #E5484D; color: #E5484D; }
.sched-table { display: flex; flex-direction: column; gap: 2px; overflow-x: auto; }
.sched-row { display: grid; grid-template-columns:
  minmax(180px, 2fr) minmax(120px, 1fr) 70px minmax(150px, 1fr) minmax(150px, 1fr)
  110px 90px minmax(160px, 2fr); gap: 8px; align-items: center; padding: 6px 4px;
  border-bottom: 1px solid var(--line); font-size: 13px; }
.sched-row-head { color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--line); }
.sched-cell { overflow: hidden; text-overflow: ellipsis; }
.sched-name { font-weight: 500; }
.sched-flag { font-size: 11px; color: var(--accent, #2E7D32); }
.sched-flag.muted { color: var(--muted); }
.sched-stage { display: flex; align-items: center; gap: 12px; margin-top: 12px;
  padding: 6px 4px; }
.sched-stage-name { font-weight: 600; }
.sched-state { border-radius: 999px; padding: 2px 8px; font-size: 12px;
  border: 1px solid var(--line); }
.sched-state.done { border-color: #2E7D32; color: #2E7D32; }
.sched-state.in_progress { border-color: #1F6FEB; color: #1F6FEB; }
.sched-state.overdue { border-color: #E5484D; color: #E5484D; }
.sched-dev.late { color: #E5484D; }
.sched-dev.early { color: #2E7D32; }
.sched-chart { position: relative; height: 14px; background: var(--line);
  border-radius: 7px; display: block; }
.sched-bar { position: absolute; top: 0; height: 14px; border-radius: 7px;
  background: #1F6FEB; }
.sched-bar.done { background: #2E7D32; }
.sched-bar.overdue { background: #E5484D; }
.sched-bar.not_started { background: #8A94A6; }
.sched-actions { grid-column: 1 / -1; display: flex; gap: 12px; }
.sched-work-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 8px 4px; }
.sched-empty { display: flex; flex-direction: column; gap: 8px; }
.sched-empty-title { font-weight: 600; }
.sched-apply { display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-top: 8px; }
.sched-replace { margin-top: 12px; }
.sched-compact { display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px; align-items: center; }
.sched-compact-line { display: flex; justify-content: space-between; gap: 12px;
  align-items: baseline; grid-column: 1 / -1; }
.sched-compact-current { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-weight: 600; }
.sched-compact-progress { flex: none; color: var(--muted); font-size: 12px; }
.sched-compact-meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted);
  font-size: 12px; align-items: center; min-width: 0; }
.sched-compact-empty { color: var(--muted); font-size: 13px; }
.sched-compact-bar { width: 100%; height: 4px; overflow: hidden; border-radius: 999px;
  background: var(--surface-sunken); grid-column: 1 / -1; }
.sched-compact-bar > i { display: block; height: 100%; border-radius: inherit;
  background: var(--status-ok); transition: width .15s ease; }
.sched-compact-action { grid-column: 2; grid-row: 2; height: 30px; padding: 3px 10px; }
.sched-compact > .cmp-link-btn:not(.sched-compact-action) {
  grid-column: 1 / -1; justify-self: start; height: auto;
}
.sched-dash-row { display: flex; flex-direction: column; gap: 5px; padding: 10px 14px;
  border-bottom: 1px solid var(--line); }
.sched-dash-row:last-child { border-bottom: none; }
.sched-dash-row > .cmp-link-btn { align-self: flex-start; height: auto; text-align: left; }
.sched-dash-slot { min-width: 0; }
.sched-editor { margin-top: 16px; }
.sched-editor-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sched-tpl-row { align-items: center; }
.sched-tpl-stage { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.sched-tpl-stage-head { display: flex; gap: 12px; align-items: center; }
.sched-tpl-work { display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 4px 0 4px 16px; font-size: 13px; }
.sched-tpl-work-name { font-weight: 500; }
.sched-tpl-add, .sched-tpl-publish { display: flex; gap: 8px; align-items: center;
  margin-top: 12px; }
.sched-tpl-versions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
@media (max-width: 1100px) {
  .sched-row { grid-template-columns: minmax(140px, 2fr) 60px minmax(120px, 1fr)
    100px minmax(120px, 1fr); }
  .sched-row .sched-cell:nth-child(2), .sched-row .sched-cell:nth-child(5) { display: none; }
}

/* Задача 11.1: выбор рабочей недели. */
.sched-week { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sched-week-day { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px;
  color: var(--muted); }
/* OFFICE-12.1 + приёмка 12.2 + читаемость UX-1: диаграмма Ганта ГПР.
   Один контейнер прокрутки: панель работ закреплена слева, календарная шапка —
   сверху. Высоты строк должны совпадать с GANTT_ROW_H / GANTT_STAGE_H в app.js. */
.gantt-panel { display: flex; flex-direction: column; gap: 12px; --gantt-side: 360px;
  --gantt-navy: #17324A; --gantt-orange: #C75A2C; --gantt-green: #2F855A;
  --gantt-red: #BD3F3F; --gantt-blue: #2F7CCB; --gantt-plan: #CFD5DA;
  --gantt-future: #E9EDF0; }
/* Фокус-режим разворачивает график внутри страницы: Fullscreen API увёл бы из
   кабинета и сломал бы возврат по Esc. */
.gantt-panel.focus { position: fixed; inset: 0; z-index: 1000; overflow: hidden;
  height: 100vh; box-sizing: border-box; background: var(--card, #fff);
  padding: 14px; }
.gantt-panel.focus .gantt { flex: 1; min-height: 0; max-height: none; }
.gantt-toolbar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center;
  justify-content: space-between; }
.gantt-views, .gantt-scales, .gantt-modes { display: flex; gap: 4px; flex-wrap: wrap; }
.gantt-views { margin-right: 4px; }
.gantt-modes { margin-left: auto; }
.gantt-view, .gantt-mode { border: 1px solid var(--line); background: transparent;
  border-radius: 8px; padding: 4px 10px; font-size: 12px; cursor: pointer; color: inherit; }
.gantt-view:hover, .gantt-mode:hover { border-color: var(--gantt-orange); }
.gantt-view.active, .gantt-mode.active { border-color: var(--gantt-orange);
  color: var(--gantt-orange); font-weight: 600; background: #FAEBE4; }
.gantt-scale { border: 1px solid var(--line); background: transparent; border-radius: 8px;
  padding: 4px 12px; font-size: 12px; cursor: pointer; color: inherit; }
.gantt-scale:hover { border-color: var(--gantt-orange); }
.gantt-scale.active { border-color: var(--gantt-orange); color: var(--gantt-orange);
  background: #FAEBE4; font-weight: 600; }
/* Условные обозначения живут под диаграммой и переносятся по строкам. */
.gantt-legend { display: flex; flex-wrap: wrap; gap: 8px 12px; color: var(--muted);
  font-size: 12px; padding-top: 2px; }
.gantt-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  border: 1px solid #1F6FEB; background: #F5F9FF; border-radius: 10px; padding: 8px 12px; }
.gantt-legend-item { display: inline-flex; align-items: center; gap: 4px; }
.gantt-swatch { width: 12px; height: 8px; border-radius: 3px; display: inline-block; }
.gantt-swatch.plan { background: var(--gantt-plan); }
.gantt-swatch.on_time { background: var(--gantt-green); }
.gantt-swatch.late { background: var(--gantt-red); }
.gantt-swatch.overdue { background: var(--gantt-red); }
.gantt-swatch.fact { background: var(--gantt-green); }
.gantt-swatch.milestone { width: 10px; height: 10px; background: #7C4DFF; transform: rotate(45deg); }
.gantt-swatch.point { width: 10px; height: 10px; border-radius: 50%; background: #8A94A6; }
.gantt-swatch.off { background: #E4E8EE; }
/* Восемь обозначений диаграммы: исходный план, актуальный и два состояния факта,
   поставка, выезд, оплата и сегодняшний день. */
.gantt-swatch.baseline { background: transparent; border: 1px dashed #8A94A6; height: 10px; }
.gantt-swatch.supply { width: 10px; height: 10px; background: #2E7D32; transform: rotate(45deg); }
.gantt-swatch.visit { width: 10px; height: 10px; background: #E5484D; transform: rotate(45deg); }
.gantt-swatch.payment { width: 10px; height: 10px; background: #1F6FEB; transform: rotate(45deg); }
.gantt-swatch.today { width: 0; height: 14px; border-radius: 0; border-left: 2px solid #E5484D; }
.gantt-warn { border: 1px solid #E5A400; border-radius: 10px; padding: 8px 12px;
  font-size: 12px; color: #8A6100; }
.gantt-details { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 6px; background: var(--card, #fff); }
.gantt-details.empty { display: none; }
.gantt-details-hint { color: var(--muted); font-size: 12px; }
.gantt-details-title { font-weight: 600; font-size: 14px; }
.gantt-details-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gantt-details-facts { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; }
.gantt-fact-item b { font-weight: 500; color: var(--muted); }
.gantt-details-point { font-size: 12px; color: var(--muted); }
.gantt-details-point.accepted { color: #2E7D32; }
.gantt-details-point.issue { color: #E5484D; }
.gantt-details-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding-top: 6px; border-top: 1px solid var(--line); }
.task-work-context { margin-top: 6px; padding: 7px 9px; border-radius: 6px;
  background: var(--surface-sunken); color: var(--text-secondary); font-size: 12px; }
.gantt-details-close { flex: none; }
.gantt-danger { margin-left: auto; border: 1px solid #E5484D; background: transparent;
  color: #E5484D; border-radius: 8px; padding: 3px 10px; font-size: 12px; cursor: pointer; }
.gantt-danger:hover { background: #FDECEC; }
.gantt { position: relative; overflow: auto; max-height: calc(100vh - 280px);
  border: 1px solid var(--line); border-radius: 10px; background: var(--card, #fff); }
/* width: max-content обязателен: без него блок шириной с контейнер уезжает
   вместе с прокруткой и sticky-колонке не за что держаться. */
.gantt-head { display: flex; width: max-content; position: sticky; top: 0; z-index: 10;
  background: var(--gantt-navy); color: #fff; border-bottom: 1px solid #FFFFFF44; }
.gantt-side-head { position: sticky; left: 0; z-index: 11; width: var(--gantt-side);
  min-width: var(--gantt-side); display: flex; align-items: center;
  padding: 0 12px; height: 30px; background: var(--gantt-navy);
  border-right: 1px solid #FFFFFF44; }
.gantt-hcell { font-size: 12px; font-weight: 600; }
.gantt-cal { display: flex; flex-direction: column; }
.gantt-months { display: flex; height: 30px; }
.gantt-month { font-size: 11px; font-weight: 600; color: #fff; padding-left: 6px;
  border-right: 1px solid #FFFFFF44; overflow: hidden; white-space: nowrap;
  line-height: 30px; }
.gantt-grid { display: flex; align-items: flex-start; width: max-content; }
.gantt-side { position: sticky; left: 0; z-index: 8; width: var(--gantt-side);
  min-width: var(--gantt-side); background: var(--card, #fff);
  border-right: 2px solid var(--line); }
/* Плотность образца ГПР: работа — одна строка 30px, этап — 36px. Значения
   продублированы в app.js (GANTT_ROW_H / GANTT_STAGE_H): панель и холст обязаны
   совпадать до пикселя. Кликабельна вся строка, а не только полоса. */
.gantt-row { height: 30px; padding: 2px 10px; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 0; justify-content: center; cursor: pointer; }
.gantt-row:hover, .gantt-row.hl,
.gantt-row[data-work-id]:hover, .gantt-row[data-work-id].hl { background: #FAEBE4; }
.gantt-row.selected { background: #FAEBE4; box-shadow: inset 3px 0 0 var(--gantt-orange); }
.gantt-row:focus-visible { outline: 2px solid var(--gantt-orange); outline-offset: -2px; }
.gantt-row[data-work-id] { padding-left: 29px; background: #F7F8F9; }
.gantt-row[data-work-id] { flex-direction: row; align-items: center; gap: 6px; }
.gantt-row[data-work-id].selected {
  background: #FAEBE4; box-shadow: inset 3px 0 0 var(--gantt-orange);
}
.gantt-name { font-size: 12px; font-weight: 500; line-height: 1.3; max-height: 16px;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.gantt-row[data-work-id] .gantt-name { display: block; flex: 1; min-width: 0;
  max-height: none; white-space: nowrap; text-overflow: ellipsis; }
.gantt-duration { width: 56px; border: 1px solid var(--line); border-radius: 6px;
  padding: 2px 6px; font-size: 12px; background: transparent; color: inherit; }
.gantt-chip { white-space: nowrap; font-size: 11px; }
.gantt-chip.milestone { color: #7C4DFF; }
.gantt-chip.point { color: #8A94A6; }
.gantt-stage { height: 36px; display: flex; align-items: center; gap: 10px; padding: 0 10px;
  background: var(--card, #fff); font-size: 12px; border-top: 1px solid var(--line); }
.gantt-stage:hover, .gantt-stage.hl { background: #FAEBE4; }
.gantt-stage-toggle { border: 0; background: transparent; font: inherit; font-weight: 600;
  cursor: pointer; padding: 0; color: inherit; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
button.gantt-stage-toggle:hover,
button.gantt-stage-toggle:focus,
button.gantt-stage-toggle:active {
  background: transparent !important; color: inherit !important; box-shadow: none;
}
.gantt-stage-count { color: var(--muted); font-size: 11px; white-space: nowrap; }
/* В узкой панели «+ работа» переносилась на две строки и ломала высоту этапа. */
.gantt-stage .cmp-link-btn { white-space: nowrap; flex: none; }
/* Холст можно тянуть мышью; скроллбар и трекпад продолжают работать. */
.gantt-canvas { position: relative; flex: none; cursor: grab; }
.gantt-canvas.grabbing { cursor: grabbing; }
/* Действующий комплект контроля: что именно получит следующий выезд. */
.cp-authority { border: 1px solid var(--border, #E3E6EA); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 12px; background: var(--surface-2, #F4F6F9); }
.cp-authority-title { font-weight: 600; margin-bottom: 2px; }
.cp-authority-note { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.cp-authority-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cp-authority-select { max-width: 320px; }

.gantt-bar.pickable, .gantt-milestone.pickable, .gantt-point.pickable,
.gantt-nodate.pickable { cursor: pointer; }
/* Строка без даты кликабельна: иначе её нечем открыть — на шкале её нет. */
.gantt-nodate.pickable { text-decoration: underline dotted; }
.gantt-col { position: absolute; top: 0; bottom: 0; }
.gantt-col.month-start { border-left: 2px solid #C2C9D4; }
.gantt-today { position: absolute; top: 0; bottom: 0; width: 0;
  border-left: 2px dashed var(--gantt-red); opacity: .9; z-index: 5; }
.gantt-stage-track { position: absolute; left: 0; right: 0; height: 36px; background: #fff;
  border-top: 1px solid var(--line); }
.gantt-stage-track.hl { background: #FAEBE4; }
.gantt-track { position: absolute; left: 0; right: 0; height: 30px;
  border-top: 1px solid var(--line); }
.gantt-track.hl { background: #FAEBE4; }
.gantt-track.selected { background: #FAEBE4; }
/* Исходный план: пунктирный контур на прежних датах. Лежит под полосами и выше
   их по краям — видно, откуда и куда уехала работа. */
.gantt-baseline { position: absolute; top: 7px; height: 15px; min-width: 4px;
  border: 1px dashed #6F7882; border-radius: 3px; background: transparent; z-index: 2; }
.gantt-bar { position: absolute; top: 11px; height: 7px; min-width: 3px; border-radius: 3px;
  background: var(--gantt-plan); border: 1px solid #BFC6CC; z-index: 3; overflow: hidden; }
.gantt-bar.not_started { background: var(--gantt-future); border-color: #D6DBE0; }
.gantt-bar.shifted { top: 11px; height: 7px; background: var(--gantt-future);
  border-color: #D6DBE0; }
.gantt-bar-label { display: block; padding: 0 7px; line-height: 13px; font-size: 10px;
  color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt-bar:not(.stage) .gantt-bar-label { display: none; }
.gantt-fact { position: absolute; top: 10px; height: 10px; min-width: 3px; border-radius: 3px;
  background: var(--gantt-green); z-index: 4; }
.gantt-fact.on_time { background: var(--gantt-green); }
.gantt-fact.late { background: var(--gantt-red); }
.gantt-milestone { position: absolute; top: 6px; width: 12px; height: 12px;
  background: #7C4DFF; transform: rotate(45deg); z-index: 4; }
.gantt-point { position: absolute; top: 19px; width: 8px; height: 8px; border-radius: 50%;
  background: #8A94A6; border: 1px solid #fff; z-index: 4; }
/* Секции под производственными этапами: снабжение, выезды, оплаты. Заголовок
   ниже строки этапа — это не этап, а разделитель дорожек. */
.gantt-row.gantt-section { height: 27px; flex-direction: row; align-items: center;
  gap: 8px; background: var(--surface-2, #F4F6F9); border-left: 5px solid #8A94A6; }
.gantt-visit-label { position: absolute; top: 8px; margin-left: 9px;
  font-size: 10px; color: var(--muted); white-space: nowrap; }
/* Пустая дорожка: раздел на месте, записей пока нет. */
.gantt-empty-row { justify-content: center; }
.gantt-empty-text { font-size: 11px; color: var(--muted); font-style: italic; }
.gantt-section-add { margin-left: auto; font-size: 11px; white-space: nowrap; flex: none; }
.gantt-row-edit, .gantt-row-remove { font-size: 11px; padding: 0 4px; flex: none; }
.gantt-row.gantt-row-with-actions { flex-direction: row; align-items: center; gap: 6px; }
.gantt-row.gantt-row-with-actions .gantt-name { flex: 1; min-width: 0; }
.gantt-visit-row { cursor: pointer; }
.gantt-payment-over .gantt-name { color: #B3403A; }
.gantt-add-work-btn { font-weight: 600; }
.gantt-extra-dialog, .gantt-work-dialog { display: flex; flex-direction: column;
  gap: 8px; min-width: 320px; }
.gantt-extra-dialog .sched-work-form, .gantt-work-dialog .sched-work-form {
  display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; }
.gantt-row.gantt-section.supply { border-left-color: #2E7D32; }
.gantt-row.gantt-section.visit { border-left-color: #E5484D; }
.gantt-row.gantt-section.payment { border-left-color: #1F6FEB; }
.gantt-section-title { font-size: 10px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
button.gantt-section-title { border: 0; background: transparent; padding: 0;
  cursor: pointer; text-align: left; }
button.gantt-section-title:hover { background: transparent; color: var(--muted); }
.gantt-section-track { position: absolute; left: 0; right: 0; height: 27px;
  background: var(--surface-2, #F4F6F9); border-top: 1px solid var(--line); }
/* Поставка: линия от заказа до прихода, точка в начале, ромб в конце. */
.gantt-supply { position: absolute; top: 13px; height: 3px; background: #2E7D32;
  min-width: 4px; z-index: 3; }
.gantt-supply::before { content: ""; position: absolute; left: -3px; top: -2px;
  width: 7px; height: 7px; border-radius: 50%; background: #2E7D32; }
.gantt-supply::after { content: ""; position: absolute; right: -5px; top: -4px;
  width: 10px; height: 10px; background: #2E7D32; transform: rotate(45deg); }
.gantt-visit { position: absolute; top: 10px; width: 10px; height: 10px;
  background: #9AA3AD; transform: translateX(-50%) rotate(45deg); z-index: 4; }
.gantt-visit.actual { background: #E5484D; }
.gantt-payment { position: absolute; top: 10px; width: 10px; height: 10px;
  background: #1F6FEB; transform: translateX(-50%) rotate(45deg); z-index: 4; }
.gantt-payment-label { position: absolute; top: 8px; margin-left: 9px;
  font-size: 10px; color: var(--muted); white-space: nowrap; }
.gantt-hover-dependency { position: absolute; width: 1px; background: #8A94A6;
  pointer-events: none; z-index: 2; }
.gantt-point.accepted { background: #2E7D32; }
.gantt-point.issue { background: #E5484D; }
.gantt-nodate { position: absolute; left: 8px; top: 8px; font-size: 10px; color: var(--muted); }
/* Обзор этапов: одна полоса на этап, спокойнее работ — это не задача, а свод. */
.gantt-bar.stage { top: 10px; height: 16px; border-radius: 4px;
  background: var(--gantt-future); border-color: #D6DBE0; }
.gantt-stage-progress { position: absolute; inset: 0 auto 0 0; z-index: 0; }
.gantt-stage-progress.on_time { background: var(--gantt-green); }
.gantt-stage-progress.late { background: var(--gantt-red); }
.gantt-bar.stage.shifted { top: 12px; height: 10px; background: var(--gantt-future);
  border-color: #D6DBE0; }
.gantt-bar.stage .gantt-bar-label { position: relative; z-index: 1; line-height: 16px; font-size: 11px; }
/* Бегунки границ: видны только у выбранной работы в режиме правки. */
.gantt-handle { position: absolute; top: 4px; width: 10px; height: 17px; border-radius: 4px;
  background: #fff; border: 2px solid #1F6FEB; cursor: ew-resize; box-sizing: border-box;
  z-index: 5; }
/* Контекстное меню и выбор точек — поверх графика, у места нажатия. */
.gantt-menu { position: fixed; z-index: 70; min-width: 220px; max-width: 340px;
  background: var(--card, #fff); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(16, 24, 40, .18); padding: 6px; display: flex;
  flex-direction: column; gap: 2px; }
.gantt-menu-title { font-size: 11px; color: var(--muted); padding: 4px 8px; }
.gantt-menu-item { border: 0; background: transparent; text-align: left; font: inherit;
  font-size: 13px; padding: 6px 8px; border-radius: 6px; cursor: pointer; color: inherit; }
.gantt-menu-item:hover { background: #F2F6FC; }
.gantt-picker { max-height: 60vh; overflow: auto; }
.gantt-picker-list { display: flex; flex-direction: column; gap: 4px; padding: 4px 8px; }
.gantt-picker-row { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; }
.gantt-compact { display: none; flex-direction: column; }
.gantt-compact-row { display: flex; flex-direction: column; gap: 4px;
  padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; }
.gantt-compact-name { font-weight: 500; }
.gantt-compact-stage { color: var(--muted); font-size: 12px; }
.gantt-compact-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.gantt-compact-dates { color: var(--muted); font-size: 12px; }
.gantt-compact-point { font-size: 12px; color: var(--muted); }
.gantt-compact-point.accepted { color: #2E7D32; }
.gantt-compact-point.issue { color: #E5484D; }
.gantt-acts { display: flex; gap: 10px; flex-wrap: wrap; }
@media (min-width: 1600px) { .gantt-panel { --gantt-side: 380px; } }
@media (max-width: 1279px) { .gantt-panel { --gantt-side: 330px; } }
@media (max-width: 1023px) { .gantt-panel { --gantt-side: 300px; } }
@media (max-width: 720px) {
  /* Диаграммы здесь нет — вместе с ней прячем её управление и легенду. */
  .gantt, .gantt-toolbar, .gantt-details, .gantt-legend, .gantt-edit { display: none; }
  .gantt-compact { display: flex; }
}
/* OFFICE-12.1: выбор плана контроля и пикер точек в редакторе шаблона. */
.sched-control { display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-bottom: 12px; }
.sched-points { display: flex; flex-direction: column; gap: 4px; width: 100%;
  border-top: 1px solid var(--line); padding-top: 8px; }
.sched-points-stage { font-size: 12px; font-weight: 600; margin-top: 6px; }
.sched-point { display: flex; align-items: center; gap: 6px; font-size: 13px; }

/* Состав по ТЗ (semantic generation). Отдельного экрана нет: это разметка
   поверх существующих вкладок, поэтому и стилей ровно столько, сколько нужно,
   чтобы вторичное читалось как вторичное. */
.gen-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 12px; }
.gen-mode { border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px;
  color: var(--muted); }
.gen-mode-generated_draft { border-color: #2F6FEB; color: #2F6FEB; }
.gen-mode-manual { border-color: #E5A400; color: #8A6100; }
.gen-count { color: var(--muted); }
.gen-review { color: #8A6100; }
.gen-manual-note { flex-basis: 100%; }
.gen-status { flex-basis: 100%; color: var(--muted); display: flex; gap: 8px;
  align-items: center; flex-wrap: wrap; }
.gen-suppressed { flex-basis: 100%; font-size: 12px; }
.gen-suppressed-row { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.gen-suppressed-name { color: var(--muted); }
.gantt-scope { flex: none; max-width: 38%; overflow: hidden; text-overflow: ellipsis;
  font-size: 11px; color: var(--muted); white-space: nowrap; }
.gantt-needs-review { flex: none; font-size: 11px; color: #8A6100; white-space: nowrap; }
.lc-transition-actions { display: flex; margin-top: 10px; }

@media (prefers-reduced-motion: reduce) {
  .sched-compact-bar > i { transition: none; }
}
@media (max-width: 720px) {
  .card-more-menu { left: 0; right: auto; }
  .sched-compact { grid-template-columns: 1fr; }
  .sched-compact-action { grid-column: 1; grid-row: auto; justify-self: start; }
}
.gantt-details-technical { font-size: 12px; color: var(--muted); }
.pv3-generation { display: flex; flex-direction: column; gap: 6px; }
.pv3-gen-summary { font-size: 12px; color: var(--muted); }
.pv3-gen-headline { font-size: 13px; font-weight: 500; }
.pv3-questions { display: flex; flex-direction: column; gap: 6px; }
.pv3-question { display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  border: 1px solid #E5A400; border-radius: 10px; padding: 6px 10px; font-size: 12px; }
.pv3-question-text { flex: 1; min-width: 240px; }
.pv3-diagnostics { font-size: 12px; color: var(--muted); }
.pv3-diagnostic { padding: 1px 0; }
.cp-generated { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.cp-generated-head { display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 16px 18px; border: 1px solid var(--border-soft);
  border-radius: 12px; background: var(--surface); }
.cp-generated-heading { min-width: 0; }
.cp-generated-title { font-weight: 650; font-size: 17px; color: var(--ink); }
.cp-generated-subtitle { margin-top: 3px; font-size: 12px; color: var(--text-muted); }
.cp-generated-total { flex: none; min-width: 38px; padding: 7px 11px; border-radius: 999px;
  background: #EAF1FF; color: #2459A9; font-size: 14px; font-weight: 700;
  text-align: center; }
.cp-generated-stage { overflow: hidden; border: 1px solid var(--border-soft);
  border-radius: 12px; background: var(--surface); }
.cp-generated-stage-summary, .cp-generated-work-summary, .cp-generated-review summary {
  cursor: pointer; list-style: none; }
.cp-generated-stage-summary::-webkit-details-marker,
.cp-generated-work-summary::-webkit-details-marker { display: none; }
.cp-generated-stage-summary { display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; background: var(--surface-sunken); }
.cp-generated-stage-summary::before, .cp-generated-work-summary::before {
  content: "›"; flex: none; color: var(--text-muted); font-size: 18px; line-height: 1;
  transform: rotate(0); transition: transform .15s ease; }
.cp-generated-stage[open] > .cp-generated-stage-summary::before,
.cp-generated-work[open] > .cp-generated-work-summary::before { transform: rotate(90deg); }
.cp-generated-stage[open] > .cp-generated-stage-summary { border-bottom: 1px solid var(--border-soft); }
.cp-generated-stage-title { flex: 1; min-width: 0; font-size: 14px; font-weight: 650; }
.cp-generated-count { flex: none; padding: 2px 8px; border-radius: 999px;
  background: var(--surface); color: var(--text-muted); font-size: 11px; font-weight: 600; }
.cp-generated-work { margin: 10px 12px; overflow: hidden; border: 1px solid var(--border-soft);
  border-radius: 10px; background: var(--surface); }
.cp-generated-work-summary { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.cp-generated-work[open] > .cp-generated-work-summary { border-bottom: 1px solid var(--border-soft); }
.cp-generated-work-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; }
.cp-generated-point-list { display: flex; flex-direction: column; }
.cp-generated-point { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px;
  align-items: start; padding: 10px 12px; color: var(--ink); }
.cp-generated-point + .cp-generated-point { border-top: 1px solid var(--border-soft); }
.cp-generated-point-index { display: grid; place-items: center; width: 24px; height: 24px;
  border: 1px solid var(--border-soft); border-radius: 7px; color: var(--text-muted);
  font-size: 11px; font-weight: 650; }
.cp-generated-point-body { min-width: 0; }
.cp-generated-text { font-size: 13px; line-height: 1.45; }
.cp-generated-evidence { display: inline-flex; margin-top: 6px; padding: 3px 8px;
  border-radius: 999px; background: #EAF1FF; color: #2459A9; font-size: 11px;
  font-weight: 600; }
.cp-generated-review { border: 1px solid #E5A400; border-radius: 10px; padding: 10px 12px; }

/* Кандидаты фактов в окне подтверждения объекта. Карточка живёт рядом с
   параметрами дома и повторяет их вид: это не новый экран. */
.factcard { display: flex; flex-direction: column; gap: 8px; }
.factgroup { display: flex; flex-direction: column; gap: 6px; }
.factgroup h5 { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.factrow { display: flex; align-items: flex-start; gap: 10px; padding: 6px 8px;
  border: 1px solid var(--line); border-radius: 10px; }
.factrow-pending_confirmation, .factrow-conflict { border-color: #E5A400; }
.factrow-rejected { opacity: 0.6; }
.factrow-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.factrow-value { font-size: 13px; }
.factrow-ai { font-size: 11px; color: #2F6FEB; }
.factrow-source { font-size: 12px; color: var(--muted); }
.factrow-source summary { cursor: pointer; }
.factrow-source-item { padding: 2px 0; }
.factrow-file { font-size: 12px; }
.factrow-quote { font-size: 12px; font-style: italic; }
.factrow-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* Не распределённые строки ТЗ: отдельный блок, визуально отличный от значений. */
.pv3-unmapped { margin-top: 14px; }
.pv3-unmapped-note { margin: 0 0 10px; }
.pv3-unmapped-row {
  border: 1px solid var(--line); border-left-width: 3px; border-radius: 8px;
  padding: 8px 10px; margin-bottom: 8px;
}
.pv3-unmapped-row.ambiguous { border-left-color: #C08A2E; }
.pv3-unmapped-row.unknown { border-left-color: #8A9096; }
.pv3-unmapped-head { display: flex; align-items: center; gap: 8px; }
.pv3-unmapped-badge {
  font-size: 11px; color: #8A9096; border: 1px solid var(--line);
  border-radius: 10px; padding: 1px 7px;
}
.pv3-unmapped-value { font-size: 13px; margin: 2px 0 4px; }
.pv3-unmapped-src summary { font-size: 12px; color: #8A9096; cursor: pointer; }
.pv3-unmapped-pick { margin-top: 6px; }
/* Шапка блока: заголовок и запрос подсказки на одной линии. */
.pv3-unmapped-top {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
/* Черновик ИИ виден как черновик и не похож на сохранённое значение. */
.pv3-unmapped-draft {
  margin-top: 6px; padding: 6px 8px; border-radius: 6px;
  background: #FBF6EC; font-size: 13px;
}
.pv3-unmapped-pick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pv3-unmapped-pick .pv3-input { flex: 1 1 220px; min-width: 0; }
.pv3-unmapped-apply { flex: 0 0 auto; }
.pv3-unmapped-remember-label {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: #6B7075; white-space: nowrap;
}
.pv3-unmapped-proposals { margin-top: 12px; padding-top: 10px; border-top: 1px solid #E7E9EC; }
.pv3-unmapped-proposal { font-size: 13px; margin-bottom: 4px; }
@media (max-width: 640px) {
  .pv3-unmapped-pick { flex-direction: column; align-items: stretch; }
  .pv3-unmapped-pick .pv3-input, .pv3-unmapped-apply { width: 100%; }
}
.pv3-showall { margin-top: 8px; }
/* Переключатель показывает скрытые строки, не меняя данные. */
.pv3-show-hidden .pv3-row.hidden { display: flex; opacity: .65; }
