:root {
  --bg: #09090b;
  --sidebar: #0c0c0f;
  --panel: #111114;
  --panel-2: #17171c;
  --hover: #1b1b21;
  --border: #25252c;
  --border-2: #32323b;
  --text: #ececf1;
  --text-2: #c4c4cf;
  --muted: #86868f;
  --accent: #7c83ff;
  --accent-bg: #1b1c33;
  --green: #22c55e;
  --red: #f05252;
  --amber: #f5a524;
  --cyan: #06b6d4;
  --pink: #d946ef;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(0,0,0,.45);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f5f5f8;
  --sidebar: #ffffff;
  --panel: #ffffff;
  --panel-2: #f3f3f7;
  --hover: #efeff5;
  --border: #e3e3ea;
  --border-2: #d3d3dc;
  --text: #16161d;
  --text-2: #3a3a46;
  --muted: #6e6e7a;
  --accent: #5b5ff0;
  --accent-bg: #ececff;
  --shadow: 0 12px 40px rgba(20,20,40,.12);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, -apple-system, system-ui, sans-serif; font-size: 14px; }
a { color: var(--accent); text-decoration: none; }
button { font: inherit; color: inherit; }
code { background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; font-size: 12.5px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.error { color: var(--red); min-height: 18px; font-size: 13px; }
.green { color: var(--green); } .red { color: var(--red); } .amber { color: var(--amber); } .accent { color: var(--accent); } .cyan { color: var(--cyan); } .pink { color: var(--pink); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.nowrap { white-space: nowrap; }

/* ---------- Кнопки и поля ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); border-radius: 10px; padding: 8px 14px; cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn svg { width: 16px; height: 16px; }
.btn:hover { border-color: var(--border-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.warning { background: var(--amber); border-color: var(--amber); color: #1b1300; }
.btn.danger { color: var(--red); }
.btn.ghost { background: none; border-color: transparent; color: var(--muted); padding: 6px 8px; }
.btn.ghost:hover { color: var(--text); background: var(--hover); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: default; }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 8px; display: inline-grid; place-items: center; }
.icon-btn:hover { color: var(--text); background: var(--hover); }
.icon-btn.danger:hover { color: var(--red); }
.icon-btn svg { width: 16px; height: 16px; }
input, select, textarea { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 9px 12px; font: inherit; outline: none; width: 100%; }
textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.search input { padding-left: 34px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { color: var(--text-2); font-size: 13px; font-weight: 500; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.counter { text-align: right; color: var(--muted); font-size: 11.5px; }

.switch { position: relative; width: 40px; height: 22px; flex: none; cursor: pointer; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--border-2); border-radius: 22px; transition: .15s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .15s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(18px); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; }
.toggle-row .t { font-weight: 500; }

.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.radio-card { border: 1px solid var(--border); background: var(--panel-2); border-radius: 12px; padding: 12px 14px; cursor: pointer; }
.radio-card.on { border-color: var(--accent); background: var(--accent-bg); }
.radio-card .t { font-weight: 600; } .radio-card .d { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* ---------- Вход ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-box { width: 100%; max-width: 360px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.login-box label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 13px; }

/* ---------- Каркас ---------- */
.layout { display: grid; grid-template-columns: 272px 1fr; min-height: 100vh; }
.layout.collapsed { grid-template-columns: 72px 1fr; }
.sidebar { background: var(--sidebar); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 30; }
.brand { padding: 18px 22px 16px; border-bottom: 1px solid var(--border); }
.brand-title { font-weight: 700; letter-spacing: .6px; font-size: 17px; }
.brand-sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
#brand-switch select { padding: 7px 10px; font-weight: 600; }
.brand-now { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13.5px; color: var(--accent); }
.brand-now svg { width: 15px; height: 15px; }
.collapsed #brand-switch { display: none; }
.nav { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 13px; padding: 10px 12px; border-radius: 10px; color: var(--text-2); cursor: pointer; background: none; border: 0; font-size: 15px; text-align: left; width: 100%; }
.nav-item svg { width: 20px; height: 20px; flex: none; }
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.active { background: var(--accent-bg); color: var(--accent); }
.nav-badge { margin-left: auto; min-width: 22px; height: 22px; border-radius: 11px; background: var(--amber); color: #1b1300; font-size: 12px; font-weight: 700; display: grid; place-items: center; padding: 0 6px; }
.sidebar-foot { border-top: 1px solid var(--border); padding: 12px; }
.me { display: flex; align-items: center; gap: 10px; padding: 6px 10px 12px; }
.me .n { font-weight: 600; } .me .e { color: var(--muted); font-size: 12px; }
.collapsed .nav-item span, .collapsed .brand-sub, .collapsed .me > div, .collapsed .nav-badge { display: none; }
.collapsed .brand-title { font-size: 12px; }
.collapsed .nav-item { justify-content: center; }
.main { padding: 28px 32px 60px; min-width: 0; }
.burger { display: none; }

/* ---------- Заголовки и секции ---------- */
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 26px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.page-head h1 svg { width: 24px; height: 24px; color: var(--accent); }
.page-head .sub { color: var(--muted); margin-top: 5px; font-size: 14.5px; }
.section-title { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; margin: 28px 0 14px; }
.section-title svg { width: 18px; height: 18px; color: var(--accent); }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; min-width: 0; }
.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.panel-head h3 { margin: 0; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.panel-head h3 svg { width: 17px; height: 17px; color: var(--accent); }
.empty { text-align: center; padding: 42px 20px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; color: var(--text-2); margin-bottom: 10px; }
.empty .t { color: var(--text); font-weight: 600; margin-bottom: 6px; font-size: 15px; }

/* ---------- Вкладки и чипы ---------- */
.tabs { display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 4px; overflow-x: auto; margin-bottom: 18px; width: fit-content; max-width: 100%; }
.tab { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 9px; border: 0; background: none; color: var(--muted); cursor: pointer; white-space: nowrap; font-weight: 500; }
.tab svg { width: 16px; height: 16px; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--accent-bg); color: var(--accent); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: var(--panel); color: var(--muted); border-radius: 9px; padding: 6px 12px; cursor: pointer; font-size: 13px; white-space: nowrap; }
.chip:hover { color: var(--text); }
.chip.active { background: var(--accent-bg); color: var(--accent); border-color: transparent; }

/* ---------- Карточки ---------- */
.grid { display: grid; gap: 16px; }
.grid.cols-6 { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.card { --c: 124,131,255; position: relative; background: linear-gradient(180deg, rgba(var(--c),.10), rgba(var(--c),.025)); border: 1px solid rgba(var(--c),.24); border-radius: var(--radius); padding: 18px 18px; min-width: 0; }
.card[class] { color: var(--text); }
.card.plain { background: var(--panel); border-color: var(--border); }
.card.blue { --c: 59,130,246; } .card.green { --c: 34,197,94; } .card.violet { --c: 139,92,246; }
.card.amber { --c: 245,165,36; } .card.pink { --c: 217,70,239; } .card.cyan { --c: 6,182,212; } .card.red { --c: 240,82,82; } .card.orange { --c: 249,115,22; }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card-title { color: var(--text-2); font-size: 14px; line-height: 1.35; }
.card-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: rgba(var(--c),.16); color: rgb(var(--c)); flex: none; }
.card-icon svg { width: 20px; height: 20px; }
.card-value { font-size: 28px; font-weight: 700; margin: 14px 0 8px; letter-spacing: .3px; font-variant-numeric: tabular-nums; }
.card-value small { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.card-value.c { color: rgb(var(--c)); }
.card-sub { color: var(--muted); font-size: 13px; line-height: 1.6; }
.mini { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; min-width: 0; }
.mini .l { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.mini .l svg { width: 14px; height: 14px; }
.mini .v { font-size: 22px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.mini .s { color: var(--muted); font-size: 12px; margin-top: 4px; line-height: 1.5; }
.chg { font-weight: 600; white-space: nowrap; }
.chg.up { color: var(--green); } .chg.down { color: var(--red); }
.badge-up { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 7px; background: rgba(34,197,94,.14); color: var(--green); }
.badge-down { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 7px; background: rgba(240,82,82,.14); color: var(--red); }
.bar { height: 7px; border-radius: 6px; background: var(--border); overflow: hidden; display: flex; margin: 4px 0 10px; }
.bar > span { display: block; height: 100%; }
.windows { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 10px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.windows b { color: var(--text); font-weight: 500; }
.info { color: var(--muted); cursor: help; display: inline-flex; vertical-align: middle; position: relative; }
.info svg { width: 14px; height: 14px; }
.info .tip { display: none; position: absolute; z-index: 40; left: 50%; top: 22px; transform: translateX(-50%); width: 290px; background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 10px; padding: 10px 12px; color: var(--text); font-size: 12.5px; line-height: 1.5; font-weight: 400; box-shadow: var(--shadow); }
.info:hover .tip { display: block; }

.banner { display: flex; align-items: center; gap: 14px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; font-size: 17px; flex-wrap: wrap; }
.banner > svg { color: var(--accent); }
.banner .big { color: var(--accent); font-size: 27px; font-weight: 700; }

.tile { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 16px; text-align: center; }
.tile svg { width: 20px; height: 20px; color: var(--muted); }
.tile .v { font-size: 22px; font-weight: 700; margin: 6px 0 2px; }
.tile .l { color: var(--muted); font-size: 12.5px; }

/* ---------- Таблицы ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.toolbar .search { flex: 1; min-width: 220px; max-width: 360px; }
.toolbar select { width: auto; min-width: 180px; }
.table-wrap { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; background: var(--panel); }
tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td { background: var(--hover); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.u-cell { display: flex; align-items: center; gap: 10px; }
.u-cell .n { font-weight: 500; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.u-cell .h { color: var(--muted); font-size: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-2); flex: none; }
.dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(34,197,94,.18); }
.tg { width: 18px; height: 18px; border-radius: 50%; background: #2aabee; display: grid; place-items: center; flex: none; }
.tg svg { width: 11px; height: 11px; color: #fff; }
.idlink { color: var(--accent); font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 2px 9px; border-radius: 20px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.pill.green { background: rgba(34,197,94,.12); color: var(--green); border-color: rgba(34,197,94,.25); }
.pill.amber { background: rgba(245,165,36,.12); color: var(--amber); border-color: rgba(245,165,36,.25); }
.pill.red { background: rgba(240,82,82,.12); color: var(--red); border-color: rgba(240,82,82,.25); }
.pill.blue { background: var(--accent-bg); color: var(--accent); border-color: transparent; }
.pill.cyan { background: rgba(6,182,212,.12); color: var(--cyan); border-color: rgba(6,182,212,.25); }
.pager { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-top: 12px; color: var(--muted); flex-wrap: wrap; }
.pager select { width: auto; padding: 5px 8px; }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item .main-col { flex: 1; min-width: 0; }
.list-item .t { font-weight: 500; display: flex; gap: 8px; align-items: center; }
.list-item .s { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.list-item .amt { font-weight: 600; white-space: nowrap; }

.chart-box { position: relative; height: 260px; }
.chart-box.sm { height: 180px; }

/* ---------- Модальное окно и боковая панель ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 50; }
.modal { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; z-index: 60; }
.modal-box { position: relative; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow); }
.modal-box.wide { max-width: 860px; }
.modal-box h2 { margin: 0 0 18px; font-size: 19px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.close-x { position: absolute; top: 12px; right: 14px; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--panel); border-left: 1px solid var(--border); z-index: 60; overflow-y: auto; padding: 22px 24px 40px; box-shadow: var(--shadow); }
.drawer h2 { margin: 0; font-size: 17px; }
.d-section { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 16px; }
.d-section h4 { margin: 0 0 12px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 9px 14px; font-size: 13.5px; }
.kv > div:nth-child(odd) { color: var(--muted); }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--accent-bg); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 18px; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.dev { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; font-size: 13px; }
.dev .t { font-weight: 600; margin-bottom: 4px; }
.timeline { border-left: 2px solid var(--border); padding-left: 16px; display: flex; flex-direction: column; gap: 12px; }
.timeline .ev { position: relative; }
.timeline .ev::before { content: ""; position: absolute; left: -21px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.timeline .ev .t { font-weight: 500; } .timeline .ev .s { color: var(--muted); font-size: 12.5px; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--panel-2); border: 1px solid var(--border-2); color: var(--text); padding: 11px 18px; border-radius: 12px; z-index: 80; box-shadow: var(--shadow); font-weight: 500; }
.toast.err { border-color: rgba(240,82,82,.5); color: var(--red); }

/* ---------- Аккордеон ---------- */
.acc { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; }
.acc-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 15px 18px; background: none; border: 0; cursor: pointer; font-weight: 600; font-size: 14.5px; text-align: left; }
.acc-head svg { width: 18px; height: 18px; color: var(--accent); }
.acc-head .chev { margin-left: auto; color: var(--muted); transition: .15s; }
.acc.open .acc-head .chev { transform: rotate(180deg); }
.acc-body { display: none; padding: 4px 18px 18px; }
.acc.open .acc-body { display: block; }
.sub-h { font-size: 11.5px; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 18px 0 10px; }
.screen-card { display: flex; gap: 14px; align-items: center; background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.screen-card .img { width: 92px; height: 60px; border-radius: 8px; background: var(--bg); border: 1px dashed var(--border-2); display: grid; place-items: center; color: var(--muted); font-size: 11px; overflow: hidden; flex: none; }
.screen-card .img img { width: 100%; height: 100%; object-fit: cover; }
.save-bar { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 18px 0 6px; display: flex; justify-content: flex-end; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 10px; padding: 7px 11px; cursor: pointer; background: var(--panel-2); font-size: 13px; }
.swatch i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.swatch.on { border-color: var(--accent); }

/* ---------- Прочее ---------- */
.explain { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.step { display: flex; gap: 12px; color: var(--text-2); font-size: 13.5px; line-height: 1.55; }
.step .n { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-bg); color: var(--accent); display: grid; place-items: center; font-weight: 700; flex: none; font-size: 13px; }
.funnel-step { display: grid; grid-template-columns: 32px 1fr auto; gap: 14px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--border); }
.funnel-step:last-child { border-bottom: 0; }
.funnel-step .n { width: 28px; height: 28px; border-radius: 8px; background: var(--accent-bg); color: var(--accent); display: grid; place-items: center; font-weight: 700; }
.funnel-step .v { text-align: right; font-weight: 700; font-size: 18px; }
.alert-card { background: var(--panel); border: 1px solid rgba(245,165,36,.35); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; }
.map-box { height: 520px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: #111; }
.leaflet-container { background: #0b0b0e !important; font-family: inherit; }
.cluster { border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 12px; border: 2px solid rgba(255,255,255,.55); }
.cluster.on { background: rgba(34,197,94,.85); } .cluster.off { background: rgba(124,131,255,.85); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); align-items: center; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.flag { font-size: 18px; }

@media (max-width: 900px) {
  .layout, .layout.collapsed { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 272px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .layout.menu-open .sidebar { transform: none; }
  .burger { display: inline-grid; margin-right: 4px; }
  .main { padding: 18px 16px 40px; }
  .page-head h1 { font-size: 22px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv > div:nth-child(even) { margin-bottom: 8px; }
  .toolbar .search { max-width: none; }
  .toolbar select { flex: 1; min-width: 0; }
  .grid.cols-2 { grid-template-columns: 1fr; }
  .funnel-step { grid-template-columns: 28px 1fr; }
  .funnel-step .v { grid-column: 2; text-align: left; }
}
