/* «Качество заполнения сделок»: поверх общего app.css (палитра, кнопки, карточки, таблицы — как в «Бонусах») */

.note.err, .note.warn, .note.info, .note.ok { border-radius: 10px; padding: 12px 14px; font-size: 14px; }
.note.err { background: var(--err-bg); color: var(--err-ink); }
.note.warn { background: var(--warn-bg); color: var(--warn-ink); }
.note.info { background: var(--info-bg); color: #0a6f8f; }
.err-line { font-size: 13px; color: var(--err-ink); margin-top: 8px; }
.ok-line { font-size: 13px; color: var(--ok-ink); margin-top: 8px; }
.err-line:empty, .ok-line:empty { display: none; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 60; background: #2b3540; color: #fff; padding: 10px 16px;
  border-radius: 10px; font-size: 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); max-width: min(560px, 92vw); }
.toast.bad { background: var(--err-ink); }

/* «Поможем настроить» — компактная плашка с вопросом в чат поддержки (как в «Журнале изменений CRM» и «Целях и плане») */
.cta-chat { margin: 0; max-width: 820px; padding: 9px 12px 9px 10px; border-radius: 10px; color: #fff;
  background: linear-gradient(120deg, #4aa3ff 0%, #1269d3 100%); box-shadow: 0 3px 10px rgba(30, 136, 255, .2); }
.cta-main { display: flex; align-items: center; gap: 10px; }
.cta-ico { flex: none; width: 30px; height: 30px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 16px; line-height: 1; }
.cta-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 13px; color: rgba(255,255,255,.92); }
.cta-title { font-size: 14px; font-weight: 600; color: #fff; display: flex; align-items: center; flex-wrap: wrap; gap: 2px 8px; }
.cta-free { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: #ffe066; color: #5c4400; border-radius: 5px; padding: 1px 6px; }
.cta-act { flex: none; display: flex; align-items: center; }
.btn.cta-btn { height: 30px; padding: 0 14px; background: #fff; color: #1265c7; border: 0; font-weight: 700; text-decoration: none; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.btn.cta-btn:hover { background: #eef6ff; }
.btn.cta-btn:disabled { opacity: .7; cursor: default; }
.cta-link { border: 0; background: none; padding: 0; color: #fff; font: inherit; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.cta-form { margin-top: 9px; display: flex; flex-direction: column; gap: 8px; }
.cta-form .input { border-color: transparent; color: #333; }
.cta-form-row { display: flex; align-items: center; gap: 14px; }
.cta-msg { margin-top: 6px; font-size: 13px; color: #fff; font-weight: 500; }
@media (max-width: 720px) { .cta-main { flex-wrap: wrap; } .cta-act { width: 100%; } }
.cta-chat [hidden] { display: none !important; }

/* ---------- балл ---------- */
.sc { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; padding: 2px 8px; border-radius: 6px;
  font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sc.good { background: var(--ok-bg); color: var(--ok-ink); }
.sc.mid { background: var(--warn-bg); color: var(--warn-ink); }
.sc.low { background: var(--err-bg); color: var(--err-ink); }
.meter { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.meter .track { flex: 1; height: 8px; border-radius: 4px; background: var(--chip-bg); overflow: hidden; position: relative; }
.meter .track i { position: absolute; inset: 0 auto 0 0; border-radius: 4px; }
.meter .track .th { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink-2); opacity: .35; }
.meter b { font-variant-numeric: tabular-nums; min-width: 38px; text-align: right; font-weight: 600; }
.c-good { background: #7bc417; }
.c-mid { background: #ffb300; }
.c-low { background: #ff6a5c; }
.delta { font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.delta.up { color: var(--ok-ink); }
.delta.down { color: var(--err-ink); }
.delta.flat { color: var(--muted); }
.spark { display: block; }
.trend-cell { display: flex; align-items: center; gap: 8px; }

/* ---------- рейтинг ---------- */
.tiles-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 860px) { .tiles-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.two { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 980px) { .two { grid-template-columns: 1fr; } }
table.rating { min-width: 860px; }
table.rating td { vertical-align: middle; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #f7fbfd; }
.who { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.ava { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--info-bg); color: var(--info-ink); display: grid; place-items: center;
  font-size: 12px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip-miss { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--chip-bg); color: var(--ink-2); white-space: nowrap; }
.chip-miss b { font-weight: 600; color: var(--err-ink); margin-left: 4px; }
.hbars { display: flex; flex-direction: column; gap: 4px; }
.hbar { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, 1.3fr) 40px; gap: 10px; align-items: center; font-size: 14px;
  border: 0; background: none; padding: 5px 6px; margin: 0 -6px; border-radius: 6px; text-align: left; width: calc(100% + 12px); }
.hbar:hover { background: var(--chip-bg); }
.hbar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .bar-bg { height: 10px; background: var(--chip-bg); border-radius: 5px; overflow: hidden; }
.hbar .bar-bg i { display: block; height: 100%; background: #ff8a7f; border-radius: 5px; }
.hbar .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.weeks { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 8px; }
.weeks .w { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; min-width: 0; }
.weeks .w i { width: 100%; max-width: 38px; border-radius: 6px 6px 2px 2px; }
.weeks .w span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.weeks .w em { font-style: normal; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.scan-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }

/* ---------- сделки ---------- */
.filters-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters-row select.input { width: auto; min-width: 180px; max-width: 280px; }
table.deals { min-width: 820px; }
table.deals td { vertical-align: middle; }
.stage-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: var(--line-strong); }
.miss-list { color: var(--err-ink); font-size: 13px; }
.miss-list .later { color: var(--muted); display: block; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--link); font: inherit; cursor: pointer; text-align: left; }
.linkbtn:hover { text-decoration: underline; }
.active-filter { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; background: var(--info-bg); color: var(--info-ink); border-radius: 14px; padding: 4px 6px 4px 12px; }
.active-filter button { border: 0; background: none; color: inherit; font-size: 15px; line-height: 1; padding: 0 4px; }

/* ---------- требования ---------- */
.funnels { display: flex; gap: 6px; flex-wrap: wrap; }
.funnels button { border: 1px solid var(--line-strong); background: #fff; border-radius: 16px; padding: 5px 12px; font-size: 14px; color: var(--ink-2); }
.funnels button[aria-pressed="true"] { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }
.funnels button .n { font-size: 12px; margin-left: 6px; opacity: .7; }
table.matrix { min-width: 760px; }
table.matrix th, table.matrix td { text-align: center; padding: 8px 6px; vertical-align: middle; }
table.matrix th.f, table.matrix td.f { text-align: left; padding-left: 14px; min-width: 230px; }
table.matrix th.stg { font-weight: 500; font-size: 12px; line-height: 1.25; white-space: normal; min-width: 72px; max-width: 110px; vertical-align: bottom; }
table.matrix th.stg i { display: block; height: 4px; border-radius: 2px; margin: 0 auto 6px; width: 70%; }
table.matrix th.fail { color: var(--err-ink); }
table.matrix td.cell { cursor: pointer; }
table.matrix td.cell:hover { background: var(--info-bg); }
table.matrix td.sep, table.matrix th.sep { border-left: 1px dashed var(--line-strong); }
.dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--line-strong); vertical-align: middle; }
.dot.on { background: var(--accent); border-color: var(--accent); }
.dot.start { box-shadow: 0 0 0 4px rgba(47, 198, 246, .25); }
.dot.fail.on { background: #ff6a5c; border-color: #ff6a5c; }
.wsel { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.wsel button { border: 0; background: #fff; padding: 3px 9px; font-size: 12px; color: var(--ink-2); }
.wsel button + button { border-left: 1px solid var(--line); }
.wsel button[aria-pressed="true"] { background: var(--ink-2); color: #fff; }
.fname { font-weight: 500; line-height: 1.3; }
.fname small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.adder { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.picker .opts { max-height: 360px; }
.save-bar { position: sticky; bottom: 8px; z-index: 5; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px;
  background: #fffbe6; border: 1px solid #ffe08a; border-radius: 12px; box-shadow: 0 4px 16px rgba(20, 24, 30, .1); }
.legend-row { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); align-items: center; }
.legend-row span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- настройки ---------- */
.set-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
@media (max-width: 900px) { .set-grid { grid-template-columns: 1fr; } }
.days { display: flex; gap: 4px; flex-wrap: wrap; }
.days label { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 32px; border: 1px solid var(--line-strong);
  border-radius: 8px; font-size: 13px; cursor: pointer; user-select: none; }
.days input { display: none; }
.days label:has(input:checked) { background: var(--accent); border-color: var(--accent); color: #fff; }
.switch { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.switch input { accent-color: var(--accent); width: 18px; height: 18px; margin: 1px 0 0; flex: none; }
.switch b { font-weight: 600; display: block; }
.switch span { font-size: 13px; color: var(--muted); }
.sample { white-space: pre-wrap; font-size: 13px; background: var(--chip-bg); border-radius: 10px; padding: 12px 14px; color: var(--ink-2); }
.num-inline { display: inline-flex; align-items: center; gap: 8px; }
.num-inline .input { width: 84px; }

/* ---------- вкладка в сделке ---------- */
.app.tab { max-width: 980px; padding-top: 12px; gap: 14px; }
.tab-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.ring { position: relative; width: 104px; height: 104px; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring .v { position: absolute; inset: 0; display: grid; place-items: center; font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ring .v small { font-size: 14px; font-weight: 500; }
.tab-title { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 220px; }
.tab-title h1 { font-size: 22px; }
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.checklist li { display: flex; gap: 10px; align-items: center; padding: 9px 2px; border-top: 1px solid var(--line); font-size: 14px; }
.checklist li:first-child { border-top: 0; }
.checklist .mk { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.checklist .yes .mk { background: var(--ok-bg); color: var(--ok-ink); }
.checklist .no .mk { background: var(--err-bg); color: var(--err-ink); }
.checklist .no .t { font-weight: 500; }
.checklist .w { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.later-list { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.later-list b { font-weight: 600; }
.later-list span { color: var(--ink-2); }
