/* RDP Fleet — liquid glass (те же токены, что в WG Fleet) + мобильная раскладка */
@font-face{font-family:'Inter';font-style:normal;font-weight:100 900;font-display:swap;src:url(/fonts/inter-cyrillic.woff2) format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Inter';font-style:normal;font-weight:100 900;font-display:swap;src:url(/fonts/inter-latin.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}

:root {
  --bg-img: url(/bg/light.jpg);
  --bg-veil: rgba(230, 236, 247, 0.30);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --card-bg: rgba(255, 255, 255, 0.80);
  --glass-border: rgba(0, 0, 0, 0.12);
  --input-bg: rgba(255, 255, 255, 0.85);
  --input-border: rgba(0, 0, 0, 0.18);
  --primary: #007aff; --primary-rgb: 0, 122, 255;
  --ok: #16a34a; --ok-rgb: 22, 163, 74;
  --warn: #b45309; --warn-rgb: 217, 119, 6;
  --err: #dc2626; --err-rgb: 220, 38, 38;
  --muted-dot: #8e8e93;
  --chart-line: #0a6fe0;
  --chart-grid: rgba(15, 23, 42, 0.10);
  --r-xs: 10px; --r-sm: 14px; --r-md: 20px; --r-lg: 28px; --r-pill: 999px;
  --lg-blur: 20px; --lg-sat: 1.7;
  --lg-fill: rgba(255, 255, 255, 0.55);
  --panel-solid: rgba(255, 255, 255, 0.82);
  --lg-fill-raised: rgba(255, 255, 255, 0.82);
  --lg-fill-soft: rgba(255, 255, 255, 0.35);
  --lg-border: rgba(255, 255, 255, 0.60);
  --lg-hairline: rgba(0, 0, 0, 0.10);
  --lg-highlight: rgba(255, 255, 255, 0.75);
  --lg-shadow-1: 0 2px 6px rgba(16, 24, 40, 0.08);
  --lg-shadow-card: 0 6px 18px rgba(16, 24, 40, 0.12);
  --lg-shadow-card-hover: 0 12px 30px rgba(16, 24, 40, 0.20);
  --lg-shadow-3: 0 24px 56px rgba(16, 24, 40, 0.18), 0 8px 20px rgba(16, 24, 40, 0.10);
  --lg-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --lg-fast: 0.18s;
  --mono: ui-monospace, 'JetBrains Mono', 'Cascadia Mono', Consolas, monospace;
  --sheet-bg: rgba(250, 252, 255, 0.94);
}
:root[data-theme="dark"] {
  --bg-img: url(/bg/dark.jpg);
  --bg-veil: rgba(0, 0, 0, 0.38);
  --text-primary: #f0f4f8;
  --text-secondary: #a8b3bf;
  --card-bg: rgba(22, 27, 33, 0.62);
  --glass-border: rgba(255, 255, 255, 0.10);
  --input-bg: rgba(40, 45, 50, 0.80);
  --input-border: rgba(255, 255, 255, 0.15);
  --primary: #0a84ff; --primary-rgb: 10, 132, 255;
  --ok: #30d158; --ok-rgb: 48, 209, 88;
  --warn: #ffb340; --warn-rgb: 255, 179, 64;
  --err: #ff453a; --err-rgb: 255, 69, 58;
  --chart-line: #4da3ff;
  --chart-grid: rgba(255, 255, 255, 0.10);
  --lg-fill: rgba(30, 36, 44, 0.55);
  --panel-solid: rgba(22, 26, 33, 0.86);
  --lg-fill-raised: rgba(34, 40, 50, 0.85);
  --lg-fill-soft: rgba(255, 255, 255, 0.06);
  --lg-border: rgba(255, 255, 255, 0.14);
  --lg-hairline: rgba(255, 255, 255, 0.10);
  --lg-highlight: rgba(255, 255, 255, 0.16);
  --lg-shadow-1: 0 2px 6px rgba(0, 0, 0, 0.35);
  --lg-shadow-card: 0 6px 20px rgba(0, 0, 0, 0.45);
  --lg-shadow-card-hover: 0 12px 30px rgba(0, 0, 0, 0.55);
  --lg-shadow-3: 0 28px 60px rgba(0, 0, 0, 0.55), 0 10px 24px rgba(0, 0, 0, 0.40);
  --sheet-bg: rgba(24, 29, 36, 0.96);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100vh; overflow-x: clip; }
/* полоса прокрутки страницы скрыта (прокрутка колесом и тачпадом работает): её появление
   на длинных вкладках и исчезновение на коротких меняло ширину страницы */
html { scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--text-primary); background: #0b0f14; font-size: 14px; -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body::before { content: ''; position: fixed; inset: -4%; z-index: -2; background: var(--bg-img) center / cover no-repeat; filter: blur(6px) saturate(1.15); transform: scale(1.04); }
body::after { content: ''; position: fixed; inset: 0; z-index: -1; background: var(--bg-veil); }
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--primary); }
svg.i { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.mono { font-family: var(--mono); font-size: 0.92em; }
.muted { color: var(--text-secondary); }
.small { font-size: .82rem; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.spacer { flex: 1; }
.num { font-variant-numeric: tabular-nums; }

.glass {
  background: var(--lg-fill);
  -webkit-backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-sat));
  backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-sat));
  border: 1px solid var(--lg-border);
  box-shadow: var(--lg-shadow-card), inset 0 1px 0 0 var(--lg-highlight);
}

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 272px 1fr; gap: 18px; padding: 18px; min-height: 100vh; }
.sidebar { position: sticky; top: 18px; align-self: start; height: calc(100vh - 36px); border-radius: var(--r-lg); padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 14px; }
.brand-logo { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, rgba(var(--primary-rgb), .95), #33e1e0); box-shadow: 0 6px 18px rgba(var(--primary-rgb), .35), inset 0 1px 0 rgba(255,255,255,.5); }
.brand-logo svg.i { width: 21px; height: 21px; }
.brand b { font-size: 1.08rem; letter-spacing: -0.3px; display: block; }
.brand small { color: var(--text-secondary); font-size: .76rem; }
.nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .8px; color: var(--text-secondary); padding: 12px 12px 6px; display: flex; justify-content: space-between; align-items: center; }
.nav-list { overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 3px; padding-bottom: 8px; scrollbar-width: none; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: var(--r-md); cursor: pointer; border: 1px solid transparent; min-width: 0; transition: background var(--lg-fast); color: inherit; text-decoration: none; }
.nav-item:hover { background: var(--lg-fill-soft); }
.nav-item.active { background: var(--card-bg); border-color: rgba(var(--primary-rgb), .7); box-shadow: inset 0 1px 0 var(--lg-highlight), 0 0 0 3px rgba(var(--primary-rgb), .12); }
.nav-item .nm { flex: 1; min-width: 0; }
.nav-item .nm b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item .nm small { display: block; color: var(--text-secondary); font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-count { font-size: .75rem; font-family: var(--mono); color: var(--text-secondary); }
.side-foot { display: flex; flex-direction: column; gap: 3px; padding-top: 8px; border-top: 1px solid var(--lg-hairline); }
.side-foot .row { display: flex; gap: 8px; align-items: center; padding: 6px 4px 0; }
.me-chip { flex: 1; display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: var(--r-md); cursor: pointer; min-width: 0; border: 1px solid transparent; background: none; text-align: left; }
.me-chip:hover { background: var(--lg-fill-soft); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; color: #fff; background: linear-gradient(135deg, #5e5ce6, rgba(var(--primary-rgb), 1)); flex-shrink: 0; }
.me-chip b { display: block; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-chip small { display: block; font-size: .74rem; color: var(--text-secondary); }

.main { min-width: 0; display: flex; flex-direction: column; gap: 16px; padding-bottom: 110px; }
.mtop { display: none; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
#tabbody > .stack, #tabbody > div { display: flex; flex-direction: column; gap: 16px; }
.scrim { display: none; }

/* ---------- кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; min-height: 38px; border-radius: var(--r-pill); border: 1px solid var(--input-border);
  background: var(--lg-fill-soft); color: var(--text-primary); font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none;
  box-shadow: inset 0 1px 0 0 var(--lg-highlight); transition: background var(--lg-fast), box-shadow var(--lg-fast), transform var(--lg-fast); }
.btn:hover { background: var(--lg-fill-raised); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible, .btn-icon:focus-visible, .nav-item:focus-visible, .tab:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn.primary { background: transparent; color: var(--primary); border-color: rgba(var(--primary-rgb), .85); font-weight: 600; box-shadow: inset 0 1px 0 0 var(--lg-highlight), 0 0 0 3px rgba(var(--primary-rgb), .14); }
.btn.primary:hover { background: rgba(var(--primary-rgb), .10); }
.btn.solid { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.solid:hover { filter: brightness(1.08); background: var(--primary); }
.btn.danger { color: var(--err); border-color: rgba(var(--err-rgb), .6); background: transparent; }
.btn.danger:hover { background: rgba(var(--err-rgb), .10); }
.btn.danger.solid { background: var(--err); color: #fff; }
.btn.sm { padding: 6px 12px; min-height: 32px; font-size: .84rem; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--r-sm); display: inline-grid; place-items: center; flex-shrink: 0;
  background: var(--input-bg); border: 1px solid var(--input-border); color: var(--text-primary); cursor: pointer; box-shadow: var(--lg-shadow-1); }
.btn-icon:hover { background: var(--lg-fill-raised); }
.btn-icon.accent { color: var(--primary); border-color: rgba(var(--primary-rgb), .6); }
.btn-icon.sm { width: 32px; height: 32px; border-radius: 11px; }

/* ---------- статусы ---------- */
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: var(--muted-dot); display: inline-block; }
.dot.st-ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(var(--ok-rgb), .22); }
.dot.st-warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(var(--warn-rgb), .2); }
.dot.st-down { background: var(--err); box-shadow: 0 0 0 3px rgba(var(--err-rgb), .22); }
.dot.st-new { background: var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .2); }
.dot.st-idle { background: transparent; border: 2px solid var(--muted-dot); }
.dot.st-locked { background: transparent; border: 2px dashed var(--err); }
.dot.pulse { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(var(--ok-rgb), 0); } }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--r-pill); font-size: .75rem; font-weight: 600; border: 1px solid var(--glass-border); background: var(--lg-fill-soft); white-space: nowrap; }
.badge.st-ok { color: var(--ok); border-color: rgba(var(--ok-rgb), .45); background: rgba(var(--ok-rgb), .10); }
.badge.st-warn { color: var(--warn); border-color: rgba(var(--warn-rgb), .45); background: rgba(var(--warn-rgb), .10); }
.badge.st-down { color: var(--err); border-color: rgba(var(--err-rgb), .45); background: rgba(var(--err-rgb), .10); }
.badge.st-new, .badge.st-info { color: var(--primary); border-color: rgba(var(--primary-rgb), .45); background: rgba(var(--primary-rgb), .10); }
.badge.demo { color: #a855f7; border-color: rgba(168, 85, 247, .45); }
.badge svg.i { width: 12px; height: 12px; }

/* ---------- страница ---------- */
.page-head { border-radius: var(--r-lg); padding: 18px 20px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.page-head .ttl { flex: 1; min-width: 220px; }
.page-head h1 { margin: 0; font-size: 1.4rem; font-weight: 700; letter-spacing: -0.5px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-head .sub { color: var(--text-secondary); margin-top: 5px; font-size: .86rem; display: flex; gap: 6px 14px; flex-wrap: wrap; }
.head-metrics { flex-basis: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 8px 20px; padding-top: 14px; border-top: 1px solid var(--lg-hairline); align-items: end; }
.head-metrics .hm { min-width: 0; }
.head-metrics .hm-top { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.head-metrics .hm-top .i { width: 17px; height: 17px; flex: none; align-self: center; color: var(--text-secondary); }
.head-metrics b { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.head-metrics .hm-spark { display: block; width: 100%; height: 30px; margin-top: 4px; overflow: visible; }
.head-metrics .hm-spark.empty { border-bottom: 1px dashed var(--lg-hairline); height: 30px; }
.head-metrics .hm-spark .l { fill: none; stroke: var(--primary); stroke-width: 2.2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 3px color-mix(in srgb, var(--primary) 60%, transparent)); }
.head-metrics .hm-spark .a { fill: var(--primary); opacity: .32; }
.head-metrics .hm-spark .l.rx { stroke: var(--ok); filter: drop-shadow(0 0 3px color-mix(in srgb, var(--ok) 60%, transparent)); }
.head-metrics .hm-spark .a.rx { fill: var(--ok); opacity: .22; }
.head-metrics .hm-barbox { display: flex; align-items: flex-end; height: 30px; margin-top: 4px; }
.head-metrics .hm-sess { display: flex; align-items: center; gap: 8px; padding: 6px 2px 4px 18px; border-left: 1px solid var(--lg-hairline); align-self: stretch; }
.head-metrics .hm-sess .i { width: 20px; height: 20px; color: var(--text-secondary); }
.head-metrics .hm-sess b { font-size: 1.5rem; }
.head-metrics .hm-sess em { white-space: nowrap; }
.head-metrics .bar { display: block; width: 100%; height: 7px; border-radius: 99px; background: var(--lg-hairline); margin: 0 0 2px; overflow: hidden; }
.head-metrics .bar i { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.head-metrics .bar i.w { background: var(--warn); } .head-metrics .bar i.e { background: var(--err); }
.head-metrics em { font-style: normal; font-size: .76rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.panel { border-radius: var(--r-lg); padding: 18px 20px; }
/* Большие блоки содержимого — без живого размытия фона: Chrome при перерисовке такого блока (загрузка
   «Управления») оставлял на экране тёмные прямоугольники от старого слоя. Подложка почти непрозрачная. */
.panel.glass { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--panel-solid); }
.panel > h2, .panel-h h2 { margin: 0; font-size: 1.02rem; font-weight: 650; letter-spacing: -0.2px; }
.panel-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-h .sub { color: var(--text-secondary); font-size: .84rem; }
.panel > h2 { margin-bottom: 12px; }
.panel p { margin: 0 0 10px; line-height: 1.5; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { border-radius: var(--r-md); padding: 14px 16px; }
.tile small { display: block; font-size: .72rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .6px; }
.tile b { display: block; font-size: 1.55rem; font-weight: 700; letter-spacing: -0.6px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tile b em { font-style: normal; font-weight: 500; color: var(--text-secondary); font-size: .95rem; letter-spacing: 0; }
.tile .hint { font-size: .78rem; color: var(--text-secondary); margin-top: 2px; }

.alerts { display: flex; flex-direction: column; gap: 6px; }
.alert { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: var(--r-sm); background: var(--lg-fill-soft); border: 1px solid var(--lg-hairline); cursor: pointer; }
.alert:hover { background: var(--lg-fill-raised); }
.alert .srv { font-weight: 600; }
.alert svg.i { color: var(--warn); }
.alert.err svg.i { color: var(--err); }
.alert.info svg.i { color: var(--primary); }

/* ---------- карточки серверов ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.card { background: var(--card-bg); border: 1px solid var(--lg-border); border-radius: var(--r-lg); padding: 16px; cursor: pointer; display: flex; flex-direction: column; gap: 11px;
  box-shadow: var(--lg-shadow-card), inset 0 1px 0 0 var(--lg-highlight); transition: transform var(--lg-fast) var(--lg-ease), box-shadow var(--lg-fast); color: inherit; text-decoration: none; }
.card:hover { transform: translateY(-2px); box-shadow: var(--lg-shadow-card-hover), inset 0 1px 0 0 var(--lg-highlight); }
.card-top { display: flex; align-items: center; gap: 10px; }
.card-top b { font-size: 1.04rem; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-host { color: var(--text-secondary); font-family: var(--mono); font-size: .8rem; margin-top: -6px; }
.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.metric { padding: 8px 10px; border-radius: var(--r-sm); background: var(--lg-fill-soft); border: 1px solid var(--lg-hairline); min-width: 0; }
.metric small { display: block; font-size: .68rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .5px; }
.metric b { font-weight: 650; font-size: .96rem; font-variant-numeric: tabular-nums; }
.metric b em { font-style: normal; color: var(--text-secondary); font-weight: 500; font-size: .8rem; }
.bar { height: 5px; border-radius: 99px; background: var(--lg-hairline); margin-top: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--ok); transition: width .4s var(--lg-ease); }
.bar i.w { background: var(--warn); } .bar i.e { background: var(--err); }
.card-err { font-size: .8rem; color: var(--err); background: rgba(var(--err-rgb), .08); border: 1px solid rgba(var(--err-rgb), .25); padding: 7px 10px; border-radius: var(--r-xs); word-break: break-word; }
.card-note { font-size: .8rem; color: var(--text-secondary); }
.spark { height: 34px; }
.spark svg { width: 100%; height: 100%; display: block; overflow: visible; }
.spark path.l { fill: none; stroke: var(--chart-line); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.spark path.a { fill: var(--chart-line); opacity: .10; }
.spark-cap { display: flex; justify-content: space-between; font-size: .72rem; color: var(--text-secondary); margin-top: -4px; }
.empty { text-align: center; padding: 42px 20px; color: var(--text-secondary); }
.empty b { display: block; color: var(--text-primary); font-size: 1.05rem; margin-bottom: 6px; }

/* ---------- вкладки ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 5px; border-radius: var(--r-pill); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px; border-radius: var(--r-pill); cursor: pointer; white-space: nowrap; border: 1px solid transparent; background: none; font-weight: 550; color: var(--text-secondary); text-decoration: none; }
.tab:hover { color: var(--text-primary); background: var(--lg-fill-soft); }
.tab.active { color: var(--text-primary); background: var(--card-bg); border-color: rgba(var(--primary-rgb), .6); box-shadow: inset 0 1px 0 var(--lg-highlight); }
.tab .cnt { font-size: .74rem; font-family: var(--mono); padding: 1px 7px; border-radius: 99px; background: var(--lg-fill-soft); border: 1px solid var(--lg-hairline); }
/* вкладки сервера — значками внизу шапки, на всю ширину */
.head-tabs { flex-basis: 100%; display: flex; gap: 6px; padding-top: 12px; border-top: 1px solid var(--lg-hairline); }
.head-tabs .tab { flex: 1; justify-content: center; padding: 9px 10px; }
.head-tabs .tab .i { width: 20px; height: 20px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-pill); background: var(--lg-fill-soft); border: 1px solid var(--lg-hairline); }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: var(--r-pill); cursor: pointer; font-weight: 550; color: var(--text-secondary); font-size: .84rem; }
.seg button.on { background: var(--card-bg); color: var(--text-primary); box-shadow: var(--lg-shadow-1); }

/* ---------- таблицы (на телефоне превращаются в карточки) ---------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 550; font-size: .76rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .5px; padding: 8px 10px; border-bottom: 1px solid var(--lg-hairline); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--lg-hairline); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.sel td { background: rgba(var(--primary-rgb), .07); }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl .who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.tbl .who b { font-weight: 600; }
.row-acts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; margin: 0; vertical-align: middle; }
.bulkbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-radius: var(--r-md); background: rgba(var(--primary-rgb), .08); border: 1px solid rgba(var(--primary-rgb), .3); margin-bottom: 12px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .search { flex: 1; min-width: 160px; }
.meter { display: inline-block; width: 64px; height: 5px; border-radius: 99px; background: var(--lg-hairline); vertical-align: middle; margin-left: 8px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.meter i.w { background: var(--warn); } .meter i.e { background: var(--err); }

/* ---------- формы ---------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: .8rem; color: var(--text-secondary); font-weight: 550; }
.field > small { font-size: .76rem; color: var(--text-secondary); }
.input, select.input, textarea.input { width: 100%; padding: 10px 13px; border-radius: var(--r-sm); border: 1px solid var(--input-border); background: var(--input-bg); outline: none; min-height: 40px; }
.input:focus { border-color: rgba(var(--primary-rgb), .8); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .18); }
textarea.input { resize: vertical; min-height: 110px; font-family: var(--mono); font-size: .88rem; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px 14px; }
.form-sec { margin-top: 18px; }
.form-sec:first-child { margin-top: 0; }
.form-sec > h3 { margin: 0 0 10px; font-size: .82rem; text-transform: uppercase; letter-spacing: .7px; color: var(--text-secondary); font-weight: 650; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; padding: 6px 0; }
.check > span b { display: block; font-weight: 550; }
.check > span small { display: block; color: var(--text-secondary); font-size: .78rem; margin-top: 2px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 2px 14px; }
.note { font-size: .84rem; padding: 10px 13px; border-radius: var(--r-sm); background: rgba(var(--primary-rgb), .07); border: 1px solid rgba(var(--primary-rgb), .22); line-height: 1.5; }
.note.warn { background: rgba(var(--warn-rgb), .09); border-color: rgba(var(--warn-rgb), .35); }
.note.err { background: rgba(var(--err-rgb), .08); border-color: rgba(var(--err-rgb), .3); }

.steps { display: flex; flex-direction: column; gap: 6px; }
.step { display: flex; gap: 12px; align-items: flex-start; padding: 11px 13px; border-radius: var(--r-md); background: var(--lg-fill-soft); border: 1px solid var(--lg-hairline); cursor: pointer; }
.step:hover { background: var(--lg-fill-raised); }
.step .body { flex: 1; min-width: 0; }
.step .body b { font-weight: 600; }
.step .body small { display: block; color: var(--text-secondary); font-size: .8rem; margin-top: 2px; }
.step .st { font-size: .76rem; white-space: nowrap; }

/* ---------- графики ---------- */

/* ---------- сессии ---------- */
.sess-list { display: flex; flex-direction: column; gap: 8px; }
.sess { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--r-md); background: var(--lg-fill-soft); border: 1px solid var(--lg-hairline); }
.sess .who { flex: 1; min-width: 180px; display: flex; gap: 11px; align-items: center; }
.sess .who b { font-weight: 600; font-size: .98rem; }
.sess .who small { display: block; color: var(--text-secondary); font-size: .78rem; margin-top: 1px; }

/* ---------- модальные окна ---------- */
.modal-back { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.35); display: grid; place-items: center; padding: 18px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(560px, 100%); max-height: calc(100vh - 36px); overflow: auto; border-radius: var(--r-lg); padding: 20px 22px; background: var(--sheet-bg); border: 1px solid var(--lg-border); box-shadow: var(--lg-shadow-3); animation: pop .2s var(--lg-ease); }
.modal.wide { width: min(860px, 100%); }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.modal h2 { margin: 0 0 4px; font-size: 1.15rem; letter-spacing: -0.3px; }
.modal .sub { color: var(--text-secondary); font-size: .86rem; margin-bottom: 14px; line-height: 1.45; }
.modal-body { display: flex; flex-direction: column; gap: 12px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.log { font-family: var(--mono); font-size: .8rem; line-height: 1.5; background: rgba(0,0,0,.82); color: #d6e2ee; border-radius: var(--r-sm); padding: 12px 14px; max-height: 55vh; min-height: 160px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.log .ok { color: #5fe08a; } .log .er { color: #ff7b72; } .log .hd { color: #79c0ff; font-weight: 600; }
.creds { font-family: var(--mono); font-size: .88rem; }
.creds td { padding: 6px 10px; }

.menu { position: fixed; z-index: 60; min-width: 220px; padding: 6px; border-radius: var(--r-md); background: var(--sheet-bg); border: 1px solid var(--lg-border); box-shadow: var(--lg-shadow-3); animation: pop .15s var(--lg-ease); }
.menu button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 10px 12px; border: 0; background: none; border-radius: 11px; cursor: pointer; text-align: left; }
.menu button:hover { background: var(--lg-fill-soft); }
.menu button.danger { color: var(--err); }
.menu hr { border: 0; border-top: 1px solid var(--lg-hairline); margin: 5px 4px; }

.toasts { position: fixed; top: 16px; right: 16px; z-index: 80; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { padding: 11px 15px; border-radius: var(--r-md); background: var(--sheet-bg); border: 1px solid var(--lg-border); box-shadow: var(--lg-shadow-card); display: flex; gap: 10px; align-items: flex-start; animation: pop .2s var(--lg-ease); }
.toast.ok svg.i { color: var(--ok); } .toast.err svg.i { color: var(--err); }

.dock { position: fixed; right: 18px; bottom: 18px; z-index: 40; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; max-width: calc(100vw - 36px); }
.dock-item { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: var(--r-md); cursor: pointer; max-width: 380px; min-width: 0; }
.dock-item .t { min-width: 0; }
.dock-item b { display: block; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-item small { display: block; font-size: .76rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(var(--primary-rgb), .25); border-top-color: var(--primary); animation: spin .8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- вход ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login { width: min(380px, 100%); border-radius: var(--r-lg); padding: 26px 24px; display: flex; flex-direction: column; gap: 14px; }
.login .brand { padding: 0 0 6px; }
.login .err { color: var(--err); font-size: .86rem; min-height: 1.2em; }

/* ---------- телефон ---------- */
@media (max-width: 860px) {
  .app { display: block; padding: 0 10px 10px; }
  .mtop { display: flex; position: sticky; top: 0; z-index: 30; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 6px 10px; margin: 0 -10px 12px; padding-left: 16px; padding-right: 16px;
    background: var(--lg-fill); -webkit-backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-sat)); backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-sat)); border-bottom: 1px solid var(--lg-border); }
  .mtop b { flex: 1; font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sidebar { position: fixed; z-index: 45; top: 0; left: 0; bottom: 0; height: auto; width: min(300px, 86vw); border-radius: 0 var(--r-lg) var(--r-lg) 0; transform: translateX(-105%); transition: transform .25s var(--lg-ease);
    background: var(--sheet-bg); padding-top: calc(16px + env(safe-area-inset-top)); }
  body.drawer .sidebar { transform: none; }
  body.drawer .scrim { display: block; position: fixed; inset: 0; z-index: 44; background: rgba(0,0,0,.35); }
  .main, .stack { gap: 12px; }
  .page-head { padding: 15px 16px; border-radius: var(--r-md); }
  .page-head h1 { font-size: 1.2rem; }
  .page-head .actions { width: 100%; }
  .head-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
  .head-metrics b { font-size: 1.1rem; }
  .head-metrics .hm-sess { border-left: 0; padding-left: 0; }
  .panel { padding: 15px 14px; border-radius: var(--r-md); }
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { padding: 12px 13px; }
  .tile b { font-size: 1.3rem; }
  .grid { grid-template-columns: 1fr; }
  .tbl.cards thead { display: none; }
  .tbl.cards, .tbl.cards tbody, .tbl.cards tr, .tbl.cards td { display: block; width: 100%; }
  .tbl.cards tr { padding: 11px 4px; border-bottom: 1px solid var(--lg-hairline); display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: center; }
  .tbl.cards tr:last-child { border-bottom: 0; }
  .tbl.cards td { border: 0; padding: 0; }
  .tbl.cards td[data-l]::before { content: attr(data-l) ': '; color: var(--text-secondary); font-size: .78rem; }
  .tbl.cards td.c-sel { grid-row: span 2; }
  .tbl.cards td.c-main { grid-column: 2; }
  .tbl.cards td.c-nil { display: none; }
  .tbl.cards td.c-act { grid-column: 3; grid-row: 1 / span 2; }
  .tbl.cards td.c-extra { grid-column: 2; font-size: .82rem; }
  .tbl.cards td.r { text-align: left; }
  .modal-back { place-items: end center; padding: 0; }
  .modal { width: 100%; max-height: 92vh; border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
  .modal-foot .btn { flex: 1; }
  .dock { left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); align-items: stretch; }
  .dock-item { max-width: none; }
  .sess .row-acts { width: 100%; justify-content: flex-start; }
  .toasts { left: 12px; right: 12px; top: calc(12px + env(safe-area-inset-top)); max-width: none; }
  .input, select.input { font-size: 16px; } /* iOS не зумит поле при фокусе */
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
