/* LeadFinder — светлая минималистичная тема + тёмный вариант. Внешние шрифты и CDN не используются. */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #fbfbfd;
  --border: #e6e8ec;
  --border-strong: #d5d9e0;
  --text: #16181d;
  --text-2: #5b6270;
  --text-3: #8a91a0;
  --accent: #3b5bfd;
  --accent-soft: #eef1ff;
  --accent-text: #ffffff;
  --hot: #e0402b;
  --hot-bg: #fdecea;
  --warm: #d97706;
  --warm-bg: #fdf3e4;
  --medium: #2563eb;
  --medium-bg: #eaf0fe;
  --low: #6b7280;
  --low-bg: #f1f2f5;
  --ok: #15803d;
  --ok-bg: #e8f5ec;
  --danger: #dc2626;
  --shadow-sm: 0 1px 2px rgba(16, 20, 32, .05);
  --shadow: 0 4px 20px rgba(16, 20, 32, .07);
  --shadow-lg: 0 20px 50px rgba(16, 20, 32, .16);
  --radius: 14px;
  --radius-sm: 9px;
  --sidebar-w: 232px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
          "Noto Sans", "Liberation Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

[data-theme="dark"] {
  --bg: #0e1014;
  --surface: #16191f;
  --surface-2: #1b1f26;
  --border: #262b34;
  --border-strong: #333944;
  --text: #eceef2;
  --text-2: #a3aab8;
  --text-3: #757d8c;
  --accent: #6c86ff;
  --accent-soft: #1c2340;
  --accent-text: #0b0d12;
  --hot: #ff7663;
  --hot-bg: #35201d;
  --warm: #f0a23c;
  --warm-bg: #33261440;
  --medium: #6ea0ff;
  --medium-bg: #172440;
  --low: #98a0af;
  --low-bg: #20242c;
  --ok: #4ade80;
  --ok-bg: #14291d;
  --danger: #f87171;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 4px 24px rgba(0, 0, 0, .45);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }
/* Атрибут hidden должен побеждать любые display из правил ниже (.drawer, .view и т.п.). */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0 0 10px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-2);
       padding: 1px 5px; border-radius: 5px; border: 1px solid var(--border); }
.muted { color: var(--text-2); }
.small { font-size: 12.5px; }
.mt { margin-top: 10px; }
.hidden { display: none !important; }

/* --- каркас --- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 18px 12px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 20px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; background: var(--accent);
  color: var(--accent-text); display: grid; place-items: center;
  font-weight: 700; font-size: 13px; letter-spacing: .02em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 15px; }
.brand-text small { color: var(--text-3); font-size: 11.5px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-2); font: inherit; font-size: 14px;
  cursor: pointer; text-align: left; transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 550; }
.nav-ico { width: 18px; text-align: center; opacity: .85; font-size: 13px; }
.nav-count {
  margin-left: auto; font-size: 11.5px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 20px; padding: 0 7px; color: var(--text-2);
}
.sidebar-foot { margin-top: auto; display: flex; gap: 6px; padding-top: 12px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 26px; border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(6px);
  position: sticky; top: 0; z-index: 20;
}
.topbar-title h1 { font-size: 19px; }
.topbar-title p { margin: 1px 0 0; font-size: 12.8px; color: var(--text-3); }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; }
.content { padding: 22px 26px 60px; display: flex; flex-direction: column; gap: 18px; }

.view { display: none; flex-direction: column; gap: 18px; }
.view.is-active { display: flex; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* --- карточки --- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden;
}
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.card-head h2 { font-size: 15px; }
.card-head > .btn, .card-head > .badge { margin-left: auto; }
.card-body { padding: 18px; }
.card-body.no-pad { padding: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.grid-sticky > .card:last-child { position: sticky; top: 92px; }

/* --- статистика --- */
.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 16px 14px; box-shadow: var(--shadow-sm);
}
.stat-label { font-size: 12.5px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 27px; font-weight: 640; letter-spacing: -.02em; margin-top: 6px; }
.stat-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.stat.accent .stat-value { color: var(--accent); }
.stat.hot .stat-value { color: var(--hot); }

.bar-row { display: grid; grid-template-columns: 150px 1fr 52px; gap: 10px; align-items: center; margin-bottom: 9px; }
.bar-row:last-child { margin-bottom: 0; }
.bar-label { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 20px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 20px; transition: width .3s ease; }
.bar-fill.hot { background: var(--hot); }
.bar-fill.warm { background: var(--warm); }
.bar-fill.medium { background: var(--medium); }
.bar-fill.low { background: var(--low); }
.bar-value { font-size: 12.5px; color: var(--text-2); text-align: right; font-variant-numeric: tabular-nums; }

/* --- формы --- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--text-2); }
.field > span { font-weight: 500; }
.field-hint { font-weight: 400; color: var(--text-3); }

/* Итог импорта из файла. */
.import-result {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.import-result .dl { margin: 0; }
.err-text { margin: 0; color: var(--danger); }
input[type="file"] { padding: 9px 11px; background: var(--surface-2); cursor: pointer; }
.req { color: var(--danger); }
input, select, textarea {
  font: inherit; font-size: 14px; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 9px 11px; width: 100%; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
select { cursor: pointer; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%),
                    linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.hint { color: var(--text-3); font-size: 11.8px; }
.fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin: 0; }
.fieldset legend { font-size: 12.5px; color: var(--text-3); padding: 0 6px; }
.check { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; color: var(--text-2); cursor: pointer; padding: 4px 0; }
.check input { width: 16px; height: 16px; margin: 2px 0 0; flex: 0 0 16px; accent-color: var(--accent); }
.check-demo { background: var(--surface-2); border: 1px dashed var(--border-strong);
              border-radius: var(--radius-sm); padding: 10px 12px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* --- кнопки --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; font-weight: 500;
  cursor: pointer; transition: background .15s, border-color .15s, transform .06s, opacity .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--text-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.btn-sm { padding: 6px 11px; font-size: 12.8px; }
.btn-danger { color: var(--danger); }
.icon-btn {
  width: 34px; height: 34px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: transparent; color: var(--text-2); cursor: pointer; font-size: 16px;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.only-mobile { display: none; }

/* --- бейджи --- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px;
  border-radius: 20px; font-size: 12px; font-weight: 550;
  background: var(--low-bg); color: var(--low); border: 1px solid transparent; white-space: nowrap;
}
.badge-hot { background: var(--hot-bg); color: var(--hot); }
.badge-warm { background: var(--warm-bg); color: var(--warm); }
.badge-medium { background: var(--medium-bg); color: var(--medium); }
.badge-low { background: var(--low-bg); color: var(--low); }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-danger { background: var(--hot-bg); color: var(--hot); }
.badge-neutral { background: var(--surface-2); color: var(--text-2); border-color: var(--border); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }

/* --- фильтры --- */
.filters { padding: 14px 16px; }
.filters-collapse > summary { display: none; }
.filters-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.filters-row select, .filters-row .input-search { width: auto; min-width: 150px; flex: 0 1 auto; }
.input-search { flex: 1 1 260px; min-width: 200px; }
.mini-field { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); }
.mini-field input, .mini-field select { width: 78px; padding: 6px 8px; font-size: 13px; }
.chip-check {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; font-size: 12.8px;
  border: 1px solid var(--border-strong); border-radius: 20px; cursor: pointer; color: var(--text-2);
  user-select: none;
}
.chip-check:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip-check input { width: 14px; height: 14px; accent-color: var(--accent); }
.filters-meta { margin-top: 10px; display: flex; gap: 10px; align-items: center;
                font-size: 12.5px; color: var(--text-3); }

/* --- таблица --- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 900px; }
.table th {
  text-align: left; font-weight: 550; font-size: 12px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-3); padding: 11px 14px;
  border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap;
}
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--text); }
.table th.is-sorted { color: var(--accent); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr.is-selected { background: var(--accent-soft); }
.table tbody tr.is-excluded { opacity: .55; }
.col-check { width: 38px; }
.col-actions { width: 90px; }
.cell-name { font-weight: 550; color: var(--text); cursor: pointer; }
.cell-name:hover { color: var(--accent); }
.cell-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; max-width: 320px; }
.cell-contact { font-size: 12.8px; color: var(--text-2); display: flex; flex-direction: column; gap: 2px; }
.copy-btn { border: 0; background: none; color: var(--text-2); cursor: pointer; font: inherit;
            font-size: 12.8px; padding: 0; text-align: left; }
.copy-btn:hover { color: var(--accent); }
.score-cell { display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.score-num { font-weight: 620; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }

.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px;
         border-top: 1px solid var(--border); font-size: 13px; color: var(--text-2); }
.pager-right { display: flex; align-items: center; gap: 10px; }

.bulkbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--accent-soft); border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--accent);
}
.bulkbar select { width: auto; padding: 6px 28px 6px 10px; font-size: 13px; }

/* --- список/строки --- */
.rowlist { display: flex; flex-direction: column; }
.rowitem { display: flex; align-items: center; gap: 14px; padding: 13px 18px;
           border-bottom: 1px solid var(--border); }
.rowitem:last-child { border-bottom: 0; }
.rowitem:hover { background: var(--surface-2); }
.rowitem-main { flex: 1; min-width: 0; }
.rowitem-title { font-weight: 550; font-size: 13.8px; }
.rowitem-sub { font-size: 12.3px; color: var(--text-3); margin-top: 2px; }
.rowitem-metrics { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-2); flex-wrap: wrap; }
.rowitem-actions { display: flex; gap: 6px; }
.metric-num { font-weight: 600; color: var(--text); }

/* --- прогресс --- */
.progress { height: 8px; background: var(--surface-2); border: 1px solid var(--border);
            border-radius: 20px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--accent); border-radius: 20px;
                transition: width .4s ease; }
.progress-msg { margin: 10px 0 14px; font-size: 13.5px; color: var(--text-2); }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.step { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: var(--radius-sm);
        font-size: 13.2px; color: var(--text-3); }
.step-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border-strong);
            display: grid; place-items: center; font-size: 11px; flex: 0 0 20px; }
.step.is-done { color: var(--text-2); }
.step.is-done .step-dot { border-color: var(--ok); background: var(--ok); color: #fff; }
.step.is-active { color: var(--text); background: var(--accent-soft); font-weight: 550; }
.step.is-active .step-dot { border-color: var(--accent); border-top-color: transparent;
                            animation: spin .8s linear infinite; }
.step.is-error .step-dot { border-color: var(--danger); background: var(--danger); color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- пустые состояния --- */
.empty { text-align: center; padding: 34px 16px; color: var(--text-3); }
.empty-ico { font-size: 30px; opacity: .5; margin-bottom: 8px; }
.empty p { margin: 0 0 4px; color: var(--text-2); font-weight: 500; }
.empty small { font-size: 12.5px; }

/* --- скелетоны --- */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 37%, var(--surface-2) 63%);
            background-size: 400% 100%; animation: shimmer 1.3s ease infinite;
            border-radius: 6px; height: 12px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* --- карточка организации (drawer) --- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(10, 12, 18, .45); z-index: 40;
                   animation: fade .15s ease; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: min(560px, 100vw);
  background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg);
  z-index: 50; display: flex; flex-direction: column; animation: slide .2s ease;
}
@keyframes slide { from { transform: translateX(20px); opacity: .4; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px;
               border-bottom: 1px solid var(--border); }
.drawer-head h2 { font-size: 17px; }
.drawer-head p { margin: 3px 0 0; font-size: 12.8px; }
.drawer-body { padding: 18px 20px 40px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.dl { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; font-size: 13.4px; }
.dl dt { color: var(--text-3); }
.dl dd { margin: 0; color: var(--text); word-break: break-word; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
                 color: var(--text-3); font-weight: 600; margin-bottom: 8px; }
.reason { display: flex; gap: 10px; align-items: flex-start; padding: 7px 10px; border-radius: var(--radius-sm);
          background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 6px; font-size: 13px; }
.reason-pts { font-variant-numeric: tabular-nums; font-weight: 600; flex: 0 0 42px; }
.reason.plus .reason-pts { color: var(--ok); }
.reason.minus .reason-pts { color: var(--danger); }
.reason.zero .reason-pts { color: var(--text-3); }
.score-hero { display: flex; align-items: center; gap: 14px; padding: 14px 16px;
              background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); }
.score-hero-num { font-size: 30px; font-weight: 660; letter-spacing: -.02em; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.list-cols { columns: 2; margin: 0 0 10px; padding-left: 18px; font-size: 13.4px; color: var(--text-2); }
.list-cols li { margin-bottom: 3px; }

/* --- уведомления --- */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: flex;
          flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 36px)); }
.toast {
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 11px 14px; font-size: 13.4px;
  animation: toastIn .2s ease;
}
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--danger); }
.toast strong { display: block; margin-bottom: 2px; font-size: 13.2px; }
.toast span { color: var(--text-2); }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* --- таблица аудита --- */
.audit-table { width: 100%; border-collapse: collapse; font-size: 13.4px; }
.audit-table td { padding: 9px 18px; border-bottom: 1px solid var(--border); }
.audit-table tr:last-child td { border-bottom: 0; }
/* Выравнивание чисел — только для таблицы аудита качества данных (метрика/число/доля).
   Таблицы со своим набором колонок помечаются классом plain-table. */
.audit-table:not(.plain-table) td:nth-child(2) { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; width: 90px; }
.audit-table:not(.plain-table) td:nth-child(3) { width: 210px; }
.audit-table th {
  padding: 8px 18px; text-align: left; font-size: 12px; font-weight: 600;
  color: var(--text-3); text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--border);
}
.plain-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; width: 130px; }
.plain-table th:last-child { text-align: right; }
.audit-pct { display: flex; align-items: center; gap: 8px; }

/* --- адаптив --- */
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 980px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-sticky > .card:last-child { position: static; }
}
@media (max-width: 780px) {
  .sidebar {
    position: fixed; z-index: 60; left: 0; top: 0; transform: translateX(-100%);
    transition: transform .22s ease; box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open { transform: none; }
  .only-mobile { display: inline-flex; }
  .topbar { padding: 12px 14px; }
  .topbar-title h1 { font-size: 17px; }
  .topbar-title p { display: none; }
  .topbar-actions .btn { padding: 8px 12px; }
  .content { padding: 14px 14px 70px; gap: 14px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-value { font-size: 23px; }
  .form-row { grid-template-columns: 1fr; }
  .filters-row select, .input-search { width: 100%; min-width: 0; flex: 1 1 100%; }
  /* На телефоне фильтры свёрнуты — таблица должна быть на первом экране. */
  .filters-collapse > summary {
    display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
    margin-top: 10px; padding: 9px 12px; border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 500; color: var(--text-2);
  }
  .filters-collapse > summary::-webkit-details-marker { display: none; }
  .filters-collapse > summary::after { content: '▾'; margin-left: auto; color: var(--text-3); }
  .filters-collapse[open] > summary::after { content: '▴'; }
  .filters-badge {
    background: var(--accent); color: var(--accent-text); border-radius: 20px;
    font-size: 11.5px; padding: 1px 7px; font-weight: 600;
  }
  .card-body { padding: 14px; }
  .drawer { width: 100vw; }
  /* Таблица на телефоне превращается в список карточек — без горизонтальной прокрутки. */
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table { min-width: 0; }
  .table thead { display: none; }
  .table tbody tr {
    position: relative; padding: 12px 44px 12px 14px; border-bottom: 1px solid var(--border);
  }
  .table td { border: 0; padding: 3px 0; }
  .table td:empty { display: none; }
  .col-check { position: absolute; top: 12px; right: 14px; width: auto; padding: 0; }
  .col-actions { width: auto; margin-top: 6px; }
  .row-actions { justify-content: flex-start; }
  .cell-sub { max-width: none; }
  .score-cell { justify-content: flex-start; }
  .pager { flex-direction: column; gap: 10px; align-items: stretch; }
  .pager-right { justify-content: space-between; }
  .dl { grid-template-columns: 1fr; gap: 2px 0; }
  .dl dt { margin-top: 8px; font-size: 12px; }
  .rowitem { flex-direction: column; align-items: flex-start; gap: 8px; }
  .list-cols { columns: 1; }
  .toasts { left: 12px; right: 12px; bottom: 12px; max-width: none; }
  .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* --- аудит 152-ФЗ --- */
.stat-grid-sm { grid-template-columns: repeat(6, 1fr); gap: 10px; }
.stat-grid-sm .stat { padding: 12px 12px 10px; }
.stat-grid-sm .stat-value { font-size: 22px; }

.radio-check input { accent-color: var(--accent); }
.filters-row-audit { border-top: 1px dashed var(--border); padding-top: 8px; }
.filters-group-label { font-size: 12.5px; color: var(--text-3); }
.table-modes { margin-left: auto; display: inline-flex; gap: 4px; }
.table-modes .btn.is-active { background: var(--accent-soft); color: var(--accent); }

.flag { font-size: 12.5px; font-weight: 600; }
.flag-ok { color: #16a34a; }
.flag-bad { color: var(--danger); }
[data-theme="dark"] .flag-ok { color: #4ade80; }

.needs { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.notice {
  font-size: 12.2px; line-height: 1.5; color: var(--text-2); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin: 12px 0;
}
.list { margin: 4px 0 0; padding-left: 18px; font-size: 13px; color: var(--text-2); }
.list li { margin-bottom: 4px; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.tab {
  background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 10px;
  font: inherit; font-size: 13.5px; color: var(--text-3); cursor: pointer;
}
.tab.is-active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tab-count {
  background: var(--danger); color: #fff; border-radius: 20px; padding: 0 6px;
  font-size: 11px; font-weight: 600;
}
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

.finding-group { margin-bottom: 14px; }
.finding {
  border: 1px solid var(--border); border-left: 3px solid var(--danger);
  border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; background: var(--surface);
}
.finding.is-manual { border-left-color: var(--warm); }
.finding-head { display: flex; gap: 8px; align-items: baseline; font-size: 13.4px; }
.finding-weight {
  font-size: 11.5px; font-weight: 700; color: var(--text-3); background: var(--surface-2);
  border-radius: 6px; padding: 1px 6px; flex: none;
}
.finding-norm { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.finding-evidence { font-size: 12.4px; color: var(--text-2); margin-top: 5px; word-break: break-word; }
.finding-evidence a { margin-left: 6px; }
.finding-fix { font-size: 12.6px; color: var(--text-2); margin-top: 6px; }
.rowitem-tight { padding: 8px 0; }

@media (max-width: 1100px) {
  .stat-grid-sm { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 780px) {
  .stat-grid-sm { grid-template-columns: repeat(2, 1fr); }
  .table-modes { margin-left: 0; }
}
