/* Светлая тема (по умолчанию) — в духе Авито: светло-серый фон, белые карточки, голубой акцент */
:root {
  --bg: #f2f1f0; --card: #ffffff; --soft: #f2f1f0; --soft-2: #e8e7e6; --text: #000000; --muted: #6e6e6e; --faint: #a3a3a3;
  --border: #e6e5e4; --accent: #00aaff; --accent-hover: #0099e6; --accent-soft: #e0f4ff; --accent-text: #0088cc; --on-accent: #fff;
  --good: #00a046; --good-fill: #02d15c; --good-soft: #e3f9eb;
  --warn: #c77700; --warn-fill: #ffa200; --warn-soft: #fff3dc;
  --bad: #e6203a; --bad-fill: #ff4053; --bad-soft: #ffe8ea;
  --c-views: #00aaff; --c-contacts: #02d15c; --c-fav: #ff4053; --c-spend: #965eeb; --c-missed: #ff4053;
  --c-promo: #ffa200; --c-other: #c9c8c7;
  --shadow: 0 2px 8px rgba(0,0,0,.04); --shadow-hover: 0 6px 20px rgba(0,0,0,.08);
  --radius: 20px; --radius-sm: 12px; --sidebar: 264px;
  color-scheme: light;
}
/* Тёмная тема: включается переключателем или настройкой системы */
:root[data-theme="dark"] {
  --bg: #0f0f10; --card: #1c1c1e; --soft: #262628; --soft-2: #303033; --text: #f5f5f5; --muted: #a1a1a6; --faint: #6c6c70;
  --border: #2c2c2e; --accent: #33bbff; --accent-hover: #5cc8ff; --accent-soft: #0f3347; --accent-text: #5cc8ff; --on-accent: #001a26;
  --good: #3ddc84; --good-fill: #2fd273; --good-soft: #10301e;
  --warn: #ffbe4d; --warn-fill: #ffa200; --warn-soft: #36290f;
  --bad: #ff6b7a; --bad-fill: #ff4053; --bad-soft: #3a161b;
  --c-views: #33bbff; --c-contacts: #2fd273; --c-fav: #ff6b7a; --c-spend: #b08cf5; --c-missed: #ff6b7a;
  --c-promo: #ffb733; --c-other: #4a4a4e;
  --shadow: none; --shadow-hover: 0 6px 20px rgba(0,0,0,.4);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f0f10; --card: #1c1c1e; --soft: #262628; --soft-2: #303033; --text: #f5f5f5; --muted: #a1a1a6; --faint: #6c6c70;
    --border: #2c2c2e; --accent: #33bbff; --accent-hover: #5cc8ff; --accent-soft: #0f3347; --accent-text: #5cc8ff; --on-accent: #001a26;
    --good: #3ddc84; --good-fill: #2fd273; --good-soft: #10301e;
    --warn: #ffbe4d; --warn-fill: #ffa200; --warn-soft: #36290f;
    --bad: #ff6b7a; --bad-fill: #ff4053; --bad-soft: #3a161b;
    --c-views: #33bbff; --c-contacts: #2fd273; --c-fav: #ff6b7a; --c-spend: #b08cf5; --c-missed: #ff6b7a;
    --c-promo: #ffb733; --c-other: #4a4a4e;
    --shadow: none; --shadow-hover: 0 6px 20px rgba(0,0,0,.4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; transition: background .2s, color .2s;
  /* длинные «слова» без пробелов (например «Сертификация,Декларация,протоколы») переносим, а не выпускаем за рамку */
  overflow-wrap: anywhere; }
/* содержимое строк и карточек может сжиматься, иначе длинный текст распирает блок */
.row > b, .row > .num, .row > .pill { flex: none; white-space: nowrap; }
.row > *, .alert > div, .funnel-step .t, .list-item > div, .acc-card .top > div, .page-head > div, .kpi { min-width: 0; }
.alert .go, .alert .icon, .pill, .dot, .hint { flex: none; }
.kpi .value { overflow: hidden; text-overflow: ellipsis; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { color: var(--accent); }
h1 { font-size: 28px; line-height: 1.2; margin: 0; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 18px; margin: 0 0 14px; font-weight: 800; letter-spacing: -.01em; display: flex; align-items: center; gap: 6px; }
h3 { font-size: 15px; margin: 0 0 8px; font-weight: 700; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }

/* раскладка */
.layout { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--card); padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--border); }
.brand { font-weight: 800; font-size: 17px; padding: 4px 10px 16px; display: flex; align-items: center; gap: 10px; letter-spacing: -.01em; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 20px; height: 20px; }
.nav { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--text);
  cursor: pointer; text-decoration: none; font-weight: 500; transition: background .15s; }
.nav:hover { background: var(--soft); color: var(--text); }
.nav.on { background: var(--soft); font-weight: 700; }
.nav .ico { width: 20px; text-align: center; color: var(--muted); }
.nav.on .ico { color: var(--accent); }
.nav .grow { flex: 1; min-width: 0; }
.nav .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav .sub { font-size: 12px; color: var(--muted); font-weight: 500; }
.nav .sub.bad { color: var(--bad); }
.nav-label { font-size: 12px; color: var(--muted); padding: 16px 12px 6px; font-weight: 700; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--faint); }
.dot.good { background: var(--good-fill); } .dot.warning { background: var(--warn-fill); } .dot.danger { background: var(--bad-fill); }
.count { font-size: 12px; font-weight: 700; background: var(--bad-fill); color: #fff; border-radius: 10px; padding: 0 7px; line-height: 20px; }
.sidebar .bottom { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.add-link { color: var(--accent-text) !important; }
.main { padding: 28px 32px 64px; min-width: 0; max-width: 1440px; }
.mobile-bar { display: none; }

/* переключатель темы */
.theme-switch { display: flex; background: var(--soft); border-radius: var(--radius-sm); padding: 3px; margin: 6px 0 4px; }
.theme-switch button { flex: 1; border: 0; background: none; padding: 6px 4px; border-radius: 9px; font-size: 13px; color: var(--muted);
  justify-content: center; font-weight: 600; }
.theme-switch button:hover { color: var(--text); background: none; }
.theme-switch button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.theme-float { position: fixed; top: 16px; right: 16px; z-index: 20; width: 220px; }

/* шапка страницы */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.page-head .sub-line { margin-top: 6px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
/* панель периода и кнопок — всегда на виду при прокрутке страницы аккаунта */
.sticky-bar { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  justify-content: flex-end; margin: -6px -32px 14px; padding: 10px 32px; background: var(--bg);
  transition: box-shadow .15s, background .15s; }
.sticky-bar .sticky-name { display: none; font-weight: 800; font-size: 16px; margin-right: auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40%; }
.sticky-bar.stuck { box-shadow: 0 6px 16px rgba(0,0,0,.08); background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.sticky-bar.stuck .sticky-name { display: block; }
.tabs { display: flex; gap: 6px; margin-bottom: 20px; overflow-x: auto; padding-bottom: 2px; }
.tab { padding: 9px 16px; color: var(--text); border-radius: 100px; white-space: nowrap; cursor: pointer; text-decoration: none;
  font-weight: 600; background: var(--card); transition: background .15s, color .15s; }
.tab:hover { background: var(--soft-2); color: var(--text); }
.tab.on { background: var(--text); color: var(--card); }

/* кнопки и поля */
button, .btn { font: inherit; font-weight: 600; border: 0; background: var(--soft); color: var(--text);
  border-radius: var(--radius-sm); padding: 10px 16px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none; transition: background .15s, transform .1s; line-height: 1.2; }
button:hover, .btn:hover { background: var(--soft-2); color: var(--text); }
button:active, .btn:active { transform: scale(.98); }
.card button:not(.primary):not(.danger), .card .btn:not(.primary), .modal button:not(.primary):not(.danger) { background: var(--soft); }
button.primary, .btn.primary { background: var(--accent); color: var(--on-accent); }
button.primary:hover, .btn.primary:hover { background: var(--accent-hover); color: var(--on-accent); }
button.danger { color: var(--bad); }
button.danger:hover { background: var(--bad-soft); }
button:disabled { opacity: .55; cursor: wait; }
.toolbar > button, .toolbar > .btn { background: var(--card); }
.toolbar > button:hover, .toolbar > .btn:hover { background: var(--soft-2); }
.toolbar > .btn.primary { background: var(--accent); }
.seg { display: inline-flex; background: var(--card); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.card .seg { background: var(--soft); }
.seg button { border-radius: 9px; padding: 7px 12px; background: none; color: var(--muted); }
.seg button:hover { background: none; color: var(--text); }
.seg button.on, .card .seg button.on { background: var(--accent); color: var(--on-accent); }
.card .seg button:not(.on) { background: none; }
input, select, textarea { font: inherit; color: var(--text); background: var(--soft); border: 2px solid transparent;
  border-radius: var(--radius-sm); padding: 10px 12px; width: 100%; transition: border-color .15s, background .15s; }
input:hover, select:hover, textarea:hover { background: var(--soft-2); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); background: var(--card); }
input:disabled { opacity: .6; }
textarea { min-height: 70px; resize: vertical; }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 5px; font-weight: 600; }
.check { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 15px; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; }
.error { color: var(--bad); font-size: 14px; margin-top: 8px; font-weight: 600; }

/* карточки */
.card { background: var(--card); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 14px; }
/* колонки сами переходят в новый ряд, когда места мало */
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--card); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); color: var(--text);
  display: block; position: relative; text-decoration: none; transition: transform .15s, box-shadow .15s; }
a.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); color: var(--text); }
a.kpi::after { content: "›"; position: absolute; right: 16px; top: 12px; font-size: 22px; color: var(--faint); transition: color .15s, transform .15s; }
a.kpi:hover::after { color: var(--accent); transform: translateX(2px); }
.kpi .label { color: var(--muted); font-size: 13px; font-weight: 600; display: flex; gap: 5px; align-items: center; padding-right: 14px; }
.kpi .value { font-size: 26px; font-weight: 800; margin: 4px 0 2px; font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: -.02em; }
.kpi .delta { font-size: 13px; color: var(--muted); font-weight: 500; }
.up { color: var(--good) !important; } .down { color: var(--bad) !important; }
.mt { margin-top: 14px; }
.chart-box { position: relative; height: 290px; }
.chart-box.short { height: 200px; }
.hint { cursor: pointer; color: var(--muted); font-size: 11px; background: var(--soft); border-radius: 50%; width: 20px; height: 20px;
  display: inline-grid; place-items: center; font-weight: 800; flex: none; padding: 0; border: 0; vertical-align: middle; }
.hint:hover, .card .hint:hover { background: var(--accent); color: var(--on-accent); }
.popover { position: absolute; z-index: 70; max-width: 300px; background: var(--text); color: var(--card); font-size: 13px; line-height: 1.45;
  font-weight: 500; padding: 10px 12px; border-radius: var(--radius-sm); box-shadow: var(--shadow-hover); animation: fade .12s; }
.link-btn { background: none !important; color: var(--accent-text); padding: 4px 0; font-size: 14px; }
.link-btn:hover { color: var(--accent); }
.bar-row.part { width: 100%; background: none !important; padding: 4px 6px; margin: 1px -6px; border-radius: 8px; color: var(--text);
  text-align: left; font-size: 13px; font-weight: 500; }
.bar-row.part:hover, .bar-row.part.open { background: var(--soft) !important; }
.part-detail { font-size: 13px; background: var(--soft); border-radius: 10px; padding: 8px 10px; margin: 2px 0 6px; }
.explain { padding: 12px 0; border-bottom: 1px solid var(--border); display: grid; gap: 3px; }
.explain:last-of-type { border-bottom: 0; }

/* индекс здоровья */
.health { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.health > div:last-child { flex: 1 1 240px; }
.health-score { width: 110px; height: 110px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-size: 36px; font-weight: 800; position: relative; }
.health-score::before { content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(var(--ring) calc(var(--p) * 1%), var(--soft) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 10px), #000 calc(100% - 9px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 10px), #000 calc(100% - 9px)); }
.health-score.good { --ring: var(--good-fill); color: var(--good); }
.health-score.warning { --ring: var(--warn-fill); color: var(--warn); }
.health-score.danger { --ring: var(--bad-fill); color: var(--bad); }
.bar-row { display: grid; grid-template-columns: minmax(0, 160px) minmax(40px, 1fr) 42px; gap: 10px; align-items: center; font-size: 13px; margin: 5px 0; font-weight: 500; }
.bar { height: 8px; background: var(--soft); border-radius: 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 4px; }

/* воронка */
.funnel-step { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.funnel-step:last-of-type { border-bottom: 0; }
.funnel-step .t { flex: 1; font-weight: 600; }
.pill { font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 100px; white-space: nowrap; display: inline-block; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warning { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--bad-soft); color: var(--bad); }
.pill.neutral { background: var(--soft); color: var(--muted); }
.advice { background: var(--warn-soft); border-radius: var(--radius-sm); padding: 12px 14px; margin-top: 12px; font-size: 14px; }
.advice.ok { background: var(--good-soft); }

/* плашки о проблемах со сбором данных */
.plaque { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm); margin-bottom: 12px; font-size: 14px; }
.plaque.warning { background: var(--warn-soft); } .plaque.danger { background: var(--bad-soft); }
.plaque .icon { width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-weight: 800; color: #fff; font-size: 13px; }
.plaque.warning .icon { background: var(--warn-fill); } .plaque.danger .icon { background: var(--bad-fill); }
.plaque > div { min-width: 0; }
.plaque-title { font-weight: 800; margin-bottom: 2px; }
.plaque-action { margin-top: 6px; color: var(--muted); }
.plaque-action b { color: var(--text); }

/* тревоги */
.alert { display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 8px; font-size: 14px;
  color: var(--text); text-decoration: none; transition: transform .15s, filter .15s; }
.alert.danger { background: var(--bad-soft); } .alert.warning { background: var(--warn-soft); }
.alert.resolved { background: var(--soft); color: var(--muted); }
.alert .go { margin-left: auto; color: var(--faint); font-size: 22px; align-self: flex-start; padding: 0 4px;
  text-decoration: none; border-radius: 8px; transition: color .15s, background .15s; }
.alert .go:hover { color: var(--accent); background: var(--card); }
/* развёрнутая рекомендация */
details.more { margin-top: 8px; }
details.more summary { cursor: pointer; color: var(--accent-text); font-weight: 700; font-size: 13px; list-style: none;
  display: inline-flex; align-items: center; gap: 4px; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: "▾"; transition: transform .15s; }
details.more[open] summary::after { transform: rotate(180deg); }
details.more summary:hover { color: var(--accent); }
.more-body { background: var(--card); border-radius: 10px; padding: 10px 12px; margin-top: 8px; font-size: 13px; color: var(--text); }
.more-body p { margin: 2px 0 8px; }
.more-body ol { margin: 4px 0 8px; padding-left: 20px; }
.more-body li { margin-bottom: 4px; }
.more-h { font-weight: 800; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.alert .icon { width: 22px; height: 22px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; }
.alert.danger .icon { background: var(--bad-fill); } .alert.warning .icon { background: var(--warn-fill); }
.alert.resolved .icon { background: var(--good-fill); }
.alert .msg { font-weight: 700; }
.alert .adv { color: var(--muted); margin-top: 2px; }

/* таблицы */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; vertical-align: middle; }
th:first-child, td:first-child { text-align: left; white-space: normal; min-width: 190px; }
th { color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; user-select: none; }
th:hover { color: var(--text); }
th.sorted { color: var(--text); } th.sorted::after { content: " ↓"; color: var(--accent); } th.sorted.asc::after { content: " ↑"; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; transition: background .12s; }
tbody tr.click:hover { background: var(--soft); }
tbody tr.click:hover td:first-child { color: var(--accent-text); }
td.left, th.left { text-align: left; }

/* плитки аккаунтов */
.view-switch { margin-left: auto; }
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.acc-card { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); color: var(--text);
  text-decoration: none; display: flex; flex-direction: column; gap: 14px; transition: transform .15s, box-shadow .15s; }
.acc-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); color: var(--text); }
.acc-card .top { display: flex; gap: 12px; align-items: center; }
.acc-card .title { font-weight: 800; font-size: 17px; line-height: 1.25; }
.acc-card .owner { font-size: 12px; color: var(--muted); font-weight: 600; }
.mini-ring { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 800; font-size: 16px;
  position: relative; }
.mini-ring::before { content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(var(--ring) calc(var(--p) * 1%), var(--soft) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px)); }
.mini-ring.good { --ring: var(--good-fill); color: var(--good); } .mini-ring.warning { --ring: var(--warn-fill); color: var(--warn); }
.mini-ring.danger { --ring: var(--bad-fill); color: var(--bad); } .mini-ring.none { --ring: var(--soft); color: var(--muted); }
.acc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.acc-stats > div { background: var(--soft); border-radius: var(--radius-sm); padding: 8px 11px; min-width: 0; }
.acc-stats .l { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-stats .v { font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.acc-card .foot { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* управление графиком: показатели и вид */
.chart-ctl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.chip { padding: 5px 10px; border-radius: 100px; font-size: 13px; font-weight: 600; gap: 6px; background: var(--soft) !important; }
.chip i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.chip.off { opacity: .45; text-decoration: line-through; }
.chip:hover { background: var(--soft-2) !important; }
.seg-sm button { padding: 5px 10px; font-size: 13px; }

/* карта активности по часам */
.heat-wrap { overflow-x: auto; }
.heat { display: grid; grid-template-columns: 34px repeat(24, minmax(26px, 1fr)); gap: 3px; min-width: 720px; }
.heat-h { font-size: 11px; color: var(--muted); text-align: center; font-weight: 600; }
.heat-d { font-size: 12px; color: var(--muted); font-weight: 700; display: flex; align-items: center; }
.heat-c { height: 30px; border-radius: 6px; font-size: 11px; font-weight: 700; color: #fff; display: grid; place-items: center;
  cursor: default; transition: transform .1s; }
.heat-c:hover { transform: scale(1.15); outline: 2px solid var(--text); position: relative; z-index: 1; }
.heat-legend { display: flex; align-items: center; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.heat-legend i { width: 18px; height: 12px; border-radius: 3px; display: inline-block; }

/* списки */
.list-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
a.list-item { display: block; color: var(--text); text-decoration: none; border-radius: 10px; margin: 0 -8px; padding: 10px 8px; }
a.list-item.row { display: flex; }
a.list-item:hover { background: var(--soft); color: var(--text); }
.row { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.stars { color: #ffb800; letter-spacing: 1px; }
.empty { text-align: center; padding: 56px 16px; }
.empty h2 { justify-content: center; font-size: 22px; }
.empty p { color: var(--muted); }
.badge { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 100px; background: var(--warn-soft); color: var(--warn); margin-left: 6px; vertical-align: middle; }
.loading { color: var(--muted); padding: 48px; text-align: center; }

/* окно поверх страницы */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: grid; place-items: center; z-index: 50; padding: 16px;
  animation: fade .15s; }
.modal { background: var(--card); border-radius: 24px; padding: 26px; width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto;
  animation: pop .18s; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--card);
  padding: 12px 18px; border-radius: var(--radius-sm); z-index: 60; font-size: 14px; font-weight: 600; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; left: 0; top: 0; width: 290px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); }
  .mobile-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--card);
    border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
  .mobile-bar .brand { padding: 0; }
  .main { padding: 18px 16px 64px; }
  .sticky-bar { top: 59px; margin: -6px -16px 12px; padding: 8px 16px; justify-content: flex-start; gap: 6px; }
  .sticky-bar .sticky-name { max-width: 100%; flex-basis: 100%; font-size: 14px; }
  /* на телефоне у кнопок — только значки, чтобы панель занимала одну строку */
  .sticky-bar .toolbar { flex-wrap: nowrap; gap: 6px; width: 100%; }
  .sticky-bar .bt { display: none; }
  .sticky-bar .toolbar > button, .sticky-bar .toolbar > .btn { padding: 8px 11px; }
  .sticky-bar .seg { flex: 1; min-width: 0; }
  .sticky-bar .seg button { flex: 1; padding: 7px 4px; font-size: 13px; }
  h1 { font-size: 24px; }
  .bar-row { grid-template-columns: 120px 1fr 38px; }
  .health { gap: 14px; }
  .health-score { width: 88px; height: 88px; font-size: 28px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi .value { font-size: 21px; }
  .card { padding: 18px; }
  .theme-float { position: static; width: 260px; max-width: 100%; margin: 12px 12px 0 auto; }
}
