/* «Аудит CRM и процессов». Живёт внутри Битрикс24: белые панели с тонкой рамкой без теней, один акцент (синий портала)
 * для действий, статусы - точкой и текстом. Отчёт - одна панель-сводка и вкладки, проблемы раскрываются строкой. */
:root {
    --ink: #1f2329; --text: #333a45; --muted: #5f6873; --faint: #8a929b;
    --line: #e3e6ea; --line2: #cfd4d9; --bg: #eef2f5; --panel: #fff; --soft: #f5f7f9; --hover: #f6f8fa;
    --accent: #0075ff; --accent-d: #0063d6; --accent-l: #eaf3ff;
    --ok: #137a4c; --ok-dot: #1bab6a; --bad: #c2343b; --bad-dot: #e0464d; --warn: #8a5a00; --warn-dot: #e09b1a; --gray-dot: #aab2ba;
    --r: 10px; --ease: cubic-bezier(.22, .9, .3, 1);
}
html { scrollbar-gutter: stable; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { color: var(--ink); margin: 0; font-weight: 600; }
h1 { font-size: 18px; line-height: 1.3; }
a { color: var(--accent); text-decoration: none; cursor: pointer; }
a:hover { text-decoration: underline; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pad { padding: 14px 16px; margin: 0; }
.ok-t { color: var(--ok); } .bad-t { color: var(--bad); } .warn-t { color: var(--warn); }

.au { padding: 18px 20px 36px; min-width: 760px; max-width: 1280px; }
.au-head { display: flex; align-items: center; gap: 10px; }
.au-head img { width: 28px; height: 28px; border-radius: 7px; flex: none; }
.au-head .grow { flex: 1; }
.sum { margin: 8px 0 0; color: var(--text); font-size: 13.5px; line-height: 1.7; }
.sum b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.sum .bad-t b { color: var(--bad); }
.sum .sep { margin: 0 9px; color: var(--line2); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; flex: none; vertical-align: 1px; background: var(--gray-dot); }
.dot.g { background: var(--ok-dot); } .dot.y { background: var(--warn-dot); } .dot.r { background: var(--bad-dot); } .dot.n { background: var(--gray-dot); }

.btn { appearance: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; border: 1px solid var(--accent); background: var(--accent); color: #fff;
    font: inherit; font-weight: 500; padding: 0 14px; border-radius: 8px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.btn:hover { background: var(--accent-d); border-color: var(--accent-d); text-decoration: none; }
.btn.ghost { background: #fff; color: var(--text); border-color: var(--line2); }
.btn.ghost:hover { border-color: var(--muted); color: var(--ink); }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 16px; height: 16px; }
.btn:focus-visible, .tab:focus-visible, .ov tbody tr:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); margin-top: 14px; overflow: hidden; }
.h2 { font-size: 15px; margin: 22px 0 0; }

/* сводка по разделам */
.ov { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ov th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--soft); white-space: nowrap; }
.ov td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ov tbody tr:last-child td { border-bottom: 0; }
.ov tbody tr { cursor: pointer; transition: background .12s; }
.ov tbody tr:hover { background: var(--hover); }
.ov tbody tr.on { background: var(--accent-l); }
.ov .sn { white-space: nowrap; color: var(--ink); font-weight: 500; }
.ov .top { color: var(--text); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ov td.num, .ov th.num { width: 82px; }

/* вкладки */
.tabs { display: flex; align-items: flex-end; gap: 2px; margin-top: 16px; border-bottom: 1px solid var(--line2); }
.tab { appearance: none; border: 0; background: none; font: inherit; font-size: 13.5px; color: var(--muted); padding: 8px 11px 9px; cursor: pointer; white-space: nowrap;
    border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.tab i { font-style: normal; color: var(--faint); font-weight: 400; margin-left: 6px; }
.tabs .grow { flex: 1; }
.flt { font-size: 13px; color: var(--muted); padding-bottom: 8px; }
.flt button { appearance: none; border: 0; background: none; color: var(--accent); font: inherit; cursor: pointer; padding: 0 0 0 6px; }
.tabbody { background: var(--panel); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--r) var(--r); padding: 4px 0 8px; }

/* проблемы */
.grp { display: flex; align-items: center; font-size: 13.5px; padding: 14px 16px 6px; }
.grp .muted { font-weight: 400; margin-left: 6px; }
.plist, .glist, .chk { list-style: none; margin: 0; padding: 0; }
.plist li { border-top: 1px solid var(--line); }
.plist li:first-child { border-top: 0; }
.plist summary { list-style: none; display: flex; align-items: baseline; gap: 0; padding: 9px 16px; cursor: pointer; transition: background .12s; }
.plist summary::-webkit-details-marker { display: none; }
.plist summary:hover { background: var(--hover); }
.plist summary .dot { flex: none; }
.plist .pt { flex: 1; color: var(--ink); }
.plist .psec { color: var(--faint); font-size: 12.5px; margin-left: 12px; white-space: nowrap; }
.plist details[open] summary .pt { font-weight: 600; }
.pbody { padding: 0 16px 12px 32px; color: var(--text); font-size: 13.5px; max-width: 900px; }
.pbody .fix { color: var(--ink); }
.ex { font-size: 13px; line-height: 1.7; }
.ex .sep { margin: 0 7px; color: var(--line2); }
.glist li { padding: 6px 16px 6px 32px; position: relative; font-size: 13.5px; }
.glist li::before { content: "✓"; position: absolute; left: 15px; color: var(--ok); }

/* воронки и таблицы */
.fun { padding: 0 0 6px; border-top: 1px solid var(--line); }
.fun:first-child { border-top: 0; }
.fh { padding: 12px 16px 8px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.fh h3 { font-size: 14px; }
.fh .muted { font-size: 13px; }
.tw { overflow-x: auto; }
.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
.grid th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 7px 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--soft); white-space: nowrap; }
.grid td { padding: 7px 12px; border-bottom: 1px solid var(--line); }
.grid th.num { text-align: right; }
.grid.fx { table-layout: fixed; }
.grid.fx td:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid tr.xr td { background: #fcfcfd; }
.grid tr.won td { font-weight: 500; border-bottom: 0; }
.tt { font-size: 13px; padding: 14px 16px 6px; color: var(--ink); }

.kv { padding: 4px 16px 8px; }
.kv > div { display: flex; gap: 12px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.kv > div:last-child { border-bottom: 0; }
.kv > div > span:first-child { width: 250px; flex: none; color: var(--muted); }
.kv b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.kv b.bad-t { color: var(--bad); } .kv b.warn-t { color: var(--warn); }
.chk li { display: flex; gap: 10px; padding: 8px 16px; border-top: 1px solid var(--line); font-size: 13.5px; }
.chk li:first-child { border-top: 0; }
.chk .ck { width: 18px; flex: none; font-weight: 700; }
.chk .ck.ok { color: var(--ok); } .chk .ck.no { color: var(--bad); }
.chk p { margin: 2px 0 0; color: var(--text); }
.chk b { font-weight: 500; color: var(--ink); }

/* старт и ход проверки */
.start { margin-top: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.start .row { display: flex; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13.5px; }
.start .row:first-child { border-top: 0; }
.start .row b { width: 230px; flex: none; color: var(--ink); font-weight: 600; }
.start .go { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-top: 1px solid var(--line); background: var(--soft); }
.prog { margin-top: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.bar { height: 6px; background: var(--soft); border-radius: 3px; overflow: hidden; margin: 10px 0 8px; border: 1px solid var(--line); }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .4s var(--ease); }
.note { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--line2); border-radius: 8px; padding: 9px 12px; background: #fff; font-size: 13px; margin-top: 12px; }
.note svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--muted); }
.note.bad { border-color: #f1c9cb; } .note.bad svg { color: var(--bad); }
.hist { margin-top: 10px; font-size: 13px; color: var(--muted); }
.hist b { color: var(--ink); font-weight: 600; }
.hist .sep { margin: 0 7px; color: var(--line2); }
.notes { margin-top: 16px; font-size: 12.5px; color: var(--muted); }
.notes p { margin: 0 0 4px; }
.rate { margin-top: 14px; font-size: 13px; color: var(--muted); }
.rate button { appearance: none; border: 0; background: none; font: inherit; color: var(--accent); cursor: pointer; padding: 0 0 0 6px; }
.foot { color: var(--faint); font-size: 12px; margin-top: 18px; text-align: center; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
.fade { animation: fadeIn .2s var(--ease); }
@keyframes fadeIn { from { opacity: .35; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* файл отчёта и печать */
.full .panel { break-inside: auto; }
@media print {
    body { background: #fff; }
    .au { padding: 0; min-width: 0; max-width: none; }
    .noprint, .tabs, .btn, .rate { display: none !important; }
    .panel, .tabbody { border-color: #ccc; }
    .plist summary .psec { display: inline; }
    .fun, .plist li { break-inside: avoid; }
    a { color: var(--ink); text-decoration: none; }
}
