/* =========================================================
   RustWarden — панель управления в браузере.
   Рабочий стол оператора: боковое меню, верхняя строка состояния, сетка панелей.
   Шрифты как у сайта: Archivo (заголовки), IBM Plex Sans (текст), IBM Plex Mono (цифры).
   ========================================================= */
:root {
  color-scheme: dark;
  --bg: #111214;
  --bg2: #16171a;
  --card: #1b1c20;
  --card2: #24252a;
  --line: #2a2c32;
  --line2: #393b43;
  --text: #ecebe6;
  --muted: #a6a29a;
  --dim: #6f6c66;
  --sig: #e0224a;
  --sig-hi: #ff4f73;
  --sig-rgb: 224, 34, 74;
  --sig-ink: #fff;
  --ok: #6fd99a;
  --ok-rgb: 111, 217, 154;
  --threat: #ff4f73;
  --threat-rgb: 255, 79, 115;
  --warn: #e9b23a;
  --warn-rgb: 233, 178, 58;
  --info: #8fb8ff;
  --violet: #c58cff;
  --amber: var(--sig); --red: var(--threat); --green: var(--ok); --blue: var(--info);
  --r: 14px;
  --display: 'Archivo', 'Arial Black', system-ui, sans-serif;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --side: 252px;
  --dock-h: 0px;
  --safe-b: 0px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14.5px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--sig-hi); }
h1, h2, h3 { font-family: var(--display); font-stretch: 112%; font-weight: 800; margin: 0; letter-spacing: -.01em; line-height: 1.15; text-transform: none; text-wrap: balance; }
h1 { font-size: 26px; }
h2 { font-size: 19px; }
h3 { font-size: 15px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- приведение общих элементов к стилю панели ---------- */
.btn { font: 600 14px var(--sans); text-transform: none; letter-spacing: 0; min-height: 38px; padding: 8px 14px; border-radius: 10px; background: var(--card2); }
.btn:hover:not(:disabled) { border-color: #4b4d56; background: #2a2b31; }
.btn.primary { background: var(--sig); box-shadow: 0 6px 18px rgba(var(--sig-rgb), .25); }
.btn.primary:hover:not(:disabled) { background: #ea2c55; }
.btn.sm { min-height: 32px; padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn.ghost { background: transparent; }
.chip { font: 500 13px var(--sans); text-transform: none; letter-spacing: 0; border-radius: 8px; padding: 6px 12px; background: var(--card); }
.chip:hover { color: var(--text); }
.card { background: var(--card); border-radius: var(--r); padding: 16px; margin-bottom: 0; box-shadow: none; }
.list { background: var(--card); border-radius: var(--r); margin-bottom: 0; }
.item { min-height: 48px; padding: 10px 14px; }
.item.tap:hover { background: var(--card2); }
.kv b, .stat-grid b, .res-grid b, .price { font-family: var(--display); font-stretch: 112%; text-transform: none; }
.kv b { font-size: 22px; }
.section-title { margin: 22px 0 10px; }
.section-title h2 { font: 600 11.5px var(--mono); letter-spacing: .14em; }
.cap { font: 600 11px var(--mono); letter-spacing: .14em; }
.badge { font: 600 11px var(--mono); letter-spacing: .06em; border-radius: 6px; }
input.f, select.f, textarea.f { font: 14px var(--sans); background: var(--bg2); padding: 9px 12px; border-radius: 9px; }
label.lbl { font: 600 11px var(--mono); letter-spacing: .12em; }
.hero-title { font: 800 22px var(--display); font-stretch: 112%; text-transform: none; }
.tile b { font: 700 15px var(--display); text-transform: none; }

/* ---------- каркас ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); height: 100vh; }
.side { background: var(--bg2); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.side-head { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; }
.side-head img { width: 30px; height: 30px; }
.side-head b { font: 800 15px var(--display); font-stretch: 125%; letter-spacing: .14em; }
.side-head b span { color: var(--sig-hi); }
.srv-card { margin: 4px 12px 10px; padding: 11px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); cursor: pointer; text-align: left; color: inherit; font: inherit; width: calc(100% - 24px); transition: border-color .2s; }
.srv-card:hover { border-color: var(--line2); }
.srv-card .cap { display: flex; align-items: center; gap: 6px; }
.srv-card b { display: block; margin-top: 4px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srv-card small { display: block; color: var(--muted); font: 500 12px var(--mono); margin-top: 2px; }
.nav { flex: 1; overflow-y: auto; padding: 6px 10px 12px; }
.nav h4 { margin: 14px 10px 6px; font: 600 10.5px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.nav a { display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 10px; border-radius: 9px; color: var(--muted); text-decoration: none; font-weight: 500; transition: background .15s, color .15s; position: relative; }
.nav a:hover { background: var(--card); color: var(--text); }
.nav a.on { background: rgba(var(--sig-rgb), .12); color: var(--text); }
.nav a.on::before { content: ''; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--sig); }
.nav a.on svg { color: var(--sig-hi); }
.nav a svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav a .cnt { margin-left: auto; font: 600 11px var(--mono); padding: 1px 7px; border-radius: 999px; background: var(--card2); color: var(--muted); }
.nav a .cnt.hot { background: var(--threat); color: #fff; }
.side-user { border-top: 1px solid var(--line); padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.side-user .av { width: 32px; height: 32px; border-radius: 50%; background: var(--card2); display: grid; place-items: center; font: 700 13px var(--display); color: var(--sig-hi); flex: none; }
.side-user .who { min-width: 0; flex: 1; }
.side-user .who b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .who small { color: var(--muted); font-size: 12px; }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; flex: none; }
.icon-btn:hover { color: var(--text); border-color: var(--line2); }
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.mainc { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 0 26px; height: 64px; border-bottom: 1px solid var(--line); background: rgba(17, 18, 20, .85); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); flex: none; }
.topbar .crumb { min-width: 0; flex: 1; }
.topbar .crumb small { display: block; font: 500 12px var(--sans); color: var(--dim); }
.topbar .crumb h1 { font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.pill { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg2); font: 500 12.5px var(--sans); color: var(--muted); white-space: nowrap; }
.pill b { color: var(--text); font: 600 12.5px var(--mono); }
.pill svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.pill.ok { color: var(--ok); border-color: rgba(var(--ok-rgb), .35); }
.pill.err { color: var(--threat); border-color: rgba(var(--threat-rgb), .4); }
.menu-btn { display: none; }
.page { flex: 1; overflow-y: auto; padding: 24px 26px 48px; }
.page > * { animation: rise .35s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.page.flush { padding: 0; overflow: hidden; display: flex; }

/* полоса тревоги */
.alarm-bar { display: flex; align-items: center; gap: 14px; padding: 10px 26px; background: linear-gradient(90deg, rgba(var(--threat-rgb), .22), rgba(var(--threat-rgb), .08)); border-bottom: 1px solid rgba(var(--threat-rgb), .5); color: #fff; flex: none; }
.alarm-bar b { font: 800 14px var(--display); font-stretch: 112%; letter-spacing: .04em; text-transform: uppercase; }
.alarm-bar .dotx { width: 10px; height: 10px; border-radius: 50%; background: var(--threat); box-shadow: 0 0 0 0 rgba(var(--threat-rgb), .7); animation: pulse 1.2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(var(--threat-rgb), 0); } 100% { box-shadow: 0 0 0 0 rgba(var(--threat-rgb), 0); } }
.alarm-bar .btn { margin-left: auto; }

/* ---------- сетка панелей ---------- */
.grid { display: grid; align-items: start; gap: 16px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c5 { grid-column: span 5; } .c6 { grid-column: span 6; } .c7 { grid-column: span 7; } .c8 { grid-column: span 8; } .c12 { grid-column: span 12; }
@media (max-width: 1280px) { .c3 { grid-column: span 6; } .c4, .c5 { grid-column: span 6; } .c7, .c8 { grid-column: span 12; } .c4.keep { grid-column: span 4; } }
@media (max-width: 860px) { .grid > * { grid-column: span 12 !important; } }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; min-width: 0; }
.panel-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px 0; }
.panel-h h2 { font-size: 15px; font-family: var(--sans); font-weight: 600; letter-spacing: 0; flex: 1; min-width: 0; }
.panel-h .cap { color: var(--dim); }
.panel-h a, .panel-h .lnk { font-size: 13px; color: var(--muted); text-decoration: none; background: none; border: 0; cursor: pointer; padding: 0; }
.panel-h a:hover, .panel-h .lnk:hover { color: var(--text); }
.panel-b { padding: 12px 16px 16px; flex: 1; min-width: 0; }
.panel-b.np { padding: 8px 0 6px; }

/* показатели */
.stat { padding: 16px 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; gap: 6px; min-width: 0; position: relative; overflow: hidden; }
.stat .k { display: flex; align-items: center; gap: 8px; font: 600 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.stat .k svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
.stat .v { font: 800 28px var(--display); font-stretch: 112%; font-variant-numeric: tabular-nums; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .v small { font: 500 14px var(--sans); color: var(--muted); margin-left: 4px; }
.stat .s { font-size: 13px; color: var(--muted); }
.stat.good .v { color: var(--ok); }
.stat.bad { border-color: rgba(var(--threat-rgb), .5); background: linear-gradient(180deg, rgba(var(--threat-rgb), .12), var(--card) 70%); }
.stat.bad .v { color: var(--threat); }
.stat.warn .v { color: var(--warn); }
.stat .meter { margin-top: 4px; }

/* таблицы */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font: 600 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: rgba(255, 255, 255, .02); }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl .name { font-weight: 600; }
.tbl .sub { font-size: 12.5px; color: var(--muted); }
.tbl .acts { display: flex; gap: 6px; justify-content: flex-end; }
.tbl tr.clickable { cursor: pointer; }
.st { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; white-space: nowrap; }
.st i { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: none; }
.st.on i { background: var(--ok); box-shadow: 0 0 8px rgba(var(--ok-rgb), .6); }
.st.on { color: var(--ok); }
.st.bad i { background: var(--threat); }
.st.bad { color: var(--threat); }
.st.warn i { background: var(--warn); }
.st.warn { color: var(--warn); }

/* строки списков в панелях */
.rows { display: flex; flex-direction: column; }
.rowi { display: flex; align-items: center; gap: 12px; padding: 9px 16px; min-height: 44px; }
.rowi + .rowi { border-top: 1px solid var(--line); }
.rowi .g { flex: 1; min-width: 0; }
.rowi .g b { display: block; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rowi .g small { display: block; color: var(--muted); font-size: 12.5px; }
.rowi time, .rowi .tm { font: 500 12px var(--mono); color: var(--dim); white-space: nowrap; }
.evi { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--card2); color: var(--muted); flex: none; }
.evi svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.evi.red { color: var(--threat); background: rgba(var(--threat-rgb), .12); }
.evi.blue { color: var(--info); background: rgba(143, 184, 255, .12); }
.evi.warn { color: var(--warn); background: rgba(var(--warn-rgb), .12); }
.evi.sig { color: var(--sig-hi); background: rgba(var(--sig-rgb), .12); }
.evi.ok { color: var(--ok); background: rgba(var(--ok-rgb), .1); }
.empty-s { padding: 22px 16px; text-align: center; color: var(--muted); font-size: 13.5px; }

/* группы обороны */
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.grp { border: 1px solid var(--line); background: var(--bg2); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; transition: border-color .2s, background .2s; }
.grp.on { border-color: rgba(var(--sig-rgb), .55); background: linear-gradient(180deg, rgba(var(--sig-rgb), .12), var(--bg2)); }
.grp .top { display: flex; align-items: center; gap: 10px; }
.grp .top b { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grp .top span { font: 600 12px var(--mono); color: var(--muted); }
.grp .dots { display: flex; gap: 4px; flex-wrap: wrap; }
.grp .dots i { width: 18px; height: 6px; border-radius: 3px; background: var(--line2); }
.grp .dots i.on { background: var(--sig-hi); box-shadow: 0 0 8px rgba(var(--sig-rgb), .5); }
.grp .btns { display: flex; gap: 6px; }
.grp .btns .btn { flex: 1; }

/* горизонтальные полосы (время в игре) */
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: 110px minmax(0, 1fr) 104px; gap: 12px; align-items: center; font-size: 13.5px; }
.hbar .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .t { height: 8px; border-radius: 4px; background: var(--card2); overflow: hidden; }
.hbar .t i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #a3122e, var(--sig-hi)); animation: grow .8s var(--ease) both; }
@keyframes grow { from { width: 0 !important; } }
.hbar .v { white-space: nowrap; text-align: right; font: 500 12.5px var(--mono); color: var(--muted); }

/* тимчат */
.chatbox { display: flex; flex-direction: column; height: calc(100vh - 64px - 48px - 70px); min-height: 360px; }
.chatlog { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.cm { max-width: 72%; display: flex; flex-direction: column; gap: 2px; }
.cm .h { font-size: 12px; color: var(--muted); display: flex; gap: 8px; }
.cm .h b { color: var(--sig-hi); font-weight: 600; }
.cm .h time { font-family: var(--mono); color: var(--dim); }
.cm .m { background: var(--card2); border: 1px solid var(--line); padding: 8px 12px; border-radius: 4px 12px 12px 12px; word-wrap: break-word; }
.cm.me { align-self: flex-end; align-items: flex-end; }
.cm.me .m { background: rgba(var(--sig-rgb), .12); border-color: rgba(var(--sig-rgb), .35); border-radius: 12px 4px 12px 12px; }
.cm.bot .m { border-style: dashed; color: var(--muted); }
.chatin { display: flex; gap: 10px; padding: 12px; border-top: 1px solid var(--line); }
.chatin input { flex: 1; }
.cmds { display: flex; flex-wrap: wrap; gap: 6px; }
.cmds code { font: 500 12.5px var(--mono); padding: 4px 8px; border-radius: 6px; background: var(--bg2); border: 1px solid var(--line); cursor: pointer; }
.cmds code:hover { border-color: var(--sig); }

/* переключатели в строках */
.tg-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.tg-row + .tg-row { border-top: 1px solid var(--line); }
.tg-row .g { flex: 1; min-width: 0; }
.tg-row .g b { display: block; font-weight: 500; font-size: 14px; }
.tg-row .g small { color: var(--muted); font-size: 12.5px; }

/* фильтры */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .grow { flex: 1; }
.search { position: relative; min-width: 220px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; fill: none; stroke: var(--dim); stroke-width: 2; }
.search input { padding-left: 34px; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--muted); font: 500 13px var(--sans); padding: 6px 12px; border-radius: 7px; cursor: pointer; }
.seg button.on { background: var(--card2); color: var(--text); }

/* карта на всю область */
.mapzone { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 300px; min-height: 0; }
.mapzone .map-wrap { position: relative; inset: auto; top: auto; bottom: auto; height: 100%; }
.mapzone .map-tools { bottom: 16px; }
.mapzone .layers { bottom: 16px; }
.mapside { border-left: 1px solid var(--line); background: var(--bg2); overflow-y: auto; }
.mapside .sec { padding: 14px 16px 6px; font: 600 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
@media (max-width: 1100px) { .mapzone { grid-template-columns: 1fr; } .mapside { display: none; } }

/* модальное окно: панель справа */
.sheet-wrap { z-index: 60; }
.sheet { left: auto; right: 0; top: 0; bottom: 0; width: min(520px, 100%); max-height: none; border-radius: 0; border-top: 0; border-left: 1px solid var(--line2); padding: 22px 24px 30px; animation: slideIn .28s var(--ease); max-width: none; margin: 0; background: var(--bg2); }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } }
.grab { display: none; }
.sheet-x { top: 0; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 80; background: var(--card2); border: 1px solid var(--line2); padding: 10px 16px; border-radius: 10px; box-shadow: 0 12px 30px rgba(0, 0, 0, .4); font-size: 14px; }

/* вход */
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.login-l { padding: 48px 56px; display: flex; flex-direction: column; justify-content: center; gap: 22px; }
.login-l .brand { display: flex; align-items: center; gap: 12px; }
.login-l .brand img { width: 40px; height: 40px; }
.login-l .brand b { font: 800 18px var(--display); font-stretch: 125%; letter-spacing: .14em; }
.login-l .brand b span { color: var(--sig-hi); }
.login-l h1 { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.08; max-width: 16ch; }
.login-l p { color: var(--muted); max-width: 48ch; font-size: 16px; }
.login-box { padding: 22px; border: 1px solid var(--line2); border-radius: 16px; background: var(--card); max-width: 420px; display: grid; gap: 12px; }
.login-box small { color: var(--dim); }
.login-r { position: relative; overflow: hidden; border-left: 1px solid var(--line); background: radial-gradient(circle at 70% 30%, rgba(var(--sig-rgb), .22), transparent 55%), var(--bg2); display: grid; place-items: center; padding: 40px; }
.login-r::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 48px 48px; opacity: .5; -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%); mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%); }
.preview { position: relative; width: min(460px, 100%); display: grid; gap: 12px; }
.preview .stat { animation: rise .6s var(--ease) both; }
.preview .stat:nth-child(2) { animation-delay: .1s; } .preview .stat:nth-child(3) { animation-delay: .2s; }
@media (max-width: 900px) { .login-page { grid-template-columns: 1fr; } .login-r { display: none; } .login-l { padding: 32px 20px; } }

/* узкий экран: меню выезжает */
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 70; transform: translateX(-100%); transition: transform .25s var(--ease); box-shadow: 20px 0 50px rgba(0, 0, 0, .5); }
  body.menu .side { transform: none; }
  body.menu::after { content: ''; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 65; }
  .menu-btn { display: grid; }
  .topbar { padding: 0 16px; }
  .page { padding: 18px 16px 40px; }
  .live .pill.opt { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.grid.stretch { align-items: stretch; }
.switch { display: inline-block; vertical-align: middle; }
/* встроенные экраны приложения (утилиты, админка, клан) */
#toolsBox > .row.between:first-child, #adminBox > .row.between:first-child { display: none; }
#toolsBox .card, #toolsBox .list, #adminBox .card, #adminBox .list, .panel-b .card, .panel-b .list { margin-bottom: 12px; }
.panel-b > .section-title:first-child { margin-top: 0; }
.plan + .plan { margin-top: 8px; }
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (max-width: 1280px) { .c8.col, .c4.col { grid-column: span 12; } }
.topbar .crumb small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* переключатель языка */
.lang-sw { display: inline-flex; flex: none; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255, 255, 255, .03); }
.lang-sw button { font: 600 12px var(--mono, monospace); letter-spacing: .06em; color: var(--dim); background: none; border: 0; padding: 6px 9px; border-radius: 6px; cursor: pointer; transition: background .15s, color .15s; }
.lang-sw button:hover { color: var(--text); }
.lang-sw button.on { background: var(--sig); color: #fff; }
.login-page { position: relative; }
.login-lang { position: absolute; top: 20px; right: 24px; z-index: 5; }

/* ---- полировка: движение и отклик ---- */
.page.enter > * { animation: rise .45s var(--ease) both; }
.page.enter > *:nth-child(2) { animation-delay: .05s; } .page.enter > *:nth-child(3) { animation-delay: .1s; }
.page.enter > *:nth-child(4) { animation-delay: .15s; } .page.enter > *:nth-child(n+5) { animation-delay: .2s; }
.page.enter .stats > *, .page.enter .grid > .col > * { animation: rise .5s var(--ease) both; }
.page.enter .stats > *:nth-child(2) { animation-delay: .06s; } .page.enter .stats > *:nth-child(3) { animation-delay: .12s; } .page.enter .stats > *:nth-child(4) { animation-delay: .18s; }
.page.enter .grid > .col > *:nth-child(2) { animation-delay: .08s; } .page.enter .grid > .col > *:nth-child(n+3) { animation-delay: .14s; }
.stat, .panel { transition: border-color .25s, box-shadow .3s, transform .3s var(--ease); }
.stat::after, .panel::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), rgba(var(--sig-rgb), .08), transparent 45%); }
.panel { position: relative; }
@media (hover: hover) { .stat:hover, .panel:hover { border-color: var(--line2); } .stat:hover::after, .panel:hover::after { opacity: 1; } .stat:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(0, 0, 0, .28); } }
.stat .v { transition: color .3s; }
.stat.bad { animation: badGlow 2.4s ease-in-out infinite; }
@keyframes badGlow { 50% { box-shadow: 0 0 0 1px rgba(var(--threat-rgb), .35), 0 0 30px rgba(var(--threat-rgb), .12); } }
.nav a { position: relative; transition: background .2s, color .2s, padding-left .25s var(--ease); }
.nav a:hover:not(.on) { padding-left: 13px; }
.nav a.on::before { animation: navbar .35s var(--ease); }
@keyframes navbar { from { transform: scaleY(0); } }
.nav a svg { transition: transform .3s var(--ease), color .2s; }
.nav a:hover svg { transform: scale(1.1); }
.side-head img { transition: transform .6s var(--ease), filter .3s; }
.side-head:hover img { transform: rotate(-8deg) scale(1.08); filter: drop-shadow(0 0 10px rgba(var(--sig-rgb), .55)); }
.btn { transition: background .2s, border-color .2s, transform .15s var(--ease), box-shadow .25s; }
.btn.red, .btn.primary { position: relative; overflow: hidden; }
.btn.red::after, .btn.primary::after { content: ''; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .25), transparent); transform: skewX(-18deg); transition: left .7s var(--ease); pointer-events: none; }
.btn.red:hover::after, .btn.primary:hover::after { left: 130%; }
.switch i::after { transition: transform .32s cubic-bezier(.34, 1.56, .64, 1), background .2s; }
.switch input:active + i::after { width: 26px; }
.chip { transition: background .2s, border-color .2s, color .2s, transform .15s var(--ease); }
.chip:active { transform: scale(.95); }
.toast { animation: toastIn .4s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 14px) scale(.96); } }
.pill .dot.on { animation: ring 2.4s ease-out infinite; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(var(--ok-rgb), .55); } 70%, 100% { box-shadow: 0 0 0 7px rgba(var(--ok-rgb), 0); } }
.topbar .crumb h1 { animation: crumbIn .35s var(--ease); }
@keyframes crumbIn { from { opacity: 0; transform: translateX(-6px); } }
body.lswap .page, body.lswap .side .nav { animation: lswap .35s var(--ease); }
@keyframes lswap { from { opacity: .4; filter: blur(2px); } }
table tbody tr { transition: background .15s; }
::selection { background: rgba(var(--sig-rgb), .4); }
* { scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
@media (prefers-reduced-motion: reduce) { .page.enter > *, .stat.bad { animation: none !important; } }
