/* SM Смета — стили разделов сервиса: оценки, смета и матрица, КП, хранилище, услуги, бриф, главная.
   Базовые стили (палитра, каркас, формы, кнопки) — в base.css; подключаются вместе в base.html. */

/* ── Commercial Offer: справочники ставок ─────────── */
.rates-table input[type=text] { width: 100%; min-width: 120px; padding: 7px 10px; }
.rates-table .num-input { max-width: 120px; text-align: right; }
.rates-table td { vertical-align: middle; }
.rates-table .row-actions { white-space: nowrap; }
.rates-table .new-row td { padding-top: 14px; border-top: 1px dashed var(--border-strong); }

/* ── Commercial Offer: карточка оценки ────────────── */
.hidden { display: none !important; }
.est-head { align-items: flex-start; }
.est-head h1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.est-meta { display: flex; gap: 6px 18px; flex-wrap: wrap; font-size: 13.5px; margin-top: 6px; }
.est-request-comment { margin-bottom: 14px; padding: 12px 16px; }
.inline-form { display: inline-flex; gap: 8px; align-items: center; }
.inline-form select { padding: 8px 12px; }
.est-tabs { display: flex; gap: 4px; margin: 4px 0 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.est-tab { padding: 10px 14px; color: var(--muted); text-decoration: none; font-weight: 560; font-size: 14px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 8px; align-items: center; }
.est-tab:hover { color: var(--ink); }
.est-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Смета */
.smeta-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.smeta-totals { position: sticky; top: 16px; }
.smeta-totals h2 { margin-top: 0; }
.totals { font-size: 14px; }
.trow { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 30px; padding: 2px 0; }
.trow > span:first-child, .trow > label { color: var(--muted); }
.trow > :last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); }
.trow.sub { min-height: 22px; font-size: 12.5px; }
.trow.sub > * { color: var(--faint); }
.trow.strong { font-weight: 700; font-size: 15px; }
.trow.strong > span:first-child { color: var(--ink); }
.trow.param > label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 13.5px; font-weight: 500; color: var(--ink); white-space: nowrap; }
.trow.param input, .trow.param select { padding: 4px 8px; font-size: 13px; width: 58px; text-align: right; }
.trow.param input.wide { width: 90px; }
.trow.param select { width: auto; text-align: left; }
.tsep { border-top: 1px dashed var(--border-strong); margin: 8px 0; }
.small { font-size: 12.5px; }
.smeta-readonly { margin: 0 0 12px; }
.stage { margin-bottom: 14px; padding: 14px 16px 10px; }
.stage.optional { border-style: dashed; }
.stage-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stage-num { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #f4f1ea;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; flex: none; }
.stage-name { flex: 1; min-width: 200px; font-weight: 650; font-size: 15px; padding: 7px 10px; }
.stage-optional { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); margin: 0; cursor: pointer; }
.stage-meta { display: inline-flex; gap: 14px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.stage-meta b { color: var(--ink); font-variant-numeric: tabular-nums; }
.stage-amount b { font-size: 14.5px; }
.stage-tools, .col-tools { white-space: nowrap; }
.stage-sub { display: flex; gap: 10px; align-items: center; margin: 8px 0 6px 36px; flex-wrap: wrap; }
.stage-desc { flex: 1; min-width: 200px; padding: 6px 10px; font-size: 13px; }
.stage-hpd { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); margin: 0; }
.stage-hpd input { width: 64px; padding: 5px 8px; text-align: right; }
.icon-btn { border: none; background: transparent; cursor: pointer; color: var(--muted); font-size: 13px;
  padding: 4px 4px; border-radius: 7px; line-height: 1; }
.icon-btn:hover { background: rgba(var(--ink-rgb), .07); color: var(--ink); }
.icon-btn.danger:hover { background: var(--crit-bg); color: var(--crit); }
table.works th, table.works td { padding: 5px 6px; vertical-align: middle; }
table.works input[type=text], table.works select { padding: 6px 9px; font-size: 13.5px; }
table.works .col-name { min-width: 200px; }
table.works .col-name input { width: calc(100% - 78px); }
table.works .kind-select { width: 70px; padding: 6px 4px; margin-right: 4px; }
table.works .col-spec { min-width: 150px; }
table.works .col-spec select { width: 100%; }
table.works .spec-name { width: 100%; margin-top: 4px; }
table.works .num-input { width: 74px; text-align: right; }
table.works .col-amount b { font-variant-numeric: tabular-nums; white-space: nowrap; }
table.works .col-cost { color: var(--muted); }
table.works input:disabled, table.works select:disabled, .stage input:disabled { background: transparent; border-color: transparent; color: var(--ink); opacity: 1; }
table.works tfoot td { padding-top: 10px; }
input.saved { box-shadow: 0 0 0 3px var(--ok-bg); border-color: var(--ok-dot) !important; transition: box-shadow .2s; }
.smeta-add { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; }

/* Согласование */
.approvals-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 18px; align-items: start; }
.action-form { margin-bottom: 14px; }
.action-form textarea { width: 100%; min-height: 70px; margin-bottom: 8px; }
.route { margin-top: 16px; font-size: 13px; }
.events { list-style: none; margin: 0; padding: 0; }
.events li { padding: 10px 0; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 130px 1fr; gap: 2px 12px; font-size: 13.5px; }
.events li:last-child { border-bottom: none; }
.ev-who { font-weight: 600; }
.ev-what { grid-column: 2; color: var(--muted); }
.ev-comment { grid-column: 2; margin-top: 4px; padding: 8px 12px; background: rgba(var(--ink-rgb), .05); border-radius: 8px; white-space: pre-wrap; }

@media (max-width: 1000px) {
  .smeta-layout, .approvals-layout { grid-template-columns: minmax(0, 1fr); }
  .smeta-main, .matrix-host { min-width: 0; }
  .matrix-wrap .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .smeta-totals { position: static; }
}

/* ── Commercial Offer: КП ─────────────────────────── */
.offer-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.offer-side .card { margin-bottom: 14px; }
.offer-block { padding: 12px 0; border-top: 1px dashed var(--border-strong); }
.offer-block.is-hidden { opacity: .6; }
.offer-block-head { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.offer-block-head .block-title { flex: 1; min-width: 200px; font-weight: 650; padding: 7px 10px; }
.offer-block-head .lib-pick { max-width: 220px; padding: 7px 10px; font-size: 13px; }
.offer-block textarea { width: 100%; font-size: 14px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; font-size: 13px; }
.versions { list-style: none; margin: 0; padding: 0; }
.versions li { padding: 8px 0; border-bottom: 1px solid var(--border); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.versions li:last-child { border-bottom: none; }
.lib-item { padding: 10px 0; border-top: 1px dashed var(--border-strong); }
.lib-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 4px; }
.lib-head .group { display: flex; gap: 6px; }
.prose ul { margin: 4px 0; padding-left: 20px; }
@media (max-width: 1000px) { .offer-layout { grid-template-columns: 1fr; } }

/* ── Commercial Offer: степпер и панель действий ──── */
.flow-card { padding: 16px 20px 14px; margin-bottom: 16px; }
.stepper { list-style: none; margin: 0 0 14px; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.stepper li { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 110px; position: relative; color: var(--faint); font-size: 12.5px; font-weight: 600; }
.stepper li::after { content: ""; flex: 1; height: 2px; background: var(--border-strong); border-radius: 2px; }
.stepper li:last-child::after { display: none; }
.stepper .dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border-strong); display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; flex: none; background: var(--card-solid); }
.stepper li.done { color: var(--muted); }
.stepper li.done .dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.stepper li.done::after { background: var(--accent); }
.stepper li.current { color: var(--accent); }
.stepper li.current .dot { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.stepper li.current.bad { color: var(--crit); }
.stepper li.current.bad .dot { border-color: var(--crit); color: var(--crit); box-shadow: 0 0 0 4px var(--crit-bg); }
.flow-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.holder { font-size: 15px; font-weight: 600; }
.flow-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.issues { margin-top: 12px; padding: 10px 14px; background: var(--warn-bg); color: var(--warn); border-radius: 12px; font-size: 13.5px; }
.issues ul { margin: 6px 0 0; padding-left: 18px; }
.request-comment { margin-top: 12px; padding: 10px 14px; background: rgba(var(--ink-rgb), .05); border-radius: 12px; font-size: 13.5px; }
.dialog { border: none; border-radius: var(--radius); padding: 22px 24px; background: var(--card-solid); color: var(--ink); box-shadow: var(--shadow-lg); width: min(520px, 92vw); }
.dialog::backdrop { background: rgba(20, 20, 30, .45); backdrop-filter: blur(3px); }
.dialog h2 { margin: 0 0 6px; }
.dialog textarea { width: 100%; }
.dialog .actions { margin-top: 14px; }

/* ── Commercial Offer: правая панель цены, строки сметы ── */
.client-view { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border-strong); }
.client-view .checks { display: flex; margin: 6px 0 0; }
.kind-tag { display: inline-flex; width: 22px; height: 22px; border-radius: 6px; align-items: center; justify-content: center; font-size: 11px; margin-right: 6px; background: var(--accent-soft); color: var(--accent); flex: none; vertical-align: middle; }
.kind-tag.fixed { background: rgba(217, 143, 42, .14); color: #a86b12; }
table.works .col-name input { width: calc(100% - 34px); }
table.works .rate-text { display: inline-flex; align-items: center; gap: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; padding: 6px 0; }
table.works .rate-text .icon-btn { font-size: 12px; padding: 2px 5px; }
tr.work.fixed td.col-spec { font-size: 12.5px; }
.smeta-empty { margin-bottom: 14px; }

/* ── Commercial Offer: вкладка КП v2 ───────────────── */
.offer-stack .share-card { margin-bottom: 16px; }
.share-card.ready { border-color: var(--ok-dot); }
.share-card.muted-card p { margin: 0; }
.share-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.share-head h2 { margin: 0 0 10px; }
.copy-row.big { flex-wrap: wrap; }
.copy-row.big input { min-width: 260px; font-size: 14px; padding: 10px 13px; }
.share-stats { margin-top: 10px; font-size: 13px; }
.share-stats .sep { margin: 0 6px; }
.share-republish { margin-top: 12px; }
.preview-frame { border: 1px solid var(--border-strong); border-radius: 12px; overflow: hidden; background: #fff; height: 520px; }
.preview-frame iframe { width: 100%; height: 100%; border: 0; }
.preview-frame.print { background: #ddd; }
.small-chips .chip { padding: 5px 10px; font-size: 12px; }
.manage-card summary { cursor: pointer; font-weight: 650; }
.manage-card h3 { font-size: 14px; margin: 14px 0 6px; }
@media (min-width: 1300px) { .offer-layout { grid-template-columns: minmax(0, 1fr) 460px; } }

/* ── Commercial Offer: список оценок v2 ───────────── */
.list-filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; flex: 1; justify-content: flex-end; }
.estimates-table .sub { font-size: 12px; margin-top: 2px; }
.estimates-table tr.mine td:first-child { box-shadow: inset 3px 0 0 var(--warn-dot); }
.estimates-table td.num b { font-variant-numeric: tabular-nums; }

/* ── Commercial Offer: режим призрака ─────────────── */
.ghost-bar { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin: 0 0 8px; padding: 7px 10px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); font-size: 12px; font-weight: 600; white-space: nowrap; }
.ghost-bar form { margin: 0; }
.ghost-exit { border: none; background: transparent; color: inherit; cursor: pointer; display: inline-flex; align-items: center; padding: 4px; border-radius: 7px; line-height: 1; }
.ghost-exit:hover { background: rgba(0, 0, 0, .06); }
.row-actions { white-space: nowrap; }
.row-actions form { margin-right: 4px; }

/* ── Commercial Offer: главная — фокус дня и доска ── */
.focus { position: relative; overflow: hidden; border-radius: 22px; padding: 26px 28px; margin-bottom: 22px; color: #fff;
  background: radial-gradient(700px 320px at 8% 0%, #4c5fe0 0%, rgba(76, 95, 224, 0) 62%),
              radial-gradient(560px 300px at 100% 20%, #8a3fd1 0%, rgba(138, 63, 209, 0) 60%),
              linear-gradient(135deg, #2f3f8f, #3d3aa8); box-shadow: 0 24px 50px -30px rgba(47, 63, 143, .8);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 24px; align-items: center; }
/* без задач — спокойная карточка, не спорит с доской */
.focus.calm { grid-template-columns: 1fr; color: var(--ink); padding: 18px 22px; border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--accent-soft), transparent 60%), var(--card); box-shadow: var(--shadow); }
.focus.calm .focus-greeting { color: var(--faint); opacity: 1; }
.focus.calm h1 { color: var(--ink); font-size: 20px; font-weight: 700; }
.focus.calm .focus-sub { color: var(--muted); opacity: 1; font-size: 14px; }
.focus-greeting { margin: 0 0 6px; font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; opacity: .7; font-weight: 600; }
.focus h1 { margin: 0 0 8px; font-family: inherit; font-size: 28px; font-weight: 800; letter-spacing: -.02em; color: #fff; }
.focus-sub { margin: 0; opacity: .85; font-size: 15px; line-height: 1.5; }
.focus-tasks { display: grid; gap: 8px; }
.task { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); color: #fff; text-decoration: none; transition: background .15s, transform .15s; }
.task:hover { background: rgba(255, 255, 255, .2); text-decoration: none; transform: translateY(-1px); }
.task-body { display: grid; gap: 2px; min-width: 0; }
.task-body b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-body span { font-size: 12.5px; opacity: .8; }
.task-cta { flex: none; background: #fff; color: var(--accent); border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 13px; }

.board-head { display: flex; align-items: center; gap: 14px; margin: 0 0 12px; flex-wrap: wrap; }
.board-head h2 { margin: 0; font-size: 22px; }
.board-head .muted { flex: 1; font-size: 13.5px; }
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.board .bcol { flex: 0 0 236px; scroll-snap-align: start; }
.bcol { background: rgba(var(--ink-rgb), .04); border-radius: 18px; padding: 10px; min-height: 160px; display: flex; flex-direction: column; min-width: 0; }
.bcol header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 4px 6px 10px; }
.bcol-title { font-weight: 700; font-size: 13px; letter-spacing: .02em; }
.bcol-meta { font-size: 12px; color: var(--muted); white-space: nowrap; }
.bcol-body { display: grid; gap: 8px; align-content: start; min-width: 0; }
.bcol-request .bcol-title::before, .bcol-estimate .bcol-title::before, .bcol-review .bcol-title::before, .bcol-offer .bcol-title::before, .bcol-sent .bcol-title::before {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.bcol-request .bcol-title::before { background: var(--unknown-dot); }
.bcol-estimate .bcol-title::before { background: var(--maintenance-dot); }
.bcol-review .bcol-title::before { background: var(--warn-dot); }
.bcol-offer .bcol-title::before { background: var(--accent); }
.bcol-sent .bcol-title::before { background: var(--ok-dot); }
.bcard { display: block; min-width: 0; overflow: hidden; overflow-wrap: anywhere; background: var(--card-solid); border: 1px solid var(--border); border-radius: 14px; padding: 12px 13px; color: var(--ink); text-decoration: none;
  box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.bcard:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.bcard.mine { border-color: var(--warn-dot); box-shadow: 0 0 0 3px var(--warn-bg), var(--shadow); }
.bcard-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.bcard-top b { font-size: 13.5px; line-height: 1.3; }
.bcard-client { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.bcard-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-top: 10px; font-size: 12.5px; flex-wrap: wrap; }
.bcard-foot b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.bcard-holder { color: var(--muted); min-width: 0; }
.chip-you { background: var(--warn-bg); color: var(--warn); border-radius: 999px; padding: 2px 8px; font-weight: 600; font-size: 11.5px; }
.bcard-age { margin-top: 6px; font-size: 11.5px; color: var(--faint); }
.bcol-empty { text-align: center; color: var(--faint); font-size: 12.5px; padding: 26px 0; border: 1px dashed var(--border-strong); border-radius: 12px; }
.finals { margin-top: 16px; padding: 12px 16px; }
.finals summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.finals-list { margin-top: 10px; }
.finals-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); color: var(--ink); text-decoration: none; font-size: 13.5px; }
.finals-row:hover { text-decoration: none; color: var(--accent); }
@media (max-width: 1000px) { .focus { grid-template-columns: 1fr; } .board { grid-template-columns: repeat(5, 220px); } }

/* ── Смета v3: чистая таблица ─────────────────────── */
.smeta-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 10px; flex-wrap: wrap; }
.switch-costs { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); cursor: pointer; margin: 0; }
.switch-costs input { accent-color: var(--accent); }
#smeta:not(.show-costs) .col-cost, #smeta:not(.show-costs) .cost-only { display: none; }
.stage { padding: 12px 18px 8px; }
.stage-head { gap: 8px; }
.stage-head .stage-name { flex: 1; min-width: 160px; font-weight: 700; font-size: 15.5px; }
.stage-meta { color: var(--muted); font-size: 13px; white-space: nowrap; margin-left: auto; }
.stage-meta b { color: var(--ink); font-variant-numeric: tabular-nums; }
.stage-meta .stage-amount { font-size: 14px; }
.stage-sub { margin: 2px 0 4px 34px; gap: 14px; }
.stage-desc { flex: 1; font-size: 13px; color: var(--muted); }
.stage-hpd { display: inline-flex; gap: 4px; align-items: center; font-size: 12.5px; color: var(--muted); margin: 0; }
.stage-hpd .num-cell { width: 40px; }
.stage-tools, .col-tools .icon-btn { opacity: 0; transition: opacity .12s; }
.stage:hover .stage-tools, tr.work:hover .col-tools .icon-btn, .col-tools .icon-btn:focus { opacity: 1; }
/* ячейки-поля: без рамок, пока не трогаешь */
/* #smeta — чтобы перебить общий стиль input[type=text] */
#smeta .cell { border: 1px solid transparent; background: transparent; border-radius: 7px; padding: 5px 7px; font: inherit; font-size: 13.5px; color: var(--ink); width: 100%; box-shadow: none; transition: background .12s, border-color .12s; }
#smeta .cell::placeholder { color: var(--faint); }
#smeta .cell:hover:not(:disabled) { background: rgba(var(--ink-rgb), .05); }
#smeta .cell:focus { outline: none; background: var(--card-solid); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#smeta .cell:disabled { color: var(--ink); opacity: 1; }
#smeta .stage-name.cell { font-weight: 700; font-size: 15.5px; padding: 5px 8px; }
#smeta .stage-desc.cell { font-size: 13px; }
.num-cell { text-align: right; width: 72px; font-variant-numeric: tabular-nums; }
.num-cell.amount { width: 96px; }
table.works { margin-top: 2px; }
table.works th { font-size: 11px; letter-spacing: .04em; text-transform: none; color: var(--faint); font-weight: 600; padding: 4px 6px 6px; border-bottom: 1px solid var(--border); }
table.works td { padding: 3px 4px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.works tbody tr:last-child td { border-bottom: none; }
table.works tr.work:hover td { background: rgba(var(--ink-rgb), .02); }
table.works .col-name { min-width: 220px; }
table.works .col-name .cell { width: calc(100% - 4px); }
table.works .col-name .chip-exp { display: inline-block; margin-left: 4px; background: rgba(217, 143, 42, .14); color: #a86b12; border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 600; vertical-align: middle; }
table.works tr.fixed .col-name { display: flex; align-items: center; }
table.works .col-spec { min-width: 150px; white-space: nowrap; }
.chip-select { appearance: none; -webkit-appearance: none; border: none; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 4px 22px 4px 10px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; max-width: 160px; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232f3f8f' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 7px center; background-size: 11px; }
.chip-select.custom { background-color: rgba(var(--ink-rgb), .06); color: var(--muted); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666a78' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.chip-select:disabled { cursor: default; }
.chip-select:focus { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.spec-name { width: 110px; margin-left: 4px; font-size: 13px; }
table.works .col-rate { width: 84px; }
table.works .col-rate .muted { display: inline-block; padding: 5px 7px; font-variant-numeric: tabular-nums; }
table.works .col-hours { width: 84px; }
table.works .col-amount { width: 110px; }
table.works .col-amount b { font-variant-numeric: tabular-nums; white-space: nowrap; }
table.works .col-cost { width: 150px; white-space: nowrap; color: var(--muted); }
table.works .col-cost .num-cell { width: 64px; }
table.works .col-tools { width: 96px; white-space: nowrap; text-align: right; }
table.works tfoot td { padding: 8px 4px 2px; }
.quick-row { display: flex; gap: 10px; align-items: center; }
#smeta .quick { flex: 1; border: 1.5px dashed var(--border-strong); border-radius: 10px; padding: 8px 12px; font: inherit; font-size: 13.5px; background: transparent; color: var(--ink); }
#smeta .quick::placeholder { color: var(--faint); }
#smeta .quick:focus { outline: none; border-style: solid; border-color: var(--accent); background: var(--card-solid); box-shadow: 0 0 0 3px var(--accent-soft); }
.quick.error { border-color: var(--crit-dot); }
.link-btn { border: none; background: transparent; color: var(--accent); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 6px 4px; white-space: nowrap; }
.link-btn:hover { text-decoration: underline; }
#smeta input.saved.cell { box-shadow: 0 0 0 3px var(--ok-bg); border-color: var(--ok-dot); }

/* ── Commercial Offer: хранилище ───────────────────── */
.archive { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.arch-folders { background: rgba(var(--ink-rgb), .04); border-radius: 16px; padding: 8px; display: grid; gap: 2px; position: sticky; top: 16px; max-height: calc(100vh - 40px); overflow: auto; }
.folder { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 13.5px; }
.folder:hover { background: rgba(var(--ink-rgb), .06); text-decoration: none; }
.folder.active { background: var(--card-solid); box-shadow: var(--shadow); font-weight: 600; }
.folder-icon { color: var(--mandarin); font-size: 13px; width: 16px; text-align: center; }
.folder-icon.all { color: var(--accent); }
.folder-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-count { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.arch-head { display: flex; align-items: baseline; gap: 12px; margin: 4px 0 12px; flex-wrap: wrap; }
.arch-head h2 { margin: 0; font-size: 20px; }
.files { display: grid; gap: 8px; }
.file { position: relative; display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: var(--card-solid); border: 1px solid var(--border); border-radius: 14px; color: var(--ink); text-decoration: none; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; }
.file:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.file-icon { width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.file.smeta .file-icon { background: var(--accent-soft); color: var(--accent); }
.file.kp .file-icon { background: rgba(217, 143, 42, .14); color: #a86b12; }
.file-body { display: grid; gap: 3px; min-width: 0; flex: 1; }
.file-body b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.file-meta.faint { color: var(--faint); }
.file-meta .badge { font-size: 11px; padding: 1px 8px 1px 6px; }
.file-actions { display: flex; gap: 6px; flex: none; position: relative; z-index: 1; }
.file-link { position: absolute; inset: 0; border-radius: inherit; }
.file-body b { position: relative; }
@media (max-width: 900px) { .archive { grid-template-columns: 1fr; } .arch-folders { position: static; max-height: none; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); } }

/* ── хранилище: ручные папки ── */
.arch-folders .side-label { margin: 10px 10px 4px; }
.folder-icon.client { color: var(--faint); }
.folder-hint { margin: 2px 10px 6px; }
.folder-new { display: flex; gap: 6px; padding: 4px 6px 2px; }
.folder-new input { flex: 1; min-width: 0; padding: 6px 10px; font-size: 13px; }
.move-form select { padding: 5px 26px 5px 9px; font-size: 12.5px; max-width: 150px; }

.template-pick { margin-bottom: 14px; padding: 12px 16px; }
.template-pick summary { cursor: pointer; font-weight: 650; color: var(--muted); }
.template-form { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.template-form select { min-width: 320px; }

/* ── Хранилище v2: проводник + колонки ─────────────── */
.arch-toolbar { align-items: center; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { color: var(--faint); }
.view-switch .chip { padding: 5px 9px; font-size: 12px; display: inline-flex; align-items: center; line-height: 0; }
.folder-new input { width: 150px; padding: 6px 10px; font-size: 13px; }
.archive-app { display: grid; gap: 14px; align-items: start; min-height: 420px; }
.archive-app { grid-template-columns: 220px minmax(0, 1fr) 300px; }  /* одна сетка для плиток и колонок */
.arch-pane { min-width: 0; }
.arch-tree { background: rgba(var(--ink-rgb), .04); border-radius: 16px; padding: 8px; position: sticky; top: 16px; max-height: calc(100vh - 40px); overflow: auto; }
.arch-tree .side-label, .col .side-label { margin: 10px 8px 4px; }
.tree-item { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; border: none; background: transparent; padding: 8px 10px; border-radius: 10px; color: var(--ink); font: inherit; font-size: 13.5px; cursor: pointer; }
.tree-item:hover { background: rgba(var(--ink-rgb), .06); }
.tree-item.on { background: var(--card-solid); box-shadow: var(--shadow); font-weight: 600; }
.tree-item.root { color: var(--accent); }
.t-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-count { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.tree-hint { margin: 2px 10px 6px; }
/* иконки */
.fold { position: relative; display: inline-block; width: 18px; height: 14px; flex: none; }
.fold::before { content: ""; position: absolute; inset: 3px 0 0 0; background: #e8b04b; border-radius: 3px; }
.fold::after { content: ""; position: absolute; left: 0; top: 0; width: 8px; height: 5px; background: #f3c96b; border-radius: 2px 2px 0 0; }
.fold.client::before { background: #b9bfe6; } .fold.client::after { background: #d5d9f2; }
.docic { position: relative; display: inline-block; width: 14px; height: 18px; flex: none; border: 1.5px solid #9fa8e0; border-radius: 3px; background: var(--card-solid); }
.docic::after { content: ""; position: absolute; left: 3px; right: 3px; top: 5px; height: 2px; background: #9fa8e0; box-shadow: 0 4px 0 #9fa8e0; }
.docic.kp { border-color: #e0b46a; } .docic.kp::after { background: #e0b46a; box-shadow: 0 4px 0 #e0b46a; }
/* плитки */
.tiles-head { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 600; margin: 4px 4px 8px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 10px 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--card-solid); color: var(--ink); font: inherit; cursor: pointer; text-align: center; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; }
.tile:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.tile.sel { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.tile .fold { width: 56px; height: 44px; margin-bottom: 4px; } .tile .fold::before { inset: 8px 0 0 0; border-radius: 7px; } .tile .fold::after { width: 26px; height: 12px; border-radius: 5px 5px 0 0; }
.tile .docic { width: 34px; height: 44px; border-radius: 6px; border-width: 2px; margin-bottom: 4px; } .tile .docic::after { left: 7px; right: 7px; top: 12px; height: 3px; box-shadow: 0 7px 0 #9fa8e0, 0 14px 0 #9fa8e0; } .tile .docic.kp::after { box-shadow: 0 7px 0 #e0b46a, 0 14px 0 #e0b46a; }
.tile b { font-size: 13px; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
.tile-meta { font-size: 11.5px; color: var(--muted); }
.tile-badge { position: absolute; top: 8px; right: 8px; border-radius: 999px; padding: 1px 7px; font-size: 10.5px; font-weight: 700; }
.tile-badge.smeta { background: var(--accent-soft); color: var(--accent); } .tile-badge.kp { background: rgba(217, 143, 42, .16); color: #a86b12; }
/* колонки */
.cols { display: flex; align-items: stretch; overflow-x: auto; background: var(--card-solid); border: 1px solid var(--border); border-radius: 16px; min-height: 420px; max-height: calc(100vh - 170px); scroll-behavior: smooth; }
.col { flex: 0 0 240px; padding: 6px; border-right: 1px solid var(--border); overflow-y: auto; }
.col:last-child { border-right: none; flex: 1 0 240px; }
.col.drop-over { outline-offset: -3px; }
.col .tree-item { border-radius: 8px; padding: 7px 9px; }
.col-item { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; border: none; background: transparent; padding: 7px 9px; border-radius: 8px; color: var(--ink); font: inherit; font-size: 13.5px; cursor: pointer; }
.col-item:hover { background: rgba(var(--ink-rgb), .06); }
.col-item.on { background: var(--accent); color: #fff; }
.col-item.on .t-name, .col-item.client.on .t-name { color: #fff; } .col-item.on .chev { opacity: .8; }
.col-item.on .fold::before { background: rgba(255, 255, 255, .85); } .col-item.on .fold::after { background: #fff; }
.col-item.on .docic { border-color: #fff; background: transparent; } .col-item.on .docic::after { background: #fff; box-shadow: 0 4px 0 #fff; }
.chev { opacity: .5; }
/* панель свойств */
.arch-props { background: var(--card-solid); border: 1px solid var(--border); border-radius: 16px; padding: 16px; position: sticky; top: 16px; box-shadow: var(--shadow); }
.props-empty { padding: 30px 8px; text-align: center; font-size: 13.5px; }
.props-head { display: flex; gap: 12px; align-items: flex-start; }
.props-head .docic { width: 30px; height: 38px; border-radius: 5px; border-width: 2px; flex: none; } .props-head .docic::after { left: 6px; right: 6px; top: 10px; height: 3px; box-shadow: 0 6px 0 #9fa8e0, 0 12px 0 #9fa8e0; } .props-head .docic.kp::after { box-shadow: 0 6px 0 #e0b46a, 0 12px 0 #e0b46a; }
.props-head .fold { width: 44px; height: 34px; } .props-head .fold::before { inset: 6px 0 0 0; border-radius: 6px; } .props-head .fold::after { width: 20px; height: 9px; }
.props-head h3 { margin: 0 0 6px; font-size: 15px; line-height: 1.3; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 5px 12px; margin: 14px 0; font-size: 13px; }
.kv dt { color: var(--faint); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.props-actions { display: grid; gap: 6px; }
.props-actions .btn { text-align: center; }
.props-move { margin-top: 12px; } .props-move label { margin-bottom: 4px; } .props-move select { width: 100%; }
.props-row { display: flex; gap: 6px; margin-top: 12px; } .props-row input { flex: 1; min-width: 0; padding: 6px 10px; }
.arch-props form + form { margin-top: 8px; }
@media (max-width: 1100px) { .archive-app { grid-template-columns: 200px minmax(0, 1fr); } .arch-props { position: static; grid-column: 1 / -1; } }

/* ── Смета: матрица страницы × этапы ─────────────── */
.smeta-toolbar .chips { margin-right: 4px; }
.matrix-wrap { margin-bottom: 14px; }
.matrix-empty { background: var(--card-solid); border-radius: var(--radius); }
table.matrix { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card-solid); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
table.matrix th, table.matrix td { padding: 5px 5px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); font-size: 13px; }
table.matrix th:last-child, table.matrix td:last-child { border-right: none; }
table.matrix tbody tr:last-child td { border-bottom: none; }
table.matrix thead th { background: rgba(var(--ink-rgb), .035); font-weight: 600; color: var(--muted); text-align: center; vertical-align: bottom; }
table.matrix .mx-stage { font-size: 12.5px; color: var(--ink); border-bottom: 2px solid var(--accent-soft); }
/* шапка ролей: без капса и разрядки, перенос по словам — так колонка ужимается до ширины ячейки с часами */
table.matrix .mx-role { font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; white-space: normal; line-height: 1.2; max-width: 76px; overflow-wrap: normal; word-break: normal; hyphens: auto; -webkit-hyphens: auto; padding: 6px 3px; }
table.matrix thead .mx-total { font-size: 10.5px; letter-spacing: .02em; }
table.matrix .mx-obj { text-align: left; min-width: 190px; width: auto; }
table.matrix .mx-obj .cell { font-weight: 600; }
table.matrix .mx-cell { width: 54px; padding: 3px 2px; }
table.matrix .mx-cell.filled { background: var(--accent-soft); }
table.matrix .mx-cell .num-cell { width: 100%; min-width: 44px; text-align: center; padding: 5px 2px; }
table.matrix .mx-total { white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 12.5px; }
table.matrix tfoot td { background: rgba(var(--ink-rgb), .035); font-variant-numeric: tabular-nums; font-size: 12px; white-space: nowrap; }
table.matrix .mx-tools { white-space: nowrap; width: 28px; padding: 0 2px; text-align: center; }
table.matrix .mx-tools .icon-btn { opacity: 0; padding: 2px 4px; }
table.matrix tr:hover .mx-tools .icon-btn { opacity: 1; }
.mx-col-remove { font-size: 10px; padding: 0 3px; vertical-align: middle; }
.mx-add { display: flex; gap: 12px; align-items: flex-start; margin-top: 10px; flex-wrap: wrap; }
.mx-add .quick { flex: 1; min-width: 320px; }
.mx-cols { position: relative; }
.mx-cols summary { cursor: pointer; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: 10px; font-size: 13px; color: var(--muted); }
.mx-cols-body { position: absolute; right: 0; z-index: 5; margin-top: 6px; background: var(--card-solid); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow-lg); min-width: 320px; display: grid; gap: 6px; }
.mx-col-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; font-size: 13px; }
.mx-col-row select { max-width: 200px; padding: 5px 8px; font-size: 12.5px; }
.mx-help { margin: 8px 0 0; }

/* ── перетаскивание ─────────────────────────────── */
.drag-handle { display: inline-flex; align-items: center; justify-content: center; width: 16px; color: var(--faint); cursor: grab; font-size: 13px; letter-spacing: -3px; user-select: none; opacity: 0; transition: opacity .12s; }
.stage:hover .stage-head > .drag-handle, tr.work:hover .drag-handle, table.matrix tr:hover .drag-handle { opacity: 1; }
.drag-handle:active { cursor: grabbing; }
table.works .col-drag { width: 18px; padding-left: 0 !important; padding-right: 0 !important; }
table.matrix .mx-obj { display: table-cell; white-space: nowrap; }
table.matrix .mx-obj .cell { font-size: 13px; padding: 4px 6px; }
table.matrix .mx-obj .drag-handle { vertical-align: middle; margin-right: 2px; }
table.matrix .mx-obj .cell { display: inline-block; width: calc(100% - 22px); vertical-align: middle; }
.dragging { opacity: .45; }
.stage.dragging { outline: 2px dashed var(--accent); }
.drop-over { outline: 2px solid var(--accent) !important; outline-offset: -2px; background: var(--accent-soft) !important; }
.tile[draggable], .col-item[draggable], .tree-item[draggable] { cursor: grab; }

/* матрица: группы этапов */
table.matrix .mx-stage-row th { background: rgba(var(--ink-rgb), .06); text-align: left; color: var(--ink); font-weight: 700; padding: 6px 8px; font-size: 12px; letter-spacing: .03em; }
table.matrix .mx-stage-row th.num { font-size: 12px; letter-spacing: 0; text-transform: none; }
table.matrix .mx-stage-row th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.matrix .mx-group.optional .mx-stage-row th { color: var(--muted); }
table.matrix .mx-quick-row td { padding: 4px 6px 8px; border-bottom: 2px solid var(--border); }
table.matrix .mx-quick-row .quick { width: 100%; padding: 6px 10px; font-size: 13px; }
table.matrix tfoot .mx-obj { font-weight: 600; }

/* ── импорт сметы из таблицы ─────────────────────── */
.smeta-toolbar .smeta-import { margin-left: auto; }
#import-dialog input[type=file] { width: 100%; padding: 8px; border: 1px dashed var(--border-strong); border-radius: 10px; background: transparent; }
#import-dialog .import-or { text-align: center; margin: 6px 0; }
#import-dialog label { display: block; margin-bottom: 4px; }
#import-dialog input[type=url] { width: 100%; }
.import-sheets { margin-bottom: 12px; display: inline-flex; }
.import-sheets .chip { text-decoration: none; }
.import-warn { margin-bottom: 12px; }
.import-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; align-items: start; }
.import-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; min-width: 0; }
.import-map h3, .import-preview h3, .import-side h3 { margin: 0 0 10px; font-size: 15px; }
.import-map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-bottom: 10px; }
.import-col { display: grid; gap: 4px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--card-solid); }
.import-col.auto { border-color: var(--accent-soft); background: var(--accent-soft); }
.import-col.unmapped { background: rgba(var(--ink-rgb), .04); }
.import-col-head { font-size: 12.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-col-rate { font-size: 11.5px; color: var(--faint); min-height: 14px; }
.import-col select { width: 100%; font-size: 12.5px; padding: 5px 8px; }
table.import-table .mx-obj { min-width: 220px; max-width: 460px; white-space: normal; }
table.import-table th.mx-obj { white-space: nowrap; }
table.import-table .mx-cell { width: 54px; text-align: right; }
table.import-table .mx-line { width: 44px; text-align: right; font-size: 11.5px; }
table.import-table td.mx-obj { font-weight: 500; padding: 6px 8px; }
.import-skipped summary { cursor: pointer; font-weight: 650; color: var(--muted); }
.import-skipped table { margin-top: 10px; }
.import-skipped th, .import-skipped td { padding: 5px 8px; font-size: 12.5px; }
.import-side { position: sticky; top: 16px; }
.import-mode { display: grid; gap: 6px; margin: 12px 0; font-size: 13.5px; }
.import-submit { width: 100%; text-align: center; }
@media (max-width: 1100px) { .import-layout { grid-template-columns: 1fr; } .import-side { position: static; } }

/* ── словари: кейсы и тарифы ─────────────────────── */
.case-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.case-tile { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--card-solid); display: flex; flex-direction: column; }
.case-cover { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; display: block; background: rgba(var(--ink-rgb), .05); }
.case-body { padding: 10px 12px 6px; display: grid; gap: 3px; flex: 1; }
.case-body p { margin: 2px 0 0; }
.case-actions { display: flex; gap: 6px; justify-content: flex-end; padding: 6px 10px 10px; }
.case-cover-preview { display: block; max-width: 320px; border-radius: 10px; border: 1px solid var(--border); margin-bottom: 8px; }
.pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 8px; align-items: start; }
.pick-list > p, .pick-list > span, .pick-manage { grid-column: 1 / -1; }
.pick { display: grid; grid-template-columns: auto 56px minmax(0, 1fr); gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--card-solid); cursor: pointer; font-size: 13px; }
.pick:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.plans-pick .pick { grid-template-columns: auto minmax(0, 1fr) auto; }
.pick-cover { width: 56px; height: 36px; object-fit: cover; border-radius: 6px; }
.pick-text { display: grid; min-width: 0; } .pick-text b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .pick-text small { color: var(--faint); }
.pick-rec { font-size: 12px; color: var(--muted); white-space: nowrap; display: inline-flex; gap: 4px; align-items: center; }
.pick-list label.small { margin-left: 8px; }

/* ── хранилище: навигация и папки клиентов ──────── */
.arch-main-wrap { min-width: 0; }
.arch-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 0 10px; }
.arch-bar-right { display: flex; align-items: center; gap: 8px; }
.arch-up { flex: none; padding: 5px 11px; }
.btn.icon-only { padding: 5px 8px; display: inline-flex; align-items: center; }
.folder-new { display: flex; gap: 6px; align-items: center; margin: -2px 0 10px; padding: 8px 10px; background: var(--card-solid); border: 1px solid var(--border); border-radius: 12px; }
.folder-new input[type=text] { flex: 1; width: auto; min-width: 0; padding: 6px 10px; font-size: 13px; }
.arch-toolbar .search { margin-left: auto; }
.arch-up:disabled { opacity: .45; cursor: default; box-shadow: none; }
.arch-up.drop-over { background: var(--accent) !important; color: #fff !important; outline: none !important; }
.tree-item.client .t-name, .col-item.client .t-name { color: var(--accent); }
.tile.folder.client { background: linear-gradient(180deg, var(--accent-soft), var(--card-solid) 70%); }
.tile.folder.client b { color: var(--accent); }
.fold.client::before { background: #7f8ce0; } .fold.client::after { background: #a4aeee; }
.props-note { margin: 10px 0 0; line-height: 1.45; }

/* ── услуги ─────────────────────────────────────── */
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.tab-ro { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); margin-left: 6px; vertical-align: middle; opacity: .6; }
.service-flags { display: flex; gap: 18px; flex-wrap: wrap; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .form-grid.three { grid-template-columns: 1fr; } }

/* ── матрица: свойства этапа ────────────────── */
table.matrix .mx-gear { opacity: .45; font-size: 14px; }
table.matrix tr:hover .mx-gear, table.matrix .mx-gear:focus { opacity: 1; }
table.matrix .mx-stage-edit td { background: var(--accent-soft); padding: 10px 12px 12px; border-bottom: 2px solid var(--accent); }
.mx-edit { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.mx-edit label { display: grid; gap: 3px; font-size: 11.5px; color: var(--muted); min-width: 180px; }
.mx-edit label.grow { flex: 1; min-width: 260px; } .mx-edit label.narrow { min-width: 90px; }
.mx-edit label.check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); padding-bottom: 6px; }
.mx-edit .cell { background: var(--card-solid); border-color: var(--border); }
.mx-edit-actions { display: flex; gap: 6px; margin-left: auto; padding-bottom: 2px; }

/* ── старт пустой сметы ───────────────────── */
.smeta-toolbar .smeta-import { margin-left: auto; display: flex; gap: 6px; }
.smeta-start { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 4px 0 18px; }
.start-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; aspect-ratio: 1.25; padding: 22px 18px; border: 1.5px dashed var(--border-strong); border-radius: 18px; background: var(--card-solid); color: var(--ink); font: inherit; cursor: pointer; text-align: center; transition: transform .12s, border-color .12s, box-shadow .12s; }
.start-card:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow-lg); border-style: solid; }
.start-card:disabled { opacity: .55; cursor: default; }
.start-card .start-icon { width: 52px; height: 52px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; }
.start-card b { font-size: 15px; } .start-card small { color: var(--muted); font-size: 12.5px; line-height: 1.4; max-width: 240px; }
.btn.danger-ghost { color: var(--crit); }
@media (max-width: 900px) { .smeta-start { grid-template-columns: 1fr; } .start-card { aspect-ratio: auto; } }

/* ── полоса режима призрака ──────────────── */
.ghost-top { position: sticky; top: 0; z-index: 60; display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 7px 18px; background: var(--warn); color: #fff; font-size: 13px; }
.ghost-top .btn { background: #fff; color: var(--warn); box-shadow: none; padding: 4px 12px; }
.layout.has-ghost .sidebar { top: 34px; height: calc(100vh - 34px); }

.props-access { margin-top: 12px; display: grid; gap: 6px; }
.props-access label { font-size: 12px; color: var(--muted); }
.props-access select { width: 100%; }
.access-users { display: grid; gap: 4px; max-height: 180px; overflow: auto; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: rgba(var(--ink-rgb), .03); }
.access-user { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; align-items: center; font-size: 13px; color: var(--ink) !important; }
.access-user small { grid-column: 2; font-size: 11px; }
.access-user.author { opacity: .7; } .access-user.author input { cursor: not-allowed; }

/* ── кнопки добавления: основной путь, строка ввода — дополнительный ── */
.quick-secondary { flex: 1; min-width: 200px; font-size: 12.5px !important; color: var(--muted); }
.quick-row .btn { flex: none; }
.mx-add-row { display: flex; gap: 8px; align-items: center; }
.mx-add-row .quick { flex: 1; }
.mx-actions { display: flex; gap: 10px; margin: 10px 0 4px; }
table.matrix .mx-fixed td { background: rgba(var(--ink-rgb), .02); }
table.matrix .mx-fixed-span { text-align: left; font-style: italic; padding-left: 10px; }
.mx-fixed-tag { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 5px; background: rgba(217, 143, 42, .18); color: #a86b12; font-size: 11px; font-weight: 800; margin-right: 4px; vertical-align: middle; }
table.matrix .mx-fixed .mx-fixed-amount { width: 90px; text-align: right; font-weight: 700; }
table.matrix .mx-fixed .mx-obj .cell { width: calc(100% - 24px); }

/* ── блок «Запрос на оценку» в карточке ───────── */
.request-brief { margin-top: 12px; padding: 12px 16px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--card-solid); }
.rb-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; font-size: 14px; }
.rb-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 22px; margin: 0; font-size: 13.5px; }
.rb-grid dt { color: var(--faint); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }
.rb-grid dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.rb-grid > div { min-width: 0; }
.request-brief .request-comment { margin-top: 12px; }
@media (max-width: 900px) { .rb-grid { grid-template-columns: 1fr 1fr; } }

/* ── подсказки по экранам («Помощь») ─────────── */
.nav-help { width: 100%; text-align: left; border: none; background: transparent; font: inherit; cursor: pointer; margin-top: auto; }
.tour-overlay { position: fixed; inset: 0; z-index: 900; }
.tour-spot { position: fixed; border-radius: 14px; box-shadow: 0 0 0 200vmax rgba(15, 17, 40, .62); transition: all .25s ease; pointer-events: none; }
.tour-overlay::before { content: ""; position: fixed; inset: 0; }
.tour-card { position: fixed; z-index: 901; background: var(--card-solid); color: var(--ink); border-radius: 16px; padding: 14px 16px 12px; box-shadow: var(--shadow-lg); width: 360px; max-width: calc(100vw - 24px); animation: tour-in .2s ease; }
@keyframes tour-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }
.tour-head { display: flex; justify-content: space-between; align-items: center; color: var(--faint); font-size: 12px; }
.tour-close { border: none; background: transparent; color: var(--faint); cursor: pointer; font-size: 14px; padding: 2px 6px; border-radius: 6px; }
.tour-close:hover { background: rgba(var(--ink-rgb), .06); }
.tour-card h3 { margin: 6px 0 4px; font-size: 16px; }
.tour-card p { margin: 0 0 12px; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.tour-actions { display: flex; gap: 8px; align-items: center; }
.tour-actions .link-btn { margin-left: auto; color: var(--faint); }

/* ── бриф клиента (карточка и услуга) ─────────── */
.stepper li.skipped .dot { background: transparent; color: var(--faint); border-color: var(--border-strong); }
.stepper li.skipped .lbl { color: var(--faint); text-decoration: line-through; }
.est-tabs .pill.small { font-size: 10.5px; padding: 1px 7px; margin-left: 4px; vertical-align: middle; }
.est-tab-action { margin-left: auto; align-self: center; }
.brief-layout { display: grid; gap: 14px; }
.brief-status-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.brief-status-head h2 { margin: 0 0 4px; }
.brief-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.brief-note { display: grid; gap: 6px; margin-top: 12px; max-width: 720px; }
.brief-note label { font-size: 12.5px; color: var(--muted); }
.brief-note button { justify-self: start; }
.brief-section { margin: 16px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.brief-answer { padding: 10px 0; border-top: 1px solid var(--border); }
.brief-answer.empty .ba-v { color: var(--faint); }
.ba-q { font-weight: 650; font-size: 13.5px; } .ba-q .req { color: var(--crit); }
.ba-v { margin-top: 3px; white-space: pre-wrap; font-size: 14px; }
.ba-note { margin-top: 6px; padding: 8px 12px; background: var(--accent-soft); border-radius: 10px; font-size: 13px; }
.ba-edit summary { cursor: pointer; margin-top: 6px; }
.ba-form { display: grid; gap: 8px; margin-top: 8px; max-width: 640px; }
.ba-form label { display: grid; gap: 3px; font-size: 12.5px; color: var(--muted); }
.ba-form .checks { display: flex; gap: 12px; flex-wrap: wrap; }
.ba-form button { justify-self: start; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 13px; text-decoration: none; margin: 2px 6px 2px 0; }
.file-chip small { color: var(--faint); }
.bq-list { display: grid; gap: 8px; }
.bq { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--card-solid); margin: 0; }
.bq.dragging { opacity: .5; }
.bq .drag-handle { opacity: .5; margin-top: 8px; }
.bq-plus { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); font-weight: 800; margin-top: 6px; }
.bq-fields { display: grid; gap: 6px; min-width: 0; }
.bq-fields input[type=text], .bq-fields textarea, .bq-fields select { width: 100%; font-size: 13.5px; padding: 6px 10px; }
.bq-row { display: grid; grid-template-columns: minmax(0, 1fr) 180px auto; gap: 8px; align-items: center; }
.bq-row .checks { white-space: nowrap; font-size: 13px; }
.bq-tools { display: flex; gap: 6px; align-items: center; margin-top: 4px; }
.bq-new { margin-top: 12px; border-style: dashed; }
@media (max-width: 900px) { .bq-row { grid-template-columns: 1fr; } .bq { grid-template-columns: 22px minmax(0, 1fr); } .bq-tools { grid-column: 2; } }

/* ── аватар в сайдбаре ── */
.side-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; }
.side-avatar.initials { display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: #fff; font-weight: 800; font-size: 14px; }
.side-profile .who { min-width: 0; overflow: hidden; }

/* ── конструктор КП ─────────────────────────────── */
.ob-zone { margin-top: 14px; }
.ob-zone-title { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 700; }
.ob-zone-title small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.ob-list { display: grid; gap: 10px; min-height: 28px; padding: 2px; border-radius: 12px; }
.ob-list:empty { border: 1.5px dashed var(--border); min-height: 44px; }
.ob { border: 1px solid var(--border); border-radius: 14px; background: var(--card-solid); padding: 10px 14px 12px; }
.ob.is-hidden { opacity: .55; background: rgba(var(--ink-rgb), .02); }
.ob.dragging { opacity: .4; }
.ob-head { display: flex; align-items: center; gap: 10px; }
.ob-head .drag-handle { opacity: .5; cursor: grab; }
.ob-title { flex: 1; min-width: 0; font-weight: 700; font-size: 14.5px; border: 1px solid transparent; background: transparent; padding: 4px 6px; border-radius: 8px; font-family: inherit; color: var(--ink); }
.ob-title:hover, .ob-title:focus { border-color: var(--border); background: var(--card-solid); outline: none; }
.ob-switch { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.ob-switch input { display: none; }
.ob-switch .track { width: 30px; height: 18px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background .15s; }
.ob-switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left .15s; }
.ob-switch input:checked + .track { background: var(--accent); } .ob-switch input:checked + .track::after { left: 14px; }
.ob-variants { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 6px; }
.ob-variants .chip { font-size: 12px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--card-solid); cursor: pointer; }
.ob-variants .chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.ob-variants .chip.active small { color: rgba(255, 255, 255, .8); }
.ob-update { margin: 6px 0; padding: 6px 10px; background: var(--warn-bg); color: var(--warn); border-radius: 10px; font-size: 12.5px; }
.ob-update .link-btn { font-size: 12.5px; padding: 0 4px; color: inherit; text-decoration: underline; }
.ob-preview { margin-top: 6px; font-size: 13.5px; line-height: 1.55; color: var(--ink); cursor: text; padding: 6px 8px; border-radius: 8px; border: 1px dashed transparent; }
.ob-preview:hover { border-color: var(--border); background: rgba(var(--ink-rgb), .02); }
.ob-body { width: 100%; margin-top: 6px; font-size: 13.5px; }
.ob-add { margin-top: 8px; }
.ob-actions { align-items: center; gap: 12px; }
.ob-help { margin: 0 0 10px; } .ob-help summary { cursor: pointer; }
.ob-ph { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: 12.5px; }
.ob-ph-item code { background: var(--accent-soft); color: var(--accent); padding: 1px 6px; border-radius: 6px; }
.lib-common { margin-top: 10px; padding: 8px 12px; background: rgba(var(--ink-rgb), .03); border-radius: 10px; }
.lib-goes { margin-top: 8px; }

/* ── профиль в сайдбаре: кликабельный блок ── */
.side-profile { padding-left: 2px; padding-right: 2px; gap: 2px; }
.side-me { display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; padding: 5px 4px; border-radius: 12px; color: inherit; text-decoration: none; transition: background .12s; }
.side-me .side-avatar { width: 30px; height: 30px; font-size: 13px; }
.side-me .who-name { font-size: 12.5px; }
.side-me .who-name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.side-me .who .muted { display: block; font-size: 12px; line-height: 1.3; }
.side-me:hover, .side-me.active { background: rgba(var(--ink-rgb), .06); text-decoration: none; }
.side-me .who { flex: 1; min-width: 0; overflow: hidden; }
.ob-status.pending { color: var(--warn); } .ob-status.ok { color: var(--ok, #2e8b57); } .ob-status.error { color: var(--crit); } .ob-status.saving { color: var(--muted); }

.edit-cta { display: flex; justify-content: space-between; align-items: center; gap: 16px; background: linear-gradient(135deg, var(--accent-soft), var(--card-solid) 70%); }

/* ── Просрочка, связи оценок, версии КП, пустые колонки доски ── */
.overdue { color: var(--crit); font-weight: 600; }
.related { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.related .badge { vertical-align: middle; }
.version-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.version-diff { margin: 4px 0 8px; padding: 6px 10px; border-left: 2px solid var(--border-strong); color: var(--ink); line-height: 1.5; }
.board .bcol.is-empty { flex-basis: 118px; }
.bcol.is-empty header { flex-direction: column; align-items: flex-start; gap: 2px; padding-bottom: 8px; }
.bcol.is-empty .bcol-title { font-size: 12px; line-height: 1.2; }
.bcol.is-empty .bcol-empty { padding: 18px 0; font-size: 12px; }

/* согласование с телефона: панель действий и шапка карточки в столбик */
@media (max-width: 640px) {
  .est-head { flex-direction: column; align-items: stretch; }
  .est-head .group { display: flex; flex-wrap: wrap; gap: 8px; }
  .est-head .inline-form { display: flex; gap: 8px; width: 100%; }
  .est-head .inline-form select { flex: 1; min-width: 0; }
  .flow-row { flex-direction: column; align-items: stretch; }
  .flow-actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .flow-actions .btn { width: 100%; text-align: center; padding: 12px 14px; font-size: 15px; }
  .stepper li { min-width: 104px; font-size: 12px; }
  .rb-grid { grid-template-columns: 1fr; }
  .dialog form { width: min(100%, 520px); }
  .dialog textarea { width: 100%; }
}

/* ── удаление админом ── */
.bulk-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; margin: -6px -8px 10px; border-radius: 12px; background: var(--crit-bg); color: var(--crit); font-size: 13.5px; }
.bulk-bar b { font-size: 15px; }
.estimates-table th.chk, .estimates-table td.chk { width: 34px; padding-right: 0; }
.estimates-table td.chk input { width: 16px; height: 16px; cursor: pointer; }
.btn.danger-text { color: var(--crit); }
.props-admin { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); display: grid; gap: 6px; justify-items: start; }
