/* ═══════════════════════════════════════════════════════════════
   STOLB — design system
   Графитовая тема с тёплым янтарным акцентом. Без внешних зависимостей.
   Бренд: монохромный логотип-надпись, "O" — светящаяся опора (web/stolb-logo.svg).
   ═══════════════════════════════════════════════════════════════ */

:root {
  --bg: #17191e;
  --bg-deep: #121419;
  --surface: #1e2127;
  --surface-2: #252931;
  --surface-3: #2e333c;
  --border: #31363f;
  --border-soft: #282c34;
  --text: #e9ebee;
  --text-sub: #a9aeb8;
  --text-muted: #7f848f;
  --accent: #e8833a;
  --accent-hover: #f29b5b;
  --accent-dim: rgba(232, 131, 58, 0.14);
  --cyan: #f2b04d; /* вторичный тёплый: live-индикаторы, градиенты */
  --ok: #34d399;
  --ok-dim: rgba(52, 211, 153, 0.14);
  --warn: #fbbf24;
  --warn-dim: rgba(251, 191, 36, 0.14);
  --err: #f87171;
  --err-dim: rgba(248, 113, 113, 0.14);
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.42);
  --sidebar-w: 236px;
  --mono: "SF Mono", "Cascadia Code", ui-monospace, Menlo, Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(232, 131, 58, 0.05), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(242, 176, 77, 0.04), transparent 60%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

::selection { background: rgba(232, 131, 58, 0.35); }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #2c3550; }

/* ═══ Login ═══════════════════════════════════════════════════ */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: linear-gradient(180deg, rgba(232, 131, 58, 0.05), transparent 30%), var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 36px 32px;
  box-shadow: var(--shadow);
}

.login-logo { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 28px; }
.login-logo .name { font-size: 22px; font-weight: 700; letter-spacing: 0.3px; }
.login-logo .sub { font-size: 12px; color: var(--text-muted); margin-top: -8px; }

.login-error {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--err);
  background: var(--err-dim);
  border: 1px solid rgba(248, 113, 113, 0.25);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  min-height: 0;
  display: none;
}
.login-error.show { display: block; }

.login-hint { margin-top: 18px; font-size: 11.5px; color: var(--text-muted); text-align: center; }

/* ═══ Logo ═══════════════════════════════════════════════════ */

.logo-mark {
  width: 40px; height: 40px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(232, 131, 58, 0.22), rgba(242, 176, 77, 0.12));
  border: 1px solid rgba(232, 131, 58, 0.35);
}
.logo-mark svg { display: block; }
.logo-mark.sm { width: 30px; height: 30px; border-radius: 9px; }
.logo-mark.sm svg { width: 17px; height: 17px; }
/* STOLB-вариант: чёрная плитка + светящаяся опора (белый глиф "O") */
.logo-mark.stolb {
  background: #0A0A0A;
  border-color: #2e333c;
}
.logo-mark.stolb svg { width: 22px; height: 22px; }
.logo-mark.sm.stolb svg { width: 19px; height: 19px; }
/* Полный логотип на карточке входа */
.login-logo .brand-svg { width: 300px; max-width: 76vw; height: auto; display: block; }
/* Логотип в сайдбаре — сам является надписью (вьюбокс 1200×424 ≈ 2.83:1) */
.sidebar .brand .brand-svg-sm { width: 124px; height: auto; display: block; }

/* ═══ App layout ═════════════════════════════════════════════ */

.app { display: none; min-height: 100vh; }
.app.active { display: flex; }

.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-deep) 100%);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar .brand {
  display: flex; align-items: center; gap: 11px;
  padding: 15px 18px 13px;
  border-bottom: 1px solid var(--border-soft);
}
.sidebar .brand .name { font-weight: 700; font-size: 15px; letter-spacing: 0.2px; }
.sidebar .brand .name small { display: block; font-weight: 500; font-size: 10.5px; color: var(--text-muted); letter-spacing: 0.6px; text-transform: uppercase; }

.nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav .nav-group { margin-bottom: 4px; }
.nav .nav-label {
  font-size: 10px; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase;
  color: var(--text-muted); padding: 14px 12px 6px;
}
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px;
  margin-bottom: 2px;
  color: var(--text-sub);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  border-left: 2px solid transparent;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.nav a svg { width: 17px; height: 17px; flex: none; opacity: 0.75; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active {
  background: var(--accent-dim);
  color: var(--accent-hover);
  border-left-color: var(--accent);
}
.nav a.active svg { opacity: 1; }
.nav .nav-count {
  margin-left: auto;
  font-size: 10.5px; font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-3);
  border-radius: 9px; padding: 1px 7px;
}

.sidebar .foot {
  padding: 12px 14px;
  border-top: 1px solid var(--border-soft);
  display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 32px; height: 32px; flex: none; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  color: #fff; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.foot .who { flex: 1; min-width: 0; }
.foot .who .email { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.foot .who .role { font-size: 10.5px; color: var(--text-muted); text-transform: capitalize; }
.foot .icon-btn { flex: none; }

/* Main column */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 28px;
  background: rgba(11, 14, 20, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}
.topbar h1 { font-size: 17px; font-weight: 700; letter-spacing: 0.2px; }
.topbar .spacer { flex: 1; }

.health-pills { display: flex; gap: 8px; }
.hpill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600;
  color: var(--text-sub);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 11px;
  cursor: default;
}
.hpill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); }
.hpill.up .dot { background: var(--ok); box-shadow: 0 0 6px rgba(52, 211, 153, 0.7); }
.hpill.down .dot { background: var(--err); }
.hpill.unknown .dot { background: var(--warn); }

.content { padding: 24px 28px 60px; max-width: 1460px; width: 100%; }

.section { display: none; }
.section.active { display: block; animation: fadein 0.18s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.section-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px; flex-wrap: wrap;
}
.section-head .sub { color: var(--text-muted); font-size: 12.5px; }
.section-head .spacer { flex: 1; }

/* ═══ Cards / KPI ═════════════════════════════════════════════ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 18px;
}
.card.tight { padding: 14px 16px; }
.card-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.card-head h2 { font-size: 14px; font-weight: 700; letter-spacing: 0.2px; }
.card-head .hint { font-size: 11.5px; color: var(--text-muted); }
.card-head .spacer { flex: 1; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: var(--accent);
}
.kpi.k-ok::before { background: var(--ok); }
.kpi.k-warn::before { background: var(--warn); }
.kpi.k-cyan::before { background: var(--cyan); }
.kpi .k-label { font-size: 11px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-muted); }
.kpi .k-value { font-size: 26px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .k-value small { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.kpi .k-extra { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }
.dash-grid .card { margin-bottom: 0; }
@media (max-width: 1080px) { .dash-grid { grid-template-columns: 1fr; } }

/* ═══ Buttons ═════════════════════════════════════════════════ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 15px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px; font-weight: 600;
  font-family: inherit;
  transition: background 0.12s, border-color 0.12s, transform 0.05s;
  white-space: nowrap;
}
.btn:hover { background: #2a3349; border-color: #313c58; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn svg { width: 15px; height: 15px; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ok { background: transparent; border-color: rgba(52, 211, 153, 0.5); color: var(--ok); }
.btn-ok:hover { background: var(--ok-dim); border-color: var(--ok); }
.btn-warn { background: transparent; border-color: rgba(251, 191, 36, 0.5); color: var(--warn); }
.btn-warn:hover { background: var(--warn-dim); border-color: var(--warn); }
.btn-danger { background: transparent; border-color: rgba(248, 113, 113, 0.5); color: var(--err); }
.btn-danger:hover { background: var(--err-dim); border-color: var(--err); }
.btn-danger-solid { background: var(--err); border-color: var(--err); color: #fff; }
.btn-danger-solid:hover { background: #fb8f8f; border-color: #fb8f8f; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-sub); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn-sm svg { width: 13px; height: 13px; }
.btn-icon { padding: 6px; border-radius: 7px; }
.btn-block { width: 100%; }

.icon-btn {
  background: transparent; border: none; color: var(--text-muted);
  cursor: pointer; padding: 6px; border-radius: 7px; display: inline-flex;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 16px; height: 16px; }

/* ═══ Forms ═══════════════════════════════════════════════════ */

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; font-weight: 600; color: var(--text-sub); }
.field .help { font-size: 11px; color: var(--text-muted); }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

input, select, textarea {
  background: var(--bg-deep);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  width: 100%;
  transition: border-color 0.12s, box-shadow 0.12s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 131, 58, 0.18);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input[type="checkbox"] { width: auto; accent-color: var(--accent); }
input[type="datetime-local"] { color-scheme: dark; }
textarea { resize: vertical; min-height: 70px; }

.check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-sub); cursor: pointer; user-select: none; }

/* ═══ Tables ═══════════════════════════════════════════════════ */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase;
  white-space: nowrap;
}
td { padding: 9px 10px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.1s; }
tbody tr:hover { background: rgba(232, 131, 58, 0.05); }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: rgba(232, 131, 58, 0.09); }

td .mono, .mono { font-family: var(--mono); font-size: 12px; }
.cell-sub { display: block; font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.num { font-variant-numeric: tabular-nums; }

.empty-row { text-align: center; color: var(--text-muted); padding: 26px 10px !important; font-size: 12.5px; }

/* ═══ Badges / pills ═════════════════════════════════════════ */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700;
  border-radius: 20px;
  padding: 2.5px 10px;
  letter-spacing: 0.3px;
  text-transform: capitalize;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-online, .badge-completed, .badge-delivered, .badge-active { background: var(--ok-dim); color: var(--ok); }
.badge-offline, .badge-failed, .badge-error { background: var(--err-dim); color: var(--err); }
.badge-auth_wait, .badge-pending, .badge-cancelled { background: var(--warn-dim); color: var(--warn); }
.badge-neutral { background: var(--surface-3); color: var(--text-sub); }
.badge-info { background: var(--accent-dim); color: var(--accent-hover); }

.badge.plain::before { display: none; }

.rssi { display: inline-flex; align-items: center; gap: 7px; font-variant-numeric: tabular-nums; }
.rssi .bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.rssi .bars i { width: 3px; border-radius: 1px; background: var(--surface-3); }
.rssi .bars i.on { background: var(--ok); }
.rssi .bars i:nth-child(1) { height: 4px; }
.rssi .bars i:nth-child(2) { height: 7px; }
.rssi .bars i:nth-child(3) { height: 10px; }
.rssi .bars i:nth-child(4) { height: 13px; }
.rssi.weak .bars i.on { background: var(--err); }
.rssi.mid .bars i.on { background: var(--warn); }

/* ═══ Progress ═══════════════════════════════════════════════ */

.progress {
  background: var(--bg-deep);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  height: 8px;
  overflow: hidden;
  position: relative;
}
.progress-bar {
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  transition: width 0.4s ease;
}
.progress-bar.failed { background: var(--err); }
.progress-bar.done { background: var(--ok); }
.progress-bar.stalled { background: var(--warn); animation: pulse 1.4s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

.progress-cell { min-width: 150px; }
.progress-cell .progress { margin-bottom: 4px; }
.progress-cell .pct { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* ═══ Skeleton / loading ═════════════════════════════════════ */

.skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
  height: 14px;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.loading-block { color: var(--text-muted); font-size: 12.5px; text-align: center; padding: 22px 0; }

.spinner {
  width: 15px; height: 15px; flex: none;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══ Toasts ═════════════════════════════════════════════════ */

#toasts {
  position: fixed; right: 20px; bottom: 20px; z-index: 300;
  display: flex; flex-direction: column; gap: 10px;
  max-width: 380px;
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  font-size: 13px;
  animation: toast-in 0.22s ease;
}
.toast.t-ok { border-left-color: var(--ok); }
.toast.t-err { border-left-color: var(--err); }
.toast.t-warn { border-left-color: var(--warn); }
.toast .t-msg { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast .t-title { font-weight: 700; font-size: 12.5px; margin-bottom: 2px; }
@keyframes toast-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.toast.out { opacity: 0; transform: translateX(24px); transition: 0.25s; }

/* ═══ Modal ═══════════════════════════════════════════════════ */

.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(4, 6, 12, 0.66);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fadein 0.15s ease;
}
.modal {
  width: 100%; max-width: 480px;
  max-height: 88vh; overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.modal.m-lg { max-width: 620px; }
.modal-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-soft);
}
.modal-head h3 { font-size: 15px; font-weight: 700; }
.modal-head .spacer { flex: 1; }
.modal-body { padding: 18px 20px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border-soft);
}
.modal-foot .left { margin-right: auto; }

/* ═══ Drawer (endpoint detail) ═══════════════════════════════ */

.drawer-overlay {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(4, 6, 12, 0.55);
  animation: fadein 0.15s ease;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 160;
  width: min(560px, 94vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  animation: slide-in 0.22s ease;
}
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-soft);
}
.drawer-head h3 { font-size: 15px; font-weight: 700; }
.drawer-head .sub { font-size: 11.5px; color: var(--text-muted); font-family: var(--mono); }
.drawer-head .spacer { flex: 1; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs button {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 13px; font-weight: 600;
  font-family: inherit;
  padding: 8px 14px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--accent-hover); border-bottom-color: var(--accent); }

/* ═══ Misc ═══════════════════════════════════════════════════ */

.kv-grid { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; font-size: 12.5px; }
.kv-grid dt { color: var(--text-muted); }
.kv-grid dd { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.pre {
  background: var(--bg-deep);
  border: 1px solid var(--border-soft);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 11.5px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 260px;
  overflow-y: auto;
  color: var(--text-sub);
}

.log-list { display: flex; flex-direction: column; gap: 6px; font-family: var(--mono); font-size: 11.5px; }
.log-list .log-line { padding: 7px 10px; background: var(--bg-deep); border-radius: 6px; color: var(--text-sub); overflow-wrap: anywhere; }
.log-line .ok { color: var(--ok); }
.log-line .err { color: var(--err); }
.log-line .dim { color: var(--text-muted); }

.muted { color: var(--text-muted); }
.small { font-size: 11.5px; }
.hidden { display: none !important; }
.mt { margin-top: 14px; }
.flex { display: flex; gap: 10px; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.right { margin-left: auto; }

.dropzone {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 26px 18px;
  text-align: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-size: 13px;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-dim); color: var(--text); }
.dropzone .dz-icon { font-size: 26px; margin-bottom: 8px; }
.dropzone .dz-file { color: var(--cyan); font-family: var(--mono); font-size: 12px; margin-top: 6px; }

.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-sub);
  font-size: 12px; font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-family: inherit;
}
.chip:hover { color: var(--text); }
.chip.active { background: var(--accent-dim); border-color: rgba(232, 131, 58, 0.5); color: var(--accent-hover); }

.spark { display: block; width: 100%; height: 64px; }
.spark path { fill: none; stroke-width: 1.8; }
.spark .grid { stroke: var(--border-soft); stroke-width: 1; }

.multi-select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-deep);
  max-height: 190px;
  overflow-y: auto;
  padding: 6px;
}
.multi-select .ms-item {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 8px; border-radius: 6px;
  cursor: pointer; font-size: 13px;
}
.multi-select .ms-item:hover { background: var(--surface-2); }
.multi-select .ms-item.off { opacity: 0.42; }
.ms-item .ms-status { margin-left: auto; }

.playhead {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 12px;
  color: var(--cyan);
}
.playhead .eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.playhead .eq i { width: 3px; background: var(--cyan); border-radius: 1px; animation: eq 0.9s infinite ease-in-out; }
.playhead .eq i:nth-child(1) { height: 6px; }
.playhead .eq i:nth-child(2) { height: 12px; animation-delay: 0.15s; }
.playhead .eq i:nth-child(3) { height: 8px; animation-delay: 0.3s; }
@keyframes eq { 0%, 100% { transform: scaleY(0.5); } 50% { transform: scaleY(1.15); } }

/* Mobile */
@media (max-width: 860px) {
  .sidebar {
    position: fixed; z-index: 120; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .sidebar.open { transform: none; box-shadow: var(--shadow); }
  .content { padding: 18px 14px 60px; }
  .topbar { padding: 12px 14px; }
  .menu-btn { display: inline-flex !important; }
  .health-pills { display: none; }
}
.menu-btn { display: none; }

/* Overlay for mobile sidebar */
.scrim { position: fixed; inset: 0; background: rgba(4, 6, 12, 0.55); z-index: 110; }

/* ═════════════════════════════════════════════════════════════ */

/* Карта объектов на дашборде (схематическая, без внешних тайлов) */
.map-box {
  position: relative;
  background: var(--bg-deep);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.map-box svg { display: block; width: 100%; height: 360px; }
.map-empty {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: var(--text-muted); font-size: 12.5px;
  text-align: center; padding: 20px;
}
.map-legend {
  display: flex; gap: 14px; flex-wrap: wrap;
  font-size: 11px; color: var(--text-muted);
  align-items: center;
}
.map-legend .lg { display: inline-flex; align-items: center; gap: 5px; }
.map-legend .sw { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

.mk-label {
  font-size: 10.5px; fill: var(--text-sub);
  paint-order: stroke; stroke: var(--bg-deep); stroke-width: 3px;
  font-weight: 600;
}
.mk-label.gw { fill: var(--text-muted); font-weight: 500; }
.mk-label.sub { fill: var(--text-muted); font-size: 9px; font-style: italic; }

@keyframes mk-pulse { from { opacity: 0.65; r: 8; } to { opacity: 0; r: 16; } }
.mk-pulse { animation: mk-pulse 1.8s ease-out infinite; fill: none; stroke-width: 2px; }
@keyframes mk-pulse-err { from { opacity: 0.6; r: 8; } to { opacity: 0; r: 15; } }
.mk-pulse-err { animation: mk-pulse-err 1.4s ease-out infinite; fill: none; stroke-width: 2px; }

.map-marker { cursor: pointer; }
.map-marker:hover .mk-halo { opacity: 0.25; }
.mk-halo { opacity: 0; transition: opacity 0.15s; }
