/* Flow v3 — стили доработок. Только новые блоки; токены — из действующей дизайн-системы (exp-bold.css). */

/* ---------- общее ---------- */
.row-f4{display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px}
@media (max-width:767px){ .row-f4{grid-template-columns:repeat(2,minmax(0,1fr))} }
.fld-i{display:inline-flex; align-items:center; gap:6px; font-size:12.5px; color:var(--ink-2)}
.fld-i input,.fld-i select{min-height:34px}
.note.crit{background:var(--crit-soft); color:var(--ink)}
.sev-dot{display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:6px; vertical-align:middle}
tr.chg td, td.chg{background:var(--warn-soft) !important}

/* ---------- Документы: дерево категорий ---------- */
.dv3{display:grid; grid-template-columns:260px minmax(0,1fr); gap:18px; align-items:start}
.dv3-main{min-width:0; display:flex; flex-direction:column; gap:16px}
.dv3-h{display:flex; flex-wrap:wrap; align-items:baseline; gap:6px 12px}
.dv3-h h2{font-size:20px}
.dt{position:sticky; top:12px; background:var(--surface); border-radius:var(--r-lg); box-shadow:var(--elev-1, 0 0 0 1px var(--line)); padding:8px; max-height:calc(100vh - 40px); overflow:auto}
.dt ul{list-style:none; margin:0; padding:0}
.dt-row{display:flex; align-items:center; gap:2px; padding-left:calc(var(--dep,0) * 14px); border-radius:8px}
.dt-row.on{background:var(--brand-tint)}
.dt-row.on .dt-b{color:var(--brand-ink); font-weight:650}
.dt-tw{flex:none; width:22px; height:22px; display:grid; place-items:center; border:0; background:none; color:var(--ink-3); border-radius:6px; cursor:pointer; padding:0}
.dt-tw:hover{background:var(--hover)}
.dt-b{flex:1; min-width:0; display:flex; align-items:center; gap:8px; border:0; background:none; text-align:left; font:inherit; font-size:13px; color:var(--ink); padding:7px 8px 7px 2px; cursor:pointer; border-radius:8px}
.dt-b:hover{background:var(--hover)}
.dt-n{flex:1; min-width:0; overflow-wrap:anywhere; line-height:1.3}
.dt-c{flex:none; font-size:11.5px; color:var(--ink-3); font-weight:600; font-variant-numeric:tabular-nums}
.dt-adm{display:flex; align-items:center; gap:6px; margin:8px 6px 4px; font-size:12.5px}
.dt-sel{display:none}
.dv3-kids{margin-top:-4px}
.dv3-loc .kv{margin:0}
@media (max-width:1023px){
  .dv3{grid-template-columns:1fr}
  .dt{display:none}
  .dt-sel{display:flex; flex-direction:column; gap:4px}
  .dt-sel select{min-height:42px; font:inherit; padding:0 10px; border-radius:10px; border:1px solid var(--line-strong); background:var(--surface); color:var(--ink)}
}
/* выбор категории в формах */
.cpick{max-height:240px; overflow:auto; border:1px solid var(--line); border-radius:10px; padding:4px; margin-top:6px; background:var(--surface)}
.cp-i{display:flex; align-items:center; gap:8px; padding:6px 8px 6px calc(8px + var(--dep,0) * 16px); border-radius:8px; cursor:pointer; font-size:13px}
.cp-i:hover{background:var(--hover)}
.cp-i small{margin-left:auto; color:var(--ink-3); font-size:11px}
.cp-i:has(input:checked){background:var(--brand-tint)}
.dc-list{display:flex; flex-direction:column; gap:2px; max-height:56vh; overflow:auto}
.dc-row{display:flex; align-items:center; gap:10px; padding:6px 6px 6px calc(6px + var(--dep,0) * 18px); border-radius:8px; border-bottom:1px solid var(--line)}
.dc-row:hover{background:var(--hover)}
.dc-n{flex:1; min-width:0; font-size:13px}
.dc-a{display:flex; gap:4px; flex-wrap:wrap; justify-content:flex-end}
/* договоры: файлы */
.ct-files td{background:var(--surface-2)}
.ct-fl{display:flex; flex-direction:column; gap:8px; padding:4px 0}
.ct-d{font-size:13px}
.ct-f{display:inline-flex; align-items:center; gap:6px; margin:4px 10px 0 0; flex-wrap:wrap}

/* ---------- Ежедневный факт: суточные данные ---------- */
.df-tools{display:flex; flex-wrap:wrap; gap:8px 10px; align-items:center; padding:0 24px 14px}
@media (max-width:767px){ .df-tools{padding:0 16px 12px} }
.dfw{border:1px solid var(--line); border-radius:var(--r-lg); padding:12px 14px; margin-bottom:12px; background:var(--surface)}
.dfw.chg{border-color:var(--warn)}
.dfw-h{display:flex; flex-wrap:wrap; gap:8px 18px; align-items:flex-start; justify-content:space-between; margin-bottom:8px}
.dfw-n{min-width:0; flex:1 1 320px}
.dfw-n b{font-size:14px}
.dfw-n .faint{font-size:12px; margin-top:2px}
.dfw-code{display:inline-block; font-size:11.5px; font-weight:650; color:var(--ink-3); background:var(--surface-2); border-radius:6px; padding:1px 6px; margin-right:6px; font-variant-numeric:tabular-nums}
.dfw-k{display:grid; grid-template-columns:auto 120px auto auto; gap:4px 16px; align-items:center; font-size:12.5px; color:var(--ink-2)}
.dfw-k small{display:block; font-size:11px; color:var(--ink-3)}
.dfw-k b{color:var(--ink); font-size:14px}
.dfw-bar{height:8px; background:var(--track); border-radius:4px; overflow:hidden}
.dfw-bar i{display:block; height:100%; background:var(--good); border-radius:4px}
@media (max-width:767px){ .dfw-k{grid-template-columns:1fr 1fr} .dfw-bar{grid-column:1/-1} }
.dft td,.dft th{padding-top:6px; padding-bottom:6px}
.dft .nin{width:96px}
.dfw-add{display:inline-flex; align-items:center; gap:4px; margin-top:6px; font-size:12.5px}
.df-chk{list-style:none; margin:4px 0 0; padding:0; font-size:11px; text-align:left; line-height:1.4}
.df-chk li.ok{color:var(--good)} .df-chk li.w{color:var(--warn-ink)}
.df-bar{position:sticky; bottom:0; z-index:5; display:flex; flex-wrap:wrap; gap:8px 10px; align-items:center; padding:12px 24px; background:var(--surface); border-top:1px solid var(--line)}
.df-bar.on{box-shadow:0 -10px 24px -18px rgba(10,18,38,.35); border-top-color:var(--warn)}
.df-bar .grow{flex:1}
.df-bar #df-note{flex:1 1 280px; max-width:520px}
@media (max-width:767px){ .df-bar{bottom:calc(60px + env(safe-area-inset-bottom,0px)); padding:10px 16px} }
/* форма отчёта */
.rf-auto{display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; background:var(--surface-2); border-radius:10px; padding:10px 12px; margin-bottom:10px}
.rf-auto > span,.rf-auto > label{display:flex; flex-direction:column; gap:3px; min-width:0; font-size:13px}
.rf-auto small{font-size:11px; color:var(--ink-3)}
.rf-auto select,.rf-auto input{min-height:34px; font:inherit; font-size:13px}
@media (max-width:900px){ .rf-auto{grid-template-columns:repeat(2,minmax(0,1fr))} }
.rf-t .nin{width:84px} .rf-t .inp{min-width:120px}
.rf-iss{display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px 14px}
.rf-is{display:flex; flex-direction:column; gap:4px; padding:6px 8px; border-radius:8px}
.rf-is.on{background:var(--warn-soft)}
@media (max-width:767px){ .rf-iss{grid-template-columns:1fr} }

/* ---------- Подрядчики и договоры ---------- */
.ocards{display:flex; flex-direction:column; gap:14px}
.ocard{background:var(--surface); border-radius:var(--r-lg); box-shadow:var(--elev-1, 0 0 0 1px var(--line)); padding:16px 18px}
.ocard > header{display:flex; gap:12px; justify-content:space-between; align-items:flex-start; margin-bottom:12px}
.ocard h3{font-size:16px; margin-top:4px}
.oc-grid{display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px}
.oc-grid .eyebrow{margin-bottom:6px}
.oc-grid .qlink{display:block; text-align:left; margin:0 0 4px}
@media (max-width:1100px){ .oc-grid{grid-template-columns:repeat(2,minmax(0,1fr))} }
@media (max-width:640px){ .oc-grid{grid-template-columns:1fr} }

/* ---------- Риски: «Требует решения» ---------- */
.dec-block .att-i .chip:last-child{margin-left:auto; flex:none}

/* ---------- рабочие экраны ГИП / сметчика ---------- */
.wb .tiles{margin-bottom:12px}
.wb-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:14px}
.wb-box{border:1px solid var(--line); border-radius:var(--r-md); padding:10px 12px; min-width:0}
.wb-h{display:flex; align-items:center; gap:8px; margin-bottom:6px; font-size:13px}
.wb-h .cnt{margin-left:auto; position:static}

/* ---------- обзор: одна колонка без блока «Требует решения» ---------- */
.ox-grid.ox-one{grid-template-columns:minmax(0,1fr)}

/* ---------- матрица прав ---------- */
.mx-top{display:flex; flex-wrap:wrap; gap:10px 14px; align-items:center; margin-bottom:10px}
.mx-wrap{max-height:70vh; overflow:auto}
.mx3 thead th{position:sticky; top:0; z-index:2; background:var(--surface)}
.mx3 th span{display:block}
.mx-colall{display:inline-grid; place-items:center; margin-top:4px}
.mx3 tr.mx-sub td:first-child{padding-left:22px}
.mx3 tr.mx-sub td:first-child b{font-weight:550}
.mx3 td.mx-na{color:var(--ink-3); background:var(--surface-2); cursor:help}
.mx-bar.on{border-top-color:var(--warn)}
.mx-ra{font-size:11px; font-weight:400; white-space:nowrap}
.mx-user{display:flex; flex-direction:column; gap:4px; padding:10px 12px; border-radius:10px; background:var(--surface-2); margin-bottom:10px}
.mxu{display:inline-grid; place-items:center; width:28px; height:28px; border-radius:7px; border:1px solid var(--line-strong); background:var(--surface); color:var(--ink-3); font:inherit; font-weight:700; cursor:pointer; padding:0}
.mxu.on{color:#fff; background:var(--ink-3); border-color:transparent}
.mxu.on.s-role{background:var(--accent)}
.mxu.on.s-grant,.mxu.on.s-rule{background:var(--good)}
.mxu.on.s-prule{background:var(--good); box-shadow:inset 0 0 0 2px var(--surface), 0 0 0 2px var(--good)}
.mxu.s-deny{color:var(--crit); border-color:var(--crit); background:var(--crit-soft)}
.mxu.on.s-super{background:var(--ink-2)}
.mxu:disabled{cursor:not-allowed; opacity:.55}
tr.mx-off td{opacity:.55}

/* ---------- график: изменение размеров ---------- */
.gt-lh{position:sticky}
.gt-lh .gt-c{position:relative}
.gt-rz{position:absolute; top:0; right:-4px; bottom:0; width:8px; cursor:col-resize; z-index:2}
.gt-rz::after{content:''; position:absolute; top:8px; bottom:8px; left:3px; width:2px; border-radius:1px; background:transparent}
.gt-lh .gt-c:hover .gt-rz::after,.rz-col .gt-rz::after{background:var(--line-strong)}
.gt-rz:hover::after{background:var(--accent) !important}
.gt-split{position:absolute; top:0; right:-5px; width:10px; height:50px; cursor:col-resize; z-index:3}
.gt-split::after{content:''; position:absolute; top:6px; bottom:6px; left:4px; width:2px; border-radius:1px; background:var(--accent); opacity:.35}
.gt-split:hover::after{opacity:1}
.gt-l{position:sticky}
.gt-rzh{position:absolute; left:0; right:0; bottom:-3px; height:6px; cursor:row-resize; z-index:2}
.gt-rzh:hover{background:color-mix(in srgb, var(--accent) 35%, transparent)}
.gt-row[style*="--rh"] .gb-main,.gt-row[style*="--rh"] .gb-ext{top:calc(var(--rh) / 2 - 8px)}
.gt-row[style*="--rh"] .gb-base{top:calc(var(--rh) / 2 + 8px)}
.gt-row[style*="--rh"] .gb-ms,.gt-row[style*="--rh"] .gb-msp{top:calc(var(--rh) / 2 - 7px)}
.gt-row[style*="--rh"] .gb-lbl{top:calc(var(--rh) / 2 - 8px)}
.gt-row[style*="--rh"] .gb-stg{top:calc(var(--rh) / 2 - 4px)}
.qc{position:fixed}
.qc-rz{position:absolute; left:-4px; top:16px; bottom:16px; width:8px; cursor:ew-resize; z-index:2; border-radius:4px}
.qc-rz:hover{background:color-mix(in srgb, var(--accent) 30%, transparent)}
html.rz-col,html.rz-col *{cursor:col-resize !important; user-select:none}
html.rz-row,html.rz-row *{cursor:row-resize !important; user-select:none}
html.rz-qc,html.rz-qc *{cursor:ew-resize !important; user-select:none}
@media (max-width:767px){ .gt-rz,.gt-split,.gt-rzh,.qc-rz{display:none} }
.df-tools .inp{width:auto; flex:0 1 auto; max-width:280px; min-height:36px}
.df-tools select.inp{max-width:300px}
.dft{table-layout:fixed; width:100%; min-width:640px}
.dft th:nth-child(1){width:34%} .dft th:nth-child(2){width:16%} .dft th:nth-child(3){width:14%} .dft th:nth-child(4){width:24%} .dft th:nth-child(5){width:12%}
.dft td:nth-child(5),.dft th:nth-child(5){text-align:center}
@media (max-width:767px){
  .df-bar:not(.on){display:none}
  .df-bar{gap:6px} .df-bar > span:first-child{flex:1 1 100%; font-size:12.5px}
  .df-bar #df-note{flex:1 1 100%; max-width:none; min-height:36px}
  .df-bar .grow{display:none} .df-bar .btn{flex:1 1 auto; padding-inline:10px}
}
